Skip to content

Commit 6abd672

Browse files
authored
Removed hardcoded locations for test-app (#81)
* bugfix: Removed hardcoded location for test-app * chore: Updated fixtures * chore: Updated README --------- Co-authored-by: ijlee2 <[email protected]>
1 parent decfbf5 commit 6abd672

File tree

5 files changed

+8
-8
lines changed
  • src/steps/update-addon-package-json
  • tests/fixtures
    • ember-container-query-customizations/output/packages/ember-container-query
    • new-v1-addon-customizations/output/packages/new-v1-addon
    • steps/update-addon-package-json/customizations/output/packages/ember-container-query

5 files changed

+8
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ In most cases, I recommend running the codemod without any arguments (i.e. allow
5555
By default, the package name decides where the addon package lives. Pass `--addon-location` to override the logic. This may be useful if you have a workspace with many addons.
5656

5757
```sh
58-
npx ember-codemod-v1-to-v2 --addon-location packages/ui/buttons
58+
npx ember-codemod-v1-to-v2 --addon-location packages/ui/button
5959
```
6060

6161
</details>
@@ -94,7 +94,7 @@ npx ember-codemod-v1-to-v2 --test-app-location docs-app
9494
By default, the test-app package is named `test-app`. Pass `--test-app-name` to override the logic. This may be useful if you have a workspace with many addons.
9595

9696
```sh
97-
npx ember-codemod-v1-to-v2 --test-app-name test-app-for-ui-buttons
97+
npx ember-codemod-v1-to-v2 --test-app-name test-app-for-ui-button
9898
```
9999

100100
</details>

src/steps/update-addon-package-json/update-scripts.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function updateScripts(
66
packageJson: PackageJson,
77
options: Options,
88
): void {
9-
const { packages } = options;
9+
const { locations, packages } = options;
1010

1111
const scripts = convertToMap(packageJson['scripts']);
1212

@@ -40,15 +40,15 @@ export function updateScripts(
4040

4141
scripts.set(
4242
'test',
43-
"echo 'A v2 addon does not have tests, run tests in test-app'",
43+
`echo 'A v2 addon does not have tests, run tests in ${locations.testApp}'`,
4444
);
4545
} else {
4646
scripts.set('build', 'rollup --config');
4747
scripts.set('prepack', 'rollup --config');
4848
scripts.set('start', 'rollup --config --watch');
4949
scripts.set(
5050
'test',
51-
"echo 'A v2 addon does not have tests, run tests in test-app'",
51+
`echo 'A v2 addon does not have tests, run tests in ${locations.testApp}'`,
5252
);
5353
}
5454

tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"start": "concurrently \"npm:start:*\" --names \"start:\"",
4444
"start:js": "rollup --config --watch --no-watch.clearScreen",
4545
"start:types": "glint --declaration --watch",
46-
"test": "echo 'A v2 addon does not have tests, run tests in test-app'",
46+
"test": "echo 'A v2 addon does not have tests, run tests in demo-app'",
4747
"test:ember": "ember test",
4848
"test:ember-compatibility": "./node_modules/.bin/ember try:one"
4949
},

tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"start": "concurrently \"npm:start:*\" --names \"start:\"",
2828
"start:js": "rollup --config --watch --no-watch.clearScreen",
2929
"start:types": "tsc --watch",
30-
"test": "echo 'A v2 addon does not have tests, run tests in test-app'",
30+
"test": "echo 'A v2 addon does not have tests, run tests in demo-app'",
3131
"test:ember": "ember test",
3232
"test:ember-compatibility": "ember try:each"
3333
},

tests/fixtures/steps/update-addon-package-json/customizations/output/packages/ember-container-query/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"start": "concurrently \"npm:start:*\" --names \"start:\"",
4444
"start:js": "rollup --config --watch --no-watch.clearScreen",
4545
"start:types": "glint --declaration --watch",
46-
"test": "echo 'A v2 addon does not have tests, run tests in test-app'",
46+
"test": "echo 'A v2 addon does not have tests, run tests in demo-app'",
4747
"test:ember": "ember test",
4848
"test:ember-compatibility": "./node_modules/.bin/ember try:one"
4949
},

0 commit comments

Comments
 (0)