ember-cli 4.9.0 → 4.10.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # ember-cli Changelog
2
2
 
3
+ ## v4.10.0-beta.0
4
+
5
+ #### Blueprint Changes
6
+
7
+ - [`ember new` diff](https://github.com/ember-cli/ember-new-output/compare/v4.9.0...v4.10.0-beta.0)
8
+ - [`ember addon` diff](https://github.com/ember-cli/ember-addon-output/compare/v4.9.0...v4.10.0-beta.0)
9
+
10
+ #### Changelog
11
+
12
+ - [#10048](https://github.com/ember-cli/ember-cli/pull/10048) Make addAddonsToProject support creating a new project with custom target directory [@simonihmig](https://github.com/simonihmig)
13
+ - [#10054](https://github.com/ember-cli/ember-cli/pull/10054) [ENHANCEMENT] Conditionally apply ESLint parser options in `app` and `addon` blueprints [@Windvis](https://github.com/Windvis)
14
+ - [#10056](https://github.com/ember-cli/ember-cli/pull/10056) [INTERNAL] Use `eslint-plugin-n` instead of `eslint-plugin-node` [@bertdeblock](https://github.com/bertdeblock)
15
+ - [#10060](https://github.com/ember-cli/ember-cli/pull/10060) [ENHANCEMENT] Replace `eslint-plugin-node` with `eslint-plugin-n` in blueprints [@Windvis](https://github.com/Windvis)
16
+ - [#10062](https://github.com/ember-cli/ember-cli/pull/10062) [ENHANCEMENT] Update Prettier config in blueprints to only use single quotes for `.js` and `.ts` files [@Windvis](https://github.com/Windvis)
17
+
18
+ Thank you to all who took the time to contribute!
19
+
3
20
  ## v4.9.0
4
21
 
5
22
  #### Blueprint Changes
@@ -4,11 +4,11 @@ module.exports = {
4
4
  root: true,
5
5
  parser: '<%= typescript ? '@typescript-eslint/parser' : 'babel-eslint' %>',
6
6
  parserOptions: {
7
- ecmaVersion: 2018,
7
+ ecmaVersion: 2018,<% if (!typescript) { %>
8
8
  sourceType: 'module',
9
9
  ecmaFeatures: {
10
10
  legacyDecorators: true,
11
- },
11
+ },<% } %>
12
12
  },
13
13
  plugins: ['ember'<% if (typescript) { %>, '@typescript-eslint'<% } %>],
14
14
  extends: [
@@ -45,20 +45,14 @@ module.exports = {
45
45
  './server/**/*.js',<% } else { %>
46
46
  './tests/dummy/config/**/*.js',<% } %>
47
47
  ],
48
- parserOptions: {
48
+ <% if (!typescript) { %> parserOptions: {
49
49
  sourceType: 'script',
50
50
  },
51
- env: {
51
+ <% } %> env: {
52
52
  browser: false,
53
53
  node: true,
54
54
  },
55
- plugins: ['node'],
56
- extends: ['plugin:node/recommended'],<% if (blueprint === 'app') {%>
57
- rules: {
58
- // this can be removed once the following is fixed
59
- // https://github.com/mysticatea/eslint-plugin-node/issues/77
60
- 'node/no-unpublished-require': 'off',
61
- },<% } %>
55
+ extends: ['plugin:n/recommended'],
62
56
  },
63
57
  {
64
58
  // test files
@@ -1,5 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  module.exports = {
4
- singleQuote: true,
4
+ overrides: [
5
+ {
6
+ files: '*.{js,ts}',
7
+ options: {
8
+ singleQuote: true,
9
+ },
10
+ },
11
+ ],
5
12
  };
@@ -45,19 +45,19 @@
45
45
  "ember-cli-inject-live-reload": "^2.1.0",
46
46
  "ember-cli-sri": "^2.1.1",
47
47
  "ember-cli-terser": "^4.0.2",
48
- "ember-data": "~4.9.1",
48
+ "ember-data": "~4.10.0-beta.2",
49
49
  "ember-fetch": "^8.1.2",
50
50
  "ember-load-initializers": "^2.1.2",
51
51
  "ember-page-title": "^7.0.0",
52
52
  "ember-qunit": "^6.0.0",
53
53
  "ember-resolver": "^8.0.3",
54
- "ember-source": "~4.9.1",
54
+ "ember-source": "~4.10.0-beta.2",
55
55
  "ember-template-lint": "^5.2.0<% if (welcome) { %>",
56
56
  "ember-welcome-page": "^6.2.0<% } %>",
57
57
  "eslint": "^7.32.0",
58
58
  "eslint-config-prettier": "^8.5.0",
59
59
  "eslint-plugin-ember": "^11.2.1",
60
- "eslint-plugin-node": "^11.1.0",
60
+ "eslint-plugin-n": "^15.6.0",
61
61
  "eslint-plugin-prettier": "^4.2.1",
62
62
  "eslint-plugin-qunit": "^7.3.4",
63
63
  "loader.js": "^4.7.0",
@@ -3,7 +3,7 @@
3
3
  "logo": "https://ember-cli.com/assets/images/ember-cli-logo-small-dark.png",
4
4
  "name": "ember-cli",
5
5
  "description": "Command line tool for developing ambitious ember.js apps",
6
- "version": "4.9.0-release-f420b7f917"
6
+ "version": "4.10.0-beta.0-beta-0fcb3a31a0"
7
7
  },
8
8
  "files": {
9
9
  "lib/broccoli/default-packager.js": {
@@ -4600,7 +4600,7 @@
4600
4600
  },
4601
4601
  {
4602
4602
  "file": "lib/models/blueprint.js",
4603
- "line": 1344,
4603
+ "line": 1356,
4604
4604
  "description": "Used to retrieve a task with the given name. Passes the new task\nthe standard information available (like `ui`, `analytics`, `project`, etc).",
4605
4605
  "itemtype": "method",
4606
4606
  "name": "taskFor",
@@ -4617,7 +4617,7 @@
4617
4617
  },
4618
4618
  {
4619
4619
  "file": "lib/models/blueprint.js",
4620
- "line": 1362,
4620
+ "line": 1374,
4621
4621
  "description": "Inserts the given content into a file. If the `contentsToInsert` string is already\npresent in the current contents, the file will not be changed unless `force` option\nis passed.\n\nIf `options.before` is specified, `contentsToInsert` will be inserted before\nthe first instance of that string. If `options.after` is specified, the\ncontents will be inserted after the first instance of that string.\nIf the string specified by options.before or options.after is not in the file,\nno change will be made.\n\nIf neither `options.before` nor `options.after` are present, `contentsToInsert`\nwill be inserted at the end of the file.\n\nExample:\n```\n// app/router.js\nRouter.map(function () {\n});\n```\n\n```\ninsertIntoFile('app/router.js', ' this.route(\"admin\");', {\n after: 'Router.map(function () {' + EOL\n}).then(function() {\n // file has been inserted into!\n});\n\n\n```\n\n```\n// app/router.js\nRouter.map(function () {\n this.route(\"admin\");\n});\n```",
4622
4622
  "itemtype": "method",
4623
4623
  "name": "insertIntoFile",
@@ -4647,7 +4647,7 @@
4647
4647
  },
4648
4648
  {
4649
4649
  "file": "lib/models/blueprint.js",
4650
- "line": 1466,
4650
+ "line": 1478,
4651
4651
  "description": "Used to retrieve a blueprint with the given name.",
4652
4652
  "itemtype": "method",
4653
4653
  "name": "lookupBlueprint",
@@ -4669,7 +4669,7 @@
4669
4669
  },
4670
4670
  {
4671
4671
  "file": "lib/models/blueprint.js",
4672
- "line": 1483,
4672
+ "line": 1495,
4673
4673
  "static": 1,
4674
4674
  "itemtype": "method",
4675
4675
  "name": "lookup",
@@ -4716,7 +4716,7 @@
4716
4716
  },
4717
4717
  {
4718
4718
  "file": "lib/models/blueprint.js",
4719
- "line": 1532,
4719
+ "line": 1544,
4720
4720
  "description": "Loads a blueprint from given path.",
4721
4721
  "static": 1,
4722
4722
  "itemtype": "method",
@@ -4744,7 +4744,7 @@
4744
4744
  },
4745
4745
  {
4746
4746
  "file": "lib/models/blueprint.js",
4747
- "line": 1560,
4747
+ "line": 1572,
4748
4748
  "static": 1,
4749
4749
  "itemtype": "method",
4750
4750
  "name": "list",
@@ -4774,7 +4774,7 @@
4774
4774
  },
4775
4775
  {
4776
4776
  "file": "lib/models/blueprint.js",
4777
- "line": 1609,
4777
+ "line": 1621,
4778
4778
  "description": "Files that are renamed when installed into the target directory.\nThis allows including files in the blueprint that would have an effect\non another process, such as a file named `.gitignore`.\n\nThe keys are the filenames used in the files folder.\nThe values are the filenames used in the target directory.",
4779
4779
  "static": 1,
4780
4780
  "itemtype": "property",
@@ -4785,7 +4785,7 @@
4785
4785
  },
4786
4786
  {
4787
4787
  "file": "lib/models/blueprint.js",
4788
- "line": 1624,
4788
+ "line": 1636,
4789
4789
  "static": 1,
4790
4790
  "itemtype": "property",
4791
4791
  "name": "ignoredFiles",
@@ -4795,7 +4795,7 @@
4795
4795
  },
4796
4796
  {
4797
4797
  "file": "lib/models/blueprint.js",
4798
- "line": 1630,
4798
+ "line": 1642,
4799
4799
  "static": 1,
4800
4800
  "itemtype": "property",
4801
4801
  "name": "ignoredUpdateFiles",
@@ -4805,7 +4805,7 @@
4805
4805
  },
4806
4806
  {
4807
4807
  "file": "lib/models/blueprint.js",
4808
- "line": 1636,
4808
+ "line": 1648,
4809
4809
  "static": 1,
4810
4810
  "itemtype": "property",
4811
4811
  "name": "defaultLookupPaths",
@@ -4815,7 +4815,7 @@
4815
4815
  },
4816
4816
  {
4817
4817
  "file": "lib/models/blueprint.js",
4818
- "line": 1644,
4818
+ "line": 1656,
4819
4819
  "access": "private",
4820
4820
  "tagname": "",
4821
4821
  "itemtype": "method",
@@ -4837,7 +4837,7 @@
4837
4837
  },
4838
4838
  {
4839
4839
  "file": "lib/models/blueprint.js",
4840
- "line": 1657,
4840
+ "line": 1669,
4841
4841
  "access": "private",
4842
4842
  "tagname": "",
4843
4843
  "itemtype": "method",
@@ -4855,7 +4855,7 @@
4855
4855
  },
4856
4856
  {
4857
4857
  "file": "lib/models/blueprint.js",
4858
- "line": 1668,
4858
+ "line": 1680,
4859
4859
  "access": "private",
4860
4860
  "tagname": "",
4861
4861
  "itemtype": "method",
@@ -4873,7 +4873,7 @@
4873
4873
  },
4874
4874
  {
4875
4875
  "file": "lib/models/blueprint.js",
4876
- "line": 1677,
4876
+ "line": 1689,
4877
4877
  "access": "private",
4878
4878
  "tagname": "",
4879
4879
  "itemtype": "method",
@@ -4900,7 +4900,7 @@
4900
4900
  },
4901
4901
  {
4902
4902
  "file": "lib/models/blueprint.js",
4903
- "line": 1691,
4903
+ "line": 1703,
4904
4904
  "access": "private",
4905
4905
  "tagname": "",
4906
4906
  "itemtype": "method",
@@ -4922,7 +4922,7 @@
4922
4922
  },
4923
4923
  {
4924
4924
  "file": "lib/models/blueprint.js",
4925
- "line": 1703,
4925
+ "line": 1715,
4926
4926
  "description": "Combines provided lookup paths with defaults and removes\nduplicates.",
4927
4927
  "access": "private",
4928
4928
  "tagname": "",
@@ -4945,7 +4945,7 @@
4945
4945
  },
4946
4946
  {
4947
4947
  "file": "lib/models/blueprint.js",
4948
- "line": 1718,
4948
+ "line": 1730,
4949
4949
  "description": "Looks for a __path__ token in the files folder. Must be present for\nthe blueprint to support pod tokens.",
4950
4950
  "access": "private",
4951
4951
  "tagname": "",
@@ -4968,7 +4968,7 @@
4968
4968
  },
4969
4969
  {
4970
4970
  "file": "lib/models/blueprint.js",
4971
- "line": 1757,
4971
+ "line": 1769,
4972
4972
  "access": "private",
4973
4973
  "tagname": "",
4974
4974
  "itemtype": "method",
@@ -4990,7 +4990,7 @@
4990
4990
  },
4991
4991
  {
4992
4992
  "file": "lib/models/blueprint.js",
4993
- "line": 1771,
4993
+ "line": 1783,
4994
4994
  "access": "private",
4995
4995
  "tagname": "",
4996
4996
  "itemtype": "method",
@@ -5012,7 +5012,7 @@
5012
5012
  },
5013
5013
  {
5014
5014
  "file": "lib/models/blueprint.js",
5015
- "line": 1781,
5015
+ "line": 1793,
5016
5016
  "access": "private",
5017
5017
  "tagname": "",
5018
5018
  "itemtype": "method",
@@ -5027,7 +5027,7 @@
5027
5027
  },
5028
5028
  {
5029
5029
  "file": "lib/models/blueprint.js",
5030
- "line": 1794,
5030
+ "line": 1806,
5031
5031
  "access": "private",
5032
5032
  "tagname": "",
5033
5033
  "itemtype": "method",
@@ -1319,6 +1319,7 @@ let Blueprint = CoreObject.extend({
1319
1319
  let installText = packages.length > 1 ? 'install addons' : 'install addon';
1320
1320
  this._writeStatusToUI(chalk.green, installText, taskOptions['packages'].join(', '));
1321
1321
 
1322
+ let previousCwd;
1322
1323
  if (!this.project.isEmberCLIProject()) {
1323
1324
  // our blueprint ran *outside* an ember-cli project. So the only way this
1324
1325
  // makes sense if the blueprint generated a new project, which we're now
@@ -1332,13 +1333,24 @@ let Blueprint = CoreObject.extend({
1332
1333
  this.project.packageInfoCache._clear();
1333
1334
  const Project = require('../../lib/models/project');
1334
1335
  this.project = taskOptions.blueprintOptions.project = Project.closestSync(
1335
- this.project.root,
1336
+ options.blueprintOptions.target,
1336
1337
  this.project.ui,
1337
1338
  this.project.cli
1338
1339
  );
1340
+
1341
+ // The install task adds dependencies based on the current working directory.
1342
+ // But in case we created the new project by calling the blueprint with a custom target directory (options.target),
1343
+ // the current directory will *not* be the one the project is created in, so we must adjust this here.
1344
+ previousCwd = process.cwd();
1345
+ process.chdir(options.blueprintOptions.target);
1346
+ }
1347
+
1348
+ let result = this.taskFor('addon-install').run(taskOptions);
1349
+ if (previousCwd) {
1350
+ return result.then(() => process.chdir(previousCwd));
1339
1351
  }
1340
1352
 
1341
- return this.taskFor('addon-install').run(taskOptions);
1353
+ return result;
1342
1354
  },
1343
1355
 
1344
1356
  /**
@@ -190,7 +190,7 @@ let Command = CoreObject.extend({
190
190
  } else {
191
191
  // interrupt all external commands which don't use `runTask()` with an error
192
192
 
193
- // eslint-disable-next-line no-process-exit
193
+ // eslint-disable-next-line n/no-process-exit
194
194
  process.exit(1);
195
195
  }
196
196
  },
@@ -15,7 +15,7 @@ class Task extends CoreObject {
15
15
  * @method onInterrupt
16
16
  */
17
17
  onInterrupt() {
18
- // eslint-disable-next-line no-process-exit
18
+ // eslint-disable-next-line n/no-process-exit
19
19
  process.exit(1);
20
20
  }
21
21
  }
@@ -22,7 +22,6 @@ module.exports = async function (dir) {
22
22
 
23
23
  let buildFileUrl = url.pathToFileURL(buildFilePath);
24
24
  try {
25
- // eslint-disable-next-line node/no-unsupported-features/es-syntax
26
25
  let fn = (await import(buildFileUrl)).default;
27
26
  return fn;
28
27
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-cli",
3
- "version": "4.9.0",
3
+ "version": "4.10.0-beta.0",
4
4
  "description": "Command line tool for developing ambitious ember.js apps",
5
5
  "keywords": [
6
6
  "app",
@@ -37,7 +37,7 @@
37
37
  "test:slow": "node --unhandled-rejections=strict tests/runner slow"
38
38
  },
39
39
  "dependencies": {
40
- "@babel/core": "^7.19.3",
40
+ "@babel/core": "^7.19.6",
41
41
  "@babel/plugin-transform-modules-amd": "^7.18.6",
42
42
  "amd-name-resolver": "^1.3.1",
43
43
  "babel-plugin-module-resolver": "^4.1.0",
@@ -61,7 +61,7 @@
61
61
  "calculate-cache-key-for-tree": "^2.0.0",
62
62
  "capture-exit": "^2.0.0",
63
63
  "chalk": "^4.1.2",
64
- "ci-info": "^3.4.0",
64
+ "ci-info": "^3.5.0",
65
65
  "clean-base-url": "^1.0.0",
66
66
  "compression": "^1.7.4",
67
67
  "configstore": "^5.0.1",
@@ -93,7 +93,7 @@
93
93
  "heimdalljs-graph": "^1.0.0",
94
94
  "heimdalljs-logger": "^0.1.10",
95
95
  "http-proxy": "^1.18.1",
96
- "inflection": "^1.13.1",
96
+ "inflection": "^1.13.4",
97
97
  "inquirer": "^8.2.1",
98
98
  "is-git-url": "^1.0.0",
99
99
  "is-language-code": "^3.1.0",
@@ -134,7 +134,7 @@
134
134
  },
135
135
  "devDependencies": {
136
136
  "@ember/edition-utils": "^1.2.0",
137
- "@octokit/rest": "^19.0.4",
137
+ "@octokit/rest": "^19.0.5",
138
138
  "broccoli-plugin": "^4.0.3",
139
139
  "broccoli-test-helper": "^2.0.0",
140
140
  "chai": "^4.3.6",
@@ -147,7 +147,7 @@
147
147
  "eslint-config-prettier": "^8.5.0",
148
148
  "eslint-plugin-chai-expect": "^3.0.0",
149
149
  "eslint-plugin-mocha": "^10.1.0",
150
- "eslint-plugin-node": "^11.1.0",
150
+ "eslint-plugin-n": "^15.3.0",
151
151
  "eslint-plugin-prettier": "^4.2.1",
152
152
  "fixturify": "^2.1.0",
153
153
  "jsdom": "^20.0.0",
@@ -159,7 +159,7 @@
159
159
  "release-it": "^15.4.2",
160
160
  "rimraf": "^3.0.2",
161
161
  "strip-ansi": "^6.0.0",
162
- "supertest": "^6.2.4",
162
+ "supertest": "^6.3.1",
163
163
  "testdouble": "^3.16.6",
164
164
  "tmp": "^0.2.1",
165
165
  "websocket": "^1.0.32",
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- // eslint-disable-next-line node/no-unpublished-require
3
+ // eslint-disable-next-line n/no-unpublished-require
4
4
  const expect = require('chai').expect;
5
5
  const semver = require('semver');
6
6
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
- // eslint-disable-next-line node/no-unpublished-require
5
+ // eslint-disable-next-line n/no-unpublished-require
6
6
  const jsdom = require('jsdom');
7
7
  const { AssertionError } = require('assert');
8
8
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- /* eslint-disable node/no-unpublished-require */
3
+ // eslint-disable-next-line n/no-unpublished-require
4
4
  const which = require('which');
5
5
 
6
6
  module.exports = which.sync('yarn', { nothrow: true });
@@ -4,8 +4,6 @@ const Project = require('../../lib/models/project');
4
4
  const Instrumentation = require('../../lib/models/instrumentation');
5
5
  const MockUI = require('console-ui/mock');
6
6
 
7
- // eslint-disable-next-line node/no-unpublished-require
8
-
9
7
  class MockProject extends Project {
10
8
  constructor(options = {}) {
11
9
  let root = options.root || process.cwd();
@@ -1,8 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const chalk = require('chalk');
4
-
5
- // eslint-disable-next-line node/no-unpublished-require
4
+ // eslint-disable-next-line n/no-unpublished-require
6
5
  const stripAnsi = require('strip-ansi');
7
6
 
8
7
  module.exports = function (helpString) {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const http = require('http');
4
- /* eslint-disable node/no-unpublished-require */
4
+ // eslint-disable-next-line n/no-unpublished-require
5
5
  const WebSocketServer = require('websocket').server;
6
6
 
7
7
  class ProxyServer {