Skip to content

Commit

Permalink
Removed hardcoded locations for test-app (#81)
Browse files Browse the repository at this point in the history
* bugfix: Removed hardcoded location for test-app

* chore: Updated fixtures

* chore: Updated README

---------

Co-authored-by: ijlee2 <[email protected]>
  • Loading branch information
ijlee2 and ijlee2 authored Apr 26, 2024
1 parent decfbf5 commit 6abd672
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ In most cases, I recommend running the codemod without any arguments (i.e. allow
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.

```sh
npx ember-codemod-v1-to-v2 --addon-location packages/ui/buttons
npx ember-codemod-v1-to-v2 --addon-location packages/ui/button
```

</details>
Expand Down Expand Up @@ -94,7 +94,7 @@ npx ember-codemod-v1-to-v2 --test-app-location docs-app
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.

```sh
npx ember-codemod-v1-to-v2 --test-app-name test-app-for-ui-buttons
npx ember-codemod-v1-to-v2 --test-app-name test-app-for-ui-button
```

</details>
Expand Down
6 changes: 3 additions & 3 deletions src/steps/update-addon-package-json/update-scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function updateScripts(
packageJson: PackageJson,
options: Options,
): void {
const { packages } = options;
const { locations, packages } = options;

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

Expand Down Expand Up @@ -40,15 +40,15 @@ export function updateScripts(

scripts.set(
'test',
"echo 'A v2 addon does not have tests, run tests in test-app'",
`echo 'A v2 addon does not have tests, run tests in ${locations.testApp}'`,
);
} else {
scripts.set('build', 'rollup --config');
scripts.set('prepack', 'rollup --config');
scripts.set('start', 'rollup --config --watch');
scripts.set(
'test',
"echo 'A v2 addon does not have tests, run tests in test-app'",
`echo 'A v2 addon does not have tests, run tests in ${locations.testApp}'`,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"start": "concurrently \"npm:start:*\" --names \"start:\"",
"start:js": "rollup --config --watch --no-watch.clearScreen",
"start:types": "glint --declaration --watch",
"test": "echo 'A v2 addon does not have tests, run tests in test-app'",
"test": "echo 'A v2 addon does not have tests, run tests in demo-app'",
"test:ember": "ember test",
"test:ember-compatibility": "./node_modules/.bin/ember try:one"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"start": "concurrently \"npm:start:*\" --names \"start:\"",
"start:js": "rollup --config --watch --no-watch.clearScreen",
"start:types": "tsc --watch",
"test": "echo 'A v2 addon does not have tests, run tests in test-app'",
"test": "echo 'A v2 addon does not have tests, run tests in demo-app'",
"test:ember": "ember test",
"test:ember-compatibility": "ember try:each"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"start": "concurrently \"npm:start:*\" --names \"start:\"",
"start:js": "rollup --config --watch --no-watch.clearScreen",
"start:types": "glint --declaration --watch",
"test": "echo 'A v2 addon does not have tests, run tests in test-app'",
"test": "echo 'A v2 addon does not have tests, run tests in demo-app'",
"test:ember": "ember test",
"test:ember-compatibility": "./node_modules/.bin/ember try:one"
},
Expand Down

0 comments on commit 6abd672

Please sign in to comment.