diff --git a/.changeset/purple-penguins-tie.md b/.changeset/purple-penguins-tie.md new file mode 100644 index 000000000000..6dda80267342 --- /dev/null +++ b/.changeset/purple-penguins-tie.md @@ -0,0 +1,5 @@ +--- +"create-cloudflare": minor +--- + +Replaces the "prestart" and "predeploy" scripts when using Angular to better support pnpm diff --git a/packages/create-cloudflare/e2e-tests/pages.test.ts b/packages/create-cloudflare/e2e-tests/pages.test.ts index a418819e0426..8d47fed32ba8 100644 --- a/packages/create-cloudflare/e2e-tests/pages.test.ts +++ b/packages/create-cloudflare/e2e-tests/pages.test.ts @@ -35,6 +35,10 @@ describe.concurrent(`E2E: Web frameworks`, () => { unsupportedPms: ["bun"], testCommitMessage: true, }, + angular: { + expectResponseToContain: "Love Angular?", + testCommitMessage: true, + }, gatsby: { expectResponseToContain: "Gatsby!", unsupportedPms: ["bun"], diff --git a/packages/create-cloudflare/src/frameworks/angular/index.ts b/packages/create-cloudflare/src/frameworks/angular/index.ts index 7676b9197bf8..4500236f5a65 100644 --- a/packages/create-cloudflare/src/frameworks/angular/index.ts +++ b/packages/create-cloudflare/src/frameworks/angular/index.ts @@ -27,9 +27,8 @@ const generate = async (ctx: PagesGeneratorContext) => { }; const configure = async (ctx: PagesGeneratorContext) => { - const cli = getFrameworkCli(ctx, false); process.chdir(ctx.project.path); - await runCommand(`${npx} ${cli}@next analytics disable`, { + await runCommand(`${npx} ng analytics disable`, { silent: true, }); await addSSRAdapter(); @@ -45,14 +44,13 @@ const config: FrameworkConfig = { packageScripts: { process: "node ./tools/copy-worker-files.mjs && node ./tools/copy-client-files.mjs && node ./tools/bundle.mjs", - prestart: `${npm} run build:ssr && ${npm} run process`, - start: - "wrangler pages dev dist/cloudflare --compatibility-date=2021-09-20 --experimental-local", - predeploy: `${npm} run build:ssr && ${npm} run process`, - deploy: "wrangler pages deploy dist/cloudflare", + "pages:build": `${npm} run build:ssr && ${npm} run process`, + start: `${npm} run pages:build && wrangler pages dev dist/cloudflare --compatibility-date=2021-09-20 --experimental-local`, + deploy: `${npm} run pages:build && wrangler pages deploy dist/cloudflare`, }, deployCommand: "deploy", devCommand: "start", + testFlags: ["--routing", "--style", "sass"], }; export default config;