Skip to content

Commit 87d9d24

Browse files
authored
Merge pull request #1280 from pichfl/mainmatter/give-up
Warn users trying to upgrade past 6.7.0 - i.e. don't auto upgrade them to Vite
2 parents 758510a + fecc7d0 commit 87d9d24

2 files changed

Lines changed: 67 additions & 1 deletion

File tree

docs/upgrading-past-6-7.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Upgrading your Ember project past 6.7
2+
3+
`[email protected]` is the first release to publish the default app blueprint as
4+
its own package [@ember-tooling/classic-build-app-blueprint][npm].
5+
6+
[npm]: https://www.npmjs.com/package/@ember-tooling/classic-build-app-blueprint
7+
8+
Starting with `[email protected]`, creating an Ember application will use the new
9+
Vite-based blueprint and build process.
10+
11+
## Moving to the new classic app blueprint
12+
13+
If you want to stay with the classic build process, you will need to update
14+
`config/ember-cli-update.json` and replace the base blueprint:
15+
16+
```diff
17+
@@ -2,13 +2,11 @@
18+
{
19+
"schemaVersion": "1.0.0",
20+
"packages": [
21+
{
22+
- "name": "ember-cli",
23+
- "version": "6.7.0",
24+
+ "name": "@ember-tooling/classic-build-app-blueprint",
25+
+ "version": "6.7.1",
26+
"blueprints": [
27+
{
28+
- "name": "app",
29+
- "outputRepo": "https://github.com/ember-cli/ember-new-output",
30+
- "codemodsSource": "ember-app-codemods-manifest@1",
31+
+ "name": "@ember-tooling/classic-build-app-blueprint",
32+
"isBaseBlueprint": true,
33+
"options": [
34+
"--ci-provider=github"
35+
]
36+
}
37+
]
38+
}
39+
]
40+
}
41+
```
42+
43+
Re-run `ember-cli-update` after that.
44+
45+
## Moving to Vite
46+
47+
Use [ember-vite-codemod][mod] to upgrade your project.
48+
49+
[mod]: https://github.com/mainmatter/ember-vite-codemod/

src/index.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@ const getBaseBlueprint = require('./get-base-blueprint');
2020
const chooseBlueprintUpdates = require('./choose-blueprint-updates');
2121
const getBlueprintFilePath = require('./get-blueprint-file-path');
2222
const resolvePackage = require('./resolve-package');
23-
const { defaultTo } = require('./constants');
23+
const {
24+
defaultTo,
25+
defaultPackageName,
26+
defaultAppBlueprintName
27+
} = require('./constants');
2428
const normalizeBlueprintArgs = require('./normalize-blueprint-args');
29+
const semver = require('semver');
2530

2631
/**
2732
* If `version` attribute exists in the `blueprint` object and URL is empty, skip. Otherwise resolve the details of
@@ -211,6 +216,18 @@ module.exports = async function emberCliUpdate({
211216
let versions = await getVersions(packageName);
212217
let getTagVersion = _getTagVersion(versions, packageName);
213218
endBlueprint.version = await getTagVersion(to);
219+
220+
if (
221+
packageName === defaultPackageName &&
222+
endBlueprint.name === defaultAppBlueprintName &&
223+
semver.gte(endBlueprint.version, '6.8.0')
224+
) {
225+
console.log(
226+
`You cannot use ember-cli-update to automatically upgrade past 6.7. Read the following documentation to find out how to proceed: https://github.com/ember-cli/ember-cli-update/blob/master/docs/upgrading-past-6-7-0.md `
227+
);
228+
229+
process.exit(1);
230+
}
214231
}
215232

216233
let customDiffOptions = getStartAndEndCommands({

0 commit comments

Comments
 (0)