ember-cli 6.10.0-alpha.1 → 6.10.0-beta.1

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.
Files changed (66) hide show
  1. package/CHANGELOG.md +131 -219
  2. package/CONTRIBUTING.md +30 -34
  3. package/README.md +9 -21
  4. package/RELEASE.md +11 -9
  5. package/bin/ember +16 -13
  6. package/blueprints/addon-import/index.js +4 -4
  7. package/docs/build/data.json +9 -9
  8. package/lib/broccoli/ember-app.js +1 -1
  9. package/lib/commands/generate.js +1 -1
  10. package/lib/commands/init.js +1 -1
  11. package/lib/commands/new.js +1 -1
  12. package/lib/commands/test.js +0 -3
  13. package/lib/commands/unknown.js +1 -1
  14. package/lib/debug/deprecate.js +1 -1
  15. package/lib/models/asset-size-printer.js +3 -3
  16. package/lib/models/blueprint.js +6 -6
  17. package/lib/models/builder.js +1 -1
  18. package/lib/models/command.js +2 -2
  19. package/lib/models/hardware-info.js +5 -2
  20. package/lib/models/instrumentation.js +2 -2
  21. package/lib/models/project.js +3 -3
  22. package/lib/models/watcher.js +1 -1
  23. package/lib/models/worker.js +2 -2
  24. package/lib/tasks/addon-install.js +1 -1
  25. package/lib/tasks/build-watch.js +2 -2
  26. package/lib/tasks/build.js +1 -1
  27. package/lib/tasks/git-init.js +2 -2
  28. package/lib/tasks/install-blueprint.js +1 -1
  29. package/lib/tasks/interactive-new.js +5 -5
  30. package/lib/tasks/npm-task.js +2 -2
  31. package/lib/tasks/serve.js +1 -1
  32. package/lib/tasks/server/express-server.js +1 -1
  33. package/lib/tasks/test-server.js +1 -1
  34. package/lib/utilities/find-build-file.js +2 -2
  35. package/lib/utilities/get-lang-arg.js +4 -4
  36. package/lib/utilities/heimdall-progress.js +5 -2
  37. package/lib/utilities/lint-fix.js +1 -1
  38. package/lib/utilities/markdown-color.js +1 -1
  39. package/lib/utilities/print-command.js +1 -1
  40. package/lib/utilities/require-as-hash.js +10 -8
  41. package/lib/utilities/windows-admin.js +1 -1
  42. package/package.json +60 -55
  43. package/packages/addon-blueprint/additional-package.json +1 -3
  44. package/packages/addon-blueprint/index.js +1 -1
  45. package/packages/addon-blueprint/package.json +5 -5
  46. package/packages/app-blueprint/files/package.json +9 -9
  47. package/packages/app-blueprint/index.js +1 -1
  48. package/packages/app-blueprint/package.json +5 -5
  49. package/tests/helpers/acceptance.js +1 -1
  50. package/tests/helpers/command-generator.js +2 -2
  51. package/tests/helpers/package-cache.js +1 -1
  52. package/tests/helpers/process-help-string.js +3 -3
  53. package/tests/helpers/run-command.js +1 -1
  54. package/lib/utilities/execa.js +0 -20
  55. package/packages/blueprint-blueprint/files/blueprints/__name__/files/.gitkeep +0 -0
  56. package/packages/blueprint-blueprint/files/blueprints/__name__/index.js +0 -16
  57. package/packages/blueprint-blueprint/index.js +0 -5
  58. package/packages/blueprint-blueprint/package.json +0 -13
  59. package/packages/blueprint-model/package.json +0 -19
  60. package/packages/blueprint-model/utilities/directory-for-package-name.js +0 -31
  61. package/packages/blueprint-model/utilities/edit-file-diff.js +0 -64
  62. package/packages/blueprint-model/utilities/experiments.js +0 -63
  63. package/packages/blueprint-model/utilities/file-info.js +0 -170
  64. package/packages/blueprint-model/utilities/open-editor.js +0 -44
  65. package/packages/blueprint-model/utilities/prepend-emoji.js +0 -12
  66. package/packages/blueprint-model/utilities/process-template.js +0 -10
