From f2e4e742b100e1ca24a2a2040f77c2be1815db04 Mon Sep 17 00:00:00 2001 From: ijlee2 Date: Fri, 26 Apr 2024 08:25:02 +0200 Subject: [PATCH 1/3] bugfix: Removed hardcoded location for test-app --- src/steps/update-addon-package-json/update-scripts.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/steps/update-addon-package-json/update-scripts.ts b/src/steps/update-addon-package-json/update-scripts.ts index 3c42ba68..caba4655 100644 --- a/src/steps/update-addon-package-json/update-scripts.ts +++ b/src/steps/update-addon-package-json/update-scripts.ts @@ -6,7 +6,7 @@ export function updateScripts( packageJson: PackageJson, options: Options, ): void { - const { packages } = options; + const { locations, packages } = options; const scripts = convertToMap(packageJson['scripts']); @@ -40,7 +40,7 @@ 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'); @@ -48,7 +48,7 @@ export function updateScripts( 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}'`, ); } From 4fac4806940157257b8d021fdcceab42cd8819f9 Mon Sep 17 00:00:00 2001 From: ijlee2 Date: Fri, 26 Apr 2024 08:26:30 +0200 Subject: [PATCH 2/3] chore: Updated fixtures --- .../output/packages/ember-container-query/package.json | 2 +- .../output/packages/new-v1-addon/package.json | 2 +- .../output/packages/ember-container-query/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/package.json b/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/package.json index 5fc6d310..2f7e3cb6 100644 --- a/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/package.json +++ b/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/package.json @@ -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" }, diff --git a/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/package.json b/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/package.json index 1c23c12b..d76783f0 100644 --- a/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/package.json +++ b/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/package.json @@ -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" }, diff --git a/tests/fixtures/steps/update-addon-package-json/customizations/output/packages/ember-container-query/package.json b/tests/fixtures/steps/update-addon-package-json/customizations/output/packages/ember-container-query/package.json index 5fc6d310..2f7e3cb6 100644 --- a/tests/fixtures/steps/update-addon-package-json/customizations/output/packages/ember-container-query/package.json +++ b/tests/fixtures/steps/update-addon-package-json/customizations/output/packages/ember-container-query/package.json @@ -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" }, From 9516199372dea66556cfbae3343846412e7216e3 Mon Sep 17 00:00:00 2001 From: ijlee2 Date: Fri, 26 Apr 2024 08:27:08 +0200 Subject: [PATCH 3/3] chore: Updated README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f2a8b575..12de9ec0 100644 --- a/README.md +++ b/README.md @@ -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 ``` @@ -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 ```