ember-cli 5.7.0 → 5.8.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,23 @@
1
1
  # ember-cli Changelog
2
2
 
3
+ ## v5.8.0
4
+
5
+ #### Blueprint Changes
6
+
7
+ - [`ember new` diff](https://github.com/ember-cli/ember-new-output/compare/v5.7.0...v5.8.0)
8
+ - [`ember addon` diff](https://github.com/ember-cli/ember-addon-output/compare/v5.7.0...v5.8.0)
9
+
10
+ #### Changelog
11
+
12
+ - [#10418](https://github.com/ember-cli/ember-cli/pull/10418) [ENHANCEMENT] Use `content-tag` to parse GTS in blueprints [@IgnaceMaes](https://github.com/IgnaceMaes)
13
+ - [#10432](https://github.com/ember-cli/ember-cli/pull/10432) Filter out tsconfig.declarations.json correctly [@bendemboski](https://github.com/bendemboski)
14
+ - [#10436](https://github.com/ember-cli/ember-cli/pull/10436) stop using wyvox/action-setup-pnpm [@mansona](https://github.com/mansona)
15
+ - [#10437](https://github.com/ember-cli/ember-cli/pull/10437) [ENHANCEMENT] Update LTS scenarios in `addon` blueprint [@bertdeblock](https://github.com/bertdeblock)
16
+ - [#10438](https://github.com/ember-cli/ember-cli/pull/10438) [ENHANCEMENT] Add `declarations` folder to `.eslintignore` file in `app` blueprint [@bertdeblock](https://github.com/bertdeblock)
17
+ - [#10439](https://github.com/ember-cli/ember-cli/pull/10439) [ENHANCEMENT] Add tsconfig files to `.npmignore` file in `addon` blueprint [@bertdeblock](https://github.com/bertdeblock)
18
+
19
+ Thank you to all who took the time to contribute!
20
+
3
21
  ## v5.7.0
4
22
 
5
23
  #### Blueprint Changes
@@ -19,16 +19,16 @@ jobs:
19
19
 
20
20
  steps:
21
21
  - uses: actions/checkout@v3<% if (pnpm) { %>
22
- - uses: wyvox/action-setup-pnpm@v2
22
+ - uses: pnpm/action-setup@v2
23
23
  with:
24
- node-version: 18<% } else { %>
24
+ version: 8<% } %>
25
25
  - name: Install Node
26
26
  uses: actions/setup-node@v3
27
27
  with:
28
28
  node-version: 18
29
- cache: <%= yarn ? 'yarn' : 'npm' %>
29
+ cache: <%= pnpm ? 'pnpm' : yarn ? 'yarn' : 'npm' %>
30
30
  - name: Install Dependencies
31
- run: <%= yarn ? 'yarn install --frozen-lockfile' : 'npm ci' %><% } %>
31
+ run: <%= pnpm ? 'pnpm install --frozen-lockfile' : yarn ? 'yarn install --frozen-lockfile' : 'npm ci' %>
32
32
  - name: Lint
33
33
  run: <%= pnpm ? 'pnpm' : yarn ? 'yarn' : 'npm run' %> lint
34
34
  - name: Run Tests
@@ -41,16 +41,15 @@ jobs:
41
41
 
42
42
  steps:
43
43
  - uses: actions/checkout@v3<% if (pnpm) { %>
44
- - uses: wyvox/action-setup-pnpm@v2
44
+ - uses: pnpm/action-setup@v2
45
45
  with:
46
- node-version: 18
47
- args: '--no-lockfile'<% } else { %>
46
+ version: 8<% } %>
48
47
  - uses: actions/setup-node@v3
49
48
  with:
50
49
  node-version: 18
51
- cache: <%= yarn ? 'yarn' : 'npm' %>
50
+ cache: <%= pnpm ? 'pnpm' : yarn ? 'yarn' : 'npm' %>
52
51
  - name: Install Dependencies
53
- run: <%= yarn ? 'yarn install --no-lockfile' : 'npm install --no-shrinkwrap' %><% } %>
52
+ run: <%= pnpm ? 'pnpm install --no-lockfile' : yarn ? 'yarn install --no-lockfile' : 'npm install --no-shrinkwrap' %>
54
53
  - name: Run Tests
55
54
  run: <%= pnpm ? 'pnpm' : yarn ? 'yarn' : 'npm run' %> test:ember
56
55
 
@@ -64,8 +63,8 @@ jobs:
64
63
  fail-fast: false
65
64
  matrix:
66
65
  try-scenario:
67
- - ember-lts-4.8
68
66
  - ember-lts-4.12
67
+ - ember-lts-5.4
69
68
  - ember-release
70
69
  - ember-beta
71
70
  - ember-canary
@@ -74,15 +73,15 @@ jobs:
74
73
 
75
74
  steps:
76
75
  - uses: actions/checkout@v3<% if (pnpm) { %>
77
- - uses: wyvox/action-setup-pnpm@v2
76
+ - uses: pnpm/action-setup@v2
78
77
  with:
79
- node-version: 18<% } else { %>
78
+ version: 8<% } %>
80
79
  - name: Install Node
81
80
  uses: actions/setup-node@v3
82
81
  with:
83
82
  node-version: 18
84
- cache: <%= yarn ? 'yarn' : 'npm' %>
83
+ cache: <%= pnpm ? 'pnpm' : yarn ? 'yarn' : 'npm' %>
85
84
  - name: Install Dependencies
86
- run: <%= yarn ? 'yarn install --frozen-lockfile' : 'npm ci' %><% } %>
85
+ run: <%= pnpm ? 'pnpm install --frozen-lockfile' : yarn ? 'yarn install --frozen-lockfile' : 'npm ci' %>
87
86
  - name: Run Tests
88
87
  run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
@@ -62,8 +62,8 @@ jobs:
62
62
 
63
63
  # we recommend new addons test the current and previous LTS
64
64
  # as well as latest stable release (bonus points to beta/canary)
65
- - env: EMBER_TRY_SCENARIO=ember-lts-4.8
66
65
  - env: EMBER_TRY_SCENARIO=ember-lts-4.12
66
+ - env: EMBER_TRY_SCENARIO=ember-lts-5.4
67
67
  - env: EMBER_TRY_SCENARIO=ember-release
68
68
  - env: EMBER_TRY_SCENARIO=ember-beta
69
69
  - env: EMBER_TRY_SCENARIO=ember-canary
@@ -5,8 +5,8 @@
5
5
 
6
6
  ## Compatibility
7
7
 
8
- * Ember.js v4.8 or above
9
- * Ember CLI v4.8 or above
8
+ * Ember.js v4.12 or above
9
+ * Ember CLI v4.12 or above
10
10
  * Node.js v18 or above
11
11
 
12
12
 
@@ -9,18 +9,18 @@ module.exports = async function () {
9
9
  <% } else if (yarn) { %>useYarn: true,
10
10
  <% } %>scenarios: [
11
11
  {
12
- name: 'ember-lts-4.8',
12
+ name: 'ember-lts-4.12',
13
13
  npm: {
14
14
  devDependencies: {
15
- 'ember-source': '~4.8.0',
15
+ 'ember-source': '~4.12.0',
16
16
  },
17
17
  },
18
18
  },
19
19
  {
20
- name: 'ember-lts-4.12',
20
+ name: 'ember-lts-5.4',
21
21
  npm: {
22
22
  devDependencies: {
23
- 'ember-source': '~4.12.0',
23
+ 'ember-source': '~5.4.0',
24
24
  },
25
25
  },
26
26
  },
@@ -23,6 +23,8 @@
23
23
  /ember-cli-build.js
24
24
  /testem.js
25
25
  /tests/
26
+ /tsconfig.declarations.json
27
+ /tsconfig.json
26
28
  /yarn-error.log
27
29
  /yarn.lock
28
30
  .gitkeep
@@ -218,7 +218,7 @@ module.exports = {
218
218
  }
219
219
 
220
220
  if (!options.typescript) {
221
- addonFiles = addonFiles.filter((file) => file !== 'tsconfig.json' && !file.endsWith('.d.ts'));
221
+ addonFiles = addonFiles.filter((file) => !file.startsWith('tsconfig.') && !file.endsWith('.d.ts'));
222
222
  }
223
223
 
224
224
  return uniq(appFiles.concat(addonFiles));
@@ -2,6 +2,7 @@
2
2
  /blueprints/*/files/
3
3
 
4
4
  # compiled output
5
+ /declarations/
5
6
  /dist/
6
7
 
7
8
  # misc
@@ -19,14 +19,16 @@ jobs:
19
19
 
20
20
  steps:
21
21
  - uses: actions/checkout@v3<% if (pnpm) { %>
22
- - uses: wyvox/action-setup-pnpm@v2<% } else { %>
22
+ - uses: pnpm/action-setup@v2
23
+ with:
24
+ version: 8<% } %>
23
25
  - name: Install Node
24
26
  uses: actions/setup-node@v3
25
27
  with:
26
28
  node-version: 18
27
- cache: <%= yarn ? 'yarn' : 'npm' %>
29
+ cache: <%= pnpm ? 'pnpm' : yarn ? 'yarn' : 'npm' %>
28
30
  - name: Install Dependencies
29
- run: <%= yarn ? 'yarn install --frozen-lockfile' : 'npm ci' %><% } %>
31
+ run: <%= pnpm ? 'pnpm install --frozen-lockfile' : yarn ? 'yarn install --frozen-lockfile' : 'npm ci' %>
30
32
  - name: Lint
31
33
  run: <%= pnpm ? 'pnpm' : yarn ? 'yarn' : 'npm run' %> lint
32
34
 
@@ -37,13 +39,15 @@ jobs:
37
39
 
38
40
  steps:
39
41
  - uses: actions/checkout@v3<% if (pnpm) { %>
40
- - uses: wyvox/action-setup-pnpm@v2<% } else { %>
42
+ - uses: pnpm/action-setup@v2
43
+ with:
44
+ version: 8<% } %>
41
45
  - name: Install Node
42
46
  uses: actions/setup-node@v3
43
47
  with:
44
48
  node-version: 18
45
- cache: <%= yarn ? 'yarn' : 'npm' %>
49
+ cache: <%= pnpm ? 'pnpm' : yarn ? 'yarn' : 'npm' %>
46
50
  - name: Install Dependencies
47
- run: <%= yarn ? 'yarn install --frozen-lockfile' : 'npm ci' %><% } %>
51
+ run: <%= pnpm ? 'pnpm install --frozen-lockfile' : yarn ? 'yarn install --frozen-lockfile' : 'npm ci' %>
48
52
  - name: Run Tests
49
53
  run: <%= pnpm ? 'pnpm' : yarn ? 'yarn' : 'npm' %> test
@@ -26,20 +26,20 @@
26
26
  "test:ember": "ember test"
27
27
  },
28
28
  "devDependencies": {
29
- "@babel/core": "^7.24.0",
30
- "<% if (!typescript) { %>@babel/eslint-parser": "^7.23.10",
31
- "@babel/plugin-proposal-decorators": "^7.24.0",
29
+ "@babel/core": "^7.24.4",
30
+ "<% if (!typescript) { %>@babel/eslint-parser": "^7.24.1",
31
+ "@babel/plugin-proposal-decorators": "^7.24.1",
32
32
  "<% } %>@ember/optional-features": "^2.1.0",
33
33
  "@ember/string": "^3.1.1",
34
34
  "@ember/test-helpers": "^3.3.0<% if (embroider) { %>",
35
- "@embroider/compat": "^3.4.5",
36
- "@embroider/core": "^3.4.5",
37
- "@embroider/webpack": "^3.2.2<% } %>",
35
+ "@embroider/compat": "^3.4.7",
36
+ "@embroider/core": "^3.4.7",
37
+ "@embroider/webpack": "^3.2.3<% } %>",
38
38
  "@glimmer/component": "^1.1.2",
39
39
  "@glimmer/tracking": "^1.1.2<% if (typescript) { %>",
40
- "@glint/environment-ember-loose": "^1.3.0",
41
- "@glint/template": "^1.3.0",
42
- "@tsconfig/ember": "^3.0.4",
40
+ "@glint/environment-ember-loose": "^1.4.0",
41
+ "@glint/template": "^1.4.0",
42
+ "@tsconfig/ember": "^3.0.6",
43
43
  "@types/ember": "^4.0.11",
44
44
  "@types/ember-data": "^4.4.16",
45
45
  "@types/ember-data__adapter": "^4.0.6",
@@ -86,10 +86,10 @@
86
86
  "ember-fetch": "^8.1.2",
87
87
  "ember-load-initializers": "^2.1.2",
88
88
  "ember-modifier": "^4.1.0",
89
- "ember-page-title": "^8.2.2",
89
+ "ember-page-title": "^8.2.3",
90
90
  "ember-qunit": "^8.0.2",
91
91
  "ember-resolver": "^11.0.1",
92
- "ember-source": "~5.7.0",
92
+ "ember-source": "~5.8.0",
93
93
  "ember-template-lint": "^5.13.0<% if (welcome) { %>",
94
94
  "ember-welcome-page": "^7.0.2<% } %>",
95
95
  "eslint": "^8.57.0",
@@ -106,8 +106,8 @@
106
106
  "stylelint-config-standard": "^34.0.0",
107
107
  "stylelint-prettier": "^4.1.0",
108
108
  "tracked-built-ins": "^3.3.0<% if (typescript) { %>",
109
- "typescript": "^5.3.3<% } %>",
110
- "webpack": "^5.90.3"
109
+ "typescript": "^5.4.5<% } %>",
110
+ "webpack": "^5.91.0"
111
111
  },
112
112
  "engines": {
113
113
  "node": ">= 18"
@@ -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": "5.7.0-release-ce0618174f"
6
+ "version": "5.8.0-release-778dbe8299"
7
7
  },
8
8
  "files": {
9
9
  "lib/broccoli/default-packager.js": {
@@ -3921,7 +3921,7 @@
3921
3921
  },
3922
3922
  {
3923
3923
  "file": "lib/models/blueprint.js",
3924
- "line": 582,
3924
+ "line": 581,
3925
3925
  "itemtype": "method",
3926
3926
  "name": "install",
3927
3927
  "params": [
@@ -3940,7 +3940,7 @@
3940
3940
  },
3941
3941
  {
3942
3942
  "file": "lib/models/blueprint.js",
3943
- "line": 609,
3943
+ "line": 608,
3944
3944
  "itemtype": "method",
3945
3945
  "name": "uninstall",
3946
3946
  "params": [
@@ -3959,7 +3959,7 @@
3959
3959
  },
3960
3960
  {
3961
3961
  "file": "lib/models/blueprint.js",
3962
- "line": 631,
3962
+ "line": 630,
3963
3963
  "description": "Hook for running operations before install.",
3964
3964
  "itemtype": "method",
3965
3965
  "name": "beforeInstall",
@@ -3972,7 +3972,7 @@
3972
3972
  },
3973
3973
  {
3974
3974
  "file": "lib/models/blueprint.js",
3975
- "line": 638,
3975
+ "line": 637,
3976
3976
  "description": "Hook for running operations after install.",
3977
3977
  "itemtype": "method",
3978
3978
  "name": "afterInstall",
@@ -3985,7 +3985,7 @@
3985
3985
  },
3986
3986
  {
3987
3987
  "file": "lib/models/blueprint.js",
3988
- "line": 645,
3988
+ "line": 644,
3989
3989
  "description": "Hook for running operations before uninstall.",
3990
3990
  "itemtype": "method",
3991
3991
  "name": "beforeUninstall",
@@ -3998,7 +3998,7 @@
3998
3998
  },
3999
3999
  {
4000
4000
  "file": "lib/models/blueprint.js",
4001
- "line": 652,
4001
+ "line": 651,
4002
4002
  "description": "Hook for running operations after uninstall.",
4003
4003
  "itemtype": "method",
4004
4004
  "name": "afterUninstall",
@@ -4011,7 +4011,7 @@
4011
4011
  },
4012
4012
  {
4013
4013
  "file": "lib/models/blueprint.js",
4014
- "line": 661,
4014
+ "line": 660,
4015
4015
  "description": "Hook for adding custom template variables.\n\nWhen the following is called on the command line:\n\n```sh\nember generate controller foo --type=array --dry-run isAdmin:true\n```\n\nThe object passed to `locals` looks like this:\n\n```js\n{\n entity: {\n name: 'foo',\n options: {\n isAdmin: true\n }\n },\n dryRun: true\n type: \"array\"\n // more keys\n}\n```\n\nThis hook must return an object or a Promise which resolves to an object.\nThe resolved object will be merged with the aforementioned default locals.",
4016
4016
  "access": "public",
4017
4017
  "tagname": "",
@@ -4033,7 +4033,7 @@
4033
4033
  },
4034
4034
  {
4035
4035
  "file": "lib/models/blueprint.js",
4036
- "line": 696,
4036
+ "line": 695,
4037
4037
  "description": "Hook to add additional or override existing fileMap tokens.\n\nUse `fileMapTokens` to add custom fileMap tokens for use\nin the `mapFile` method. The hook must return an object in the\nfollowing pattern:\n\n```js\n{\n __token__(options){\n // logic to determine value goes here\n return 'value';\n }\n}\n```\n\nIt will be merged with the default `fileMapTokens`, and can be used\nto override any of the default tokens.\n\nTokens are used in the files folder (see `files`), and get replaced with\nvalues when the `mapFile` method is called.",
4038
4038
  "access": "public",
4039
4039
  "tagname": "",
@@ -4048,7 +4048,7 @@
4048
4048
  },
4049
4049
  {
4050
4050
  "file": "lib/models/blueprint.js",
4051
- "line": 724,
4051
+ "line": 723,
4052
4052
  "access": "private",
4053
4053
  "tagname": "",
4054
4054
  "itemtype": "method",
@@ -4069,7 +4069,7 @@
4069
4069
  },
4070
4070
  {
4071
4071
  "file": "lib/models/blueprint.js",
4072
- "line": 780,
4072
+ "line": 779,
4073
4073
  "description": "Used to generate fileMap tokens for mapFile.",
4074
4074
  "itemtype": "method",
4075
4075
  "name": "generateFileMap",
@@ -4089,7 +4089,7 @@
4089
4089
  },
4090
4090
  {
4091
4091
  "file": "lib/models/blueprint.js",
4092
- "line": 795,
4092
+ "line": 794,
4093
4093
  "itemtype": "method",
4094
4094
  "name": "buildFileInfo",
4095
4095
  "params": [
@@ -4118,7 +4118,7 @@
4118
4118
  },
4119
4119
  {
4120
4120
  "file": "lib/models/blueprint.js",
4121
- "line": 816,
4121
+ "line": 815,
4122
4122
  "itemtype": "method",
4123
4123
  "name": "isUpdate",
4124
4124
  "return": {
@@ -4130,7 +4130,7 @@
4130
4130
  },
4131
4131
  {
4132
4132
  "file": "lib/models/blueprint.js",
4133
- "line": 826,
4133
+ "line": 825,
4134
4134
  "access": "private",
4135
4135
  "tagname": "",
4136
4136
  "itemtype": "method",
@@ -4161,7 +4161,7 @@
4161
4161
  },
4162
4162
  {
4163
4163
  "file": "lib/models/blueprint.js",
4164
- "line": 838,
4164
+ "line": 837,
4165
4165
  "description": "Add update files to ignored files or reset them",
4166
4166
  "access": "private",
4167
4167
  "tagname": "",
@@ -4172,7 +4172,7 @@
4172
4172
  },
4173
4173
  {
4174
4174
  "file": "lib/models/blueprint.js",
4175
- "line": 851,
4175
+ "line": 850,
4176
4176
  "access": "private",
4177
4177
  "tagname": "",
4178
4178
  "itemtype": "method",
@@ -4193,7 +4193,7 @@
4193
4193
  },
4194
4194
  {
4195
4195
  "file": "lib/models/blueprint.js",
4196
- "line": 864,
4196
+ "line": 863,
4197
4197
  "access": "private",
4198
4198
  "tagname": "",
4199
4199
  "itemtype": "method",
@@ -4215,7 +4215,7 @@
4215
4215
  },
4216
4216
  {
4217
4217
  "file": "lib/models/blueprint.js",
4218
- "line": 878,
4218
+ "line": 877,
4219
4219
  "itemtype": "method",
4220
4220
  "name": "processFiles",
4221
4221
  "params": [
@@ -4239,7 +4239,7 @@
4239
4239
  },
4240
4240
  {
4241
4241
  "file": "lib/models/blueprint.js",
4242
- "line": 911,
4242
+ "line": 910,
4243
4243
  "itemtype": "method",
4244
4244
  "name": "processFilesForUninstall",
4245
4245
  "params": [
@@ -4259,7 +4259,7 @@
4259
4259
  },
4260
4260
  {
4261
4261
  "file": "lib/models/blueprint.js",
4262
- "line": 962,
4262
+ "line": 961,
4263
4263
  "itemtype": "method",
4264
4264
  "name": "mapFile",
4265
4265
  "params": [
@@ -4282,7 +4282,7 @@
4282
4282
  },
4283
4283
  {
4284
4284
  "file": "lib/models/blueprint.js",
4285
- "line": 979,
4285
+ "line": 978,
4286
4286
  "description": "Looks for a __root__ token in the files folder. Must be present for\nthe blueprint to support addon tokens. The `server`, `blueprints`, and `test`",
4287
4287
  "access": "private",
4288
4288
  "tagname": "",
@@ -4297,7 +4297,7 @@
4297
4297
  },
4298
4298
  {
4299
4299
  "file": "lib/models/blueprint.js",
4300
- "line": 991,
4300
+ "line": 990,
4301
4301
  "access": "private",
4302
4302
  "tagname": "",
4303
4303
  "itemtype": "method",
@@ -4327,7 +4327,7 @@
4327
4327
  },
4328
4328
  {
4329
4329
  "file": "lib/models/blueprint.js",
4330
- "line": 1021,
4330
+ "line": 1020,
4331
4331
  "access": "private",
4332
4332
  "tagname": "",
4333
4333
  "itemtype": "method",
@@ -4348,7 +4348,7 @@
4348
4348
  },
4349
4349
  {
4350
4350
  "file": "lib/models/blueprint.js",
4351
- "line": 1054,
4351
+ "line": 1053,
4352
4352
  "description": "Used to add a package to the project's `package.json`.\n\nGenerally, this would be done from the `afterInstall` hook, to\nensure that a package that is required by a given blueprint is\navailable.",
4353
4353
  "itemtype": "method",
4354
4354
  "name": "addPackageToProject",
@@ -4373,7 +4373,7 @@
4373
4373
  },
4374
4374
  {
4375
4375
  "file": "lib/models/blueprint.js",
4376
- "line": 1076,
4376
+ "line": 1075,
4377
4377
  "description": "Used to add multiple packages to the project's `package.json`.\n\nGenerally, this would be done from the `afterInstall` hook, to\nensure that a package that is required by a given blueprint is\navailable.\n\nExpects each array item to be an object with a `name`. Each object\nmay optionally have a `target` to specify a specific version.",
4378
4378
  "itemtype": "method",
4379
4379
  "name": "addPackagesToProject",
@@ -4396,7 +4396,7 @@
4396
4396
  },
4397
4397
  {
4398
4398
  "file": "lib/models/blueprint.js",
4399
- "line": 1125,
4399
+ "line": 1124,
4400
4400
  "description": "Used to remove a package from the project's `package.json`.\n\nGenerally, this would be done from the `afterInstall` hook, to\nensure that any package conflicts can be resolved before the\naddon is used.",
4401
4401
  "itemtype": "method",
4402
4402
  "name": "removePackageFromProject",
@@ -4416,7 +4416,7 @@
4416
4416
  },
4417
4417
  {
4418
4418
  "file": "lib/models/blueprint.js",
4419
- "line": 1142,
4419
+ "line": 1141,
4420
4420
  "description": "Used to remove multiple packages from the project's `package.json`.\n\nGenerally, this would be done from the `afterInstall` hook, to\nensure that any package conflicts can be resolved before the\naddon is used.\n\nExpects each array item to be an object with a `name` property.",
4421
4421
  "itemtype": "method",
4422
4422
  "name": "removePackagesFromProject",
@@ -4436,7 +4436,7 @@
4436
4436
  },
4437
4437
  {
4438
4438
  "file": "lib/models/blueprint.js",
4439
- "line": 1183,
4439
+ "line": 1182,
4440
4440
  "description": "Used to add an addon to the project's `package.json` and run it's\n`defaultBlueprint` if it provides one.\n\nGenerally, this would be done from the `afterInstall` hook, to\nensure that a package that is required by a given blueprint is\navailable.",
4441
4441
  "itemtype": "method",
4442
4442
  "name": "addAddonToProject",
@@ -4456,7 +4456,7 @@
4456
4456
  },
4457
4457
  {
4458
4458
  "file": "lib/models/blueprint.js",
4459
- "line": 1203,
4459
+ "line": 1202,
4460
4460
  "description": "Used to add multiple addons to the project's `package.json` and run their\n`defaultBlueprint` if they provide one.\n\nGenerally, this would be done from the `afterInstall` hook, to\nensure that a package that is required by a given blueprint is\navailable.",
4461
4461
  "itemtype": "method",
4462
4462
  "name": "addAddonsToProject",
@@ -4476,7 +4476,7 @@
4476
4476
  },
4477
4477
  {
4478
4478
  "file": "lib/models/blueprint.js",
4479
- "line": 1280,
4479
+ "line": 1279,
4480
4480
  "description": "Used to retrieve a task with the given name. Passes the new task\nthe standard information available (like `ui`, `project`, etc).",
4481
4481
  "itemtype": "method",
4482
4482
  "name": "taskFor",
@@ -4493,7 +4493,7 @@
4493
4493
  },
4494
4494
  {
4495
4495
  "file": "lib/models/blueprint.js",
4496
- "line": 1297,
4496
+ "line": 1296,
4497
4497
  "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```",
4498
4498
  "itemtype": "method",
4499
4499
  "name": "insertIntoFile",
@@ -4523,7 +4523,7 @@
4523
4523
  },
4524
4524
  {
4525
4525
  "file": "lib/models/blueprint.js",
4526
- "line": 1401,
4526
+ "line": 1400,
4527
4527
  "description": "Used to retrieve a blueprint with the given name.",
4528
4528
  "itemtype": "method",
4529
4529
  "name": "lookupBlueprint",
@@ -4545,7 +4545,7 @@
4545
4545
  },
4546
4546
  {
4547
4547
  "file": "lib/models/blueprint.js",
4548
- "line": 1418,
4548
+ "line": 1417,
4549
4549
  "static": 1,
4550
4550
  "itemtype": "method",
4551
4551
  "name": "lookup",
@@ -4592,7 +4592,7 @@
4592
4592
  },
4593
4593
  {
4594
4594
  "file": "lib/models/blueprint.js",
4595
- "line": 1459,
4595
+ "line": 1458,
4596
4596
  "description": "Loads a blueprint from given path.",
4597
4597
  "static": 1,
4598
4598
  "itemtype": "method",
@@ -4620,7 +4620,7 @@
4620
4620
  },
4621
4621
  {
4622
4622
  "file": "lib/models/blueprint.js",
4623
- "line": 1487,
4623
+ "line": 1486,
4624
4624
  "static": 1,
4625
4625
  "itemtype": "method",
4626
4626
  "name": "list",
@@ -4650,7 +4650,7 @@
4650
4650
  },
4651
4651
  {
4652
4652
  "file": "lib/models/blueprint.js",
4653
- "line": 1536,
4653
+ "line": 1535,
4654
4654
  "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.",
4655
4655
  "static": 1,
4656
4656
  "itemtype": "property",
@@ -4661,7 +4661,7 @@
4661
4661
  },
4662
4662
  {
4663
4663
  "file": "lib/models/blueprint.js",
4664
- "line": 1551,
4664
+ "line": 1550,
4665
4665
  "static": 1,
4666
4666
  "itemtype": "property",
4667
4667
  "name": "ignoredFiles",
@@ -4671,7 +4671,7 @@
4671
4671
  },
4672
4672
  {
4673
4673
  "file": "lib/models/blueprint.js",
4674
- "line": 1557,
4674
+ "line": 1556,
4675
4675
  "static": 1,
4676
4676
  "itemtype": "property",
4677
4677
  "name": "ignoredUpdateFiles",
@@ -4681,7 +4681,7 @@
4681
4681
  },
4682
4682
  {
4683
4683
  "file": "lib/models/blueprint.js",
4684
- "line": 1563,
4684
+ "line": 1562,
4685
4685
  "static": 1,
4686
4686
  "itemtype": "property",
4687
4687
  "name": "defaultLookupPaths",
@@ -4691,7 +4691,7 @@
4691
4691
  },
4692
4692
  {
4693
4693
  "file": "lib/models/blueprint.js",
4694
- "line": 1571,
4694
+ "line": 1570,
4695
4695
  "access": "private",
4696
4696
  "tagname": "",
4697
4697
  "itemtype": "method",
@@ -4713,7 +4713,7 @@
4713
4713
  },
4714
4714
  {
4715
4715
  "file": "lib/models/blueprint.js",
4716
- "line": 1584,
4716
+ "line": 1583,
4717
4717
  "access": "private",
4718
4718
  "tagname": "",
4719
4719
  "itemtype": "method",
@@ -4731,7 +4731,7 @@
4731
4731
  },
4732
4732
  {
4733
4733
  "file": "lib/models/blueprint.js",
4734
- "line": 1595,
4734
+ "line": 1594,
4735
4735
  "access": "private",
4736
4736
  "tagname": "",
4737
4737
  "itemtype": "method",
@@ -4749,7 +4749,7 @@
4749
4749
  },
4750
4750
  {
4751
4751
  "file": "lib/models/blueprint.js",
4752
- "line": 1604,
4752
+ "line": 1603,
4753
4753
  "access": "private",
4754
4754
  "tagname": "",
4755
4755
  "itemtype": "method",
@@ -4776,7 +4776,7 @@
4776
4776
  },
4777
4777
  {
4778
4778
  "file": "lib/models/blueprint.js",
4779
- "line": 1618,
4779
+ "line": 1617,
4780
4780
  "access": "private",
4781
4781
  "tagname": "",
4782
4782
  "itemtype": "method",
@@ -4798,7 +4798,7 @@
4798
4798
  },
4799
4799
  {
4800
4800
  "file": "lib/models/blueprint.js",
4801
- "line": 1630,
4801
+ "line": 1629,
4802
4802
  "description": "Combines provided lookup paths with defaults and removes\nduplicates.",
4803
4803
  "access": "private",
4804
4804
  "tagname": "",
@@ -4821,7 +4821,7 @@
4821
4821
  },
4822
4822
  {
4823
4823
  "file": "lib/models/blueprint.js",
4824
- "line": 1645,
4824
+ "line": 1644,
4825
4825
  "description": "Looks for a __path__ token in the files folder. Must be present for\nthe blueprint to support pod tokens.",
4826
4826
  "access": "private",
4827
4827
  "tagname": "",
@@ -4844,7 +4844,7 @@
4844
4844
  },
4845
4845
  {
4846
4846
  "file": "lib/models/blueprint.js",
4847
- "line": 1684,
4847
+ "line": 1683,
4848
4848
  "access": "private",
4849
4849
  "tagname": "",
4850
4850
  "itemtype": "method",
@@ -4866,7 +4866,7 @@
4866
4866
  },
4867
4867
  {
4868
4868
  "file": "lib/models/blueprint.js",
4869
- "line": 1698,
4869
+ "line": 1697,
4870
4870
  "access": "private",
4871
4871
  "tagname": "",
4872
4872
  "itemtype": "method",
@@ -4888,7 +4888,7 @@
4888
4888
  },
4889
4889
  {
4890
4890
  "file": "lib/models/blueprint.js",
4891
- "line": 1708,
4891
+ "line": 1707,
4892
4892
  "access": "private",
4893
4893
  "tagname": "",
4894
4894
  "itemtype": "method",
@@ -4903,7 +4903,7 @@
4903
4903
  },
4904
4904
  {
4905
4905
  "file": "lib/models/blueprint.js",
4906
- "line": 1721,
4906
+ "line": 1720,
4907
4907
  "access": "private",
4908
4908
  "tagname": "",
4909
4909
  "itemtype": "method",
@@ -4923,6 +4923,39 @@
4923
4923
  "module": "ember-cli",
4924
4924
  "namespace": "Blueprint"
4925
4925
  },
4926
+ {
4927
+ "file": "lib/models/blueprint.js",
4928
+ "line": 1774,
4929
+ "description": "Takes a substring of a string based on byte offsets.",
4930
+ "access": "private",
4931
+ "tagname": "",
4932
+ "itemtype": "method",
4933
+ "name": "substringBytes",
4934
+ "params": [
4935
+ {
4936
+ "name": "value",
4937
+ "description": ": The input string.",
4938
+ "type": "String"
4939
+ },
4940
+ {
4941
+ "name": "start",
4942
+ "description": ": The byte index of the substring start.",
4943
+ "type": "Number"
4944
+ },
4945
+ {
4946
+ "name": "end",
4947
+ "description": ": The byte index of the substring end.",
4948
+ "type": "Number"
4949
+ }
4950
+ ],
4951
+ "return": {
4952
+ "description": ": The substring.",
4953
+ "type": "String"
4954
+ },
4955
+ "class": "Blueprint",
4956
+ "module": "ember-cli",
4957
+ "namespace": "Blueprint"
4958
+ },
4926
4959
  {
4927
4960
  "file": "lib/models/builder.js",
4928
4961
  "line": 39,
@@ -547,16 +547,16 @@ let Blueprint = CoreObject.extend({
547
547
  const { removeTypes } = require('remove-types');
548
548
 
549
549
  if (extension === '.gts') {
550
- const { parseTemplates } = require('ember-template-tag');
550
+ const { Preprocessor } = require('content-tag');
551
+ const preprocessor = new Preprocessor();
551
552
  // Strip template tags
552
553
  const templateTagIdentifier = (index) => `template = __TEMPLATE_TAG_${index}__;`;
553
554
  const templateTagIdentifierBraces = (index) => `(template = __TEMPLATE_TAG_${index}__);`;
554
- const templateTagMatches = parseTemplates(code).filter((match) => match.type === 'template-tag');
555
+ const templateTagMatches = preprocessor.parse(code);
555
556
  let strippedCode = code;
556
557
  for (let i = 0; i < templateTagMatches.length; i++) {
557
558
  const match = templateTagMatches[i];
558
- const [matchStart, matchEnd] = match.range;
559
- const templateTag = code.substring(matchStart, matchEnd);
559
+ const templateTag = substringBytes(code, match.range.start, match.range.end);
560
560
  strippedCode = strippedCode.replace(templateTag, templateTagIdentifier(i));
561
561
  }
562
562
 
@@ -567,8 +567,7 @@ let Blueprint = CoreObject.extend({
567
567
  let transformedWithTemplateTag = transformed;
568
568
  for (let i = 0; i < templateTagMatches.length; i++) {
569
569
  const match = templateTagMatches[i];
570
- const [matchStart, matchEnd] = match.range;
571
- const templateTag = code.substring(matchStart, matchEnd);
570
+ const templateTag = substringBytes(code, match.range.start, match.range.end);
572
571
  transformedWithTemplateTag = transformedWithTemplateTag.replace(templateTagIdentifier(i), templateTag);
573
572
  transformedWithTemplateTag = transformedWithTemplateTag.replace(templateTagIdentifierBraces(i), templateTag);
574
573
  }
@@ -1772,4 +1771,18 @@ function isJavaScriptFile(filePath) {
1772
1771
  return path.extname(filePath) === '.js' || path.extname(filePath) === '.gjs';
1773
1772
  }
1774
1773
 
1774
+ /**
1775
+ * Takes a substring of a string based on byte offsets.
1776
+ * @private
1777
+ * @method substringBytes
1778
+ * @param {string} value : The input string.
1779
+ * @param {number} start : The byte index of the substring start.
1780
+ * @param {number} end : The byte index of the substring end.
1781
+ * @return {string} : The substring.
1782
+ */
1783
+ function substringBytes(value, start, end) {
1784
+ let buf = Buffer.from(value);
1785
+ return buf.subarray(start, end).toString();
1786
+ }
1787
+
1775
1788
  module.exports = Blueprint;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-cli",
3
- "version": "5.7.0",
3
+ "version": "5.8.0",
4
4
  "description": "Command line tool for developing ambitious ember.js apps",
5
5
  "keywords": [
6
6
  "app",
@@ -59,6 +59,7 @@
59
59
  "compression": "^1.7.4",
60
60
  "configstore": "^5.0.1",
61
61
  "console-ui": "^3.1.2",
62
+ "content-tag": "^1.2.2",
62
63
  "core-object": "^3.1.5",
63
64
  "dag-map": "^2.0.2",
64
65
  "diff": "^5.1.0",
@@ -67,7 +68,6 @@
67
68
  "ember-cli-normalize-entity-name": "^1.0.0",
68
69
  "ember-cli-preprocess-registry": "^5.0.1",
69
70
  "ember-cli-string-utils": "^1.1.0",
70
- "ember-template-tag": "^2.3.8",
71
71
  "ensure-posix-path": "^1.1.1",
72
72
  "execa": "^5.1.1",
73
73
  "exit": "^0.1.2",