From edabbd6d52b752639ea5b174b2116c65bc397f38 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sun, 6 Apr 2025 12:27:29 +0200 Subject: [PATCH] root: update start scripts and remove dev Signed-off-by: Patrik Oldsberg --- .changeset/four-drinks-begin.md | 16 ++++++++++++++++ lighthouserc.js | 2 +- package.json | 13 ++++++------- .../templates/default-app/package.json.hbs | 4 +--- 4 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 .changeset/four-drinks-begin.md diff --git a/.changeset/four-drinks-begin.md b/.changeset/four-drinks-begin.md new file mode 100644 index 0000000000..aca60e2999 --- /dev/null +++ b/.changeset/four-drinks-begin.md @@ -0,0 +1,16 @@ +--- +'@backstage/create-app': patch +--- + +Updated the root `package.json` in the template to use the new `backstage-cli repo start` command. + +The `yarn dev` command is now redundant and has been removed from the template. We recommend existing projects to add these or similar scripts to help redirect users: + +```json +{ + "scripts": { + "dev": "echo \"Use 'yarn start' instead\"", + "start-backend": "echo \"Use 'yarn start backend' instead\"" + } +} +``` diff --git a/lighthouserc.js b/lighthouserc.js index 49595068ca..396bff5dc7 100644 --- a/lighthouserc.js +++ b/lighthouserc.js @@ -52,7 +52,7 @@ module.exports = { outputPath: './.lighthouseci/reports', preset: 'desktop', }, - startServerCommand: 'yarn start:lighthouse', + startServerCommand: 'yarn start', startServerReadyPattern: 'webpack compiled successfully', startServerReadyTimeout: 600000, numberOfRuns: 1, diff --git a/package.json b/package.json index a2dad21782..26c7844580 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,8 @@ "build:plugins-report": "node ./scripts/build-plugins-report", "clean": "backstage-cli repo clean", "create-plugin": "echo \"use 'yarn new' instead\"", - "dev": "yarn workspaces foreach -A --include example-backend --include example-app --parallel --jobs unlimited -v -i run start", - "dev:next": "yarn workspaces foreach -A --include example-backend --include example-app-next --parallel --jobs unlimited -v -i run start", + "dev": "echo \"use 'yarn start' instead\"", + "dev:next": "echo \"use 'yarn start:next' instead\"", "docker-build": "yarn tsc && yarn workspace example-backend build && yarn workspace example-backend build-image", "fix": "backstage-cli repo fix --publish", "postinstall": "husky || true", @@ -50,12 +50,11 @@ "release": "node scripts/prepare-release.js && changeset version && yarn prettier --write '{packages,plugins}/*/{package.json,CHANGELOG.md}' '.changeset/*.json' && yarn install --no-immutable", "snyk:test": "npx snyk test --yarn-workspaces --strict-out-of-sync=false", "snyk:test:package": "yarn snyk:test --include", - "start": "yarn workspace example-app start", - "start-backend": "yarn workspace example-backend start", - "start-backend:legacy": "yarn workspace example-backend-legacy start", - "start:lighthouse": "yarn workspaces foreach -A --include example-backend --include example-app --parallel --jobs unlimited -v -i run start", + "start": "backstage-cli repo start", + "start-backend": "echo \"Use 'yarn start example-backend' instead\"", + "start-backend:legacy": "echo \"Use 'yarn start example-backend-legacy' instead\"", "start:microsite": "cd microsite/ && yarn start", - "start:next": "yarn workspace example-app-next start", + "start:next": "yarn start example-app-next example-backend", "storybook": "yarn ./storybook run storybook", "techdocs-cli": "node scripts/techdocs-cli.js", "techdocs-cli:dev": "cross-env TECHDOCS_CLI_DEV_MODE=true node scripts/techdocs-cli.js", diff --git a/packages/create-app/templates/default-app/package.json.hbs b/packages/create-app/templates/default-app/package.json.hbs index 83659e2a02..8399c6505a 100644 --- a/packages/create-app/templates/default-app/package.json.hbs +++ b/packages/create-app/templates/default-app/package.json.hbs @@ -6,9 +6,7 @@ "node": "20 || 22" }, "scripts": { - "dev": "yarn workspaces foreach -A --include backend --include app --parallel --jobs unlimited -v -i run start", - "start": "yarn workspace app start", - "start-backend": "yarn workspace backend start", + "start": "backstage-cli repo start", "build:backend": "yarn workspace backend build", "build:all": "backstage-cli repo build --all", "build-image": "yarn workspace backend build-image",