package/README.md CHANGED
@@ -1,5 +1,4 @@
1
- ember-cli
2
- ==============================================================================
1
+ # ember-cli
3
2
 
4
3
  [![Latest npm release][npm-badge]][npm-badge-url]
5
4
  [![GitHub Actions CI][github-actions-badge]][github-actions-ci-url]
@@ -18,9 +17,7 @@ ember-cli
18
17
 
19
18
  The Ember.js command line utility.
20
19
 
21
-
22
- Features
23
- ------------------------------------------------------------------------------
20
+ ## Features
24
21
 
25
22
  - Asset build pipeline using [Broccoli.js](https://broccoli.build/)
26
23
  - ES6 transpilation using [Babel](https://babeljs.io/)
@@ -31,16 +28,13 @@ Features
31
28
  [Testem](https://github.com/testem/testem)
32
29
  - Powerful addon system for extensibility
33
30
 
34
-
35
- Installation
36
- ------------------------------------------------------------------------------
31
+ ## Installation
37
32
 
38
33
  ```
39
34
  npm install -g ember-cli
40
35
  ```
41
36
 
42
- Usage
43
- ------------------------------------------------------------------------------
37
+ ## Usage
44
38
 
45
39
  After installation the `ember` CLI tool will be available to you. It is the
46
40
  entrypoint for all the functionality mentioned above.
@@ -49,26 +43,20 @@ You can call `ember <command> --help` to find out more about [all of the
49
43
  following commands](https://cli.emberjs.com/release/basic-use/cli-commands/) or visit <https://cli.emberjs.com/release/> to read
50
44
  the in-depth documentation.
51
45
 
46
+ ## Documentation
52
47
 
53
- Documentation
54
- ------------------------------------------------------------------------------
55
48
  Please refer to the [CLI guides](https://cli.emberjs.com/release/) for help using Ember CLI.
56
49
 
57
- Contributing
58
- ------------------------------------------------------------------------------
59
- Please see the [contributing guidelines](https://github.com/ember-cli/ember-cli/blob/master/CONTRIBUTING.md)
50
+ ## Contributing
60
51
 
52
+ Please see the [contributing guidelines](https://github.com/ember-cli/ember-cli/blob/master/CONTRIBUTING.md)
61
53
 
62
- Community
63
- ------------------------------------------------------------------------------
54
+ ## Community
64
55
 
65
56
  - Discord: [Get your invite](https://discord.gg/emberjs)
66
57
  - Issues: [ember-cli/issues](https://github.com/ember-cli/ember-cli/issues)
67
58
  - Documentation: [cli.emberjs.com](https://cli.emberjs.com/release/)
68
59
 
69
-
70
-
71
- License
72
- ------------------------------------------------------------------------------
60
+ ## License
73
61
 
74
62
  This project is licensed under the [MIT License](LICENSE).
package/RELEASE.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  `ember-cli` follows the same channel based release process that Ember does:
4
4
 
5
- * `release` - This branch represents the `latest` dist-tag on NPM
6
- * `beta` - This branch represents the `beta` dist-tag on NPM
7
- * `master` - The branch represents the `alpha` dist-tag on NPM
5
+ - `release` - This branch represents the `latest` dist-tag on NPM
6
+ - `beta` - This branch represents the `beta` dist-tag on NPM
7
+ - `master` - The branch represents the `alpha` dist-tag on NPM
8
8
 
9
9
  Most changes should be made as a PR that targets the `master` branch and then makes their way through `beta` and `release` over the course of 12 weeks as part of the Ember release train. Generally speaking we do not backport functional changes to `beta` or `release` but we can if needs be.
10
10
 
@@ -30,7 +30,6 @@ This makes sure that you are starting from a "clean slate" before doing any othe
30
30
 
31
31
  You can use [this saved search](https://github.com/ember-cli/ember-cli/pulls?q=is%3Apr+is%3Aopen+Prepare) to find any outstanding `Prepare Release` branches.
32
32
 
33
-
34
33
  ### Initial Stable Release from the `release` branch
35
34
 
36
35
  - fetch latest from origin `git fetch`
@@ -45,7 +44,7 @@ You can use [this saved search](https://github.com/ember-cli/ember-cli/pulls?q=i
45
44
  - make sure to not update the version in the package.json during this step, this will be release-plan's job
46
45
  - make sure to not update the version in the `packages/app-blueprint/package.json`, or `packages/addon-blueprint/package.json` files during this step, this will be release-plan's job
47
46
  - make sure to not add the `release-plan` config section to the package.json during this step. We are releasing a real release so we don't want to configure release-plan to do a pre-release.
48
- - Update blueprint dependencies to latest. Note: ember-data needs to be updated only in the alpha version from now on, make sure to only update to the release version of what was in the beta.
47
+ - Update blueprint dependencies to latest. Note: ember-data needs to be updated only in the alpha version from now on, make sure to only update to the release version of what was in the beta.
49
48
 
50
49
  ```
51
50
  node ./dev/update-blueprint-dependencies.js --ember-source=latest --ember-data=<whatever version was in the beta>
@@ -99,17 +98,19 @@ You can use [this saved search](https://github.com/ember-cli/ember-cli/pulls?q=i
99
98
  - Merge the `Prepare Beta Release` when you are ready to release the next beta version
100
99
  - Check the `Release Beta` GitHub action to make sure the release succeeded
101
100
 
102
-
103
101
  ### Alpha release from the `master` branch
104
102
 
105
103
  - fetch latest from origin `git fetch`
106
104
  - create a new branch to merge `beta` into `master` e.g. `git checkout --no-track -b merge-beta origin/master`
107
105
  - merge beta into this new branch e.g. `git merge origin/beta --no-ff`
108
106
  - **make sure to not update the .release-plan file** this should only ever be changed by the release-plan github scripts
107
+ - make sure to not update the version in the package.json during this step, that step comes later
109
108
  - make sure to not update the `release-plan` config section to the `package.json`, `packages/addon-blueprint/package.json`, or `packages/app-blueprint/package.json`, during this step.
109
+ - make sure not to update the `@ember-tooling/blueprint-blueprint` or `@ember-tooling/blueprint-model` away from being `workspace: *` dependencies. On master they always use the latest and don't use semver.
110
110
  - **make sure to not update any .github/workflows/plan-release.yml file** this should still plan a beta release
111
111
  - **make sure to not update any .github/workflows/publish.yml file** this should still publish a beta release
112
112
  - **make sure to not update the CHANGELOG.md file** in this step.
113
+ - **make sure not to delete any package files** they exist on master but not on either the release or beta branches
113
114
  - commit this merge
114
115
  - manually update the version in `package.json` to be the next alpha.
115
116
  - e.g. if the current alpha is `"version": "6.6.0-alpha.3",` update it to be `"version": "6.7.0-alpha.0",`
@@ -119,10 +120,12 @@ You can use [this saved search](https://github.com/ember-cli/ember-cli/pulls?q=i
119
120
  - Update blueprint dependencies to alpha
120
121
 
121
122
  ```
122
- node ./dev/update-blueprint-dependencies.js --ember-source=alpha --ember-data=latest
123
+ node ./dev/update-blueprint-dependencies.js --ember-source=alpha --ember-data=<whatever version is in the package.json>
123
124
  ```
124
125
 
126
+ - note: ember-data (aka warp-drive) should only ever be updated on master as a separate PR. It is no longer part of the release process
125
127
  - update the @ember/app-blueprint dependency `pnpm i -w @ember/app-blueprint@alpha`
128
+ - make sure the app-blueprint still has a `~` after the above step
126
129
  - commit this update `git commit -am "update blueprint dependencies to alpha"`
127
130
  - push and open a PR targeting `master` with a PR title like `Prepare 6.6-alpha`
128
131
  - mark this PR as an `enchancement` if the next alpha is a minor release
@@ -132,7 +135,6 @@ You can use [this saved search](https://github.com/ember-cli/ember-cli/pulls?q=i
132
135
  - Merge the `Prepare Alpha Release` when you are ready to release the next alpha version
133
136
  - Check the `Release Alpha` GitHub action to make sure the release succeeded
134
137
 
135
-
136
138
  ## Changelog updates
137
139
 
138
140
  `release-plan` is designed to automatically generate a Changelog that includes the titles of every PR that was merged since the last release. As we would like to make use of this auto-generated Changelog we need to make sure that PRs are named correctly and the Changelog included in the "Prepare Release" PRs are what we were expecting.
@@ -143,7 +145,6 @@ If you want to change the content of the Changelog then you should update the PR
143
145
 
144
146
  Now that we're using release-plan for all releases, patch releases have become super easy! Every time you merge a PR to any branch that is being released with `release-plan` a new `Prepare Release` PR will be created. When you merge this `Prepare Release` branch it will automatically release the new Patch version.
145
147
 
146
-
147
148
  ## Post-release Automation
148
149
 
149
150
  There is a GitHub Actions workflow, https://github.com/ember-cli/ember-cli/actions/workflows/sync-output-repos.yml that pushes various invocations of the blueprint generator to "output repos".
@@ -161,6 +162,7 @@ Both of these have a git-tag per release version
161
162
  Multiple editors could be supported, but right now, we only "customize" for stackblitz.
162
163
 
163
164
  https://github.com/ember-cli/editor-output/
165
+
164
166
  - [a branch for each scenario + release version](https://github.com/ember-cli/editor-output/branches/active)
165
167
  - `${editorName}-{addon,app}-output{-'typescript'?}{-version}`
166
168
  - and the "latest release" (non beta) will not have a version at the end
package/bin/ember CHANGED
@@ -19,9 +19,9 @@ logger.info('Resolving "ember-cli" from %j...', basedir);
19
19
  var projectLocalCli;
20
20
  try {
21
21
  projectLocalCli = resolve.sync('ember-cli', {
22
- basedir: basedir
22
+ basedir: basedir,
23
23
  });
24
- } catch(ignored) {}
24
+ } catch (ignored) {}
25
25
 
26
26
  logger.info('Resolved "ember-cli" to %j', projectLocalCli);
27
27
 
@@ -35,14 +35,17 @@ cli({
35
35
  cliArgs: process.argv.slice(2),
36
36
  inputStream: process.stdin,
37
37
  outputStream: process.stdout,
38
- errorStream: process.stderr
39
- }).then(function(result) {
40
- var exit = require('exit');
41
- var exitCode = typeof result === 'object' ? result.exitCode : result;
42
-
43
- logger.info('Quitting "ember-cli" with exit code: %j', exitCode);
44
- exit(exitCode);
45
- }, function(err) {
46
- console.log(err);
47
- process.exit(-1);
48
- });
38
+ errorStream: process.stderr,
39
+ }).then(
40
+ function (result) {
41
+ var exit = require('exit');
42
+ var exitCode = typeof result === 'object' ? result.exitCode : result;
43
+
44
+ logger.info('Quitting "ember-cli" with exit code: %j', exitCode);
45
+ exit(exitCode);
46
+ },
47
+ function (err) {
48
+ console.log(err);
49
+ process.exit(-1);
50
+ }
51
+ );
@@ -2,7 +2,7 @@
2
2
 
3
3
  const stringUtil = require('ember-cli-string-utils');
4
4
  const path = require('path');
5
- const inflector = require('inflection');
5
+ const { pluralize } = require('inflection');
6
6
  const SilentError = require('silent-error');
7
7
 
8
8
  module.exports = {
@@ -26,7 +26,7 @@ module.exports = {
26
26
  if (options.pod && options.hasPathToken) {
27
27
  return path.join(options.podPath, options.dasherizedModuleName);
28
28
  }
29
- return inflector.pluralize(options.locals.blueprintName);
29
+ return pluralize(options.locals.blueprintName);
30
30
  },
31
31
  __root__(options) {
32
32
  if (options.inRepoAddon) {
@@ -45,11 +45,11 @@ module.exports = {
45
45
  let addonName = stringUtil.dasherize(addonRawName);
46
46
  let fileName = stringUtil.dasherize(options.entity.name);
47
47
  let blueprintName = options.originBlueprintName;
48
- let modulePathSegments = [addonName, inflector.pluralize(options.originBlueprintName), fileName];
48
+ let modulePathSegments = [addonName, pluralize(options.originBlueprintName), fileName];
49
49
 
50
50
  if (/-addon/.test(blueprintName)) {
51
51
  blueprintName = blueprintName.substr(0, blueprintName.indexOf('-addon'));
52
- modulePathSegments = [addonName, inflector.pluralize(blueprintName), fileName];
52
+ modulePathSegments = [addonName, pluralize(blueprintName), fileName];
53
53
  }
54
54
 
55
55
  if (options.pod) {
@@ -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": "6.10.0-alpha.1-master-51bed22cb7"
6
+ "version": "6.10.0-beta.1-beta-93c2f53aa6"
7
7
  },
8
8
  "files": {
9
9
  "lib/broccoli/default-packager.js": {
@@ -5516,7 +5516,7 @@
5516
5516
  },
5517
5517
  {
5518
5518
  "file": "lib/models/hardware-info.js",
5519
- "line": 232,
5519
+ "line": 235,
5520
5520
  "description": "Indicates whether the host is running on battery power. This can cause\nperformance degredation.",
5521
5521
  "access": "private",
5522
5522
  "tagname": "",
@@ -5538,7 +5538,7 @@
5538
5538
  },
5539
5539
  {
5540
5540
  "file": "lib/models/hardware-info.js",
5541
- "line": 266,
5541
+ "line": 269,
5542
5542
  "description": "Determines the amount of swap/virtual memory currently in use.",
5543
5543
  "access": "private",
5544
5544
  "tagname": "",
@@ -5560,7 +5560,7 @@
5560
5560
  },
5561
5561
  {
5562
5562
  "file": "lib/models/hardware-info.js",
5563
- "line": 297,
5563
+ "line": 300,
5564
5564
  "description": "Determines the total amount of memory available to the host, as from\n`os.totalmem`.",
5565
5565
  "access": "private",
5566
5566
  "tagname": "",
@@ -5575,7 +5575,7 @@
5575
5575
  },
5576
5576
  {
5577
5577
  "file": "lib/models/hardware-info.js",
5578
- "line": 309,
5578
+ "line": 312,
5579
5579
  "description": "Determines the amount of memory currently being used by the current Node\nprocess, as from `process.memoryUsage`.",
5580
5580
  "access": "private",
5581
5581
  "tagname": "",
@@ -5590,7 +5590,7 @@
5590
5590
  },
5591
5591
  {
5592
5592
  "file": "lib/models/hardware-info.js",
5593
- "line": 322,
5593
+ "line": 325,
5594
5594
  "description": "Determines the number of logical processors available to the host, as from\n`os.cpus`.",
5595
5595
  "access": "private",
5596
5596
  "tagname": "",
@@ -5605,7 +5605,7 @@
5605
5605
  },
5606
5606
  {
5607
5607
  "file": "lib/models/hardware-info.js",
5608
- "line": 334,
5608
+ "line": 337,
5609
5609
  "description": "Determines the average processor load across the system. This is\nexpressed as a fractional number between 0 and the number of logical\nprocessors.",
5610
5610
  "access": "private",
5611
5611
  "tagname": "",
@@ -5627,7 +5627,7 @@
5627
5627
  },
5628
5628
  {
5629
5629
  "file": "lib/models/hardware-info.js",
5630
- "line": 358,
5630
+ "line": 361,
5631
5631
  "description": "Gets the speed of the host's processors.\n\nIf more than one processor is found, the average of their speeds is taken.",
5632
5632
  "access": "private",
5633
5633
  "tagname": "",
@@ -5642,7 +5642,7 @@
5642
5642
  },
5643
5643
  {
5644
5644
  "file": "lib/models/hardware-info.js",
5645
- "line": 373,
5645
+ "line": 376,
5646
5646
  "description": "Determines the time since the host was started, as from `os.uptime`.",
5647
5647
  "access": "private",
5648
5648
  "tagname": "",
@@ -6,7 +6,7 @@
6
6
  const fs = require('fs');
7
7
  const path = require('path');
8
8
  const p = require('ember-cli-preprocess-registry/preprocessors');
9
- const chalk = require('chalk');
9
+ const { default: chalk } = require('chalk');
10
10
  const resolve = require('resolve');
11
11
 
12
12
  const { assert } = require('../debug');
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const path = require('path');
4
- const chalk = require('chalk');
4
+ const { default: chalk } = require('chalk');
5
5
  const Command = require('../models/command');
6
6
  const Blueprint = require('../models/blueprint');
7
7
  const mergeBlueprintOptions = require('../utilities/merge-blueprint-options');
@@ -4,7 +4,7 @@ const clone = require('lodash/clone');
4
4
  const merge = require('lodash/merge');
5
5
  const Command = require('../models/command');
6
6
  const SilentError = require('silent-error');
7
- const chalk = require('chalk');
7
+ const { default: chalk } = require('chalk');
8
8
  const isValidProjectName = require('../utilities/valid-project-name');
9
9
  const normalizeBlueprint = require('../utilities/normalize-blueprint-option');
10
10
  const mergeBlueprintOptions = require('../utilities/merge-blueprint-options');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const chalk = require('chalk');
3
+ const { default: chalk } = require('chalk');
4
4
  const Command = require('../models/command');
5
5
  const Project = require('../models/project');
6
6
  const SilentError = require('silent-error');
@@ -90,9 +90,6 @@ module.exports = Command.extend({
90
90
  this.availableOptions = this.availableOptions.concat(ClassicOptions);
91
91
  }
92
92
 
93
- // Make sure Testem supports the Wasm MIME type:
94
- require('express').static.mime.define({ 'application/wasm': ['wasm'] });
95
-
96
93
  this.Builder = this.Builder || Builder;
97
94
  this.Watcher = this.Watcher || Watcher;
98
95
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  const Command = require('../models/command');
4
4
  const SilentError = require('silent-error');
5
- const chalk = require('chalk');
5
+ const { default: chalk } = require('chalk');
6
6
 
7
7
  module.exports = Command.extend({
8
8
  skipHelp: true,
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const chalk = require('chalk');
3
+ const { default: chalk } = require('chalk');
4
4
  const semver = require('semver');
5
5
  const assert = require('./assert');
6
6
  const emberCLIVersion = require('../../package').version;
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const chalk = require('chalk');
3
+ const { default: chalk } = require('chalk');
4
4
  const path = require('path');
5
5
  const walkSync = require('walk-sync');
6
- const workerpool = require('workerpool');
6
+ const { pool: workerPool } = require('workerpool');
7
7
 
8
8
  module.exports = class AssetPrinterSize {
9
9
  constructor(options) {
@@ -52,7 +52,7 @@ module.exports = class AssetPrinterSize {
52
52
  let testFileRegex = /(test-(loader|support))|(testem)/i;
53
53
 
54
54
  // create a dedicated worker
55
- const pool = workerpool.pool(`${__dirname}/worker.js`);
55
+ const pool = workerPool(`${__dirname}/worker.js`);
56
56
 
57
57
  try {
58
58
  let assets = files
@@ -4,15 +4,15 @@
4
4
  @module ember-cli
5
5
  */
6
6
  const FileInfo = require('@ember-tooling/blueprint-model/utilities/file-info');
7
- const chalk = require('chalk');
7
+ const { default: chalk } = require('chalk');
8
8
  const MarkdownColor = require('../utilities/markdown-color');
9
9
  const sequence = require('../utilities/sequence');
10
10
  const printCommand = require('../utilities/print-command');
11
11
  const insertIntoFile = require('../utilities/insert-into-file');
12
12
  const cleanRemove = require('../utilities/clean-remove');
13
13
  const fs = require('fs-extra');
14
- const inflector = require('inflection');
15
- const minimatch = require('minimatch');
14
+ const { pluralize } = require('inflection');
15
+ const { minimatch } = require('minimatch');
16
16
  const path = require('path');
17
17
  const stringUtils = require('ember-cli-string-utils');
18
18
  const merge = require('lodash/merge');
@@ -547,7 +547,7 @@ let Blueprint = CoreObject.extend({
547
547
  let strippedCode = code;
548
548
  for (let i = 0; i < templateTagMatches.length; i++) {
549
549
  const match = templateTagMatches[i];
550
- const templateTag = substringBytes(code, match.range.start, match.range.end);
550
+ const templateTag = substringBytes(code, match.range.startByte, match.range.endByte);
551
551
  if (match.type === 'class-member') {
552
552
  strippedCode = strippedCode.replace(templateTag, replacementClassMember(i));
553
553
  } else {
@@ -562,7 +562,7 @@ let Blueprint = CoreObject.extend({
562
562
  let transformedWithTemplateTag = transformed;
563
563
  for (let i = 0; i < templateTagMatches.length; i++) {
564
564
  const match = templateTagMatches[i];
565
- const templateTag = substringBytes(code, match.range.start, match.range.end);
565
+ const templateTag = substringBytes(code, match.range.startByte, match.range.endByte);
566
566
  if (match.type === 'class-member') {
567
567
  transformedWithTemplateTag = transformedWithTemplateTag.replace(replacementClassMember(i), templateTag);
568
568
  } else {
@@ -745,7 +745,7 @@ let Blueprint = CoreObject.extend({
745
745
  if (options.pod && options.hasPathToken) {
746
746
  return path.join(options.podPath, options.dasherizedModuleName);
747
747
  }
748
- return inflector.pluralize(blueprintName);
748
+ return pluralize(blueprintName);
749
749
  },
750
750
  __root__(options) {
751
751
  if (options.inRepoAddon) {
@@ -4,7 +4,7 @@ const fs = require('fs-extra');
4
4
  const path = require('path');
5
5
  const CoreObject = require('core-object');
6
6
  const SilentError = require('silent-error');
7
- const chalk = require('chalk');
7
+ const { default: chalk } = require('chalk');
8
8
  const findBuildFile = require('../utilities/find-build-file');
9
9
  const _resetTreeCache = require('./addon')._resetTreeCache;
10
10
  const Sync = require('tree-sync');
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const nopt = require('nopt');
4
- const chalk = require('chalk');
4
+ const { default: chalk } = require('chalk');
5
5
  const path = require('path');
6
6
  const isGitRepo = require('is-git-url');
7
7
  const camelize = require('ember-cli-string-utils').camelize;
@@ -312,7 +312,7 @@ let Command = CoreObject.extend({
312
312
 
313
313
  let options = commandOptions.options;
314
314
 
315
- if (this.hasOption('watcher')) {
315
+ if (this.hasOption('watcher') || process.env.EMBROIDER_PREBUILD) {
316
316
  // Do stuff to try and provide a good experience when it comes to file watching:
317
317
  let watchPreference = detector.findBestWatcherOption(options);
318
318
 
@@ -1,10 +1,13 @@
1
1
  'use strict';
2
2
 
3
- const execa = require('execa');
3
+ const { execaSync } = require('execa');
4
4
  const fs = require('fs');
5
5
  const logger = require('heimdalljs-logger')('ember-cli:hardware-info');
6
6
  const os = require('os');
7
7
 
8
+ // For testing purposes:
9
+ const execa = { sync: execaSync };
10
+
8
11
  function isUsingBatteryAcpi() {
9
12
  try {
10
13
  const { stdout } = execa.sync('acpi', ['--ac-adapter']);
@@ -382,4 +385,4 @@ const hwinfo = {
382
385
  },
383
386
  };
384
387
 
385
- module.exports = hwinfo;
388
+ module.exports = { execa, hwinfo };
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  const fs = require('fs-extra');
4
- const chalk = require('chalk');
4
+ const { default: chalk } = require('chalk');
5
5
  const heimdallGraph = require('heimdalljs-graph');
6
6
  const getConfig = require('../utilities/get-config');
7
7
  const utilsInstrumentation = require('../utilities/instrumentation');
8
8
  const logger = require('heimdalljs-logger')('ember-cli:instrumentation');
9
- const hwinfo = require('./hardware-info');
9
+ const { hwinfo } = require('./hardware-info');
10
10
 
11
11
  let vizEnabled = utilsInstrumentation.vizEnabled;
12
12
  let instrumentationEnabled = utilsInstrumentation.instrumentationEnabled;
@@ -5,7 +5,7 @@
5
5
  */
6
6
  const util = require('util');
7
7
  const path = require('path');
8
- const findup = require('find-up');
8
+ const { findUpSync } = require('find-up');
9
9
  const resolve = util.promisify(require('resolve'));
10
10
  const fs = require('fs-extra');
11
11
  const cloneDeep = require('lodash/cloneDeep');
@@ -717,7 +717,7 @@ class Project {
717
717
  @return {String} The project root directory
718
718
  */
719
719
  static getProjectRoot() {
720
- let packagePath = findup.sync('package.json');
720
+ let packagePath = findUpSync('package.json');
721
721
  if (!packagePath) {
722
722
  logger.info('getProjectRoot: not found. Will use cwd: %s', process.cwd());
723
723
  return process.cwd();
@@ -777,7 +777,7 @@ function ensureUI(_ui) {
777
777
  }
778
778
 
779
779
  function findupPath(pathName) {
780
- let pkgPath = findup.sync('package.json', { cwd: pathName });
780
+ let pkgPath = findUpSync('package.json', { cwd: pathName });
781
781
  if (!pkgPath) {
782
782
  throw new NotFoundError(`No project found at or up from: \`${pathName}\``);
783
783
  }
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const chalk = require('chalk');
3
+ const { default: chalk } = require('chalk');
4
4
  const logger = require('heimdalljs-logger')('ember-cli:watcher');
5
5
  const CoreObject = require('core-object');
6
6
  const serveURL = require('../utilities/get-serve-url');
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const workerpool = require('workerpool');
3
+ const { worker } = require('workerpool');
4
4
  const gzipStats = require('./gzipStats');
5
5
 
6
6
  // create worker and register public functions
7
- workerpool.worker({
7
+ worker({
8
8
  gzipStats,
9
9
  });
@@ -14,7 +14,7 @@ class AddonInstallTask extends Task {
14
14
  }
15
15
 
16
16
  run(options) {
17
- const chalk = require('chalk');
17
+ const { default: chalk } = require('chalk');
18
18
  let ui = this.ui;
19
19
  let packageNames = options.packages || [];
20
20
  let blueprintOptions = options.blueprintOptions || {};
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- const chalk = require('chalk');
3
+ const { default: chalk } = require('chalk');
4
4
  const path = require('path');
5
5
  const Task = require('../models/task');
6
6
  const Watcher = require('../models/watcher');
7
7
  const Builder = require('../models/builder');
8
- const pDefer = require('p-defer');
8
+ const { default: pDefer } = require('p-defer');
9
9
 
10
10
  class BuildWatchTask extends Task {
11
11
  constructor(options) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const chalk = require('chalk');
3
+ const { default: chalk } = require('chalk');
4
4
  const Task = require('../models/task');
5
5
  const Builder = require('../models/builder');
6
6
 
@@ -4,12 +4,12 @@ const Task = require('../models/task');
4
4
  const path = require('path');
5
5
  const pkg = require('../../package.json');
6
6
  const fs = require('fs');
7
- const execa = require('../utilities/execa');
7
+ const { execa } = require('execa');
8
8
 
9
9
  module.exports = class GitInitTask extends Task {
10
10
  async run(_commandOptions) {
11
11
  let commandOptions = _commandOptions || {};
12
- const chalk = require('chalk');
12
+ const { default: chalk } = require('chalk');
13
13
  let ui = this.ui;
14
14
 
15
15
  if (commandOptions.skipGit) {
@@ -7,7 +7,7 @@ const util = require('util');
7
7
  const temp = require('temp');
8
8
  const path = require('path');
9
9
  const merge = require('lodash/merge');
10
- const execa = require('../utilities/execa');
10
+ const { execa } = require('execa');
11
11
  const SilentError = require('silent-error');
12
12
  const npa = require('npm-package-arg');
13
13
  const lintFix = require('../utilities/lint-fix');