From c8f1e5ff8d60277806d53252cedba71df4ee4e22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Somhairle=20MacLe=C3=B2id?= Date: Tue, 29 Aug 2023 17:20:33 +0100 Subject: [PATCH] Fix Quick Edit and Devtools builds (#3864) --- package-lock.json | 4 ++-- packages/quick-edit-extension/scripts/bundle.ts | 8 ++++++-- packages/wrangler-devtools/Makefile | 5 +---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1d65b89c6cf3..850315879168 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2571,7 +2571,7 @@ }, "node_modules/@clack/prompts/node_modules/is-unicode-supported": { "version": "1.3.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -35564,7 +35564,7 @@ "is-unicode-supported": { "version": "1.3.0", "bundled": true, - "dev": true + "extraneous": true } } }, diff --git a/packages/quick-edit-extension/scripts/bundle.ts b/packages/quick-edit-extension/scripts/bundle.ts index d4cb04446e21..d49611badb0f 100644 --- a/packages/quick-edit-extension/scripts/bundle.ts +++ b/packages/quick-edit-extension/scripts/bundle.ts @@ -7,7 +7,6 @@ type BuildFlags = { async function buildMain(flags: BuildFlags = {}) { const options: esbuild.BuildOptions = { - watch: flags.watch, entryPoints: ["./src/extension.ts"], bundle: true, outfile: "./dist/extension.js", @@ -40,7 +39,12 @@ async function buildMain(flags: BuildFlags = {}) { }, ], }; - await esbuild.build(options); + if (flags.watch) { + const ctx = await esbuild.context(options); + await ctx.watch(); + } else { + await esbuild.build(options); + } } async function run() { diff --git a/packages/wrangler-devtools/Makefile b/packages/wrangler-devtools/Makefile index 04b7545e25f5..4f511e87290b 100644 --- a/packages/wrangler-devtools/Makefile +++ b/packages/wrangler-devtools/Makefile @@ -20,10 +20,7 @@ devtools-frontend/out/Default/gen/front_end: devtools-frontend cd devtools-frontend && PATH=$(PATH_WITH_DEPOT) $(ROOT)/depot/gn gen out/Default cd devtools-frontend && PATH=$(PATH_WITH_DEPOT) $(ROOT)/depot/autoninja -C out/Default -node_modules: - npm ci - -publish: node_modules devtools-frontend/out/Default/gen/front_end +publish: devtools-frontend/out/Default/gen/front_end npx wrangler pages deploy --project-name cloudflare-devtools devtools-frontend/out/Default/gen/front_end cleanup: