diff --git a/.github/workflows/generate-sandboxes-main.yml b/.github/workflows/generate-sandboxes-main.yml index 7d9328578493..adea48c1b2f6 100644 --- a/.github/workflows/generate-sandboxes-main.yml +++ b/.github/workflows/generate-sandboxes-main.yml @@ -30,7 +30,10 @@ jobs: git config --global user.name "Storybook Bot" git config --global user.email "bot@storybook.js.org" - name: Install dependencies - run: node ./scripts/check-dependencies.js + run: | + cd ./scripts + node --loader esbuild-register/loader -r esbuild-register ./check-dependencies.ts + cd .. - name: Compile Storybook libraries run: yarn task --task compile --start-from=auto --no-link - name: Publishing to local registry diff --git a/.github/workflows/generate-sandboxes-next.yml b/.github/workflows/generate-sandboxes-next.yml index 8a28c4cbb23a..9a00f8b99cdc 100644 --- a/.github/workflows/generate-sandboxes-next.yml +++ b/.github/workflows/generate-sandboxes-next.yml @@ -30,7 +30,10 @@ jobs: git config --global user.name "Storybook Bot" git config --global user.email "bot@storybook.js.org" - name: Install dependencies - run: node ./scripts/check-dependencies.js + run: | + cd ./scripts + node --loader esbuild-register/loader -r esbuild-register ./check-dependencies.ts + cd .. - name: Compile Storybook libraries run: yarn task --task compile --start-from=auto --no-link - name: Publishing to local registry diff --git a/scripts/check-dependencies.cjs b/scripts/check-dependencies.cjs deleted file mode 100755 index c8bd9114faf9..000000000000 --- a/scripts/check-dependencies.cjs +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -const { checkDependencies } = require('./utils/cli-utils'); - -checkDependencies().catch((e) => { - console.error(e); - process.exit(1); -}); diff --git a/scripts/check-dependencies.ts b/scripts/check-dependencies.ts new file mode 100755 index 000000000000..babee83b82f6 --- /dev/null +++ b/scripts/check-dependencies.ts @@ -0,0 +1,7 @@ +import { checkDependencies } from './utils/cli-utils'; + +checkDependencies().catch((e) => { + // eslint-disable-next-line no-console + console.error(e); + process.exit(1); +}); diff --git a/scripts/tasks/bench.ts b/scripts/tasks/bench.ts index 349d79ea7fa9..cead08852edb 100644 --- a/scripts/tasks/bench.ts +++ b/scripts/tasks/bench.ts @@ -1,3 +1,4 @@ +/* eslint-disable import/extensions */ import prettyBytes from 'pretty-bytes'; import prettyTime from 'pretty-ms'; @@ -19,8 +20,10 @@ export const bench: Task = { const controllers: AbortController[] = []; try { const { disableDocs } = options; - const { browse } = await import('../bench/browse'); - const { saveBench, loadBench } = await import('../bench/utils'); + // @ts-expect-error Default import required for dynamic import processed by esbuild + const { browse } = (await import('../bench/browse.ts')).default; + // @ts-expect-error Default import required for dynamic import processed by esbuild + const { saveBench, loadBench } = (await import('../bench/utils.ts')).default; const devController = await dev.run(details, { ...options, debug: false }); if (!devController) { @@ -28,6 +31,7 @@ export const bench: Task = { } controllers.push(devController); const devBrowseResult = await browse(`http://localhost:${devPort}`, { disableDocs }); + devController.abort(); const serveController = await serve.run(details, { ...options, debug: false }); @@ -35,6 +39,7 @@ export const bench: Task = { throw new Error('serve: controller is null'); } controllers.push(serveController); + const buildBrowseResult = await browse(`http://localhost:${servePort}`, { disableDocs }); serveController.abort();