Skip to content

Commit

Permalink
bugfix: Removed hardcoded package manager names
Browse files Browse the repository at this point in the history
  • Loading branch information
ijlee2 committed Apr 26, 2024
1 parent 82753b7 commit 24c1695
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/blueprints/ember-addon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"lint": "pnpm --filter '*' lint",
"lint:fix": "pnpm --filter '*' lint:fix",
"prepare": "pnpm build",
"start": "concurrently 'npm:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
"start": "concurrently 'pnpm:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
"start:addon": "pnpm --filter <%= options.packages.addon.name %> start",
"start:test-app": "pnpm --filter <%= options.packages.testApp.name %> start",
"test": "pnpm --filter '*' test"
Expand All @@ -58,7 +58,7 @@
"lint": "yarn workspaces run lint",
"lint:fix": "yarn workspaces run lint:fix",
"prepare": "yarn build",
"start": "concurrently 'npm:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
"start": "concurrently 'yarn:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
"start:addon": "yarn workspace <%= options.packages.addon.name %> run start",
"start:test-app": "yarn workspace <%= options.packages.testApp.name %> run start",
"test": "yarn workspaces run test"
Expand Down
18 changes: 12 additions & 6 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 { locations, packages } = options;
const { locations, packageManager, packages } = options;

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

Expand All @@ -16,8 +16,14 @@ export function updateScripts(
*/
scripts.clear();

scripts.set('lint', "concurrently 'npm:lint:*(!fix)' --names 'lint:'");
scripts.set('lint:fix', "concurrently 'npm:lint:*:fix' --names 'fix:'");
scripts.set(
'lint',
`concurrently '${packageManager}:lint:*(!fix)' --names 'lint:'`,
);
scripts.set(
'lint:fix',
`concurrently '${packageManager}:lint:*:fix' --names 'fix:'`,
);
scripts.set(
'lint:hbs',
'ember-template-lint . --no-error-on-unmatched-pattern',
Expand All @@ -34,11 +40,11 @@ export function updateScripts(
);

if (packages.addon.hasTypeScript) {
scripts.set('build', 'concurrently "npm:build:*"');
scripts.set('build', `concurrently "${packageManager}:build:*"`);
scripts.set('build:js', 'rollup --config');
scripts.delete('postpack');
scripts.set('prepack', "concurrently 'npm:build:*'");
scripts.set('start', 'concurrently "npm:start:*"');
scripts.set('prepack', `concurrently '${packageManager}:build:*'`);
scripts.set('start', `concurrently "${packageManager}:start:*"`);
scripts.set('start:js', 'rollup --config --watch --no-watch.clearScreen');

if (packages.addon.hasGlint) {
Expand Down

0 comments on commit 24c1695

Please sign in to comment.