Skip to content

Commit

Permalink
Merge pull request #21727 from storybookjs/norbert/fix-ui-storybook-d…
Browse files Browse the repository at this point in the history
…ev-upgrade-esbuild

Tech: upgrade esbuild, remove watch option from options
  • Loading branch information
ndelangen authored Mar 23, 2023
2 parents 14cb942 + 2f6ce19 commit 4a37372
Show file tree
Hide file tree
Showing 6 changed files with 266 additions and 232 deletions.
2 changes: 1 addition & 1 deletion code/lib/builder-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.10",
"browser-assert": "^1.2.1",
"ejs": "^3.1.8",
"esbuild": "^0.16.4",
"esbuild": "^0.17.0",
"esbuild-plugin-alias": "^0.2.1",
"express": "^4.17.3",
"find-cache-dir": "^3.0.0",
Expand Down
12 changes: 1 addition & 11 deletions code/lib/builder-manager/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ const starter: StarterFunction = async function* starterGeneratorFn({

compilation = await instance({
...config,
watch: true,
});

yield;
Expand Down Expand Up @@ -223,11 +222,11 @@ const builder: BuilderFunction = async function* builderGeneratorFn({ startTime,
const coreDirOrigin = join(dirname(require.resolve('@storybook/manager/package.json')), 'dist');
const coreDirTarget = join(options.outputDir, `sb-manager`);

// TODO: this doesn't watch, we should change this to use the esbuild watch API: https://esbuild.github.io/api/#watch
compilation = await instance({
...config,

minify: true,
watch: false,
});

yield;
Expand Down Expand Up @@ -281,15 +280,6 @@ export const bail: ManagerBuilder['bail'] = async () => {
//
}
}

if (compilation && compilation.stop) {
try {
compilation.stop();
logger.warn('Force closed manager build');
} catch (err) {
logger.warn('Unable to close manager build!');
}
}
};

export const start = async (options: BuilderStartOptions) => {
Expand Down
1 change: 1 addition & 0 deletions code/lib/builder-vite/src/optimizeDeps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const INCLUDE_CANDIDATES = [
'@mdx-js/react',
'@storybook/addon-docs > acorn-jsx',
'@storybook/addon-docs',
'@storybook/addon-essentials/docs/mdx-react-shim',
'@storybook/channel-postmessage',
'@storybook/channel-websocket',
'@storybook/client-api',
Expand Down
4 changes: 2 additions & 2 deletions code/lib/core-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"@types/node": "^16.0.0",
"@types/pretty-hrtime": "^1.0.0",
"chalk": "^4.1.0",
"esbuild": "^0.16.4",
"esbuild-register": "^3.3.3",
"esbuild": "^0.17.0",
"esbuild-register": "^3.4.0",
"file-system-cache": "^2.0.0",
"find-up": "^5.0.0",
"fs-extra": "^11.1.0",
Expand Down
6 changes: 3 additions & 3 deletions code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/experimental-utils": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"esbuild": "^0.16.4",
"esbuild": "^0.17.0",
"eslint": "^8.28.0",
"playwright": "1.31.1",
"serialize-javascript": "^3.1.0"
Expand Down Expand Up @@ -219,8 +219,8 @@
"concurrently": "^5.3.0",
"cross-env": "^7.0.3",
"danger": "^10.6.2",
"esbuild": "^0.16.4",
"esbuild-loader": "^2.19.0",
"esbuild": "^0.17.0",
"esbuild-loader": "^3.0.0",
"esbuild-plugin-alias": "^0.2.1",
"eslint": "^8.28.0",
"eslint-import-resolver-typescript": "^3.5.2",
Expand Down
Loading

0 comments on commit 4a37372

Please sign in to comment.