From a725eda543c052d06a14f26a88b0fa5256950ae8 Mon Sep 17 00:00:00 2001 From: 43081j <43081j@users.noreply.github.com> Date: Mon, 6 May 2024 23:27:03 +0100 Subject: [PATCH 01/64] feat: migrate from express to connect Migrates away from express, instead using connect and the underlying node server directly. Both express and connect support the same middleware structure, which means most middleware packages work for both and have remained the same in this change. A few notes: - Express' router has been replaced by basic connect mount points (though the two are not equivalent exactly) - Express static has been replaced by sirv This trims a large sub-tree of dependencies from our packages which express was pulling in. We in fact use very little of the functionality express gives us, only really making use of the connect-style API anyway. --- code/builders/builder-manager/package.json | 2 +- code/builders/builder-manager/src/index.ts | 48 ++++++-- code/builders/builder-vite/package.json | 3 +- code/builders/builder-vite/src/index.ts | 35 ++++-- code/builders/builder-webpack5/package.json | 2 +- code/builders/builder-webpack5/src/index.ts | 22 +++- code/lib/core-server/package.json | 3 +- code/lib/core-server/src/dev-server.ts | 23 ++-- code/lib/core-server/src/utils/doTelemetry.ts | 5 +- .../src/utils/get-caching-middleware.ts | 6 +- .../src/utils/getAccessControlMiddleware.ts | 12 +- .../src/utils/getStoryIndexGenerator.ts | 5 +- code/lib/core-server/src/utils/metadata.ts | 11 +- code/lib/core-server/src/utils/router.ts | 5 - code/lib/core-server/src/utils/server-init.ts | 4 +- .../core-server/src/utils/server-statics.ts | 112 +++++++++++++----- .../src/utils/stories-json.test.ts | 14 +-- .../lib/core-server/src/utils/stories-json.ts | 18 +-- code/lib/types/package.json | 1 - code/lib/types/src/modules/core-common.ts | 10 +- code/package.json | 1 - code/yarn.lock | 79 ++++++++++-- 22 files changed, 290 insertions(+), 131 deletions(-) delete mode 100644 code/lib/core-server/src/utils/router.ts diff --git a/code/builders/builder-manager/package.json b/code/builders/builder-manager/package.json index a472f7c4f339..de3bebff0b5c 100644 --- a/code/builders/builder-manager/package.json +++ b/code/builders/builder-manager/package.json @@ -54,9 +54,9 @@ "ejs": "^3.1.8", "esbuild": "^0.18.0 || ^0.19.0 || ^0.20.0", "esbuild-plugin-alias": "^0.2.1", - "express": "^4.17.3", "fs-extra": "^11.1.0", "process": "^0.11.10", + "sirv": "^2.0.4", "util": "^0.12.4" }, "devDependencies": { diff --git a/code/builders/builder-manager/src/index.ts b/code/builders/builder-manager/src/index.ts index 28e6fdd5a55e..cb5346423630 100644 --- a/code/builders/builder-manager/src/index.ts +++ b/code/builders/builder-manager/src/index.ts @@ -1,6 +1,6 @@ import { dirname, join, parse } from 'path'; import fs from 'fs-extra'; -import express from 'express'; +import sirv from 'sirv'; import { logger } from '@storybook/node-logger'; @@ -26,6 +26,7 @@ import { safeResolve } from './utils/safeResolve'; import { readOrderedFiles } from './utils/files'; import { buildFrameworkGlobalsFromOptions } from './utils/framework'; +const isRootPath = /^\/($|\?)/; let compilation: Compilation; let asyncIterator: ReturnType | ReturnType; @@ -124,7 +125,7 @@ export const executor = { const starter: StarterFunction = async function* starterGeneratorFn({ startTime, options, - router, + app, }) { logger.info('=> Starting manager..'); @@ -159,8 +160,33 @@ const starter: StarterFunction = async function* starterGeneratorFn({ const coreDirOrigin = join(dirname(require.resolve('@storybook/manager/package.json')), 'dist'); - router.use(`/sb-addons`, express.static(addonsDir, { immutable: true, maxAge: '5m' })); - router.use(`/sb-manager`, express.static(coreDirOrigin, { immutable: true, maxAge: '5m' })); + const serveAddons = sirv(addonsDir, { + maxAge: 300000, + dev: true, + immutable: true + }); + const serveCore = sirv(coreDirOrigin, { + maxAge: 300000, + dev: true, + immutable: true + }); + // TODO (43081j): maybe abstract this into a reusable function + app.use('/sb-addons', (req, res, next) => { + if (!req.url || req.url === '/') { + next(); + return; + } + + serveAddons(req, res, next); + }); + app.use('/sb-manager', (req, res, next) => { + if (!req.url || req.url === '/') { + next(); + return; + } + + serveCore(req, res, next); + }); const { cssFiles, jsFiles } = await readOrderedFiles(addonsDir, compilation?.outputFiles); @@ -187,15 +213,19 @@ const starter: StarterFunction = async function* starterGeneratorFn({ yield; - router.use(`/`, ({ path }, res, next) => { - if (path === '/') { - res.status(200).send(html); + app.use('/', ({ url }, res, next) => { + if (isRootPath.test(url)) { + res.statusCode = 200; + res.write(html); + res.end(); } else { next(); } }); - router.use(`/index.html`, ({ path }, res) => { - res.status(200).send(html); + app.use(`/index.html`, (req, res) => { + res.statusCode = 200; + res.write(html); + res.end(); }); return { diff --git a/code/builders/builder-vite/package.json b/code/builders/builder-vite/package.json index db351000c368..2e44fa1136cb 100644 --- a/code/builders/builder-vite/package.json +++ b/code/builders/builder-vite/package.json @@ -55,14 +55,13 @@ "@types/find-cache-dir": "^3.2.1", "browser-assert": "^1.2.1", "es-module-lexer": "^1.5.0", - "express": "^4.17.3", "find-cache-dir": "^3.0.0", "fs-extra": "^11.1.0", "magic-string": "^0.30.0", + "sirv": "^2.0.4", "ts-dedent": "^2.0.0" }, "devDependencies": { - "@types/express": "^4.17.13", "@types/node": "^18.0.0", "glob": "^10.0.0", "slash": "^5.0.0", diff --git a/code/builders/builder-vite/src/index.ts b/code/builders/builder-vite/src/index.ts index 3c0b7591d2cf..798ab03f1471 100644 --- a/code/builders/builder-vite/src/index.ts +++ b/code/builders/builder-vite/src/index.ts @@ -1,9 +1,8 @@ // noinspection JSUnusedGlobalSymbols import * as fs from 'fs-extra'; -import type { RequestHandler } from 'express'; +import type {NextHandleFunction} from 'connect'; import type { ViteDevServer } from 'vite'; -import express from 'express'; import { dirname, join, parse } from 'path'; import { NoStatsForViteDevError } from '@storybook/core-events/server-errors'; import type { Options } from '@storybook/types'; @@ -11,6 +10,7 @@ import { transformIframeHtml } from './transform-iframe-html'; import { createViteServer } from './vite-server'; import { build as viteBuild } from './build'; import type { ViteBuilder } from './types'; +import sirv from 'sirv'; export { withoutVitePlugins } from './utils/without-vite-plugins'; export { hasVitePlugins } from './utils/has-vite-plugins'; @@ -20,16 +20,17 @@ export * from './types'; const getAbsolutePath = (input: I): I => dirname(require.resolve(join(input, 'package.json'))) as any; -function iframeMiddleware(options: Options, server: ViteDevServer): RequestHandler { +function iframeMiddleware(options: Options, server: ViteDevServer): NextHandleFunction { return async (req, res, next) => { - if (!req.url.match(/^\/iframe\.html($|\?)/)) { + if (!req.url || !req.url.match(/^\/iframe\.html($|\?)/)) { next(); return; } + const url = new URL(req.url, 'https://storybook.js.org'); // We need to handle `html-proxy` params for style tag HMR https://github.com/storybookjs/builder-vite/issues/266#issuecomment-1055677865 // e.g. /iframe.html?html-proxy&index=0.css - if (req.query['html-proxy'] !== undefined) { + if (url.searchParams.has('html-proxy')) { next(); return; } @@ -41,7 +42,9 @@ function iframeMiddleware(options: Options, server: ViteDevServer): RequestHandl const generated = await transformIframeHtml(indexHtml, options); const transformed = await server.transformIndexHtml('/iframe.html', generated); res.setHeader('Content-Type', 'text/html'); - res.status(200).send(transformed); + res.statusCode = 200; + res.write(transformed); + res.end(); }; } @@ -54,18 +57,30 @@ export async function bail(): Promise { export const start: ViteBuilder['start'] = async ({ startTime, options, - router, + app, server: devServer, }) => { server = await createViteServer(options as Options, devServer); const previewResolvedDir = getAbsolutePath('@storybook/preview'); const previewDirOrigin = join(previewResolvedDir, 'dist'); + const servePreview = sirv(previewDirOrigin, { + maxAge: 300000, + dev: true, + immutable: true + }); + + app.use('/sb-preview', (req, res, next) => { + if (!req.url || req.url === '/') { + next(); + return; + } - router.use(`/sb-preview`, express.static(previewDirOrigin, { immutable: true, maxAge: '5m' })); + servePreview(req, res, next); + }); - router.use(iframeMiddleware(options as Options, server)); - router.use(server.middlewares); + app.use(iframeMiddleware(options as Options, server)); + app.use(server.middlewares); return { bail, diff --git a/code/builders/builder-webpack5/package.json b/code/builders/builder-webpack5/package.json index 0c346841e92f..4f734d96dc75 100644 --- a/code/builders/builder-webpack5/package.json +++ b/code/builders/builder-webpack5/package.json @@ -79,7 +79,6 @@ "constants-browserify": "^1.0.0", "css-loader": "^6.7.1", "es-module-lexer": "^1.5.0", - "express": "^4.17.3", "fork-ts-checker-webpack-plugin": "^8.0.0", "fs-extra": "^11.1.0", "html-webpack-plugin": "^5.5.0", @@ -87,6 +86,7 @@ "path-browserify": "^1.0.1", "process": "^0.11.10", "semver": "^7.3.7", + "sirv": "^2.0.4", "style-loader": "^3.3.1", "terser-webpack-plugin": "^5.3.1", "ts-dedent": "^2.0.0", diff --git a/code/builders/builder-webpack5/src/index.ts b/code/builders/builder-webpack5/src/index.ts index 6473f7db3c3d..0c5baf8c0654 100644 --- a/code/builders/builder-webpack5/src/index.ts +++ b/code/builders/builder-webpack5/src/index.ts @@ -6,7 +6,6 @@ import { logger } from '@storybook/node-logger'; import type { Builder, Options } from '@storybook/types'; import { checkWebpackVersion } from '@storybook/core-webpack'; import { dirname, join, parse } from 'path'; -import express from 'express'; import fs from 'fs-extra'; import { PREVIEW_BUILDER_PROGRESS } from '@storybook/core-events'; import { @@ -14,6 +13,7 @@ import { WebpackInvocationError, WebpackMissingStatsError, } from '@storybook/core-events/server-errors'; +import sirv from 'sirv'; import prettyTime from 'pretty-hrtime'; @@ -114,7 +114,7 @@ export const bail: WebpackBuilder['bail'] = async () => { const starter: StarterFunction = async function* starterGeneratorFn({ startTime, options, - router, + app, channel, }) { const webpackInstance = await executor.get(options); @@ -181,11 +181,23 @@ const starter: StarterFunction = async function* starterGeneratorFn({ const previewResolvedDir = getAbsolutePath('@storybook/preview'); const previewDirOrigin = join(previewResolvedDir, 'dist'); + const servePreview = sirv(previewDirOrigin, { + maxAge: 300000, + dev: true, + immutable: true + }); + + app.use('/sb-preview', (req, res, next) => { + if (!req.url || req.url === '/') { + next(); + return; + } - router.use(`/sb-preview`, express.static(previewDirOrigin, { immutable: true, maxAge: '5m' })); + servePreview(req, res, next); + }); - router.use(compilation); - router.use(webpackHotMiddleware(compiler, { log: false })); + app.use(compilation); + app.use(webpackHotMiddleware(compiler, { log: false })); const stats = await new Promise((res, rej) => { compilation?.waitUntilValid(res as any); diff --git a/code/lib/core-server/package.json b/code/lib/core-server/package.json index 9d4850f18142..6ab535ce8cb0 100644 --- a/code/lib/core-server/package.json +++ b/code/lib/core-server/package.json @@ -82,9 +82,9 @@ "chalk": "^4.1.0", "cli-table3": "^0.6.1", "compression": "^1.7.4", + "connect": "^3.7.0", "detect-port": "^1.3.0", "diff": "^5.2.0", - "express": "^4.17.3", "fs-extra": "^11.1.0", "globby": "^14.0.1", "ip": "^2.0.1", @@ -94,6 +94,7 @@ "prompts": "^2.4.0", "read-pkg-up": "^7.0.1", "semver": "^7.3.7", + "sirv": "^2.0.4", "telejson": "^7.2.0", "tiny-invariant": "^1.3.1", "ts-dedent": "^2.0.0", diff --git a/code/lib/core-server/src/dev-server.ts b/code/lib/core-server/src/dev-server.ts index f8805a75a690..46351e1d2cf2 100644 --- a/code/lib/core-server/src/dev-server.ts +++ b/code/lib/core-server/src/dev-server.ts @@ -1,4 +1,3 @@ -import express from 'express'; import compression from 'compression'; import invariant from 'tiny-invariant'; @@ -19,12 +18,12 @@ import { getManagerBuilder, getPreviewBuilder } from './utils/get-builders'; import type { StoryIndexGenerator } from './utils/StoryIndexGenerator'; import { getStoryIndexGenerator } from './utils/getStoryIndexGenerator'; import { doTelemetry } from './utils/doTelemetry'; -import { router } from './utils/router'; import { getAccessControlMiddleware } from './utils/getAccessControlMiddleware'; import { getCachingMiddleware } from './utils/get-caching-middleware'; +import connect, {type NextHandleFunction} from 'connect'; export async function storybookDevServer(options: Options) { - const app = express(); + const app = connect(); const [server, features, core] = await Promise.all([ getServer(app, options), @@ -40,12 +39,12 @@ export async function storybookDevServer(options: Options) { let indexError: Error | undefined; // try get index generator, if failed, send telemetry without storyCount, then rethrow the error const initializedStoryIndexGenerator: Promise = - getStoryIndexGenerator(features ?? {}, options, serverChannel).catch((err) => { + getStoryIndexGenerator(app, features ?? {}, options, serverChannel).catch((err) => { indexError = err; return undefined; }); - app.use(compression({ level: 1 })); + app.use(compression({ level: 1 }) as NextHandleFunction); if (typeof options.extendServer === 'function') { options.extendServer(server); @@ -54,9 +53,7 @@ export async function storybookDevServer(options: Options) { app.use(getAccessControlMiddleware(core?.crossOriginIsolated ?? false)); app.use(getCachingMiddleware()); - getMiddleware(options.configDir)(router); - - app.use(router); + getMiddleware(options.configDir)(app); const { port, host, initialPath } = options; invariant(port, 'expected options to have a port'); @@ -77,7 +74,7 @@ export async function storybookDevServer(options: Options) { const [previewBuilder, managerBuilder] = await Promise.all([ getPreviewBuilder(builderName, options.configDir), getManagerBuilder(), - useStatics(router, options), + useStatics(app, options), ]); if (options.debugWebpack) { @@ -87,7 +84,7 @@ export async function storybookDevServer(options: Options) { const managerResult = await managerBuilder.start({ startTime: process.hrtime(), options, - router, + app, server, channel: serverChannel, }); @@ -100,7 +97,7 @@ export async function storybookDevServer(options: Options) { .start({ startTime: process.hrtime(), options, - router, + app, server, channel: serverChannel, }) @@ -122,7 +119,7 @@ export async function storybookDevServer(options: Options) { // this is a preview route, the builder has to be started before we can serve it // this handler keeps request to that route pending until the builder is ready to serve it, preventing a 404 - router.get('/iframe.html', (req, res, next) => { + app.use('/iframe.html', (req, res, next) => { // We need to catch here or node will treat any errors thrown by `previewStarted` as // unhandled and exit (even though they are very much handled below) previewStarted.catch(() => {}).then(() => next()); @@ -142,7 +139,7 @@ export async function storybookDevServer(options: Options) { const previewResult = await previewStarted; // Now the preview has successfully started, we can count this as a 'dev' event. - doTelemetry(core, initializedStoryIndexGenerator, options); + doTelemetry(app, core, initializedStoryIndexGenerator, options); return { previewResult, managerResult, address, networkAddress }; } diff --git a/code/lib/core-server/src/utils/doTelemetry.ts b/code/lib/core-server/src/utils/doTelemetry.ts index ecb494fc45f5..2c07cb83970c 100644 --- a/code/lib/core-server/src/utils/doTelemetry.ts +++ b/code/lib/core-server/src/utils/doTelemetry.ts @@ -4,11 +4,12 @@ import { telemetry, getPrecedingUpgrade } from '@storybook/telemetry'; import { useStorybookMetadata } from './metadata'; import type { StoryIndexGenerator } from './StoryIndexGenerator'; import { summarizeIndex } from './summarizeIndex'; -import { router } from './router'; import { versionStatus } from './versionStatus'; import { sendTelemetryError } from '../withTelemetry'; +import type { Server } from 'connect'; export async function doTelemetry( + app: Server, core: CoreConfig, initializedStoryIndexGenerator: Promise, options: Options @@ -47,6 +48,6 @@ export async function doTelemetry( } if (!core?.disableProjectJson) { - useStorybookMetadata(router, options.configDir); + useStorybookMetadata(app, options.configDir); } } diff --git a/code/lib/core-server/src/utils/get-caching-middleware.ts b/code/lib/core-server/src/utils/get-caching-middleware.ts index d01cb3e5e922..fe7554def150 100644 --- a/code/lib/core-server/src/utils/get-caching-middleware.ts +++ b/code/lib/core-server/src/utils/get-caching-middleware.ts @@ -1,8 +1,8 @@ -import type { RequestHandler } from 'express'; +import type { NextHandleFunction } from 'connect'; -export function getCachingMiddleware(): RequestHandler { +export function getCachingMiddleware(): NextHandleFunction { return (req, res, next) => { - res.header('Cache-Control', 'no-store'); + res.setHeader('Cache-Control', 'no-store'); next(); }; } diff --git a/code/lib/core-server/src/utils/getAccessControlMiddleware.ts b/code/lib/core-server/src/utils/getAccessControlMiddleware.ts index 9eb8851e6a5c..23e0caf276bd 100644 --- a/code/lib/core-server/src/utils/getAccessControlMiddleware.ts +++ b/code/lib/core-server/src/utils/getAccessControlMiddleware.ts @@ -1,16 +1,16 @@ -import type { RequestHandler } from 'express'; +import type { NextHandleFunction } from 'connect'; -export function getAccessControlMiddleware(crossOriginIsolated: boolean): RequestHandler { +export function getAccessControlMiddleware(crossOriginIsolated: boolean): NextHandleFunction { return (req, res, next) => { - res.header('Access-Control-Allow-Origin', '*'); - res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept'); + res.setHeader('Access-Control-Allow-Origin', '*'); + res.setHeader('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept'); // These headers are required to enable SharedArrayBuffer // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer if (crossOriginIsolated) { // These headers are required to enable SharedArrayBuffer // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer - res.header('Cross-Origin-Opener-Policy', 'same-origin'); - res.header('Cross-Origin-Embedder-Policy', 'require-corp'); + res.setHeader('Cross-Origin-Opener-Policy', 'same-origin'); + res.setHeader('Cross-Origin-Embedder-Policy', 'require-corp'); } next(); }; diff --git a/code/lib/core-server/src/utils/getStoryIndexGenerator.ts b/code/lib/core-server/src/utils/getStoryIndexGenerator.ts index f8c1bc97f615..12f9da95fce5 100644 --- a/code/lib/core-server/src/utils/getStoryIndexGenerator.ts +++ b/code/lib/core-server/src/utils/getStoryIndexGenerator.ts @@ -3,9 +3,10 @@ import { normalizeStories } from '@storybook/core-common'; import { useStoriesJson } from './stories-json'; import type { ServerChannel } from './get-server-channel'; import { StoryIndexGenerator } from './StoryIndexGenerator'; -import { router } from './router'; +import type { Server } from 'connect'; export async function getStoryIndexGenerator( + app: Server, features: { argTypeTargetsV7?: boolean; }, @@ -32,7 +33,7 @@ export async function getStoryIndexGenerator( const initializedStoryIndexGenerator = generator.initialize().then(() => generator); useStoriesJson({ - router, + app, initializedStoryIndexGenerator, normalizedStories, serverChannel, diff --git a/code/lib/core-server/src/utils/metadata.ts b/code/lib/core-server/src/utils/metadata.ts index 319b001ea7b9..5aedb18385bf 100644 --- a/code/lib/core-server/src/utils/metadata.ts +++ b/code/lib/core-server/src/utils/metadata.ts @@ -1,5 +1,5 @@ import { writeJSON } from 'fs-extra'; -import type { Request, Response, Router } from 'express'; +import type { Server } from 'connect'; import { getStorybookMetadata } from '@storybook/telemetry'; export async function extractStorybookMetadata(outputFile: string, configDir: string) { @@ -8,10 +8,11 @@ export async function extractStorybookMetadata(outputFile: string, configDir: st await writeJSON(outputFile, storybookMetadata); } -export function useStorybookMetadata(router: Router, configDir?: string) { - router.use('/project.json', async (req: Request, res: Response) => { +export function useStorybookMetadata(app: Server, configDir?: string) { + app.use('/project.json', async (req, res) => { const storybookMetadata = await getStorybookMetadata(configDir); - res.header('Content-Type', 'application/json'); - res.send(JSON.stringify(storybookMetadata)); + res.setHeader('Content-Type', 'application/json'); + res.write(JSON.stringify(storybookMetadata)); + res.end(); }); } diff --git a/code/lib/core-server/src/utils/router.ts b/code/lib/core-server/src/utils/router.ts deleted file mode 100644 index 894388991b5f..000000000000 --- a/code/lib/core-server/src/utils/router.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Router } from 'express'; - -// @ts-expect-error (Converted from ts-ignore) - -export const router: Router = new Router(); diff --git a/code/lib/core-server/src/utils/server-init.ts b/code/lib/core-server/src/utils/server-init.ts index 176c1e6bfd69..bf2c873a5d38 100644 --- a/code/lib/core-server/src/utils/server-init.ts +++ b/code/lib/core-server/src/utils/server-init.ts @@ -1,11 +1,11 @@ import { logger } from '@storybook/node-logger'; -import type { Express } from 'express'; +import type { Server } from 'connect'; import { readFile } from 'fs-extra'; import http from 'http'; import https from 'https'; export async function getServer( - app: Express, + app: Server, options: { https?: boolean; sslCert?: string; diff --git a/code/lib/core-server/src/utils/server-statics.ts b/code/lib/core-server/src/utils/server-statics.ts index 2a0b93e1ca41..9b264a5dcd99 100644 --- a/code/lib/core-server/src/utils/server-statics.ts +++ b/code/lib/core-server/src/utils/server-statics.ts @@ -2,51 +2,99 @@ import { logger } from '@storybook/node-logger'; import type { Options } from '@storybook/types'; import { getDirectoryFromWorkingDir } from '@storybook/core-common'; import chalk from 'chalk'; -import type { Router } from 'express'; -import express from 'express'; +import type {NextHandleFunction, Server} from 'connect'; import { pathExists } from 'fs-extra'; import path, { basename, isAbsolute } from 'path'; +import sirv from 'sirv'; +import type {ServerResponse} from 'http'; import { dedent } from 'ts-dedent'; -export async function useStatics(router: Router, options: Options) { +// TODO (43081j): maybe get this from somewhere? +const contentTypes: Record = { + 'css': 'text/css', + 'woff2': 'font/woff2', + 'js': 'text/javascript' +}; +const setContentTypeHeaders = (res: ServerResponse, pathname: string) => { + const base = basename(pathname); + const contentType = contentTypes[base]; + if (contentType) { + res.setHeader('Content-Type', contentType); + } +}; + +export async function useStatics(app: Server, options: Options): Promise { const staticDirs = (await options.presets.apply('staticDirs')) ?? []; const faviconPath = await options.presets.apply('favicon'); - const statics = [ + const statics: Array<{targetEndpoint: string; staticPath: string}> = []; + const userStatics = [ + `${faviconPath}:/${basename(faviconPath)}`, ...staticDirs.map((dir) => (typeof dir === 'string' ? dir : `${dir.from}:${dir.to}`)), ]; - if (statics && statics.length > 0) { - await Promise.all( - statics.map(async (dir) => { - try { - const normalizedDir = - staticDirs && !isAbsolute(dir) - ? getDirectoryFromWorkingDir({ - configDir: options.configDir, - workingDir: process.cwd(), - directory: dir, - }) - : dir; - const { staticDir, staticPath, targetEndpoint } = await parseStaticDir(normalizedDir); - - // Don't log for the internal static dir - if (!targetEndpoint.startsWith('/sb-')) { - logger.info( - chalk`=> Serving static files from {cyan ${staticDir}} at {cyan ${targetEndpoint}}` - ); - } - - router.use(targetEndpoint, express.static(staticPath, { index: false })); - } catch (e) { - if (e instanceof Error) logger.warn(e.message); - } - }) - ); + for (const dir of userStatics) { + try { + const normalizedDir = + staticDirs && !isAbsolute(dir) + ? getDirectoryFromWorkingDir({ + configDir: options.configDir, + workingDir: process.cwd(), + directory: dir, + }) + : dir; + const { staticDir, staticPath, targetEndpoint } = await parseStaticDir(normalizedDir); + + // Don't log for the internal static dir + if (!targetEndpoint.startsWith('/sb-')) { + logger.info( + chalk`=> Serving static files from {cyan ${staticDir}} at {cyan ${targetEndpoint}}` + ); + } + + statics.push({targetEndpoint, staticPath}); + } catch (e) { + if (e instanceof Error) logger.warn(e.message); + } } - router.get(`/${basename(faviconPath)}`, (req, res) => res.sendFile(faviconPath)); + const serve = sirv( + process.cwd(), + { + dev: true, + etag: true, + setHeaders: setContentTypeHeaders + } + ); + + app.use((req, res, next) => { + if (!req.url) { + return next(); + } + + const url = new URL(req.url, 'https://storybook.js.org'); + const pathname = path.normalize(url.pathname); + + // TODO (43081j): this is 'security' so you can't break out of cwd + // Probably need to do something better here + if (pathname.startsWith('..') || pathname.endsWith('/')) { + return next(); + } + + for (const {targetEndpoint, staticPath} of statics) { + if (pathname.startsWith(targetEndpoint)) { + // TODO (43081j): similar as above, this might be doable in a cleaner way + const newPath = path.relative(process.cwd(), path.resolve(staticPath, './' + pathname.slice(targetEndpoint.length))); + url.pathname = newPath; + req.url = url.href.slice(url.origin.length); + serve(req, res, next); + return; + } + } + + next(); + }); } export const parseStaticDir = async (arg: string) => { diff --git a/code/lib/core-server/src/utils/stories-json.test.ts b/code/lib/core-server/src/utils/stories-json.test.ts index a621f5443ce3..9d7d6e2da036 100644 --- a/code/lib/core-server/src/utils/stories-json.test.ts +++ b/code/lib/core-server/src/utils/stories-json.test.ts @@ -1,6 +1,6 @@ import { describe, beforeEach, it, expect, vi } from 'vitest'; -import type { Router, Request, Response } from 'express'; +import type { Server } from 'connect'; import Watchpack from 'watchpack'; import path from 'path'; import debounce from 'lodash/debounce.js'; @@ -55,7 +55,7 @@ const getInitializedStoryIndexGenerator = async ( describe('useStoriesJson', () => { const use = vi.fn(); - const router: Router = { use } as any; + const app: Server = { use } as any; const send = vi.fn(); const write = vi.fn(); const response: Response = { @@ -86,7 +86,7 @@ describe('useStoriesJson', () => { const mockServerChannel = { emit: vi.fn() } as any as ServerChannel; console.time('useStoriesJson'); useStoriesJson({ - router, + app, serverChannel: mockServerChannel, workingDir, normalizedStories, @@ -255,7 +255,7 @@ describe('useStoriesJson', () => { const mockServerChannel = { emit: vi.fn() } as any as ServerChannel; useStoriesJson({ - router, + app, serverChannel: mockServerChannel, workingDir, normalizedStories, @@ -287,7 +287,7 @@ describe('useStoriesJson', () => { it('sends invalidate events', async () => { const mockServerChannel = { emit: vi.fn() } as any as ServerChannel; useStoriesJson({ - router, + app, serverChannel: mockServerChannel, workingDir, normalizedStories, @@ -316,7 +316,7 @@ describe('useStoriesJson', () => { it('only sends one invalidation when multiple event listeners are listening', async () => { const mockServerChannel = { emit: vi.fn() } as any as ServerChannel; useStoriesJson({ - router, + app, serverChannel: mockServerChannel, workingDir, normalizedStories, @@ -354,7 +354,7 @@ describe('useStoriesJson', () => { const mockServerChannel = { emit: vi.fn() } as any as ServerChannel; useStoriesJson({ - router, + app, serverChannel: mockServerChannel, workingDir, normalizedStories, diff --git a/code/lib/core-server/src/utils/stories-json.ts b/code/lib/core-server/src/utils/stories-json.ts index 074c0248cb0c..ae9c72c90d1f 100644 --- a/code/lib/core-server/src/utils/stories-json.ts +++ b/code/lib/core-server/src/utils/stories-json.ts @@ -1,4 +1,4 @@ -import type { Router, Request, Response } from 'express'; +import type { Server } from 'connect'; import { writeJSON } from 'fs-extra'; import type { NormalizedStoriesSpecifier, StoryIndex } from '@storybook/types'; @@ -22,13 +22,13 @@ export async function extractStoriesJson( } export function useStoriesJson({ - router, + app, initializedStoryIndexGenerator, workingDir = process.cwd(), serverChannel, normalizedStories, }: { - router: Router; + app: Server; initializedStoryIndexGenerator: Promise; serverChannel: ServerChannel; workingDir?: string; @@ -43,15 +43,17 @@ export function useStoriesJson({ maybeInvalidate(); }); - router.use('/index.json', async (req: Request, res: Response) => { + app.use('/index.json', async (req, res) => { try { const generator = await initializedStoryIndexGenerator; const index = await generator.getIndex(); - res.header('Content-Type', 'application/json'); - res.send(JSON.stringify(index)); + res.setHeader('Content-Type', 'application/json'); + res.write(JSON.stringify(index)); + res.end(); } catch (err) { - res.status(500); - res.send(err instanceof Error ? err.toString() : String(err)); + res.statusCode = 500; + res.write(err instanceof Error ? err.toString() : String(err)); + res.end(); } }); } diff --git a/code/lib/types/package.json b/code/lib/types/package.json index 58824511b291..558e0b19dce7 100644 --- a/code/lib/types/package.json +++ b/code/lib/types/package.json @@ -45,7 +45,6 @@ }, "dependencies": { "@storybook/channels": "workspace:*", - "@types/express": "^4.7.0", "file-system-cache": "2.3.0" }, "devDependencies": { diff --git a/code/lib/types/src/modules/core-common.ts b/code/lib/types/src/modules/core-common.ts index c4aeeacbcf1f..e5e2af12457a 100644 --- a/code/lib/types/src/modules/core-common.ts +++ b/code/lib/types/src/modules/core-common.ts @@ -1,8 +1,8 @@ /* eslint-disable @typescript-eslint/naming-convention */ import type { FileSystemCache } from 'file-system-cache'; import type { Options as TelejsonOptions } from 'telejson'; -import type { Router } from 'express'; -import type { Server } from 'http'; +import type { Server } from 'connect'; +import type { Server as HttpServer } from 'http'; import type { PackageJson as PackageJsonFromTypeFest } from 'type-fest'; import type { StoriesEntry, Indexer } from './indexer'; @@ -157,7 +157,7 @@ export interface LoadOptions { configDir?: string; cacheKey?: string; ignorePreview?: boolean; - extendServer?: (server: Server) => void; + extendServer?: (server: HttpServer) => void; } export interface CLIOptions { @@ -217,8 +217,8 @@ export interface Builder { start: (args: { options: Options; startTime: ReturnType; - router: Router; - server: Server; + app: Server; + server: HttpServer; channel: ServerChannel; }) => Promise= 1.4.0 < 2": +"statuses@npm:>= 1.4.0 < 2, statuses@npm:~1.5.0": version: 1.5.0 resolution: "statuses@npm:1.5.0" checksum: 10c0/e433900956357b3efd79b1c547da4d291799ac836960c016d10a98f6a810b1b5c0dcc13b5a7aa609a58239b5190e1ea176ad9221c2157d2fd1c747393e6b2940 @@ -27456,6 +27508,13 @@ __metadata: languageName: node linkType: hard +"totalist@npm:^3.0.0": + version: 3.0.1 + resolution: "totalist@npm:3.0.1" + checksum: 10c0/4bb1fadb69c3edbef91c73ebef9d25b33bbf69afe1e37ce544d5f7d13854cda15e47132f3e0dc4cafe300ddb8578c77c50a65004d8b6e97e77934a69aa924863 + languageName: node + linkType: hard + "tough-cookie@npm:^4.1.3": version: 4.1.3 resolution: "tough-cookie@npm:4.1.3" From 9b0b42aebbd41c07488a56f7cdebc76efdce0b92 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 7 May 2024 15:50:56 +0200 Subject: [PATCH 02/64] fix --- code/builders/builder-manager/src/index.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/code/builders/builder-manager/src/index.ts b/code/builders/builder-manager/src/index.ts index cb5346423630..5b0dd2373ea9 100644 --- a/code/builders/builder-manager/src/index.ts +++ b/code/builders/builder-manager/src/index.ts @@ -122,11 +122,7 @@ export const executor = { * * I am sorry for making you read about generators today :') */ -const starter: StarterFunction = async function* starterGeneratorFn({ - startTime, - options, - app, -}) { +const starter: StarterFunction = async function* starterGeneratorFn({ startTime, options, app }) { logger.info('=> Starting manager..'); const { @@ -163,12 +159,12 @@ const starter: StarterFunction = async function* starterGeneratorFn({ const serveAddons = sirv(addonsDir, { maxAge: 300000, dev: true, - immutable: true + immutable: true, }); const serveCore = sirv(coreDirOrigin, { maxAge: 300000, dev: true, - immutable: true + immutable: true, }); // TODO (43081j): maybe abstract this into a reusable function app.use('/sb-addons', (req, res, next) => { @@ -214,7 +210,7 @@ const starter: StarterFunction = async function* starterGeneratorFn({ yield; app.use('/', ({ url }, res, next) => { - if (isRootPath.test(url)) { + if (url && isRootPath.test(url)) { res.statusCode = 200; res.write(html); res.end(); From 81292297e8333b57086fae7cae94b6a484df84dc Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 7 May 2024 16:39:37 +0200 Subject: [PATCH 03/64] fix linting --- code/builders/builder-vite/src/index.ts | 4 +-- code/builders/builder-webpack5/src/index.ts | 2 +- code/lib/core-server/src/dev-server.ts | 2 +- .../core-server/src/utils/server-statics.ts | 34 +++++++++---------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/code/builders/builder-vite/src/index.ts b/code/builders/builder-vite/src/index.ts index 798ab03f1471..5500261989d5 100644 --- a/code/builders/builder-vite/src/index.ts +++ b/code/builders/builder-vite/src/index.ts @@ -1,7 +1,7 @@ // noinspection JSUnusedGlobalSymbols import * as fs from 'fs-extra'; -import type {NextHandleFunction} from 'connect'; +import type { NextHandleFunction } from 'connect'; import type { ViteDevServer } from 'vite'; import { dirname, join, parse } from 'path'; import { NoStatsForViteDevError } from '@storybook/core-events/server-errors'; @@ -67,7 +67,7 @@ export const start: ViteBuilder['start'] = async ({ const servePreview = sirv(previewDirOrigin, { maxAge: 300000, dev: true, - immutable: true + immutable: true, }); app.use('/sb-preview', (req, res, next) => { diff --git a/code/builders/builder-webpack5/src/index.ts b/code/builders/builder-webpack5/src/index.ts index 0c5baf8c0654..19e6385feb17 100644 --- a/code/builders/builder-webpack5/src/index.ts +++ b/code/builders/builder-webpack5/src/index.ts @@ -184,7 +184,7 @@ const starter: StarterFunction = async function* starterGeneratorFn({ const servePreview = sirv(previewDirOrigin, { maxAge: 300000, dev: true, - immutable: true + immutable: true, }); app.use('/sb-preview', (req, res, next) => { diff --git a/code/lib/core-server/src/dev-server.ts b/code/lib/core-server/src/dev-server.ts index 46351e1d2cf2..74d56058571b 100644 --- a/code/lib/core-server/src/dev-server.ts +++ b/code/lib/core-server/src/dev-server.ts @@ -20,7 +20,7 @@ import { getStoryIndexGenerator } from './utils/getStoryIndexGenerator'; import { doTelemetry } from './utils/doTelemetry'; import { getAccessControlMiddleware } from './utils/getAccessControlMiddleware'; import { getCachingMiddleware } from './utils/get-caching-middleware'; -import connect, {type NextHandleFunction} from 'connect'; +import connect, { type NextHandleFunction } from 'connect'; export async function storybookDevServer(options: Options) { const app = connect(); diff --git a/code/lib/core-server/src/utils/server-statics.ts b/code/lib/core-server/src/utils/server-statics.ts index 9b264a5dcd99..bc664d13132f 100644 --- a/code/lib/core-server/src/utils/server-statics.ts +++ b/code/lib/core-server/src/utils/server-statics.ts @@ -2,19 +2,19 @@ import { logger } from '@storybook/node-logger'; import type { Options } from '@storybook/types'; import { getDirectoryFromWorkingDir } from '@storybook/core-common'; import chalk from 'chalk'; -import type {NextHandleFunction, Server} from 'connect'; +import type { NextHandleFunction, Server } from 'connect'; import { pathExists } from 'fs-extra'; import path, { basename, isAbsolute } from 'path'; import sirv from 'sirv'; -import type {ServerResponse} from 'http'; +import type { ServerResponse } from 'http'; import { dedent } from 'ts-dedent'; // TODO (43081j): maybe get this from somewhere? const contentTypes: Record = { - 'css': 'text/css', - 'woff2': 'font/woff2', - 'js': 'text/javascript' + css: 'text/css', + woff2: 'font/woff2', + js: 'text/javascript', }; const setContentTypeHeaders = (res: ServerResponse, pathname: string) => { const base = basename(pathname); @@ -28,7 +28,7 @@ export async function useStatics(app: Server, options: Options): Promise { const staticDirs = (await options.presets.apply('staticDirs')) ?? []; const faviconPath = await options.presets.apply('favicon'); - const statics: Array<{targetEndpoint: string; staticPath: string}> = []; + const statics: Array<{ targetEndpoint: string; staticPath: string }> = []; const userStatics = [ `${faviconPath}:/${basename(faviconPath)}`, ...staticDirs.map((dir) => (typeof dir === 'string' ? dir : `${dir.from}:${dir.to}`)), @@ -53,20 +53,17 @@ export async function useStatics(app: Server, options: Options): Promise { ); } - statics.push({targetEndpoint, staticPath}); + statics.push({ targetEndpoint, staticPath }); } catch (e) { if (e instanceof Error) logger.warn(e.message); } } - const serve = sirv( - process.cwd(), - { - dev: true, - etag: true, - setHeaders: setContentTypeHeaders - } - ); + const serve = sirv(process.cwd(), { + dev: true, + etag: true, + setHeaders: setContentTypeHeaders, + }); app.use((req, res, next) => { if (!req.url) { @@ -82,10 +79,13 @@ export async function useStatics(app: Server, options: Options): Promise { return next(); } - for (const {targetEndpoint, staticPath} of statics) { + for (const { targetEndpoint, staticPath } of statics) { if (pathname.startsWith(targetEndpoint)) { // TODO (43081j): similar as above, this might be doable in a cleaner way - const newPath = path.relative(process.cwd(), path.resolve(staticPath, './' + pathname.slice(targetEndpoint.length))); + const newPath = path.relative( + process.cwd(), + path.resolve(staticPath, './' + pathname.slice(targetEndpoint.length)) + ); url.pathname = newPath; req.url = url.href.slice(url.origin.length); serve(req, res, next); From ffa4f0b90896b54b33f04addd13d5d901543ee2a Mon Sep 17 00:00:00 2001 From: 43081j <43081j@users.noreply.github.com> Date: Tue, 7 May 2024 21:13:41 +0100 Subject: [PATCH 04/64] test: fix stories-json test assertions --- .../src/utils/stories-json.test.ts | 20 +++++++++---------- .../lib/core-server/src/utils/stories-json.ts | 6 ++---- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/code/lib/core-server/src/utils/stories-json.test.ts b/code/lib/core-server/src/utils/stories-json.test.ts index 0700cebb11fb..d2370fdcd052 100644 --- a/code/lib/core-server/src/utils/stories-json.test.ts +++ b/code/lib/core-server/src/utils/stories-json.test.ts @@ -56,23 +56,23 @@ const getInitializedStoryIndexGenerator = async ( describe('useStoriesJson', () => { const use = vi.fn(); const app: Server = { use } as any; - const send = vi.fn(); + const end = vi.fn(); const write = vi.fn(); const response: Response = { header: vi.fn(), - send, + send: vi.fn(), status: vi.fn(), setHeader: vi.fn(), flushHeaders: vi.fn(), write, flush: vi.fn(), - end: vi.fn(), + end, on: vi.fn(), } as any; beforeEach(async () => { use.mockClear(); - send.mockClear(); + end.mockClear(); write.mockClear(); vi.mocked(debounce).mockImplementation((cb) => cb as any); Watchpack.mockClear(); @@ -102,8 +102,8 @@ describe('useStoriesJson', () => { await route(request, response); console.timeEnd('route'); - expect(send).toHaveBeenCalledTimes(1); - expect(JSON.parse(send.mock.calls[0][0])).toMatchInlineSnapshot(` + expect(end).toHaveBeenCalledTimes(1); + expect(JSON.parse(end.mock.calls[0][0])).toMatchInlineSnapshot(` { "entries": { "a--metaof": { @@ -283,14 +283,14 @@ describe('useStoriesJson', () => { const route = use.mock.calls[0][1]; const firstPromise = route(request, response); - const secondResponse = { ...response, send: vi.fn(), status: vi.fn() }; + const secondResponse = { ...response, end: vi.fn(), status: vi.fn() }; const secondPromise = route(request, secondResponse); await Promise.all([firstPromise, secondPromise]); - expect(send).toHaveBeenCalledTimes(1); + expect(end).toHaveBeenCalledTimes(1); expect(response.status).not.toEqual(500); - expect(secondResponse.send).toHaveBeenCalledTimes(1); + expect(secondResponse.end).toHaveBeenCalledTimes(1); expect(secondResponse.status).not.toEqual(500); }); }); @@ -298,7 +298,7 @@ describe('useStoriesJson', () => { describe('SSE endpoint', () => { beforeEach(() => { use.mockClear(); - send.mockClear(); + end.mockClear(); }); it('sends invalidate events', async () => { diff --git a/code/lib/core-server/src/utils/stories-json.ts b/code/lib/core-server/src/utils/stories-json.ts index 4bbaaed14fbc..87cef6342dc2 100644 --- a/code/lib/core-server/src/utils/stories-json.ts +++ b/code/lib/core-server/src/utils/stories-json.ts @@ -61,12 +61,10 @@ export function useStoriesJson({ const generator = await initializedStoryIndexGenerator; const index = await generator.getIndex(); res.setHeader('Content-Type', 'application/json'); - res.write(JSON.stringify(index)); - res.end(); + res.end(JSON.stringify(index)); } catch (err) { res.statusCode = 500; - res.write(err instanceof Error ? err.toString() : String(err)); - res.end(); + res.end(err instanceof Error ? err.toString() : String(err)); } }); } From b92d83b7fcd68140d662382ba8538fd9a3e1441d Mon Sep 17 00:00:00 2001 From: 43081j <43081j@users.noreply.github.com> Date: Tue, 7 May 2024 21:41:27 +0100 Subject: [PATCH 05/64] fix(core-server): remove unused import --- code/lib/core-server/src/utils/server-statics.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/lib/core-server/src/utils/server-statics.ts b/code/lib/core-server/src/utils/server-statics.ts index bc664d13132f..f63d88cab906 100644 --- a/code/lib/core-server/src/utils/server-statics.ts +++ b/code/lib/core-server/src/utils/server-statics.ts @@ -2,7 +2,7 @@ import { logger } from '@storybook/node-logger'; import type { Options } from '@storybook/types'; import { getDirectoryFromWorkingDir } from '@storybook/core-common'; import chalk from 'chalk'; -import type { NextHandleFunction, Server } from 'connect'; +import type { Server } from 'connect'; import { pathExists } from 'fs-extra'; import path, { basename, isAbsolute } from 'path'; import sirv from 'sirv'; From 29402760543fdb2ab469e13c8b65efea1ff04117 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Mon, 1 Jul 2024 17:04:42 +0200 Subject: [PATCH 06/64] update branch with CPC work --- code/builders/builder-vite/package.json | 1 + code/builders/builder-webpack5/src/index.ts | 2 +- code/core/package.json | 2 +- code/core/src/core-server/dev-server.ts | 2 +- .../core/src/core-server/utils/doTelemetry.ts | 2 +- .../utils/get-caching-middleware.ts | 2 +- .../utils/getAccessControlMiddleware.ts | 2 +- .../utils/getStoryIndexGenerator.ts | 2 +- code/core/src/core-server/utils/metadata.ts | 2 +- .../src/core-server/utils/server-connect.ts | 88 +++++++++++++++++++ .../core/src/core-server/utils/server-init.ts | 2 +- .../src/core-server/utils/server-statics.ts | 2 +- .../core-server/utils/stories-json.test.ts | 2 +- .../src/core-server/utils/stories-json.ts | 2 +- code/core/src/types/modules/core-common.ts | 2 +- code/yarn.lock | 43 ++++++++- 16 files changed, 142 insertions(+), 16 deletions(-) create mode 100644 code/core/src/core-server/utils/server-connect.ts diff --git a/code/builders/builder-vite/package.json b/code/builders/builder-vite/package.json index b88932fd3551..cf6ebc3beed8 100644 --- a/code/builders/builder-vite/package.json +++ b/code/builders/builder-vite/package.json @@ -46,6 +46,7 @@ "@storybook/csf-plugin": "workspace:*", "@types/find-cache-dir": "^3.2.1", "browser-assert": "^1.2.1", + "connect": "^3.7.0", "es-module-lexer": "^1.5.0", "find-cache-dir": "^3.0.0", "fs-extra": "^11.1.0", diff --git a/code/builders/builder-webpack5/src/index.ts b/code/builders/builder-webpack5/src/index.ts index 599484a4ff67..deb5405d1a46 100644 --- a/code/builders/builder-webpack5/src/index.ts +++ b/code/builders/builder-webpack5/src/index.ts @@ -13,7 +13,7 @@ import { WebpackCompilationError, WebpackInvocationError, WebpackMissingStatsError, -} from 'storybook/internal/core-events'; +} from 'storybook/internal/server-errors'; import sirv from 'sirv'; import prettyTime from 'pretty-hrtime'; diff --git a/code/core/package.json b/code/core/package.json index 1f6b9cc92fad..839e867f9aac 100644 --- a/code/core/package.json +++ b/code/core/package.json @@ -315,6 +315,7 @@ "cli-table3": "^0.6.1", "comment-parser": "^1.4.1", "compression": "^1.7.4", + "connect": "^3.7.0", "copy-to-clipboard": "^3.3.1", "cross-spawn": "^7.0.3", "css": "^3.0.0", @@ -328,7 +329,6 @@ "esbuild": "^0.18.0 || ^0.19.0 || ^0.20.0", "esbuild-plugin-alias": "^0.2.1", "execa": "^8.0.1", - "express": "^4.19.2", "fd-package-json": "^1.2.0", "fetch-retry": "^6.0.0", "file-system-cache": "^2.4.4", diff --git a/code/core/src/core-server/dev-server.ts b/code/core/src/core-server/dev-server.ts index 3b06865358cb..a83e551b650e 100644 --- a/code/core/src/core-server/dev-server.ts +++ b/code/core/src/core-server/dev-server.ts @@ -20,7 +20,7 @@ import { getStoryIndexGenerator } from './utils/getStoryIndexGenerator'; import { doTelemetry } from './utils/doTelemetry'; import { getAccessControlMiddleware } from './utils/getAccessControlMiddleware'; import { getCachingMiddleware } from './utils/get-caching-middleware'; -import connect, { type NextHandleFunction } from 'connect'; +import { type NextHandleFunction, connect } from './utils/server-connect'; export async function storybookDevServer(options: Options) { const app = connect(); diff --git a/code/core/src/core-server/utils/doTelemetry.ts b/code/core/src/core-server/utils/doTelemetry.ts index 288cfd0268c8..5f14d50392b6 100644 --- a/code/core/src/core-server/utils/doTelemetry.ts +++ b/code/core/src/core-server/utils/doTelemetry.ts @@ -6,7 +6,7 @@ import type { StoryIndexGenerator } from './StoryIndexGenerator'; import { summarizeIndex } from './summarizeIndex'; import { versionStatus } from './versionStatus'; import { sendTelemetryError } from '../withTelemetry'; -import type { Server } from 'connect'; +import type { Server } from './server-connect'; export async function doTelemetry( app: Server, diff --git a/code/core/src/core-server/utils/get-caching-middleware.ts b/code/core/src/core-server/utils/get-caching-middleware.ts index fe7554def150..1489117ba884 100644 --- a/code/core/src/core-server/utils/get-caching-middleware.ts +++ b/code/core/src/core-server/utils/get-caching-middleware.ts @@ -1,4 +1,4 @@ -import type { NextHandleFunction } from 'connect'; +import type { NextHandleFunction } from './server-connect'; export function getCachingMiddleware(): NextHandleFunction { return (req, res, next) => { diff --git a/code/core/src/core-server/utils/getAccessControlMiddleware.ts b/code/core/src/core-server/utils/getAccessControlMiddleware.ts index 23e0caf276bd..f6d2769d6939 100644 --- a/code/core/src/core-server/utils/getAccessControlMiddleware.ts +++ b/code/core/src/core-server/utils/getAccessControlMiddleware.ts @@ -1,4 +1,4 @@ -import type { NextHandleFunction } from 'connect'; +import type { NextHandleFunction } from './server-connect'; export function getAccessControlMiddleware(crossOriginIsolated: boolean): NextHandleFunction { return (req, res, next) => { diff --git a/code/core/src/core-server/utils/getStoryIndexGenerator.ts b/code/core/src/core-server/utils/getStoryIndexGenerator.ts index fd76cf00875f..f67487c60ab4 100644 --- a/code/core/src/core-server/utils/getStoryIndexGenerator.ts +++ b/code/core/src/core-server/utils/getStoryIndexGenerator.ts @@ -3,7 +3,7 @@ import { normalizeStories } from '@storybook/core/common'; import { useStoriesJson } from './stories-json'; import type { ServerChannel } from './get-server-channel'; import { StoryIndexGenerator } from './StoryIndexGenerator'; -import type { Server } from 'connect'; +import type { Server } from './server-connect'; export async function getStoryIndexGenerator( app: Server, diff --git a/code/core/src/core-server/utils/metadata.ts b/code/core/src/core-server/utils/metadata.ts index bad118d9920f..9519ddc503f8 100644 --- a/code/core/src/core-server/utils/metadata.ts +++ b/code/core/src/core-server/utils/metadata.ts @@ -1,5 +1,5 @@ import { writeJSON } from 'fs-extra'; -import type { Server } from 'connect'; +import type { Server } from './server-connect'; import { getStorybookMetadata } from '@storybook/core/telemetry'; export async function extractStorybookMetadata(outputFile: string, configDir: string) { diff --git a/code/core/src/core-server/utils/server-connect.ts b/code/core/src/core-server/utils/server-connect.ts new file mode 100644 index 000000000000..73dcb7494e0c --- /dev/null +++ b/code/core/src/core-server/utils/server-connect.ts @@ -0,0 +1,88 @@ +import * as http from 'http'; + +import connect from 'connect'; + +export { connect }; + +export type ServerHandle = HandleFunction | http.Server; + +export class IncomingMessage extends http.IncomingMessage { + originalUrl?: http.IncomingMessage['url'] | undefined; +} + +type NextFunction = (err?: any) => void; + +export type SimpleHandleFunction = (req: IncomingMessage, res: http.ServerResponse) => void; +export type NextHandleFunction = ( + req: IncomingMessage, + res: http.ServerResponse, + next: NextFunction +) => void; +export type ErrorHandleFunction = ( + err: any, + req: IncomingMessage, + res: http.ServerResponse, + next: NextFunction +) => void; +export type HandleFunction = SimpleHandleFunction | NextHandleFunction | ErrorHandleFunction; + +export interface ServerStackItem { + route: string; + handle: ServerHandle; +} + +export interface Server extends NodeJS.EventEmitter { + (req: http.IncomingMessage, res: http.ServerResponse, next?: Function): void; + + route: string; + stack: ServerStackItem[]; + + /** + * Utilize the given middleware `handle` to the given `route`, + * defaulting to _/_. This "route" is the mount-point for the + * middleware, when given a value other than _/_ the middleware + * is only effective when that segment is present in the request's + * pathname. + * + * For example if we were to mount a function at _/admin_, it would + * be invoked on _/admin_, and _/admin/settings_, however it would + * not be invoked for _/_, or _/posts_. + */ + use(fn: NextHandleFunction): Server; + use(fn: HandleFunction): Server; + use(route: string, fn: NextHandleFunction): Server; + use(route: string, fn: HandleFunction): Server; + + /** + * Handle server requests, punting them down + * the middleware stack. + */ + handle(req: http.IncomingMessage, res: http.ServerResponse, next: Function): void; + + /** + * Listen for connections. + * + * This method takes the same arguments + * as node's `http.Server#listen()`. + * + * HTTP and HTTPS: + * + * If you run your application both as HTTP + * and HTTPS you may wrap them individually, + * since your Connect "server" is really just + * a JavaScript `Function`. + * + * var connect = require('connect') + * , http = require('http') + * , https = require('https'); + * + * var app = connect(); + * + * http.createServer(app).listen(80); + * https.createServer(options, app).listen(443); + */ + listen(port: number, hostname?: string, backlog?: number, callback?: Function): http.Server; + listen(port: number, hostname?: string, callback?: Function): http.Server; + listen(path: string, callback?: Function): http.Server; + listen(handle: any, listeningListener?: Function): http.Server; +} diff --git a/code/core/src/core-server/utils/server-init.ts b/code/core/src/core-server/utils/server-init.ts index 76623c44659f..3b8b7d844ec4 100644 --- a/code/core/src/core-server/utils/server-init.ts +++ b/code/core/src/core-server/utils/server-init.ts @@ -1,5 +1,5 @@ import { logger } from '@storybook/core/node-logger'; -import type { Server } from 'connect'; +import type { Server } from './server-connect'; import { readFile } from 'fs-extra'; import http from 'http'; import https from 'https'; diff --git a/code/core/src/core-server/utils/server-statics.ts b/code/core/src/core-server/utils/server-statics.ts index b22eacd3a1d4..4f478f0633f9 100644 --- a/code/core/src/core-server/utils/server-statics.ts +++ b/code/core/src/core-server/utils/server-statics.ts @@ -2,7 +2,7 @@ import { logger } from '@storybook/core/node-logger'; import type { Options } from '@storybook/core/types'; import { getDirectoryFromWorkingDir } from '@storybook/core/common'; import chalk from 'chalk'; -import type { Server } from 'connect'; +import type { Server } from './server-connect'; import { pathExists } from 'fs-extra'; import { basename, isAbsolute, normalize, posix, relative, resolve, sep, win32 } from 'node:path'; import sirv from 'sirv'; diff --git a/code/core/src/core-server/utils/stories-json.test.ts b/code/core/src/core-server/utils/stories-json.test.ts index 9f2e327ab04e..0247a8ca39de 100644 --- a/code/core/src/core-server/utils/stories-json.test.ts +++ b/code/core/src/core-server/utils/stories-json.test.ts @@ -1,6 +1,6 @@ import { describe, beforeEach, it, expect, vi } from 'vitest'; -import type { Server } from 'connect'; +import type { Server } from './server-connect'; import Watchpack from 'watchpack'; import path from 'node:path'; import debounce from 'lodash/debounce.js'; diff --git a/code/core/src/core-server/utils/stories-json.ts b/code/core/src/core-server/utils/stories-json.ts index 467bba0f4d77..9c7a3efd1f3a 100644 --- a/code/core/src/core-server/utils/stories-json.ts +++ b/code/core/src/core-server/utils/stories-json.ts @@ -1,4 +1,4 @@ -import type { Server } from 'connect'; +import type { Server } from './server-connect'; import { basename } from 'node:path'; import { writeJSON } from 'fs-extra'; diff --git a/code/core/src/types/modules/core-common.ts b/code/core/src/types/modules/core-common.ts index 35d1a245491b..922dab66b469 100644 --- a/code/core/src/types/modules/core-common.ts +++ b/code/core/src/types/modules/core-common.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/naming-convention */ import type { FileSystemCache } from 'file-system-cache'; import type { Options as TelejsonOptions } from 'telejson'; -import type { Server } from 'connect'; +import type { Server } from '../../core-server/utils/server-connect'; import type { Server as HttpServer } from 'http'; import type { PackageJson as PackageJsonFromTypeFest } from 'type-fest'; diff --git a/code/yarn.lock b/code/yarn.lock index 6087e5c776a9..ee9a81f4b22d 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -5545,6 +5545,7 @@ __metadata: "@types/find-cache-dir": "npm:^3.2.1" "@types/node": "npm:^18.0.0" browser-assert: "npm:^1.2.1" + connect: "npm:^3.7.0" es-module-lexer: "npm:^1.5.0" find-cache-dir: "npm:^3.0.0" fs-extra: "npm:^11.1.0" @@ -5787,6 +5788,7 @@ __metadata: cli-table3: "npm:^0.6.1" comment-parser: "npm:^1.4.1" compression: "npm:^1.7.4" + connect: "npm:^3.7.0" copy-to-clipboard: "npm:^3.3.1" cross-spawn: "npm:^7.0.3" css: "npm:^3.0.0" @@ -5801,7 +5803,6 @@ __metadata: esbuild-plugin-alias: "npm:^0.2.1" esbuild-register: "npm:^3.5.0" execa: "npm:^8.0.1" - express: "npm:^4.19.2" fd-package-json: "npm:^1.2.0" fetch-retry: "npm:^6.0.0" file-system-cache: "npm:^2.4.4" @@ -11852,6 +11853,18 @@ __metadata: languageName: node linkType: hard +"connect@npm:^3.7.0": + version: 3.7.0 + resolution: "connect@npm:3.7.0" + dependencies: + debug: "npm:2.6.9" + finalhandler: "npm:1.1.2" + parseurl: "npm:~1.3.3" + utils-merge: "npm:1.0.1" + checksum: 10c0/f120c6116bb16a0a7d2703c0b4a0cd7ed787dc5ec91978097bf62aa967289020a9f41a9cd3c3276a7b92aaa36f382d2cd35fed7138fd466a55c8e9fdbed11ca8 + languageName: node + linkType: hard + "console-browserify@npm:^1.2.0": version: 1.2.0 resolution: "console-browserify@npm:1.2.0" @@ -14506,7 +14519,7 @@ __metadata: languageName: node linkType: hard -"express@npm:^4.17.3, express@npm:^4.19.2": +"express@npm:^4.17.3": version: 4.19.2 resolution: "express@npm:4.19.2" dependencies: @@ -14821,6 +14834,21 @@ __metadata: languageName: node linkType: hard +"finalhandler@npm:1.1.2": + version: 1.1.2 + resolution: "finalhandler@npm:1.1.2" + dependencies: + debug: "npm:2.6.9" + encodeurl: "npm:~1.0.2" + escape-html: "npm:~1.0.3" + on-finished: "npm:~2.3.0" + parseurl: "npm:~1.3.3" + statuses: "npm:~1.5.0" + unpipe: "npm:~1.0.0" + checksum: 10c0/6a96e1f5caab085628c11d9fdceb82ba608d5e426c6913d4d918409baa271037a47f28fbba73279e8ad614f0b8fa71ea791d265e408d760793829edd8c2f4584 + languageName: node + linkType: hard + "finalhandler@npm:1.2.0": version: 1.2.0 resolution: "finalhandler@npm:1.2.0" @@ -21384,6 +21412,15 @@ __metadata: languageName: node linkType: hard +"on-finished@npm:~2.3.0": + version: 2.3.0 + resolution: "on-finished@npm:2.3.0" + dependencies: + ee-first: "npm:1.1.1" + checksum: 10c0/c904f9e518b11941eb60279a3cbfaf1289bd0001f600a950255b1dede9fe3df8cd74f38483550b3bb9485165166acb5db500c3b4c4337aec2815c88c96fcc2ea + languageName: node + linkType: hard + "on-headers@npm:~1.0.2": version: 1.0.2 resolution: "on-headers@npm:1.0.2" @@ -25603,7 +25640,7 @@ __metadata: languageName: node linkType: hard -"statuses@npm:>= 1.4.0 < 2": +"statuses@npm:>= 1.4.0 < 2, statuses@npm:~1.5.0": version: 1.5.0 resolution: "statuses@npm:1.5.0" checksum: 10c0/e433900956357b3efd79b1c547da4d291799ac836960c016d10a98f6a810b1b5c0dcc13b5a7aa609a58239b5190e1ea176ad9221c2157d2fd1c747393e6b2940 From 88fbc1b229f6a369c583785b793ca9264e842468 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 4 Jul 2024 08:56:49 +0200 Subject: [PATCH 07/64] remove express types --- code/core/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/code/core/package.json b/code/core/package.json index 0ce5a8c2ac27..8a4ec79f08ad 100644 --- a/code/core/package.json +++ b/code/core/package.json @@ -246,7 +246,6 @@ }, "dependencies": { "@storybook/csf": "0.1.11", - "@types/express": "^4.17.21", "@types/node": "^18.0.0", "browser-assert": "^1.2.1", "esbuild": "^0.18.0 || ^0.19.0 || ^0.20.0 || ^0.21.0", From 841777d040b3116e06ce265de6e5f41857cd4cd5 Mon Sep 17 00:00:00 2001 From: James Garbutt <43081j@users.noreply.github.com> Date: Fri, 27 Sep 2024 18:50:40 +0700 Subject: [PATCH 08/64] feat: migrate from express to polka Migrates from express to polka 1.x. --- code/builders/builder-vite/package.json | 2 +- code/builders/builder-vite/src/index.ts | 14 +-- code/builders/builder-webpack5/src/index.ts | 10 +- code/core/package.json | 5 +- code/core/src/core-server/dev-server.ts | 14 +-- .../core/src/core-server/utils/doTelemetry.ts | 4 +- .../utils/get-caching-middleware.ts | 4 +- .../utils/getAccessControlMiddleware.ts | 4 +- .../utils/getStoryIndexGenerator.ts | 5 +- code/core/src/core-server/utils/metadata.ts | 4 +- .../src/core-server/utils/server-connect.ts | 87 ----------------- .../core/src/core-server/utils/server-init.ts | 21 ++--- .../src/core-server/utils/server-statics.ts | 5 +- .../core-server/utils/stories-json.test.ts | 4 +- .../src/core-server/utils/stories-json.ts | 4 +- code/core/src/types/modules/core-common.ts | 4 +- code/yarn.lock | 94 +++++++++---------- 17 files changed, 86 insertions(+), 199 deletions(-) delete mode 100644 code/core/src/core-server/utils/server-connect.ts diff --git a/code/builders/builder-vite/package.json b/code/builders/builder-vite/package.json index 3c519291210f..17a5a9ae5d15 100644 --- a/code/builders/builder-vite/package.json +++ b/code/builders/builder-vite/package.json @@ -46,10 +46,10 @@ "@storybook/csf-plugin": "workspace:*", "@types/find-cache-dir": "^3.2.1", "browser-assert": "^1.2.1", - "connect": "^3.7.0", "es-module-lexer": "^1.5.0", "find-cache-dir": "^3.0.0", "magic-string": "^0.30.0", + "polka": "^1.0.0-next.28", "sirv": "^2.0.4", "ts-dedent": "^2.0.0" }, diff --git a/code/builders/builder-vite/src/index.ts b/code/builders/builder-vite/src/index.ts index 56422068e2be..3aa99e434977 100644 --- a/code/builders/builder-vite/src/index.ts +++ b/code/builders/builder-vite/src/index.ts @@ -5,7 +5,7 @@ import { join, parse } from 'node:path'; import { NoStatsForViteDevError } from 'storybook/internal/server-errors'; import type { Options } from 'storybook/internal/types'; -import type { NextHandleFunction } from 'connect'; +import type Polka from 'polka'; import sirv from 'sirv'; import { corePath } from 'storybook/core-path'; import type { ViteDevServer } from 'vite'; @@ -13,13 +13,14 @@ import type { ViteDevServer } from 'vite'; import { build as viteBuild } from './build'; import { transformIframeHtml } from './transform-iframe-html'; import type { ViteBuilder } from './types'; +import { createViteServer } from './vite-server'; export { withoutVitePlugins } from './utils/without-vite-plugins'; export { hasVitePlugins } from './utils/has-vite-plugins'; export * from './types'; -function iframeMiddleware(options: Options, server: ViteDevServer): NextHandleFunction { +function iframeMiddleware(options: Options, server: ViteDevServer): Polka.Middleware { return async (req, res, next) => { if (!req.url || !req.url.match(/^\/iframe\.html($|\?)/)) { next(); @@ -68,14 +69,7 @@ export const start: ViteBuilder['start'] = async ({ immutable: true, }); - app.use('/sb-preview', (req, res, next) => { - if (!req.url || req.url === '/') { - next(); - return; - } - - servePreview(req, res, next); - }); + app.use('/sb-preview', servePreview); app.use(iframeMiddleware(options as Options, server)); app.use(server.middlewares); diff --git a/code/builders/builder-webpack5/src/index.ts b/code/builders/builder-webpack5/src/index.ts index 97843e519ac1..cd7430cf7685 100644 --- a/code/builders/builder-webpack5/src/index.ts +++ b/code/builders/builder-webpack5/src/index.ts @@ -187,15 +187,7 @@ const starter: StarterFunction = async function* starterGeneratorFn({ immutable: true, }); - app.use('/sb-preview', (req, res, next) => { - if (!req.url || req.url === '/') { - next(); - return; - } - - servePreview(req, res, next); - }); - + app.use('/sb-preview', servePreview); app.use(compilation); app.use(webpackHotMiddleware(compiler, { log: false })); diff --git a/code/core/package.json b/code/core/package.json index f987bce728ac..2ffa60cb7f42 100644 --- a/code/core/package.json +++ b/code/core/package.json @@ -305,6 +305,7 @@ "@emotion/use-insertion-effect-with-fallbacks": "^1.0.1", "@fal-works/esbuild-plugin-global-externals": "^2.1.2", "@ndelangen/get-tarball": "^3.0.7", + "@polka/compression": "^1.0.0-next.28", "@popperjs/core": "^2.6.0", "@radix-ui/react-dialog": "^1.0.5", "@radix-ui/react-scroll-area": "1.2.0-rc.7", @@ -314,7 +315,6 @@ "@storybook/icons": "^1.2.10", "@tanstack/react-virtual": "^3.3.0", "@testing-library/react": "^14.0.0", - "@types/compression": "^1.7.0", "@types/cross-spawn": "^6.0.2", "@types/detect-port": "^1.3.0", "@types/diff": "^5.0.9", @@ -346,8 +346,6 @@ "cli-table3": "^0.6.1", "commander": "^12.1.0", "comment-parser": "^1.4.1", - "compression": "^1.7.4", - "connect": "^3.7.0", "copy-to-clipboard": "^3.3.1", "cross-spawn": "^7.0.3", "css": "^3.0.0", @@ -386,6 +384,7 @@ "open": "^8.4.0", "picomatch": "^2.3.0", "polished": "^4.2.2", + "polka": "^1.0.0-next.28", "prettier": "^3.2.5", "pretty-hrtime": "^1.0.3", "prompts": "^2.4.0", diff --git a/code/core/src/core-server/dev-server.ts b/code/core/src/core-server/dev-server.ts index 2a4ab7ac262e..0653ceba93d0 100644 --- a/code/core/src/core-server/dev-server.ts +++ b/code/core/src/core-server/dev-server.ts @@ -1,12 +1,13 @@ +import { logConfig } from '@storybook/core/common'; import type { Options } from '@storybook/core/types'; import { logger } from '@storybook/core/node-logger'; import { MissingBuilderError } from '@storybook/core/server-errors'; -import compression from 'compression'; +import compression from '@polka/compression'; +import polka from 'polka'; import invariant from 'tiny-invariant'; -import { logConfig } from '../common'; import type { StoryIndexGenerator } from './utils/StoryIndexGenerator'; import { doTelemetry } from './utils/doTelemetry'; import { getManagerBuilder, getPreviewBuilder } from './utils/get-builders'; @@ -17,19 +18,18 @@ import { getStoryIndexGenerator } from './utils/getStoryIndexGenerator'; import { getMiddleware } from './utils/middleware'; import { openInBrowser } from './utils/open-in-browser'; import { getServerAddresses } from './utils/server-address'; -import { type NextHandleFunction, connect } from './utils/server-connect'; import { getServer } from './utils/server-init'; import { useStatics } from './utils/server-statics'; export async function storybookDevServer(options: Options) { - const app = connect(); - const [server, features, core] = await Promise.all([ - getServer(app, options), + getServer(options), options.presets.apply('features'), options.presets.apply('core'), ]); + const app = polka({ server }); + const serverChannel = await options.presets.apply( 'experimental_serverChannel', getServerChannel(server) @@ -43,7 +43,7 @@ export async function storybookDevServer(options: Options) { return undefined; }); - app.use(compression({ level: 1 }) as NextHandleFunction); + app.use(compression({ level: 1 })); if (typeof options.extendServer === 'function') { options.extendServer(server); diff --git a/code/core/src/core-server/utils/doTelemetry.ts b/code/core/src/core-server/utils/doTelemetry.ts index d7db53f9cab6..0e9b48b8c8f5 100644 --- a/code/core/src/core-server/utils/doTelemetry.ts +++ b/code/core/src/core-server/utils/doTelemetry.ts @@ -1,17 +1,17 @@ import { getPrecedingUpgrade, telemetry } from '@storybook/core/telemetry'; import type { CoreConfig, Options } from '@storybook/core/types'; +import type Polka from 'polka'; import invariant from 'tiny-invariant'; import { sendTelemetryError } from '../withTelemetry'; import type { StoryIndexGenerator } from './StoryIndexGenerator'; import { useStorybookMetadata } from './metadata'; -import type { Server } from './server-connect'; import { summarizeIndex } from './summarizeIndex'; import { versionStatus } from './versionStatus'; export async function doTelemetry( - app: Server, + app: Polka.Polka, core: CoreConfig, initializedStoryIndexGenerator: Promise, options: Options diff --git a/code/core/src/core-server/utils/get-caching-middleware.ts b/code/core/src/core-server/utils/get-caching-middleware.ts index 1489117ba884..dd4d5c747156 100644 --- a/code/core/src/core-server/utils/get-caching-middleware.ts +++ b/code/core/src/core-server/utils/get-caching-middleware.ts @@ -1,6 +1,6 @@ -import type { NextHandleFunction } from './server-connect'; +import type Polka from 'polka'; -export function getCachingMiddleware(): NextHandleFunction { +export function getCachingMiddleware(): Polka.Middleware { return (req, res, next) => { res.setHeader('Cache-Control', 'no-store'); next(); diff --git a/code/core/src/core-server/utils/getAccessControlMiddleware.ts b/code/core/src/core-server/utils/getAccessControlMiddleware.ts index f6d2769d6939..b44046d290bf 100644 --- a/code/core/src/core-server/utils/getAccessControlMiddleware.ts +++ b/code/core/src/core-server/utils/getAccessControlMiddleware.ts @@ -1,6 +1,6 @@ -import type { NextHandleFunction } from './server-connect'; +import type Polka from 'polka'; -export function getAccessControlMiddleware(crossOriginIsolated: boolean): NextHandleFunction { +export function getAccessControlMiddleware(crossOriginIsolated: boolean): Polka.Middleware { return (req, res, next) => { res.setHeader('Access-Control-Allow-Origin', '*'); res.setHeader('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept'); diff --git a/code/core/src/core-server/utils/getStoryIndexGenerator.ts b/code/core/src/core-server/utils/getStoryIndexGenerator.ts index 11555bf7306f..d6b1d7d1058e 100644 --- a/code/core/src/core-server/utils/getStoryIndexGenerator.ts +++ b/code/core/src/core-server/utils/getStoryIndexGenerator.ts @@ -1,13 +1,14 @@ import { normalizeStories } from '@storybook/core/common'; import type { DocsOptions, Options } from '@storybook/core/types'; +import type Polka from 'polka'; + import { StoryIndexGenerator } from './StoryIndexGenerator'; import type { ServerChannel } from './get-server-channel'; -import type { Server } from './server-connect'; import { useStoriesJson } from './stories-json'; export async function getStoryIndexGenerator( - app: Server, + app: Polka.Polka, features: { argTypeTargetsV7?: boolean; }, diff --git a/code/core/src/core-server/utils/metadata.ts b/code/core/src/core-server/utils/metadata.ts index 16cea6042aaf..a9a2ebb337ba 100644 --- a/code/core/src/core-server/utils/metadata.ts +++ b/code/core/src/core-server/utils/metadata.ts @@ -2,7 +2,7 @@ import { writeFile } from 'node:fs/promises'; import { getStorybookMetadata } from '@storybook/core/telemetry'; -import type { Server } from './server-connect'; +import type Polka from 'polka'; export async function extractStorybookMetadata(outputFile: string, configDir: string) { const storybookMetadata = await getStorybookMetadata(configDir); @@ -10,7 +10,7 @@ export async function extractStorybookMetadata(outputFile: string, configDir: st await writeFile(outputFile, JSON.stringify(storybookMetadata)); } -export function useStorybookMetadata(app: Server, configDir?: string) { +export function useStorybookMetadata(app: Polka.Polka, configDir?: string) { app.use('/project.json', async (req, res) => { const storybookMetadata = await getStorybookMetadata(configDir); res.setHeader('Content-Type', 'application/json'); diff --git a/code/core/src/core-server/utils/server-connect.ts b/code/core/src/core-server/utils/server-connect.ts deleted file mode 100644 index 7bb43409b65b..000000000000 --- a/code/core/src/core-server/utils/server-connect.ts +++ /dev/null @@ -1,87 +0,0 @@ -import connect from 'connect'; -import * as http from 'http'; - -export { connect }; - -export type ServerHandle = HandleFunction | http.Server; - -export class IncomingMessage extends http.IncomingMessage { - originalUrl?: http.IncomingMessage['url'] | undefined; -} - -type NextFunction = (err?: any) => void; - -export type SimpleHandleFunction = (req: IncomingMessage, res: http.ServerResponse) => void; -export type NextHandleFunction = ( - req: IncomingMessage, - res: http.ServerResponse, - next: NextFunction -) => void; -export type ErrorHandleFunction = ( - err: any, - req: IncomingMessage, - res: http.ServerResponse, - next: NextFunction -) => void; -export type HandleFunction = SimpleHandleFunction | NextHandleFunction | ErrorHandleFunction; - -export interface ServerStackItem { - route: string; - handle: ServerHandle; -} - -export interface Server extends NodeJS.EventEmitter { - (req: http.IncomingMessage, res: http.ServerResponse, next?: Function): void; - - route: string; - stack: ServerStackItem[]; - - /** - * Utilize the given middleware `handle` to the given `route`, - * defaulting to _/_. This "route" is the mount-point for the - * middleware, when given a value other than _/_ the middleware - * is only effective when that segment is present in the request's - * pathname. - * - * For example if we were to mount a function at _/admin_, it would - * be invoked on _/admin_, and _/admin/settings_, however it would - * not be invoked for _/_, or _/posts_. - */ - use(fn: NextHandleFunction): Server; - use(fn: HandleFunction): Server; - use(route: string, fn: NextHandleFunction): Server; - use(route: string, fn: HandleFunction): Server; - - /** - * Handle server requests, punting them down - * the middleware stack. - */ - handle(req: http.IncomingMessage, res: http.ServerResponse, next: Function): void; - - /** - * Listen for connections. - * - * This method takes the same arguments - * as node's `http.Server#listen()`. - * - * HTTP and HTTPS: - * - * If you run your application both as HTTP - * and HTTPS you may wrap them individually, - * since your Connect "server" is really just - * a JavaScript `Function`. - * - * var connect = require('connect') - * , http = require('http') - * , https = require('https'); - * - * var app = connect(); - * - * http.createServer(app).listen(80); - * https.createServer(options, app).listen(443); - */ - listen(port: number, hostname?: string, backlog?: number, callback?: Function): http.Server; - listen(port: number, hostname?: string, callback?: Function): http.Server; - listen(path: string, callback?: Function): http.Server; - listen(handle: any, listeningListener?: Function): http.Server; -} diff --git a/code/core/src/core-server/utils/server-init.ts b/code/core/src/core-server/utils/server-init.ts index 53d6b9c5e97b..d06c3421e7bc 100644 --- a/code/core/src/core-server/utils/server-init.ts +++ b/code/core/src/core-server/utils/server-init.ts @@ -5,19 +5,14 @@ import { logger } from '@storybook/core/node-logger'; import http from 'http'; import https from 'https'; -import type { Server } from './server-connect'; - -export async function getServer( - app: Server, - options: { - https?: boolean; - sslCert?: string; - sslKey?: string; - sslCa?: string[]; - } -) { +export async function getServer(options: { + https?: boolean; + sslCert?: string; + sslKey?: string; + sslCa?: string[]; +}) { if (!options.https) { - return http.createServer(app); + return http.createServer(); } if (!options.sslCert) { @@ -36,5 +31,5 @@ export async function getServer( key: await readFile(options.sslKey, { encoding: 'utf8' }), }; - return https.createServer(sslOptions, app); + return https.createServer(sslOptions); } diff --git a/code/core/src/core-server/utils/server-statics.ts b/code/core/src/core-server/utils/server-statics.ts index 99d4a10ee282..6d1ffd59f041 100644 --- a/code/core/src/core-server/utils/server-statics.ts +++ b/code/core/src/core-server/utils/server-statics.ts @@ -8,11 +8,10 @@ import { logger } from '@storybook/core/node-logger'; import chalk from 'chalk'; import type { ServerResponse } from 'http'; +import type Polka from 'polka'; import sirv from 'sirv'; import { dedent } from 'ts-dedent'; -import type { Server } from './server-connect'; - // TODO (43081j): maybe get this from somewhere? const contentTypes: Record = { css: 'text/css', @@ -27,7 +26,7 @@ const setContentTypeHeaders = (res: ServerResponse, pathname: string) => { } }; -export async function useStatics(app: Server, options: Options): Promise { +export async function useStatics(app: Polka.Polka, options: Options): Promise { const staticDirs = (await options.presets.apply('staticDirs')) ?? []; const faviconPath = await options.presets.apply('favicon'); diff --git a/code/core/src/core-server/utils/stories-json.test.ts b/code/core/src/core-server/utils/stories-json.test.ts index 3ca7e213df48..cc11d43ba5a3 100644 --- a/code/core/src/core-server/utils/stories-json.test.ts +++ b/code/core/src/core-server/utils/stories-json.test.ts @@ -8,13 +8,13 @@ import { STORY_INDEX_INVALIDATED } from '@storybook/core/core-events'; import { debounce } from 'es-toolkit/compat'; import type { Request, Response } from 'express'; +import type Polka from 'polka'; import Watchpack from 'watchpack'; import { csfIndexer } from '../presets/common-preset'; import type { StoryIndexGeneratorOptions } from './StoryIndexGenerator'; import { StoryIndexGenerator } from './StoryIndexGenerator'; import type { ServerChannel } from './get-server-channel'; -import type { Server } from './server-connect'; import { DEBOUNCE, useStoriesJson } from './stories-json'; vi.mock('watchpack'); @@ -59,7 +59,7 @@ const getInitializedStoryIndexGenerator = async ( describe('useStoriesJson', () => { const use = vi.fn(); - const app: Server = { use } as any; + const app: Polka.Polka = { use } as any; const end = vi.fn(); const write = vi.fn(); const response: Response = { diff --git a/code/core/src/core-server/utils/stories-json.ts b/code/core/src/core-server/utils/stories-json.ts index 2d5b50ead6a1..a33e12eb0393 100644 --- a/code/core/src/core-server/utils/stories-json.ts +++ b/code/core/src/core-server/utils/stories-json.ts @@ -6,10 +6,10 @@ import type { NormalizedStoriesSpecifier, StoryIndex } from '@storybook/core/typ import { STORY_INDEX_INVALIDATED } from '@storybook/core/core-events'; import { debounce } from 'es-toolkit/compat'; +import type Polka from 'polka'; import type { StoryIndexGenerator } from './StoryIndexGenerator'; import type { ServerChannel } from './get-server-channel'; -import type { Server } from './server-connect'; import { watchStorySpecifiers } from './watch-story-specifiers'; import { watchConfig } from './watchConfig'; @@ -33,7 +33,7 @@ export function useStoriesJson({ serverChannel, normalizedStories, }: { - app: Server; + app: Polka.Polka; initializedStoryIndexGenerator: Promise; serverChannel: ServerChannel; workingDir?: string; diff --git a/code/core/src/types/modules/core-common.ts b/code/core/src/types/modules/core-common.ts index 3eb0a5a9d798..d5dc8baf0bee 100644 --- a/code/core/src/types/modules/core-common.ts +++ b/code/core/src/types/modules/core-common.ts @@ -2,10 +2,10 @@ import type { FileSystemCache } from 'file-system-cache'; // should be node:http, but that caused the ui/manager to fail to build, might be able to switch this back once ui/manager is in the core import type { Server as HttpServer } from 'http'; +import type Polka from 'polka'; import type { Options as TelejsonOptions } from 'telejson'; import type { PackageJson as PackageJsonFromTypeFest } from 'type-fest'; -import type { Server } from '../../core-server/utils/server-connect'; import type { Indexer, StoriesEntry } from './indexer'; /** ⚠️ This file contains internal WIP types they MUST NOT be exported outside this package for now! */ @@ -216,7 +216,7 @@ export interface Builder { start: (args: { options: Options; startTime: ReturnType; - app: Server; + app: Polka.Polka; server: HttpServer; channel: ServerChannel; }) => Promise= 1.4.0 < 2, statuses@npm:~1.5.0": +"statuses@npm:>= 1.4.0 < 2": version: 1.5.0 resolution: "statuses@npm:1.5.0" checksum: 10c0/e433900956357b3efd79b1c547da4d291799ac836960c016d10a98f6a810b1b5c0dcc13b5a7aa609a58239b5190e1ea176ad9221c2157d2fd1c747393e6b2940 @@ -27626,6 +27611,15 @@ __metadata: languageName: node linkType: hard +"trouter@npm:^4.0.0": + version: 4.0.0 + resolution: "trouter@npm:4.0.0" + dependencies: + regexparam: "npm:^3.0.0" + checksum: 10c0/e27326a831187c6a47a72b62212364e3f88247fa2a8723e5030e14a0002b69756fb51f97efbda2466deb05f4a78ecb83c2a1a7b343e9659cbfb3f370156f1e12 + languageName: node + linkType: hard + "try-catch@npm:^3.0.0": version: 3.0.1 resolution: "try-catch@npm:3.0.1" From 056a37c2aed4bda1e6865ec42fc1db80e20e13af Mon Sep 17 00:00:00 2001 From: James Garbutt <43081j@users.noreply.github.com> Date: Fri, 27 Sep 2024 19:11:43 +0700 Subject: [PATCH 09/64] fix: revert a few changes --- code/core/src/builder-manager/index.ts | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/code/core/src/builder-manager/index.ts b/code/core/src/builder-manager/index.ts index 26cafb1a117d..592416521a2a 100644 --- a/code/core/src/builder-manager/index.ts +++ b/code/core/src/builder-manager/index.ts @@ -172,23 +172,8 @@ const starter: StarterFunction = async function* starterGeneratorFn({ startTime, dev: true, immutable: true, }); - // TODO (43081j): maybe abstract this into a reusable function - app.use('/sb-addons', (req, res, next) => { - if (!req.url || req.url === '/') { - next(); - return; - } - - serveAddons(req, res, next); - }); - app.use('/sb-manager', (req, res, next) => { - if (!req.url || req.url === '/') { - next(); - return; - } - - serveCore(req, res, next); - }); + app.use('/sb-addons', serveAddons); + app.use('/sb-manager', serveCore); const { cssFiles, jsFiles } = await readOrderedFiles(addonsDir, compilation?.outputFiles); From cce0f14f1e2040094ce9189d419b28451b642987 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Mon, 30 Sep 2024 22:35:02 +0200 Subject: [PATCH 10/64] listen for requests, cleanup --- code/builders/builder-vite/src/index.ts | 24 +++++++-------- code/builders/builder-webpack5/src/index.ts | 20 ++++++------- code/core/src/builder-manager/index.ts | 29 ++++++++++--------- code/core/src/core-server/dev-server.ts | 25 ++++++++-------- .../utils/getStoryIndexGenerator.ts | 3 -- .../src/core-server/utils/server-statics.ts | 24 ++++++++------- .../core-server/utils/stories-json.test.ts | 5 ++-- code/core/src/types/modules/core-common.ts | 1 + 8 files changed, 64 insertions(+), 67 deletions(-) diff --git a/code/builders/builder-vite/src/index.ts b/code/builders/builder-vite/src/index.ts index 3aa99e434977..9307c07dfed6 100644 --- a/code/builders/builder-vite/src/index.ts +++ b/code/builders/builder-vite/src/index.ts @@ -26,7 +26,8 @@ function iframeMiddleware(options: Options, server: ViteDevServer): Polka.Middle next(); return; } - const url = new URL(req.url, 'https://storybook.js.org'); + // the base isn't used for anything, but it's required by the URL constructor + const url = new URL(req.url, 'http://localhost:6006'); // We need to handle `html-proxy` params for style tag HMR https://github.com/storybookjs/builder-vite/issues/266#issuecomment-1055677865 // e.g. /iframe.html?html-proxy&index=0.css @@ -62,15 +63,14 @@ export const start: ViteBuilder['start'] = async ({ server = await createViteServer(options as Options, devServer); const previewResolvedDir = join(corePath, 'dist/preview'); - const previewDirOrigin = previewResolvedDir; - const servePreview = sirv(previewDirOrigin, { - maxAge: 300000, - dev: true, - immutable: true, - }); - - app.use('/sb-preview', servePreview); - + app.use( + '/sb-preview', + sirv(previewResolvedDir, { + maxAge: 300000, + dev: true, + immutable: true, + }) + ); app.use(iframeMiddleware(options as Options, server)); app.use(server.middlewares); @@ -89,10 +89,8 @@ export const build: ViteBuilder['build'] = async ({ options }) => { const viteCompilation = viteBuild(options as Options); const previewResolvedDir = join(corePath, 'dist/preview'); - const previewDirOrigin = previewResolvedDir; const previewDirTarget = join(options.outputDir || '', `sb-preview`); - - const previewFiles = cp(previewDirOrigin, previewDirTarget, { + const previewFiles = cp(previewResolvedDir, previewDirTarget, { filter: (src) => { const { ext } = parse(src); if (ext) { diff --git a/code/builders/builder-webpack5/src/index.ts b/code/builders/builder-webpack5/src/index.ts index cd7430cf7685..9e2245fec19c 100644 --- a/code/builders/builder-webpack5/src/index.ts +++ b/code/builders/builder-webpack5/src/index.ts @@ -180,14 +180,14 @@ const starter: StarterFunction = async function* starterGeneratorFn({ compilation = webpackDevMiddleware(compiler, middlewareOptions); const previewResolvedDir = join(corePath, 'dist/preview'); - const previewDirOrigin = previewResolvedDir; - const servePreview = sirv(previewDirOrigin, { - maxAge: 300000, - dev: true, - immutable: true, - }); - - app.use('/sb-preview', servePreview); + app.use( + '/sb-preview', + sirv(previewResolvedDir, { + maxAge: 300000, + dev: true, + immutable: true, + }) + ); app.use(compilation); app.use(webpackHotMiddleware(compiler, { log: false })); @@ -293,10 +293,8 @@ const builder: BuilderFunction = async function* builderGeneratorFn({ startTime, }); const previewResolvedDir = join(corePath, 'dist/preview'); - const previewDirOrigin = previewResolvedDir; const previewDirTarget = join(options.outputDir || '', `sb-preview`); - - const previewFiles = cp(previewDirOrigin, previewDirTarget, { + const previewFiles = cp(previewResolvedDir, previewDirTarget, { filter: (src) => { const { ext } = parse(src); if (ext) { diff --git a/code/core/src/builder-manager/index.ts b/code/core/src/builder-manager/index.ts index 592416521a2a..93241012b068 100644 --- a/code/core/src/builder-manager/index.ts +++ b/code/core/src/builder-manager/index.ts @@ -162,18 +162,22 @@ const starter: StarterFunction = async function* starterGeneratorFn({ startTime, 'manager' ); - const serveAddons = sirv(addonsDir, { - maxAge: 300000, - dev: true, - immutable: true, - }); - const serveCore = sirv(coreDirOrigin, { - maxAge: 300000, - dev: true, - immutable: true, - }); - app.use('/sb-addons', serveAddons); - app.use('/sb-manager', serveCore); + app.use( + '/sb-addons', + sirv(addonsDir, { + maxAge: 300000, + dev: true, + immutable: true, + }) + ); + app.use( + '/sb-manager', + sirv(coreDirOrigin, { + maxAge: 300000, + dev: true, + immutable: true, + }) + ); const { cssFiles, jsFiles } = await readOrderedFiles(addonsDir, compilation?.outputFiles); @@ -261,7 +265,6 @@ const builder: BuilderFunction = async function* builderGeneratorFn({ startTime, // 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, }); diff --git a/code/core/src/core-server/dev-server.ts b/code/core/src/core-server/dev-server.ts index 0653ceba93d0..9cf13d96f959 100644 --- a/code/core/src/core-server/dev-server.ts +++ b/code/core/src/core-server/dev-server.ts @@ -22,13 +22,13 @@ import { getServer } from './utils/server-init'; import { useStatics } from './utils/server-statics'; export async function storybookDevServer(options: Options) { - const [server, features, core] = await Promise.all([ - getServer(options), - options.presets.apply('features'), - options.presets.apply('core'), - ]); - + const [server, core] = await Promise.all([getServer(options), options.presets.apply('core')]); + console.log('LOG: starting dev server'); const app = polka({ server }); + // app.use((req, res, next) => { + // console.log('LOG: ', { url: req.url, method: req.method }); + // next(); + // }); const serverChannel = await options.presets.apply( 'experimental_serverChannel', @@ -38,7 +38,7 @@ export async function storybookDevServer(options: Options) { let indexError: Error | undefined; // try get index generator, if failed, send telemetry without storyCount, then rethrow the error const initializedStoryIndexGenerator: Promise = - getStoryIndexGenerator(app, features ?? {}, options, serverChannel).catch((err) => { + getStoryIndexGenerator(app, options, serverChannel).catch((err) => { indexError = err; return undefined; }); @@ -59,11 +59,6 @@ export async function storybookDevServer(options: Options) { const proto = options.https ? 'https' : 'http'; const { address, networkAddress } = getServerAddresses(port, host, proto, initialPath); - const listening = new Promise((resolve, reject) => { - // @ts-expect-error (Following line doesn't match TypeScript signature at all 🤔) - server.listen({ port, host }, (error: Error) => (error ? reject(error) : resolve())); - }); - if (!core?.builder) { throw new MissingBuilderError(); } @@ -84,6 +79,7 @@ export async function storybookDevServer(options: Options) { startTime: process.hrtime(), options, app, + router: app, // back-compatability with express-based API server, channel: serverChannel, }); @@ -99,6 +95,7 @@ export async function storybookDevServer(options: Options) { startTime: process.hrtime(), options, app, + router: app, // back-compatability with express-based API server, channel: serverChannel, }) @@ -126,7 +123,9 @@ export async function storybookDevServer(options: Options) { previewStarted.catch(() => {}).then(() => next()); }); - await Promise.all([initializedStoryIndexGenerator, listening]).then(async ([indexGenerator]) => { + app.listen(port, host); + + await Promise.all([initializedStoryIndexGenerator]).then(async ([indexGenerator]) => { if (indexGenerator && !options.ci && !options.smokeTest && options.open) { openInBrowser(host ? networkAddress : address); } diff --git a/code/core/src/core-server/utils/getStoryIndexGenerator.ts b/code/core/src/core-server/utils/getStoryIndexGenerator.ts index d6b1d7d1058e..d91373d825cf 100644 --- a/code/core/src/core-server/utils/getStoryIndexGenerator.ts +++ b/code/core/src/core-server/utils/getStoryIndexGenerator.ts @@ -9,9 +9,6 @@ import { useStoriesJson } from './stories-json'; export async function getStoryIndexGenerator( app: Polka.Polka, - features: { - argTypeTargetsV7?: boolean; - }, options: Options, serverChannel: ServerChannel ): Promise { diff --git a/code/core/src/core-server/utils/server-statics.ts b/code/core/src/core-server/utils/server-statics.ts index 6d1ffd59f041..aa8f4876b4c5 100644 --- a/code/core/src/core-server/utils/server-statics.ts +++ b/code/core/src/core-server/utils/server-statics.ts @@ -74,7 +74,8 @@ export async function useStatics(app: Polka.Polka, options: Options): Promise { const app: Polka.Polka = { use } as any; const end = vi.fn(); const write = vi.fn(); - const response: Response = { + const response: Polka.Response = { header: vi.fn(), send: vi.fn(), status: vi.fn(), @@ -82,7 +81,7 @@ describe('useStoriesJson', () => { Watchpack.mockClear(); }); - const request: Request = { + const request: Polka.Request = { headers: { accept: 'application/json' }, } as any; diff --git a/code/core/src/types/modules/core-common.ts b/code/core/src/types/modules/core-common.ts index d5dc8baf0bee..ddecfea2d89d 100644 --- a/code/core/src/types/modules/core-common.ts +++ b/code/core/src/types/modules/core-common.ts @@ -217,6 +217,7 @@ export interface Builder { options: Options; startTime: ReturnType; app: Polka.Polka; + router: Polka.Polka; // back-compatability with express-based API server: HttpServer; channel: ServerChannel; }) => Promise Date: Tue, 1 Oct 2024 13:49:25 +0200 Subject: [PATCH 11/64] comment update --- code/builders/builder-vite/src/plugins/code-generator-plugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/builders/builder-vite/src/plugins/code-generator-plugin.ts b/code/builders/builder-vite/src/plugins/code-generator-plugin.ts index 77509b97cf93..79dba3844060 100644 --- a/code/builders/builder-vite/src/plugins/code-generator-plugin.ts +++ b/code/builders/builder-vite/src/plugins/code-generator-plugin.ts @@ -50,7 +50,7 @@ export function codeGeneratorPlugin(options: Options): Plugin { }, config(config, { command }) { // If we are building the static distribution, add iframe.html as an entry. - // In development mode, it's not an entry - instead, we use an express middleware + // In development mode, it's not an entry - instead, we use a middleware // to serve iframe.html. The reason is that Vite's dev server (at the time of writing) // does not support virtual files as entry points. if (command === 'build') { From e6099804e99077fce2f977f87006775bef578a50 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 1 Oct 2024 16:33:12 +0200 Subject: [PATCH 12/64] remove `file-system-cache` by embedding it into our source --- code/core/package.json | 2 +- code/core/src/common/utils/file-cache.ts | 472 ++++++++++++++++++++- code/core/src/types/modules/core-common.ts | 2 +- code/yarn.lock | 77 +--- 4 files changed, 472 insertions(+), 81 deletions(-) diff --git a/code/core/package.json b/code/core/package.json index 17ec07a21246..c502e9ac845a 100644 --- a/code/core/package.json +++ b/code/core/package.json @@ -365,7 +365,6 @@ "express": "^4.19.2", "fd-package-json": "^1.2.0", "fetch-retry": "^6.0.0", - "file-system-cache": "^2.4.4", "find-cache-dir": "^5.0.0", "find-up": "^7.0.0", "flush-promises": "^1.0.2", @@ -390,6 +389,7 @@ "prettier": "^3.2.5", "pretty-hrtime": "^1.0.3", "prompts": "^2.4.0", + "ramda": "^0.30.1", "react": "^18.2.0", "react-dom": "^18.2.0", "react-draggable": "^4.4.5", diff --git a/code/core/src/common/utils/file-cache.ts b/code/core/src/common/utils/file-cache.ts index de65cc988383..a788150c4a63 100644 --- a/code/core/src/common/utils/file-cache.ts +++ b/code/core/src/common/utils/file-cache.ts @@ -1,11 +1,469 @@ -import * as fsc from 'file-system-cache'; +import * as crypto from 'node:crypto'; +import * as fs from 'node:fs'; +import { existsSync, lstatSync } from 'node:fs'; +import * as fsp from 'node:fs/promises'; +import { mkdir, rm, stat } from 'node:fs/promises'; +import * as fsPath from 'node:path'; -// @ts-expect-error (needed due to it's use of `exports.default`) -const Cache = (fsc.default.default || fsc.default) as typeof fsc.default; +import * as R from 'ramda'; -export type Options = Parameters['0']; -export type FileSystemCache = ReturnType; +const pathExists = async (path: string) => { + return stat(path) + .then(() => true) + .catch(() => false); +}; -export function createFileSystemCache(options: Options): FileSystemCache { - return Cache(options); +async function ensureDir(dirPath: string): Promise { + try { + // Attempt to create the directory recursively + await mkdir(dirPath, { recursive: true }); + } catch (err: any) { + // If the error is something other than the directory already existing, throw the error + if (err.code !== 'EEXIST') { + throw err; + } + } +} + +async function remove(path: string): Promise { + try { + // Attempt to remove the file or directory recursively + await rm(path, { recursive: true, force: true }); + } catch (err: any) { + // If the error code is anything other than the path not existing, rethrow the error + if (err.code !== 'ENOENT') { + throw err; + } + } +} + +export type FileSystemCacheOptions = { + basePath?: string; + ns?: any; + ttl?: number; + hash?: HashAlgorithm; + extension?: string; +}; + +export const isNothing = (value: any) => R.isNil(value) || R.isEmpty(value); +export const isString = R.is(String); + +export const toAbsolutePath = (path: string) => { + return path.startsWith('.') ? fsPath.resolve(path) : path; +}; + +export const ensureString = (defaultValue: string, text?: string): string => { + return typeof text === 'string' ? text : defaultValue; +}; + +export const compact = (input: any[]): string[] => { + const flat = [].concat(...input); + return flat.filter((value) => !R.isNil(value)); +}; + +export const toStringArray = R.pipe(compact, R.map(R.toString)); + +export const isFileSync = (path: string) => { + return existsSync(path) ? lstatSync(path).isFile() : false; +}; + +export const readFileSync = (path: string) => { + return existsSync(path) ? fs.readFileSync(path).toString() : undefined; +}; + +export const filePathsP = async (basePath: string, ns: string): Promise => { + if (!(await pathExists(basePath))) { + return []; + } + return (await fsp.readdir(basePath)) + .filter(Boolean) + .filter((name) => (ns ? name.startsWith(ns) : true)) + .filter((name) => (!ns ? !name.includes('-') : true)) + .map((name) => `${basePath}/${name}`); +}; + +/** + * Turns a set of values into a HEX hash code. + * + * @param values: The set of values to hash. + */ +export const hash = (algorithm: HashAlgorithm, ...values: any[]) => { + if (R.pipe(compact, R.isEmpty)(values)) { + return undefined; + } + const resultHash = crypto.createHash(algorithm); + const addValue = (value: any) => resultHash.update(value); + const addValues = R.forEach(addValue); + R.pipe(toStringArray, addValues)(values); + return resultHash.digest('hex'); +}; + +export const hashExists = (algorithm: HashAlgorithm) => { + return crypto.getHashes().includes(algorithm); +}; + +/** Retrieve a value from the given path. */ +export async function getValueP(path: string, defaultValue?: any) { + const exists = await pathExists(path); + + if (!exists) { + return defaultValue; + } + try { + const content = await fsp.readFile(path, 'utf8'); + return toGetValue(JSON.parse(content)); + } catch (error: any) { + if (error.code === 'ENOENT') { + return defaultValue; + } + if (error.message === 'Cache item has expired.') { + fs.rmSync(path); + return defaultValue; + } + throw new Error(`Failed to read cache value at: ${path}. ${error.message}`); + } +} + +/** Format value structure. */ +export const toGetValue = (data: any) => { + if (isExpired(data)) { + return undefined; + } + + if (data.type === 'Date') { + return new Date(data.value); + } + return data.value; +}; + +/** Stringify a value into JSON. */ +export const toJson = (value: any, ttl: number) => + JSON.stringify({ value, type: R.type(value), created: new Date(), ttl }); + +/** Check's a cache item to see if it has expired. */ +export const isExpired = (data: any) => { + const timeElapsed = (new Date().getTime() - new Date(data.created).getTime()) / 1000; + return timeElapsed > data.ttl && data.ttl > 0; +}; + +export type HashAlgorithm = + | 'RSA-MD5' + | 'RSA-RIPEMD160' + | 'RSA-SHA1' + | 'RSA-SHA1-2' + | 'RSA-SHA224' + | 'RSA-SHA256' + | 'RSA-SHA3-224' + | 'RSA-SHA3-256' + | 'RSA-SHA3-384' + | 'RSA-SHA3-512' + | 'RSA-SHA384' + | 'RSA-SHA512' + | 'RSA-SHA512/224' + | 'RSA-SHA512/256' + | 'RSA-SM3' + | 'blake2b512' + | 'blake2s256' + | 'id-rsassa-pkcs1-v1_5-with-sha3-224' + | 'id-rsassa-pkcs1-v1_5-with-sha3-256' + | 'id-rsassa-pkcs1-v1_5-with-sha3-384' + | 'id-rsassa-pkcs1-v1_5-with-sha3-512' + | 'md5' + | 'md5-sha1' + | 'md5WithRSAEncryption' + | 'ripemd' + | 'ripemd160' + | 'ripemd160WithRSA' + | 'rmd160' + | 'sha1' + | 'sha1WithRSAEncryption' + | 'sha224' + | 'sha224WithRSAEncryption' + | 'sha256' + | 'sha256WithRSAEncryption' + | 'sha3-224' + | 'sha3-256' + | 'sha3-384' + | 'sha3-512' + | 'sha384' + | 'sha384WithRSAEncryption' + | 'sha512' + | 'sha512-224' + | 'sha512-224WithRSAEncryption' + | 'sha512-256' + | 'sha512-256WithRSAEncryption' + | 'sha512WithRSAEncryption' + | 'shake128' + | 'shake256' + | 'sm3' + | 'sm3WithRSAEncryption' + | 'ssl3-md5' + | 'ssl3-sha1'; + +export const hashAlgorithms: HashAlgorithm[] = [ + 'RSA-MD5', + 'RSA-RIPEMD160', + 'RSA-SHA1', + 'RSA-SHA1-2', + 'RSA-SHA224', + 'RSA-SHA256', + 'RSA-SHA3-224', + 'RSA-SHA3-256', + 'RSA-SHA3-384', + 'RSA-SHA3-512', + 'RSA-SHA384', + 'RSA-SHA512', + 'RSA-SHA512/224', + 'RSA-SHA512/256', + 'RSA-SM3', + 'blake2b512', + 'blake2s256', + 'id-rsassa-pkcs1-v1_5-with-sha3-224', + 'id-rsassa-pkcs1-v1_5-with-sha3-256', + 'id-rsassa-pkcs1-v1_5-with-sha3-384', + 'id-rsassa-pkcs1-v1_5-with-sha3-512', + 'md5', + 'md5-sha1', + 'md5WithRSAEncryption', + 'ripemd', + 'ripemd160', + 'ripemd160WithRSA', + 'rmd160', + 'sha1', + 'sha1WithRSAEncryption', + 'sha224', + 'sha224WithRSAEncryption', + 'sha256', + 'sha256WithRSAEncryption', + 'sha3-224', + 'sha3-256', + 'sha3-384', + 'sha3-512', + 'sha384', + 'sha384WithRSAEncryption', + 'sha512', + 'sha512-224', + 'sha512-224WithRSAEncryption', + 'sha512-256', + 'sha512-256WithRSAEncryption', + 'sha512WithRSAEncryption', + 'shake128', + 'shake256', + 'sm3', + 'sm3WithRSAEncryption', + 'ssl3-md5', + 'ssl3-sha1', +]; +/** A cache that read/writes to a specific part of the file-system. */ +export class FileSystemCache { + /** The list of all available hash algorithms. */ + static hashAlgorithms: HashAlgorithm[] = hashAlgorithms; + + /** Instance. */ + readonly basePath: string; + + readonly ns?: any; + + readonly extension?: string; + + readonly hash: HashAlgorithm; + + readonly ttl: number; + + basePathExists?: boolean; + + /** + * Constructor. + * + * @param options - BasePath: The folder path to read/write to. Default: './build' - ns: A single + * value, or array, that represents a a unique namespace within which values for this store are + * cached. - extension: An optional file-extension for paths. - ttl: The default time-to-live + * for cached values in seconds. Default: 0 (never expires) - hash: The hashing algorithm to use + * when generating cache keys. Default: "sha1" + */ + constructor(options: FileSystemCacheOptions = {}) { + this.basePath = formatPath(options.basePath); + this.hash = options.hash ?? 'sha1'; + this.ns = hash(this.hash, options.ns); + this.ttl = options.ttl ?? 0; + + if (isString(options.extension)) { + this.extension = options.extension; + } + + if (isFileSync(this.basePath)) { + throw new Error(`The basePath '${this.basePath}' is a file. It should be a folder.`); + } + + if (!hashExists(this.hash)) { + throw new Error(`Hash does not exist: ${this.hash}`); + } + } + + /** + * Generates the path to the cached files. + * + * @param {string} key: The key of the cache item. + */ + public path(key: string): string { + if (isNothing(key)) { + throw new Error(`Path requires a cache key.`); + } + let name = hash(this.hash, key); + + if (this.ns) { + name = `${this.ns}-${name}`; + } + + if (this.extension) { + name = `${name}.${this.extension.replace(/^\./, '')}`; + } + return `${this.basePath}/${name}`; + } + + /** + * Determines whether the file exists. + * + * @param {string} key: The key of the cache item. + */ + public fileExists(key: string) { + return pathExists(this.path(key)); + } + + /** Ensure that the base path exists. */ + public async ensureBasePath() { + if (!this.basePathExists) { + await ensureDir(this.basePath); + } + this.basePathExists = true; + } + + /** + * Gets the contents of the file with the given key. + * + * @param {string} key: The key of the cache item. + * @param defaultValue: Optional. A default value to return if the value does not exist in cache. + * @returns File contents, or undefined if the file does not exis + */ + public get(key: string, defaultValue?: any) { + return getValueP(this.path(key), defaultValue); + } + + /** + * Gets the contents of the file with the given key. + * + * @param {string} key: The key of the cache item. + * @param defaultValue: Optional. A default value to return if the value does not exist in cache. + * @returns The cached value, or undefined. + */ + public getSync(key: string, defaultValue?: any) { + const path = this.path(key); + const content = readFileSync(path) || ''; + return fs.existsSync(path) ? toGetValue(JSON.parse(content)) : defaultValue; + } + + /** + * Writes the given value to the file-system. + * + * @param {string} key: The key of the cache item. + * @param value: The value to write (Primitive or Object). + */ + public async set(key: string, value: any, ttl?: number) { + const path = this.path(key); + ttl = typeof ttl === 'number' ? ttl : this.ttl; + await this.ensureBasePath(); + await fsp.writeFile(path, toJson(value, ttl)); + return { path }; + } + + /** + * Writes the given value to the file-system and memory cache. + * + * @param {string} key: The key of the cache item. + * @param value: The value to write (Primitive or Object). + * @returns The cache. + */ + public setSync(key: string, value: any, ttl?: number) { + ttl = typeof ttl === 'number' ? ttl : this.ttl; + fs.writeFileSync(this.path(key), toJson(value, ttl)); + return this; + } + + /** + * Removes the item from the file-system. + * + * @param {string} key: The key of the cache item. + */ + public remove(key: string) { + return remove(this.path(key)); + } + + /** Removes all items from the cache. */ + public async clear() { + const paths = await filePathsP(this.basePath, this.ns); + await Promise.all(paths.map((path) => remove(path))); + console.groupEnd(); + } + + /** + * Saves several items to the cache in one operation. + * + * @param {array} items: An array of objects of the form { key, value }. + */ + public async save( + input: ({ key: string; value: any } | null | undefined)[] + ): Promise<{ paths: string[] }> { + type Item = { key: string; value: any }; + let items = (Array.isArray(input) ? input : [input]) as Item[]; + + const isValid = (item: any) => { + if (!R.is(Object, item)) { + return false; + } + return item.key && item.value; + }; + + items = items.filter((item) => Boolean(item)); + items + .filter((item) => !isValid(item)) + .forEach(() => { + const err = `Save items not valid, must be an array of {key, value} objects.`; + throw new Error(err); + }); + + if (items.length === 0) { + return { paths: [] }; + } + + const paths = await Promise.all( + items.map(async (item) => (await this.set(item.key, item.value)).path) + ); + + return { paths }; + } + + /** Loads all files within the cache's namespace. */ + public async load(): Promise<{ files: { path: string; value: any }[] }> { + const paths = await filePathsP(this.basePath, this.ns); + + if (paths.length === 0) { + return { files: [] }; + } + const files = await Promise.all( + paths.map(async (path) => ({ path, value: await getValueP(path) })) + ); + return { files }; + } +} + +/** Helpers */ + +function formatPath(path?: string) { + path = ensureString('./.cache', path); + path = toAbsolutePath(path); + return path; +} + +export function createFileSystemCache(options: FileSystemCacheOptions): FileSystemCache { + return new FileSystemCache(options); } diff --git a/code/core/src/types/modules/core-common.ts b/code/core/src/types/modules/core-common.ts index 8e71a4cadb2a..82fbfb8c7669 100644 --- a/code/core/src/types/modules/core-common.ts +++ b/code/core/src/types/modules/core-common.ts @@ -1,11 +1,11 @@ /* eslint-disable @typescript-eslint/naming-convention */ import type { Router } from 'express'; -import type { FileSystemCache } from 'file-system-cache'; // should be node:http, but that caused the ui/manager to fail to build, might be able to switch this back once ui/manager is in the core import type { Server } from 'http'; import type * as telejson from 'telejson'; import type { PackageJson as PackageJsonFromTypeFest } from 'type-fest'; +import type { FileSystemCache } from '../../common/utils/file-cache'; import type { Indexer, StoriesEntry } from './indexer'; /** ⚠️ This file contains internal WIP types they MUST NOT be exported outside this package for now! */ diff --git a/code/yarn.lock b/code/yarn.lock index a3ab66666dda..6fdf68f6070c 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -6078,7 +6078,6 @@ __metadata: express: "npm:^4.19.2" fd-package-json: "npm:^1.2.0" fetch-retry: "npm:^6.0.0" - file-system-cache: "npm:^2.4.4" find-cache-dir: "npm:^5.0.0" find-up: "npm:^7.0.0" flush-promises: "npm:^1.0.2" @@ -6105,6 +6104,7 @@ __metadata: pretty-hrtime: "npm:^1.0.3" process: "npm:^0.11.10" prompts: "npm:^2.4.0" + ramda: "npm:^0.30.1" react: "npm:^18.2.0" react-dom: "npm:^18.2.0" react-draggable: "npm:^4.4.5" @@ -7844,16 +7844,6 @@ __metadata: languageName: node linkType: hard -"@types/fs-extra@npm:11.0.1": - version: 11.0.1 - resolution: "@types/fs-extra@npm:11.0.1" - dependencies: - "@types/jsonfile": "npm:*" - "@types/node": "npm:*" - checksum: 10c0/a65f1fae47849fe1a17441dcabc9400390303405972ff3cbb3578746cea8916b23d5e7652bf57a87767f75a9b2f37caac499b78b5230ae08fef0ba58b34c3a85 - languageName: node - linkType: hard - "@types/fs-extra@npm:^5.0.5": version: 5.1.0 resolution: "@types/fs-extra@npm:5.1.0" @@ -7988,15 +7978,6 @@ __metadata: languageName: node linkType: hard -"@types/jsonfile@npm:*": - version: 6.1.2 - resolution: "@types/jsonfile@npm:6.1.2" - dependencies: - "@types/node": "npm:*" - checksum: 10c0/c2943f9bfa7867b33fb362b88a932efdc00e9e5f2762b6ef912617cb0a3e3221a98920f8976a4cf817aa576e03d28a25391236e9644e2ebe648081b08df62ef5 - languageName: node - linkType: hard - "@types/loader-utils@npm:^2.0.5": version: 2.0.6 resolution: "@types/loader-utils@npm:2.0.6" @@ -8164,15 +8145,6 @@ __metadata: languageName: node linkType: hard -"@types/ramda@npm:0.29.3": - version: 0.29.3 - resolution: "@types/ramda@npm:0.29.3" - dependencies: - types-ramda: "npm:^0.29.4" - checksum: 10c0/9c62a4600f5df5e65a01ffe4a470500c98f7c0d093fde47e0d4257675f1ec50effe4696cb004a6b53227948db67ea26a2345dbc91819ecc868105c0f64cecd1e - languageName: node - linkType: hard - "@types/range-parser@npm:*": version: 1.2.5 resolution: "@types/range-parser@npm:1.2.5" @@ -15268,18 +15240,6 @@ __metadata: languageName: node linkType: hard -"file-system-cache@npm:^2.4.4": - version: 2.4.4 - resolution: "file-system-cache@npm:2.4.4" - dependencies: - "@types/fs-extra": "npm:11.0.1" - "@types/ramda": "npm:0.29.3" - fs-extra: "npm:11.1.1" - ramda: "npm:0.29.0" - checksum: 10c0/274bd9c2f8f81d0c3b2cc0d077807c969b48cac4857ae77f87b4b480548252aa42d3a43b3e9d4bb54df567eb70f0c384782514fcea74b78765543e9496e27e2d - languageName: node - linkType: hard - "filelist@npm:^1.0.4": version: 1.0.4 resolution: "filelist@npm:1.0.4" @@ -15723,17 +15683,6 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:11.1.1": - version: 11.1.1 - resolution: "fs-extra@npm:11.1.1" - dependencies: - graceful-fs: "npm:^4.2.0" - jsonfile: "npm:^6.0.1" - universalify: "npm:^2.0.0" - checksum: 10c0/a2480243d7dcfa7d723c5f5b24cf4eba02a6ccece208f1524a2fbde1c629492cfb9a59e4b6d04faff6fbdf71db9fdc8ef7f396417a02884195a625f5d8dc9427 - languageName: node - linkType: hard - "fs-extra@npm:^10.0.0, fs-extra@npm:^10.1.0": version: 10.1.0 resolution: "fs-extra@npm:10.1.0" @@ -23614,10 +23563,10 @@ __metadata: languageName: node linkType: hard -"ramda@npm:0.29.0": - version: 0.29.0 - resolution: "ramda@npm:0.29.0" - checksum: 10c0/b00eaaf1c62b06a99affa1d583e256bd65ad27ab9d0ef512f55d7d93b842e7cd244a4a09179f61fdd8548362e409323867a2b0477cbd0626b5644eb6ac7c53da +"ramda@npm:^0.30.1": + version: 0.30.1 + resolution: "ramda@npm:0.30.1" + checksum: 10c0/3ea3e35c80e1a1b78c23de0c72d3382c3446f42052b113b851f1b7fc421e33a45ce92e7aef3c705cc6de3812a209d03417af5c264f67126cda539fd66c8bea71 languageName: node linkType: hard @@ -27377,13 +27326,6 @@ __metadata: languageName: node linkType: hard -"ts-toolbelt@npm:^9.6.0": - version: 9.6.0 - resolution: "ts-toolbelt@npm:9.6.0" - checksum: 10c0/838f9a2f0fe881d5065257a23b402c41315b33ff987b73db3e2b39fcb70640c4c7220e1ef118ed5676763543724fdbf4eda7b0e2c17acb667ed1401336af9f8c - languageName: node - linkType: hard - "tsconfig-paths-webpack-plugin@npm:^4.0.1": version: 4.1.0 resolution: "tsconfig-paths-webpack-plugin@npm:4.1.0" @@ -27567,15 +27509,6 @@ __metadata: languageName: node linkType: hard -"types-ramda@npm:^0.29.4": - version: 0.29.10 - resolution: "types-ramda@npm:0.29.10" - dependencies: - ts-toolbelt: "npm:^9.6.0" - checksum: 10c0/cc6439341a60a4f2b49e1ac447c8a0279f161464fd0a204abaa57e90e101772c0b1adc185a7c0715c3836c19594a9ec268c1e5c4394d0e409cb71d141def3963 - languageName: node - linkType: hard - "typescript@npm:^3.8.3": version: 3.9.10 resolution: "typescript@npm:3.9.10" From 94a0bf62437249af606e2923c21ef4fbd6a87210 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 1 Oct 2024 17:07:22 +0200 Subject: [PATCH 13/64] fix dep missing --- code/core/package.json | 1 + code/yarn.lock | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/code/core/package.json b/code/core/package.json index c502e9ac845a..fc1fce7cc28e 100644 --- a/code/core/package.json +++ b/code/core/package.json @@ -329,6 +329,7 @@ "@types/prettier": "^3.0.0", "@types/pretty-hrtime": "^1.0.0", "@types/prompts": "^2.0.9", + "@types/ramda": "^0.30.2", "@types/react-syntax-highlighter": "11.0.5", "@types/react-transition-group": "^4", "@types/semver": "^7.5.8", diff --git a/code/yarn.lock b/code/yarn.lock index 6fdf68f6070c..495364337ab2 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -6039,6 +6039,7 @@ __metadata: "@types/prettier": "npm:^3.0.0" "@types/pretty-hrtime": "npm:^1.0.0" "@types/prompts": "npm:^2.0.9" + "@types/ramda": "npm:^0.30.2" "@types/react-syntax-highlighter": "npm:11.0.5" "@types/react-transition-group": "npm:^4" "@types/semver": "npm:^7.5.8" @@ -8145,6 +8146,15 @@ __metadata: languageName: node linkType: hard +"@types/ramda@npm:^0.30.2": + version: 0.30.2 + resolution: "@types/ramda@npm:0.30.2" + dependencies: + types-ramda: "npm:^0.30.1" + checksum: 10c0/dda95008860f594eb7b4fd9819adeb2dcd4d4e2baca6cb33f692f6f8ea76d04a7fd81f9a057c5c67555612769e5592cb15f91de6c9f8b619b8b1d806d19dc9ea + languageName: node + linkType: hard + "@types/range-parser@npm:*": version: 1.2.5 resolution: "@types/range-parser@npm:1.2.5" @@ -27326,6 +27336,13 @@ __metadata: languageName: node linkType: hard +"ts-toolbelt@npm:^9.6.0": + version: 9.6.0 + resolution: "ts-toolbelt@npm:9.6.0" + checksum: 10c0/838f9a2f0fe881d5065257a23b402c41315b33ff987b73db3e2b39fcb70640c4c7220e1ef118ed5676763543724fdbf4eda7b0e2c17acb667ed1401336af9f8c + languageName: node + linkType: hard + "tsconfig-paths-webpack-plugin@npm:^4.0.1": version: 4.1.0 resolution: "tsconfig-paths-webpack-plugin@npm:4.1.0" @@ -27509,6 +27526,15 @@ __metadata: languageName: node linkType: hard +"types-ramda@npm:^0.30.1": + version: 0.30.1 + resolution: "types-ramda@npm:0.30.1" + dependencies: + ts-toolbelt: "npm:^9.6.0" + checksum: 10c0/4a8b230ae9772e6534f65b1a154dd5604bcd1d74e27b49686337a215e83aa8fc93e49f8c49af395418d2950cb9fb9b900662077c1d4b73ff6fe4f4bcb83ab2d6 + languageName: node + linkType: hard + "typescript@npm:^3.8.3": version: 3.9.10 resolution: "typescript@npm:3.9.10" From 4fd94e63e9cada9a98b9bd1f8869838e59a6694b Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 2 Oct 2024 09:05:25 +0200 Subject: [PATCH 14/64] remove custom content-type headers --- .../src/core-server/utils/server-statics.ts | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/code/core/src/core-server/utils/server-statics.ts b/code/core/src/core-server/utils/server-statics.ts index aa8f4876b4c5..04f985901ce3 100644 --- a/code/core/src/core-server/utils/server-statics.ts +++ b/code/core/src/core-server/utils/server-statics.ts @@ -7,25 +7,10 @@ import type { Options } from '@storybook/core/types'; import { logger } from '@storybook/core/node-logger'; import chalk from 'chalk'; -import type { ServerResponse } from 'http'; import type Polka from 'polka'; import sirv from 'sirv'; import { dedent } from 'ts-dedent'; -// TODO (43081j): maybe get this from somewhere? -const contentTypes: Record = { - css: 'text/css', - woff2: 'font/woff2', - js: 'text/javascript', -}; -const setContentTypeHeaders = (res: ServerResponse, pathname: string) => { - const base = basename(pathname); - const contentType = contentTypes[base]; - if (contentType) { - res.setHeader('Content-Type', contentType); - } -}; - export async function useStatics(app: Polka.Polka, options: Options): Promise { const staticDirs = (await options.presets.apply('staticDirs')) ?? []; const faviconPath = await options.presets.apply('favicon'); @@ -49,7 +34,7 @@ export async function useStatics(app: Polka.Polka, options: Options): Promise Serving static files from ${chalk.cyan(staticDir)} at ${chalk.cyan(targetEndpoint)}` ); @@ -66,7 +51,6 @@ export async function useStatics(app: Polka.Polka, options: Options): Promise { From 0cafba675b7ccb29fd2001aa07f0012024fc2959 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 2 Oct 2024 10:11:23 +0200 Subject: [PATCH 15/64] make polka a dev dep of builder-vite --- code/builders/builder-vite/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/builders/builder-vite/package.json b/code/builders/builder-vite/package.json index 3853291d8916..6487f0cdb097 100644 --- a/code/builders/builder-vite/package.json +++ b/code/builders/builder-vite/package.json @@ -49,7 +49,6 @@ "es-module-lexer": "^1.5.0", "find-cache-dir": "^3.0.0", "magic-string": "^0.30.0", - "polka": "^1.0.0-next.28", "sirv": "^2.0.4", "ts-dedent": "^2.0.0" }, @@ -57,6 +56,7 @@ "@types/express": "^4.17.21", "@types/node": "^22.0.0", "glob": "^10.0.0", + "polka": "^1.0.0-next.28", "slash": "^5.0.0", "typescript": "^5.3.2", "vite": "^4.0.4" From 31ca3f76336a6ea380833fd92fc69f6f05b9130a Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 2 Oct 2024 10:15:01 +0200 Subject: [PATCH 16/64] prebundle polka, sirv --- code/builders/builder-vite/package.json | 2 +- code/builders/builder-webpack5/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/builders/builder-vite/package.json b/code/builders/builder-vite/package.json index 6487f0cdb097..da62b3d90d69 100644 --- a/code/builders/builder-vite/package.json +++ b/code/builders/builder-vite/package.json @@ -49,7 +49,6 @@ "es-module-lexer": "^1.5.0", "find-cache-dir": "^3.0.0", "magic-string": "^0.30.0", - "sirv": "^2.0.4", "ts-dedent": "^2.0.0" }, "devDependencies": { @@ -57,6 +56,7 @@ "@types/node": "^22.0.0", "glob": "^10.0.0", "polka": "^1.0.0-next.28", + "sirv": "^2.0.4", "slash": "^5.0.0", "typescript": "^5.3.2", "vite": "^4.0.4" diff --git a/code/builders/builder-webpack5/package.json b/code/builders/builder-webpack5/package.json index e9250474971c..70a2b505be1b 100644 --- a/code/builders/builder-webpack5/package.json +++ b/code/builders/builder-webpack5/package.json @@ -78,7 +78,6 @@ "path-browserify": "^1.0.1", "process": "^0.11.10", "semver": "^7.3.7", - "sirv": "^2.0.4", "style-loader": "^3.3.1", "terser-webpack-plugin": "^5.3.1", "ts-dedent": "^2.0.0", @@ -95,6 +94,7 @@ "@types/terser-webpack-plugin": "^5.2.0", "@types/webpack-hot-middleware": "^2.25.6", "pretty-hrtime": "^1.0.3", + "sirv": "^2.0.4", "slash": "^5.0.0", "typescript": "^5.3.2" }, From eb504091eb80b2cca7b52ebea4cd41cda318fe31 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 2 Oct 2024 13:15:50 +0200 Subject: [PATCH 17/64] replace for https://git.nfp.is/TheThing/fs-cache-fast/src/branch/master/index.mjs --- code/core/package.json | 2 - code/core/src/common/utils/file-cache.ts | 535 +++++------------------ code/yarn.lock | 34 -- 3 files changed, 116 insertions(+), 455 deletions(-) diff --git a/code/core/package.json b/code/core/package.json index fc1fce7cc28e..3f404f11fb26 100644 --- a/code/core/package.json +++ b/code/core/package.json @@ -329,7 +329,6 @@ "@types/prettier": "^3.0.0", "@types/pretty-hrtime": "^1.0.0", "@types/prompts": "^2.0.9", - "@types/ramda": "^0.30.2", "@types/react-syntax-highlighter": "11.0.5", "@types/react-transition-group": "^4", "@types/semver": "^7.5.8", @@ -390,7 +389,6 @@ "prettier": "^3.2.5", "pretty-hrtime": "^1.0.3", "prompts": "^2.4.0", - "ramda": "^0.30.1", "react": "^18.2.0", "react-dom": "^18.2.0", "react-draggable": "^4.4.5", diff --git a/code/core/src/common/utils/file-cache.ts b/code/core/src/common/utils/file-cache.ts index a788150c4a63..6e2a9d545bf9 100644 --- a/code/core/src/common/utils/file-cache.ts +++ b/code/core/src/common/utils/file-cache.ts @@ -1,469 +1,166 @@ -import * as crypto from 'node:crypto'; -import * as fs from 'node:fs'; -import { existsSync, lstatSync } from 'node:fs'; -import * as fsp from 'node:fs/promises'; -import { mkdir, rm, stat } from 'node:fs/promises'; -import * as fsPath from 'node:path'; - -import * as R from 'ramda'; - -const pathExists = async (path: string) => { - return stat(path) - .then(() => true) - .catch(() => false); -}; - -async function ensureDir(dirPath: string): Promise { - try { - // Attempt to create the directory recursively - await mkdir(dirPath, { recursive: true }); - } catch (err: any) { - // If the error is something other than the directory already existing, throw the error - if (err.code !== 'EEXIST') { - throw err; - } - } +import { createHash, randomBytes } from 'node:crypto'; +import { mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs'; +import { promises as fsPromises } from 'node:fs'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; + +interface FileSystemCacheOptions { + ns?: string; + prefix?: string; + hash_alg?: string; + basePath?: string; + ttl?: number; } -async function remove(path: string): Promise { - try { - // Attempt to remove the file or directory recursively - await rm(path, { recursive: true, force: true }); - } catch (err: any) { - // If the error code is anything other than the path not existing, rethrow the error - if (err.code !== 'ENOENT') { - throw err; - } - } +interface CacheItem { + key: string; + content?: any; + value?: any; } -export type FileSystemCacheOptions = { - basePath?: string; - ns?: any; +interface CacheSetOptions { ttl?: number; - hash?: HashAlgorithm; - extension?: string; -}; - -export const isNothing = (value: any) => R.isNil(value) || R.isEmpty(value); -export const isString = R.is(String); - -export const toAbsolutePath = (path: string) => { - return path.startsWith('.') ? fsPath.resolve(path) : path; -}; - -export const ensureString = (defaultValue: string, text?: string): string => { - return typeof text === 'string' ? text : defaultValue; -}; + encoding?: BufferEncoding; +} -export const compact = (input: any[]): string[] => { - const flat = [].concat(...input); - return flat.filter((value) => !R.isNil(value)); -}; +export class FileSystemCache { + private id = randomBytes(15).toString('base64').replace(/\//g, '-'); -export const toStringArray = R.pipe(compact, R.map(R.toString)); + private prefix: string; -export const isFileSync = (path: string) => { - return existsSync(path) ? lstatSync(path).isFile() : false; -}; + private hash_alg: string; -export const readFileSync = (path: string) => { - return existsSync(path) ? fs.readFileSync(path).toString() : undefined; -}; + private cache_dir: string; -export const filePathsP = async (basePath: string, ns: string): Promise => { - if (!(await pathExists(basePath))) { - return []; - } - return (await fsp.readdir(basePath)) - .filter(Boolean) - .filter((name) => (ns ? name.startsWith(ns) : true)) - .filter((name) => (!ns ? !name.includes('-') : true)) - .map((name) => `${basePath}/${name}`); -}; + private ttl: number; -/** - * Turns a set of values into a HEX hash code. - * - * @param values: The set of values to hash. - */ -export const hash = (algorithm: HashAlgorithm, ...values: any[]) => { - if (R.pipe(compact, R.isEmpty)(values)) { - return undefined; + constructor(options: FileSystemCacheOptions = {}) { + this.prefix = (options.ns || options.prefix || '') + '-'; + this.hash_alg = options.hash_alg || 'md5'; + this.cache_dir = options.basePath || join(tmpdir(), this.id); + this.ttl = options.ttl || 0; + createHash(this.hash_alg); // Verifies hash algorithm is available + mkdirSync(this.cache_dir, { recursive: true }); } - const resultHash = crypto.createHash(algorithm); - const addValue = (value: any) => resultHash.update(value); - const addValues = R.forEach(addValue); - R.pipe(toStringArray, addValues)(values); - return resultHash.digest('hex'); -}; - -export const hashExists = (algorithm: HashAlgorithm) => { - return crypto.getHashes().includes(algorithm); -}; - -/** Retrieve a value from the given path. */ -export async function getValueP(path: string, defaultValue?: any) { - const exists = await pathExists(path); - if (!exists) { - return defaultValue; + private generateHash(name: string): string { + return join(this.cache_dir, this.prefix + createHash(this.hash_alg).update(name).digest('hex')); } - try { - const content = await fsp.readFile(path, 'utf8'); - return toGetValue(JSON.parse(content)); - } catch (error: any) { - if (error.code === 'ENOENT') { - return defaultValue; - } - if (error.message === 'Cache item has expired.') { - fs.rmSync(path); - return defaultValue; - } - throw new Error(`Failed to read cache value at: ${path}. ${error.message}`); - } -} -/** Format value structure. */ -export const toGetValue = (data: any) => { - if (isExpired(data)) { - return undefined; + private isExpired(parsed: { ttl?: number }, now: number): boolean { + return parsed.ttl != null && now > parsed.ttl; } - if (data.type === 'Date') { - return new Date(data.value); + private parseCacheData( + data: string, + fallback: T | null, + opts: CacheSetOptions = {} + ): T | null { + const parsed = JSON.parse(data); + return this.isExpired(parsed, Date.now()) ? fallback : (parsed.content as T); } - return data.value; -}; - -/** Stringify a value into JSON. */ -export const toJson = (value: any, ttl: number) => - JSON.stringify({ value, type: R.type(value), created: new Date(), ttl }); - -/** Check's a cache item to see if it has expired. */ -export const isExpired = (data: any) => { - const timeElapsed = (new Date().getTime() - new Date(data.created).getTime()) / 1000; - return timeElapsed > data.ttl && data.ttl > 0; -}; - -export type HashAlgorithm = - | 'RSA-MD5' - | 'RSA-RIPEMD160' - | 'RSA-SHA1' - | 'RSA-SHA1-2' - | 'RSA-SHA224' - | 'RSA-SHA256' - | 'RSA-SHA3-224' - | 'RSA-SHA3-256' - | 'RSA-SHA3-384' - | 'RSA-SHA3-512' - | 'RSA-SHA384' - | 'RSA-SHA512' - | 'RSA-SHA512/224' - | 'RSA-SHA512/256' - | 'RSA-SM3' - | 'blake2b512' - | 'blake2s256' - | 'id-rsassa-pkcs1-v1_5-with-sha3-224' - | 'id-rsassa-pkcs1-v1_5-with-sha3-256' - | 'id-rsassa-pkcs1-v1_5-with-sha3-384' - | 'id-rsassa-pkcs1-v1_5-with-sha3-512' - | 'md5' - | 'md5-sha1' - | 'md5WithRSAEncryption' - | 'ripemd' - | 'ripemd160' - | 'ripemd160WithRSA' - | 'rmd160' - | 'sha1' - | 'sha1WithRSAEncryption' - | 'sha224' - | 'sha224WithRSAEncryption' - | 'sha256' - | 'sha256WithRSAEncryption' - | 'sha3-224' - | 'sha3-256' - | 'sha3-384' - | 'sha3-512' - | 'sha384' - | 'sha384WithRSAEncryption' - | 'sha512' - | 'sha512-224' - | 'sha512-224WithRSAEncryption' - | 'sha512-256' - | 'sha512-256WithRSAEncryption' - | 'sha512WithRSAEncryption' - | 'shake128' - | 'shake256' - | 'sm3' - | 'sm3WithRSAEncryption' - | 'ssl3-md5' - | 'ssl3-sha1'; - -export const hashAlgorithms: HashAlgorithm[] = [ - 'RSA-MD5', - 'RSA-RIPEMD160', - 'RSA-SHA1', - 'RSA-SHA1-2', - 'RSA-SHA224', - 'RSA-SHA256', - 'RSA-SHA3-224', - 'RSA-SHA3-256', - 'RSA-SHA3-384', - 'RSA-SHA3-512', - 'RSA-SHA384', - 'RSA-SHA512', - 'RSA-SHA512/224', - 'RSA-SHA512/256', - 'RSA-SM3', - 'blake2b512', - 'blake2s256', - 'id-rsassa-pkcs1-v1_5-with-sha3-224', - 'id-rsassa-pkcs1-v1_5-with-sha3-256', - 'id-rsassa-pkcs1-v1_5-with-sha3-384', - 'id-rsassa-pkcs1-v1_5-with-sha3-512', - 'md5', - 'md5-sha1', - 'md5WithRSAEncryption', - 'ripemd', - 'ripemd160', - 'ripemd160WithRSA', - 'rmd160', - 'sha1', - 'sha1WithRSAEncryption', - 'sha224', - 'sha224WithRSAEncryption', - 'sha256', - 'sha256WithRSAEncryption', - 'sha3-224', - 'sha3-256', - 'sha3-384', - 'sha3-512', - 'sha384', - 'sha384WithRSAEncryption', - 'sha512', - 'sha512-224', - 'sha512-224WithRSAEncryption', - 'sha512-256', - 'sha512-256WithRSAEncryption', - 'sha512WithRSAEncryption', - 'shake128', - 'shake256', - 'sm3', - 'sm3WithRSAEncryption', - 'ssl3-md5', - 'ssl3-sha1', -]; -/** A cache that read/writes to a specific part of the file-system. */ -export class FileSystemCache { - /** The list of all available hash algorithms. */ - static hashAlgorithms: HashAlgorithm[] = hashAlgorithms; - - /** Instance. */ - readonly basePath: string; - - readonly ns?: any; - readonly extension?: string; - - readonly hash: HashAlgorithm; - - readonly ttl: number; - - basePathExists?: boolean; - - /** - * Constructor. - * - * @param options - BasePath: The folder path to read/write to. Default: './build' - ns: A single - * value, or array, that represents a a unique namespace within which values for this store are - * cached. - extension: An optional file-extension for paths. - ttl: The default time-to-live - * for cached values in seconds. Default: 0 (never expires) - hash: The hashing algorithm to use - * when generating cache keys. Default: "sha1" - */ - constructor(options: FileSystemCacheOptions = {}) { - this.basePath = formatPath(options.basePath); - this.hash = options.hash ?? 'sha1'; - this.ns = hash(this.hash, options.ns); - this.ttl = options.ttl ?? 0; - - if (isString(options.extension)) { - this.extension = options.extension; - } - - if (isFileSync(this.basePath)) { - throw new Error(`The basePath '${this.basePath}' is a file. It should be a folder.`); - } - - if (!hashExists(this.hash)) { - throw new Error(`Hash does not exist: ${this.hash}`); - } + private parseSetData(key: string, data: T, opts: CacheSetOptions = {}): string { + const ttl = opts.ttl ?? this.ttl; + return JSON.stringify({ key, content: data, ...(ttl && { ttl: Date.now() + ttl * 1000 }) }); } - /** - * Generates the path to the cached files. - * - * @param {string} key: The key of the cache item. - */ - public path(key: string): string { - if (isNothing(key)) { - throw new Error(`Path requires a cache key.`); - } - let name = hash(this.hash, key); - - if (this.ns) { - name = `${this.ns}-${name}`; - } - - if (this.extension) { - name = `${name}.${this.extension.replace(/^\./, '')}`; + public async get( + name: string, + fallback: T | null = null, + opts?: CacheSetOptions + ): Promise { + try { + const data = await fsPromises.readFile(this.generateHash(name), 'utf8'); + return this.parseCacheData(data, fallback, opts); + } catch { + return fallback; } - return `${this.basePath}/${name}`; } - /** - * Determines whether the file exists. - * - * @param {string} key: The key of the cache item. - */ - public fileExists(key: string) { - return pathExists(this.path(key)); - } - - /** Ensure that the base path exists. */ - public async ensureBasePath() { - if (!this.basePathExists) { - await ensureDir(this.basePath); + public getSync(name: string, fallback: T | null = null, opts?: CacheSetOptions): T | null { + try { + const data = readFileSync(this.generateHash(name), 'utf8'); + return this.parseCacheData(data, fallback, opts); + } catch { + return fallback; } - this.basePathExists = true; } - /** - * Gets the contents of the file with the given key. - * - * @param {string} key: The key of the cache item. - * @param defaultValue: Optional. A default value to return if the value does not exist in cache. - * @returns File contents, or undefined if the file does not exis - */ - public get(key: string, defaultValue?: any) { - return getValueP(this.path(key), defaultValue); + public async set( + name: string, + data: T, + orgOpts: CacheSetOptions | number = {} + ): Promise { + const opts: CacheSetOptions = typeof orgOpts === 'number' ? { ttl: orgOpts } : orgOpts; + await fsPromises.writeFile(this.generateHash(name), this.parseSetData(name, data, opts), { + encoding: opts.encoding || 'utf8', + }); } - /** - * Gets the contents of the file with the given key. - * - * @param {string} key: The key of the cache item. - * @param defaultValue: Optional. A default value to return if the value does not exist in cache. - * @returns The cached value, or undefined. - */ - public getSync(key: string, defaultValue?: any) { - const path = this.path(key); - const content = readFileSync(path) || ''; - return fs.existsSync(path) ? toGetValue(JSON.parse(content)) : defaultValue; + public setSync(name: string, data: T, orgOpts: CacheSetOptions | number = {}): void { + const opts: CacheSetOptions = typeof orgOpts === 'number' ? { ttl: orgOpts } : orgOpts; + writeFileSync(this.generateHash(name), this.parseSetData(name, data, opts), { + encoding: opts.encoding || 'utf8', + }); } - /** - * Writes the given value to the file-system. - * - * @param {string} key: The key of the cache item. - * @param value: The value to write (Primitive or Object). - */ - public async set(key: string, value: any, ttl?: number) { - const path = this.path(key); - ttl = typeof ttl === 'number' ? ttl : this.ttl; - await this.ensureBasePath(); - await fsp.writeFile(path, toJson(value, ttl)); - return { path }; + public async setMany(items: CacheItem[], options?: CacheSetOptions): Promise { + await Promise.all(items.map((item) => this.set(item.key, item.content ?? item.value, options))); } - /** - * Writes the given value to the file-system and memory cache. - * - * @param {string} key: The key of the cache item. - * @param value: The value to write (Primitive or Object). - * @returns The cache. - */ - public setSync(key: string, value: any, ttl?: number) { - ttl = typeof ttl === 'number' ? ttl : this.ttl; - fs.writeFileSync(this.path(key), toJson(value, ttl)); - return this; + public setManySync(items: CacheItem[], options?: CacheSetOptions): void { + items.forEach((item) => this.setSync(item.key, item.content ?? item.value, options)); } - /** - * Removes the item from the file-system. - * - * @param {string} key: The key of the cache item. - */ - public remove(key: string) { - return remove(this.path(key)); + public async remove(name: string): Promise { + await fsPromises.rm(this.generateHash(name), { force: true }); } - /** Removes all items from the cache. */ - public async clear() { - const paths = await filePathsP(this.basePath, this.ns); - await Promise.all(paths.map((path) => remove(path))); - console.groupEnd(); + public removeSync(name: string): void { + rmSync(this.generateHash(name), { force: true }); } - /** - * Saves several items to the cache in one operation. - * - * @param {array} items: An array of objects of the form { key, value }. - */ - public async save( - input: ({ key: string; value: any } | null | undefined)[] - ): Promise<{ paths: string[] }> { - type Item = { key: string; value: any }; - let items = (Array.isArray(input) ? input : [input]) as Item[]; - - const isValid = (item: any) => { - if (!R.is(Object, item)) { - return false; - } - return item.key && item.value; - }; - - items = items.filter((item) => Boolean(item)); - items - .filter((item) => !isValid(item)) - .forEach(() => { - const err = `Save items not valid, must be an array of {key, value} objects.`; - throw new Error(err); - }); - - if (items.length === 0) { - return { paths: [] }; - } - - const paths = await Promise.all( - items.map(async (item) => (await this.set(item.key, item.value)).path) + public async clear(): Promise { + const files = await fsPromises.readdir(this.cache_dir); + await Promise.all( + files + .filter((f) => f.startsWith(this.prefix)) + .map((f) => fsPromises.rm(join(this.cache_dir, f), { force: true })) ); - - return { paths }; } - /** Loads all files within the cache's namespace. */ - public async load(): Promise<{ files: { path: string; value: any }[] }> { - const paths = await filePathsP(this.basePath, this.ns); + public clearSync(): void { + readdirSync(this.cache_dir) + .filter((f) => f.startsWith(this.prefix)) + .forEach((f) => rmSync(join(this.cache_dir, f), { force: true })); + } - if (paths.length === 0) { - return { files: [] }; - } - const files = await Promise.all( - paths.map(async (path) => ({ path, value: await getValueP(path) })) + public async getAll(): Promise { + const now = Date.now(); + const files = await fsPromises.readdir(this.cache_dir); + const items = await Promise.all( + files + .filter((f) => f.startsWith(this.prefix)) + .map((f) => fsPromises.readFile(join(this.cache_dir, f), 'utf8')) ); - return { files }; + return items + .map((data) => JSON.parse(data)) + .filter((entry) => entry.content && !this.isExpired(entry, now)); + } + + public async load(): Promise<{ files: CacheItem[] }> { + const res = await this.getAll(); + return { + files: res.map((entry) => ({ + path: this.generateHash(entry.key), + value: entry.content, + key: entry.key, + })), + }; } } -/** Helpers */ - -function formatPath(path?: string) { - path = ensureString('./.cache', path); - path = toAbsolutePath(path); - return path; -} - export function createFileSystemCache(options: FileSystemCacheOptions): FileSystemCache { return new FileSystemCache(options); } diff --git a/code/yarn.lock b/code/yarn.lock index 495364337ab2..f258f17c2b2b 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -6039,7 +6039,6 @@ __metadata: "@types/prettier": "npm:^3.0.0" "@types/pretty-hrtime": "npm:^1.0.0" "@types/prompts": "npm:^2.0.9" - "@types/ramda": "npm:^0.30.2" "@types/react-syntax-highlighter": "npm:11.0.5" "@types/react-transition-group": "npm:^4" "@types/semver": "npm:^7.5.8" @@ -6105,7 +6104,6 @@ __metadata: pretty-hrtime: "npm:^1.0.3" process: "npm:^0.11.10" prompts: "npm:^2.4.0" - ramda: "npm:^0.30.1" react: "npm:^18.2.0" react-dom: "npm:^18.2.0" react-draggable: "npm:^4.4.5" @@ -8146,15 +8144,6 @@ __metadata: languageName: node linkType: hard -"@types/ramda@npm:^0.30.2": - version: 0.30.2 - resolution: "@types/ramda@npm:0.30.2" - dependencies: - types-ramda: "npm:^0.30.1" - checksum: 10c0/dda95008860f594eb7b4fd9819adeb2dcd4d4e2baca6cb33f692f6f8ea76d04a7fd81f9a057c5c67555612769e5592cb15f91de6c9f8b619b8b1d806d19dc9ea - languageName: node - linkType: hard - "@types/range-parser@npm:*": version: 1.2.5 resolution: "@types/range-parser@npm:1.2.5" @@ -23573,13 +23562,6 @@ __metadata: languageName: node linkType: hard -"ramda@npm:^0.30.1": - version: 0.30.1 - resolution: "ramda@npm:0.30.1" - checksum: 10c0/3ea3e35c80e1a1b78c23de0c72d3382c3446f42052b113b851f1b7fc421e33a45ce92e7aef3c705cc6de3812a209d03417af5c264f67126cda539fd66c8bea71 - languageName: node - linkType: hard - "randombytes@npm:^2.0.0, randombytes@npm:^2.0.1, randombytes@npm:^2.0.5, randombytes@npm:^2.1.0": version: 2.1.0 resolution: "randombytes@npm:2.1.0" @@ -27336,13 +27318,6 @@ __metadata: languageName: node linkType: hard -"ts-toolbelt@npm:^9.6.0": - version: 9.6.0 - resolution: "ts-toolbelt@npm:9.6.0" - checksum: 10c0/838f9a2f0fe881d5065257a23b402c41315b33ff987b73db3e2b39fcb70640c4c7220e1ef118ed5676763543724fdbf4eda7b0e2c17acb667ed1401336af9f8c - languageName: node - linkType: hard - "tsconfig-paths-webpack-plugin@npm:^4.0.1": version: 4.1.0 resolution: "tsconfig-paths-webpack-plugin@npm:4.1.0" @@ -27526,15 +27501,6 @@ __metadata: languageName: node linkType: hard -"types-ramda@npm:^0.30.1": - version: 0.30.1 - resolution: "types-ramda@npm:0.30.1" - dependencies: - ts-toolbelt: "npm:^9.6.0" - checksum: 10c0/4a8b230ae9772e6534f65b1a154dd5604bcd1d74e27b49686337a215e83aa8fc93e49f8c49af395418d2950cb9fb9b900662077c1d4b73ff6fe4f4bcb83ab2d6 - languageName: node - linkType: hard - "typescript@npm:^3.8.3": version: 3.9.10 resolution: "typescript@npm:3.9.10" From a4e35ec921a948026e6cc63d2db2f9e1db2c05f5 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 2 Oct 2024 13:33:39 +0200 Subject: [PATCH 18/64] fix --- code/core/src/common/utils/file-cache.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/core/src/common/utils/file-cache.ts b/code/core/src/common/utils/file-cache.ts index 6e2a9d545bf9..c44e4dc66038 100644 --- a/code/core/src/common/utils/file-cache.ts +++ b/code/core/src/common/utils/file-cache.ts @@ -65,7 +65,7 @@ export class FileSystemCache { return JSON.stringify({ key, content: data, ...(ttl && { ttl: Date.now() + ttl * 1000 }) }); } - public async get( + public async get( name: string, fallback: T | null = null, opts?: CacheSetOptions From 9e050395f156dffdb8ee4f75207755d80a0f1b1e Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 2 Oct 2024 13:42:44 +0200 Subject: [PATCH 19/64] fix --- code/__mocks__/fs.ts | 2 ++ code/core/src/cli/detect.test.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/code/__mocks__/fs.ts b/code/__mocks__/fs.ts index 50e34e8e4ca1..f617d31141f6 100644 --- a/code/__mocks__/fs.ts +++ b/code/__mocks__/fs.ts @@ -19,6 +19,7 @@ export const realpathSync = vi.fn(); export const readdir = vi.fn(); export const readdirSync = vi.fn(); export const readlinkSync = vi.fn(); +export const mkdirSync = vi.fn(); export default { __setMockFiles, @@ -29,4 +30,5 @@ export default { readdir, readdirSync, readlinkSync, + mkdirSync, }; diff --git a/code/core/src/cli/detect.test.ts b/code/core/src/cli/detect.test.ts index 95c1b126dca3..ea7f8139fda3 100644 --- a/code/core/src/cli/detect.test.ts +++ b/code/core/src/cli/detect.test.ts @@ -24,6 +24,7 @@ vi.mock('fs', () => ({ readdirSync: vi.fn(), readlinkSync: vi.fn(), default: vi.fn(), + mkdirSync: vi.fn(), })); vi.mock('@storybook/core/node-logger'); From c36ee50b67be7917b46c7acc5e63e1915abbf671 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 2 Oct 2024 15:17:40 +0200 Subject: [PATCH 20/64] simplifications, fixes, and make webpack progress actually represent the modules, instead of entrypoints... --- code/builders/builder-webpack5/src/index.ts | 4 +- .../src/preview/iframe-webpack.config.ts | 4 +- code/core/src/common/utils/file-cache.ts | 38 ++++++++----------- 3 files changed, 19 insertions(+), 27 deletions(-) diff --git a/code/builders/builder-webpack5/src/index.ts b/code/builders/builder-webpack5/src/index.ts index ffc11812562b..e35ced7be073 100644 --- a/code/builders/builder-webpack5/src/index.ts +++ b/code/builders/builder-webpack5/src/index.ts @@ -137,7 +137,7 @@ const starter: StarterFunction = async function* starterGeneratorFn({ } yield; - const modulesCount = (await options.cache?.get('modulesCount').catch(() => {})) || 1000; + const modulesCount = await options.cache?.get('modulesCount', 1000); let totalModules: number; let value = 0; @@ -147,7 +147,7 @@ const starter: StarterFunction = async function* starterGeneratorFn({ const progress = { value, message: message.charAt(0).toUpperCase() + message.slice(1) }; if (message === 'building') { // arg3 undefined in webpack5 - const counts = (arg3 && arg3.match(/(\d+)\/(\d+)/)) || []; + const counts = (arg3 && arg3.match(/entries (\d+)\/(\d+)/)) || []; const complete = parseInt(counts[1], 10); const total = parseInt(counts[2], 10); if (!Number.isNaN(complete) && !Number.isNaN(total)) { diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index ea8b55d4973c..763f2bf15646 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -72,7 +72,7 @@ export default async ( docsOptions, entries, nonNormalizedStories, - modulesCount = 1000, + modulesCount, build, tagsOptions, ] = await Promise.all([ @@ -86,7 +86,7 @@ export default async ( presets.apply('docs'), presets.apply('entries', []), presets.apply('stories', []), - options.cache?.get('modulesCount').catch(() => {}), + options.cache?.get('modulesCount', 1000), options.presets.apply('build'), presets.apply('tags', {}), ]); diff --git a/code/core/src/common/utils/file-cache.ts b/code/core/src/common/utils/file-cache.ts index c44e4dc66038..3dd7849abd66 100644 --- a/code/core/src/common/utils/file-cache.ts +++ b/code/core/src/common/utils/file-cache.ts @@ -1,6 +1,6 @@ import { createHash, randomBytes } from 'node:crypto'; import { mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs'; -import { promises as fsPromises } from 'node:fs'; +import { readFile, readdir, rm, writeFile } from 'node:fs/promises'; import { tmpdir } from 'node:os'; import { join } from 'node:path'; @@ -51,11 +51,7 @@ export class FileSystemCache { return parsed.ttl != null && now > parsed.ttl; } - private parseCacheData( - data: string, - fallback: T | null, - opts: CacheSetOptions = {} - ): T | null { + private parseCacheData(data: string, fallback: T | null): T | null { const parsed = JSON.parse(data); return this.isExpired(parsed, Date.now()) ? fallback : (parsed.content as T); } @@ -65,25 +61,21 @@ export class FileSystemCache { return JSON.stringify({ key, content: data, ...(ttl && { ttl: Date.now() + ttl * 1000 }) }); } - public async get( - name: string, - fallback: T | null = null, - opts?: CacheSetOptions - ): Promise { + public async get(name: string, fallback?: T): Promise { try { - const data = await fsPromises.readFile(this.generateHash(name), 'utf8'); - return this.parseCacheData(data, fallback, opts); + const data = await readFile(this.generateHash(name), 'utf8'); + return this.parseCacheData(data, fallback) as T; } catch { - return fallback; + return fallback as T; } } - public getSync(name: string, fallback: T | null = null, opts?: CacheSetOptions): T | null { + public getSync(name: string, fallback?: T): T { try { const data = readFileSync(this.generateHash(name), 'utf8'); - return this.parseCacheData(data, fallback, opts); + return this.parseCacheData(data, fallback) as T; } catch { - return fallback; + return fallback as T; } } @@ -93,7 +85,7 @@ export class FileSystemCache { orgOpts: CacheSetOptions | number = {} ): Promise { const opts: CacheSetOptions = typeof orgOpts === 'number' ? { ttl: orgOpts } : orgOpts; - await fsPromises.writeFile(this.generateHash(name), this.parseSetData(name, data, opts), { + await writeFile(this.generateHash(name), this.parseSetData(name, data, opts), { encoding: opts.encoding || 'utf8', }); } @@ -114,7 +106,7 @@ export class FileSystemCache { } public async remove(name: string): Promise { - await fsPromises.rm(this.generateHash(name), { force: true }); + await rm(this.generateHash(name), { force: true }); } public removeSync(name: string): void { @@ -122,11 +114,11 @@ export class FileSystemCache { } public async clear(): Promise { - const files = await fsPromises.readdir(this.cache_dir); + const files = await readdir(this.cache_dir); await Promise.all( files .filter((f) => f.startsWith(this.prefix)) - .map((f) => fsPromises.rm(join(this.cache_dir, f), { force: true })) + .map((f) => rm(join(this.cache_dir, f), { force: true })) ); } @@ -138,11 +130,11 @@ export class FileSystemCache { public async getAll(): Promise { const now = Date.now(); - const files = await fsPromises.readdir(this.cache_dir); + const files = await readdir(this.cache_dir); const items = await Promise.all( files .filter((f) => f.startsWith(this.prefix)) - .map((f) => fsPromises.readFile(join(this.cache_dir, f), 'utf8')) + .map((f) => readFile(join(this.cache_dir, f), 'utf8')) ); return items .map((data) => JSON.parse(data)) From 0080cf2b450a30ca07fdd4999dee92be235263e1 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 2 Oct 2024 15:58:19 +0200 Subject: [PATCH 21/64] fix typing issue --- code/core/src/common/utils/file-cache.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/core/src/common/utils/file-cache.ts b/code/core/src/common/utils/file-cache.ts index 3dd7849abd66..3c9fd7d10789 100644 --- a/code/core/src/common/utils/file-cache.ts +++ b/code/core/src/common/utils/file-cache.ts @@ -24,8 +24,6 @@ interface CacheSetOptions { } export class FileSystemCache { - private id = randomBytes(15).toString('base64').replace(/\//g, '-'); - private prefix: string; private hash_alg: string; @@ -37,7 +35,8 @@ export class FileSystemCache { constructor(options: FileSystemCacheOptions = {}) { this.prefix = (options.ns || options.prefix || '') + '-'; this.hash_alg = options.hash_alg || 'md5'; - this.cache_dir = options.basePath || join(tmpdir(), this.id); + this.cache_dir = + options.basePath || join(tmpdir(), randomBytes(15).toString('base64').replace(/\//g, '-')); this.ttl = options.ttl || 0; createHash(this.hash_alg); // Verifies hash algorithm is available mkdirSync(this.cache_dir, { recursive: true }); From 219b7d7cb1662799b9a7af0c25e86830c3e192c2 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 2 Oct 2024 16:10:10 +0200 Subject: [PATCH 22/64] fix typing issues proper --- code/core/src/cli/dev.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/core/src/cli/dev.ts b/code/core/src/cli/dev.ts index 6d05f140fa38..26ff6250f3a8 100644 --- a/code/core/src/cli/dev.ts +++ b/code/core/src/cli/dev.ts @@ -44,14 +44,16 @@ export const dev = async (cliOptions: CLIOptions) => { const packageJson = await findPackage(__dirname); invariant(packageJson, 'Failed to find the closest package.json file.'); + type Options = Parameters[0]; + const options = { ...cliOptions, configDir: cliOptions.configDir || './.storybook', configType: 'DEVELOPMENT', ignorePreview: !!cliOptions.previewUrl && !cliOptions.forceBuildPreview, - cache, + cache: cache as any, packageJson, - } as Parameters[0]; + } as Options; await withTelemetry( 'dev', From 3116f88a6459b8a6e7385f7160b5bf974c31ae99 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 2 Oct 2024 16:26:43 +0200 Subject: [PATCH 23/64] set up the linting plugin --- code/package.json | 1 + code/yarn.lock | 19 +++++++++++++++++++ scripts/.eslintrc.cjs | 10 +++++++++- scripts/package.json | 1 + scripts/yarn.lock | 37 +++++++++++++++++++++++++++++++++++++ 5 files changed, 67 insertions(+), 1 deletion(-) diff --git a/code/package.json b/code/package.json index 6619f4e0b187..a62be2693a17 100644 --- a/code/package.json +++ b/code/package.json @@ -191,6 +191,7 @@ "esbuild-plugin-alias": "^0.2.1", "eslint": "^8.56.0", "eslint-import-resolver-typescript": "^3.6.1", + "eslint-plugin-depend": "^0.11.0", "eslint-plugin-local-rules": "portal:../scripts/eslint-plugin-local-rules", "eslint-plugin-playwright": "^1.6.2", "eslint-plugin-storybook": "^0.8.0", diff --git a/code/yarn.lock b/code/yarn.lock index 1b04c78853dc..f71bd7d4d3b6 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -6891,6 +6891,7 @@ __metadata: esbuild-plugin-alias: "npm:^0.2.1" eslint: "npm:^8.56.0" eslint-import-resolver-typescript: "npm:^3.6.1" + eslint-plugin-depend: "npm:^0.11.0" eslint-plugin-local-rules: "portal:../scripts/eslint-plugin-local-rules" eslint-plugin-playwright: "npm:^1.6.2" eslint-plugin-storybook: "npm:^0.8.0" @@ -14336,6 +14337,17 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-depend@npm:^0.11.0": + version: 0.11.0 + resolution: "eslint-plugin-depend@npm:0.11.0" + dependencies: + fd-package-json: "npm:^1.2.0" + module-replacements: "npm:^2.1.0" + semver: "npm:^7.6.3" + checksum: 10c0/64baf4d4f5d406efa1f13bda723ff0eb5fe4cee0ae8c3679fcdfccb4d7ba3a9472416fa3c54d75f1bde3e0123e55a85774662484a5b0355812f21a8968ee784a + languageName: node + linkType: hard + "eslint-plugin-eslint-comments@npm:^3.2.0": version: 3.2.0 resolution: "eslint-plugin-eslint-comments@npm:3.2.0" @@ -21040,6 +21052,13 @@ __metadata: languageName: node linkType: hard +"module-replacements@npm:^2.1.0": + version: 2.5.0 + resolution: "module-replacements@npm:2.5.0" + checksum: 10c0/7fcbcb19151778a2f2fa70b7bffb134bb8922b2306e2a0d7b4a863467a9d6d9d5fed537763c43272e22b69dbddaf1610746b42a68b4663aa225e85f9ae9b03c8 + languageName: node + linkType: hard + "mri@npm:^1.1.0, mri@npm:^1.2.0": version: 1.2.0 resolution: "mri@npm:1.2.0" diff --git a/scripts/.eslintrc.cjs b/scripts/.eslintrc.cjs index 2af8b19b61c1..b49fe70944d0 100644 --- a/scripts/.eslintrc.cjs +++ b/scripts/.eslintrc.cjs @@ -1,6 +1,11 @@ module.exports = { root: true, - extends: ['@storybook/eslint-config-storybook', 'plugin:storybook/recommended'], + extends: [ + // + '@storybook/eslint-config-storybook', + 'plugin:storybook/recommended', + 'plugin:depend/recommended' + ], parserOptions: { tsconfigRootDir: __dirname, project: ['./tsconfig.json'], @@ -11,6 +16,9 @@ module.exports = { '@typescript-eslint/consistent-type-imports': ['error', { disallowTypeAnnotations: false }], 'no-use-before-define': 'off', 'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }], + "depend/ban-dependencies": ["error", { + "modules": ["lodash", "chalk", "qs", "handlebars", "fs-extra"] + }] }, overrides: [ { diff --git a/scripts/package.json b/scripts/package.json index d38128434b76..fa651f004959 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -112,6 +112,7 @@ "eslint": "^8.57.0", "eslint-config-airbnb-typescript": "^18.0.0", "eslint-config-prettier": "^9.1.0", + "eslint-plugin-depend": "^0.11.0", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-file-progress": "^1.4.0", "eslint-plugin-html": "^8.1.1", diff --git a/scripts/yarn.lock b/scripts/yarn.lock index a17539cb16d5..72976374f403 100644 --- a/scripts/yarn.lock +++ b/scripts/yarn.lock @@ -1576,6 +1576,7 @@ __metadata: eslint: "npm:^8.57.0" eslint-config-airbnb-typescript: "npm:^18.0.0" eslint-config-prettier: "npm:^9.1.0" + eslint-plugin-depend: "npm:^0.11.0" eslint-plugin-eslint-comments: "npm:^3.2.0" eslint-plugin-file-progress: "npm:^1.4.0" eslint-plugin-html: "npm:^8.1.1" @@ -5517,6 +5518,17 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-depend@npm:^0.11.0": + version: 0.11.0 + resolution: "eslint-plugin-depend@npm:0.11.0" + dependencies: + fd-package-json: "npm:^1.2.0" + module-replacements: "npm:^2.1.0" + semver: "npm:^7.6.3" + checksum: 10c0/64baf4d4f5d406efa1f13bda723ff0eb5fe4cee0ae8c3679fcdfccb4d7ba3a9472416fa3c54d75f1bde3e0123e55a85774662484a5b0355812f21a8968ee784a + languageName: node + linkType: hard + "eslint-plugin-eslint-comments@npm:^3.2.0": version: 3.2.0 resolution: "eslint-plugin-eslint-comments@npm:3.2.0" @@ -6182,6 +6194,15 @@ __metadata: languageName: node linkType: hard +"fd-package-json@npm:^1.2.0": + version: 1.2.0 + resolution: "fd-package-json@npm:1.2.0" + dependencies: + walk-up-path: "npm:^3.0.1" + checksum: 10c0/712a78a12bd8ec8482867b26bbcb2ff1dca9b096a416150c138e1512f1879c6d23dfb41b03b8e9226afc1e58a35df4738e9f9ae57032ff1dbbae75acfb70343b + languageName: node + linkType: hard + "fd-slicer@npm:~1.1.0": version: 1.1.0 resolution: "fd-slicer@npm:1.1.0" @@ -9820,6 +9841,13 @@ __metadata: languageName: node linkType: hard +"module-replacements@npm:^2.1.0": + version: 2.5.0 + resolution: "module-replacements@npm:2.5.0" + checksum: 10c0/7fcbcb19151778a2f2fa70b7bffb134bb8922b2306e2a0d7b4a863467a9d6d9d5fed537763c43272e22b69dbddaf1610746b42a68b4663aa225e85f9ae9b03c8 + languageName: node + linkType: hard + "mount-point@npm:^3.0.0": version: 3.0.0 resolution: "mount-point@npm:3.0.0" @@ -12381,6 +12409,15 @@ __metadata: languageName: node linkType: hard +"semver@npm:^7.6.3": + version: 7.6.3 + resolution: "semver@npm:7.6.3" + bin: + semver: bin/semver.js + checksum: 10c0/88f33e148b210c153873cb08cfe1e281d518aaa9a666d4d148add6560db5cd3c582f3a08ccb91f38d5f379ead256da9931234ed122057f40bb5766e65e58adaf + languageName: node + linkType: hard + "send@npm:0.18.0": version: 0.18.0 resolution: "send@npm:0.18.0" From c2233ad230363d04c9f8ce5bde9026997f598854 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 2 Oct 2024 17:07:43 +0200 Subject: [PATCH 24/64] add ignores for disallowed packages --- code/builders/builder-vite/src/list-stories.ts | 1 + code/core/src/common/js-package-manager/JsPackageManager.ts | 4 ++-- code/core/src/common/utils/validate-configuration-files.ts | 1 + code/core/src/core-server/utils/StoryIndexGenerator.ts | 1 + .../core-server/utils/__tests__/remove-mdx-stories.test.ts | 1 + code/core/src/core-server/utils/remove-mdx-entries.ts | 1 + code/core/src/core-server/utils/search-files.ts | 1 + code/core/src/core-server/utils/watch-story-specifiers.ts | 1 + code/core/src/telemetry/get-portable-stories-usage.ts | 1 + code/lib/cli-storybook/src/automigrate/fixes/mdx-1-to-3.ts | 1 + code/lib/cli-storybook/src/automigrate/fixes/mdx-gfm.ts | 1 + code/lib/cli-storybook/src/automigrate/fixes/mdx-to-csf.ts | 1 + .../src/automigrate/fixes/missing-storybook-dependencies.ts | 1 + .../src/automigrate/fixes/prompt-remove-react.test.ts | 1 + code/lib/cli-storybook/src/warn.ts | 1 + code/lib/codemod/src/index.ts | 1 + code/lib/create-storybook/src/generators/baseGenerator.ts | 1 + code/lib/create-storybook/src/scaffold-new-project.ts | 1 + scripts/bench/utils.ts | 1 + scripts/build-package.ts | 2 ++ scripts/check-package.ts | 2 ++ scripts/combine-compodoc.ts | 3 +++ scripts/dangerfile.ts | 3 +++ scripts/get-report-message.ts | 2 ++ scripts/get-template.ts | 1 + scripts/knip.config.ts | 1 + scripts/prepare/addon-bundle.ts | 2 ++ scripts/prepare/bundle.ts | 2 ++ scripts/prepare/check.ts | 1 + scripts/prepare/tools.ts | 2 ++ scripts/prepare/tsc.ts | 2 ++ scripts/release/__tests__/is-pr-frozen.test.ts | 1 + scripts/release/__tests__/version.test.ts | 2 ++ scripts/release/__tests__/write-changelog.test.ts | 1 + scripts/release/get-changelog-from-file.ts | 1 + scripts/release/get-current-version.ts | 1 + scripts/release/is-pr-frozen.ts | 1 + scripts/release/label-patches.ts | 1 + scripts/release/pick-patches.ts | 1 + scripts/release/publish.ts | 2 ++ scripts/release/version.ts | 2 ++ scripts/release/write-changelog.ts | 1 + scripts/reset.js | 1 + scripts/run-registry.ts | 2 ++ scripts/sandbox/generate.ts | 3 +++ scripts/sandbox/publish.ts | 3 +++ scripts/sandbox/utils/git.ts | 1 + scripts/sandbox/utils/template.ts | 1 + scripts/sandbox/utils/yarn.ts | 1 + scripts/strict-ts.ts | 1 + scripts/task.ts | 1 + scripts/tasks/build.ts | 1 + scripts/tasks/compile.ts | 1 + scripts/tasks/generate.ts | 1 + scripts/tasks/install.ts | 1 + scripts/tasks/publish.ts | 1 + scripts/tasks/sandbox-parts.ts | 1 + scripts/tasks/sandbox.ts | 1 + scripts/upload-bench.ts | 1 + scripts/utils/exec.ts | 4 ++-- scripts/utils/filterExistsInCodeDir.ts | 1 + scripts/utils/package-json.ts | 1 + scripts/utils/paths.ts | 1 + scripts/utils/workspace.ts | 1 + scripts/utils/yarn.ts | 1 + scripts/vite-ecosystem-ci/before-test.js | 3 ++- 66 files changed, 88 insertions(+), 5 deletions(-) diff --git a/code/builders/builder-vite/src/list-stories.ts b/code/builders/builder-vite/src/list-stories.ts index 5eefb9b8fb74..d5b417f2553c 100644 --- a/code/builders/builder-vite/src/list-stories.ts +++ b/code/builders/builder-vite/src/list-stories.ts @@ -3,6 +3,7 @@ import { isAbsolute, join } from 'node:path'; import { commonGlobOptions, normalizeStories } from 'storybook/internal/common'; import type { Options } from 'storybook/internal/types'; +// eslint-disable-next-line depend/ban-dependencies import { glob } from 'glob'; import slash from 'slash'; diff --git a/code/core/src/common/js-package-manager/JsPackageManager.ts b/code/core/src/common/js-package-manager/JsPackageManager.ts index 5b0bdde0fdb6..21f870852d4d 100644 --- a/code/core/src/common/js-package-manager/JsPackageManager.ts +++ b/code/core/src/common/js-package-manager/JsPackageManager.ts @@ -2,8 +2,8 @@ import { existsSync, readFileSync } from 'node:fs'; import { readFile, writeFile } from 'node:fs/promises'; import { dirname, resolve } from 'node:path'; -import type { CommonOptions } from 'execa'; -import { execaCommand, execaCommandSync } from 'execa'; +// eslint-disable-next-line depend/ban-dependencies +import { type CommonOptions, execaCommand, execaCommandSync } from 'execa'; import picocolors from 'picocolors'; import { gt, satisfies } from 'semver'; import invariant from 'tiny-invariant'; diff --git a/code/core/src/common/utils/validate-configuration-files.ts b/code/core/src/common/utils/validate-configuration-files.ts index 3e35a6f2bafb..ccd0dba864ea 100644 --- a/code/core/src/common/utils/validate-configuration-files.ts +++ b/code/core/src/common/utils/validate-configuration-files.ts @@ -3,6 +3,7 @@ import { resolve } from 'node:path'; import { once } from '@storybook/core/node-logger'; import { MainFileMissingError } from '@storybook/core/server-errors'; +// eslint-disable-next-line depend/ban-dependencies import { glob } from 'glob'; import slash from 'slash'; import { dedent } from 'ts-dedent'; diff --git a/code/core/src/core-server/utils/StoryIndexGenerator.ts b/code/core/src/core-server/utils/StoryIndexGenerator.ts index aed65a46bf6b..164613d7e4c2 100644 --- a/code/core/src/core-server/utils/StoryIndexGenerator.ts +++ b/code/core/src/core-server/utils/StoryIndexGenerator.ts @@ -130,6 +130,7 @@ export class StoryIndexGenerator { const fullGlob = slash(join(specifier.directory, specifier.files)); // Dynamically import globby because it is a pure ESM module + // eslint-disable-next-line depend/ban-dependencies const { globby } = await import('globby'); const files = await globby(fullGlob, { diff --git a/code/core/src/core-server/utils/__tests__/remove-mdx-stories.test.ts b/code/core/src/core-server/utils/__tests__/remove-mdx-stories.test.ts index f1342ad48a9a..87fe8317ea35 100644 --- a/code/core/src/core-server/utils/__tests__/remove-mdx-stories.test.ts +++ b/code/core/src/core-server/utils/__tests__/remove-mdx-stories.test.ts @@ -5,6 +5,7 @@ import { describe, expect, it, vi } from 'vitest'; import { normalizeStoriesEntry } from '@storybook/core/common'; import { type StoriesEntry } from '@storybook/core/types'; +// eslint-disable-next-line depend/ban-dependencies import { glob as globOriginal } from 'glob'; import slash from 'slash'; diff --git a/code/core/src/core-server/utils/remove-mdx-entries.ts b/code/core/src/core-server/utils/remove-mdx-entries.ts index f71488712a49..da431155016a 100644 --- a/code/core/src/core-server/utils/remove-mdx-entries.ts +++ b/code/core/src/core-server/utils/remove-mdx-entries.ts @@ -3,6 +3,7 @@ import { isAbsolute, join, relative } from 'node:path'; import { commonGlobOptions, normalizeStories } from '@storybook/core/common'; import type { Options, StoriesEntry } from '@storybook/core/types'; +// eslint-disable-next-line depend/ban-dependencies import { glob } from 'glob'; import slash from 'slash'; diff --git a/code/core/src/core-server/utils/search-files.ts b/code/core/src/core-server/utils/search-files.ts index b0e743895aa9..723f74341b34 100644 --- a/code/core/src/core-server/utils/search-files.ts +++ b/code/core/src/core-server/utils/search-files.ts @@ -31,6 +31,7 @@ export async function searchFiles({ fileExtensions?: string[]; }): Promise { // Dynamically import globby because it is a pure ESM module + // eslint-disable-next-line depend/ban-dependencies const { globby, isDynamicPattern } = await import('globby'); const hasSearchSpecialGlobChars = isDynamicPattern(searchQuery, { cwd }); diff --git a/code/core/src/core-server/utils/watch-story-specifiers.ts b/code/core/src/core-server/utils/watch-story-specifiers.ts index b320520dc9a4..6fa8d3e83a6f 100644 --- a/code/core/src/core-server/utils/watch-story-specifiers.ts +++ b/code/core/src/core-server/utils/watch-story-specifiers.ts @@ -97,6 +97,7 @@ export function watchStorySpecifiers( ); // Dynamically import globby because it is a pure ESM module + // eslint-disable-next-line depend/ban-dependencies const { globby } = await import('globby'); // glob only supports forward slashes diff --git a/code/core/src/telemetry/get-portable-stories-usage.ts b/code/core/src/telemetry/get-portable-stories-usage.ts index e328a3283c57..cd9da7f4f589 100644 --- a/code/core/src/telemetry/get-portable-stories-usage.ts +++ b/code/core/src/telemetry/get-portable-stories-usage.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line depend/ban-dependencies import { execaCommand } from 'execa'; import { createFileSystemCache, resolvePathInStorybookCache } from '../common'; diff --git a/code/lib/cli-storybook/src/automigrate/fixes/mdx-1-to-3.ts b/code/lib/cli-storybook/src/automigrate/fixes/mdx-1-to-3.ts index e53ee7cde234..155ee08246f6 100644 --- a/code/lib/cli-storybook/src/automigrate/fixes/mdx-1-to-3.ts +++ b/code/lib/cli-storybook/src/automigrate/fixes/mdx-1-to-3.ts @@ -51,6 +51,7 @@ export const mdx1to3: Fix = { async check() { // Dynamically import globby because it is a pure ESM module + // eslint-disable-next-line depend/ban-dependencies const { globby } = await import('globby'); const storiesMdxFiles = await globby('./!(node_modules)**/*.(story|stories).mdx'); diff --git a/code/lib/cli-storybook/src/automigrate/fixes/mdx-gfm.ts b/code/lib/cli-storybook/src/automigrate/fixes/mdx-gfm.ts index 8369f8896ef3..41fc1b4a3a0b 100644 --- a/code/lib/cli-storybook/src/automigrate/fixes/mdx-gfm.ts +++ b/code/lib/cli-storybook/src/automigrate/fixes/mdx-gfm.ts @@ -47,6 +47,7 @@ export const mdxgfm: Fix = { } // Dynamically import globby because it is a pure ESM module + // eslint-disable-next-line depend/ban-dependencies const { globby } = await import('globby'); const files = await globby(pattern, commonGlobOptions(pattern)); diff --git a/code/lib/cli-storybook/src/automigrate/fixes/mdx-to-csf.ts b/code/lib/cli-storybook/src/automigrate/fixes/mdx-to-csf.ts index 55e36258c9cd..217b3dcacb93 100644 --- a/code/lib/cli-storybook/src/automigrate/fixes/mdx-to-csf.ts +++ b/code/lib/cli-storybook/src/automigrate/fixes/mdx-to-csf.ts @@ -2,6 +2,7 @@ import type { StoriesEntry } from 'storybook/internal/types'; import { runCodemod } from '@storybook/codemod'; +// eslint-disable-next-line depend/ban-dependencies import { glob } from 'glob'; import picocolors from 'picocolors'; import { prompt } from 'prompts'; diff --git a/code/lib/cli-storybook/src/automigrate/fixes/missing-storybook-dependencies.ts b/code/lib/cli-storybook/src/automigrate/fixes/missing-storybook-dependencies.ts index 9b5892b51a32..8eda42d9b9ba 100644 --- a/code/lib/cli-storybook/src/automigrate/fixes/missing-storybook-dependencies.ts +++ b/code/lib/cli-storybook/src/automigrate/fixes/missing-storybook-dependencies.ts @@ -70,6 +70,7 @@ export const missingStorybookDependencies: Fix { if (!hasTSDependency) { // Dynamically import globby because it is a pure ESM module + // eslint-disable-next-line depend/ban-dependencies const { globby } = await import('globby'); const files = await globby(['**/*.@(ts|tsx)', '!**/node_modules', '!**/*.d.ts']); diff --git a/code/lib/codemod/src/index.ts b/code/lib/codemod/src/index.ts index ec80bd250d3f..80bc90932918 100644 --- a/code/lib/codemod/src/index.ts +++ b/code/lib/codemod/src/index.ts @@ -65,6 +65,7 @@ export async function runCodemod( } // Dynamically import globby because it is a pure ESM module + // eslint-disable-next-line depend/ban-dependencies const { globby } = await import('globby'); const files = await globby([glob, '!**/node_modules', '!**/dist']); diff --git a/code/lib/create-storybook/src/generators/baseGenerator.ts b/code/lib/create-storybook/src/generators/baseGenerator.ts index b1aea02b11e1..1a44e3ba272b 100644 --- a/code/lib/create-storybook/src/generators/baseGenerator.ts +++ b/code/lib/create-storybook/src/generators/baseGenerator.ts @@ -11,6 +11,7 @@ import type { JsPackageManager } from 'storybook/internal/common'; import { getPackageDetails, versions as packageVersions } from 'storybook/internal/common'; import type { SupportedFrameworks } from 'storybook/internal/types'; +// eslint-disable-next-line depend/ban-dependencies import ora from 'ora'; import invariant from 'tiny-invariant'; import { dedent } from 'ts-dedent'; diff --git a/code/lib/create-storybook/src/scaffold-new-project.ts b/code/lib/create-storybook/src/scaffold-new-project.ts index f41d9c876010..c07ff8c9fba4 100644 --- a/code/lib/create-storybook/src/scaffold-new-project.ts +++ b/code/lib/create-storybook/src/scaffold-new-project.ts @@ -7,6 +7,7 @@ import { GenerateNewProjectOnInitError } from 'storybook/internal/server-errors' import { telemetry } from 'storybook/internal/telemetry'; import boxen from 'boxen'; +// eslint-disable-next-line depend/ban-dependencies import execa from 'execa'; import picocolors from 'picocolors'; import prompts from 'prompts'; diff --git a/scripts/bench/utils.ts b/scripts/bench/utils.ts index 1bd3a3f849ae..673fb56c4360 100644 --- a/scripts/bench/utils.ts +++ b/scripts/bench/utils.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line depend/ban-dependencies import { ensureDir, readJSON, readdir, writeJSON } from 'fs-extra'; import { join } from 'path'; import type { Page } from 'playwright-core'; diff --git a/scripts/build-package.ts b/scripts/build-package.ts index 96ddb84c2fbc..d1d1f147e69c 100644 --- a/scripts/build-package.ts +++ b/scripts/build-package.ts @@ -1,5 +1,7 @@ import { program } from 'commander'; +// eslint-disable-next-line depend/ban-dependencies import { execaCommand } from 'execa'; +// eslint-disable-next-line depend/ban-dependencies import { readJSON } from 'fs-extra'; import { posix, resolve, sep } from 'path'; import picocolors from 'picocolors'; diff --git a/scripts/check-package.ts b/scripts/check-package.ts index 8b9c49985fb5..035ae8a74ec6 100644 --- a/scripts/check-package.ts +++ b/scripts/check-package.ts @@ -2,7 +2,9 @@ // without having to build dts files for all packages in the monorepo. // It is not implemented yet for angular, svelte and vue. import { program } from 'commander'; +// eslint-disable-next-line depend/ban-dependencies import { execaCommand } from 'execa'; +// eslint-disable-next-line depend/ban-dependencies import { readJSON } from 'fs-extra'; import { resolve } from 'path'; import picocolors from 'picocolors'; diff --git a/scripts/combine-compodoc.ts b/scripts/combine-compodoc.ts index eefc905fc132..7b934854d015 100755 --- a/scripts/combine-compodoc.ts +++ b/scripts/combine-compodoc.ts @@ -1,8 +1,11 @@ // Compodoc does not follow symlinks (it ignores them and their contents entirely) // So, we need to run a separate compodoc process on every symlink inside the project, // then combine the results into one large documentation.json +// eslint-disable-next-line depend/ban-dependencies import { execaCommand } from 'execa'; +// eslint-disable-next-line depend/ban-dependencies import { lstat, readFile, realpath, writeFile } from 'fs-extra'; +// eslint-disable-next-line depend/ban-dependencies import { globSync } from 'glob'; import { join, resolve } from 'path'; diff --git a/scripts/dangerfile.ts b/scripts/dangerfile.ts index 93382ae441cf..961d77cbd2f8 100644 --- a/scripts/dangerfile.ts +++ b/scripts/dangerfile.ts @@ -4,8 +4,11 @@ import { danger, fail } from 'danger'; execSync('npm install lodash'); +// eslint-disable-next-line depend/ban-dependencies const flatten = require('lodash/flatten.js'); +// eslint-disable-next-line depend/ban-dependencies const intersection = require('lodash/intersection.js'); +// eslint-disable-next-line depend/ban-dependencies const isEmpty = require('lodash/isEmpty.js'); const pkg = require('../code/package.json'); diff --git a/scripts/get-report-message.ts b/scripts/get-report-message.ts index 4774bc0f8ca2..60f556b91014 100644 --- a/scripts/get-report-message.ts +++ b/scripts/get-report-message.ts @@ -1,4 +1,6 @@ +// eslint-disable-next-line depend/ban-dependencies import { execaCommand } from 'execa'; +// eslint-disable-next-line depend/ban-dependencies import { readJson } from 'fs-extra'; import { join } from 'path'; diff --git a/scripts/get-template.ts b/scripts/get-template.ts index 728632392489..cb351eab0410 100644 --- a/scripts/get-template.ts +++ b/scripts/get-template.ts @@ -1,4 +1,5 @@ import { program } from 'commander'; +// eslint-disable-next-line depend/ban-dependencies import { pathExists, readFile } from 'fs-extra'; import { readdir } from 'fs/promises'; import picocolors from 'picocolors'; diff --git a/scripts/knip.config.ts b/scripts/knip.config.ts index ef23f8c556bd..c57b570a8ac0 100644 --- a/scripts/knip.config.ts +++ b/scripts/knip.config.ts @@ -1,5 +1,6 @@ import { join, relative } from 'node:path'; +// eslint-disable-next-line depend/ban-dependencies import fg from 'fast-glob'; import type { KnipConfig } from 'knip'; import { match } from 'minimatch'; diff --git a/scripts/prepare/addon-bundle.ts b/scripts/prepare/addon-bundle.ts index fa5e14a0e4c4..16683ea38ff2 100755 --- a/scripts/prepare/addon-bundle.ts +++ b/scripts/prepare/addon-bundle.ts @@ -3,7 +3,9 @@ import { builtinModules } from 'node:module'; import type { Metafile } from 'esbuild'; import aliasPlugin from 'esbuild-plugin-alias'; +// eslint-disable-next-line depend/ban-dependencies import * as fs from 'fs-extra'; +// eslint-disable-next-line depend/ban-dependencies import { glob } from 'glob'; import { dirname, join, parse, posix, relative, sep } from 'path'; import slash from 'slash'; diff --git a/scripts/prepare/bundle.ts b/scripts/prepare/bundle.ts index 4651774257c8..d3a671034d17 100755 --- a/scripts/prepare/bundle.ts +++ b/scripts/prepare/bundle.ts @@ -3,7 +3,9 @@ import { dirname, join, parse, posix, relative, resolve, sep } from 'node:path'; import type { Metafile } from 'esbuild'; import aliasPlugin from 'esbuild-plugin-alias'; +// eslint-disable-next-line depend/ban-dependencies import * as fs from 'fs-extra'; +// eslint-disable-next-line depend/ban-dependencies import { glob } from 'glob'; import slash from 'slash'; import { dedent } from 'ts-dedent'; diff --git a/scripts/prepare/check.ts b/scripts/prepare/check.ts index dbf09429492b..0462b6094464 100755 --- a/scripts/prepare/check.ts +++ b/scripts/prepare/check.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line depend/ban-dependencies import fs from 'fs-extra'; import { join } from 'path'; import ts from 'typescript'; diff --git a/scripts/prepare/tools.ts b/scripts/prepare/tools.ts index eb4214a945ba..d2c58b420833 100644 --- a/scripts/prepare/tools.ts +++ b/scripts/prepare/tools.ts @@ -5,7 +5,9 @@ import * as process from 'node:process'; import { globalExternals } from '@fal-works/esbuild-plugin-global-externals'; import { spawn } from 'cross-spawn'; import * as esbuild from 'esbuild'; +// eslint-disable-next-line depend/ban-dependencies import { readJson } from 'fs-extra'; +// eslint-disable-next-line depend/ban-dependencies import { glob } from 'glob'; import limit from 'p-limit'; import picocolors from 'picocolors'; diff --git a/scripts/prepare/tsc.ts b/scripts/prepare/tsc.ts index 6a6aba2643bd..af6b39e15050 100755 --- a/scripts/prepare/tsc.ts +++ b/scripts/prepare/tsc.ts @@ -1,4 +1,6 @@ +// eslint-disable-next-line depend/ban-dependencies import { emptyDir, move, readJson } from 'fs-extra'; +// eslint-disable-next-line depend/ban-dependencies import { globSync } from 'glob'; import { join } from 'path'; import * as ts from 'typescript'; diff --git a/scripts/release/__tests__/is-pr-frozen.test.ts b/scripts/release/__tests__/is-pr-frozen.test.ts index 681069af7256..27baeaa4a723 100644 --- a/scripts/release/__tests__/is-pr-frozen.test.ts +++ b/scripts/release/__tests__/is-pr-frozen.test.ts @@ -3,6 +3,7 @@ import { join } from 'node:path'; import { describe, expect, it, vi } from 'vitest'; +// eslint-disable-next-line depend/ban-dependencies import * as fsExtraImp from 'fs-extra'; import * as simpleGitImp from 'simple-git'; diff --git a/scripts/release/__tests__/version.test.ts b/scripts/release/__tests__/version.test.ts index 3572e4cb76ee..58dd785c0284 100644 --- a/scripts/release/__tests__/version.test.ts +++ b/scripts/release/__tests__/version.test.ts @@ -3,7 +3,9 @@ import { join } from 'node:path'; import { describe, expect, it, vi } from 'vitest'; +// eslint-disable-next-line depend/ban-dependencies import { execaCommand } from 'execa'; +// eslint-disable-next-line depend/ban-dependencies import * as fsExtraImp from 'fs-extra'; import type * as MockedFSToExtra from '../../../code/__mocks__/fs-extra'; diff --git a/scripts/release/__tests__/write-changelog.test.ts b/scripts/release/__tests__/write-changelog.test.ts index f0346066b26c..59e1ccb6fd60 100644 --- a/scripts/release/__tests__/write-changelog.test.ts +++ b/scripts/release/__tests__/write-changelog.test.ts @@ -3,6 +3,7 @@ import { join } from 'node:path'; import { beforeEach, describe, expect, it, vi } from 'vitest'; +// eslint-disable-next-line depend/ban-dependencies import * as fsExtraImp from 'fs-extra'; import { dedent } from 'ts-dedent'; diff --git a/scripts/release/get-changelog-from-file.ts b/scripts/release/get-changelog-from-file.ts index 354605e04644..de8bc4e386e9 100644 --- a/scripts/release/get-changelog-from-file.ts +++ b/scripts/release/get-changelog-from-file.ts @@ -2,6 +2,7 @@ import { join } from 'node:path'; import { setOutput } from '@actions/core'; import { program } from 'commander'; +// eslint-disable-next-line depend/ban-dependencies import { readFile } from 'fs-extra'; import picocolors from 'picocolors'; import semver from 'semver'; diff --git a/scripts/release/get-current-version.ts b/scripts/release/get-current-version.ts index 8530f6cf9646..b0133cf03f7f 100644 --- a/scripts/release/get-current-version.ts +++ b/scripts/release/get-current-version.ts @@ -1,6 +1,7 @@ import { join } from 'node:path'; import { setOutput } from '@actions/core'; +// eslint-disable-next-line depend/ban-dependencies import { readJson } from 'fs-extra'; import picocolors from 'picocolors'; diff --git a/scripts/release/is-pr-frozen.ts b/scripts/release/is-pr-frozen.ts index d8c80708fc71..e198e89d8202 100644 --- a/scripts/release/is-pr-frozen.ts +++ b/scripts/release/is-pr-frozen.ts @@ -2,6 +2,7 @@ import { join } from 'node:path'; import { setOutput } from '@actions/core'; import { program } from 'commander'; +// eslint-disable-next-line depend/ban-dependencies import { readJson } from 'fs-extra'; import picocolors from 'picocolors'; diff --git a/scripts/release/label-patches.ts b/scripts/release/label-patches.ts index c1d8fa945e11..0ddbd60af981 100644 --- a/scripts/release/label-patches.ts +++ b/scripts/release/label-patches.ts @@ -1,4 +1,5 @@ import { program } from 'commander'; +// eslint-disable-next-line depend/ban-dependencies import ora from 'ora'; import { v4 as uuidv4 } from 'uuid'; diff --git a/scripts/release/pick-patches.ts b/scripts/release/pick-patches.ts index d25667cc4974..54dc6a21b2bb 100644 --- a/scripts/release/pick-patches.ts +++ b/scripts/release/pick-patches.ts @@ -1,5 +1,6 @@ import { setOutput } from '@actions/core'; import { program } from 'commander'; +// eslint-disable-next-line depend/ban-dependencies import ora from 'ora'; import picocolors from 'picocolors'; import invariant from 'tiny-invariant'; diff --git a/scripts/release/publish.ts b/scripts/release/publish.ts index 83839dd4a003..f2054d93398e 100644 --- a/scripts/release/publish.ts +++ b/scripts/release/publish.ts @@ -1,7 +1,9 @@ import { join } from 'node:path'; import { program } from 'commander'; +// eslint-disable-next-line depend/ban-dependencies import { execaCommand } from 'execa'; +// eslint-disable-next-line depend/ban-dependencies import { readJson } from 'fs-extra'; import pRetry from 'p-retry'; import picocolors from 'picocolors'; diff --git a/scripts/release/version.ts b/scripts/release/version.ts index bdaef52fa18e..7d18b99aeca5 100644 --- a/scripts/release/version.ts +++ b/scripts/release/version.ts @@ -2,7 +2,9 @@ import { join } from 'node:path'; import { setOutput } from '@actions/core'; import { program } from 'commander'; +// eslint-disable-next-line depend/ban-dependencies import { execaCommand } from 'execa'; +// eslint-disable-next-line depend/ban-dependencies import { readFile, readJson, writeFile, writeJson } from 'fs-extra'; import picocolors from 'picocolors'; import semver from 'semver'; diff --git a/scripts/release/write-changelog.ts b/scripts/release/write-changelog.ts index 59e0d3273958..9e8b1e342cb2 100644 --- a/scripts/release/write-changelog.ts +++ b/scripts/release/write-changelog.ts @@ -1,6 +1,7 @@ import { join } from 'node:path'; import { program } from 'commander'; +// eslint-disable-next-line depend/ban-dependencies import { readFile, writeFile, writeJson } from 'fs-extra'; import picocolors from 'picocolors'; import semver from 'semver'; diff --git a/scripts/reset.js b/scripts/reset.js index ed93cbce800b..d9049633d2bc 100644 --- a/scripts/reset.js +++ b/scripts/reset.js @@ -1,6 +1,7 @@ import { spawn } from 'node:child_process'; import { appendFile, writeFileSync } from 'node:fs'; +// eslint-disable-next-line depend/ban-dependencies import { remove } from 'fs-extra'; import trash from 'trash'; diff --git a/scripts/run-registry.ts b/scripts/run-registry.ts index 825788b24f51..5f179501583d 100755 --- a/scripts/run-registry.ts +++ b/scripts/run-registry.ts @@ -5,7 +5,9 @@ import type { Server } from 'node:http'; import { join, resolve as resolvePath } from 'node:path'; import { program } from 'commander'; +// eslint-disable-next-line depend/ban-dependencies import { execa, execaSync } from 'execa'; +// eslint-disable-next-line depend/ban-dependencies import { pathExists, readJSON, remove } from 'fs-extra'; import pLimit from 'p-limit'; import picocolors from 'picocolors'; diff --git a/scripts/sandbox/generate.ts b/scripts/sandbox/generate.ts index d92696383699..495d142c0196 100755 --- a/scripts/sandbox/generate.ts +++ b/scripts/sandbox/generate.ts @@ -1,7 +1,10 @@ import * as ghActions from '@actions/core'; import { program } from 'commander'; +// eslint-disable-next-line depend/ban-dependencies import type { Options as ExecaOptions } from 'execa'; +// eslint-disable-next-line depend/ban-dependencies import { execaCommand } from 'execa'; +// eslint-disable-next-line depend/ban-dependencies import { copy, emptyDir, ensureDir, move, remove, rename, writeFile } from 'fs-extra'; import pLimit from 'p-limit'; import { join, relative } from 'path'; diff --git a/scripts/sandbox/publish.ts b/scripts/sandbox/publish.ts index 7ddb549c3900..f83048dff5cd 100755 --- a/scripts/sandbox/publish.ts +++ b/scripts/sandbox/publish.ts @@ -1,7 +1,10 @@ import { program } from 'commander'; +// eslint-disable-next-line depend/ban-dependencies import { execaCommand } from 'execa'; import { existsSync } from 'fs'; +// eslint-disable-next-line depend/ban-dependencies import { copy, emptyDir, remove, writeFile } from 'fs-extra'; +// eslint-disable-next-line depend/ban-dependencies import { glob } from 'glob'; import { dirname, join, relative } from 'path'; diff --git a/scripts/sandbox/utils/git.ts b/scripts/sandbox/utils/git.ts index 17022db63fca..2ea8b89f29b4 100644 --- a/scripts/sandbox/utils/git.ts +++ b/scripts/sandbox/utils/git.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line depend/ban-dependencies import { execaCommand } from 'execa'; import invariant from 'tiny-invariant'; diff --git a/scripts/sandbox/utils/template.ts b/scripts/sandbox/utils/template.ts index 11b6c1e86d5a..825cd6e58641 100644 --- a/scripts/sandbox/utils/template.ts +++ b/scripts/sandbox/utils/template.ts @@ -1,4 +1,5 @@ import { render } from 'ejs'; +// eslint-disable-next-line depend/ban-dependencies import { readFile } from 'fs-extra'; import prettier from 'prettier'; diff --git a/scripts/sandbox/utils/yarn.ts b/scripts/sandbox/utils/yarn.ts index a2d579b2cde0..8f4163256a08 100644 --- a/scripts/sandbox/utils/yarn.ts +++ b/scripts/sandbox/utils/yarn.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line depend/ban-dependencies import { move, remove } from 'fs-extra'; import { join } from 'path'; diff --git a/scripts/strict-ts.ts b/scripts/strict-ts.ts index 990cbe866ccf..bf0710f5a583 100644 --- a/scripts/strict-ts.ts +++ b/scripts/strict-ts.ts @@ -1,6 +1,7 @@ import { existsSync, readFileSync } from 'node:fs'; import { dirname, join } from 'node:path'; +// eslint-disable-next-line depend/ban-dependencies import glob from 'fast-glob'; import JSON5 from 'json5'; diff --git a/scripts/task.ts b/scripts/task.ts index 905b53b82cae..9a28f8e79546 100644 --- a/scripts/task.ts +++ b/scripts/task.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line depend/ban-dependencies import { outputFile, pathExists, readFile } from 'fs-extra'; import type { TestCase } from 'junit-xml'; import { getJunitXml } from 'junit-xml'; diff --git a/scripts/tasks/build.ts b/scripts/tasks/build.ts index 4a74dcba1f55..796532e2bc0c 100644 --- a/scripts/tasks/build.ts +++ b/scripts/tasks/build.ts @@ -1,4 +1,5 @@ import dirSize from 'fast-folder-size'; +// eslint-disable-next-line depend/ban-dependencies import { pathExists } from 'fs-extra'; import { join } from 'path'; import { promisify } from 'util'; diff --git a/scripts/tasks/compile.ts b/scripts/tasks/compile.ts index 2fe631c5f615..bb0bf918812a 100644 --- a/scripts/tasks/compile.ts +++ b/scripts/tasks/compile.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line depend/ban-dependencies import { readFile } from 'fs-extra'; import { resolve } from 'path'; diff --git a/scripts/tasks/generate.ts b/scripts/tasks/generate.ts index 3e1b0ddc5bc3..5736803a551d 100644 --- a/scripts/tasks/generate.ts +++ b/scripts/tasks/generate.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line depend/ban-dependencies import { pathExists, remove } from 'fs-extra'; import { join } from 'path'; diff --git a/scripts/tasks/install.ts b/scripts/tasks/install.ts index 90342845687e..0299c18d2fe4 100644 --- a/scripts/tasks/install.ts +++ b/scripts/tasks/install.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line depend/ban-dependencies import { pathExists, remove } from 'fs-extra'; import { join } from 'path'; diff --git a/scripts/tasks/publish.ts b/scripts/tasks/publish.ts index d83ffb9272b2..987286207dd1 100644 --- a/scripts/tasks/publish.ts +++ b/scripts/tasks/publish.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line depend/ban-dependencies import { pathExists } from 'fs-extra'; import { resolve } from 'path'; diff --git a/scripts/tasks/sandbox-parts.ts b/scripts/tasks/sandbox-parts.ts index a2df1e8e1691..78f8dad696cc 100644 --- a/scripts/tasks/sandbox-parts.ts +++ b/scripts/tasks/sandbox-parts.ts @@ -1,6 +1,7 @@ // This file requires many imports from `../code`, which requires both an install and bootstrap of // the repo to work properly. So we load it async in the task runner *after* those steps. import { isFunction } from 'es-toolkit'; +// eslint-disable-next-line depend/ban-dependencies import { copy, ensureDir, diff --git a/scripts/tasks/sandbox.ts b/scripts/tasks/sandbox.ts index 93d5cf823c93..5b3494d9955f 100644 --- a/scripts/tasks/sandbox.ts +++ b/scripts/tasks/sandbox.ts @@ -1,4 +1,5 @@ import dirSize from 'fast-folder-size'; +// eslint-disable-next-line depend/ban-dependencies import { pathExists, remove } from 'fs-extra'; import { join } from 'path'; import { promisify } from 'util'; diff --git a/scripts/upload-bench.ts b/scripts/upload-bench.ts index 9766079b9dc8..48e5fa618896 100644 --- a/scripts/upload-bench.ts +++ b/scripts/upload-bench.ts @@ -1,4 +1,5 @@ import { BigQuery } from '@google-cloud/bigquery'; +// eslint-disable-next-line depend/ban-dependencies import { execaCommand } from 'execa'; import { join } from 'path'; diff --git a/scripts/utils/exec.ts b/scripts/utils/exec.ts index c12c9eea2f9f..a4a77ebd2244 100644 --- a/scripts/utils/exec.ts +++ b/scripts/utils/exec.ts @@ -1,5 +1,5 @@ -import type { ExecaChildProcess, Options } from 'execa'; -import { execa } from 'execa'; +// eslint-disable-next-line depend/ban-dependencies +import { type ExecaChildProcess, type Options, execa } from 'execa'; import picocolors from 'picocolors'; const logger = console; diff --git a/scripts/utils/filterExistsInCodeDir.ts b/scripts/utils/filterExistsInCodeDir.ts index 7a22fdf8d2f2..673148f916eb 100644 --- a/scripts/utils/filterExistsInCodeDir.ts +++ b/scripts/utils/filterExistsInCodeDir.ts @@ -1,5 +1,6 @@ import { join, resolve } from 'node:path'; +// eslint-disable-next-line depend/ban-dependencies import { pathExists } from 'fs-extra'; import { CODE_DIRECTORY } from './constants'; diff --git a/scripts/utils/package-json.ts b/scripts/utils/package-json.ts index cc88350ddfaa..16bdb67f7078 100644 --- a/scripts/utils/package-json.ts +++ b/scripts/utils/package-json.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line depend/ban-dependencies import { readJSON, writeJSON } from 'fs-extra'; import { join } from 'path'; diff --git a/scripts/utils/paths.ts b/scripts/utils/paths.ts index 36db99f4e093..7253fdff740c 100644 --- a/scripts/utils/paths.ts +++ b/scripts/utils/paths.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line depend/ban-dependencies import { pathExists } from 'fs-extra'; import { join } from 'path'; diff --git a/scripts/utils/workspace.ts b/scripts/utils/workspace.ts index 98a0164ec5ac..fcba0311b09d 100644 --- a/scripts/utils/workspace.ts +++ b/scripts/utils/workspace.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line depend/ban-dependencies import { execaCommand } from 'execa'; import memoize from 'memoizerific'; diff --git a/scripts/utils/yarn.ts b/scripts/utils/yarn.ts index 0b8147dfa983..1f78e58162c5 100644 --- a/scripts/utils/yarn.ts +++ b/scripts/utils/yarn.ts @@ -1,5 +1,6 @@ import { join } from 'node:path'; +// eslint-disable-next-line depend/ban-dependencies import { pathExists, readJSON, writeJSON } from 'fs-extra'; // TODO -- should we generate this file a second time outside of CLI? diff --git a/scripts/vite-ecosystem-ci/before-test.js b/scripts/vite-ecosystem-ci/before-test.js index 93da3f28519b..35ba21734d06 100644 --- a/scripts/vite-ecosystem-ci/before-test.js +++ b/scripts/vite-ecosystem-ci/before-test.js @@ -8,7 +8,8 @@ import { readFile, writeFile } from 'node:fs/promises'; import { dirname, resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; -import { execa, execaCommand } from 'execa'; +// eslint-disable-next-line depend/ban-dependencies +import { execaCommand } from 'execa'; const filename = fileURLToPath(import.meta.url); // eslint-disable-next-line no-underscore-dangle, @typescript-eslint/naming-convention From d85dc51b86688c207527d830fb5f5627c5df9b01 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 3 Oct 2024 11:15:59 +0200 Subject: [PATCH 25/64] revert to existing static serving logic --- .../src/core-server/utils/server-statics.ts | 116 +++++++----------- 1 file changed, 46 insertions(+), 70 deletions(-) diff --git a/code/core/src/core-server/utils/server-statics.ts b/code/core/src/core-server/utils/server-statics.ts index 04f985901ce3..b49130ad1755 100644 --- a/code/core/src/core-server/utils/server-statics.ts +++ b/code/core/src/core-server/utils/server-statics.ts @@ -1,5 +1,5 @@ import { existsSync } from 'node:fs'; -import { basename, isAbsolute, normalize, posix, relative, resolve, sep, win32 } from 'node:path'; +import { basename, isAbsolute, posix, resolve, sep, win32 } from 'node:path'; import { getDirectoryFromWorkingDir } from '@storybook/core/common'; import type { Options } from '@storybook/core/types'; @@ -15,76 +15,52 @@ export async function useStatics(app: Polka.Polka, options: Options): Promise('favicon'); - const statics: Array<{ targetEndpoint: string; staticPath: string }> = []; - const userStatics = [ - `${faviconPath}:/${basename(faviconPath)}`, - ...staticDirs.map((dir) => (typeof dir === 'string' ? dir : `${dir.from}:${dir.to}`)), - ]; - - for (const dir of userStatics) { - try { - const normalizedDir = - staticDirs && !isAbsolute(dir) - ? getDirectoryFromWorkingDir({ - configDir: options.configDir, - workingDir: process.cwd(), - directory: dir, + await Promise.all( + staticDirs + .map((dir) => (typeof dir === 'string' ? dir : `${dir.from}:${dir.to}`)) + .map(async (dir) => { + try { + const normalizedDir = + staticDirs && !isAbsolute(dir) + ? getDirectoryFromWorkingDir({ + configDir: options.configDir, + workingDir: process.cwd(), + directory: dir, + }) + : dir; + const { staticDir, staticPath, targetEndpoint } = await parseStaticDir(normalizedDir); + + // Don't log for the internal static dir + if (!targetEndpoint.startsWith('/sb-')) { + logger.info( + `=> Serving static files from ${chalk.cyan(staticDir)} at ${chalk.cyan(targetEndpoint)}` + ); + } + + app.use( + targetEndpoint, + sirv(staticPath, { + dev: true, + etag: true, + extensions: [], }) - : dir; - const { staticDir, staticPath, targetEndpoint } = await parseStaticDir(normalizedDir); - - // Don't log for the internal static dir - if (!targetEndpoint.startsWith('/sb-') && staticPath !== faviconPath) { - logger.info( - `=> Serving static files from ${chalk.cyan(staticDir)} at ${chalk.cyan(targetEndpoint)}` - ); - } - - statics.push({ targetEndpoint, staticPath }); - } catch (e) { - if (e instanceof Error) { - logger.warn(e.message); - } - } - } - - const serve = sirv(process.cwd(), { - dev: true, - etag: true, - }); - - app.use((req, res, next) => { - if (!req.url) { - return next(); - } - - // the base isn't used for anything, but it's required by the URL constructor - const url = new URL(req.url, 'http://localhost:6006'); - const pathname = normalize(url.pathname); - - // TODO (43081j): this is 'security' so you can't break out of cwd - // Probably need to do something better here - if (pathname.startsWith('..') || pathname.endsWith('/')) { - return next(); - } - - for (const { targetEndpoint, staticPath } of statics) { - if (!pathname.startsWith(targetEndpoint)) { - continue; - } - // TODO (43081j): similar as above, this might be doable in a cleaner way - const newPath = relative( - process.cwd(), - resolve(staticPath, './' + pathname.slice(targetEndpoint.length)) - ); - url.pathname = newPath; - req.url = url.href.slice(url.origin.length); - serve(req, res, next); - return; - } - - next(); - }); + ); + } catch (e) { + if (e instanceof Error) { + logger.warn(e.message); + } + } + }) + ); + + app.get( + `/${basename(faviconPath)}`, + sirv(faviconPath, { + dev: true, + etag: true, + extensions: [], + }) + ); } export const parseStaticDir = async (arg: string) => { From 8f7f8812f5913eaa39fe5fc09da484aa5897baae Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 3 Oct 2024 13:25:10 +0200 Subject: [PATCH 26/64] cleanup express dependencies --- code/builders/builder-vite/package.json | 1 - code/yarn.lock | 3 +- scripts/package.json | 2 - scripts/utils/serve.ts | 14 ------- scripts/yarn.lock | 54 +------------------------ 5 files changed, 3 insertions(+), 71 deletions(-) delete mode 100644 scripts/utils/serve.ts diff --git a/code/builders/builder-vite/package.json b/code/builders/builder-vite/package.json index da62b3d90d69..a9c982f98d45 100644 --- a/code/builders/builder-vite/package.json +++ b/code/builders/builder-vite/package.json @@ -52,7 +52,6 @@ "ts-dedent": "^2.0.0" }, "devDependencies": { - "@types/express": "^4.17.21", "@types/node": "^22.0.0", "glob": "^10.0.0", "polka": "^1.0.0-next.28", diff --git a/code/yarn.lock b/code/yarn.lock index e3ca8b48ce61..d5ec15207ec3 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -6089,7 +6089,6 @@ __metadata: resolution: "@storybook/builder-vite@workspace:builders/builder-vite" dependencies: "@storybook/csf-plugin": "workspace:*" - "@types/express": "npm:^4.17.21" "@types/find-cache-dir": "npm:^3.2.1" "@types/node": "npm:^22.0.0" browser-assert: "npm:^1.2.1" @@ -8104,7 +8103,7 @@ __metadata: languageName: node linkType: hard -"@types/express@npm:*, @types/express@npm:^4.17.13, @types/express@npm:^4.17.21": +"@types/express@npm:*, @types/express@npm:^4.17.13": version: 4.17.21 resolution: "@types/express@npm:4.17.21" dependencies: diff --git a/scripts/package.json b/scripts/package.json index 456ba6c06038..51c33d4b0004 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -75,7 +75,6 @@ "@types/detect-port": "^1.3.5", "@types/ejs": "^3.1.5", "@types/escodegen": "^0.0.6", - "@types/express": "^4.17.21", "@types/fs-extra": "^11.0.4", "@types/http-server": "^0.12.4", "@types/jest": "^29.5.12", @@ -124,7 +123,6 @@ "eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-storybook": "^0.8.0", "execa": "^6.1.0", - "express": "^4.19.2", "fast-folder-size": "^2.2.0", "fast-glob": "^3.3.2", "find-up": "^5.0.0", diff --git a/scripts/utils/serve.ts b/scripts/utils/serve.ts deleted file mode 100644 index 98ba1da21c63..000000000000 --- a/scripts/utils/serve.ts +++ /dev/null @@ -1,14 +0,0 @@ -import express from 'express'; -import type { Server } from 'http'; -import serveStatic from 'serve-static'; - -export const serve = async (location: string, port: string): Promise => { - return new Promise((resolve) => { - const app = express(); - - app.use(serveStatic(location)); - const server = app.listen(port, () => { - resolve(server); - }); - }); -}; diff --git a/scripts/yarn.lock b/scripts/yarn.lock index 68267cf11fe1..18fd280b33a4 100644 --- a/scripts/yarn.lock +++ b/scripts/yarn.lock @@ -1538,7 +1538,6 @@ __metadata: "@types/detect-port": "npm:^1.3.5" "@types/ejs": "npm:^3.1.5" "@types/escodegen": "npm:^0.0.6" - "@types/express": "npm:^4.17.21" "@types/fs-extra": "npm:^11.0.4" "@types/http-server": "npm:^0.12.4" "@types/jest": "npm:^29.5.12" @@ -1588,7 +1587,6 @@ __metadata: eslint-plugin-react-hooks: "npm:^4.6.2" eslint-plugin-storybook: "npm:^0.8.0" execa: "npm:^6.1.0" - express: "npm:^4.19.2" fast-folder-size: "npm:^2.2.0" fast-glob: "npm:^3.3.2" find-up: "npm:^5.0.0" @@ -1769,16 +1767,6 @@ __metadata: languageName: node linkType: hard -"@types/body-parser@npm:*": - version: 1.19.4 - resolution: "@types/body-parser@npm:1.19.4" - dependencies: - "@types/connect": "npm:*" - "@types/node": "npm:*" - checksum: 10c0/bec2b8a97861a960ee415f7ab3c2aeb7f4d779fd364d27ddee46057897ea571735f1f854f5ee41682964315d4e3699f62427998b9c21851d773398ef535f0612 - languageName: node - linkType: hard - "@types/concat-stream@npm:^2.0.0": version: 2.0.1 resolution: "@types/concat-stream@npm:2.0.1" @@ -1852,30 +1840,6 @@ __metadata: languageName: node linkType: hard -"@types/express-serve-static-core@npm:^4.17.33": - version: 4.17.39 - resolution: "@types/express-serve-static-core@npm:4.17.39" - dependencies: - "@types/node": "npm:*" - "@types/qs": "npm:*" - "@types/range-parser": "npm:*" - "@types/send": "npm:*" - checksum: 10c0/b23b005fddd2ba3f7142ec9713f06b5582c7712cdf99c3419d3972364903b348a103c3264d9a761d6497140e3b89bd416454684c4bdeff206b4c59b86e96428a - languageName: node - linkType: hard - -"@types/express@npm:^4.17.21": - version: 4.17.21 - resolution: "@types/express@npm:4.17.21" - dependencies: - "@types/body-parser": "npm:*" - "@types/express-serve-static-core": "npm:^4.17.33" - "@types/qs": "npm:*" - "@types/serve-static": "npm:*" - checksum: 10c0/12e562c4571da50c7d239e117e688dc434db1bac8be55613294762f84fd77fbd0658ccd553c7d3ab02408f385bc93980992369dd30e2ecd2c68c358e6af8fabf - languageName: node - linkType: hard - "@types/fs-extra@npm:^11.0.4": version: 11.0.4 resolution: "@types/fs-extra@npm:11.0.4" @@ -2097,20 +2061,6 @@ __metadata: languageName: node linkType: hard -"@types/qs@npm:*": - version: 6.9.9 - resolution: "@types/qs@npm:6.9.9" - checksum: 10c0/aede2a4181a49ae8548a1354bac3f8235cb0c5aab066b10875a3e68e88a199e220f4284e7e2bb75a3c18e5d4ff6abe1a6ce0389ef31b63952cc45e0f4d885ba0 - languageName: node - linkType: hard - -"@types/range-parser@npm:*": - version: 1.2.6 - resolution: "@types/range-parser@npm:1.2.6" - checksum: 10c0/46e7fffc54cdacc8fb0cd576f8f9a6436453f0176205d6ec55434a460c7677e78e688673426d5db5e480501b2943ba08a16ececa3a354c222093551c7217fb8f - languageName: node - linkType: hard - "@types/react-dom@npm:^18.3.0": version: 18.3.0 resolution: "@types/react-dom@npm:18.3.0" @@ -2154,7 +2104,7 @@ __metadata: languageName: node linkType: hard -"@types/serve-static@npm:*, @types/serve-static@npm:^1.15.7": +"@types/serve-static@npm:^1.15.7": version: 1.15.7 resolution: "@types/serve-static@npm:1.15.7" dependencies: @@ -6015,7 +5965,7 @@ __metadata: languageName: node linkType: hard -"express@npm:4.19.2, express@npm:^4.19.2": +"express@npm:4.19.2": version: 4.19.2 resolution: "express@npm:4.19.2" dependencies: From 2b4803efdab25e8ed0f1aaf677cd6bd0b31283ce Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 3 Oct 2024 13:52:04 +0200 Subject: [PATCH 27/64] Don't expose Polka typings --- code/core/src/types/modules/core-common.ts | 32 +++++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/code/core/src/types/modules/core-common.ts b/code/core/src/types/modules/core-common.ts index ddecfea2d89d..290f632f7995 100644 --- a/code/core/src/types/modules/core-common.ts +++ b/code/core/src/types/modules/core-common.ts @@ -1,8 +1,7 @@ /* eslint-disable @typescript-eslint/naming-convention */ import type { FileSystemCache } from 'file-system-cache'; // should be node:http, but that caused the ui/manager to fail to build, might be able to switch this back once ui/manager is in the core -import type { Server as HttpServer } from 'http'; -import type Polka from 'polka'; +import type { Server as HttpServer, IncomingMessage } from 'http'; import type { Options as TelejsonOptions } from 'telejson'; import type { PackageJson as PackageJsonFromTypeFest } from 'type-fest'; @@ -211,13 +210,38 @@ export type Options = LoadOptions & CLIOptions & BuilderOptions & { build?: TestBuildConfig }; +// A minimal version of Polka's interface to avoid exposing internal implementation details +type Pattern = RegExp | string; +type Middleware = ( + req: T & IncomingMessage, + res: Response, + next: (err?: string | Error) => Promise | void +) => Promise; + +interface ServerApp { + server: HttpServer; + + use(pattern: Pattern, ...handlers: Middleware[]): this; + use(...handlers: Middleware[]): this; + + get(...handlers: Middleware[]): this; + post(...handlers: Middleware[]): this; + put(...handlers: Middleware[]): this; + patch(...handlers: Middleware[]): this; + delete(...handlers: Middleware[]): this; + head(...handlers: Middleware[]): this; + options(...handlers: Middleware[]): this; + connect(...handlers: Middleware[]): this; + trace(...handlers: Middleware[]): this; +} + export interface Builder { getConfig: (options: Options) => Promise; start: (args: { options: Options; startTime: ReturnType; - app: Polka.Polka; - router: Polka.Polka; // back-compatability with express-based API + app: ServerApp; + router: ServerApp; // back-compatability with express-based API server: HttpServer; channel: ServerChannel; }) => Promise Date: Thu, 3 Oct 2024 14:29:48 +0200 Subject: [PATCH 28/64] fix middleware types --- code/builders/builder-vite/src/index.ts | 5 ++--- .../src/core-server/utils/get-caching-middleware.ts | 4 ++-- .../core-server/utils/getAccessControlMiddleware.ts | 4 ++-- code/core/src/types/modules/core-common.ts | 11 +++++------ 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/code/builders/builder-vite/src/index.ts b/code/builders/builder-vite/src/index.ts index 9307c07dfed6..fab1d8c81bf9 100644 --- a/code/builders/builder-vite/src/index.ts +++ b/code/builders/builder-vite/src/index.ts @@ -3,9 +3,8 @@ import { cp, readFile } from 'node:fs/promises'; import { join, parse } from 'node:path'; import { NoStatsForViteDevError } from 'storybook/internal/server-errors'; -import type { Options } from 'storybook/internal/types'; +import type { Middleware, Options } from 'storybook/internal/types'; -import type Polka from 'polka'; import sirv from 'sirv'; import { corePath } from 'storybook/core-path'; import type { ViteDevServer } from 'vite'; @@ -20,7 +19,7 @@ export { hasVitePlugins } from './utils/has-vite-plugins'; export * from './types'; -function iframeMiddleware(options: Options, server: ViteDevServer): Polka.Middleware { +function iframeMiddleware(options: Options, server: ViteDevServer): Middleware { return async (req, res, next) => { if (!req.url || !req.url.match(/^\/iframe\.html($|\?)/)) { next(); diff --git a/code/core/src/core-server/utils/get-caching-middleware.ts b/code/core/src/core-server/utils/get-caching-middleware.ts index dd4d5c747156..88cc96c2ae70 100644 --- a/code/core/src/core-server/utils/get-caching-middleware.ts +++ b/code/core/src/core-server/utils/get-caching-middleware.ts @@ -1,6 +1,6 @@ -import type Polka from 'polka'; +import type { Middleware } from '../../types'; -export function getCachingMiddleware(): Polka.Middleware { +export function getCachingMiddleware(): Middleware { return (req, res, next) => { res.setHeader('Cache-Control', 'no-store'); next(); diff --git a/code/core/src/core-server/utils/getAccessControlMiddleware.ts b/code/core/src/core-server/utils/getAccessControlMiddleware.ts index b44046d290bf..0b5c3428b842 100644 --- a/code/core/src/core-server/utils/getAccessControlMiddleware.ts +++ b/code/core/src/core-server/utils/getAccessControlMiddleware.ts @@ -1,6 +1,6 @@ -import type Polka from 'polka'; +import type { Middleware } from '../../types'; -export function getAccessControlMiddleware(crossOriginIsolated: boolean): Polka.Middleware { +export function getAccessControlMiddleware(crossOriginIsolated: boolean): Middleware { return (req, res, next) => { res.setHeader('Access-Control-Allow-Origin', '*'); res.setHeader('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept'); diff --git a/code/core/src/types/modules/core-common.ts b/code/core/src/types/modules/core-common.ts index 290f632f7995..968b588054f9 100644 --- a/code/core/src/types/modules/core-common.ts +++ b/code/core/src/types/modules/core-common.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/naming-convention */ import type { FileSystemCache } from 'file-system-cache'; // should be node:http, but that caused the ui/manager to fail to build, might be able to switch this back once ui/manager is in the core -import type { Server as HttpServer, IncomingMessage } from 'http'; +import type { Server as HttpServer, IncomingMessage, ServerResponse } from 'http'; import type { Options as TelejsonOptions } from 'telejson'; import type { PackageJson as PackageJsonFromTypeFest } from 'type-fest'; @@ -211,17 +211,16 @@ export type Options = LoadOptions & BuilderOptions & { build?: TestBuildConfig }; // A minimal version of Polka's interface to avoid exposing internal implementation details -type Pattern = RegExp | string; -type Middleware = ( +export type Middleware = ( req: T & IncomingMessage, - res: Response, + res: ServerResponse, next: (err?: string | Error) => Promise | void -) => Promise; +) => Promise | void; interface ServerApp { server: HttpServer; - use(pattern: Pattern, ...handlers: Middleware[]): this; + use(pattern: RegExp | string, ...handlers: Middleware[]): this; use(...handlers: Middleware[]): this; get(...handlers: Middleware[]): this; From b563eee59979388a354e79c18d42d3eff6593fb1 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Fri, 4 Oct 2024 11:46:21 +0200 Subject: [PATCH 29/64] only expose router to builders --- code/builders/builder-vite/src/index.ts | 8 ++++---- code/builders/builder-webpack5/src/index.ts | 8 ++++---- code/core/src/builder-manager/index.ts | 14 +++++++++----- code/core/src/core-server/dev-server.ts | 3 +-- code/core/src/types/modules/core-common.ts | 3 +-- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/code/builders/builder-vite/src/index.ts b/code/builders/builder-vite/src/index.ts index fab1d8c81bf9..9ab66f2771d0 100644 --- a/code/builders/builder-vite/src/index.ts +++ b/code/builders/builder-vite/src/index.ts @@ -56,13 +56,13 @@ export async function bail(): Promise { export const start: ViteBuilder['start'] = async ({ startTime, options, - app, + router, server: devServer, }) => { server = await createViteServer(options as Options, devServer); const previewResolvedDir = join(corePath, 'dist/preview'); - app.use( + router.use( '/sb-preview', sirv(previewResolvedDir, { maxAge: 300000, @@ -70,8 +70,8 @@ export const start: ViteBuilder['start'] = async ({ immutable: true, }) ); - app.use(iframeMiddleware(options as Options, server)); - app.use(server.middlewares); + router.use(iframeMiddleware(options as Options, server)); + router.use(server.middlewares); return { bail, diff --git a/code/builders/builder-webpack5/src/index.ts b/code/builders/builder-webpack5/src/index.ts index 9e2245fec19c..f5d973547a66 100644 --- a/code/builders/builder-webpack5/src/index.ts +++ b/code/builders/builder-webpack5/src/index.ts @@ -114,7 +114,7 @@ export const bail: WebpackBuilder['bail'] = async () => { const starter: StarterFunction = async function* starterGeneratorFn({ startTime, options, - app, + router, channel, }) { const webpackInstance = await executor.get(options); @@ -180,7 +180,7 @@ const starter: StarterFunction = async function* starterGeneratorFn({ compilation = webpackDevMiddleware(compiler, middlewareOptions); const previewResolvedDir = join(corePath, 'dist/preview'); - app.use( + router.use( '/sb-preview', sirv(previewResolvedDir, { maxAge: 300000, @@ -188,8 +188,8 @@ const starter: StarterFunction = async function* starterGeneratorFn({ immutable: true, }) ); - app.use(compilation); - app.use(webpackHotMiddleware(compiler, { log: false })); + router.use(compilation); + router.use(webpackHotMiddleware(compiler, { log: false })); const stats = await new Promise((res, rej) => { compilation?.waitUntilValid(res as any); diff --git a/code/core/src/builder-manager/index.ts b/code/core/src/builder-manager/index.ts index 93241012b068..faad0a288acf 100644 --- a/code/core/src/builder-manager/index.ts +++ b/code/core/src/builder-manager/index.ts @@ -122,7 +122,11 @@ export const executor = { * * I am sorry for making you read about generators today :') */ -const starter: StarterFunction = async function* starterGeneratorFn({ startTime, options, app }) { +const starter: StarterFunction = async function* starterGeneratorFn({ + startTime, + options, + router, +}) { if (!options.quiet) { logger.info('=> Starting manager..'); } @@ -162,7 +166,7 @@ const starter: StarterFunction = async function* starterGeneratorFn({ startTime, 'manager' ); - app.use( + router.use( '/sb-addons', sirv(addonsDir, { maxAge: 300000, @@ -170,7 +174,7 @@ const starter: StarterFunction = async function* starterGeneratorFn({ startTime, immutable: true, }) ); - app.use( + router.use( '/sb-manager', sirv(coreDirOrigin, { maxAge: 300000, @@ -204,7 +208,7 @@ const starter: StarterFunction = async function* starterGeneratorFn({ startTime, yield; - app.use('/', ({ url }, res, next) => { + router.use('/', ({ url }, res, next) => { if (url && isRootPath.test(url)) { res.statusCode = 200; res.write(html); @@ -213,7 +217,7 @@ const starter: StarterFunction = async function* starterGeneratorFn({ startTime, next(); } }); - app.use(`/index.html`, (req, res) => { + router.use(`/index.html`, (req, res) => { res.statusCode = 200; res.write(html); res.end(); diff --git a/code/core/src/core-server/dev-server.ts b/code/core/src/core-server/dev-server.ts index 9cf13d96f959..5164ee319926 100644 --- a/code/core/src/core-server/dev-server.ts +++ b/code/core/src/core-server/dev-server.ts @@ -78,8 +78,7 @@ export async function storybookDevServer(options: Options) { const managerResult = await managerBuilder.start({ startTime: process.hrtime(), options, - app, - router: app, // back-compatability with express-based API + router: app, server, channel: serverChannel, }); diff --git a/code/core/src/types/modules/core-common.ts b/code/core/src/types/modules/core-common.ts index 968b588054f9..d8a5e1b5bca2 100644 --- a/code/core/src/types/modules/core-common.ts +++ b/code/core/src/types/modules/core-common.ts @@ -239,8 +239,7 @@ export interface Builder { start: (args: { options: Options; startTime: ReturnType; - app: ServerApp; - router: ServerApp; // back-compatability with express-based API + router: ServerApp; server: HttpServer; channel: ServerChannel; }) => Promise Date: Sun, 6 Oct 2024 13:31:26 +0200 Subject: [PATCH 30/64] chore: Filter out @storybook/core from buildable packages --- scripts/build-package.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-package.ts b/scripts/build-package.ts index 96ddb84c2fbc..5eba9690602f 100644 --- a/scripts/build-package.ts +++ b/scripts/build-package.ts @@ -9,7 +9,7 @@ import windowSize from 'window-size'; import { getWorkspaces } from './utils/workspace'; async function run() { - const packages = await getWorkspaces(); + const packages = (await getWorkspaces()).filter(({ name }) => name !== '@storybook/root'); const packageTasks = packages .map((pkg) => { let suffix = pkg.name.replace('@storybook/', ''); From 9fa3ee2993063f2b046773bcce700d55de61afc0 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Mon, 7 Oct 2024 13:15:46 +0200 Subject: [PATCH 31/64] fix ServerApp types to match Polka/Trouter --- code/core/src/core-server/dev-server.ts | 3 +- .../core-server/utils/stories-json.test.ts | 2 +- code/core/src/types/modules/core-common.ts | 21 ++++++------ scripts/package.json | 1 + scripts/yarn.lock | 34 +++++++++++++++++++ 5 files changed, 48 insertions(+), 13 deletions(-) diff --git a/code/core/src/core-server/dev-server.ts b/code/core/src/core-server/dev-server.ts index 5164ee319926..f0af2ec8e1b3 100644 --- a/code/core/src/core-server/dev-server.ts +++ b/code/core/src/core-server/dev-server.ts @@ -93,8 +93,7 @@ export async function storybookDevServer(options: Options) { .start({ startTime: process.hrtime(), options, - app, - router: app, // back-compatability with express-based API + router: app, server, channel: serverChannel, }) diff --git a/code/core/src/core-server/utils/stories-json.test.ts b/code/core/src/core-server/utils/stories-json.test.ts index b1cbbf169f64..4868c149b724 100644 --- a/code/core/src/core-server/utils/stories-json.test.ts +++ b/code/core/src/core-server/utils/stories-json.test.ts @@ -385,7 +385,7 @@ describe('useStoriesJson', () => { await Promise.all([firstPromise, secondPromise]); expect(end).toHaveBeenCalledTimes(1); - expect(response.status).not.toEqual(500); + expect(response.statusCode).not.toEqual(500); expect(secondResponse.end).toHaveBeenCalledTimes(1); expect(secondResponse.status).not.toEqual(500); }); diff --git a/code/core/src/types/modules/core-common.ts b/code/core/src/types/modules/core-common.ts index d8a5e1b5bca2..3dd6668ef112 100644 --- a/code/core/src/types/modules/core-common.ts +++ b/code/core/src/types/modules/core-common.ts @@ -2,6 +2,7 @@ import type { FileSystemCache } from 'file-system-cache'; // should be node:http, but that caused the ui/manager to fail to build, might be able to switch this back once ui/manager is in the core import type { Server as HttpServer, IncomingMessage, ServerResponse } from 'http'; +import type { Server as NetServer } from 'net'; import type { Options as TelejsonOptions } from 'telejson'; import type { PackageJson as PackageJsonFromTypeFest } from 'type-fest'; @@ -218,20 +219,20 @@ export type Middleware = ( ) => Promise | void; interface ServerApp { - server: HttpServer; + server: NetServer; use(pattern: RegExp | string, ...handlers: Middleware[]): this; use(...handlers: Middleware[]): this; - get(...handlers: Middleware[]): this; - post(...handlers: Middleware[]): this; - put(...handlers: Middleware[]): this; - patch(...handlers: Middleware[]): this; - delete(...handlers: Middleware[]): this; - head(...handlers: Middleware[]): this; - options(...handlers: Middleware[]): this; - connect(...handlers: Middleware[]): this; - trace(...handlers: Middleware[]): this; + get(pattern: RegExp | string, ...handlers: Middleware[]): this; + post(pattern: RegExp | string, ...handlers: Middleware[]): this; + put(pattern: RegExp | string, ...handlers: Middleware[]): this; + patch(pattern: RegExp | string, ...handlers: Middleware[]): this; + delete(pattern: RegExp | string, ...handlers: Middleware[]): this; + head(pattern: RegExp | string, ...handlers: Middleware[]): this; + options(pattern: RegExp | string, ...handlers: Middleware[]): this; + connect(pattern: RegExp | string, ...handlers: Middleware[]): this; + trace(pattern: RegExp | string, ...handlers: Middleware[]): this; } export interface Builder { diff --git a/scripts/package.json b/scripts/package.json index 4ac174e81448..3424ae1c34bc 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -144,6 +144,7 @@ "picocolors": "^1.1.0", "playwright": "1.46.0", "playwright-core": "1.46.0", + "polka": "^1.0.0-next.28", "prettier": "^3.3.2", "prettier-plugin-brace-style": "^0.6.2", "prettier-plugin-css-order": "^2.1.2", diff --git a/scripts/yarn.lock b/scripts/yarn.lock index 2a07e09852d9..3edd98c91256 100644 --- a/scripts/yarn.lock +++ b/scripts/yarn.lock @@ -1301,6 +1301,13 @@ __metadata: languageName: node linkType: hard +"@polka/url@npm:^1.0.0-next.21": + version: 1.0.0-next.28 + resolution: "@polka/url@npm:1.0.0-next.28" + checksum: 10c0/acc5ea62597e4da2fb42dbee02749d07f102ae7d6d2c966bf7e423c79cd65d1621da305af567e6e7c232f3b565e242d1ec932cbb3dcc0db1508d02e9a2cafa2e + languageName: node + linkType: hard + "@rollup/rollup-android-arm-eabi@npm:4.21.0": version: 4.21.0 resolution: "@rollup/rollup-android-arm-eabi@npm:4.21.0" @@ -1609,6 +1616,7 @@ __metadata: picocolors: "npm:^1.1.0" playwright: "npm:1.46.0" playwright-core: "npm:1.46.0" + polka: "npm:^1.0.0-next.28" prettier: "npm:^3.3.2" prettier-plugin-brace-style: "npm:^0.6.2" prettier-plugin-css-order: "npm:^2.1.2" @@ -10918,6 +10926,16 @@ __metadata: languageName: node linkType: hard +"polka@npm:^1.0.0-next.28": + version: 1.0.0-next.28 + resolution: "polka@npm:1.0.0-next.28" + dependencies: + "@polka/url": "npm:^1.0.0-next.21" + trouter: "npm:^4.0.0" + checksum: 10c0/206bab3eb1c3c44c2fba9704d998b144ec36c4852b0b97192a1fd3953f215b739e2286852492c13dcc9faecea0f7825a76356d6eef7e02afd6a800d1dbb84ead + languageName: node + linkType: hard + "portfinder@npm:^1.0.28": version: 1.0.32 resolution: "portfinder@npm:1.0.32" @@ -11577,6 +11595,13 @@ __metadata: languageName: node linkType: hard +"regexparam@npm:^3.0.0": + version: 3.0.0 + resolution: "regexparam@npm:3.0.0" + checksum: 10c0/a6430d7b97d5a7d5518f37a850b6b73aab479029d02f46af4fa0e8e4a1d7aad05b7a0d2d10c86ded21a14d5f0fa4c68525f873a5fca2efeefcccd93c36627459 + languageName: node + linkType: hard + "remark-cli@npm:^12.0.0, remark-cli@npm:^12.0.1": version: 12.0.1 resolution: "remark-cli@npm:12.0.1" @@ -13450,6 +13475,15 @@ __metadata: languageName: node linkType: hard +"trouter@npm:^4.0.0": + version: 4.0.0 + resolution: "trouter@npm:4.0.0" + dependencies: + regexparam: "npm:^3.0.0" + checksum: 10c0/e27326a831187c6a47a72b62212364e3f88247fa2a8723e5030e14a0002b69756fb51f97efbda2466deb05f4a78ecb83c2a1a7b343e9659cbfb3f370156f1e12 + languageName: node + linkType: hard + "try-catch@npm:^3.0.0": version: 3.0.1 resolution: "try-catch@npm:3.0.1" From 0f86686cffcebcd40d955510febf5e2cfe080a71 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Mon, 7 Oct 2024 13:34:36 +0200 Subject: [PATCH 32/64] migrate event log server to polka --- scripts/event-log-collector.ts | 9 +++++---- scripts/package.json | 1 + scripts/yarn.lock | 8 ++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/event-log-collector.ts b/scripts/event-log-collector.ts index f3ad10700887..1e4a656960b1 100644 --- a/scripts/event-log-collector.ts +++ b/scripts/event-log-collector.ts @@ -1,9 +1,10 @@ -import express from 'express'; +import { json } from '@polka/parse'; +import polka from 'polka'; const PORT = process.env.PORT || 6007; -const server = express(); -server.use(express.json()); +const server = polka(); +server.use(json()); const events: Record[] = []; server.post('/event-log', (req, res) => { @@ -14,7 +15,7 @@ server.post('/event-log', (req, res) => { server.get('/event-log', (_req, res) => { console.log(`Sending ${events.length} events`); - res.json(events); + res.end(JSON.stringify(events)); }); server.listen(PORT, () => { diff --git a/scripts/package.json b/scripts/package.json index 3424ae1c34bc..522fa52ffc85 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -64,6 +64,7 @@ "@nx/workspace": "18.0.6", "@octokit/graphql": "^5.0.5", "@octokit/request": "^8.1.2", + "@polka/parse": "^1.0.0-next.28", "@storybook/eslint-config-storybook": "^4.0.0", "@storybook/linter-config": "^4.0.0", "@testing-library/dom": "^10.4.0", diff --git a/scripts/yarn.lock b/scripts/yarn.lock index 3edd98c91256..07e2cd5656a5 100644 --- a/scripts/yarn.lock +++ b/scripts/yarn.lock @@ -1301,6 +1301,13 @@ __metadata: languageName: node linkType: hard +"@polka/parse@npm:^1.0.0-next.28": + version: 1.0.0-next.28 + resolution: "@polka/parse@npm:1.0.0-next.28" + checksum: 10c0/42c53dfdc4b39a3b516fbd4358b2472b22f36e6038e25d463afb3f133fb1d5af84d7eb4d245ab66bc5793d6414299fdd9093803e5214e560f0693f2176fc58b6 + languageName: node + linkType: hard + "@polka/url@npm:^1.0.0-next.21": version: 1.0.0-next.28 resolution: "@polka/url@npm:1.0.0-next.28" @@ -1534,6 +1541,7 @@ __metadata: "@nx/workspace": "npm:18.0.6" "@octokit/graphql": "npm:^5.0.5" "@octokit/request": "npm:^8.1.2" + "@polka/parse": "npm:^1.0.0-next.28" "@storybook/eslint-config-storybook": "npm:^4.0.0" "@storybook/linter-config": "npm:^4.0.0" "@testing-library/dom": "npm:^10.4.0" From ca2a0698e5ba92155c8df1dffc0e28e9ae470aa8 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Mon, 7 Oct 2024 13:46:04 +0200 Subject: [PATCH 33/64] add comment --- code/core/src/common/utils/file-cache.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/core/src/common/utils/file-cache.ts b/code/core/src/common/utils/file-cache.ts index 3c9fd7d10789..74bc27d87b25 100644 --- a/code/core/src/common/utils/file-cache.ts +++ b/code/core/src/common/utils/file-cache.ts @@ -1,3 +1,7 @@ +/** + * This file is a modified copy from https://git.nfp.is/TheThing/fs-cache-fast + */ + import { createHash, randomBytes } from 'node:crypto'; import { mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs'; import { readFile, readdir, rm, writeFile } from 'node:fs/promises'; From fbf7a926cdef8fc77acae6a44b854f8e78e1e37c Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Mon, 7 Oct 2024 14:00:51 +0200 Subject: [PATCH 34/64] fix linting --- code/core/src/common/utils/file-cache.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/code/core/src/common/utils/file-cache.ts b/code/core/src/common/utils/file-cache.ts index 74bc27d87b25..590ddf60d608 100644 --- a/code/core/src/common/utils/file-cache.ts +++ b/code/core/src/common/utils/file-cache.ts @@ -1,7 +1,4 @@ -/** - * This file is a modified copy from https://git.nfp.is/TheThing/fs-cache-fast - */ - +/** This file is a modified copy from https://git.nfp.is/TheThing/fs-cache-fast */ import { createHash, randomBytes } from 'node:crypto'; import { mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs'; import { readFile, readdir, rm, writeFile } from 'node:fs/promises'; From e6e745b506ad546d66c3bb747e5c58c0085ecba4 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Mon, 7 Oct 2024 16:12:52 +0200 Subject: [PATCH 35/64] cleanup --- code/core/src/core-server/dev-server.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/code/core/src/core-server/dev-server.ts b/code/core/src/core-server/dev-server.ts index f0af2ec8e1b3..9cca751704ba 100644 --- a/code/core/src/core-server/dev-server.ts +++ b/code/core/src/core-server/dev-server.ts @@ -23,13 +23,8 @@ import { useStatics } from './utils/server-statics'; export async function storybookDevServer(options: Options) { const [server, core] = await Promise.all([getServer(options), options.presets.apply('core')]); - console.log('LOG: starting dev server'); const app = polka({ server }); - // app.use((req, res, next) => { - // console.log('LOG: ', { url: req.url, method: req.method }); - // next(); - // }); - + const serverChannel = await options.presets.apply( 'experimental_serverChannel', getServerChannel(server) From 49483aa7be4fd1af04049e882ad297ec274e1ace Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Mon, 7 Oct 2024 20:30:49 +0200 Subject: [PATCH 36/64] wait for server to listen --- code/core/src/core-server/dev-server.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/core/src/core-server/dev-server.ts b/code/core/src/core-server/dev-server.ts index 9cca751704ba..2ee47ca89886 100644 --- a/code/core/src/core-server/dev-server.ts +++ b/code/core/src/core-server/dev-server.ts @@ -116,9 +116,12 @@ export async function storybookDevServer(options: Options) { previewStarted.catch(() => {}).then(() => next()); }); - app.listen(port, host); + const listening = new Promise((resolve, reject) => { + server.once('error', reject); + app.listen({ port, host }, resolve); + }); - await Promise.all([initializedStoryIndexGenerator]).then(async ([indexGenerator]) => { + await Promise.all([initializedStoryIndexGenerator, listening]).then(async ([indexGenerator]) => { if (indexGenerator && !options.ci && !options.smokeTest && options.open) { openInBrowser(host ? networkAddress : address); } From 9fcba90bf0ddde25586b1172f369db985f64ff05 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Mon, 7 Oct 2024 21:19:21 +0200 Subject: [PATCH 37/64] fix format --- code/core/src/core-server/dev-server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/core/src/core-server/dev-server.ts b/code/core/src/core-server/dev-server.ts index 2ee47ca89886..325d33366514 100644 --- a/code/core/src/core-server/dev-server.ts +++ b/code/core/src/core-server/dev-server.ts @@ -24,7 +24,7 @@ import { useStatics } from './utils/server-statics'; export async function storybookDevServer(options: Options) { const [server, core] = await Promise.all([getServer(options), options.presets.apply('core')]); const app = polka({ server }); - + const serverChannel = await options.presets.apply( 'experimental_serverChannel', getServerChannel(server) From 68f57245b1d19b4f5bf876ebd4caa8d866849043 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Mon, 7 Oct 2024 21:19:31 +0200 Subject: [PATCH 38/64] regenerate lock-file --- code/yarn.lock | 911 +++++++++++++++---------------------------------- 1 file changed, 281 insertions(+), 630 deletions(-) diff --git a/code/yarn.lock b/code/yarn.lock index 5d09c24f0be6..2c6f7244e415 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -367,7 +367,7 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.16.0, @babel/code-frame@npm:^7.16.7, @babel/code-frame@npm:^7.21.4, @babel/code-frame@npm:^7.22.13, @babel/code-frame@npm:^7.23.5, @babel/code-frame@npm:^7.24.2, @babel/code-frame@npm:^7.24.7": +"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.16.0, @babel/code-frame@npm:^7.16.7, @babel/code-frame@npm:^7.21.4, @babel/code-frame@npm:^7.22.13, @babel/code-frame@npm:^7.23.5, @babel/code-frame@npm:^7.24.7": version: 7.24.7 resolution: "@babel/code-frame@npm:7.24.7" dependencies: @@ -377,16 +377,6 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.24.1": - version: 7.24.2 - resolution: "@babel/code-frame@npm:7.24.2" - dependencies: - "@babel/highlight": "npm:^7.24.2" - picocolors: "npm:^1.0.0" - checksum: 10c0/d1d4cba89475ab6aab7a88242e1fd73b15ecb9f30c109b69752956434d10a26a52cbd37727c4eca104b6d45227bd1dfce39a6a6f4a14c9b2f07f871e968cf406 - languageName: node - linkType: hard - "@babel/compat-data@npm:^7.22.6, @babel/compat-data@npm:^7.23.5, @babel/compat-data@npm:^7.24.4, @babel/compat-data@npm:^7.25.2": version: 7.25.2 resolution: "@babel/compat-data@npm:7.25.2" @@ -440,30 +430,7 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:^7.12.0, @babel/core@npm:^7.12.3, @babel/core@npm:^7.13.16, @babel/core@npm:^7.18.9, @babel/core@npm:^7.20.12, @babel/core@npm:^7.23.0, @babel/core@npm:^7.23.2, @babel/core@npm:^7.24.4, @babel/core@npm:^7.3.4, @babel/core@npm:^7.7.5": - version: 7.24.4 - resolution: "@babel/core@npm:7.24.4" - dependencies: - "@ampproject/remapping": "npm:^2.2.0" - "@babel/code-frame": "npm:^7.24.2" - "@babel/generator": "npm:^7.24.4" - "@babel/helper-compilation-targets": "npm:^7.23.6" - "@babel/helper-module-transforms": "npm:^7.23.3" - "@babel/helpers": "npm:^7.24.4" - "@babel/parser": "npm:^7.24.4" - "@babel/template": "npm:^7.24.0" - "@babel/traverse": "npm:^7.24.1" - "@babel/types": "npm:^7.24.0" - convert-source-map: "npm:^2.0.0" - debug: "npm:^4.1.0" - gensync: "npm:^1.0.0-beta.2" - json5: "npm:^2.2.3" - semver: "npm:^6.3.1" - checksum: 10c0/fc136966583e64d6f84f4a676368de6ab4583aa87f867186068655b30ef67f21f8e65a88c6d446a7efd219ad7ffb9185c82e8a90183ee033f6f47b5026641e16 - languageName: node - linkType: hard - -"@babel/core@npm:^7.23.9": +"@babel/core@npm:^7.12.0, @babel/core@npm:^7.12.3, @babel/core@npm:^7.13.16, @babel/core@npm:^7.18.9, @babel/core@npm:^7.20.12, @babel/core@npm:^7.23.0, @babel/core@npm:^7.23.2, @babel/core@npm:^7.23.9, @babel/core@npm:^7.24.4, @babel/core@npm:^7.3.4, @babel/core@npm:^7.7.5": version: 7.25.2 resolution: "@babel/core@npm:7.25.2" dependencies: @@ -509,19 +476,7 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.12.11, @babel/generator@npm:^7.23.6, @babel/generator@npm:^7.24.4, @babel/generator@npm:^7.24.7": - version: 7.24.7 - resolution: "@babel/generator@npm:7.24.7" - dependencies: - "@babel/types": "npm:^7.24.7" - "@jridgewell/gen-mapping": "npm:^0.3.5" - "@jridgewell/trace-mapping": "npm:^0.3.25" - jsesc: "npm:^2.5.1" - checksum: 10c0/06b1f3350baf527a3309e50ffd7065f7aee04dd06e1e7db794ddfde7fe9d81f28df64edd587173f8f9295496a7ddb74b9a185d4bf4de7bb619e6d4ec45c8fd35 - languageName: node - linkType: hard - -"@babel/generator@npm:^7.23.0, @babel/generator@npm:^7.25.0": +"@babel/generator@npm:^7.12.11, @babel/generator@npm:^7.23.0, @babel/generator@npm:^7.23.6, @babel/generator@npm:^7.24.4, @babel/generator@npm:^7.25.0": version: 7.25.0 resolution: "@babel/generator@npm:7.25.0" dependencies: @@ -533,18 +488,6 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.24.1": - version: 7.24.4 - resolution: "@babel/generator@npm:7.24.4" - dependencies: - "@babel/types": "npm:^7.24.0" - "@jridgewell/gen-mapping": "npm:^0.3.5" - "@jridgewell/trace-mapping": "npm:^0.3.25" - jsesc: "npm:^2.5.1" - checksum: 10c0/67a1b2f7cc985aaaa11b01e8ddd4fffa4f285837bc7a209738eb8203aa34bdafeb8507ed75fd883ddbabd641a036ca0a8d984e760f28ad4a9d60bff29d0a60bb - languageName: node - linkType: hard - "@babel/helper-annotate-as-pure@npm:7.22.5": version: 7.22.5 resolution: "@babel/helper-annotate-as-pure@npm:7.22.5" @@ -563,16 +506,17 @@ __metadata: languageName: node linkType: hard -"@babel/helper-builder-binary-assignment-operator-visitor@npm:^7.22.15": - version: 7.22.15 - resolution: "@babel/helper-builder-binary-assignment-operator-visitor@npm:7.22.15" +"@babel/helper-builder-binary-assignment-operator-visitor@npm:^7.24.7": + version: 7.24.7 + resolution: "@babel/helper-builder-binary-assignment-operator-visitor@npm:7.24.7" dependencies: - "@babel/types": "npm:^7.22.15" - checksum: 10c0/2535e3824ca6337f65786bbac98e562f71699f25532cecd196f027d7698b4967a96953d64e36567956658ad1a05ccbdc62d1ba79ee751c79f4f1d2d3ecc2e01c + "@babel/traverse": "npm:^7.24.7" + "@babel/types": "npm:^7.24.7" + checksum: 10c0/0ed84abf848c79fb1cd4c1ddac12c771d32c1904d87fc3087f33cfdeb0c2e0db4e7892b74b407d9d8d0c000044f3645a7391a781f788da8410c290bb123a1f13 languageName: node linkType: hard -"@babel/helper-compilation-targets@npm:^7.12.0, @babel/helper-compilation-targets@npm:^7.22.6, @babel/helper-compilation-targets@npm:^7.23.6, @babel/helper-compilation-targets@npm:^7.25.2": +"@babel/helper-compilation-targets@npm:^7.12.0, @babel/helper-compilation-targets@npm:^7.22.6, @babel/helper-compilation-targets@npm:^7.23.6, @babel/helper-compilation-targets@npm:^7.24.7, @babel/helper-compilation-targets@npm:^7.25.2": version: 7.25.2 resolution: "@babel/helper-compilation-targets@npm:7.25.2" dependencies: @@ -585,7 +529,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-create-class-features-plugin@npm:^7.18.6, @babel/helper-create-class-features-plugin@npm:^7.21.0, @babel/helper-create-class-features-plugin@npm:^7.24.0": +"@babel/helper-create-class-features-plugin@npm:^7.18.6, @babel/helper-create-class-features-plugin@npm:^7.21.0, @babel/helper-create-class-features-plugin@npm:^7.24.0, @babel/helper-create-class-features-plugin@npm:^7.24.7": version: 7.24.7 resolution: "@babel/helper-create-class-features-plugin@npm:7.24.7" dependencies: @@ -604,26 +548,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-create-class-features-plugin@npm:^7.24.1, @babel/helper-create-class-features-plugin@npm:^7.24.4": - version: 7.24.4 - resolution: "@babel/helper-create-class-features-plugin@npm:7.24.4" - dependencies: - "@babel/helper-annotate-as-pure": "npm:^7.22.5" - "@babel/helper-environment-visitor": "npm:^7.22.20" - "@babel/helper-function-name": "npm:^7.23.0" - "@babel/helper-member-expression-to-functions": "npm:^7.23.0" - "@babel/helper-optimise-call-expression": "npm:^7.22.5" - "@babel/helper-replace-supers": "npm:^7.24.1" - "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.22.5" - "@babel/helper-split-export-declaration": "npm:^7.22.6" - semver: "npm:^6.3.1" - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 10c0/6ebb38375dcd44c79f40008c2de4d023376cf436c135439f15c9c54603c2d6a8ada39b2e07be545da684d9e40b602a0cb0d1670f3877d056deb5f0d786c4bf86 - languageName: node - linkType: hard - -"@babel/helper-create-regexp-features-plugin@npm:^7.18.6": +"@babel/helper-create-regexp-features-plugin@npm:^7.18.6, @babel/helper-create-regexp-features-plugin@npm:^7.24.7": version: 7.24.7 resolution: "@babel/helper-create-regexp-features-plugin@npm:7.24.7" dependencies: @@ -636,19 +561,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-create-regexp-features-plugin@npm:^7.22.15, @babel/helper-create-regexp-features-plugin@npm:^7.22.5": - version: 7.22.15 - resolution: "@babel/helper-create-regexp-features-plugin@npm:7.22.15" - dependencies: - "@babel/helper-annotate-as-pure": "npm:^7.22.5" - regexpu-core: "npm:^5.3.1" - semver: "npm:^6.3.1" - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 10c0/8eba4c1b7b94a83e7a82df5c3e504584ff0ba6ab8710a67ecc2c434a7fb841a29c2f5c94d2de51f25446119a1df538fa90b37bd570db22ddd5e7147fe98277c6 - languageName: node - linkType: hard - "@babel/helper-define-polyfill-provider@npm:^0.5.0": version: 0.5.0 resolution: "@babel/helper-define-polyfill-provider@npm:0.5.0" @@ -707,15 +619,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-member-expression-to-functions@npm:^7.23.0": - version: 7.23.0 - resolution: "@babel/helper-member-expression-to-functions@npm:7.23.0" - dependencies: - "@babel/types": "npm:^7.23.0" - checksum: 10c0/b810daddf093ffd0802f1429052349ed9ea08ef7d0c56da34ffbcdecbdafac86f95bdea2fe30e0e0e629febc7dd41b56cb5eacc10d1a44336d37b755dac31fa4 - languageName: node - linkType: hard - "@babel/helper-member-expression-to-functions@npm:^7.24.7": version: 7.24.7 resolution: "@babel/helper-member-expression-to-functions@npm:7.24.7" @@ -736,16 +639,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-module-imports@npm:^7.24.1": - version: 7.24.3 - resolution: "@babel/helper-module-imports@npm:7.24.3" - dependencies: - "@babel/types": "npm:^7.24.0" - checksum: 10c0/052c188adcd100f5e8b6ff0c9643ddaabc58b6700d3bbbc26804141ad68375a9f97d9d173658d373d31853019e65f62610239e3295cdd58e573bdcb2fded188d - languageName: node - linkType: hard - -"@babel/helper-module-transforms@npm:^7.23.3, @babel/helper-module-transforms@npm:^7.25.2": +"@babel/helper-module-transforms@npm:^7.23.3, @babel/helper-module-transforms@npm:^7.24.7, @babel/helper-module-transforms@npm:^7.25.2": version: 7.25.2 resolution: "@babel/helper-module-transforms@npm:7.25.2" dependencies: @@ -759,15 +653,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-optimise-call-expression@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-optimise-call-expression@npm:7.22.5" - dependencies: - "@babel/types": "npm:^7.22.5" - checksum: 10c0/31b41a764fc3c585196cf5b776b70cf4705c132e4ce9723f39871f215f2ddbfb2e28a62f9917610f67c8216c1080482b9b05f65dd195dae2a52cef461f2ac7b8 - languageName: node - linkType: hard - "@babel/helper-optimise-call-expression@npm:^7.24.7": version: 7.24.7 resolution: "@babel/helper-optimise-call-expression@npm:7.24.7" @@ -777,21 +662,14 @@ __metadata: languageName: node linkType: hard -"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.20.2, @babel/helper-plugin-utils@npm:^7.22.5, @babel/helper-plugin-utils@npm:^7.24.0, @babel/helper-plugin-utils@npm:^7.8.0, @babel/helper-plugin-utils@npm:^7.8.3": - version: 7.24.0 - resolution: "@babel/helper-plugin-utils@npm:7.24.0" - checksum: 10c0/90f41bd1b4dfe7226b1d33a4bb745844c5c63e400f9e4e8bf9103a7ceddd7d425d65333b564d9daba3cebd105985764d51b4bd4c95822b97c2e3ac1201a8a5da - languageName: node - linkType: hard - -"@babel/helper-plugin-utils@npm:^7.24.7": +"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.20.2, @babel/helper-plugin-utils@npm:^7.22.5, @babel/helper-plugin-utils@npm:^7.24.0, @babel/helper-plugin-utils@npm:^7.24.7, @babel/helper-plugin-utils@npm:^7.8.0, @babel/helper-plugin-utils@npm:^7.8.3": version: 7.24.7 resolution: "@babel/helper-plugin-utils@npm:7.24.7" checksum: 10c0/c3d38cd9b3520757bb4a279255cc3f956fc0ac1c193964bd0816ebd5c86e30710be8e35252227e0c9d9e0f4f56d9b5f916537f2bc588084b0988b4787a967d31 languageName: node linkType: hard -"@babel/helper-remap-async-to-generator@npm:^7.22.20": +"@babel/helper-remap-async-to-generator@npm:^7.22.20, @babel/helper-remap-async-to-generator@npm:^7.24.7": version: 7.24.7 resolution: "@babel/helper-remap-async-to-generator@npm:7.24.7" dependencies: @@ -804,19 +682,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-replace-supers@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/helper-replace-supers@npm:7.24.1" - dependencies: - "@babel/helper-environment-visitor": "npm:^7.22.20" - "@babel/helper-member-expression-to-functions": "npm:^7.23.0" - "@babel/helper-optimise-call-expression": "npm:^7.22.5" - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 10c0/d39a3df7892b7c3c0e307fb229646168a9bd35e26a72080c2530729322600e8cff5f738f44a14860a2358faffa741b6a6a0d6749f113387b03ddbfa0ec10e1a0 - languageName: node - linkType: hard - "@babel/helper-replace-supers@npm:^7.24.7": version: 7.24.7 resolution: "@babel/helper-replace-supers@npm:7.24.7" @@ -830,15 +695,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-simple-access@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-simple-access@npm:7.22.5" - dependencies: - "@babel/types": "npm:^7.22.5" - checksum: 10c0/f0cf81a30ba3d09a625fd50e5a9069e575c5b6719234e04ee74247057f8104beca89ed03e9217b6e9b0493434cedc18c5ecca4cea6244990836f1f893e140369 - languageName: node - linkType: hard - "@babel/helper-simple-access@npm:^7.24.7": version: 7.24.7 resolution: "@babel/helper-simple-access@npm:7.24.7" @@ -859,15 +715,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-skip-transparent-expression-wrappers@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-skip-transparent-expression-wrappers@npm:7.22.5" - dependencies: - "@babel/types": "npm:^7.22.5" - checksum: 10c0/ab7fa2aa709ab49bb8cd86515a1e715a3108c4bb9a616965ba76b43dc346dee66d1004ccf4d222b596b6224e43e04cbc5c3a34459501b388451f8c589fbc3691 - languageName: node - linkType: hard - "@babel/helper-split-export-declaration@npm:7.22.6": version: 7.22.6 resolution: "@babel/helper-split-export-declaration@npm:7.22.6" @@ -886,20 +733,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-string-parser@npm:^7.23.4": - version: 7.23.4 - resolution: "@babel/helper-string-parser@npm:7.23.4" - checksum: 10c0/f348d5637ad70b6b54b026d6544bd9040f78d24e7ec245a0fc42293968181f6ae9879c22d89744730d246ce8ec53588f716f102addd4df8bbc79b73ea10004ac - languageName: node - linkType: hard - -"@babel/helper-string-parser@npm:^7.24.7": - version: 7.24.7 - resolution: "@babel/helper-string-parser@npm:7.24.7" - checksum: 10c0/47840c7004e735f3dc93939c77b099bb41a64bf3dda0cae62f60e6f74a5ff80b63e9b7cf77b5ec25a324516381fc994e1f62f922533236a8e3a6af57decb5e1e - languageName: node - linkType: hard - "@babel/helper-string-parser@npm:^7.24.8": version: 7.24.8 resolution: "@babel/helper-string-parser@npm:7.24.8" @@ -914,13 +747,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-validator-identifier@npm:^7.22.20": - version: 7.22.20 - resolution: "@babel/helper-validator-identifier@npm:7.22.20" - checksum: 10c0/dcad63db345fb110e032de46c3688384b0008a42a4845180ce7cd62b1a9c0507a1bed727c4d1060ed1a03ae57b4d918570259f81724aaac1a5b776056f37504e - languageName: node - linkType: hard - "@babel/helper-validator-option@npm:^7.22.15, @babel/helper-validator-option@npm:^7.23.5, @babel/helper-validator-option@npm:^7.24.8": version: 7.24.8 resolution: "@babel/helper-validator-option@npm:7.24.8" @@ -950,29 +776,6 @@ __metadata: languageName: node linkType: hard -"@babel/helpers@npm:^7.24.4": - version: 7.24.4 - resolution: "@babel/helpers@npm:7.24.4" - dependencies: - "@babel/template": "npm:^7.24.0" - "@babel/traverse": "npm:^7.24.1" - "@babel/types": "npm:^7.24.0" - checksum: 10c0/747ef62b7fe87de31a2f3c19ff337a86cbb79be2f6c18af63133b614ab5a8f6da5b06ae4b06fb0e71271cb6a27efec6f8b6c9f44c60b8a18777832dc7929e6c5 - languageName: node - linkType: hard - -"@babel/highlight@npm:^7.24.2": - version: 7.24.2 - resolution: "@babel/highlight@npm:7.24.2" - dependencies: - "@babel/helper-validator-identifier": "npm:^7.22.20" - chalk: "npm:^2.4.2" - js-tokens: "npm:^4.0.0" - picocolors: "npm:^1.0.0" - checksum: 10c0/98ce00321daedeed33a4ed9362dc089a70375ff1b3b91228b9f05e6591d387a81a8cba68886e207861b8871efa0bc997ceabdd9c90f6cce3ee1b2f7f941b42db - languageName: node - linkType: hard - "@babel/highlight@npm:^7.24.7": version: 7.24.7 resolution: "@babel/highlight@npm:7.24.7" @@ -985,16 +788,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.11.5, @babel/parser@npm:^7.13.16, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.23.0, @babel/parser@npm:^7.23.5, @babel/parser@npm:^7.23.6, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.24.0, @babel/parser@npm:^7.24.4, @babel/parser@npm:^7.24.7, @babel/parser@npm:^7.4.5, @babel/parser@npm:^7.6.0, @babel/parser@npm:^7.9.6": - version: 7.24.7 - resolution: "@babel/parser@npm:7.24.7" - bin: - parser: ./bin/babel-parser.js - checksum: 10c0/8b244756872185a1c6f14b979b3535e682ff08cb5a2a5fd97cc36c017c7ef431ba76439e95e419d43000c5b07720495b00cf29a7f0d9a483643d08802b58819b - languageName: node - linkType: hard - -"@babel/parser@npm:^7.20.5, @babel/parser@npm:^7.22.5, @babel/parser@npm:^7.25.0, @babel/parser@npm:^7.25.3": +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.11.5, @babel/parser@npm:^7.13.16, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.5, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.22.5, @babel/parser@npm:^7.23.0, @babel/parser@npm:^7.23.5, @babel/parser@npm:^7.23.6, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.24.0, @babel/parser@npm:^7.24.4, @babel/parser@npm:^7.24.7, @babel/parser@npm:^7.25.0, @babel/parser@npm:^7.25.3, @babel/parser@npm:^7.4.5, @babel/parser@npm:^7.6.0, @babel/parser@npm:^7.9.6": version: 7.25.3 resolution: "@babel/parser@npm:7.25.3" dependencies: @@ -1005,15 +799,6 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.24.1": - version: 7.24.4 - resolution: "@babel/parser@npm:7.24.4" - bin: - parser: ./bin/babel-parser.js - checksum: 10c0/8381e1efead5069cb7ed2abc3a583f4a86289b2f376c75cecc69f59a8eb36df18274b1886cecf2f97a6a0dff5334b27330f58535be9b3e4e26102cc50e12eac8 - languageName: node - linkType: hard - "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:^7.24.4": version: 7.24.4 resolution: "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:7.24.4" @@ -1027,38 +812,38 @@ __metadata: linkType: hard "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.23.3, @babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0 - checksum: 10c0/d4e592e6fc4878654243d2e7b51ea86471b868a8cb09de29e73b65d2b64159990c6c198fd7c9c2af2e38b1cddf70206243792853c47384a84f829dada152f605 + checksum: 10c0/a36307428ecc1a01b00cf90812335eed1575d13f211ab24fe4d0c55c28a2fcbd4135f142efabc3b277b2a8e09ee05df594a1272353f061b63829495b5dcfdb96 languageName: node linkType: hard "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:^7.23.3, @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" - "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.22.5" - "@babel/plugin-transform-optional-chaining": "npm:^7.24.1" + "@babel/helper-plugin-utils": "npm:^7.24.7" + "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.24.7" + "@babel/plugin-transform-optional-chaining": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.13.0 - checksum: 10c0/351c36e45795a7890d610ab9041a52f4078a59429f6e74c281984aa44149a10d43e82b3a8172c703c0d5679471e165d1c02b6d2e45a677958ee301b89403f202 + checksum: 10c0/aeb6e7aa363a47f815cf956ea1053c5dd8b786a17799f065c9688ba4b0051fe7565d258bbe9400bfcbfb3114cb9fda66983e10afe4d750bc70ff75403e15dd36 languageName: node linkType: hard "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@npm:^7.23.7, @babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@npm:7.24.7" dependencies: - "@babel/helper-environment-visitor": "npm:^7.22.20" - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-environment-visitor": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0 - checksum: 10c0/d7dd5a59a54635a3152895dcaa68f3370bb09d1f9906c1e72232ff759159e6be48de4a598a993c986997280a2dc29922a48aaa98020f16439f3f57ad72788354 + checksum: 10c0/2b52a73e444f6adc73f927b623e53a4cf64397170dd1071268536df1b3db1e02131418c8dc91351af48837a6298212118f4a72d5407f8005cf9a732370a315b0 languageName: node linkType: hard @@ -1236,24 +1021,24 @@ __metadata: linkType: hard "@babel/plugin-syntax-import-assertions@npm:^7.23.3, @babel/plugin-syntax-import-assertions@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-syntax-import-assertions@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-syntax-import-assertions@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/72f0340d73e037f0702c61670054e0af66ece7282c5c2f4ba8de059390fee502de282defdf15959cd9f71aa18dc5c5e4e7a0fde317799a0600c6c4e0a656d82b + checksum: 10c0/b82c53e095274ee71c248551352d73441cf65b3b3fc0107258ba4e9aef7090772a425442b3ed1c396fa207d0efafde8929c87a17d3c885b3ca2021316e87e246 languageName: node linkType: hard "@babel/plugin-syntax-import-attributes@npm:^7.23.3, @babel/plugin-syntax-import-attributes@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-syntax-import-attributes@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-syntax-import-attributes@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/309634e3335777aee902552b2cf244c4a8050213cc878b3fb9d70ad8cbbff325dc46ac5e5791836ff477ea373b27832238205f6ceaff81f7ea7c4c7e8fbb13bb + checksum: 10c0/eccc54d0f03c96d0eec7a6e2fa124dadbc7298345b62ffc4238f173308c4325b5598f139695ff05a95cf78412ef6903599e4b814496612bf39aad4715a16375b languageName: node linkType: hard @@ -1378,18 +1163,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-typescript@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-syntax-typescript@npm:7.24.1" - dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 10c0/7a81e277dcfe3138847e8e5944e02a42ff3c2e864aea6f33fd9b70d1556d12b0e70f0d56cc1985d353c91bcbf8fe163e6cc17418da21129b7f7f1d8b9ac00c93 - languageName: node - linkType: hard - -"@babel/plugin-syntax-typescript@npm:^7.3.3": +"@babel/plugin-syntax-typescript@npm:^7.24.7, @babel/plugin-syntax-typescript@npm:^7.3.3": version: 7.24.7 resolution: "@babel/plugin-syntax-typescript@npm:7.24.7" dependencies: @@ -1413,13 +1187,13 @@ __metadata: linkType: hard "@babel/plugin-transform-arrow-functions@npm:^7.23.3, @babel/plugin-transform-arrow-functions@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-arrow-functions@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-arrow-functions@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/f44bfacf087dc21b422bab99f4e9344ee7b695b05c947dacae66de05c723ab9d91800be7edc1fa016185e8c819f3aca2b4a5f66d8a4d1e47d9bad80b8fa55b8e + checksum: 10c0/6ac05a54e5582f34ac6d5dc26499e227227ec1c7fa6fc8de1f3d40c275f140d3907f79bbbd49304da2d7008a5ecafb219d0b71d78ee3290ca22020d878041245 languageName: node linkType: hard @@ -1438,16 +1212,16 @@ __metadata: linkType: hard "@babel/plugin-transform-async-generator-functions@npm:^7.23.9, @babel/plugin-transform-async-generator-functions@npm:^7.24.3": - version: 7.24.3 - resolution: "@babel/plugin-transform-async-generator-functions@npm:7.24.3" + version: 7.24.7 + resolution: "@babel/plugin-transform-async-generator-functions@npm:7.24.7" dependencies: - "@babel/helper-environment-visitor": "npm:^7.22.20" - "@babel/helper-plugin-utils": "npm:^7.24.0" - "@babel/helper-remap-async-to-generator": "npm:^7.22.20" + "@babel/helper-environment-visitor": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" + "@babel/helper-remap-async-to-generator": "npm:^7.24.7" "@babel/plugin-syntax-async-generators": "npm:^7.8.4" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/55ceed059f819dcccbfe69600bfa1c055ada466bd54eda117cfdd2cf773dd85799e2f6556e4a559b076e93b9704abcca2aef9d72aad7dc8a5d3d17886052f1d3 + checksum: 10c0/6b5e33ae66dce0afce9b06d8dace6fa052528e60f7622aa6cfd3e71bd372ca5079d426e78336ca564bc0d5f37acbcda1b21f4fe656fcb642f1a93a697ab39742 languageName: node linkType: hard @@ -1465,162 +1239,162 @@ __metadata: linkType: hard "@babel/plugin-transform-async-to-generator@npm:^7.23.3, @babel/plugin-transform-async-to-generator@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-async-to-generator@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-async-to-generator@npm:7.24.7" dependencies: - "@babel/helper-module-imports": "npm:^7.24.1" - "@babel/helper-plugin-utils": "npm:^7.24.0" - "@babel/helper-remap-async-to-generator": "npm:^7.22.20" + "@babel/helper-module-imports": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" + "@babel/helper-remap-async-to-generator": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/3731ba8e83cbea1ab22905031f25b3aeb0b97c6467360a2cc685352f16e7c786417d8883bc747f5a0beff32266bdb12a05b6292e7b8b75967087200a7bc012c4 + checksum: 10c0/83c82e243898875af8457972a26ab29baf8a2078768ee9f35141eb3edff0f84b165582a2ff73e90a9e08f5922bf813dbf15a85c1213654385198f4591c0dc45d languageName: node linkType: hard "@babel/plugin-transform-block-scoped-functions@npm:^7.23.3, @babel/plugin-transform-block-scoped-functions@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-block-scoped-functions@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-block-scoped-functions@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/6fbaa85f5204f34845dfc0bebf62fdd3ac5a286241c85651e59d426001e7a1785ac501f154e093e0b8ee49e1f51e3f8b06575a5ae8d4a9406d43e4816bf18c37 + checksum: 10c0/113e86de4612ae91773ff5cb6b980f01e1da7e26ae6f6012127415d7ae144e74987bc23feb97f63ba4bc699331490ddea36eac004d76a20d5369e4cc6a7f61cd languageName: node linkType: hard "@babel/plugin-transform-block-scoping@npm:^7.23.4, @babel/plugin-transform-block-scoping@npm:^7.24.4, @babel/plugin-transform-block-scoping@npm:^7.8.3": - version: 7.24.4 - resolution: "@babel/plugin-transform-block-scoping@npm:7.24.4" + version: 7.24.7 + resolution: "@babel/plugin-transform-block-scoping@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/62f55fd1b60a115506e9553c3bf925179b1ab8a42dc31471c4e3ada20573a488b5c5e3317145da352493ef07f1d9750ce1f8a49cb3f39489ac1ab42e5ddc883d + checksum: 10c0/dcbc5e385c0ca5fb5736b1c720c90755cffe9f91d8c854f82e61e59217dd3f6c91b3633eeee4b55a89d3f59e5275d0f5b0b1b1363d4fa70c49c468b55aa87700 languageName: node linkType: hard "@babel/plugin-transform-class-properties@npm:^7.22.5, @babel/plugin-transform-class-properties@npm:^7.23.3, @babel/plugin-transform-class-properties@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-class-properties@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-class-properties@npm:7.24.7" dependencies: - "@babel/helper-create-class-features-plugin": "npm:^7.24.1" - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-create-class-features-plugin": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/00dff042ac9df4ae67b5ef98b1137cc72e0a24e6d911dc200540a8cb1f00b4cff367a922aeb22da17da662079f0abcd46ee1c5f4cdf37ceebf6ff1639bb9af27 + checksum: 10c0/75018a466c7ede3d2397e158891c224ba7fca72864506ce067ddbc02fc65191d44da4d6379c996d0c7f09019e26b5c3f5f1d3a639cd98366519723886f0689d0 languageName: node linkType: hard "@babel/plugin-transform-class-static-block@npm:^7.23.4, @babel/plugin-transform-class-static-block@npm:^7.24.4": - version: 7.24.4 - resolution: "@babel/plugin-transform-class-static-block@npm:7.24.4" + version: 7.24.7 + resolution: "@babel/plugin-transform-class-static-block@npm:7.24.7" dependencies: - "@babel/helper-create-class-features-plugin": "npm:^7.24.4" - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-create-class-features-plugin": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" "@babel/plugin-syntax-class-static-block": "npm:^7.14.5" peerDependencies: "@babel/core": ^7.12.0 - checksum: 10c0/19dfeaf4a2ac03695034f7211a8b5ad89103b224608ac3e91791055107c5fe4d7ebe5d9fbb31b4a91265694af78762260642eb270f4b239c175984ee4b253f80 + checksum: 10c0/b0ade39a3d09dce886f79dbd5907c3d99b48167eddb6b9bbde24a0598129654d7017e611c20494cdbea48b07ac14397cd97ea34e3754bbb2abae4e698128eccb languageName: node linkType: hard "@babel/plugin-transform-classes@npm:^7.23.8, @babel/plugin-transform-classes@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-classes@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-classes@npm:7.24.7" dependencies: - "@babel/helper-annotate-as-pure": "npm:^7.22.5" - "@babel/helper-compilation-targets": "npm:^7.23.6" - "@babel/helper-environment-visitor": "npm:^7.22.20" - "@babel/helper-function-name": "npm:^7.23.0" - "@babel/helper-plugin-utils": "npm:^7.24.0" - "@babel/helper-replace-supers": "npm:^7.24.1" - "@babel/helper-split-export-declaration": "npm:^7.22.6" + "@babel/helper-annotate-as-pure": "npm:^7.24.7" + "@babel/helper-compilation-targets": "npm:^7.24.7" + "@babel/helper-environment-visitor": "npm:^7.24.7" + "@babel/helper-function-name": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" + "@babel/helper-replace-supers": "npm:^7.24.7" + "@babel/helper-split-export-declaration": "npm:^7.24.7" globals: "npm:^11.1.0" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/586a95826be4d68056fa23d8e6c34353ce2ea59bf3ca8cf62bc784e60964d492d76e1b48760c43fd486ffb65a79d3fed9a4f91289e4f526f88c3b6acc0dfb00e + checksum: 10c0/e51dba7ce8b770d1eee929e098d5a3be3efc3e8b941e22dda7d0097dc4e7be5feabd2da7b707ac06fcac5661b31223c541941dec08ce76c1faa55544d87d06ec languageName: node linkType: hard "@babel/plugin-transform-computed-properties@npm:^7.23.3, @babel/plugin-transform-computed-properties@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-computed-properties@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-computed-properties@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" - "@babel/template": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" + "@babel/template": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/8292c508b656b7722e2c2ca0f6f31339852e3ed2b9b80f6e068a4010e961b431ca109ecd467fc906283f4b1574c1e7b1cb68d35a4dea12079d386c15ff7e0eac + checksum: 10c0/25636dbc1f605c0b8bc60aa58628a916b689473d11551c9864a855142e36742fe62d4a70400ba3b74902338e77fb3d940376c0a0ba154b6b7ec5367175233b49 languageName: node linkType: hard "@babel/plugin-transform-destructuring@npm:^7.23.3, @babel/plugin-transform-destructuring@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-destructuring@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-destructuring@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/a08e706a9274a699abc3093f38c72d4a5354eac11c44572cc9ea049915b6e03255744297069fd94fcce82380725c5d6b1b11b9a84c0081aa3aa6fc2fdab98ef6 + checksum: 10c0/929f07a807fb62230bfbf881cfcedf187ac5daf2f1b01da94a75c7a0f6f72400268cf4bcfee534479e43260af8193e42c31ee03c8b0278ba77d0036ed6709c27 languageName: node linkType: hard "@babel/plugin-transform-dotall-regex@npm:^7.23.3, @babel/plugin-transform-dotall-regex@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-dotall-regex@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-dotall-regex@npm:7.24.7" dependencies: - "@babel/helper-create-regexp-features-plugin": "npm:^7.22.15" - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-create-regexp-features-plugin": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/758def705ec5a87ef910280dc2df5d2fda59dc5d4771c1725c7aed0988ae5b79e29aeb48109120301a3e1c6c03dfac84700469de06f38ca92c96834e09eadf5d + checksum: 10c0/793f14c9494972d294b7e7b97b747f47874b6d57d7804d3443c701becf5db192c9311be6a1835c07664486df1f5c60d33196c36fb7e11a53015e476b4c145b33 languageName: node linkType: hard "@babel/plugin-transform-duplicate-keys@npm:^7.23.3, @babel/plugin-transform-duplicate-keys@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-duplicate-keys@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-duplicate-keys@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/41072f57f83a6c2b15f3ee0b6779cdca105ff3d98061efe92ac02d6c7b90fdb6e7e293b8a4d5b9c690d9ae5d3ae73e6bde4596dc4d8c66526a0e5e1abc73c88c + checksum: 10c0/75ff7ec1117ac500e77bf20a144411d39c0fdd038f108eec061724123ce6d1bb8d5bd27968e466573ee70014f8be0043361cdb0ef388f8a182d1d97ad67e51b9 languageName: node linkType: hard "@babel/plugin-transform-dynamic-import@npm:^7.23.4, @babel/plugin-transform-dynamic-import@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-dynamic-import@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-dynamic-import@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" "@babel/plugin-syntax-dynamic-import": "npm:^7.8.3" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/7e2834780e9b5251ef341854043a89c91473b83c335358620ca721554877e64e416aeb3288a35f03e825c4958e07d5d00ead08c4490fadc276a21fe151d812f1 + checksum: 10c0/eeda48372efd0a5103cb22dadb13563c975bce18ae85daafbb47d57bb9665d187da9d4fe8d07ac0a6e1288afcfcb73e4e5618bf75ff63fddf9736bfbf225203b languageName: node linkType: hard "@babel/plugin-transform-exponentiation-operator@npm:^7.23.3, @babel/plugin-transform-exponentiation-operator@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-exponentiation-operator@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-exponentiation-operator@npm:7.24.7" dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor": "npm:^7.22.15" - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-builder-binary-assignment-operator-visitor": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/f0fc4c5a9add25fd6bf23dabe6752e9b7c0a2b2554933dddfd16601245a2ba332b647951079c782bf3b94c6330e3638b9b4e0227f469a7c1c707446ba0eba6c7 + checksum: 10c0/ace3e11c94041b88848552ba8feb39ae4d6cad3696d439ff51445bd2882d8b8775d85a26c2c0edb9b5e38c9e6013cc11b0dea89ec8f93c7d9d7ee95e3645078c languageName: node linkType: hard "@babel/plugin-transform-export-namespace-from@npm:^7.23.4, @babel/plugin-transform-export-namespace-from@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-export-namespace-from@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-export-namespace-from@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" "@babel/plugin-syntax-export-namespace-from": "npm:^7.8.3" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/510bb23b2423d5fbffef69b356e4050929c21a7627e8194b1506dd935c7d9cbbd696c9ae9d7c3bcd7e6e7b69561b0b290c2d72d446327b40fc20ce40bbca6712 + checksum: 10c0/4e144d7f1c57bc63b4899dbbbdfed0880f2daa75ea9c7251c7997f106e4b390dc362175ab7830f11358cb21f6b972ca10a43a2e56cd789065f7606b082674c0c languageName: node linkType: hard @@ -1637,171 +1411,171 @@ __metadata: linkType: hard "@babel/plugin-transform-for-of@npm:^7.23.6, @babel/plugin-transform-for-of@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-for-of@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-for-of@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" - "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.22.5" + "@babel/helper-plugin-utils": "npm:^7.24.7" + "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/e4bc92b1f334246e62d4bde079938df940794db564742034f6597f2e38bd426e11ae8c5670448e15dd6e45c462f2a9ab3fa87259bddf7c08553ffd9457fc2b2c + checksum: 10c0/77629b1173e55d07416f05ba7353caa09d2c2149da2ca26721ab812209b63689d1be45116b68eadc011c49ced59daf5320835b15245eb7ae93ae0c5e8277cfc0 languageName: node linkType: hard "@babel/plugin-transform-function-name@npm:^7.23.3, @babel/plugin-transform-function-name@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-function-name@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-function-name@npm:7.24.7" dependencies: - "@babel/helper-compilation-targets": "npm:^7.23.6" - "@babel/helper-function-name": "npm:^7.23.0" - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-compilation-targets": "npm:^7.24.7" + "@babel/helper-function-name": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/65c1735ec3b5e43db9b5aebf3c16171c04b3050c92396b9e22dda0d2aaf51f43fdcf147f70a40678fd9a4ee2272a5acec4826e9c21bcf968762f4c184897ad75 + checksum: 10c0/3e9642428d6952851850d89ea9307d55946528d18973784d0e2f04a651b23bd9924dd8a2641c824b483bd4ab1223bab1d2f6a1106a939998f7ced512cb60ac5b languageName: node linkType: hard "@babel/plugin-transform-json-strings@npm:^7.23.4, @babel/plugin-transform-json-strings@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-json-strings@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-json-strings@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" "@babel/plugin-syntax-json-strings": "npm:^7.8.3" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/13d9b6a3c31ab4be853b3d49d8d1171f9bd8198562fd75da8f31e7de31398e1cfa6eb1d073bed93c9746e4f9c47a53b20f8f4c255ece3f88c90852ad3181dc2d + checksum: 10c0/17c72cd5bf3e90e722aabd333559275f3309e3fa0b9cea8c2944ab83ae01502c71a2be05da5101edc02b3fc8df15a8dbb9b861cbfcc8a52bf5e797cf01d3a40a languageName: node linkType: hard "@babel/plugin-transform-literals@npm:^7.23.3, @babel/plugin-transform-literals@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-literals@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-literals@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/a27cc7d565ee57b5a2bf136fa889c5c2f5988545ae7b3b2c83a7afe5dd37dfac80dca88b1c633c65851ce6af7d2095c04c01228657ce0198f918e64b5ccd01fa + checksum: 10c0/9f3f6f3831929cd2a977748c07addf9944d5cccb50bd3a24a58beb54f91f00d6cacd3d7831d13ffe1ad6f8aba0aefd7bca5aec65d63b77f39c62ad1f2d484a3e languageName: node linkType: hard "@babel/plugin-transform-logical-assignment-operators@npm:^7.23.4, @babel/plugin-transform-logical-assignment-operators@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-logical-assignment-operators@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-logical-assignment-operators@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" "@babel/plugin-syntax-logical-assignment-operators": "npm:^7.10.4" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/98a2e0843ddfe51443c1bfcf08ba40ad8856fd4f8e397b392a5390a54f257c8c1b9a99d8ffc0fc7e8c55cce45e2cd9c2795a4450303f48f501bcbd662de44554 + checksum: 10c0/dbe882eb9053931f2ab332c50fc7c2a10ef507d6421bd9831adbb4cb7c9f8e1e5fbac4fbd2e007f6a1bf1df1843547559434012f118084dc0bf42cda3b106272 languageName: node linkType: hard "@babel/plugin-transform-member-expression-literals@npm:^7.23.3, @babel/plugin-transform-member-expression-literals@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-member-expression-literals@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-member-expression-literals@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/2af731d02aa4c757ef80c46df42264128cbe45bfd15e1812d1a595265b690a44ad036041c406a73411733540e1c4256d8174705ae6b8cfaf757fc175613993fd + checksum: 10c0/e789ae359bdf2d20e90bedef18dfdbd965c9ebae1cee398474a0c349590fda7c8b874e1a2ceee62e47e5e6ec1730e76b0f24e502164357571854271fc12cc684 languageName: node linkType: hard "@babel/plugin-transform-modules-amd@npm:^7.13.0, @babel/plugin-transform-modules-amd@npm:^7.23.3, @babel/plugin-transform-modules-amd@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-modules-amd@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-modules-amd@npm:7.24.7" dependencies: - "@babel/helper-module-transforms": "npm:^7.23.3" - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-module-transforms": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/71fd04e5e7026e6e52701214b1e9f7508ba371b757e5075fbb938a79235ed66a54ce65f89bb92b59159e9f03f01b392e6c4de6d255b948bec975a90cfd6809ef + checksum: 10c0/6df7de7fce34117ca4b2fa07949b12274c03668cbfe21481c4037b6300796d50ae40f4f170527b61b70a67f26db906747797e30dbd0d9809a441b6e220b5728f languageName: node linkType: hard "@babel/plugin-transform-modules-commonjs@npm:^7.13.8, @babel/plugin-transform-modules-commonjs@npm:^7.23.0, @babel/plugin-transform-modules-commonjs@npm:^7.23.3, @babel/plugin-transform-modules-commonjs@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-modules-commonjs@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-modules-commonjs@npm:7.24.7" dependencies: - "@babel/helper-module-transforms": "npm:^7.23.3" - "@babel/helper-plugin-utils": "npm:^7.24.0" - "@babel/helper-simple-access": "npm:^7.22.5" + "@babel/helper-module-transforms": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" + "@babel/helper-simple-access": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/efb3ea2047604a7eb44a9289311ebb29842fe6510ff8b66a77a60440448c65e1312a60dc48191ed98246bdbd163b5b6f3348a0669bcc0e3809e69c7c776b20fa + checksum: 10c0/9442292b3daf6a5076cdc3c4c32bf423bda824ccaeb0dd0dc8b3effaa1fecfcb0130ae6e647fef12a5d5ff25bcc99a0d6bfc6d24a7525345e1bcf46fcdf81752 languageName: node linkType: hard "@babel/plugin-transform-modules-systemjs@npm:^7.23.9, @babel/plugin-transform-modules-systemjs@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-modules-systemjs@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-modules-systemjs@npm:7.24.7" dependencies: - "@babel/helper-hoist-variables": "npm:^7.22.5" - "@babel/helper-module-transforms": "npm:^7.23.3" - "@babel/helper-plugin-utils": "npm:^7.24.0" - "@babel/helper-validator-identifier": "npm:^7.22.20" + "@babel/helper-hoist-variables": "npm:^7.24.7" + "@babel/helper-module-transforms": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" + "@babel/helper-validator-identifier": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/38145f8abe8a4ce2b41adabe5d65eb7bd54a139dc58e2885fec975eb5cf247bd938c1dd9f09145c46dbe57d25dd0ef7f00a020e5eb0cbe8195b2065d51e2d93d + checksum: 10c0/e2a795e0a6baafe26f4a74010622212ddd873170742d673f450e0097f8d984f6e6a95eb8ce41b05071ee9790c4be088b33801aaab3f78ee202c567634e52a331 languageName: node linkType: hard "@babel/plugin-transform-modules-umd@npm:^7.23.3, @babel/plugin-transform-modules-umd@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-modules-umd@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-modules-umd@npm:7.24.7" dependencies: - "@babel/helper-module-transforms": "npm:^7.23.3" - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-module-transforms": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/14c90c58562b54e17fe4a8ded3f627f9a993648f8378ef00cb2f6c34532032b83290d2ad54c7fff4f0c2cd49091bda780f8cc28926ec4b77a6c2141105a2e699 + checksum: 10c0/7791d290121db210e4338b94b4a069a1a79e4c7a8d7638d8159a97b281851bbed3048dac87a4ae718ad963005e6c14a5d28e6db2eeb2b04e031cee92fb312f85 languageName: node linkType: hard "@babel/plugin-transform-named-capturing-groups-regex@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-named-capturing-groups-regex@npm:7.22.5" + version: 7.24.7 + resolution: "@babel/plugin-transform-named-capturing-groups-regex@npm:7.24.7" dependencies: - "@babel/helper-create-regexp-features-plugin": "npm:^7.22.5" - "@babel/helper-plugin-utils": "npm:^7.22.5" + "@babel/helper-create-regexp-features-plugin": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0 - checksum: 10c0/b0b072bef303670b5a98307bc37d1ac326cb7ad40ea162b89a03c2ffc465451be7ef05be95cb81ed28bfeb29670dc98fe911f793a67bceab18b4cb4c81ef48f3 + checksum: 10c0/41a0b0f2d0886318237440aa3b489f6d0305361d8671121777d9ff89f9f6de9d0c02ce93625049061426c8994064ef64deae8b819d1b14c00374a6a2336fb5d9 languageName: node linkType: hard "@babel/plugin-transform-new-target@npm:^7.23.3, @babel/plugin-transform-new-target@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-new-target@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-new-target@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/c4cabe628163855f175a8799eb73d692b6f1dc347aae5022af0c253f80c92edb962e48ddccc98b691eff3d5d8e53c9a8f10894c33ba4cebc2e2f8f8fe554fb7a + checksum: 10c0/2540808a35e1a978e537334c43dab439cf24c93e7beb213a2e71902f6710e60e0184316643790c0a6644e7a8021e52f7ab8165e6b3e2d6651be07bdf517b67df languageName: node linkType: hard "@babel/plugin-transform-nullish-coalescing-operator@npm:^7.22.11, @babel/plugin-transform-nullish-coalescing-operator@npm:^7.23.4, @babel/plugin-transform-nullish-coalescing-operator@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-nullish-coalescing-operator@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-nullish-coalescing-operator@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" "@babel/plugin-syntax-nullish-coalescing-operator": "npm:^7.8.3" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/c8532951506fb031287280cebeef10aa714f8a7cea2b62a13c805f0e0af945ba77a7c87e4bbbe4c37fe973e0e5d5e649cfac7f0374f57efc54cdf9656362a392 + checksum: 10c0/7243c8ff734ed5ef759dd8768773c4b443c12e792727e759a1aec2c7fa2bfdd24f1ecb42e292a7b3d8bd3d7f7b861cf256a8eb4ba144fc9cc463892c303083d9 languageName: node linkType: hard "@babel/plugin-transform-numeric-separator@npm:^7.23.4, @babel/plugin-transform-numeric-separator@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-numeric-separator@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-numeric-separator@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" "@babel/plugin-syntax-numeric-separator": "npm:^7.10.4" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/15e2b83292e586fb4f5b4b4021d4821a806ca6de2b77d5ad6c4e07aa7afa23704e31b4d683dac041afc69ac51b2461b96e8c98e46311cc1faba54c73f235044f + checksum: 10c0/e18e09ca5a6342645d00ede477731aa6e8714ff357efc9d7cda5934f1703b3b6fb7d3298dce3ce3ba53e9ff1158eab8f1aadc68874cc21a6099d33a1ca457789 languageName: node linkType: hard @@ -1817,44 +1591,44 @@ __metadata: linkType: hard "@babel/plugin-transform-object-rest-spread@npm:^7.24.0, @babel/plugin-transform-object-rest-spread@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-object-rest-spread@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-object-rest-spread@npm:7.24.7" dependencies: - "@babel/helper-compilation-targets": "npm:^7.23.6" - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-compilation-targets": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" "@babel/plugin-syntax-object-rest-spread": "npm:^7.8.3" - "@babel/plugin-transform-parameters": "npm:^7.24.1" + "@babel/plugin-transform-parameters": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/e301f1a66b63bafc2bce885305cc88ab30ec875b5e2c7933fb7f9cbf0d954685aa10334ffcecf147ba19d6a1d7ffab37baf4ce871849d395941c56fdb3060f73 + checksum: 10c0/9ad64bc003f583030f9da50614b485852f8edac93f8faf5d1cd855201a4852f37c5255ae4daf70dd4375bdd4874e16e39b91f680d4668ec219ba05441ce286eb languageName: node linkType: hard "@babel/plugin-transform-object-super@npm:^7.23.3, @babel/plugin-transform-object-super@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-object-super@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-object-super@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" - "@babel/helper-replace-supers": "npm:^7.24.1" + "@babel/helper-plugin-utils": "npm:^7.24.7" + "@babel/helper-replace-supers": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/d30e6b9e59a707efd7ed524fc0a8deeea046011a6990250f2e9280516683138e2d13d9c52daf41d78407bdab0378aef7478326f2a15305b773d851cb6e106157 + checksum: 10c0/770cebb4b4e1872c216b17069db9a13b87dfee747d359dc56d9fcdd66e7544f92dc6ab1861a4e7e0528196aaff2444e4f17dc84efd8eaf162d542b4ba0943869 languageName: node linkType: hard "@babel/plugin-transform-optional-catch-binding@npm:^7.23.4, @babel/plugin-transform-optional-catch-binding@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-optional-catch-binding@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-optional-catch-binding@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" "@babel/plugin-syntax-optional-catch-binding": "npm:^7.8.3" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/68408b9ef772d9aa5dccf166c86dc4d2505990ce93e03dcfc65c73fb95c2511248e009ba9ccf5b96405fb85de1c16ad8291016b1cc5689ee4becb1e3050e0ae7 + checksum: 10c0/1e2f10a018f7d03b3bde6c0b70d063df8d5dd5209861d4467726cf834f5e3d354e2276079dc226aa8e6ece35f5c9b264d64b8229a8bb232829c01e561bcfb07a languageName: node linkType: hard -"@babel/plugin-transform-optional-chaining@npm:^7.23.0, @babel/plugin-transform-optional-chaining@npm:^7.23.4, @babel/plugin-transform-optional-chaining@npm:^7.24.1": +"@babel/plugin-transform-optional-chaining@npm:^7.23.0, @babel/plugin-transform-optional-chaining@npm:^7.23.4, @babel/plugin-transform-optional-chaining@npm:^7.24.1, @babel/plugin-transform-optional-chaining@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-optional-chaining@npm:7.24.7" dependencies: @@ -1867,7 +1641,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-parameters@npm:^7.23.3, @babel/plugin-transform-parameters@npm:^7.24.1": +"@babel/plugin-transform-parameters@npm:^7.23.3, @babel/plugin-transform-parameters@npm:^7.24.1, @babel/plugin-transform-parameters@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-parameters@npm:7.24.7" dependencies: @@ -1879,39 +1653,39 @@ __metadata: linkType: hard "@babel/plugin-transform-private-methods@npm:^7.22.5, @babel/plugin-transform-private-methods@npm:^7.23.3, @babel/plugin-transform-private-methods@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-private-methods@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-private-methods@npm:7.24.7" dependencies: - "@babel/helper-create-class-features-plugin": "npm:^7.24.1" - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-create-class-features-plugin": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/d8e18587d2a8b71a795da5e8841b0e64f1525a99ad73ea8b9caa331bc271d69646e2e1e749fd634321f3df9d126070208ddac22a27ccf070566b2efb74fecd99 + checksum: 10c0/5b7bf923b738fbe3ad6c33b260e0a7451be288edfe4ef516303fa787a1870cd87533bfbf61abb779c22ed003c2fc484dec2436fe75a48756f686c0241173d364 languageName: node linkType: hard "@babel/plugin-transform-private-property-in-object@npm:^7.23.4, @babel/plugin-transform-private-property-in-object@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-private-property-in-object@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-private-property-in-object@npm:7.24.7" dependencies: - "@babel/helper-annotate-as-pure": "npm:^7.22.5" - "@babel/helper-create-class-features-plugin": "npm:^7.24.1" - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-annotate-as-pure": "npm:^7.24.7" + "@babel/helper-create-class-features-plugin": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" "@babel/plugin-syntax-private-property-in-object": "npm:^7.14.5" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/33d2b9737de7667d7a1b704eef99bfecc6736157d9ea28c2e09010d5f25e33ff841c41d89a4430c5d47f4eb3384e24770fa0ec79600e1e38d6d16e2f9333b4b5 + checksum: 10c0/c6fa7defb90b1b0ed46f24ff94ff2e77f44c1f478d1090e81712f33cf992dda5ba347016f030082a2f770138bac6f4a9c2c1565e9f767a125901c77dd9c239ba languageName: node linkType: hard "@babel/plugin-transform-property-literals@npm:^7.23.3, @babel/plugin-transform-property-literals@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-property-literals@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-property-literals@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/3bf3e01f7bb8215a8b6d0081b6f86fea23e3a4543b619e059a264ede028bc58cdfb0acb2c43271271915a74917effa547bc280ac636a9901fa9f2fb45623f87e + checksum: 10c0/52564b58f3d111dc02d241d5892a4b01512e98dfdf6ef11b0ed62f8b11b0acacccef0fc229b44114fe8d1a57a8b70780b11bdd18b807d3754a781a07d8f57433 languageName: node linkType: hard @@ -1987,25 +1761,25 @@ __metadata: linkType: hard "@babel/plugin-transform-regenerator@npm:^7.23.3, @babel/plugin-transform-regenerator@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-regenerator@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-regenerator@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" regenerator-transform: "npm:^0.15.2" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/0a333585d7c0b38d31cc549d0f3cf7c396d1d50b6588a307dc58325505ddd4f5446188bc536c4779431b396251801b3f32d6d8e87db8274bc84e8c41950737f7 + checksum: 10c0/d2dc2c788fdae9d97217e70d46ba8ca9db0035c398dc3e161552b0c437113719a75c04f201f9c91ddc8d28a1da60d0b0853f616dead98a396abb9c845c44892b languageName: node linkType: hard "@babel/plugin-transform-reserved-words@npm:^7.23.3, @babel/plugin-transform-reserved-words@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-reserved-words@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-reserved-words@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/936d6e73cafb2cbb495f6817c6f8463288dbc9ab3c44684b931ebc1ece24f0d55dfabc1a75ba1de5b48843d0fef448dcfdbecb8485e4014f8f41d0d1440c536f + checksum: 10c0/2229de2768615e7f5dc0bbc55bc121b5678fd6d2febd46c74a58e42bb894d74cd5955c805880f4e02d0e1cf94f6886270eda7fafc1be9305a1ec3b9fd1d063f5 languageName: node linkType: hard @@ -2042,119 +1816,119 @@ __metadata: linkType: hard "@babel/plugin-transform-shorthand-properties@npm:^7.23.3, @babel/plugin-transform-shorthand-properties@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-shorthand-properties@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-shorthand-properties@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/8273347621183aada3cf1f3019d8d5f29467ba13a75b72cb405bc7f23b7e05fd85f4edb1e4d9f0103153dddb61826a42dc24d466480d707f8932c1923a4c25fa + checksum: 10c0/41b155bdbb3be66618358488bf7731b3b2e8fff2de3dbfd541847720a9debfcec14db06a117abedd03c9cd786db20a79e2a86509a4f19513f6e1b610520905cf languageName: node linkType: hard "@babel/plugin-transform-spread@npm:^7.23.3, @babel/plugin-transform-spread@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-spread@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-spread@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" - "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.22.5" + "@babel/helper-plugin-utils": "npm:^7.24.7" + "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/50a0302e344546d57e5c9f4dea575f88e084352eeac4e9a3e238c41739eef2df1daf4a7ebbb3ccb7acd3447f6a5ce9938405f98bf5f5583deceb8257f5a673c9 + checksum: 10c0/facba1553035f76b0d2930d4ada89a8cd0f45b79579afd35baefbfaf12e3b86096995f4b0c402cf9ee23b3f2ea0a4460c3b1ec0c192d340962c948bb223d4e66 languageName: node linkType: hard "@babel/plugin-transform-sticky-regex@npm:^7.23.3, @babel/plugin-transform-sticky-regex@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-sticky-regex@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-sticky-regex@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/786fe2ae11ef9046b9fa95677935abe495031eebf1274ad03f2054a20adea7b9dbd00336ac0b143f7924bc562e5e09793f6e8613607674b97e067d4838ccc4a0 + checksum: 10c0/5a74ed2ed0a3ab51c3d15fcaf09d9e2fe915823535c7a4d7b019813177d559b69677090e189ec3d5d08b619483eb5ad371fbcfbbff5ace2a76ba33ee566a1109 languageName: node linkType: hard "@babel/plugin-transform-template-literals@npm:^7.23.3, @babel/plugin-transform-template-literals@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-template-literals@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-template-literals@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/f73bcda5488eb81c6e7a876498d9e6b72be32fca5a4d9db9053491a2d1300cd27b889b463fd2558f3cd5826a85ed00f61d81b234aa55cb5a0abf1b6fa1bd5026 + checksum: 10c0/3630f966257bcace122f04d3157416a09d40768c44c3a800855da81146b009187daa21859d1c3b7d13f4e19e8888e60613964b175b2275d451200fb6d8d6cfe6 languageName: node linkType: hard "@babel/plugin-transform-typeof-symbol@npm:^7.23.3, @babel/plugin-transform-typeof-symbol@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-typeof-symbol@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-typeof-symbol@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/d392f549bfd13414f59feecdf3fb286f266a3eb9107a9de818e57907bda56eed08d1f6f8e314d09bf99252df026a7fd4d5df839acd45078a777abcebaa9a8593 + checksum: 10c0/5649e7260a138681e68b296ab5931e2b1f132f287d6b4131d49b24f9dc20d62902b7e9d63c4d2decd5683b41df35ef4b9b03f58c7f9f65e4c25a6d8bbf04e9e9 languageName: node linkType: hard "@babel/plugin-transform-typescript@npm:^7.13.0, @babel/plugin-transform-typescript@npm:^7.24.1": - version: 7.24.4 - resolution: "@babel/plugin-transform-typescript@npm:7.24.4" + version: 7.24.7 + resolution: "@babel/plugin-transform-typescript@npm:7.24.7" dependencies: - "@babel/helper-annotate-as-pure": "npm:^7.22.5" - "@babel/helper-create-class-features-plugin": "npm:^7.24.4" - "@babel/helper-plugin-utils": "npm:^7.24.0" - "@babel/plugin-syntax-typescript": "npm:^7.24.1" + "@babel/helper-annotate-as-pure": "npm:^7.24.7" + "@babel/helper-create-class-features-plugin": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" + "@babel/plugin-syntax-typescript": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/fa6625046f219cdc75061025c8031ada75ef631b137f1442e3d0054ba4e63548eb12cf55e2e1f442c889aa5fdd76d0d0b7904fdf812ce4c38748446227acc798 + checksum: 10c0/e8dacdc153a4c4599014b66eb01b94e3dc933d58d4f0cc3039c1a8f432e77b9df14f34a61964e014b975bf466f3fefd8c4768b3e887d3da1be9dc942799bdfdf languageName: node linkType: hard "@babel/plugin-transform-unicode-escapes@npm:^7.23.3, @babel/plugin-transform-unicode-escapes@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-unicode-escapes@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-unicode-escapes@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/67a72a1ed99639de6a93aead35b1993cb3f0eb178a8991fcef48732c38c9f0279c85bbe1e2e2477b85afea873e738ff0955a35057635ce67bc149038e2d8a28e + checksum: 10c0/8b18e2e66af33471a6971289492beff5c240e56727331db1d34c4338a6a368a82a7ed6d57ec911001b6d65643aed76531e1e7cac93265fb3fb2717f54d845e69 languageName: node linkType: hard "@babel/plugin-transform-unicode-property-regex@npm:^7.23.3, @babel/plugin-transform-unicode-property-regex@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-unicode-property-regex@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-unicode-property-regex@npm:7.24.7" dependencies: - "@babel/helper-create-regexp-features-plugin": "npm:^7.22.15" - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-create-regexp-features-plugin": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/d9d9752df7d51bf9357c0bf3762fe16b8c841fca9ecf4409a16f15ccc34be06e8e71abfaee1251b7d451227e70e6b873b36f86b090efdb20f6f7de5fdb6c7a05 + checksum: 10c0/bc57656eb94584d1b74a385d378818ac2b3fca642e3f649fead8da5fb3f9de22f8461185936915dfb33d5a9104e62e7a47828331248b09d28bb2d59e9276de3e languageName: node linkType: hard "@babel/plugin-transform-unicode-regex@npm:^7.23.3, @babel/plugin-transform-unicode-regex@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-unicode-regex@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-unicode-regex@npm:7.24.7" dependencies: - "@babel/helper-create-regexp-features-plugin": "npm:^7.22.15" - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-create-regexp-features-plugin": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/6046ab38e5d14ed97dbb921bd79ac1d7ad9d3286da44a48930e980b16896db2df21e093563ec3c916a630dc346639bf47c5924a33902a06fe3bbb5cdc7ef5f2f + checksum: 10c0/83f72a345b751566b601dc4d07e9f2c8f1bc0e0c6f7abb56ceb3095b3c9d304de73f85f2f477a09f8cc7edd5e65afd0ff9e376cdbcbea33bc0c28f3705b38fd9 languageName: node linkType: hard "@babel/plugin-transform-unicode-sets-regex@npm:^7.23.3, @babel/plugin-transform-unicode-sets-regex@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-unicode-sets-regex@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/plugin-transform-unicode-sets-regex@npm:7.24.7" dependencies: - "@babel/helper-create-regexp-features-plugin": "npm:^7.22.15" - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-create-regexp-features-plugin": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0 - checksum: 10c0/b6c1f6b90afeeddf97e5713f72575787fcb7179be7b4c961869bfbc66915f66540dc49da93e4369da15596bd44b896d1eb8a50f5e1fd907abd7a1a625901006b + checksum: 10c0/7457c0ee8e80a80cb6fdc1fe54ab115b52815627616ce9151be8ef292fc99d04a910ec24f11382b4f124b89374264396892b086886bd2a9c2317904d87c9b21b languageName: node linkType: hard @@ -2502,25 +2276,7 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.1.6, @babel/traverse@npm:^7.16.0, @babel/traverse@npm:^7.18.9, @babel/traverse@npm:^7.23.9, @babel/traverse@npm:^7.24.0, @babel/traverse@npm:^7.24.1, @babel/traverse@npm:^7.4.5": - version: 7.24.1 - resolution: "@babel/traverse@npm:7.24.1" - dependencies: - "@babel/code-frame": "npm:^7.24.1" - "@babel/generator": "npm:^7.24.1" - "@babel/helper-environment-visitor": "npm:^7.22.20" - "@babel/helper-function-name": "npm:^7.23.0" - "@babel/helper-hoist-variables": "npm:^7.22.5" - "@babel/helper-split-export-declaration": "npm:^7.22.6" - "@babel/parser": "npm:^7.24.1" - "@babel/types": "npm:^7.24.0" - debug: "npm:^4.3.1" - globals: "npm:^11.1.0" - checksum: 10c0/c087b918f6823776537ba246136c70e7ce0719fc05361ebcbfd16f4e6f2f6f1f8f4f9167f1d9b675f27d12074839605189cc9d689de20b89a85e7c140f23daab - languageName: node - linkType: hard - -"@babel/traverse@npm:^7.22.5, @babel/traverse@npm:^7.25.2": +"@babel/traverse@npm:^7.1.6, @babel/traverse@npm:^7.16.0, @babel/traverse@npm:^7.18.9, @babel/traverse@npm:^7.22.5, @babel/traverse@npm:^7.23.9, @babel/traverse@npm:^7.24.0, @babel/traverse@npm:^7.24.1, @babel/traverse@npm:^7.24.7, @babel/traverse@npm:^7.25.2, @babel/traverse@npm:^7.4.5": version: 7.25.3 resolution: "@babel/traverse@npm:7.25.3" dependencies: @@ -2535,24 +2291,6 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.24.7": - version: 7.24.7 - resolution: "@babel/traverse@npm:7.24.7" - dependencies: - "@babel/code-frame": "npm:^7.24.7" - "@babel/generator": "npm:^7.24.7" - "@babel/helper-environment-visitor": "npm:^7.24.7" - "@babel/helper-function-name": "npm:^7.24.7" - "@babel/helper-hoist-variables": "npm:^7.24.7" - "@babel/helper-split-export-declaration": "npm:^7.24.7" - "@babel/parser": "npm:^7.24.7" - "@babel/types": "npm:^7.24.7" - debug: "npm:^4.3.1" - globals: "npm:^11.1.0" - checksum: 10c0/a5135e589c3f1972b8877805f50a084a04865ccb1d68e5e1f3b94a8841b3485da4142e33413d8fd76bc0e6444531d3adf1f59f359c11ffac452b743d835068ab - languageName: node - linkType: hard - "@babel/types@npm:7.17.0": version: 7.17.0 resolution: "@babel/types@npm:7.17.0" @@ -2563,18 +2301,7 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.11.5, @babel/types@npm:^7.18.9, @babel/types@npm:^7.2.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.22.5, @babel/types@npm:^7.23.4, @babel/types@npm:^7.23.6, @babel/types@npm:^7.23.9, @babel/types@npm:^7.24.0, @babel/types@npm:^7.24.7, @babel/types@npm:^7.4.4, @babel/types@npm:^7.6.1, @babel/types@npm:^7.7.2, @babel/types@npm:^7.8.3, @babel/types@npm:^7.9.6": - version: 7.24.7 - resolution: "@babel/types@npm:7.24.7" - dependencies: - "@babel/helper-string-parser": "npm:^7.24.7" - "@babel/helper-validator-identifier": "npm:^7.24.7" - to-fast-properties: "npm:^2.0.0" - checksum: 10c0/d9ecbfc3eb2b05fb1e6eeea546836ac30d990f395ef3fe3f75ced777a222c3cfc4489492f72e0ce3d9a5a28860a1ce5f81e66b88cf5088909068b3ff4fab72c1 - languageName: node - linkType: hard - -"@babel/types@npm:^7.17.0, @babel/types@npm:^7.25.0, @babel/types@npm:^7.25.2": +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.11.5, @babel/types@npm:^7.17.0, @babel/types@npm:^7.18.9, @babel/types@npm:^7.2.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.22.5, @babel/types@npm:^7.23.0, @babel/types@npm:^7.23.4, @babel/types@npm:^7.23.6, @babel/types@npm:^7.23.9, @babel/types@npm:^7.24.0, @babel/types@npm:^7.24.7, @babel/types@npm:^7.25.0, @babel/types@npm:^7.25.2, @babel/types@npm:^7.4.4, @babel/types@npm:^7.6.1, @babel/types@npm:^7.7.2, @babel/types@npm:^7.9.6": version: 7.25.2 resolution: "@babel/types@npm:7.25.2" dependencies: @@ -2585,17 +2312,6 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.22.15, @babel/types@npm:^7.23.0": - version: 7.24.0 - resolution: "@babel/types@npm:7.24.0" - dependencies: - "@babel/helper-string-parser": "npm:^7.23.4" - "@babel/helper-validator-identifier": "npm:^7.22.20" - to-fast-properties: "npm:^2.0.0" - checksum: 10c0/777a0bb5dbe038ca4c905fdafb1cdb6bdd10fe9d63ce13eca0bd91909363cbad554a53dc1f902004b78c1dcbc742056f877f2c99eeedff647333b1fadf51235d - languageName: node - linkType: hard - "@base2/pretty-print-object@npm:1.0.1": version: 1.0.1 resolution: "@base2/pretty-print-object@npm:1.0.1" @@ -6627,7 +6343,7 @@ __metadata: languageName: unknown linkType: soft -"@storybook/icons@npm:^1.2.10": +"@storybook/icons@npm:^1.2.10, @storybook/icons@npm:^1.2.5": version: 1.2.10 resolution: "@storybook/icons@npm:1.2.10" peerDependencies: @@ -6637,16 +6353,6 @@ __metadata: languageName: node linkType: hard -"@storybook/icons@npm:^1.2.5": - version: 1.2.5 - resolution: "@storybook/icons@npm:1.2.5" - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: 10c0/089622af6de4ab82624d894fbe43688a0eb72f15e6bb8fc19c54fb9f9d7312ce7caf34acebcbd63319dbaef129d8547bc23a5600955d04f6034355e7d82dcfa1 - languageName: node - linkType: hard - "@storybook/instrumenter@workspace:*, @storybook/instrumenter@workspace:lib/instrumenter": version: 0.0.0-use.local resolution: "@storybook/instrumenter@workspace:lib/instrumenter" @@ -9893,16 +9599,7 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.0.0, acorn@npm:^8.10.0, acorn@npm:^8.11.2, acorn@npm:^8.11.3, acorn@npm:^8.4.1, acorn@npm:^8.6.0, acorn@npm:^8.7.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0": - version: 8.11.3 - resolution: "acorn@npm:8.11.3" - bin: - acorn: bin/acorn - checksum: 10c0/3ff155f8812e4a746fee8ecff1f227d527c4c45655bb1fad6347c3cb58e46190598217551b1500f18542d2bbe5c87120cb6927f5a074a59166fbdd9468f0a299 - languageName: node - linkType: hard - -"acorn@npm:^8.12.1": +"acorn@npm:^8.0.0, acorn@npm:^8.10.0, acorn@npm:^8.11.2, acorn@npm:^8.11.3, acorn@npm:^8.12.1, acorn@npm:^8.4.1, acorn@npm:^8.6.0, acorn@npm:^8.7.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0": version: 8.12.1 resolution: "acorn@npm:8.12.1" bin: @@ -10590,7 +10287,7 @@ __metadata: languageName: node linkType: hard -"available-typed-arrays@npm:^1.0.6, available-typed-arrays@npm:^1.0.7": +"available-typed-arrays@npm:^1.0.7": version: 1.0.7 resolution: "available-typed-arrays@npm:1.0.7" dependencies: @@ -11140,16 +10837,7 @@ __metadata: languageName: node linkType: hard -"braces@npm:^3.0.2, braces@npm:~3.0.2": - version: 3.0.2 - resolution: "braces@npm:3.0.2" - dependencies: - fill-range: "npm:^7.0.1" - checksum: 10c0/321b4d675791479293264019156ca322163f02dc06e3c4cab33bb15cd43d80b51efef69b0930cfde3acd63d126ebca24cd0544fa6f261e093a0fb41ab9dda381 - languageName: node - linkType: hard - -"braces@npm:^3.0.3": +"braces@npm:^3.0.2, braces@npm:^3.0.3, braces@npm:~3.0.2": version: 3.0.3 resolution: "braces@npm:3.0.3" dependencies: @@ -15594,15 +15282,6 @@ __metadata: languageName: node linkType: hard -"fill-range@npm:^7.0.1": - version: 7.0.1 - resolution: "fill-range@npm:7.0.1" - dependencies: - to-regex-range: "npm:^5.0.1" - checksum: 10c0/7cdad7d426ffbaadf45aeb5d15ec675bbd77f7597ad5399e3d2766987ed20bda24d5fac64b3ee79d93276f5865608bb22344a26b9b1ae6c4d00bd94bf611623f - languageName: node - linkType: hard - "fill-range@npm:^7.1.1": version: 7.1.1 resolution: "fill-range@npm:7.1.1" @@ -16822,7 +16501,7 @@ __metadata: languageName: node linkType: hard -"has-tostringtag@npm:^1.0.0, has-tostringtag@npm:^1.0.1, has-tostringtag@npm:^1.0.2": +"has-tostringtag@npm:^1.0.0, has-tostringtag@npm:^1.0.2": version: 1.0.2 resolution: "has-tostringtag@npm:1.0.2" dependencies: @@ -23431,11 +23110,11 @@ __metadata: linkType: hard "prettier@npm:*, prettier@npm:^3.1.1, prettier@npm:^3.2.5": - version: 3.2.5 - resolution: "prettier@npm:3.2.5" + version: 3.3.3 + resolution: "prettier@npm:3.3.3" bin: prettier: bin/prettier.cjs - checksum: 10c0/ea327f37a7d46f2324a34ad35292af2ad4c4c3c3355da07313339d7e554320f66f65f91e856add8530157a733c6c4a897dc41b577056be5c24c40f739f5ee8c6 + checksum: 10c0/b85828b08e7505716324e4245549b9205c0cacb25342a030ba8885aba2039a115dbcf75a0b7ca3b37bc9d101ee61fab8113fc69ca3359f2a226f1ecc07ad2e26 languageName: node linkType: hard @@ -29580,20 +29259,7 @@ __metadata: languageName: node linkType: hard -"which-typed-array@npm:^1.1.14, which-typed-array@npm:^1.1.2, which-typed-array@npm:^1.1.9": - version: 1.1.14 - resolution: "which-typed-array@npm:1.1.14" - dependencies: - available-typed-arrays: "npm:^1.0.6" - call-bind: "npm:^1.0.5" - for-each: "npm:^0.3.3" - gopd: "npm:^1.0.1" - has-tostringtag: "npm:^1.0.1" - checksum: 10c0/0960f1e77807058819451b98c51d4cd72031593e8de990b24bd3fc22e176f5eee22921d68d852297c786aec117689f0423ed20aa4fde7ce2704d680677891f56 - languageName: node - linkType: hard - -"which-typed-array@npm:^1.1.15": +"which-typed-array@npm:^1.1.14, which-typed-array@npm:^1.1.15, which-typed-array@npm:^1.1.2, which-typed-array@npm:^1.1.9": version: 1.1.15 resolution: "which-typed-array@npm:1.1.15" dependencies: @@ -29779,22 +29445,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:^8.13.0, ws@npm:^8.2.3": - version: 8.16.0 - resolution: "ws@npm:8.16.0" - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ">=5.0.2" - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - checksum: 10c0/a7783bb421c648b1e622b423409cb2a58ac5839521d2f689e84bc9dc41d59379c692dd405b15a997ea1d4c0c2e5314ad707332d0c558f15232d2bc07c0b4618a - languageName: node - linkType: hard - -"ws@npm:^8.18.0": +"ws@npm:^8.13.0, ws@npm:^8.18.0, ws@npm:^8.2.3": version: 8.18.0 resolution: "ws@npm:8.18.0" peerDependencies: From 6c3a0bb1eee028f7a5fccc86194ac333a36f0280 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Mon, 7 Oct 2024 21:58:32 +0200 Subject: [PATCH 39/64] fix formatting --- code/core/src/common/js-package-manager/JsPackageManager.ts | 2 +- .../src/preview-api/modules/store/csf/portable-stories.ts | 2 +- code/e2e-tests/util.ts | 2 +- code/frameworks/angular/src/server/angular-cli-webpack.js | 2 +- code/frameworks/vue3-vite/src/preset.ts | 2 +- .../cli-storybook/src/automigrate/helpers/mainConfigFile.ts | 4 +++- .../src/automigrate/helpers/new-frameworks-utils.ts | 4 ++-- code/lib/cli-storybook/src/automigrate/index.ts | 2 +- code/lib/codemod/src/transforms/__tests__/mdx-to-csf.test.ts | 2 +- code/renderers/vue3/src/docs/extractArgTypes.ts | 2 +- 10 files changed, 13 insertions(+), 11 deletions(-) diff --git a/code/core/src/common/js-package-manager/JsPackageManager.ts b/code/core/src/common/js-package-manager/JsPackageManager.ts index cf42d73d2a22..21f870852d4d 100644 --- a/code/core/src/common/js-package-manager/JsPackageManager.ts +++ b/code/core/src/common/js-package-manager/JsPackageManager.ts @@ -60,7 +60,7 @@ export abstract class JsPackageManager { /** Get the INSTALLED version of a package from the package.json file */ async getPackageVersion(packageName: string, basePath = this.cwd): Promise { const packageJSON = await this.getPackageJSON(packageName, basePath); - return packageJSON ? packageJSON.version ?? null : null; + return packageJSON ? (packageJSON.version ?? null) : null; } constructor(options?: JsPackageManagerOptions) { diff --git a/code/core/src/preview-api/modules/store/csf/portable-stories.ts b/code/core/src/preview-api/modules/store/csf/portable-stories.ts index fd50bd57c2dd..2ae9143a1a5d 100644 --- a/code/core/src/preview-api/modules/store/csf/portable-stories.ts +++ b/code/core/src/preview-api/modules/store/csf/portable-stories.ts @@ -126,7 +126,7 @@ export function composeStory 0 ? defaultConfig - : globalThis.defaultProjectAnnotations ?? {}, + : (globalThis.defaultProjectAnnotations ?? {}), globalThis.globalProjectAnnotations ?? {}, projectAnnotations ?? {}, ]) diff --git a/code/e2e-tests/util.ts b/code/e2e-tests/util.ts index 00122ef595d2..2137386c6675 100644 --- a/code/e2e-tests/util.ts +++ b/code/e2e-tests/util.ts @@ -49,7 +49,7 @@ export class SbPage { await this.page.waitForURL((url) => url.search.includes( - `path=/${viewMode ?? name === 'docs' ? 'docs' : 'story'}/${titleId}--${storyId}` + `path=/${(viewMode ?? name === 'docs') ? 'docs' : 'story'}/${titleId}--${storyId}` ) ); diff --git a/code/frameworks/angular/src/server/angular-cli-webpack.js b/code/frameworks/angular/src/server/angular-cli-webpack.js index 92ed6225d19f..6be86712e5bc 100644 --- a/code/frameworks/angular/src/server/angular-cli-webpack.js +++ b/code/frameworks/angular/src/server/angular-cli-webpack.js @@ -68,7 +68,7 @@ exports.getWebpackConfig = async (baseConfig, { builderOptions, builderContext } outputPath: typeof builderOptions.outputPath === 'string' ? builderOptions.outputPath - : builderOptions.outputPath?.base ?? 'noop-out', + : (builderOptions.outputPath?.base ?? 'noop-out'), // Fixed options optimization: false, diff --git a/code/frameworks/vue3-vite/src/preset.ts b/code/frameworks/vue3-vite/src/preset.ts index 574ab0a04ad3..8bbaf394d442 100644 --- a/code/frameworks/vue3-vite/src/preset.ts +++ b/code/frameworks/vue3-vite/src/preset.ts @@ -22,7 +22,7 @@ export const viteFinal: StorybookConfig['viteFinal'] = async (config, options) = const framework = await options.presets.apply('framework'); const frameworkOptions: FrameworkOptions = - typeof framework === 'string' ? {} : framework.options ?? {}; + typeof framework === 'string' ? {} : (framework.options ?? {}); const docgen = resolveDocgenOptions(frameworkOptions.docgen); diff --git a/code/lib/cli-storybook/src/automigrate/helpers/mainConfigFile.ts b/code/lib/cli-storybook/src/automigrate/helpers/mainConfigFile.ts index 492a91e5ff7d..57aa4bf7ce07 100644 --- a/code/lib/cli-storybook/src/automigrate/helpers/mainConfigFile.ts +++ b/code/lib/cli-storybook/src/automigrate/helpers/mainConfigFile.ts @@ -94,7 +94,9 @@ export const getBuilderPackageName = (mainConfig?: StorybookConfigRaw) => { export const getFrameworkOptions = ( mainConfig?: StorybookConfigRaw ): Record | null => { - return typeof mainConfig?.framework === 'string' ? null : mainConfig?.framework?.options ?? null; + return typeof mainConfig?.framework === 'string' + ? null + : (mainConfig?.framework?.options ?? null); }; /** diff --git a/code/lib/cli-storybook/src/automigrate/helpers/new-frameworks-utils.ts b/code/lib/cli-storybook/src/automigrate/helpers/new-frameworks-utils.ts index a4ab6ee34a4f..280bb2cf5034 100644 --- a/code/lib/cli-storybook/src/automigrate/helpers/new-frameworks-utils.ts +++ b/code/lib/cli-storybook/src/automigrate/helpers/new-frameworks-utils.ts @@ -77,14 +77,14 @@ export const detectBuilderInfo = async ({ const builderPackageName = getBuilderPackageName(mainConfig); const frameworkPackageName = getFrameworkPackageName(mainConfig) as string; - let builderOptions = typeof builder !== 'string' ? builder?.options ?? {} : {}; + let builderOptions = typeof builder !== 'string' ? (builder?.options ?? {}) : {}; if (builderPackageName) { builderOrFrameworkName = builderPackageName; } else if (framework) { if (Object.keys(frameworkPackages).includes(frameworkPackageName)) { builderOrFrameworkName = frameworkPackageName; - builderOptions = typeof framework === 'object' ? framework.options?.builder ?? {} : {}; + builderOptions = typeof framework === 'object' ? (framework.options?.builder ?? {}) : {}; } } diff --git a/code/lib/cli-storybook/src/automigrate/index.ts b/code/lib/cli-storybook/src/automigrate/index.ts index 5b76b917b547..9d98d97d7013 100644 --- a/code/lib/cli-storybook/src/automigrate/index.ts +++ b/code/lib/cli-storybook/src/automigrate/index.ts @@ -275,7 +275,7 @@ export async function runFixes({ if (result) { const promptType: Prompt = - typeof f.promptType === 'function' ? await f.promptType(result) : f.promptType ?? 'auto'; + typeof f.promptType === 'function' ? await f.promptType(result) : (f.promptType ?? 'auto'); logger.info(`\n🔎 found a '${picocolors.cyan(f.id)}' migration:`); const message = f.prompt(result); diff --git a/code/lib/codemod/src/transforms/__tests__/mdx-to-csf.test.ts b/code/lib/codemod/src/transforms/__tests__/mdx-to-csf.test.ts index 304fb0c40b05..6d41995d3e82 100644 --- a/code/lib/codemod/src/transforms/__tests__/mdx-to-csf.test.ts +++ b/code/lib/codemod/src/transforms/__tests__/mdx-to-csf.test.ts @@ -7,7 +7,7 @@ import { dedent } from 'ts-dedent'; import jscodeshift, { nameToValidExport } from '../mdx-to-csf'; expect.addSnapshotSerializer({ - print: (val: any) => (typeof val === 'string' ? val : JSON.stringify(val, null, 2) ?? ''), + print: (val: any) => (typeof val === 'string' ? val : (JSON.stringify(val, null, 2) ?? '')), test: () => true, }); diff --git a/code/renderers/vue3/src/docs/extractArgTypes.ts b/code/renderers/vue3/src/docs/extractArgTypes.ts index 7e76c731177f..f52f21c15255 100644 --- a/code/renderers/vue3/src/docs/extractArgTypes.ts +++ b/code/renderers/vue3/src/docs/extractArgTypes.ts @@ -129,7 +129,7 @@ export const extractFromVueDocgenApi = ( } } - const required = 'required' in docgenInfo ? docgenInfo.required ?? false : false; + const required = 'required' in docgenInfo ? (docgenInfo.required ?? false) : false; return { name: docgenInfo.name, From 4c861a2f7337ae56543f7e274282d2b896aa7b01 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Tue, 8 Oct 2024 10:07:12 +0800 Subject: [PATCH 40/64] Docs: Add streamlined a11y setup docs --- ...-a11y-install.md => storybook-a11y-add.md} | 7 ++--- docs/_snippets/storybook-a11y-register.md | 28 ------------------- docs/writing-tests/accessibility-testing.mdx | 14 ++-------- 3 files changed, 5 insertions(+), 44 deletions(-) rename docs/_snippets/{storybook-a11y-install.md => storybook-a11y-add.md} (61%) delete mode 100644 docs/_snippets/storybook-a11y-register.md diff --git a/docs/_snippets/storybook-a11y-install.md b/docs/_snippets/storybook-a11y-add.md similarity index 61% rename from docs/_snippets/storybook-a11y-install.md rename to docs/_snippets/storybook-a11y-add.md index 066faccd6c8f..813c19114eba 100644 --- a/docs/_snippets/storybook-a11y-install.md +++ b/docs/_snippets/storybook-a11y-add.md @@ -1,12 +1,11 @@ ```shell renderer="common" language="js" packageManager="npm" -npm install @storybook/addon-a11y --save-dev +npx storybook add @storybook/addon-a11y ``` ```shell renderer="common" language="js" packageManager="pnpm" -pnpm add --save-dev @storybook/addon-a11y +pnpx storybook add @storybook/addon-a11y ``` ```shell renderer="common" language="js" packageManager="yarn" -yarn add --dev @storybook/addon-a11y +yarn dlx storybook add @storybook/addon-a11y ``` - diff --git a/docs/_snippets/storybook-a11y-register.md b/docs/_snippets/storybook-a11y-register.md deleted file mode 100644 index e29f5c9bde9e..000000000000 --- a/docs/_snippets/storybook-a11y-register.md +++ /dev/null @@ -1,28 +0,0 @@ -```js filename=".storybook/main.js" renderer="common" language="js" -export default { - // Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-vite) - framework: '@storybook/your-framework', - stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], - addons: [ - // Other Storybook addons - '@storybook/addon-a11y', //👈 The a11y addon goes here - ], -}; -``` - -```ts filename=".storybook/main.ts" renderer="common" language="ts" -// Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-vite) -import type { StorybookConfig } from '@storybook/your-framework'; - -const config: StorybookConfig = { - framework: '@storybook/your-framework', - stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], - addons: [ - // Other Storybook addons - '@storybook/addon-a11y', //👈 The a11y addon goes here - ], -}; - -export default config; -``` - diff --git a/docs/writing-tests/accessibility-testing.mdx b/docs/writing-tests/accessibility-testing.mdx index faa147e958c6..500f28efd33d 100644 --- a/docs/writing-tests/accessibility-testing.mdx +++ b/docs/writing-tests/accessibility-testing.mdx @@ -19,21 +19,11 @@ Storybook provides an official [a11y addon](https://storybook.js.org/addons/@sto ### Set up the a11y addon -If you want to check accessibility for your stories using the [addon](https://storybook.js.org/addons/@storybook/addon-a11y/), you'll need to install it and add it to your Storybook. - -Run the following command to install the addon. - -{/* prettier-ignore-start */} - - - -{/* prettier-ignore-end */} - -Update your Storybook configuration (in `.storybook/main.js|ts`) to include the accessibility addon. +If you want to check accessibility for your stories using the [addon](https://storybook.js.org/addons/@storybook/addon-a11y/), you'll need to add it to your Storybook. {/* prettier-ignore-start */} - + {/* prettier-ignore-end */} From 7a31e6d7fa966a57f7e8ebc437e076fc4f8a1011 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 8 Oct 2024 11:06:01 +0200 Subject: [PATCH 41/64] prebundle all of renderer-react --- code/renderers/react/package.json | 24 +++++++++---------- .../defaultValues/createFromRawDefaultProp.ts | 6 ++++- code/yarn.lock | 2 -- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/code/renderers/react/package.json b/code/renderers/react/package.json index c4e9a05207f4..1d08836c1ee7 100644 --- a/code/renderers/react/package.json +++ b/code/renderers/react/package.json @@ -67,31 +67,29 @@ "@storybook/manager-api": "workspace:^", "@storybook/preview-api": "workspace:^", "@storybook/react-dom-shim": "workspace:*", - "@storybook/theming": "workspace:^", + "@storybook/theming": "workspace:^" + }, + "devDependencies": { + "@storybook/test": "workspace:*", + "@types/babel-plugin-react-docgen": "^4", "@types/escodegen": "^0.0.6", "@types/estree": "^0.0.51", "@types/node": "^22.0.0", + "@types/semver": "^7.3.4", "acorn": "^7.4.1", "acorn-jsx": "^5.3.1", "acorn-walk": "^7.2.0", + "babel-plugin-react-docgen": "^4.2.1", + "es-toolkit": "^1.21.0", "escodegen": "^2.1.0", + "expect-type": "^0.15.0", "html-tags": "^3.1.0", "prop-types": "^15.7.2", "react-element-to-jsx-string": "^15.0.0", + "require-from-string": "^2.0.2", "semver": "^7.3.7", "ts-dedent": "^2.0.0", - "type-fest": "~2.19", - "util-deprecate": "^1.0.2" - }, - "devDependencies": { - "@storybook/test": "workspace:*", - "@types/babel-plugin-react-docgen": "^4", - "@types/semver": "^7.3.4", - "@types/util-deprecate": "^1.0.0", - "babel-plugin-react-docgen": "^4.2.1", - "es-toolkit": "^1.21.0", - "expect-type": "^0.15.0", - "require-from-string": "^2.0.2" + "type-fest": "~2.19" }, "peerDependencies": { "@storybook/test": "workspace:*", diff --git a/code/renderers/react/src/docs/lib/defaultValues/createFromRawDefaultProp.ts b/code/renderers/react/src/docs/lib/defaultValues/createFromRawDefaultProp.ts index 96b052a07dda..7ed6c8df098c 100644 --- a/code/renderers/react/src/docs/lib/defaultValues/createFromRawDefaultProp.ts +++ b/code/renderers/react/src/docs/lib/defaultValues/createFromRawDefaultProp.ts @@ -7,7 +7,9 @@ import { } from 'storybook/internal/docs-tools'; import { isFunction, isPlainObject, isString } from 'es-toolkit/compat'; -import reactElementToJSXString from 'react-element-to-jsx-string'; +import type reactElementToJSXStringType from 'react-element-to-jsx-string'; +// @ts-expect-error (this is needed, because our bundling prefers the `browser` field, but that yields CJS) +import reactElementToJSXStringRaw from 'react-element-to-jsx-string/dist/esm/index.js'; import { ELEMENT_CAPTION, FUNCTION_CAPTION, OBJECT_CAPTION } from '../captions'; import type { InspectionFunction } from '../inspection'; @@ -17,6 +19,8 @@ import { generateArray } from './generateArray'; import { generateObject } from './generateObject'; import { getPrettyElementIdentifier, getPrettyFuncIdentifier } from './prettyIdentifier'; +const reactElementToJSXString = reactElementToJSXStringRaw as typeof reactElementToJSXStringType; + export type TypeResolver = (rawDefaultProp: any, propDef: PropDef) => PropDefaultValue; export interface TypeResolvers { diff --git a/code/yarn.lock b/code/yarn.lock index 4aecd7c714c8..d1be669a4fce 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -6755,7 +6755,6 @@ __metadata: "@types/estree": "npm:^0.0.51" "@types/node": "npm:^22.0.0" "@types/semver": "npm:^7.3.4" - "@types/util-deprecate": "npm:^1.0.0" acorn: "npm:^7.4.1" acorn-jsx: "npm:^5.3.1" acorn-walk: "npm:^7.2.0" @@ -6770,7 +6769,6 @@ __metadata: semver: "npm:^7.3.7" ts-dedent: "npm:^2.0.0" type-fest: "npm:~2.19" - util-deprecate: "npm:^1.0.2" peerDependencies: "@storybook/test": "workspace:*" react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta From e5d0c423e914e058ee9d178a5325acf02d2d333d Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 8 Oct 2024 11:18:14 +0200 Subject: [PATCH 42/64] add prop-types to react sandboxes as direct dep --- .../cli-storybook/src/sandbox-templates.ts | 43 ++++++++++++++++--- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/code/lib/cli-storybook/src/sandbox-templates.ts b/code/lib/cli-storybook/src/sandbox-templates.ts index f5937d53714b..86ab09d2b6a4 100644 --- a/code/lib/cli-storybook/src/sandbox-templates.ts +++ b/code/lib/cli-storybook/src/sandbox-templates.ts @@ -103,8 +103,10 @@ const baseTemplates = { renderer: '@storybook/react', builder: '@storybook/builder-webpack5', }, + skipTasks: ['e2e-tests-dev', 'bench', 'vitest-integration'], modifications: { + extraDependencies: ['prop-types'], mainConfig: (config) => { const stories = config.getFieldValue>(['stories']); return { @@ -133,6 +135,9 @@ const baseTemplates = { renderer: '@storybook/react', builder: '@storybook/builder-webpack5', }, + modifications: { + extraDependencies: ['prop-types'], + }, }, 'nextjs/13-ts': { name: 'Next.js v13.5 (Webpack | TypeScript)', @@ -147,7 +152,7 @@ const baseTemplates = { mainConfig: { features: { experimentalRSC: true }, }, - extraDependencies: ['server-only'], + extraDependencies: ['server-only', 'prop-types'], }, skipTasks: ['e2e-tests-dev', 'bench', 'vitest-integration'], }, @@ -164,7 +169,7 @@ const baseTemplates = { mainConfig: { features: { experimentalRSC: true }, }, - extraDependencies: ['server-only'], + extraDependencies: ['server-only', 'prop-types'], }, skipTasks: ['e2e-tests-dev', 'bench', 'vitest-integration'], }, @@ -181,7 +186,7 @@ const baseTemplates = { mainConfig: { features: { experimentalRSC: true }, }, - extraDependencies: ['server-only'], + extraDependencies: ['server-only', 'prop-types'], }, skipTasks: ['e2e-tests-dev', 'bench', 'vitest-integration'], }, @@ -195,7 +200,7 @@ const baseTemplates = { builder: '@storybook/builder-webpack5', }, modifications: { - extraDependencies: ['server-only'], + extraDependencies: ['server-only', 'prop-types'], mainConfig: { features: { experimentalRSC: true }, }, @@ -216,7 +221,12 @@ const baseTemplates = { framework: '@storybook/experimental-nextjs-vite', features: { experimentalRSC: true }, }, - extraDependencies: ['server-only', '@storybook/experimental-nextjs-vite', 'vite'], + extraDependencies: [ + 'server-only', + '@storybook/experimental-nextjs-vite', + 'vite', + 'prop-types', + ], }, skipTasks: ['e2e-tests-dev', 'bench'], }, @@ -228,6 +238,9 @@ const baseTemplates = { renderer: '@storybook/react', builder: '@storybook/builder-vite', }, + modifications: { + extraDependencies: ['prop-types'], + }, skipTasks: ['e2e-tests-dev', 'bench'], }, 'react-vite/default-ts': { @@ -238,6 +251,9 @@ const baseTemplates = { renderer: '@storybook/react', builder: '@storybook/builder-vite', }, + modifications: { + extraDependencies: ['prop-types'], + }, skipTasks: ['bench'], }, 'react-vite/prerelease-ts': { @@ -261,6 +277,9 @@ const baseTemplates = { renderer: '@storybook/react', builder: '@storybook/builder-vite', }, + modifications: { + extraDependencies: ['prop-types'], + }, skipTasks: ['e2e-tests-dev', 'bench'], }, 'react-webpack/18-ts': { @@ -271,6 +290,9 @@ const baseTemplates = { renderer: '@storybook/react', builder: '@storybook/builder-webpack5', }, + modifications: { + extraDependencies: ['prop-types'], + }, skipTasks: ['e2e-tests-dev', 'bench', 'vitest-integration'], }, 'react-webpack/17-ts': { @@ -282,6 +304,9 @@ const baseTemplates = { renderer: '@storybook/react', builder: '@storybook/builder-webpack5', }, + modifications: { + extraDependencies: ['prop-types'], + }, skipTasks: ['e2e-tests-dev', 'bench', 'vitest-integration'], }, 'react-webpack/prerelease-ts': { @@ -303,6 +328,9 @@ const baseTemplates = { renderer: '@storybook/react', builder: '@storybook/builder-webpack5', }, + modifications: { + extraDependencies: ['prop-types'], + }, skipTasks: ['e2e-tests-dev', 'bench', 'vitest-integration'], }, 'solid-vite/default-js': { @@ -581,7 +609,7 @@ const internalTemplates = { builder: '@storybook/builder-webpack5', }, modifications: { - extraDependencies: ['@storybook/addon-webpack5-compiler-babel'], + extraDependencies: ['@storybook/addon-webpack5-compiler-babel', 'prop-types'], editAddons: (addons) => [...addons, '@storybook/addon-webpack5-compiler-babel'].filter( (a) => a !== '@storybook/addon-webpack5-compiler-swc' @@ -599,6 +627,9 @@ const internalTemplates = { renderer: '@storybook/react', builder: '@storybook/builder-webpack5', }, + modifications: { + extraDependencies: ['prop-types'], + }, skipTasks: ['e2e-tests-dev', 'bench', 'vitest-integration'], isInternal: true, }, From cd8b7d47b8df2dcf7c10a7ec4acb7d61cd8e2724 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 8 Oct 2024 12:42:29 +0200 Subject: [PATCH 43/64] fix --- code/renderers/react/src/docs/jsxDecorator.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/renderers/react/src/docs/jsxDecorator.tsx b/code/renderers/react/src/docs/jsxDecorator.tsx index dd145b1192f7..821d9dc3dd08 100644 --- a/code/renderers/react/src/docs/jsxDecorator.tsx +++ b/code/renderers/react/src/docs/jsxDecorator.tsx @@ -8,11 +8,15 @@ import { addons, useEffect } from 'storybook/internal/preview-api'; import type { ArgsStoryFn, PartialStoryFn, StoryContext } from 'storybook/internal/types'; import type { Options } from 'react-element-to-jsx-string'; -import reactElementToJSXString from 'react-element-to-jsx-string'; +import type reactElementToJSXStringType from 'react-element-to-jsx-string'; +// @ts-expect-error (this is needed, because our bundling prefers the `browser` field, but that yields CJS) +import reactElementToJSXStringRaw from 'react-element-to-jsx-string/dist/esm/index.js'; import type { ReactRenderer } from '../types'; import { isForwardRef, isMemo } from './lib'; +const reactElementToJSXString = reactElementToJSXStringRaw as typeof reactElementToJSXStringType; + const toPascalCase = (str: string) => str.charAt(0).toUpperCase() + str.slice(1); /** From 6e32f1c2c16dd2c4eff110ca50ebbc150d5d7cfc Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:16:53 +0000 Subject: [PATCH 44/64] Write changelog for 8.4.0-alpha.5 [skip ci] --- CHANGELOG.prerelease.md | 5 +++++ code/package.json | 3 ++- docs/versions/next.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.prerelease.md b/CHANGELOG.prerelease.md index 40c0aa95376f..8c9a74c850e4 100644 --- a/CHANGELOG.prerelease.md +++ b/CHANGELOG.prerelease.md @@ -1,3 +1,8 @@ +## 8.4.0-alpha.5 + +- Core: Migrate from `express` to `polka` - [#29230](https://github.com/storybookjs/storybook/pull/29230), thanks @43081j! +- Core: Remove dependence on `file-system-cache` - [#29256](https://github.com/storybookjs/storybook/pull/29256), thanks @ndelangen! + ## 8.4.0-alpha.4 - Blocks: Prebundle `es-toolkit` - [#29259](https://github.com/storybookjs/storybook/pull/29259), thanks @JReinhold! diff --git a/code/package.json b/code/package.json index a109bbb40d02..e441ef956340 100644 --- a/code/package.json +++ b/code/package.json @@ -293,5 +293,6 @@ "Dependency Upgrades" ] ] - } + }, + "deferredNextVersion": "8.4.0-alpha.5" } diff --git a/docs/versions/next.json b/docs/versions/next.json index ab225ca861a5..d74fdfbac9b2 100644 --- a/docs/versions/next.json +++ b/docs/versions/next.json @@ -1 +1 @@ -{"version":"8.4.0-alpha.4","info":{"plain":"- Blocks: Prebundle `es-toolkit` - [#29259](https://github.com/storybookjs/storybook/pull/29259), thanks @JReinhold!\n- CLI: Update the React Native init to include v8 dependencies - [#29273](https://github.com/storybookjs/storybook/pull/29273), thanks @dannyhw!\n- Core: Upgrade `esbuild`, broadening version range - [#29254](https://github.com/storybookjs/storybook/pull/29254), thanks @ndelangen!\n- Vitest plugin: Fix renamed export stories - [#29250](https://github.com/storybookjs/storybook/pull/29250), thanks @shilman!"}} +{"version":"8.4.0-alpha.5","info":{"plain":"- Core: Migrate from `express` to `polka` - [#29230](https://github.com/storybookjs/storybook/pull/29230), thanks @43081j!\n- Core: Remove dependence on `file-system-cache` - [#29256](https://github.com/storybookjs/storybook/pull/29256), thanks @ndelangen!"}} From 54b0b3c9f9498ba4c07ef5b4ee2c090724b5d669 Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Tue, 8 Oct 2024 14:00:12 +0000 Subject: [PATCH 45/64] Bump version from "8.4.0-alpha.4" to "8.4.0-alpha.5" [skip ci] --- code/addons/a11y/package.json | 2 +- code/addons/actions/package.json | 2 +- code/addons/backgrounds/package.json | 2 +- code/addons/controls/package.json | 2 +- code/addons/docs/package.json | 2 +- code/addons/essentials/package.json | 2 +- code/addons/gfm/package.json | 2 +- code/addons/highlight/package.json | 2 +- code/addons/interactions/package.json | 2 +- code/addons/jest/package.json | 2 +- code/addons/links/package.json | 2 +- code/addons/measure/package.json | 2 +- code/addons/onboarding/package.json | 2 +- code/addons/outline/package.json | 2 +- code/addons/storysource/package.json | 2 +- code/addons/test/package.json | 2 +- code/addons/themes/package.json | 2 +- code/addons/toolbars/package.json | 2 +- code/addons/viewport/package.json | 2 +- code/builders/builder-vite/package.json | 2 +- code/builders/builder-webpack5/package.json | 2 +- code/core/package.json | 2 +- code/core/src/common/versions.ts | 168 +++++++++--------- code/core/src/manager-api/version.ts | 2 +- code/deprecated/builder-manager/package.json | 2 +- code/deprecated/channels/package.json | 2 +- code/deprecated/client-logger/package.json | 2 +- code/deprecated/components/package.json | 2 +- code/deprecated/core-common/package.json | 2 +- code/deprecated/core-events/package.json | 2 +- code/deprecated/core-server/package.json | 2 +- code/deprecated/csf-tools/package.json | 2 +- code/deprecated/docs-tools/package.json | 2 +- code/deprecated/manager-api/package.json | 2 +- code/deprecated/manager/package.json | 2 +- code/deprecated/node-logger/package.json | 2 +- code/deprecated/preview-api/package.json | 2 +- code/deprecated/preview/package.json | 2 +- code/deprecated/router/package.json | 2 +- code/deprecated/telemetry/package.json | 2 +- code/deprecated/theming/package.json | 2 +- code/deprecated/types/package.json | 2 +- code/frameworks/angular/package.json | 2 +- code/frameworks/ember/package.json | 2 +- .../experimental-nextjs-vite/package.json | 2 +- code/frameworks/html-vite/package.json | 2 +- code/frameworks/html-webpack5/package.json | 2 +- code/frameworks/nextjs/package.json | 2 +- code/frameworks/preact-vite/package.json | 2 +- code/frameworks/preact-webpack5/package.json | 2 +- code/frameworks/react-vite/package.json | 2 +- code/frameworks/react-webpack5/package.json | 2 +- code/frameworks/server-webpack5/package.json | 2 +- code/frameworks/svelte-vite/package.json | 2 +- code/frameworks/svelte-webpack5/package.json | 2 +- code/frameworks/sveltekit/package.json | 2 +- code/frameworks/vue3-vite/package.json | 2 +- code/frameworks/vue3-webpack5/package.json | 2 +- .../web-components-vite/package.json | 2 +- .../web-components-webpack5/package.json | 2 +- code/lib/blocks/package.json | 2 +- code/lib/cli-sb/package.json | 2 +- code/lib/cli-storybook/package.json | 2 +- code/lib/cli/package.json | 2 +- code/lib/codemod/package.json | 2 +- code/lib/core-webpack/package.json | 2 +- code/lib/create-storybook/package.json | 2 +- code/lib/csf-plugin/package.json | 2 +- code/lib/instrumenter/package.json | 2 +- code/lib/react-dom-shim/package.json | 2 +- code/lib/source-loader/package.json | 2 +- code/lib/test/package.json | 2 +- code/package.json | 5 +- code/presets/create-react-app/package.json | 2 +- code/presets/html-webpack/package.json | 2 +- code/presets/preact-webpack/package.json | 2 +- code/presets/react-webpack/package.json | 2 +- code/presets/server-webpack/package.json | 2 +- code/presets/svelte-webpack/package.json | 2 +- code/presets/vue3-webpack/package.json | 2 +- code/renderers/html/package.json | 2 +- code/renderers/preact/package.json | 2 +- code/renderers/react/package.json | 2 +- code/renderers/server/package.json | 2 +- code/renderers/svelte/package.json | 2 +- code/renderers/vue3/package.json | 2 +- code/renderers/web-components/package.json | 2 +- 87 files changed, 171 insertions(+), 172 deletions(-) diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index 69f3f3ec768e..b97bf37fcb26 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-a11y", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Test component compliance with web accessibility standards", "keywords": [ "a11y", diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json index afa9f7e869e1..5f93bceaf0c8 100644 --- a/code/addons/actions/package.json +++ b/code/addons/actions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-actions", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Get UI feedback when an action is performed on an interactive element", "keywords": [ "storybook", diff --git a/code/addons/backgrounds/package.json b/code/addons/backgrounds/package.json index 6fd3cb7f2753..5463167de709 100644 --- a/code/addons/backgrounds/package.json +++ b/code/addons/backgrounds/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-backgrounds", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Switch backgrounds to view components in different settings", "keywords": [ "addon", diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json index 7aa728eaaad3..7fed67880b1f 100644 --- a/code/addons/controls/package.json +++ b/code/addons/controls/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-controls", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Interact with component inputs dynamically in the Storybook UI", "keywords": [ "addon", diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index 54f80efe5ee8..33e1b6f8b967 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-docs", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Document component usage and properties in Markdown", "keywords": [ "addon", diff --git a/code/addons/essentials/package.json b/code/addons/essentials/package.json index e561f85e4d39..9c445ceb640a 100644 --- a/code/addons/essentials/package.json +++ b/code/addons/essentials/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-essentials", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Curated addons to bring out the best of Storybook", "keywords": [ "addon", diff --git a/code/addons/gfm/package.json b/code/addons/gfm/package.json index 35b14c4bdd34..ab5008f40d51 100644 --- a/code/addons/gfm/package.json +++ b/code/addons/gfm/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-mdx-gfm", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "GitHub Flavored Markdown in Storybook", "keywords": [ "addon", diff --git a/code/addons/highlight/package.json b/code/addons/highlight/package.json index 82338ca80742..8f617bc6b1a8 100644 --- a/code/addons/highlight/package.json +++ b/code/addons/highlight/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-highlight", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Highlight DOM nodes within your stories", "keywords": [ "storybook-addons", diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index 0ef077e4cecb..0bb1f7853d83 100644 --- a/code/addons/interactions/package.json +++ b/code/addons/interactions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-interactions", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Automate, test and debug user interactions", "keywords": [ "storybook-addons", diff --git a/code/addons/jest/package.json b/code/addons/jest/package.json index b994a205e0f2..ba729316a2fd 100644 --- a/code/addons/jest/package.json +++ b/code/addons/jest/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-jest", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "React storybook addon that show component jest report", "keywords": [ "addon", diff --git a/code/addons/links/package.json b/code/addons/links/package.json index e55afc0b5630..3fd15885eaf8 100644 --- a/code/addons/links/package.json +++ b/code/addons/links/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-links", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Link stories together to build demos and prototypes with your UI components", "keywords": [ "storybook-addons", diff --git a/code/addons/measure/package.json b/code/addons/measure/package.json index 0d568a6a8fe2..7093841b6410 100644 --- a/code/addons/measure/package.json +++ b/code/addons/measure/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-measure", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Inspect layouts by visualizing the box model", "keywords": [ "storybook-addons", diff --git a/code/addons/onboarding/package.json b/code/addons/onboarding/package.json index 8e37d1da57b9..499b446f2752 100644 --- a/code/addons/onboarding/package.json +++ b/code/addons/onboarding/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-onboarding", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook Addon Onboarding - Introduces a new onboarding experience", "keywords": [ "storybook-addons", diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json index 5070ddcb9d1a..b1d15df673ea 100644 --- a/code/addons/outline/package.json +++ b/code/addons/outline/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-outline", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Outline all elements with CSS to help with layout placement and alignment", "keywords": [ "storybook-addons", diff --git a/code/addons/storysource/package.json b/code/addons/storysource/package.json index 84df2eeab95d..cddf13e41cfa 100644 --- a/code/addons/storysource/package.json +++ b/code/addons/storysource/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storysource", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "View a story’s source code to see how it works and paste into your app", "keywords": [ "addon", diff --git a/code/addons/test/package.json b/code/addons/test/package.json index a892d6918b80..421961c4d941 100644 --- a/code/addons/test/package.json +++ b/code/addons/test/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/experimental-addon-test", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Integrate Vitest with Storybook", "keywords": [ "storybook-addons", diff --git a/code/addons/themes/package.json b/code/addons/themes/package.json index 53cc7b812f63..69b4b781c128 100644 --- a/code/addons/themes/package.json +++ b/code/addons/themes/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-themes", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Switch between multiple themes for you components in Storybook", "keywords": [ "css", diff --git a/code/addons/toolbars/package.json b/code/addons/toolbars/package.json index 1dd14fb03d41..3c4a5dd74544 100644 --- a/code/addons/toolbars/package.json +++ b/code/addons/toolbars/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-toolbars", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Create your own toolbar items that control story rendering", "keywords": [ "addon", diff --git a/code/addons/viewport/package.json b/code/addons/viewport/package.json index f6a0bccfba5f..2f4bba349199 100644 --- a/code/addons/viewport/package.json +++ b/code/addons/viewport/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-viewport", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Build responsive components by adjusting Storybook’s viewport size and orientation", "keywords": [ "addon", diff --git a/code/builders/builder-vite/package.json b/code/builders/builder-vite/package.json index dc7e9dd9c6b7..7e435a83b167 100644 --- a/code/builders/builder-vite/package.json +++ b/code/builders/builder-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-vite", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "A plugin to run and build Storybooks with Vite", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/builders/builder-vite/#readme", "bugs": { diff --git a/code/builders/builder-webpack5/package.json b/code/builders/builder-webpack5/package.json index 0c122fc4a33a..bb1f97290dd0 100644 --- a/code/builders/builder-webpack5/package.json +++ b/code/builders/builder-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-webpack5", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/core/package.json b/code/core/package.json index 09a26d547178..a5f179a43316 100644 --- a/code/core/package.json +++ b/code/core/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/core/src/common/versions.ts b/code/core/src/common/versions.ts index bd7cbc52f1c4..fd7fdcadb3a9 100644 --- a/code/core/src/common/versions.ts +++ b/code/core/src/common/versions.ts @@ -1,87 +1,87 @@ // auto generated file, do not edit export default { - '@storybook/addon-a11y': '8.4.0-alpha.4', - '@storybook/addon-actions': '8.4.0-alpha.4', - '@storybook/addon-backgrounds': '8.4.0-alpha.4', - '@storybook/addon-controls': '8.4.0-alpha.4', - '@storybook/addon-docs': '8.4.0-alpha.4', - '@storybook/addon-essentials': '8.4.0-alpha.4', - '@storybook/addon-mdx-gfm': '8.4.0-alpha.4', - '@storybook/addon-highlight': '8.4.0-alpha.4', - '@storybook/addon-interactions': '8.4.0-alpha.4', - '@storybook/addon-jest': '8.4.0-alpha.4', - '@storybook/addon-links': '8.4.0-alpha.4', - '@storybook/addon-measure': '8.4.0-alpha.4', - '@storybook/addon-onboarding': '8.4.0-alpha.4', - '@storybook/addon-outline': '8.4.0-alpha.4', - '@storybook/addon-storysource': '8.4.0-alpha.4', - '@storybook/experimental-addon-test': '8.4.0-alpha.4', - '@storybook/addon-themes': '8.4.0-alpha.4', - '@storybook/addon-toolbars': '8.4.0-alpha.4', - '@storybook/addon-viewport': '8.4.0-alpha.4', - '@storybook/builder-vite': '8.4.0-alpha.4', - '@storybook/builder-webpack5': '8.4.0-alpha.4', - '@storybook/core': '8.4.0-alpha.4', - '@storybook/builder-manager': '8.4.0-alpha.4', - '@storybook/channels': '8.4.0-alpha.4', - '@storybook/client-logger': '8.4.0-alpha.4', - '@storybook/components': '8.4.0-alpha.4', - '@storybook/core-common': '8.4.0-alpha.4', - '@storybook/core-events': '8.4.0-alpha.4', - '@storybook/core-server': '8.4.0-alpha.4', - '@storybook/csf-tools': '8.4.0-alpha.4', - '@storybook/docs-tools': '8.4.0-alpha.4', - '@storybook/manager': '8.4.0-alpha.4', - '@storybook/manager-api': '8.4.0-alpha.4', - '@storybook/node-logger': '8.4.0-alpha.4', - '@storybook/preview': '8.4.0-alpha.4', - '@storybook/preview-api': '8.4.0-alpha.4', - '@storybook/router': '8.4.0-alpha.4', - '@storybook/telemetry': '8.4.0-alpha.4', - '@storybook/theming': '8.4.0-alpha.4', - '@storybook/types': '8.4.0-alpha.4', - '@storybook/angular': '8.4.0-alpha.4', - '@storybook/ember': '8.4.0-alpha.4', - '@storybook/experimental-nextjs-vite': '8.4.0-alpha.4', - '@storybook/html-vite': '8.4.0-alpha.4', - '@storybook/html-webpack5': '8.4.0-alpha.4', - '@storybook/nextjs': '8.4.0-alpha.4', - '@storybook/preact-vite': '8.4.0-alpha.4', - '@storybook/preact-webpack5': '8.4.0-alpha.4', - '@storybook/react-vite': '8.4.0-alpha.4', - '@storybook/react-webpack5': '8.4.0-alpha.4', - '@storybook/server-webpack5': '8.4.0-alpha.4', - '@storybook/svelte-vite': '8.4.0-alpha.4', - '@storybook/svelte-webpack5': '8.4.0-alpha.4', - '@storybook/sveltekit': '8.4.0-alpha.4', - '@storybook/vue3-vite': '8.4.0-alpha.4', - '@storybook/vue3-webpack5': '8.4.0-alpha.4', - '@storybook/web-components-vite': '8.4.0-alpha.4', - '@storybook/web-components-webpack5': '8.4.0-alpha.4', - '@storybook/blocks': '8.4.0-alpha.4', - storybook: '8.4.0-alpha.4', - sb: '8.4.0-alpha.4', - '@storybook/cli': '8.4.0-alpha.4', - '@storybook/codemod': '8.4.0-alpha.4', - '@storybook/core-webpack': '8.4.0-alpha.4', - 'create-storybook': '8.4.0-alpha.4', - '@storybook/csf-plugin': '8.4.0-alpha.4', - '@storybook/instrumenter': '8.4.0-alpha.4', - '@storybook/react-dom-shim': '8.4.0-alpha.4', - '@storybook/source-loader': '8.4.0-alpha.4', - '@storybook/test': '8.4.0-alpha.4', - '@storybook/preset-create-react-app': '8.4.0-alpha.4', - '@storybook/preset-html-webpack': '8.4.0-alpha.4', - '@storybook/preset-preact-webpack': '8.4.0-alpha.4', - '@storybook/preset-react-webpack': '8.4.0-alpha.4', - '@storybook/preset-server-webpack': '8.4.0-alpha.4', - '@storybook/preset-svelte-webpack': '8.4.0-alpha.4', - '@storybook/preset-vue3-webpack': '8.4.0-alpha.4', - '@storybook/html': '8.4.0-alpha.4', - '@storybook/preact': '8.4.0-alpha.4', - '@storybook/react': '8.4.0-alpha.4', - '@storybook/server': '8.4.0-alpha.4', - '@storybook/svelte': '8.4.0-alpha.4', - '@storybook/vue3': '8.4.0-alpha.4', - '@storybook/web-components': '8.4.0-alpha.4', + '@storybook/addon-a11y': '8.4.0-alpha.5', + '@storybook/addon-actions': '8.4.0-alpha.5', + '@storybook/addon-backgrounds': '8.4.0-alpha.5', + '@storybook/addon-controls': '8.4.0-alpha.5', + '@storybook/addon-docs': '8.4.0-alpha.5', + '@storybook/addon-essentials': '8.4.0-alpha.5', + '@storybook/addon-mdx-gfm': '8.4.0-alpha.5', + '@storybook/addon-highlight': '8.4.0-alpha.5', + '@storybook/addon-interactions': '8.4.0-alpha.5', + '@storybook/addon-jest': '8.4.0-alpha.5', + '@storybook/addon-links': '8.4.0-alpha.5', + '@storybook/addon-measure': '8.4.0-alpha.5', + '@storybook/addon-onboarding': '8.4.0-alpha.5', + '@storybook/addon-outline': '8.4.0-alpha.5', + '@storybook/addon-storysource': '8.4.0-alpha.5', + '@storybook/experimental-addon-test': '8.4.0-alpha.5', + '@storybook/addon-themes': '8.4.0-alpha.5', + '@storybook/addon-toolbars': '8.4.0-alpha.5', + '@storybook/addon-viewport': '8.4.0-alpha.5', + '@storybook/builder-vite': '8.4.0-alpha.5', + '@storybook/builder-webpack5': '8.4.0-alpha.5', + '@storybook/core': '8.4.0-alpha.5', + '@storybook/builder-manager': '8.4.0-alpha.5', + '@storybook/channels': '8.4.0-alpha.5', + '@storybook/client-logger': '8.4.0-alpha.5', + '@storybook/components': '8.4.0-alpha.5', + '@storybook/core-common': '8.4.0-alpha.5', + '@storybook/core-events': '8.4.0-alpha.5', + '@storybook/core-server': '8.4.0-alpha.5', + '@storybook/csf-tools': '8.4.0-alpha.5', + '@storybook/docs-tools': '8.4.0-alpha.5', + '@storybook/manager': '8.4.0-alpha.5', + '@storybook/manager-api': '8.4.0-alpha.5', + '@storybook/node-logger': '8.4.0-alpha.5', + '@storybook/preview': '8.4.0-alpha.5', + '@storybook/preview-api': '8.4.0-alpha.5', + '@storybook/router': '8.4.0-alpha.5', + '@storybook/telemetry': '8.4.0-alpha.5', + '@storybook/theming': '8.4.0-alpha.5', + '@storybook/types': '8.4.0-alpha.5', + '@storybook/angular': '8.4.0-alpha.5', + '@storybook/ember': '8.4.0-alpha.5', + '@storybook/experimental-nextjs-vite': '8.4.0-alpha.5', + '@storybook/html-vite': '8.4.0-alpha.5', + '@storybook/html-webpack5': '8.4.0-alpha.5', + '@storybook/nextjs': '8.4.0-alpha.5', + '@storybook/preact-vite': '8.4.0-alpha.5', + '@storybook/preact-webpack5': '8.4.0-alpha.5', + '@storybook/react-vite': '8.4.0-alpha.5', + '@storybook/react-webpack5': '8.4.0-alpha.5', + '@storybook/server-webpack5': '8.4.0-alpha.5', + '@storybook/svelte-vite': '8.4.0-alpha.5', + '@storybook/svelte-webpack5': '8.4.0-alpha.5', + '@storybook/sveltekit': '8.4.0-alpha.5', + '@storybook/vue3-vite': '8.4.0-alpha.5', + '@storybook/vue3-webpack5': '8.4.0-alpha.5', + '@storybook/web-components-vite': '8.4.0-alpha.5', + '@storybook/web-components-webpack5': '8.4.0-alpha.5', + '@storybook/blocks': '8.4.0-alpha.5', + storybook: '8.4.0-alpha.5', + sb: '8.4.0-alpha.5', + '@storybook/cli': '8.4.0-alpha.5', + '@storybook/codemod': '8.4.0-alpha.5', + '@storybook/core-webpack': '8.4.0-alpha.5', + 'create-storybook': '8.4.0-alpha.5', + '@storybook/csf-plugin': '8.4.0-alpha.5', + '@storybook/instrumenter': '8.4.0-alpha.5', + '@storybook/react-dom-shim': '8.4.0-alpha.5', + '@storybook/source-loader': '8.4.0-alpha.5', + '@storybook/test': '8.4.0-alpha.5', + '@storybook/preset-create-react-app': '8.4.0-alpha.5', + '@storybook/preset-html-webpack': '8.4.0-alpha.5', + '@storybook/preset-preact-webpack': '8.4.0-alpha.5', + '@storybook/preset-react-webpack': '8.4.0-alpha.5', + '@storybook/preset-server-webpack': '8.4.0-alpha.5', + '@storybook/preset-svelte-webpack': '8.4.0-alpha.5', + '@storybook/preset-vue3-webpack': '8.4.0-alpha.5', + '@storybook/html': '8.4.0-alpha.5', + '@storybook/preact': '8.4.0-alpha.5', + '@storybook/react': '8.4.0-alpha.5', + '@storybook/server': '8.4.0-alpha.5', + '@storybook/svelte': '8.4.0-alpha.5', + '@storybook/vue3': '8.4.0-alpha.5', + '@storybook/web-components': '8.4.0-alpha.5', }; diff --git a/code/core/src/manager-api/version.ts b/code/core/src/manager-api/version.ts index a9c6904a4e73..b246d32aeef9 100644 --- a/code/core/src/manager-api/version.ts +++ b/code/core/src/manager-api/version.ts @@ -1 +1 @@ -export const version = '8.4.0-alpha.4'; +export const version = '8.4.0-alpha.5'; diff --git a/code/deprecated/builder-manager/package.json b/code/deprecated/builder-manager/package.json index 2241d408f94a..dcda40249739 100644 --- a/code/deprecated/builder-manager/package.json +++ b/code/deprecated/builder-manager/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-manager", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook manager builder", "keywords": [ "storybook" diff --git a/code/deprecated/channels/package.json b/code/deprecated/channels/package.json index 989eb9d09902..151a0918dd98 100644 --- a/code/deprecated/channels/package.json +++ b/code/deprecated/channels/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channels", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/client-logger/package.json b/code/deprecated/client-logger/package.json index defd774b7e98..a9bd26a65a19 100644 --- a/code/deprecated/client-logger/package.json +++ b/code/deprecated/client-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/client-logger", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/components/package.json b/code/deprecated/components/package.json index af12bf460e83..91d006dca1cb 100644 --- a/code/deprecated/components/package.json +++ b/code/deprecated/components/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/components", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Core Storybook Components", "keywords": [ "storybook" diff --git a/code/deprecated/core-common/package.json b/code/deprecated/core-common/package.json index cdb957400eee..2c575d2f50d5 100644 --- a/code/deprecated/core-common/package.json +++ b/code/deprecated/core-common/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-common", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/deprecated/core-events/package.json b/code/deprecated/core-events/package.json index 60df609a13f0..19b34adf5424 100644 --- a/code/deprecated/core-events/package.json +++ b/code/deprecated/core-events/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-events", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Event names used in storybook core", "keywords": [ "storybook" diff --git a/code/deprecated/core-server/package.json b/code/deprecated/core-server/package.json index 945fee8bde17..cd6089d25f61 100644 --- a/code/deprecated/core-server/package.json +++ b/code/deprecated/core-server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-server", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/deprecated/csf-tools/package.json b/code/deprecated/csf-tools/package.json index fa07f41a9c4f..01c4a315adc5 100644 --- a/code/deprecated/csf-tools/package.json +++ b/code/deprecated/csf-tools/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/csf-tools", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Parse and manipulate CSF and Storybook config files", "keywords": [ "storybook" diff --git a/code/deprecated/docs-tools/package.json b/code/deprecated/docs-tools/package.json index 71a266ec2f14..121c88f61708 100644 --- a/code/deprecated/docs-tools/package.json +++ b/code/deprecated/docs-tools/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/docs-tools", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Shared utility functions for frameworks to implement docs", "keywords": [ "storybook" diff --git a/code/deprecated/manager-api/package.json b/code/deprecated/manager-api/package.json index afbbd9c167a2..147a88aa0dfc 100644 --- a/code/deprecated/manager-api/package.json +++ b/code/deprecated/manager-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/manager-api", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Core Storybook Manager API & Context", "keywords": [ "storybook" diff --git a/code/deprecated/manager/package.json b/code/deprecated/manager/package.json index f8010ef1954b..711d8bf56288 100644 --- a/code/deprecated/manager/package.json +++ b/code/deprecated/manager/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/manager", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Core Storybook UI", "keywords": [ "storybook" diff --git a/code/deprecated/node-logger/package.json b/code/deprecated/node-logger/package.json index c3728db1b91d..7cef48398217 100644 --- a/code/deprecated/node-logger/package.json +++ b/code/deprecated/node-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/node-logger", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/preview-api/package.json b/code/deprecated/preview-api/package.json index 9e3d575c3ff4..f8499b6def5c 100644 --- a/code/deprecated/preview-api/package.json +++ b/code/deprecated/preview-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview-api", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/preview/package.json b/code/deprecated/preview/package.json index ec568708d0a7..43e8837e6118 100644 --- a/code/deprecated/preview/package.json +++ b/code/deprecated/preview/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/router/package.json b/code/deprecated/router/package.json index 4100a86b3bfe..e9847a3e3cd4 100644 --- a/code/deprecated/router/package.json +++ b/code/deprecated/router/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/router", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Core Storybook Router", "keywords": [ "storybook" diff --git a/code/deprecated/telemetry/package.json b/code/deprecated/telemetry/package.json index abdc96c17583..3c57fd54d10f 100644 --- a/code/deprecated/telemetry/package.json +++ b/code/deprecated/telemetry/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/telemetry", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Telemetry logging for crash reports and usage statistics", "keywords": [ "storybook" diff --git a/code/deprecated/theming/package.json b/code/deprecated/theming/package.json index 6b48bea4e4b5..6014ea905e11 100644 --- a/code/deprecated/theming/package.json +++ b/code/deprecated/theming/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/theming", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Core Storybook Components", "keywords": [ "storybook" diff --git a/code/deprecated/types/package.json b/code/deprecated/types/package.json index 6681ae17c6d6..42e9b4d36006 100644 --- a/code/deprecated/types/package.json +++ b/code/deprecated/types/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/types", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Core Storybook TS Types", "keywords": [ "storybook" diff --git a/code/frameworks/angular/package.json b/code/frameworks/angular/package.json index 80fd82ef952a..e13d79eb1cfb 100644 --- a/code/frameworks/angular/package.json +++ b/code/frameworks/angular/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/angular", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.", "keywords": [ "storybook", diff --git a/code/frameworks/ember/package.json b/code/frameworks/ember/package.json index 754307bf9578..46c4d168186f 100644 --- a/code/frameworks/ember/package.json +++ b/code/frameworks/ember/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/ember", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/ember", "bugs": { diff --git a/code/frameworks/experimental-nextjs-vite/package.json b/code/frameworks/experimental-nextjs-vite/package.json index 0dfc086ed678..e56c97a4ea1f 100644 --- a/code/frameworks/experimental-nextjs-vite/package.json +++ b/code/frameworks/experimental-nextjs-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/experimental-nextjs-vite", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for Next.js and Vite", "keywords": [ "storybook", diff --git a/code/frameworks/html-vite/package.json b/code/frameworks/html-vite/package.json index cd823b5bee3e..c7423e1e3318 100644 --- a/code/frameworks/html-vite/package.json +++ b/code/frameworks/html-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html-vite", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for HTML and Vite: Develop HTML in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/html-webpack5/package.json b/code/frameworks/html-webpack5/package.json index 3d67cc8595ac..f11133c8fa4d 100644 --- a/code/frameworks/html-webpack5/package.json +++ b/code/frameworks/html-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html-webpack5", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/nextjs/package.json b/code/frameworks/nextjs/package.json index e11c4b5beb2a..14a3af0b67ec 100644 --- a/code/frameworks/nextjs/package.json +++ b/code/frameworks/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/nextjs", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for Next.js", "keywords": [ "storybook", diff --git a/code/frameworks/preact-vite/package.json b/code/frameworks/preact-vite/package.json index c76fddce92a5..4a5d63ba61b6 100644 --- a/code/frameworks/preact-vite/package.json +++ b/code/frameworks/preact-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact-vite", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for Preact and Vite: Develop Preact components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/preact-webpack5/package.json b/code/frameworks/preact-webpack5/package.json index 95f7226d83e9..922061579cdd 100644 --- a/code/frameworks/preact-webpack5/package.json +++ b/code/frameworks/preact-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact-webpack5", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" diff --git a/code/frameworks/react-vite/package.json b/code/frameworks/react-vite/package.json index 235ed5c9224c..4d0a7294ad59 100644 --- a/code/frameworks/react-vite/package.json +++ b/code/frameworks/react-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-vite", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/react-webpack5/package.json b/code/frameworks/react-webpack5/package.json index 927e1ea8d4b2..fe755b1e0e3f 100644 --- a/code/frameworks/react-webpack5/package.json +++ b/code/frameworks/react-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-webpack5", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/server-webpack5/package.json b/code/frameworks/server-webpack5/package.json index 73a6ad914d9d..74081df191e7 100644 --- a/code/frameworks/server-webpack5/package.json +++ b/code/frameworks/server-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server-webpack5", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/svelte-vite/package.json b/code/frameworks/svelte-vite/package.json index e7e036eba116..33fbaf51c721 100644 --- a/code/frameworks/svelte-vite/package.json +++ b/code/frameworks/svelte-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte-vite", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for Svelte and Vite: Develop Svelte components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/svelte-webpack5/package.json b/code/frameworks/svelte-webpack5/package.json index 1ced4ec74704..650a8bdaf38c 100644 --- a/code/frameworks/svelte-webpack5/package.json +++ b/code/frameworks/svelte-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte-webpack5", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/sveltekit/package.json b/code/frameworks/sveltekit/package.json index 5b669a08ff31..e79f5d53fea4 100644 --- a/code/frameworks/sveltekit/package.json +++ b/code/frameworks/sveltekit/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/sveltekit", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for SvelteKit", "keywords": [ "storybook", diff --git a/code/frameworks/vue3-vite/package.json b/code/frameworks/vue3-vite/package.json index 4583e8580935..770e765110bf 100644 --- a/code/frameworks/vue3-vite/package.json +++ b/code/frameworks/vue3-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3-vite", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for Vue3 and Vite: Develop Vue3 components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/vue3-webpack5/package.json b/code/frameworks/vue3-webpack5/package.json index fc3c1593f73f..07f0ad45af36 100644 --- a/code/frameworks/vue3-webpack5/package.json +++ b/code/frameworks/vue3-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3-webpack5", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/web-components-vite/package.json b/code/frameworks/web-components-vite/package.json index 045c9adc59b9..9e17c2cb61be 100644 --- a/code/frameworks/web-components-vite/package.json +++ b/code/frameworks/web-components-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components-vite", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for web-components and Vite: Develop Web Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/web-components-webpack5/package.json b/code/frameworks/web-components-webpack5/package.json index 64f70871f847..57d69631757c 100644 --- a/code/frameworks/web-components-webpack5/package.json +++ b/code/frameworks/web-components-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components-webpack5", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.", "keywords": [ "lit", diff --git a/code/lib/blocks/package.json b/code/lib/blocks/package.json index 8232f41a52c3..f322a2d14fcb 100644 --- a/code/lib/blocks/package.json +++ b/code/lib/blocks/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/blocks", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook Doc Blocks", "keywords": [ "storybook" diff --git a/code/lib/cli-sb/package.json b/code/lib/cli-sb/package.json index 0493bd1cfe04..bea976d0f551 100644 --- a/code/lib/cli-sb/package.json +++ b/code/lib/cli-sb/package.json @@ -1,6 +1,6 @@ { "name": "sb", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook CLI", "keywords": [ "storybook" diff --git a/code/lib/cli-storybook/package.json b/code/lib/cli-storybook/package.json index 02be45508db0..530e46799b1f 100644 --- a/code/lib/cli-storybook/package.json +++ b/code/lib/cli-storybook/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/cli", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook CLI", "keywords": [ "storybook" diff --git a/code/lib/cli/package.json b/code/lib/cli/package.json index 0393c4a2cce7..82702c003822 100644 --- a/code/lib/cli/package.json +++ b/code/lib/cli/package.json @@ -1,6 +1,6 @@ { "name": "storybook", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook's CLI - install, dev, build, upgrade, and more", "keywords": [ "cli", diff --git a/code/lib/codemod/package.json b/code/lib/codemod/package.json index 27cbe8082728..c1f9d97c4675 100644 --- a/code/lib/codemod/package.json +++ b/code/lib/codemod/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/codemod", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "A collection of codemod scripts written with JSCodeshift", "keywords": [ "storybook" diff --git a/code/lib/core-webpack/package.json b/code/lib/core-webpack/package.json index 2a0895f6a69f..1d855f200aac 100644 --- a/code/lib/core-webpack/package.json +++ b/code/lib/core-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-webpack", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/lib/create-storybook/package.json b/code/lib/create-storybook/package.json index d4009087ca3c..88ea2a9a25d5 100644 --- a/code/lib/create-storybook/package.json +++ b/code/lib/create-storybook/package.json @@ -1,6 +1,6 @@ { "name": "create-storybook", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Initialize Storybook into your project", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/lib/create-storybook", "bugs": { diff --git a/code/lib/csf-plugin/package.json b/code/lib/csf-plugin/package.json index 093264381888..8124158e7857 100644 --- a/code/lib/csf-plugin/package.json +++ b/code/lib/csf-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/csf-plugin", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Enrich CSF files via static analysis", "keywords": [ "storybook" diff --git a/code/lib/instrumenter/package.json b/code/lib/instrumenter/package.json index 50ee8e5e2855..387aa9495021 100644 --- a/code/lib/instrumenter/package.json +++ b/code/lib/instrumenter/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/instrumenter", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "", "keywords": [ "storybook" diff --git a/code/lib/react-dom-shim/package.json b/code/lib/react-dom-shim/package.json index a91f19996877..be911507bb2a 100644 --- a/code/lib/react-dom-shim/package.json +++ b/code/lib/react-dom-shim/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-dom-shim", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "", "keywords": [ "storybook" diff --git a/code/lib/source-loader/package.json b/code/lib/source-loader/package.json index b4c4545f6826..67070c107216 100644 --- a/code/lib/source-loader/package.json +++ b/code/lib/source-loader/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/source-loader", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Source loader", "keywords": [ "lib", diff --git a/code/lib/test/package.json b/code/lib/test/package.json index b2a27b41a5ff..258b29a136ca 100644 --- a/code/lib/test/package.json +++ b/code/lib/test/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/test", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "", "keywords": [ "storybook" diff --git a/code/package.json b/code/package.json index e441ef956340..bd2b064fce56 100644 --- a/code/package.json +++ b/code/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/root", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "private": true, "description": "Storybook root", "homepage": "https://storybook.js.org/", @@ -293,6 +293,5 @@ "Dependency Upgrades" ] ] - }, - "deferredNextVersion": "8.4.0-alpha.5" + } } diff --git a/code/presets/create-react-app/package.json b/code/presets/create-react-app/package.json index 6b54b01500ba..47551fa24329 100644 --- a/code/presets/create-react-app/package.json +++ b/code/presets/create-react-app/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-create-react-app", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for Create React App preset", "keywords": [ "storybook" diff --git a/code/presets/html-webpack/package.json b/code/presets/html-webpack/package.json index 122bb9a5630c..8c9585398c48 100644 --- a/code/presets/html-webpack/package.json +++ b/code/presets/html-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-html-webpack", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/preact-webpack/package.json b/code/presets/preact-webpack/package.json index 06382e51dcce..d436c6e26f86 100644 --- a/code/presets/preact-webpack/package.json +++ b/code/presets/preact-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-preact-webpack", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" diff --git a/code/presets/react-webpack/package.json b/code/presets/react-webpack/package.json index 50dcf06be887..d0525a1869a5 100644 --- a/code/presets/react-webpack/package.json +++ b/code/presets/react-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-react-webpack", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading", "keywords": [ "storybook" diff --git a/code/presets/server-webpack/package.json b/code/presets/server-webpack/package.json index 0eab7670d950..7509a6b050b2 100644 --- a/code/presets/server-webpack/package.json +++ b/code/presets/server-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-server-webpack", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/svelte-webpack/package.json b/code/presets/svelte-webpack/package.json index 12582f9d912e..4577f7c2b249 100644 --- a/code/presets/svelte-webpack/package.json +++ b/code/presets/svelte-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-svelte-webpack", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/vue3-webpack/package.json b/code/presets/vue3-webpack/package.json index e2c30599c391..99ce9894a1d1 100644 --- a/code/presets/vue3-webpack/package.json +++ b/code/presets/vue3-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-vue3-webpack", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/renderers/html/package.json b/code/renderers/html/package.json index 80d498caafd1..6a8b54c38db1 100644 --- a/code/renderers/html/package.json +++ b/code/renderers/html/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook HTML renderer", "keywords": [ "storybook" diff --git a/code/renderers/preact/package.json b/code/renderers/preact/package.json index 3244b054f186..f415f70bcfb9 100644 --- a/code/renderers/preact/package.json +++ b/code/renderers/preact/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook Preact renderer", "keywords": [ "storybook" diff --git a/code/renderers/react/package.json b/code/renderers/react/package.json index c4e9a05207f4..73172e5903f2 100644 --- a/code/renderers/react/package.json +++ b/code/renderers/react/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook React renderer", "keywords": [ "storybook" diff --git a/code/renderers/server/package.json b/code/renderers/server/package.json index e4b1b6a518e7..fb723c91b936 100644 --- a/code/renderers/server/package.json +++ b/code/renderers/server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook Server renderer", "keywords": [ "storybook" diff --git a/code/renderers/svelte/package.json b/code/renderers/svelte/package.json index eae9138107d7..a9629ee6e391 100644 --- a/code/renderers/svelte/package.json +++ b/code/renderers/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook Svelte renderer", "keywords": [ "storybook" diff --git a/code/renderers/vue3/package.json b/code/renderers/vue3/package.json index 107e76249af0..ddb3cbcaf105 100644 --- a/code/renderers/vue3/package.json +++ b/code/renderers/vue3/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook Vue 3 renderer", "keywords": [ "storybook" diff --git a/code/renderers/web-components/package.json b/code/renderers/web-components/package.json index 9cd643ec071f..56212e13e548 100644 --- a/code/renderers/web-components/package.json +++ b/code/renderers/web-components/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components", - "version": "8.4.0-alpha.4", + "version": "8.4.0-alpha.5", "description": "Storybook web-components renderer", "keywords": [ "lit", From 474b23c2df6fb4eb5dbdd7ecefafe152f6c561b3 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 8 Oct 2024 21:36:53 +0200 Subject: [PATCH 46/64] prebundle dependencies in addon-docs --- code/addons/docs/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index 33e1b6f8b967..135aa4fea69b 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -97,23 +97,23 @@ "prep": "jiti ../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@mdx-js/react": "^3.0.0", "@storybook/blocks": "workspace:*", "@storybook/csf-plugin": "workspace:*", "@storybook/global": "^5.0.0", "@storybook/react-dom-shim": "workspace:*", - "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", "react": "^16.8.0 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", - "rehype-external-links": "^3.0.0", - "rehype-slug": "^6.0.0", "ts-dedent": "^2.0.0" }, "devDependencies": { "@mdx-js/mdx": "^3.0.0", + "@mdx-js/react": "^3.0.0", "@rollup/pluginutils": "^5.0.2", + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", "react": "^18.2.0", "react-dom": "^18.2.0", + "rehype-external-links": "^3.0.0", + "rehype-slug": "^6.0.0", "typescript": "^5.3.2", "vite": "^4.0.4" }, From 36662bd4d1596c95da2009825ec33ddc9e32ff80 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 8 Oct 2024 21:41:15 +0200 Subject: [PATCH 47/64] purge @storybook/global from addon-docs --- code/addons/docs/angular/index.js | 3 +-- code/addons/docs/ember/index.js | 3 +-- code/addons/docs/package.json | 1 - code/addons/docs/src/preview.ts | 4 +--- code/addons/docs/template/stories/docs2/button.stories.ts | 2 -- .../template/stories/docs2/multiple-csf-files-a.stories.ts | 2 -- .../template/stories/docs2/multiple-csf-files-b.stories.ts | 2 -- .../addons/docs/template/stories/docspage/autoplay.stories.ts | 1 - code/addons/docs/template/stories/docspage/basic.stories.ts | 1 - .../docs/template/stories/docspage/description.stories.ts | 2 -- code/addons/docs/template/stories/docspage/error.stories.ts | 2 -- .../template/stories/docspage/extract-description.stories.ts | 2 -- code/addons/docs/template/stories/docspage/iframe.stories.ts | 2 -- .../addons/docs/template/stories/docspage/overflow.stories.ts | 2 -- .../addons/docs/template/stories/docspage/override.stories.ts | 2 -- code/addons/docs/template/stories/docspage/source.stories.ts | 2 -- code/addons/docs/template/stories/toc/basic.stories.ts | 3 --- .../docs/template/stories/toc/custom-selector.stories.ts | 2 -- code/addons/docs/template/stories/toc/custom-title.stories.ts | 2 -- .../docs/template/stories/toc/ignore-selector.stories.ts | 2 -- code/yarn.lock | 1 - 21 files changed, 3 insertions(+), 40 deletions(-) diff --git a/code/addons/docs/angular/index.js b/code/addons/docs/angular/index.js index 120597b47b00..fc08456784d8 100644 --- a/code/addons/docs/angular/index.js +++ b/code/addons/docs/angular/index.js @@ -1,7 +1,6 @@ /* eslint-disable no-underscore-dangle */ -import { global } from '@storybook/global'; export const setCompodocJson = (compodocJson) => { // @ts-expect-error (Converted from ts-ignore) - global.__STORYBOOK_COMPODOC_JSON__ = compodocJson; + globalThis.__STORYBOOK_COMPODOC_JSON__ = compodocJson; }; diff --git a/code/addons/docs/ember/index.js b/code/addons/docs/ember/index.js index eab68763ab45..8c795c20d219 100644 --- a/code/addons/docs/ember/index.js +++ b/code/addons/docs/ember/index.js @@ -1,6 +1,5 @@ /* eslint-disable no-underscore-dangle */ -import { global } from '@storybook/global'; export const setJSONDoc = (jsondoc) => { - global.__EMBER_GENERATED_DOC_JSON__ = jsondoc; + globalThis.__EMBER_GENERATED_DOC_JSON__ = jsondoc; }; diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index 135aa4fea69b..a2dde28d06a1 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -99,7 +99,6 @@ "dependencies": { "@storybook/blocks": "workspace:*", "@storybook/csf-plugin": "workspace:*", - "@storybook/global": "^5.0.0", "@storybook/react-dom-shim": "workspace:*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", diff --git a/code/addons/docs/src/preview.ts b/code/addons/docs/src/preview.ts index 735de9f72234..713352b025ea 100644 --- a/code/addons/docs/src/preview.ts +++ b/code/addons/docs/src/preview.ts @@ -1,8 +1,6 @@ import type { PreparedStory } from 'storybook/internal/types'; -import { global } from '@storybook/global'; - -const excludeTags = Object.entries(global.TAGS_OPTIONS ?? {}).reduce( +const excludeTags = Object.entries(globalThis.TAGS_OPTIONS ?? {}).reduce( (acc, entry) => { const [tag, option] = entry; if ((option as any).excludeFromDocsStories) { diff --git a/code/addons/docs/template/stories/docs2/button.stories.ts b/code/addons/docs/template/stories/docs2/button.stories.ts index fd516fe58721..dffc084c7c6b 100644 --- a/code/addons/docs/template/stories/docs2/button.stories.ts +++ b/code/addons/docs/template/stories/docs2/button.stories.ts @@ -1,5 +1,3 @@ -import { global as globalThis } from '@storybook/global'; - export default { component: globalThis.Components.Button, tags: ['autodocs'], diff --git a/code/addons/docs/template/stories/docs2/multiple-csf-files-a.stories.ts b/code/addons/docs/template/stories/docs2/multiple-csf-files-a.stories.ts index c77284a296f3..67591f0acac4 100644 --- a/code/addons/docs/template/stories/docs2/multiple-csf-files-a.stories.ts +++ b/code/addons/docs/template/stories/docs2/multiple-csf-files-a.stories.ts @@ -1,5 +1,3 @@ -import { global as globalThis } from '@storybook/global'; - export default { title: 'Multiple CSF Files Same Title', component: globalThis.Components.Html, diff --git a/code/addons/docs/template/stories/docs2/multiple-csf-files-b.stories.ts b/code/addons/docs/template/stories/docs2/multiple-csf-files-b.stories.ts index 955c04af9f9e..37f1cd76aa35 100644 --- a/code/addons/docs/template/stories/docs2/multiple-csf-files-b.stories.ts +++ b/code/addons/docs/template/stories/docs2/multiple-csf-files-b.stories.ts @@ -1,5 +1,3 @@ -import { global as globalThis } from '@storybook/global'; - export default { title: 'Multiple CSF Files Same Title', component: globalThis.Components.Html, diff --git a/code/addons/docs/template/stories/docspage/autoplay.stories.ts b/code/addons/docs/template/stories/docspage/autoplay.stories.ts index 6ebdc43b3ad7..03d1388f2fb6 100644 --- a/code/addons/docs/template/stories/docspage/autoplay.stories.ts +++ b/code/addons/docs/template/stories/docspage/autoplay.stories.ts @@ -1,4 +1,3 @@ -import { global as globalThis } from '@storybook/global'; import { expect, within } from '@storybook/test'; export default { diff --git a/code/addons/docs/template/stories/docspage/basic.stories.ts b/code/addons/docs/template/stories/docspage/basic.stories.ts index 3dc35191d7b7..a9ea37650fc9 100644 --- a/code/addons/docs/template/stories/docspage/basic.stories.ts +++ b/code/addons/docs/template/stories/docspage/basic.stories.ts @@ -1,4 +1,3 @@ -import { global as globalThis } from '@storybook/global'; import { fn } from '@storybook/test'; export default { diff --git a/code/addons/docs/template/stories/docspage/description.stories.ts b/code/addons/docs/template/stories/docspage/description.stories.ts index e6a2eac1587f..3d70e317511f 100644 --- a/code/addons/docs/template/stories/docspage/description.stories.ts +++ b/code/addons/docs/template/stories/docspage/description.stories.ts @@ -1,5 +1,3 @@ -import { global as globalThis } from '@storybook/global'; - export default { component: globalThis.Components.Button, subcomponents: { diff --git a/code/addons/docs/template/stories/docspage/error.stories.ts b/code/addons/docs/template/stories/docspage/error.stories.ts index eae587a16bde..4e7be89ad483 100644 --- a/code/addons/docs/template/stories/docspage/error.stories.ts +++ b/code/addons/docs/template/stories/docspage/error.stories.ts @@ -1,5 +1,3 @@ -import { global as globalThis } from '@storybook/global'; - export default { component: globalThis.Components.Button, tags: ['autodocs', '!test', '!vitest'], diff --git a/code/addons/docs/template/stories/docspage/extract-description.stories.ts b/code/addons/docs/template/stories/docspage/extract-description.stories.ts index cb5986ac7dbe..48cd9f91cd7b 100644 --- a/code/addons/docs/template/stories/docspage/extract-description.stories.ts +++ b/code/addons/docs/template/stories/docspage/extract-description.stories.ts @@ -1,5 +1,3 @@ -import { global as globalThis } from '@storybook/global'; - export default { component: globalThis.Components.Button, tags: ['autodocs'], diff --git a/code/addons/docs/template/stories/docspage/iframe.stories.ts b/code/addons/docs/template/stories/docspage/iframe.stories.ts index 03ee6b8df175..cdb2e55ab456 100644 --- a/code/addons/docs/template/stories/docspage/iframe.stories.ts +++ b/code/addons/docs/template/stories/docspage/iframe.stories.ts @@ -1,5 +1,3 @@ -import { global as globalThis } from '@storybook/global'; - export default { component: globalThis.Components.Button, tags: ['autodocs'], diff --git a/code/addons/docs/template/stories/docspage/overflow.stories.ts b/code/addons/docs/template/stories/docspage/overflow.stories.ts index 71893031af5b..471bb6d50a6a 100644 --- a/code/addons/docs/template/stories/docspage/overflow.stories.ts +++ b/code/addons/docs/template/stories/docspage/overflow.stories.ts @@ -1,5 +1,3 @@ -import { global as globalThis } from '@storybook/global'; - export default { component: globalThis.Components.Pre, tags: ['autodocs'], diff --git a/code/addons/docs/template/stories/docspage/override.stories.ts b/code/addons/docs/template/stories/docspage/override.stories.ts index 18d2d4e5e25c..26d012580e62 100644 --- a/code/addons/docs/template/stories/docspage/override.stories.ts +++ b/code/addons/docs/template/stories/docspage/override.stories.ts @@ -1,5 +1,3 @@ -import { global as globalThis } from '@storybook/global'; - // FIXME: do this using basic React functions for multi-framework // once sandbox linking is working // diff --git a/code/addons/docs/template/stories/docspage/source.stories.ts b/code/addons/docs/template/stories/docspage/source.stories.ts index faa8517dc54d..78100e5b4a5a 100644 --- a/code/addons/docs/template/stories/docspage/source.stories.ts +++ b/code/addons/docs/template/stories/docspage/source.stories.ts @@ -1,7 +1,5 @@ import type { StoryContext } from 'storybook/internal/types'; -import { global as globalThis } from '@storybook/global'; - import { dedent } from 'ts-dedent'; export default { diff --git a/code/addons/docs/template/stories/toc/basic.stories.ts b/code/addons/docs/template/stories/toc/basic.stories.ts index 2a81297d25be..4e531d0efe30 100644 --- a/code/addons/docs/template/stories/toc/basic.stories.ts +++ b/code/addons/docs/template/stories/toc/basic.stories.ts @@ -1,6 +1,3 @@ -import { global as globalThis } from '@storybook/global'; -import { fn } from '@storybook/test'; - export default { component: globalThis.Components.Button, tags: ['autodocs'], diff --git a/code/addons/docs/template/stories/toc/custom-selector.stories.ts b/code/addons/docs/template/stories/toc/custom-selector.stories.ts index e031366aa829..09caac6a69d4 100644 --- a/code/addons/docs/template/stories/toc/custom-selector.stories.ts +++ b/code/addons/docs/template/stories/toc/custom-selector.stories.ts @@ -1,5 +1,3 @@ -import { global as globalThis } from '@storybook/global'; - export default { component: globalThis.Components.Button, tags: ['autodocs'], diff --git a/code/addons/docs/template/stories/toc/custom-title.stories.ts b/code/addons/docs/template/stories/toc/custom-title.stories.ts index 69303e905cd0..cc20cdde5637 100644 --- a/code/addons/docs/template/stories/toc/custom-title.stories.ts +++ b/code/addons/docs/template/stories/toc/custom-title.stories.ts @@ -1,5 +1,3 @@ -import { global as globalThis } from '@storybook/global'; - export default { component: globalThis.Components.Button, tags: ['autodocs'], diff --git a/code/addons/docs/template/stories/toc/ignore-selector.stories.ts b/code/addons/docs/template/stories/toc/ignore-selector.stories.ts index 61ae6d12f2a7..793ae6c5bbac 100644 --- a/code/addons/docs/template/stories/toc/ignore-selector.stories.ts +++ b/code/addons/docs/template/stories/toc/ignore-selector.stories.ts @@ -1,5 +1,3 @@ -import { global as globalThis } from '@storybook/global'; - export default { component: globalThis.Components.Button, tags: ['autodocs'], diff --git a/code/yarn.lock b/code/yarn.lock index 79822b6950b8..6bd8a171ae88 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -5446,7 +5446,6 @@ __metadata: "@rollup/pluginutils": "npm:^5.0.2" "@storybook/blocks": "workspace:*" "@storybook/csf-plugin": "workspace:*" - "@storybook/global": "npm:^5.0.0" "@storybook/react-dom-shim": "workspace:*" "@types/react": "npm:^16.8.0 || ^17.0.0 || ^18.0.0" react: "npm:^18.2.0" From 3d633c0be7ba37f7b058b6938368ad9f98328d7d Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 8 Oct 2024 21:47:06 +0200 Subject: [PATCH 48/64] revert prebundling of @mdx-js/react --- code/addons/docs/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index a2dde28d06a1..2e8e6690e491 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -97,6 +97,7 @@ "prep": "jiti ../../../scripts/prepare/bundle.ts" }, "dependencies": { + "@mdx-js/react": "^3.0.0", "@storybook/blocks": "workspace:*", "@storybook/csf-plugin": "workspace:*", "@storybook/react-dom-shim": "workspace:*", @@ -106,7 +107,6 @@ }, "devDependencies": { "@mdx-js/mdx": "^3.0.0", - "@mdx-js/react": "^3.0.0", "@rollup/pluginutils": "^5.0.2", "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", "react": "^18.2.0", From ef088e89ef538fe241159c3cc993c360714b086b Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 8 Oct 2024 21:51:27 +0200 Subject: [PATCH 49/64] purge @storybook/global from @storybook/blocks --- code/lib/blocks/package.json | 1 - code/lib/blocks/src/blocks/DocsContainer.tsx | 3 +-- code/lib/blocks/src/blocks/DocsContext.ts | 12 +++++------- code/lib/blocks/src/blocks/mdx.tsx | 3 +-- code/lib/blocks/src/components/IFrame.tsx | 3 +-- code/lib/blocks/src/components/Preview.stories.tsx | 4 +--- code/lib/blocks/src/components/Preview.tsx | 4 +--- code/lib/blocks/src/components/Story.tsx | 3 +-- code/lib/blocks/src/controls/Object.tsx | 3 +-- 9 files changed, 12 insertions(+), 24 deletions(-) diff --git a/code/lib/blocks/package.json b/code/lib/blocks/package.json index f322a2d14fcb..64c4abd84765 100644 --- a/code/lib/blocks/package.json +++ b/code/lib/blocks/package.json @@ -44,7 +44,6 @@ }, "dependencies": { "@storybook/csf": "^0.1.11", - "@storybook/global": "^5.0.0", "@storybook/icons": "^1.2.10", "color-convert": "^2.0.1", "dequal": "^2.0.2", diff --git a/code/lib/blocks/src/blocks/DocsContainer.tsx b/code/lib/blocks/src/blocks/DocsContainer.tsx index 3fb52a32ca53..eba6fd5f94fb 100644 --- a/code/lib/blocks/src/blocks/DocsContainer.tsx +++ b/code/lib/blocks/src/blocks/DocsContainer.tsx @@ -5,7 +5,6 @@ import type { ThemeVars } from 'storybook/internal/theming'; import { ThemeProvider, ensure as ensureTheme } from 'storybook/internal/theming'; import type { Renderer } from 'storybook/internal/types'; -import { global } from '@storybook/global'; import { DocsPageWrapper } from '../components'; import { TableOfContents } from '../components/TableOfContents'; @@ -14,7 +13,7 @@ import { DocsContext } from './DocsContext'; import { SourceContainer } from './SourceContainer'; import { scrollToElement } from './utils'; -const { document, window: globalWindow } = global; +const { document, window: globalWindow } = globalThis; export interface DocsContainerProps { context: DocsContextProps; diff --git a/code/lib/blocks/src/blocks/DocsContext.ts b/code/lib/blocks/src/blocks/DocsContext.ts index b7680f920c5d..850b0ccddd94 100644 --- a/code/lib/blocks/src/blocks/DocsContext.ts +++ b/code/lib/blocks/src/blocks/DocsContext.ts @@ -4,8 +4,6 @@ import { createContext } from 'react'; import type { DocsContextProps, Renderer } from 'storybook/internal/types'; -import { global } from '@storybook/global'; - export type { DocsContextProps }; // We add DocsContext to window. The reason is that in case DocsContext.ts is @@ -13,11 +11,11 @@ export type { DocsContextProps }; // we will have multiple DocsContext definitions - leading to lost context in // the React component tree. // This was specifically a problem with the Vite builder. -if (global && global.__DOCS_CONTEXT__ === undefined) { - global.__DOCS_CONTEXT__ = createContext(null); - global.__DOCS_CONTEXT__.displayName = 'DocsContext'; +if (globalThis && globalThis.__DOCS_CONTEXT__ === undefined) { + globalThis.__DOCS_CONTEXT__ = createContext(null); + globalThis.__DOCS_CONTEXT__.displayName = 'DocsContext'; } -export const DocsContext: Context> = global - ? global.__DOCS_CONTEXT__ +export const DocsContext: Context> = globalThis + ? globalThis.__DOCS_CONTEXT__ : createContext(null); diff --git a/code/lib/blocks/src/blocks/mdx.tsx b/code/lib/blocks/src/blocks/mdx.tsx index 9a4bf1173c80..09d8cff33465 100644 --- a/code/lib/blocks/src/blocks/mdx.tsx +++ b/code/lib/blocks/src/blocks/mdx.tsx @@ -6,14 +6,13 @@ import { Code, components, nameSpaceClassNames } from 'storybook/internal/compon import { NAVIGATE_URL } from 'storybook/internal/core-events'; import { styled } from 'storybook/internal/theming'; -import { global } from '@storybook/global'; import { LinkIcon } from '@storybook/icons'; import { Source } from '../components'; import type { DocsContextProps } from './DocsContext'; import { DocsContext } from './DocsContext'; -const { document } = global; +const { document } = globalThis; // Hacky utility for asserting identifiers in MDX Story elements export const assertIsFn = (val: any) => { diff --git a/code/lib/blocks/src/components/IFrame.tsx b/code/lib/blocks/src/components/IFrame.tsx index 4fbf6220a1eb..391c80877d13 100644 --- a/code/lib/blocks/src/components/IFrame.tsx +++ b/code/lib/blocks/src/components/IFrame.tsx @@ -1,8 +1,7 @@ import React, { Component } from 'react'; -import { global } from '@storybook/global'; -const { window: globalWindow } = global; +const { window: globalWindow } = globalThis; interface IFrameProps { id: string; diff --git a/code/lib/blocks/src/components/Preview.stories.tsx b/code/lib/blocks/src/components/Preview.stories.tsx index 69b3adb29bf6..39a2e3b1a942 100644 --- a/code/lib/blocks/src/components/Preview.stories.tsx +++ b/code/lib/blocks/src/components/Preview.stories.tsx @@ -5,8 +5,6 @@ import { Button, Spaced } from 'storybook/internal/components'; import { styled } from 'storybook/internal/theming'; import type { DocsContextProps, ModuleExport } from 'storybook/internal/types'; -import { global } from '@storybook/global'; - import * as ButtonStories from '../examples/Button.stories'; import { Preview, PreviewSkeleton } from './Preview'; import * as sourceStories from './Source.stories'; @@ -251,7 +249,7 @@ export const WithAdditionalActions = ( { title: 'Open on GitHub', onClick: () => { - global.location.href = + globalThis.location.href = 'https://github.com/storybookjs/storybook/blob/next/code/lib/blocks/src/components/Preview.stories.tsx#L165-L186'; }, }, diff --git a/code/lib/blocks/src/components/Preview.tsx b/code/lib/blocks/src/components/Preview.tsx index e0491c2166fe..2c7defbe37a3 100644 --- a/code/lib/blocks/src/components/Preview.tsx +++ b/code/lib/blocks/src/components/Preview.tsx @@ -5,8 +5,6 @@ import { ActionBar, Zoom } from 'storybook/internal/components'; import type { ActionItem } from 'storybook/internal/components'; import { styled } from 'storybook/internal/theming'; -import { global } from '@storybook/global'; - import { darken } from 'polished'; import type { SourceProps } from '.'; @@ -204,7 +202,7 @@ export const Preview: FC = ({ ); const actionItems = [...defaultActionItems, ...additionalActionItems]; - const { window: globalWindow } = global; + const { window: globalWindow } = globalThis; const copyToClipboard = useCallback(async (text: string) => { const { createCopyToClipboardFunction } = await import('storybook/internal/components'); diff --git a/code/lib/blocks/src/components/Story.tsx b/code/lib/blocks/src/components/Story.tsx index 9be47a232abb..c5390e95ad52 100644 --- a/code/lib/blocks/src/components/Story.tsx +++ b/code/lib/blocks/src/components/Story.tsx @@ -6,12 +6,11 @@ import { ErrorFormatter, Loader, getStoryHref } from 'storybook/internal/compone import { styled } from 'storybook/internal/theming'; import type { DocsContextProps, PreparedStory } from 'storybook/internal/types'; -import { global } from '@storybook/global'; import { IFrame } from './IFrame'; import { ZoomContext } from './ZoomContext'; -const { PREVIEW_URL } = global; +const { PREVIEW_URL } = globalThis; const BASE_URL = PREVIEW_URL || 'iframe.html'; interface CommonProps { diff --git a/code/lib/blocks/src/controls/Object.tsx b/code/lib/blocks/src/controls/Object.tsx index 382dca01a57b..ced28529b763 100644 --- a/code/lib/blocks/src/controls/Object.tsx +++ b/code/lib/blocks/src/controls/Object.tsx @@ -4,7 +4,6 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { Button, Form, IconButton } from 'storybook/internal/components'; import { type Theme, styled, useTheme } from 'storybook/internal/theming'; -import { global } from '@storybook/global'; import { AddIcon, EyeCloseIcon, EyeIcon, SubtractIcon } from '@storybook/icons'; import { cloneDeep } from 'es-toolkit/compat'; @@ -13,7 +12,7 @@ import { getControlId, getControlSetterButtonId } from './helpers'; import { JsonTree } from './react-editable-json-tree'; import type { ControlProps, ObjectConfig, ObjectValue } from './types'; -const { window: globalWindow } = global; +const { window: globalWindow } = globalThis; type JsonTreeProps = ComponentProps; From 991d41fc8a1bff88dc1a7e208446b234e503b8a9 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 8 Oct 2024 21:59:39 +0200 Subject: [PATCH 50/64] prebundle and cleanup dependencies in @storybook/blocks --- code/lib/blocks/package.json | 16 +++++++--------- code/yarn.lock | 3 --- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/code/lib/blocks/package.json b/code/lib/blocks/package.json index 64c4abd84765..004be4bf279d 100644 --- a/code/lib/blocks/package.json +++ b/code/lib/blocks/package.json @@ -45,22 +45,20 @@ "dependencies": { "@storybook/csf": "^0.1.11", "@storybook/icons": "^1.2.10", - "color-convert": "^2.0.1", - "dequal": "^2.0.2", - "markdown-to-jsx": "^7.4.5", - "memoizerific": "^1.11.3", - "polished": "^4.2.2", - "react-colorful": "^5.1.2", - "telejson": "^7.2.0", - "ts-dedent": "^2.0.0", - "util-deprecate": "^1.0.2" + "ts-dedent": "^2.0.0" }, "devDependencies": { "@storybook/addon-actions": "workspace:*", "@storybook/react": "workspace:*", "@storybook/test": "workspace:*", "@types/color-convert": "^2.0.0", + "color-convert": "^2.0.1", "es-toolkit": "^1.21.0", + "markdown-to-jsx": "^7.4.5", + "memoizerific": "^1.11.3", + "polished": "^4.2.2", + "react-colorful": "^5.1.2", + "telejson": "^7.2.0", "tocbot": "^4.20.1" }, "peerDependencies": { diff --git a/code/yarn.lock b/code/yarn.lock index 6bd8a171ae88..474a0b1d26fe 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -5763,13 +5763,11 @@ __metadata: dependencies: "@storybook/addon-actions": "workspace:*" "@storybook/csf": "npm:^0.1.11" - "@storybook/global": "npm:^5.0.0" "@storybook/icons": "npm:^1.2.10" "@storybook/react": "workspace:*" "@storybook/test": "workspace:*" "@types/color-convert": "npm:^2.0.0" color-convert: "npm:^2.0.1" - dequal: "npm:^2.0.2" es-toolkit: "npm:^1.21.0" markdown-to-jsx: "npm:^7.4.5" memoizerific: "npm:^1.11.3" @@ -5778,7 +5776,6 @@ __metadata: telejson: "npm:^7.2.0" tocbot: "npm:^4.20.1" ts-dedent: "npm:^2.0.0" - util-deprecate: "npm:^1.0.2" peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta From 21f4ff114baef03263d56bf2c8c74e0df4fb74e5 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 8 Oct 2024 22:22:03 +0200 Subject: [PATCH 51/64] cleanup and prebundle builder-vite dependencies --- code/builders/builder-vite/package.json | 25 ++++--------------- code/builders/builder-vite/src/vite-config.ts | 6 ----- code/yarn.lock | 11 -------- 3 files changed, 5 insertions(+), 37 deletions(-) diff --git a/code/builders/builder-vite/package.json b/code/builders/builder-vite/package.json index 7e435a83b167..3f72f2637f04 100644 --- a/code/builders/builder-vite/package.json +++ b/code/builders/builder-vite/package.json @@ -44,39 +44,24 @@ }, "dependencies": { "@storybook/csf-plugin": "workspace:*", - "@types/find-cache-dir": "^3.2.1", "browser-assert": "^1.2.1", - "es-module-lexer": "^1.5.0", - "find-cache-dir": "^3.0.0", - "magic-string": "^0.30.0", "ts-dedent": "^2.0.0" }, "devDependencies": { + "@types/find-cache-dir": "^3.2.1", "@types/node": "^22.0.0", + "es-module-lexer": "^1.5.0", + "find-cache-dir": "^3.0.0", "glob": "^10.0.0", + "magic-string": "^0.30.0", "polka": "^1.0.0-next.28", "sirv": "^2.0.4", "slash": "^5.0.0", - "typescript": "^5.3.2", "vite": "^4.0.4" }, "peerDependencies": { - "@preact/preset-vite": "*", "storybook": "workspace:^", - "typescript": ">= 4.3.x", - "vite": "^4.0.0 || ^5.0.0", - "vite-plugin-glimmerx": "*" - }, - "peerDependenciesMeta": { - "@preact/preset-vite": { - "optional": true - }, - "typescript": { - "optional": true - }, - "vite-plugin-glimmerx": { - "optional": true - } + "vite": "^4.0.0 || ^5.0.0" }, "publishConfig": { "access": "public" diff --git a/code/builders/builder-vite/src/vite-config.ts b/code/builders/builder-vite/src/vite-config.ts index e3eff12d038e..2ab46f81de8c 100644 --- a/code/builders/builder-vite/src/vite-config.ts +++ b/code/builders/builder-vite/src/vite-config.ts @@ -119,11 +119,5 @@ export async function pluginConfig(options: Options) { pluginWebpackStats({ workingDir: process.cwd() }), ] as PluginOption[]; - // TODO: framework doesn't exist, should move into framework when/if built - if (frameworkName === '@storybook/glimmerx-vite') { - const plugin = require('vite-plugin-glimmerx/index.cjs'); - plugins.push(plugin.default()); - } - return plugins; } diff --git a/code/yarn.lock b/code/yarn.lock index 79822b6950b8..b4dc048dd4a4 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -5816,21 +5816,10 @@ __metadata: sirv: "npm:^2.0.4" slash: "npm:^5.0.0" ts-dedent: "npm:^2.0.0" - typescript: "npm:^5.3.2" vite: "npm:^4.0.4" peerDependencies: - "@preact/preset-vite": "*" storybook: "workspace:^" - typescript: ">= 4.3.x" vite: ^4.0.0 || ^5.0.0 - vite-plugin-glimmerx: "*" - peerDependenciesMeta: - "@preact/preset-vite": - optional: true - typescript: - optional: true - vite-plugin-glimmerx: - optional: true languageName: unknown linkType: soft From de2b9b4d95857a87ca2092cb054717dfb3da5cc2 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 8 Oct 2024 23:16:17 +0200 Subject: [PATCH 52/64] format --- code/lib/blocks/src/blocks/DocsContainer.tsx | 1 - code/lib/blocks/src/components/IFrame.tsx | 1 - code/lib/blocks/src/components/Story.tsx | 1 - 3 files changed, 3 deletions(-) diff --git a/code/lib/blocks/src/blocks/DocsContainer.tsx b/code/lib/blocks/src/blocks/DocsContainer.tsx index eba6fd5f94fb..be6649113e14 100644 --- a/code/lib/blocks/src/blocks/DocsContainer.tsx +++ b/code/lib/blocks/src/blocks/DocsContainer.tsx @@ -5,7 +5,6 @@ import type { ThemeVars } from 'storybook/internal/theming'; import { ThemeProvider, ensure as ensureTheme } from 'storybook/internal/theming'; import type { Renderer } from 'storybook/internal/types'; - import { DocsPageWrapper } from '../components'; import { TableOfContents } from '../components/TableOfContents'; import type { DocsContextProps } from './DocsContext'; diff --git a/code/lib/blocks/src/components/IFrame.tsx b/code/lib/blocks/src/components/IFrame.tsx index 391c80877d13..4f2bd4beedb3 100644 --- a/code/lib/blocks/src/components/IFrame.tsx +++ b/code/lib/blocks/src/components/IFrame.tsx @@ -1,6 +1,5 @@ import React, { Component } from 'react'; - const { window: globalWindow } = globalThis; interface IFrameProps { diff --git a/code/lib/blocks/src/components/Story.tsx b/code/lib/blocks/src/components/Story.tsx index c5390e95ad52..3110b14a0205 100644 --- a/code/lib/blocks/src/components/Story.tsx +++ b/code/lib/blocks/src/components/Story.tsx @@ -6,7 +6,6 @@ import { ErrorFormatter, Loader, getStoryHref } from 'storybook/internal/compone import { styled } from 'storybook/internal/theming'; import type { DocsContextProps, PreparedStory } from 'storybook/internal/types'; - import { IFrame } from './IFrame'; import { ZoomContext } from './ZoomContext'; From 7cdd11144136eddef75e2b70d639b22fa438ea16 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 9 Oct 2024 15:08:54 +0200 Subject: [PATCH 53/64] remove util dependency from instrumenter and test --- code/lib/instrumenter/package.json | 6 ++- code/lib/test/package.json | 6 ++- code/yarn.lock | 68 +----------------------------- 3 files changed, 9 insertions(+), 71 deletions(-) diff --git a/code/lib/instrumenter/package.json b/code/lib/instrumenter/package.json index 387aa9495021..3ac2d05b6d93 100644 --- a/code/lib/instrumenter/package.json +++ b/code/lib/instrumenter/package.json @@ -44,8 +44,7 @@ }, "dependencies": { "@storybook/global": "^5.0.0", - "@vitest/utils": "^2.0.5", - "util": "^0.12.4" + "@vitest/utils": "^2.0.5" }, "devDependencies": { "typescript": "^5.3.2" @@ -68,6 +67,9 @@ "@vitest/expect", "@vitest/spy", "@vitest/utils" + ], + "externals": [ + "util" ] }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" diff --git a/code/lib/test/package.json b/code/lib/test/package.json index 258b29a136ca..75970c8fa437 100644 --- a/code/lib/test/package.json +++ b/code/lib/test/package.json @@ -51,8 +51,7 @@ "@testing-library/jest-dom": "6.5.0", "@testing-library/user-event": "14.5.2", "@vitest/expect": "2.0.5", - "@vitest/spy": "2.0.5", - "util": "^0.12.4" + "@vitest/spy": "2.0.5" }, "devDependencies": { "chai": "^5.1.1", @@ -79,6 +78,9 @@ "@vitest/expect", "@vitest/spy", "@vitest/utils" + ], + "externals": [ + "util" ] }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" diff --git a/code/yarn.lock b/code/yarn.lock index 79822b6950b8..8c127189a5ae 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -6067,7 +6067,6 @@ __metadata: browser-assert: "npm:^1.2.1" browser-dtector: "npm:^3.4.0" camelcase: "npm:^8.0.0" - chai: "npm:^4.4.1" cli-table3: "npm:^0.6.1" commander: "npm:^12.1.0" comment-parser: "npm:^1.4.1" @@ -6360,7 +6359,6 @@ __metadata: "@storybook/global": "npm:^5.0.0" "@vitest/utils": "npm:^2.0.5" typescript: "npm:^5.3.2" - util: "npm:^0.12.4" peerDependencies: storybook: "workspace:^" languageName: unknown @@ -7113,7 +7111,6 @@ __metadata: ts-dedent: "npm:^2.2.0" type-fest: "npm:~2.19" typescript: "npm:^5.3.2" - util: "npm:^0.12.4" peerDependencies: storybook: "workspace:^" languageName: unknown @@ -10130,13 +10127,6 @@ __metadata: languageName: node linkType: hard -"assertion-error@npm:^1.1.0": - version: 1.1.0 - resolution: "assertion-error@npm:1.1.0" - checksum: 10c0/25456b2aa333250f01143968e02e4884a34588a8538fbbf65c91a637f1dbfb8069249133cd2f4e530f10f624d206a664e7df30207830b659e9f5298b00a4099b - languageName: node - linkType: hard - "assertion-error@npm:^2.0.1": version: 2.0.1 resolution: "assertion-error@npm:2.0.1" @@ -11437,21 +11427,6 @@ __metadata: languageName: node linkType: hard -"chai@npm:^4.4.1": - version: 4.5.0 - resolution: "chai@npm:4.5.0" - dependencies: - assertion-error: "npm:^1.1.0" - check-error: "npm:^1.0.3" - deep-eql: "npm:^4.1.3" - get-func-name: "npm:^2.0.2" - loupe: "npm:^2.3.6" - pathval: "npm:^1.1.1" - type-detect: "npm:^4.1.0" - checksum: 10c0/b8cb596bd1aece1aec659e41a6e479290c7d9bee5b3ad63d2898ad230064e5b47889a3bc367b20100a0853b62e026e2dc514acf25a3c9385f936aa3614d4ab4d - languageName: node - linkType: hard - "chai@npm:^5.1.1": version: 5.1.1 resolution: "chai@npm:5.1.1" @@ -11568,15 +11543,6 @@ __metadata: languageName: node linkType: hard -"check-error@npm:^1.0.3": - version: 1.0.3 - resolution: "check-error@npm:1.0.3" - dependencies: - get-func-name: "npm:^2.0.2" - checksum: 10c0/94aa37a7315c0e8a83d0112b5bfb5a8624f7f0f81057c73e4707729cdd8077166c6aefb3d8e2b92c63ee130d4a2ff94bad46d547e12f3238cc1d78342a973841 - languageName: node - linkType: hard - "check-error@npm:^2.1.1": version: 2.1.1 resolution: "check-error@npm:2.1.1" @@ -12847,15 +12813,6 @@ __metadata: languageName: node linkType: hard -"deep-eql@npm:^4.1.3": - version: 4.1.3 - resolution: "deep-eql@npm:4.1.3" - dependencies: - type-detect: "npm:^4.0.0" - checksum: 10c0/ff34e8605d8253e1bf9fe48056e02c6f347b81d9b5df1c6650a1b0f6f847b4a86453b16dc226b34f853ef14b626e85d04e081b022e20b00cd7d54f079ce9bbdd - languageName: node - linkType: hard - "deep-eql@npm:^5.0.1": version: 5.0.2 resolution: "deep-eql@npm:5.0.2" @@ -16003,7 +15960,7 @@ __metadata: languageName: node linkType: hard -"get-func-name@npm:^2.0.1, get-func-name@npm:^2.0.2": +"get-func-name@npm:^2.0.1": version: 2.0.2 resolution: "get-func-name@npm:2.0.2" checksum: 10c0/89830fd07623fa73429a711b9daecdb304386d237c71268007f788f113505ef1d4cc2d0b9680e072c5082490aec9df5d7758bf5ac6f1c37062855e8e3dc0b9df @@ -19270,15 +19227,6 @@ __metadata: languageName: node linkType: hard -"loupe@npm:^2.3.6": - version: 2.3.7 - resolution: "loupe@npm:2.3.7" - dependencies: - get-func-name: "npm:^2.0.1" - checksum: 10c0/71a781c8fc21527b99ed1062043f1f2bb30bdaf54fa4cf92463427e1718bc6567af2988300bc243c1f276e4f0876f29e3cbf7b58106fdc186915687456ce5bf4 - languageName: node - linkType: hard - "loupe@npm:^3.1.0, loupe@npm:^3.1.1": version: 3.1.1 resolution: "loupe@npm:3.1.1" @@ -22534,13 +22482,6 @@ __metadata: languageName: node linkType: hard -"pathval@npm:^1.1.1": - version: 1.1.1 - resolution: "pathval@npm:1.1.1" - checksum: 10c0/f63e1bc1b33593cdf094ed6ff5c49c1c0dc5dc20a646ca9725cc7fe7cd9995002d51d5685b9b2ec6814342935748b711bafa840f84c0bb04e38ff40a335c94dc - languageName: node - linkType: hard - "pathval@npm:^2.0.0": version: 2.0.0 resolution: "pathval@npm:2.0.0" @@ -27457,13 +27398,6 @@ __metadata: languageName: node linkType: hard -"type-detect@npm:^4.0.0, type-detect@npm:^4.1.0": - version: 4.1.0 - resolution: "type-detect@npm:4.1.0" - checksum: 10c0/df8157ca3f5d311edc22885abc134e18ff8ffbc93d6a9848af5b682730ca6a5a44499259750197250479c5331a8a75b5537529df5ec410622041650a7f293e2a - languageName: node - linkType: hard - "type-fest@npm:~2.19": version: 2.19.0 resolution: "type-fest@npm:2.19.0" From a6b2f30a62d3166f3b2ca852a7becc5b9dcd82a1 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 9 Oct 2024 15:09:02 +0200 Subject: [PATCH 54/64] remove unused chai from core --- code/core/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/code/core/package.json b/code/core/package.json index a5f179a43316..f549ff2c5272 100644 --- a/code/core/package.json +++ b/code/core/package.json @@ -340,7 +340,6 @@ "boxen": "^7.1.1", "browser-dtector": "^3.4.0", "camelcase": "^8.0.0", - "chai": "^4.4.1", "cli-table3": "^0.6.1", "commander": "^12.1.0", "comment-parser": "^1.4.1", From 7c9d69baa1c350e2b4d06f424fb95cc5a3f8b19c Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Wed, 9 Oct 2024 13:28:17 +0000 Subject: [PATCH 55/64] Write changelog for 8.4.0-alpha.6 [skip ci] --- CHANGELOG.prerelease.md | 6 ++++++ code/package.json | 3 ++- docs/versions/next.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.prerelease.md b/CHANGELOG.prerelease.md index 8c9a74c850e4..abe84ed2b356 100644 --- a/CHANGELOG.prerelease.md +++ b/CHANGELOG.prerelease.md @@ -1,3 +1,9 @@ +## 8.4.0-alpha.6 + +- Addon-docs, blocks: Prebundle dependencies - [#29301](https://github.com/storybookjs/storybook/pull/29301), thanks @JReinhold! +- React: Prebundle all of `renderers/react`'s dependencies - [#29298](https://github.com/storybookjs/storybook/pull/29298), thanks @ndelangen! +- Vite: Cleanup and prebundle dependencies - [#29302](https://github.com/storybookjs/storybook/pull/29302), thanks @JReinhold! + ## 8.4.0-alpha.5 - Core: Migrate from `express` to `polka` - [#29230](https://github.com/storybookjs/storybook/pull/29230), thanks @43081j! diff --git a/code/package.json b/code/package.json index bd2b064fce56..f764a9c67eeb 100644 --- a/code/package.json +++ b/code/package.json @@ -293,5 +293,6 @@ "Dependency Upgrades" ] ] - } + }, + "deferredNextVersion": "8.4.0-alpha.6" } diff --git a/docs/versions/next.json b/docs/versions/next.json index d74fdfbac9b2..ef66fd6e9fc3 100644 --- a/docs/versions/next.json +++ b/docs/versions/next.json @@ -1 +1 @@ -{"version":"8.4.0-alpha.5","info":{"plain":"- Core: Migrate from `express` to `polka` - [#29230](https://github.com/storybookjs/storybook/pull/29230), thanks @43081j!\n- Core: Remove dependence on `file-system-cache` - [#29256](https://github.com/storybookjs/storybook/pull/29256), thanks @ndelangen!"}} +{"version":"8.4.0-alpha.6","info":{"plain":"- Addon-docs, blocks: Prebundle dependencies - [#29301](https://github.com/storybookjs/storybook/pull/29301), thanks @JReinhold!\n- React: Prebundle all of `renderers/react`'s dependencies - [#29298](https://github.com/storybookjs/storybook/pull/29298), thanks @ndelangen!\n- Vite: Cleanup and prebundle dependencies - [#29302](https://github.com/storybookjs/storybook/pull/29302), thanks @JReinhold!"}} From dcca2f0bea5af5bbc093238552a861d5827d44e3 Mon Sep 17 00:00:00 2001 From: jonniebigodes Date: Wed, 9 Oct 2024 15:03:32 +0100 Subject: [PATCH 56/64] Minor fixes to the documentation --- docs/_snippets/storybook-a11y-add.md | 4 +-- docs/_snippets/storybook-a11y-install.md | 11 ++++++++ docs/_snippets/storybook-a11y-register.md | 27 ++++++++++++++++++++ docs/writing-tests/accessibility-testing.mdx | 8 +++++- 4 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 docs/_snippets/storybook-a11y-install.md create mode 100644 docs/_snippets/storybook-a11y-register.md diff --git a/docs/_snippets/storybook-a11y-add.md b/docs/_snippets/storybook-a11y-add.md index 813c19114eba..f95b3f3b5b66 100644 --- a/docs/_snippets/storybook-a11y-add.md +++ b/docs/_snippets/storybook-a11y-add.md @@ -3,9 +3,9 @@ npx storybook add @storybook/addon-a11y ``` ```shell renderer="common" language="js" packageManager="pnpm" -pnpx storybook add @storybook/addon-a11y +pnpm exec storybook add @storybook/addon-a11y ``` ```shell renderer="common" language="js" packageManager="yarn" -yarn dlx storybook add @storybook/addon-a11y +yarn exec storybook add @storybook/addon-a11y ``` diff --git a/docs/_snippets/storybook-a11y-install.md b/docs/_snippets/storybook-a11y-install.md new file mode 100644 index 000000000000..5837429854f8 --- /dev/null +++ b/docs/_snippets/storybook-a11y-install.md @@ -0,0 +1,11 @@ +```shell renderer="common" language="js" packageManager="npm" +npm install @storybook/addon-a11y --save-dev +``` + +```shell renderer="common" language="js" packageManager="pnpm" +pnpm add --save-dev @storybook/addon-a11y +``` + +```shell renderer="common" language="js" packageManager="yarn" +yarn add --dev @storybook/addon-a11y +``` diff --git a/docs/_snippets/storybook-a11y-register.md b/docs/_snippets/storybook-a11y-register.md new file mode 100644 index 000000000000..774d14622063 --- /dev/null +++ b/docs/_snippets/storybook-a11y-register.md @@ -0,0 +1,27 @@ +```js filename=".storybook/main.js" renderer="common" language="js" +export default { + // Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-vite) + framework: '@storybook/your-framework', + stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], + addons: [ + // Other Storybook addons + '@storybook/addon-a11y', //👈 The a11y addon goes here + ], +}; +``` + +```ts filename=".storybook/main.ts" renderer="common" language="ts" +// Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-vite) +import type { StorybookConfig } from '@storybook/your-framework'; + +const config: StorybookConfig = { + framework: '@storybook/your-framework', + stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], + addons: [ + // Other Storybook addons + '@storybook/addon-a11y', //👈 The a11y addon goes here + ], +}; + +export default config; +``` diff --git a/docs/writing-tests/accessibility-testing.mdx b/docs/writing-tests/accessibility-testing.mdx index 500f28efd33d..c5560e85daf4 100644 --- a/docs/writing-tests/accessibility-testing.mdx +++ b/docs/writing-tests/accessibility-testing.mdx @@ -19,7 +19,7 @@ Storybook provides an official [a11y addon](https://storybook.js.org/addons/@sto ### Set up the a11y addon -If you want to check accessibility for your stories using the [addon](https://storybook.js.org/addons/@storybook/addon-a11y/), you'll need to add it to your Storybook. +If you want to check accessibility for your stories using the [addon](https://storybook.js.org/addons/@storybook/addon-a11y/), you'll need to add it to your Storybook. You can do this by running the following command: {/* prettier-ignore-start */} @@ -27,6 +27,12 @@ If you want to check accessibility for your stories using the [addon](https://st {/* prettier-ignore-end */} + + +The CLI's [`add`](../api/cli-options.mdx#add) command automates the addon's installation and setup. To install it manually, see our [documentation](../addons/install-addons.mdx#manual-installation) on how to install addons. + + + Start your Storybook, and you will see some noticeable differences in the UI. A new toolbar icon and the accessibility panel where you can inspect the results of the tests. ![Storybook accessibility addon running](../_assets/writing-tests/storybook-a11y-addon-optimized.png) From 9e3d960477879633bfd46a365543ba0b847514af Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Wed, 9 Oct 2024 21:34:04 +0000 Subject: [PATCH 57/64] Bump version from "8.4.0-alpha.5" to "8.4.0-alpha.6" [skip ci] --- code/addons/a11y/package.json | 2 +- code/addons/actions/package.json | 2 +- code/addons/backgrounds/package.json | 2 +- code/addons/controls/package.json | 2 +- code/addons/docs/package.json | 2 +- code/addons/essentials/package.json | 2 +- code/addons/gfm/package.json | 2 +- code/addons/highlight/package.json | 2 +- code/addons/interactions/package.json | 2 +- code/addons/jest/package.json | 2 +- code/addons/links/package.json | 2 +- code/addons/measure/package.json | 2 +- code/addons/onboarding/package.json | 2 +- code/addons/outline/package.json | 2 +- code/addons/storysource/package.json | 2 +- code/addons/test/package.json | 2 +- code/addons/themes/package.json | 2 +- code/addons/toolbars/package.json | 2 +- code/addons/viewport/package.json | 2 +- code/builders/builder-vite/package.json | 2 +- code/builders/builder-webpack5/package.json | 2 +- code/core/package.json | 2 +- code/core/src/common/versions.ts | 168 +++++++++--------- code/core/src/manager-api/version.ts | 2 +- code/deprecated/builder-manager/package.json | 2 +- code/deprecated/channels/package.json | 2 +- code/deprecated/client-logger/package.json | 2 +- code/deprecated/components/package.json | 2 +- code/deprecated/core-common/package.json | 2 +- code/deprecated/core-events/package.json | 2 +- code/deprecated/core-server/package.json | 2 +- code/deprecated/csf-tools/package.json | 2 +- code/deprecated/docs-tools/package.json | 2 +- code/deprecated/manager-api/package.json | 2 +- code/deprecated/manager/package.json | 2 +- code/deprecated/node-logger/package.json | 2 +- code/deprecated/preview-api/package.json | 2 +- code/deprecated/preview/package.json | 2 +- code/deprecated/router/package.json | 2 +- code/deprecated/telemetry/package.json | 2 +- code/deprecated/theming/package.json | 2 +- code/deprecated/types/package.json | 2 +- code/frameworks/angular/package.json | 2 +- code/frameworks/ember/package.json | 2 +- .../experimental-nextjs-vite/package.json | 2 +- code/frameworks/html-vite/package.json | 2 +- code/frameworks/html-webpack5/package.json | 2 +- code/frameworks/nextjs/package.json | 2 +- code/frameworks/preact-vite/package.json | 2 +- code/frameworks/preact-webpack5/package.json | 2 +- code/frameworks/react-vite/package.json | 2 +- code/frameworks/react-webpack5/package.json | 2 +- code/frameworks/server-webpack5/package.json | 2 +- code/frameworks/svelte-vite/package.json | 2 +- code/frameworks/svelte-webpack5/package.json | 2 +- code/frameworks/sveltekit/package.json | 2 +- code/frameworks/vue3-vite/package.json | 2 +- code/frameworks/vue3-webpack5/package.json | 2 +- .../web-components-vite/package.json | 2 +- .../web-components-webpack5/package.json | 2 +- code/lib/blocks/package.json | 2 +- code/lib/cli-sb/package.json | 2 +- code/lib/cli-storybook/package.json | 2 +- code/lib/cli/package.json | 2 +- code/lib/codemod/package.json | 2 +- code/lib/core-webpack/package.json | 2 +- code/lib/create-storybook/package.json | 2 +- code/lib/csf-plugin/package.json | 2 +- code/lib/instrumenter/package.json | 2 +- code/lib/react-dom-shim/package.json | 2 +- code/lib/source-loader/package.json | 2 +- code/lib/test/package.json | 2 +- code/package.json | 5 +- code/presets/create-react-app/package.json | 2 +- code/presets/html-webpack/package.json | 2 +- code/presets/preact-webpack/package.json | 2 +- code/presets/react-webpack/package.json | 2 +- code/presets/server-webpack/package.json | 2 +- code/presets/svelte-webpack/package.json | 2 +- code/presets/vue3-webpack/package.json | 2 +- code/renderers/html/package.json | 2 +- code/renderers/preact/package.json | 2 +- code/renderers/react/package.json | 2 +- code/renderers/server/package.json | 2 +- code/renderers/svelte/package.json | 2 +- code/renderers/vue3/package.json | 2 +- code/renderers/web-components/package.json | 2 +- 87 files changed, 171 insertions(+), 172 deletions(-) diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index b97bf37fcb26..a9b14e39eb19 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-a11y", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Test component compliance with web accessibility standards", "keywords": [ "a11y", diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json index 5f93bceaf0c8..76e4f673f551 100644 --- a/code/addons/actions/package.json +++ b/code/addons/actions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-actions", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Get UI feedback when an action is performed on an interactive element", "keywords": [ "storybook", diff --git a/code/addons/backgrounds/package.json b/code/addons/backgrounds/package.json index 5463167de709..c08e691db0f2 100644 --- a/code/addons/backgrounds/package.json +++ b/code/addons/backgrounds/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-backgrounds", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Switch backgrounds to view components in different settings", "keywords": [ "addon", diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json index 7fed67880b1f..e7cf6f0530ad 100644 --- a/code/addons/controls/package.json +++ b/code/addons/controls/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-controls", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Interact with component inputs dynamically in the Storybook UI", "keywords": [ "addon", diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index 2e8e6690e491..f54f9dd093f9 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-docs", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Document component usage and properties in Markdown", "keywords": [ "addon", diff --git a/code/addons/essentials/package.json b/code/addons/essentials/package.json index 9c445ceb640a..a752f483dd7f 100644 --- a/code/addons/essentials/package.json +++ b/code/addons/essentials/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-essentials", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Curated addons to bring out the best of Storybook", "keywords": [ "addon", diff --git a/code/addons/gfm/package.json b/code/addons/gfm/package.json index ab5008f40d51..5a5ea206f0fc 100644 --- a/code/addons/gfm/package.json +++ b/code/addons/gfm/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-mdx-gfm", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "GitHub Flavored Markdown in Storybook", "keywords": [ "addon", diff --git a/code/addons/highlight/package.json b/code/addons/highlight/package.json index 8f617bc6b1a8..173dea25fd0f 100644 --- a/code/addons/highlight/package.json +++ b/code/addons/highlight/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-highlight", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Highlight DOM nodes within your stories", "keywords": [ "storybook-addons", diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index 0bb1f7853d83..0873e9397ceb 100644 --- a/code/addons/interactions/package.json +++ b/code/addons/interactions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-interactions", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Automate, test and debug user interactions", "keywords": [ "storybook-addons", diff --git a/code/addons/jest/package.json b/code/addons/jest/package.json index ba729316a2fd..50395747b347 100644 --- a/code/addons/jest/package.json +++ b/code/addons/jest/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-jest", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "React storybook addon that show component jest report", "keywords": [ "addon", diff --git a/code/addons/links/package.json b/code/addons/links/package.json index 3fd15885eaf8..4467f4116aa0 100644 --- a/code/addons/links/package.json +++ b/code/addons/links/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-links", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Link stories together to build demos and prototypes with your UI components", "keywords": [ "storybook-addons", diff --git a/code/addons/measure/package.json b/code/addons/measure/package.json index 7093841b6410..4ef6eeaf7e4c 100644 --- a/code/addons/measure/package.json +++ b/code/addons/measure/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-measure", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Inspect layouts by visualizing the box model", "keywords": [ "storybook-addons", diff --git a/code/addons/onboarding/package.json b/code/addons/onboarding/package.json index 499b446f2752..9f1f2c6f2516 100644 --- a/code/addons/onboarding/package.json +++ b/code/addons/onboarding/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-onboarding", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook Addon Onboarding - Introduces a new onboarding experience", "keywords": [ "storybook-addons", diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json index b1d15df673ea..dc858115c2df 100644 --- a/code/addons/outline/package.json +++ b/code/addons/outline/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-outline", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Outline all elements with CSS to help with layout placement and alignment", "keywords": [ "storybook-addons", diff --git a/code/addons/storysource/package.json b/code/addons/storysource/package.json index cddf13e41cfa..821bac4c9c25 100644 --- a/code/addons/storysource/package.json +++ b/code/addons/storysource/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storysource", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "View a story’s source code to see how it works and paste into your app", "keywords": [ "addon", diff --git a/code/addons/test/package.json b/code/addons/test/package.json index 421961c4d941..e6466e73c5e2 100644 --- a/code/addons/test/package.json +++ b/code/addons/test/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/experimental-addon-test", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Integrate Vitest with Storybook", "keywords": [ "storybook-addons", diff --git a/code/addons/themes/package.json b/code/addons/themes/package.json index 69b4b781c128..c6991f923b72 100644 --- a/code/addons/themes/package.json +++ b/code/addons/themes/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-themes", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Switch between multiple themes for you components in Storybook", "keywords": [ "css", diff --git a/code/addons/toolbars/package.json b/code/addons/toolbars/package.json index 3c4a5dd74544..a83c4e024eae 100644 --- a/code/addons/toolbars/package.json +++ b/code/addons/toolbars/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-toolbars", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Create your own toolbar items that control story rendering", "keywords": [ "addon", diff --git a/code/addons/viewport/package.json b/code/addons/viewport/package.json index 2f4bba349199..cc885522186e 100644 --- a/code/addons/viewport/package.json +++ b/code/addons/viewport/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-viewport", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Build responsive components by adjusting Storybook’s viewport size and orientation", "keywords": [ "addon", diff --git a/code/builders/builder-vite/package.json b/code/builders/builder-vite/package.json index 3f72f2637f04..1ffc4942e8b9 100644 --- a/code/builders/builder-vite/package.json +++ b/code/builders/builder-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-vite", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "A plugin to run and build Storybooks with Vite", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/builders/builder-vite/#readme", "bugs": { diff --git a/code/builders/builder-webpack5/package.json b/code/builders/builder-webpack5/package.json index bb1f97290dd0..6da556c43e8c 100644 --- a/code/builders/builder-webpack5/package.json +++ b/code/builders/builder-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-webpack5", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/core/package.json b/code/core/package.json index a5f179a43316..fa40c03053e0 100644 --- a/code/core/package.json +++ b/code/core/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/core/src/common/versions.ts b/code/core/src/common/versions.ts index fd7fdcadb3a9..1f2b5d2aef7d 100644 --- a/code/core/src/common/versions.ts +++ b/code/core/src/common/versions.ts @@ -1,87 +1,87 @@ // auto generated file, do not edit export default { - '@storybook/addon-a11y': '8.4.0-alpha.5', - '@storybook/addon-actions': '8.4.0-alpha.5', - '@storybook/addon-backgrounds': '8.4.0-alpha.5', - '@storybook/addon-controls': '8.4.0-alpha.5', - '@storybook/addon-docs': '8.4.0-alpha.5', - '@storybook/addon-essentials': '8.4.0-alpha.5', - '@storybook/addon-mdx-gfm': '8.4.0-alpha.5', - '@storybook/addon-highlight': '8.4.0-alpha.5', - '@storybook/addon-interactions': '8.4.0-alpha.5', - '@storybook/addon-jest': '8.4.0-alpha.5', - '@storybook/addon-links': '8.4.0-alpha.5', - '@storybook/addon-measure': '8.4.0-alpha.5', - '@storybook/addon-onboarding': '8.4.0-alpha.5', - '@storybook/addon-outline': '8.4.0-alpha.5', - '@storybook/addon-storysource': '8.4.0-alpha.5', - '@storybook/experimental-addon-test': '8.4.0-alpha.5', - '@storybook/addon-themes': '8.4.0-alpha.5', - '@storybook/addon-toolbars': '8.4.0-alpha.5', - '@storybook/addon-viewport': '8.4.0-alpha.5', - '@storybook/builder-vite': '8.4.0-alpha.5', - '@storybook/builder-webpack5': '8.4.0-alpha.5', - '@storybook/core': '8.4.0-alpha.5', - '@storybook/builder-manager': '8.4.0-alpha.5', - '@storybook/channels': '8.4.0-alpha.5', - '@storybook/client-logger': '8.4.0-alpha.5', - '@storybook/components': '8.4.0-alpha.5', - '@storybook/core-common': '8.4.0-alpha.5', - '@storybook/core-events': '8.4.0-alpha.5', - '@storybook/core-server': '8.4.0-alpha.5', - '@storybook/csf-tools': '8.4.0-alpha.5', - '@storybook/docs-tools': '8.4.0-alpha.5', - '@storybook/manager': '8.4.0-alpha.5', - '@storybook/manager-api': '8.4.0-alpha.5', - '@storybook/node-logger': '8.4.0-alpha.5', - '@storybook/preview': '8.4.0-alpha.5', - '@storybook/preview-api': '8.4.0-alpha.5', - '@storybook/router': '8.4.0-alpha.5', - '@storybook/telemetry': '8.4.0-alpha.5', - '@storybook/theming': '8.4.0-alpha.5', - '@storybook/types': '8.4.0-alpha.5', - '@storybook/angular': '8.4.0-alpha.5', - '@storybook/ember': '8.4.0-alpha.5', - '@storybook/experimental-nextjs-vite': '8.4.0-alpha.5', - '@storybook/html-vite': '8.4.0-alpha.5', - '@storybook/html-webpack5': '8.4.0-alpha.5', - '@storybook/nextjs': '8.4.0-alpha.5', - '@storybook/preact-vite': '8.4.0-alpha.5', - '@storybook/preact-webpack5': '8.4.0-alpha.5', - '@storybook/react-vite': '8.4.0-alpha.5', - '@storybook/react-webpack5': '8.4.0-alpha.5', - '@storybook/server-webpack5': '8.4.0-alpha.5', - '@storybook/svelte-vite': '8.4.0-alpha.5', - '@storybook/svelte-webpack5': '8.4.0-alpha.5', - '@storybook/sveltekit': '8.4.0-alpha.5', - '@storybook/vue3-vite': '8.4.0-alpha.5', - '@storybook/vue3-webpack5': '8.4.0-alpha.5', - '@storybook/web-components-vite': '8.4.0-alpha.5', - '@storybook/web-components-webpack5': '8.4.0-alpha.5', - '@storybook/blocks': '8.4.0-alpha.5', - storybook: '8.4.0-alpha.5', - sb: '8.4.0-alpha.5', - '@storybook/cli': '8.4.0-alpha.5', - '@storybook/codemod': '8.4.0-alpha.5', - '@storybook/core-webpack': '8.4.0-alpha.5', - 'create-storybook': '8.4.0-alpha.5', - '@storybook/csf-plugin': '8.4.0-alpha.5', - '@storybook/instrumenter': '8.4.0-alpha.5', - '@storybook/react-dom-shim': '8.4.0-alpha.5', - '@storybook/source-loader': '8.4.0-alpha.5', - '@storybook/test': '8.4.0-alpha.5', - '@storybook/preset-create-react-app': '8.4.0-alpha.5', - '@storybook/preset-html-webpack': '8.4.0-alpha.5', - '@storybook/preset-preact-webpack': '8.4.0-alpha.5', - '@storybook/preset-react-webpack': '8.4.0-alpha.5', - '@storybook/preset-server-webpack': '8.4.0-alpha.5', - '@storybook/preset-svelte-webpack': '8.4.0-alpha.5', - '@storybook/preset-vue3-webpack': '8.4.0-alpha.5', - '@storybook/html': '8.4.0-alpha.5', - '@storybook/preact': '8.4.0-alpha.5', - '@storybook/react': '8.4.0-alpha.5', - '@storybook/server': '8.4.0-alpha.5', - '@storybook/svelte': '8.4.0-alpha.5', - '@storybook/vue3': '8.4.0-alpha.5', - '@storybook/web-components': '8.4.0-alpha.5', + '@storybook/addon-a11y': '8.4.0-alpha.6', + '@storybook/addon-actions': '8.4.0-alpha.6', + '@storybook/addon-backgrounds': '8.4.0-alpha.6', + '@storybook/addon-controls': '8.4.0-alpha.6', + '@storybook/addon-docs': '8.4.0-alpha.6', + '@storybook/addon-essentials': '8.4.0-alpha.6', + '@storybook/addon-mdx-gfm': '8.4.0-alpha.6', + '@storybook/addon-highlight': '8.4.0-alpha.6', + '@storybook/addon-interactions': '8.4.0-alpha.6', + '@storybook/addon-jest': '8.4.0-alpha.6', + '@storybook/addon-links': '8.4.0-alpha.6', + '@storybook/addon-measure': '8.4.0-alpha.6', + '@storybook/addon-onboarding': '8.4.0-alpha.6', + '@storybook/addon-outline': '8.4.0-alpha.6', + '@storybook/addon-storysource': '8.4.0-alpha.6', + '@storybook/experimental-addon-test': '8.4.0-alpha.6', + '@storybook/addon-themes': '8.4.0-alpha.6', + '@storybook/addon-toolbars': '8.4.0-alpha.6', + '@storybook/addon-viewport': '8.4.0-alpha.6', + '@storybook/builder-vite': '8.4.0-alpha.6', + '@storybook/builder-webpack5': '8.4.0-alpha.6', + '@storybook/core': '8.4.0-alpha.6', + '@storybook/builder-manager': '8.4.0-alpha.6', + '@storybook/channels': '8.4.0-alpha.6', + '@storybook/client-logger': '8.4.0-alpha.6', + '@storybook/components': '8.4.0-alpha.6', + '@storybook/core-common': '8.4.0-alpha.6', + '@storybook/core-events': '8.4.0-alpha.6', + '@storybook/core-server': '8.4.0-alpha.6', + '@storybook/csf-tools': '8.4.0-alpha.6', + '@storybook/docs-tools': '8.4.0-alpha.6', + '@storybook/manager': '8.4.0-alpha.6', + '@storybook/manager-api': '8.4.0-alpha.6', + '@storybook/node-logger': '8.4.0-alpha.6', + '@storybook/preview': '8.4.0-alpha.6', + '@storybook/preview-api': '8.4.0-alpha.6', + '@storybook/router': '8.4.0-alpha.6', + '@storybook/telemetry': '8.4.0-alpha.6', + '@storybook/theming': '8.4.0-alpha.6', + '@storybook/types': '8.4.0-alpha.6', + '@storybook/angular': '8.4.0-alpha.6', + '@storybook/ember': '8.4.0-alpha.6', + '@storybook/experimental-nextjs-vite': '8.4.0-alpha.6', + '@storybook/html-vite': '8.4.0-alpha.6', + '@storybook/html-webpack5': '8.4.0-alpha.6', + '@storybook/nextjs': '8.4.0-alpha.6', + '@storybook/preact-vite': '8.4.0-alpha.6', + '@storybook/preact-webpack5': '8.4.0-alpha.6', + '@storybook/react-vite': '8.4.0-alpha.6', + '@storybook/react-webpack5': '8.4.0-alpha.6', + '@storybook/server-webpack5': '8.4.0-alpha.6', + '@storybook/svelte-vite': '8.4.0-alpha.6', + '@storybook/svelte-webpack5': '8.4.0-alpha.6', + '@storybook/sveltekit': '8.4.0-alpha.6', + '@storybook/vue3-vite': '8.4.0-alpha.6', + '@storybook/vue3-webpack5': '8.4.0-alpha.6', + '@storybook/web-components-vite': '8.4.0-alpha.6', + '@storybook/web-components-webpack5': '8.4.0-alpha.6', + '@storybook/blocks': '8.4.0-alpha.6', + storybook: '8.4.0-alpha.6', + sb: '8.4.0-alpha.6', + '@storybook/cli': '8.4.0-alpha.6', + '@storybook/codemod': '8.4.0-alpha.6', + '@storybook/core-webpack': '8.4.0-alpha.6', + 'create-storybook': '8.4.0-alpha.6', + '@storybook/csf-plugin': '8.4.0-alpha.6', + '@storybook/instrumenter': '8.4.0-alpha.6', + '@storybook/react-dom-shim': '8.4.0-alpha.6', + '@storybook/source-loader': '8.4.0-alpha.6', + '@storybook/test': '8.4.0-alpha.6', + '@storybook/preset-create-react-app': '8.4.0-alpha.6', + '@storybook/preset-html-webpack': '8.4.0-alpha.6', + '@storybook/preset-preact-webpack': '8.4.0-alpha.6', + '@storybook/preset-react-webpack': '8.4.0-alpha.6', + '@storybook/preset-server-webpack': '8.4.0-alpha.6', + '@storybook/preset-svelte-webpack': '8.4.0-alpha.6', + '@storybook/preset-vue3-webpack': '8.4.0-alpha.6', + '@storybook/html': '8.4.0-alpha.6', + '@storybook/preact': '8.4.0-alpha.6', + '@storybook/react': '8.4.0-alpha.6', + '@storybook/server': '8.4.0-alpha.6', + '@storybook/svelte': '8.4.0-alpha.6', + '@storybook/vue3': '8.4.0-alpha.6', + '@storybook/web-components': '8.4.0-alpha.6', }; diff --git a/code/core/src/manager-api/version.ts b/code/core/src/manager-api/version.ts index b246d32aeef9..3e7463603e83 100644 --- a/code/core/src/manager-api/version.ts +++ b/code/core/src/manager-api/version.ts @@ -1 +1 @@ -export const version = '8.4.0-alpha.5'; +export const version = '8.4.0-alpha.6'; diff --git a/code/deprecated/builder-manager/package.json b/code/deprecated/builder-manager/package.json index dcda40249739..e934907f9b14 100644 --- a/code/deprecated/builder-manager/package.json +++ b/code/deprecated/builder-manager/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-manager", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook manager builder", "keywords": [ "storybook" diff --git a/code/deprecated/channels/package.json b/code/deprecated/channels/package.json index 151a0918dd98..0436cb647d46 100644 --- a/code/deprecated/channels/package.json +++ b/code/deprecated/channels/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channels", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/client-logger/package.json b/code/deprecated/client-logger/package.json index a9bd26a65a19..d1323998298c 100644 --- a/code/deprecated/client-logger/package.json +++ b/code/deprecated/client-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/client-logger", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/components/package.json b/code/deprecated/components/package.json index 91d006dca1cb..2d398c4ab7ae 100644 --- a/code/deprecated/components/package.json +++ b/code/deprecated/components/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/components", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Core Storybook Components", "keywords": [ "storybook" diff --git a/code/deprecated/core-common/package.json b/code/deprecated/core-common/package.json index 2c575d2f50d5..eb392f0fbdde 100644 --- a/code/deprecated/core-common/package.json +++ b/code/deprecated/core-common/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-common", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/deprecated/core-events/package.json b/code/deprecated/core-events/package.json index 19b34adf5424..3230ef8494e4 100644 --- a/code/deprecated/core-events/package.json +++ b/code/deprecated/core-events/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-events", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Event names used in storybook core", "keywords": [ "storybook" diff --git a/code/deprecated/core-server/package.json b/code/deprecated/core-server/package.json index cd6089d25f61..bf9132d6a8fc 100644 --- a/code/deprecated/core-server/package.json +++ b/code/deprecated/core-server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-server", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/deprecated/csf-tools/package.json b/code/deprecated/csf-tools/package.json index 01c4a315adc5..bf3373793dae 100644 --- a/code/deprecated/csf-tools/package.json +++ b/code/deprecated/csf-tools/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/csf-tools", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Parse and manipulate CSF and Storybook config files", "keywords": [ "storybook" diff --git a/code/deprecated/docs-tools/package.json b/code/deprecated/docs-tools/package.json index 121c88f61708..51b035d50216 100644 --- a/code/deprecated/docs-tools/package.json +++ b/code/deprecated/docs-tools/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/docs-tools", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Shared utility functions for frameworks to implement docs", "keywords": [ "storybook" diff --git a/code/deprecated/manager-api/package.json b/code/deprecated/manager-api/package.json index 147a88aa0dfc..2fdedd7db193 100644 --- a/code/deprecated/manager-api/package.json +++ b/code/deprecated/manager-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/manager-api", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Core Storybook Manager API & Context", "keywords": [ "storybook" diff --git a/code/deprecated/manager/package.json b/code/deprecated/manager/package.json index 711d8bf56288..256121c97eca 100644 --- a/code/deprecated/manager/package.json +++ b/code/deprecated/manager/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/manager", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Core Storybook UI", "keywords": [ "storybook" diff --git a/code/deprecated/node-logger/package.json b/code/deprecated/node-logger/package.json index 7cef48398217..bf91317796eb 100644 --- a/code/deprecated/node-logger/package.json +++ b/code/deprecated/node-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/node-logger", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/preview-api/package.json b/code/deprecated/preview-api/package.json index f8499b6def5c..442b27074ef0 100644 --- a/code/deprecated/preview-api/package.json +++ b/code/deprecated/preview-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview-api", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/preview/package.json b/code/deprecated/preview/package.json index 43e8837e6118..05c15f015b34 100644 --- a/code/deprecated/preview/package.json +++ b/code/deprecated/preview/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/router/package.json b/code/deprecated/router/package.json index e9847a3e3cd4..8863504f4040 100644 --- a/code/deprecated/router/package.json +++ b/code/deprecated/router/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/router", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Core Storybook Router", "keywords": [ "storybook" diff --git a/code/deprecated/telemetry/package.json b/code/deprecated/telemetry/package.json index 3c57fd54d10f..0b1eb51a7ae9 100644 --- a/code/deprecated/telemetry/package.json +++ b/code/deprecated/telemetry/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/telemetry", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Telemetry logging for crash reports and usage statistics", "keywords": [ "storybook" diff --git a/code/deprecated/theming/package.json b/code/deprecated/theming/package.json index 6014ea905e11..b53d7599a2e4 100644 --- a/code/deprecated/theming/package.json +++ b/code/deprecated/theming/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/theming", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Core Storybook Components", "keywords": [ "storybook" diff --git a/code/deprecated/types/package.json b/code/deprecated/types/package.json index 42e9b4d36006..1a9401f7ef31 100644 --- a/code/deprecated/types/package.json +++ b/code/deprecated/types/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/types", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Core Storybook TS Types", "keywords": [ "storybook" diff --git a/code/frameworks/angular/package.json b/code/frameworks/angular/package.json index e13d79eb1cfb..83c0e69c1bc8 100644 --- a/code/frameworks/angular/package.json +++ b/code/frameworks/angular/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/angular", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.", "keywords": [ "storybook", diff --git a/code/frameworks/ember/package.json b/code/frameworks/ember/package.json index 46c4d168186f..f3ff8f099ae1 100644 --- a/code/frameworks/ember/package.json +++ b/code/frameworks/ember/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/ember", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/ember", "bugs": { diff --git a/code/frameworks/experimental-nextjs-vite/package.json b/code/frameworks/experimental-nextjs-vite/package.json index e56c97a4ea1f..dd1f137219e0 100644 --- a/code/frameworks/experimental-nextjs-vite/package.json +++ b/code/frameworks/experimental-nextjs-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/experimental-nextjs-vite", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for Next.js and Vite", "keywords": [ "storybook", diff --git a/code/frameworks/html-vite/package.json b/code/frameworks/html-vite/package.json index c7423e1e3318..024d64fb0f8e 100644 --- a/code/frameworks/html-vite/package.json +++ b/code/frameworks/html-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html-vite", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for HTML and Vite: Develop HTML in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/html-webpack5/package.json b/code/frameworks/html-webpack5/package.json index f11133c8fa4d..20d06b691009 100644 --- a/code/frameworks/html-webpack5/package.json +++ b/code/frameworks/html-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html-webpack5", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/nextjs/package.json b/code/frameworks/nextjs/package.json index 14a3af0b67ec..df683a8f5226 100644 --- a/code/frameworks/nextjs/package.json +++ b/code/frameworks/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/nextjs", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for Next.js", "keywords": [ "storybook", diff --git a/code/frameworks/preact-vite/package.json b/code/frameworks/preact-vite/package.json index 4a5d63ba61b6..9a13683d3693 100644 --- a/code/frameworks/preact-vite/package.json +++ b/code/frameworks/preact-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact-vite", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for Preact and Vite: Develop Preact components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/preact-webpack5/package.json b/code/frameworks/preact-webpack5/package.json index 922061579cdd..4b2da816dbc4 100644 --- a/code/frameworks/preact-webpack5/package.json +++ b/code/frameworks/preact-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact-webpack5", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" diff --git a/code/frameworks/react-vite/package.json b/code/frameworks/react-vite/package.json index 4d0a7294ad59..07d799ad2f7e 100644 --- a/code/frameworks/react-vite/package.json +++ b/code/frameworks/react-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-vite", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/react-webpack5/package.json b/code/frameworks/react-webpack5/package.json index fe755b1e0e3f..0c64a575a31e 100644 --- a/code/frameworks/react-webpack5/package.json +++ b/code/frameworks/react-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-webpack5", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/server-webpack5/package.json b/code/frameworks/server-webpack5/package.json index 74081df191e7..44511928801c 100644 --- a/code/frameworks/server-webpack5/package.json +++ b/code/frameworks/server-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server-webpack5", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/svelte-vite/package.json b/code/frameworks/svelte-vite/package.json index 33fbaf51c721..e3f06894167d 100644 --- a/code/frameworks/svelte-vite/package.json +++ b/code/frameworks/svelte-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte-vite", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for Svelte and Vite: Develop Svelte components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/svelte-webpack5/package.json b/code/frameworks/svelte-webpack5/package.json index 650a8bdaf38c..707e21cf75cc 100644 --- a/code/frameworks/svelte-webpack5/package.json +++ b/code/frameworks/svelte-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte-webpack5", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/sveltekit/package.json b/code/frameworks/sveltekit/package.json index e79f5d53fea4..0b1a39539ac5 100644 --- a/code/frameworks/sveltekit/package.json +++ b/code/frameworks/sveltekit/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/sveltekit", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for SvelteKit", "keywords": [ "storybook", diff --git a/code/frameworks/vue3-vite/package.json b/code/frameworks/vue3-vite/package.json index 770e765110bf..b58b9904cd1a 100644 --- a/code/frameworks/vue3-vite/package.json +++ b/code/frameworks/vue3-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3-vite", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for Vue3 and Vite: Develop Vue3 components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/vue3-webpack5/package.json b/code/frameworks/vue3-webpack5/package.json index 07f0ad45af36..49a3cef60359 100644 --- a/code/frameworks/vue3-webpack5/package.json +++ b/code/frameworks/vue3-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3-webpack5", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/web-components-vite/package.json b/code/frameworks/web-components-vite/package.json index 9e17c2cb61be..90c2abe2cc49 100644 --- a/code/frameworks/web-components-vite/package.json +++ b/code/frameworks/web-components-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components-vite", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for web-components and Vite: Develop Web Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/web-components-webpack5/package.json b/code/frameworks/web-components-webpack5/package.json index 57d69631757c..48c89238af3d 100644 --- a/code/frameworks/web-components-webpack5/package.json +++ b/code/frameworks/web-components-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components-webpack5", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.", "keywords": [ "lit", diff --git a/code/lib/blocks/package.json b/code/lib/blocks/package.json index 004be4bf279d..c713a99ebf45 100644 --- a/code/lib/blocks/package.json +++ b/code/lib/blocks/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/blocks", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook Doc Blocks", "keywords": [ "storybook" diff --git a/code/lib/cli-sb/package.json b/code/lib/cli-sb/package.json index bea976d0f551..93269c7c4449 100644 --- a/code/lib/cli-sb/package.json +++ b/code/lib/cli-sb/package.json @@ -1,6 +1,6 @@ { "name": "sb", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook CLI", "keywords": [ "storybook" diff --git a/code/lib/cli-storybook/package.json b/code/lib/cli-storybook/package.json index 530e46799b1f..c67eecd7aeaf 100644 --- a/code/lib/cli-storybook/package.json +++ b/code/lib/cli-storybook/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/cli", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook CLI", "keywords": [ "storybook" diff --git a/code/lib/cli/package.json b/code/lib/cli/package.json index 82702c003822..db2ab24c2871 100644 --- a/code/lib/cli/package.json +++ b/code/lib/cli/package.json @@ -1,6 +1,6 @@ { "name": "storybook", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook's CLI - install, dev, build, upgrade, and more", "keywords": [ "cli", diff --git a/code/lib/codemod/package.json b/code/lib/codemod/package.json index c1f9d97c4675..c450b993d8cf 100644 --- a/code/lib/codemod/package.json +++ b/code/lib/codemod/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/codemod", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "A collection of codemod scripts written with JSCodeshift", "keywords": [ "storybook" diff --git a/code/lib/core-webpack/package.json b/code/lib/core-webpack/package.json index 1d855f200aac..87bcc3acf5af 100644 --- a/code/lib/core-webpack/package.json +++ b/code/lib/core-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-webpack", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/lib/create-storybook/package.json b/code/lib/create-storybook/package.json index 88ea2a9a25d5..c0631a738814 100644 --- a/code/lib/create-storybook/package.json +++ b/code/lib/create-storybook/package.json @@ -1,6 +1,6 @@ { "name": "create-storybook", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Initialize Storybook into your project", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/lib/create-storybook", "bugs": { diff --git a/code/lib/csf-plugin/package.json b/code/lib/csf-plugin/package.json index 8124158e7857..3c5b00e8ba4f 100644 --- a/code/lib/csf-plugin/package.json +++ b/code/lib/csf-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/csf-plugin", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Enrich CSF files via static analysis", "keywords": [ "storybook" diff --git a/code/lib/instrumenter/package.json b/code/lib/instrumenter/package.json index 387aa9495021..08d0efeabbb4 100644 --- a/code/lib/instrumenter/package.json +++ b/code/lib/instrumenter/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/instrumenter", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/lib/react-dom-shim/package.json b/code/lib/react-dom-shim/package.json index be911507bb2a..35c20f531d52 100644 --- a/code/lib/react-dom-shim/package.json +++ b/code/lib/react-dom-shim/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-dom-shim", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/lib/source-loader/package.json b/code/lib/source-loader/package.json index 67070c107216..b58751b4f8fa 100644 --- a/code/lib/source-loader/package.json +++ b/code/lib/source-loader/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/source-loader", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Source loader", "keywords": [ "lib", diff --git a/code/lib/test/package.json b/code/lib/test/package.json index 258b29a136ca..02ae1082974c 100644 --- a/code/lib/test/package.json +++ b/code/lib/test/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/test", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/package.json b/code/package.json index f764a9c67eeb..5dab4f6f2052 100644 --- a/code/package.json +++ b/code/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/root", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "private": true, "description": "Storybook root", "homepage": "https://storybook.js.org/", @@ -293,6 +293,5 @@ "Dependency Upgrades" ] ] - }, - "deferredNextVersion": "8.4.0-alpha.6" + } } diff --git a/code/presets/create-react-app/package.json b/code/presets/create-react-app/package.json index 47551fa24329..440bed5ca22c 100644 --- a/code/presets/create-react-app/package.json +++ b/code/presets/create-react-app/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-create-react-app", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for Create React App preset", "keywords": [ "storybook" diff --git a/code/presets/html-webpack/package.json b/code/presets/html-webpack/package.json index 8c9585398c48..907be048f235 100644 --- a/code/presets/html-webpack/package.json +++ b/code/presets/html-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-html-webpack", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/preact-webpack/package.json b/code/presets/preact-webpack/package.json index d436c6e26f86..6149b9b39966 100644 --- a/code/presets/preact-webpack/package.json +++ b/code/presets/preact-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-preact-webpack", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" diff --git a/code/presets/react-webpack/package.json b/code/presets/react-webpack/package.json index d0525a1869a5..c4545042945b 100644 --- a/code/presets/react-webpack/package.json +++ b/code/presets/react-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-react-webpack", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading", "keywords": [ "storybook" diff --git a/code/presets/server-webpack/package.json b/code/presets/server-webpack/package.json index 7509a6b050b2..5c12e755277f 100644 --- a/code/presets/server-webpack/package.json +++ b/code/presets/server-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-server-webpack", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/svelte-webpack/package.json b/code/presets/svelte-webpack/package.json index 4577f7c2b249..7a6db7a30d48 100644 --- a/code/presets/svelte-webpack/package.json +++ b/code/presets/svelte-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-svelte-webpack", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/vue3-webpack/package.json b/code/presets/vue3-webpack/package.json index 99ce9894a1d1..adf687f2198f 100644 --- a/code/presets/vue3-webpack/package.json +++ b/code/presets/vue3-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-vue3-webpack", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/renderers/html/package.json b/code/renderers/html/package.json index 6a8b54c38db1..d1fd583cc093 100644 --- a/code/renderers/html/package.json +++ b/code/renderers/html/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook HTML renderer", "keywords": [ "storybook" diff --git a/code/renderers/preact/package.json b/code/renderers/preact/package.json index f415f70bcfb9..7b655c4f7f2a 100644 --- a/code/renderers/preact/package.json +++ b/code/renderers/preact/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook Preact renderer", "keywords": [ "storybook" diff --git a/code/renderers/react/package.json b/code/renderers/react/package.json index 36f50780eefd..71c85982561f 100644 --- a/code/renderers/react/package.json +++ b/code/renderers/react/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook React renderer", "keywords": [ "storybook" diff --git a/code/renderers/server/package.json b/code/renderers/server/package.json index fb723c91b936..a56cfca23e6c 100644 --- a/code/renderers/server/package.json +++ b/code/renderers/server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook Server renderer", "keywords": [ "storybook" diff --git a/code/renderers/svelte/package.json b/code/renderers/svelte/package.json index a9629ee6e391..d5c86963935f 100644 --- a/code/renderers/svelte/package.json +++ b/code/renderers/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook Svelte renderer", "keywords": [ "storybook" diff --git a/code/renderers/vue3/package.json b/code/renderers/vue3/package.json index ddb3cbcaf105..cdc676706504 100644 --- a/code/renderers/vue3/package.json +++ b/code/renderers/vue3/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook Vue 3 renderer", "keywords": [ "storybook" diff --git a/code/renderers/web-components/package.json b/code/renderers/web-components/package.json index 56212e13e548..b4b0d832e3b5 100644 --- a/code/renderers/web-components/package.json +++ b/code/renderers/web-components/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components", - "version": "8.4.0-alpha.5", + "version": "8.4.0-alpha.6", "description": "Storybook web-components renderer", "keywords": [ "lit", From e189008afc820fd4419407695386e314f091cb5c Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Thu, 10 Oct 2024 23:46:57 +0800 Subject: [PATCH 58/64] CLI: Install Svelte CSF v5 in Svelte5 projects --- .../src/generators/SVELTE/index.test.ts | 42 +++++++++++++++++++ .../src/generators/SVELTE/index.ts | 31 +++++++++++++- .../src/generators/SVELTEKIT/index.ts | 5 ++- 3 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 code/lib/create-storybook/src/generators/SVELTE/index.test.ts diff --git a/code/lib/create-storybook/src/generators/SVELTE/index.test.ts b/code/lib/create-storybook/src/generators/SVELTE/index.test.ts new file mode 100644 index 000000000000..09de63358322 --- /dev/null +++ b/code/lib/create-storybook/src/generators/SVELTE/index.test.ts @@ -0,0 +1,42 @@ +import { describe, it, expect } from 'vitest'; + +import { JsPackageManager } from '@storybook/core/common'; +import { getAddonSvelteCsfVersion } from './index'; + +describe('installed', () => { + it.each([ + ['3.0.0', ''], + ['4.0.0', '4'], + ['5.0.0', '^5.0.0-next.0'], + ['6.0.0', ''], + ['3.0.0-next.0', ''], + ['4.0.0-next.0', '4'], + ['5.0.0-next.0', '^5.0.0-next.0'], + ['6.0.0-next.0', ''] + ])('svelte %s => %s', async (svelteVersion, expectedAddonSpecifier) => { + const packageManager = { + getInstalledVersion: async (pkg: string) => pkg === 'svelte' ? svelteVersion : undefined, + getAllDependencies: async () => ({ svelte: `^${svelteVersion}` }) + } as any as JsPackageManager; + await expect(getAddonSvelteCsfVersion(packageManager)).resolves.toEqual(expectedAddonSpecifier); + }); +}); + +describe('uninstalled', () => { + it.each([ + ['^3', ''], + ['^4', '4'], + ['^5', '^5.0.0-next.0'], + ['^6', ''], + ['^3.0.0-next.0', ''], + ['^4.0.0-next.0', '4'], + ['^5.0.0-next.0', '^5.0.0-next.0'], + ['^6.0.0-next.0', ''] + ])('svelte %s => %s', async (svelteSpecifier, expectedAddonSpecifier) => { + const packageManager = { + getInstalledVersion: async (pkg: string) => undefined, + getAllDependencies: async () => ({ svelte: svelteSpecifier }) + } as any as JsPackageManager; + await expect(getAddonSvelteCsfVersion(packageManager)).resolves.toEqual(expectedAddonSpecifier); + }); +}); diff --git a/code/lib/create-storybook/src/generators/SVELTE/index.ts b/code/lib/create-storybook/src/generators/SVELTE/index.ts index d3b4a89a7351..93c462f15b6e 100644 --- a/code/lib/create-storybook/src/generators/SVELTE/index.ts +++ b/code/lib/create-storybook/src/generators/SVELTE/index.ts @@ -1,10 +1,39 @@ +import { coerce, major } from 'semver' + import { baseGenerator } from '../baseGenerator'; import type { Generator } from '../types'; +import { JsPackageManager } from '@storybook/core/common'; + +const versionHelper = (svelteMajor?: number) => { + if(svelteMajor === 4) return '4'; + // TODO: update when addon-svelte-csf v5 is released + if(svelteMajor === 5) return '^5.0.0-next.0'; + return ''; +} + +export const getAddonSvelteCsfVersion = async (packageManager: JsPackageManager) => { + const svelteVersion = await packageManager.getInstalledVersion('svelte'); + if(svelteVersion) { + return versionHelper(major(svelteVersion)); + } else { + const deps = await packageManager.getAllDependencies(); + const svelteSpecifier = deps['svelte']; + try { + const coerced = coerce(svelteSpecifier); + if(coerced?.version) { + return versionHelper(major(coerced.version)); + } + } catch {} + } + return ''; +} const generator: Generator = async (packageManager, npmOptions, options) => { + const addonSvelteCsfVersion = await getAddonSvelteCsfVersion(packageManager); + await baseGenerator(packageManager, npmOptions, options, 'svelte', { extensions: ['js', 'ts', 'svelte'], - extraAddons: ['@storybook/addon-svelte-csf'], + extraAddons: [`@storybook/addon-svelte-csf${addonSvelteCsfVersion && `@${addonSvelteCsfVersion}`}`], }); }; diff --git a/code/lib/create-storybook/src/generators/SVELTEKIT/index.ts b/code/lib/create-storybook/src/generators/SVELTEKIT/index.ts index 4a891b9a68bf..b190b56db282 100644 --- a/code/lib/create-storybook/src/generators/SVELTEKIT/index.ts +++ b/code/lib/create-storybook/src/generators/SVELTEKIT/index.ts @@ -2,8 +2,11 @@ import { CoreBuilder } from 'storybook/internal/cli'; import { baseGenerator } from '../baseGenerator'; import type { Generator } from '../types'; +import { getAddonSvelteCsfVersion } from '../SVELTE'; const generator: Generator = async (packageManager, npmOptions, options) => { + const addonSvelteCsfVersion = await getAddonSvelteCsfVersion(packageManager); + await baseGenerator( packageManager, npmOptions, @@ -11,7 +14,7 @@ const generator: Generator = async (packageManager, npmOptions, options) => { 'svelte', { extensions: ['js', 'ts', 'svelte'], - extraAddons: ['@storybook/addon-svelte-csf'], + extraAddons: [`@storybook/addon-svelte-csf${addonSvelteCsfVersion && `@${addonSvelteCsfVersion}`}`], }, 'sveltekit' ); From c5e384ee5c4664d8f1f011f18eff8d1ec0b17995 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Fri, 11 Oct 2024 10:20:18 +0800 Subject: [PATCH 59/64] Fix linting and CI errors --- .../src/generators/SVELTE/index.test.ts | 22 ++++++----- .../src/generators/SVELTE/index.ts | 39 ++++++++++++------- .../src/generators/SVELTEKIT/index.ts | 6 ++- 3 files changed, 40 insertions(+), 27 deletions(-) diff --git a/code/lib/create-storybook/src/generators/SVELTE/index.test.ts b/code/lib/create-storybook/src/generators/SVELTE/index.test.ts index 09de63358322..0fb124025879 100644 --- a/code/lib/create-storybook/src/generators/SVELTE/index.test.ts +++ b/code/lib/create-storybook/src/generators/SVELTE/index.test.ts @@ -1,6 +1,7 @@ -import { describe, it, expect } from 'vitest'; +import { describe, expect, it } from 'vitest'; + +import type { JsPackageManager } from '@storybook/core/common'; -import { JsPackageManager } from '@storybook/core/common'; import { getAddonSvelteCsfVersion } from './index'; describe('installed', () => { @@ -11,14 +12,15 @@ describe('installed', () => { ['6.0.0', ''], ['3.0.0-next.0', ''], ['4.0.0-next.0', '4'], - ['5.0.0-next.0', '^5.0.0-next.0'], - ['6.0.0-next.0', ''] + ['4.2.19::__archiveUrl=https%3A%2F%2Fregistry.npmjs.org%2Fsvelte%2F-%2Fsvelte-4.2.19.tgz', '4'], + ['5.0.0-next.0', '^5.0.0-next.0'], + ['6.0.0-next.0', ''], ])('svelte %s => %s', async (svelteVersion, expectedAddonSpecifier) => { const packageManager = { - getInstalledVersion: async (pkg: string) => pkg === 'svelte' ? svelteVersion : undefined, - getAllDependencies: async () => ({ svelte: `^${svelteVersion}` }) + getInstalledVersion: async (pkg: string) => (pkg === 'svelte' ? svelteVersion : undefined), + getAllDependencies: async () => ({ svelte: `^${svelteVersion}` }), } as any as JsPackageManager; - await expect(getAddonSvelteCsfVersion(packageManager)).resolves.toEqual(expectedAddonSpecifier); + await expect(getAddonSvelteCsfVersion(packageManager)).resolves.toBe(expectedAddonSpecifier); }); }); @@ -31,12 +33,12 @@ describe('uninstalled', () => { ['^3.0.0-next.0', ''], ['^4.0.0-next.0', '4'], ['^5.0.0-next.0', '^5.0.0-next.0'], - ['^6.0.0-next.0', ''] + ['^6.0.0-next.0', ''], ])('svelte %s => %s', async (svelteSpecifier, expectedAddonSpecifier) => { const packageManager = { getInstalledVersion: async (pkg: string) => undefined, - getAllDependencies: async () => ({ svelte: svelteSpecifier }) + getAllDependencies: async () => ({ svelte: svelteSpecifier }), } as any as JsPackageManager; - await expect(getAddonSvelteCsfVersion(packageManager)).resolves.toEqual(expectedAddonSpecifier); + await expect(getAddonSvelteCsfVersion(packageManager)).resolves.toBe(expectedAddonSpecifier); }); }); diff --git a/code/lib/create-storybook/src/generators/SVELTE/index.ts b/code/lib/create-storybook/src/generators/SVELTE/index.ts index 93c462f15b6e..21661f5b02b9 100644 --- a/code/lib/create-storybook/src/generators/SVELTE/index.ts +++ b/code/lib/create-storybook/src/generators/SVELTE/index.ts @@ -1,39 +1,48 @@ -import { coerce, major } from 'semver' +import type { JsPackageManager } from 'storybook/internal/common'; + +import { coerce, major } from 'semver'; import { baseGenerator } from '../baseGenerator'; import type { Generator } from '../types'; -import { JsPackageManager } from '@storybook/core/common'; const versionHelper = (svelteMajor?: number) => { - if(svelteMajor === 4) return '4'; + if (svelteMajor === 4) { + return '4'; + } // TODO: update when addon-svelte-csf v5 is released - if(svelteMajor === 5) return '^5.0.0-next.0'; + if (svelteMajor === 5) { + return '^5.0.0-next.0'; + } return ''; -} +}; export const getAddonSvelteCsfVersion = async (packageManager: JsPackageManager) => { const svelteVersion = await packageManager.getInstalledVersion('svelte'); - if(svelteVersion) { - return versionHelper(major(svelteVersion)); - } else { - const deps = await packageManager.getAllDependencies(); - const svelteSpecifier = deps['svelte']; - try { + try { + if (svelteVersion) { + return versionHelper(major(coerce(svelteVersion) || '')); + } else { + const deps = await packageManager.getAllDependencies(); + const svelteSpecifier = deps['svelte']; const coerced = coerce(svelteSpecifier); - if(coerced?.version) { + if (coerced?.version) { return versionHelper(major(coerced.version)); } - } catch {} + } + } catch { + // fallback to latest version } return ''; -} +}; const generator: Generator = async (packageManager, npmOptions, options) => { const addonSvelteCsfVersion = await getAddonSvelteCsfVersion(packageManager); await baseGenerator(packageManager, npmOptions, options, 'svelte', { extensions: ['js', 'ts', 'svelte'], - extraAddons: [`@storybook/addon-svelte-csf${addonSvelteCsfVersion && `@${addonSvelteCsfVersion}`}`], + extraAddons: [ + `@storybook/addon-svelte-csf${addonSvelteCsfVersion && `@${addonSvelteCsfVersion}`}`, + ], }); }; diff --git a/code/lib/create-storybook/src/generators/SVELTEKIT/index.ts b/code/lib/create-storybook/src/generators/SVELTEKIT/index.ts index b190b56db282..1a17c0ac5b67 100644 --- a/code/lib/create-storybook/src/generators/SVELTEKIT/index.ts +++ b/code/lib/create-storybook/src/generators/SVELTEKIT/index.ts @@ -1,8 +1,8 @@ import { CoreBuilder } from 'storybook/internal/cli'; +import { getAddonSvelteCsfVersion } from '../SVELTE'; import { baseGenerator } from '../baseGenerator'; import type { Generator } from '../types'; -import { getAddonSvelteCsfVersion } from '../SVELTE'; const generator: Generator = async (packageManager, npmOptions, options) => { const addonSvelteCsfVersion = await getAddonSvelteCsfVersion(packageManager); @@ -14,7 +14,9 @@ const generator: Generator = async (packageManager, npmOptions, options) => { 'svelte', { extensions: ['js', 'ts', 'svelte'], - extraAddons: [`@storybook/addon-svelte-csf${addonSvelteCsfVersion && `@${addonSvelteCsfVersion}`}`], + extraAddons: [ + `@storybook/addon-svelte-csf${addonSvelteCsfVersion && `@${addonSvelteCsfVersion}`}`, + ], }, 'sveltekit' ); From 93a24de0b2a8ddd0929221ad1e176d1442c3e965 Mon Sep 17 00:00:00 2001 From: Steve Dodier-Lazaro Date: Sat, 12 Oct 2024 13:29:17 +0200 Subject: [PATCH 60/64] Manager: Add tags property to ComponentEntry objects --- code/core/src/manager-api/lib/intersect.ts | 14 +++++ code/core/src/manager-api/lib/stories.ts | 4 ++ .../src/manager-api/tests/intersect.test.ts | 44 +++++++++++++++ .../src/manager-api/tests/stories.test.ts | 54 +++++++++++++++++++ code/core/src/types/modules/api-stories.ts | 1 + 5 files changed, 117 insertions(+) create mode 100644 code/core/src/manager-api/lib/intersect.ts create mode 100644 code/core/src/manager-api/tests/intersect.test.ts diff --git a/code/core/src/manager-api/lib/intersect.ts b/code/core/src/manager-api/lib/intersect.ts new file mode 100644 index 000000000000..84eae122322d --- /dev/null +++ b/code/core/src/manager-api/lib/intersect.ts @@ -0,0 +1,14 @@ +export default (a: T[], b: T[]): T[] => { + // no point in intersecting if one of the input is ill-defined + if (!a || !b) { + return []; + } + + return a.reduce((acc: T[], aValue) => { + if (b.includes(aValue)) { + acc.push(aValue); + } + + return acc; + }, []); +}; diff --git a/code/core/src/manager-api/lib/stories.ts b/code/core/src/manager-api/lib/stories.ts index 556acba0076d..eed677371ef0 100644 --- a/code/core/src/manager-api/lib/stories.ts +++ b/code/core/src/manager-api/lib/stories.ts @@ -24,6 +24,7 @@ import memoize from 'memoizerific'; import { dedent } from 'ts-dedent'; import { type API, type State, combineParameters } from '../root'; +import intersect from './intersect'; import merge from './merge'; const TITLE_PATH_SEPARATOR = /\s*\/\s*/; @@ -273,6 +274,9 @@ export const transformStoryIndexToStoriesHash = ( children: [childId], }), }); + // merge computes a union of arrays but we want an intersection on this + // specific array property, so it's easier to add it after the merge. + acc[id].tags = intersect(acc[id]?.tags ?? item.tags, item.tags); } else { acc[id] = merge((acc[id] || {}) as API_GroupEntry, { type: 'group', diff --git a/code/core/src/manager-api/tests/intersect.test.ts b/code/core/src/manager-api/tests/intersect.test.ts new file mode 100644 index 000000000000..e1e02362bc79 --- /dev/null +++ b/code/core/src/manager-api/tests/intersect.test.ts @@ -0,0 +1,44 @@ +import { describe, expect, it } from 'vitest'; + +import intersect from '../lib/intersect'; + +describe('Manager API utilities - intersect', () => { + it('returns identity when intersecting identity', () => { + const a = ['foo', 'bar']; + expect(intersect(a, a)).toEqual(a); + }); + + it('returns a when b is a superset of a', () => { + const a = ['foo', 'bar']; + const b = ['a', 'foo', 'b', 'bar', 'c', 'ter']; + expect(intersect(a, b)).toEqual(a); + }); + + it('returns b when a is a superset of b', () => { + const a = ['a', 'foo', 'b', 'bar', 'c', 'ter']; + const b = ['foo', 'bar']; + expect(intersect(a, b)).toEqual(b); + }); + + it('returns an intersection', () => { + const a = ['a', 'bar', 'b', 'c']; + const b = ['foo', 'bar', 'ter']; + expect(intersect(a, b)).toEqual(['bar']); + }); + + it('returns an empty set when there is no overlap', () => { + const a = ['a', 'b', 'c']; + const b = ['foo', 'bar', 'ter']; + expect(intersect(a, b)).toEqual([]); + }); + + it('returns an empty set if a is undefined', () => { + const b = ['foo', 'bar', 'ter']; + expect(intersect(undefined as unknown as [], b)).toEqual([]); + }); + + it('returns an empty set if b is undefined', () => { + const a = ['foo', 'bar', 'ter']; + expect(intersect(a, undefined as unknown as [])).toEqual([]); + }); +}); diff --git a/code/core/src/manager-api/tests/stories.test.ts b/code/core/src/manager-api/tests/stories.test.ts index 16b5c926c9c2..9d3c4433fdec 100644 --- a/code/core/src/manager-api/tests/stories.test.ts +++ b/code/core/src/manager-api/tests/stories.test.ts @@ -281,6 +281,57 @@ describe('stories API', () => { name: '1', }); }); + it('intersects story/docs tags to compute tags for component entries', () => { + const moduleArgs = createMockModuleArgs({}); + const { api } = initStories(moduleArgs as unknown as ModuleArgs); + const { store } = moduleArgs; + api.setIndex({ + v: 5, + entries: { + 'a--1': { + type: 'story', + id: 'a--1', + title: 'a', + name: '1', + tags: ['shared', 'one-specific'], + importPath: './a.ts', + }, + 'a--2': { + type: 'story', + id: 'a--2', + title: 'a', + name: '2', + tags: ['shared', 'two-specific'], + importPath: './a.ts', + }, + }, + }); + const { index } = store.getState(); + // We need exact key ordering, even if in theory JS doesn't guarantee it + expect(Object.keys(index!)).toEqual(['a', 'a--1', 'a--2']); + expect(index!.a).toMatchObject({ + type: 'component', + id: 'a', + tags: ['shared'], + children: ['a--1', 'a--2'], + }); + expect(index!['a--1']).toMatchObject({ + type: 'story', + id: 'a--1', + parent: 'a', + title: 'a', + name: '1', + tags: ['shared', 'one-specific'], + }); + expect(index!['a--2']).toMatchObject({ + type: 'story', + id: 'a--2', + parent: 'a', + title: 'a', + name: '2', + tags: ['shared', 'two-specific'], + }); + }); // Stories can get out of order for a few reasons -- see reproductions on // https://github.com/storybookjs/storybook/issues/5518 it('does the right thing for out of order stories', async () => { @@ -1453,6 +1504,7 @@ describe('stories API', () => { "name": "a", "parent": undefined, "renderLabel": undefined, + "tags": [], "type": "component", }, "a--1": { @@ -1518,6 +1570,7 @@ describe('stories API', () => { "name": "a", "parent": undefined, "renderLabel": undefined, + "tags": [], "type": "component", }, "a--1": { @@ -1559,6 +1612,7 @@ describe('stories API', () => { "name": "a", "parent": undefined, "renderLabel": undefined, + "tags": [], "type": "component", }, "a--1": { diff --git a/code/core/src/types/modules/api-stories.ts b/code/core/src/types/modules/api-stories.ts index 29e82c40e74a..c53d379b7192 100644 --- a/code/core/src/types/modules/api-stories.ts +++ b/code/core/src/types/modules/api-stories.ts @@ -27,6 +27,7 @@ export interface API_ComponentEntry extends API_BaseEntry { type: 'component'; parent?: StoryId; children: StoryId[]; + tags: Tag[]; } export interface API_DocsEntry extends API_BaseEntry { From d60a9d79b1c635fd70f49ca306f453e8f2970c67 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Sat, 12 Oct 2024 22:52:45 +0800 Subject: [PATCH 61/64] Fix types --- .../src/manager/components/sidebar/__tests__/Sidebar.test.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/code/core/src/manager/components/sidebar/__tests__/Sidebar.test.tsx b/code/core/src/manager/components/sidebar/__tests__/Sidebar.test.tsx index adc05cb07a55..2e1583fdcf87 100644 --- a/code/core/src/manager/components/sidebar/__tests__/Sidebar.test.tsx +++ b/code/core/src/manager/components/sidebar/__tests__/Sidebar.test.tsx @@ -59,6 +59,7 @@ const generateStories = ({ title, refId }: { title: string; refId?: string }): A name: componentName, children: [docsId], parent: rootId, + tags: [], }, // @ts-expect-error the missing fields are deprecated and replaced by the type prop { From 48915df9f492a8e7214afeaf22684aecbbc80122 Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Sat, 12 Oct 2024 20:33:22 +0000 Subject: [PATCH 62/64] Write changelog for 8.4.0-alpha.7 [skip ci] --- CHANGELOG.prerelease.md | 5 +++++ code/package.json | 3 ++- docs/versions/next.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.prerelease.md b/CHANGELOG.prerelease.md index abe84ed2b356..4381e3ec634f 100644 --- a/CHANGELOG.prerelease.md +++ b/CHANGELOG.prerelease.md @@ -1,3 +1,8 @@ +## 8.4.0-alpha.7 + +- CLI: Install Svelte CSF v5 in Svelte5 projects - [#29323](https://github.com/storybookjs/storybook/pull/29323), thanks @shilman! +- Manager: Add tags property to ComponentEntry objects - [#29343](https://github.com/storybookjs/storybook/pull/29343), thanks @Sidnioulz! + ## 8.4.0-alpha.6 - Addon-docs, blocks: Prebundle dependencies - [#29301](https://github.com/storybookjs/storybook/pull/29301), thanks @JReinhold! diff --git a/code/package.json b/code/package.json index 5dab4f6f2052..fd61251fa13f 100644 --- a/code/package.json +++ b/code/package.json @@ -293,5 +293,6 @@ "Dependency Upgrades" ] ] - } + }, + "deferredNextVersion": "8.4.0-alpha.7" } diff --git a/docs/versions/next.json b/docs/versions/next.json index ef66fd6e9fc3..b7cf99de3ecf 100644 --- a/docs/versions/next.json +++ b/docs/versions/next.json @@ -1 +1 @@ -{"version":"8.4.0-alpha.6","info":{"plain":"- Addon-docs, blocks: Prebundle dependencies - [#29301](https://github.com/storybookjs/storybook/pull/29301), thanks @JReinhold!\n- React: Prebundle all of `renderers/react`'s dependencies - [#29298](https://github.com/storybookjs/storybook/pull/29298), thanks @ndelangen!\n- Vite: Cleanup and prebundle dependencies - [#29302](https://github.com/storybookjs/storybook/pull/29302), thanks @JReinhold!"}} +{"version":"8.4.0-alpha.7","info":{"plain":"- CLI: Install Svelte CSF v5 in Svelte5 projects - [#29323](https://github.com/storybookjs/storybook/pull/29323), thanks @shilman!\n- Manager: Add tags property to ComponentEntry objects - [#29343](https://github.com/storybookjs/storybook/pull/29343), thanks @Sidnioulz!"}} From 9d862798d666678cc4822e857c00bbd744169ced Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Sat, 12 Oct 2024 21:05:10 +0000 Subject: [PATCH 63/64] Bump version from "8.4.0-alpha.6" to "8.4.0-alpha.7" [skip ci] --- code/addons/a11y/package.json | 2 +- code/addons/actions/package.json | 2 +- code/addons/backgrounds/package.json | 2 +- code/addons/controls/package.json | 2 +- code/addons/docs/package.json | 2 +- code/addons/essentials/package.json | 2 +- code/addons/gfm/package.json | 2 +- code/addons/highlight/package.json | 2 +- code/addons/interactions/package.json | 2 +- code/addons/jest/package.json | 2 +- code/addons/links/package.json | 2 +- code/addons/measure/package.json | 2 +- code/addons/onboarding/package.json | 2 +- code/addons/outline/package.json | 2 +- code/addons/storysource/package.json | 2 +- code/addons/test/package.json | 2 +- code/addons/themes/package.json | 2 +- code/addons/toolbars/package.json | 2 +- code/addons/viewport/package.json | 2 +- code/builders/builder-vite/package.json | 2 +- code/builders/builder-webpack5/package.json | 2 +- code/core/package.json | 2 +- code/core/src/common/versions.ts | 168 +++++++++--------- code/core/src/manager-api/version.ts | 2 +- code/deprecated/builder-manager/package.json | 2 +- code/deprecated/channels/package.json | 2 +- code/deprecated/client-logger/package.json | 2 +- code/deprecated/components/package.json | 2 +- code/deprecated/core-common/package.json | 2 +- code/deprecated/core-events/package.json | 2 +- code/deprecated/core-server/package.json | 2 +- code/deprecated/csf-tools/package.json | 2 +- code/deprecated/docs-tools/package.json | 2 +- code/deprecated/manager-api/package.json | 2 +- code/deprecated/manager/package.json | 2 +- code/deprecated/node-logger/package.json | 2 +- code/deprecated/preview-api/package.json | 2 +- code/deprecated/preview/package.json | 2 +- code/deprecated/router/package.json | 2 +- code/deprecated/telemetry/package.json | 2 +- code/deprecated/theming/package.json | 2 +- code/deprecated/types/package.json | 2 +- code/frameworks/angular/package.json | 2 +- code/frameworks/ember/package.json | 2 +- .../experimental-nextjs-vite/package.json | 2 +- code/frameworks/html-vite/package.json | 2 +- code/frameworks/html-webpack5/package.json | 2 +- code/frameworks/nextjs/package.json | 2 +- code/frameworks/preact-vite/package.json | 2 +- code/frameworks/preact-webpack5/package.json | 2 +- code/frameworks/react-vite/package.json | 2 +- code/frameworks/react-webpack5/package.json | 2 +- code/frameworks/server-webpack5/package.json | 2 +- code/frameworks/svelte-vite/package.json | 2 +- code/frameworks/svelte-webpack5/package.json | 2 +- code/frameworks/sveltekit/package.json | 2 +- code/frameworks/vue3-vite/package.json | 2 +- code/frameworks/vue3-webpack5/package.json | 2 +- .../web-components-vite/package.json | 2 +- .../web-components-webpack5/package.json | 2 +- code/lib/blocks/package.json | 2 +- code/lib/cli-sb/package.json | 2 +- code/lib/cli-storybook/package.json | 2 +- code/lib/cli/package.json | 2 +- code/lib/codemod/package.json | 2 +- code/lib/core-webpack/package.json | 2 +- code/lib/create-storybook/package.json | 2 +- code/lib/csf-plugin/package.json | 2 +- code/lib/instrumenter/package.json | 2 +- code/lib/react-dom-shim/package.json | 2 +- code/lib/source-loader/package.json | 2 +- code/lib/test/package.json | 2 +- code/package.json | 5 +- code/presets/create-react-app/package.json | 2 +- code/presets/html-webpack/package.json | 2 +- code/presets/preact-webpack/package.json | 2 +- code/presets/react-webpack/package.json | 2 +- code/presets/server-webpack/package.json | 2 +- code/presets/svelte-webpack/package.json | 2 +- code/presets/vue3-webpack/package.json | 2 +- code/renderers/html/package.json | 2 +- code/renderers/preact/package.json | 2 +- code/renderers/react/package.json | 2 +- code/renderers/server/package.json | 2 +- code/renderers/svelte/package.json | 2 +- code/renderers/vue3/package.json | 2 +- code/renderers/web-components/package.json | 2 +- 87 files changed, 171 insertions(+), 172 deletions(-) diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index a9b14e39eb19..9929da5ad4c5 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-a11y", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Test component compliance with web accessibility standards", "keywords": [ "a11y", diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json index 76e4f673f551..2ba921c82226 100644 --- a/code/addons/actions/package.json +++ b/code/addons/actions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-actions", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Get UI feedback when an action is performed on an interactive element", "keywords": [ "storybook", diff --git a/code/addons/backgrounds/package.json b/code/addons/backgrounds/package.json index c08e691db0f2..a0fe70724301 100644 --- a/code/addons/backgrounds/package.json +++ b/code/addons/backgrounds/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-backgrounds", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Switch backgrounds to view components in different settings", "keywords": [ "addon", diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json index e7cf6f0530ad..7f9d214c61f9 100644 --- a/code/addons/controls/package.json +++ b/code/addons/controls/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-controls", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Interact with component inputs dynamically in the Storybook UI", "keywords": [ "addon", diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index f54f9dd093f9..3ada1b5b2842 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-docs", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Document component usage and properties in Markdown", "keywords": [ "addon", diff --git a/code/addons/essentials/package.json b/code/addons/essentials/package.json index a752f483dd7f..23b976a6ee16 100644 --- a/code/addons/essentials/package.json +++ b/code/addons/essentials/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-essentials", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Curated addons to bring out the best of Storybook", "keywords": [ "addon", diff --git a/code/addons/gfm/package.json b/code/addons/gfm/package.json index 5a5ea206f0fc..62fea2facbec 100644 --- a/code/addons/gfm/package.json +++ b/code/addons/gfm/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-mdx-gfm", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "GitHub Flavored Markdown in Storybook", "keywords": [ "addon", diff --git a/code/addons/highlight/package.json b/code/addons/highlight/package.json index 173dea25fd0f..2fc94cadf861 100644 --- a/code/addons/highlight/package.json +++ b/code/addons/highlight/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-highlight", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Highlight DOM nodes within your stories", "keywords": [ "storybook-addons", diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index 0873e9397ceb..8aa79d677ae7 100644 --- a/code/addons/interactions/package.json +++ b/code/addons/interactions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-interactions", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Automate, test and debug user interactions", "keywords": [ "storybook-addons", diff --git a/code/addons/jest/package.json b/code/addons/jest/package.json index 50395747b347..8d3b62b94778 100644 --- a/code/addons/jest/package.json +++ b/code/addons/jest/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-jest", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "React storybook addon that show component jest report", "keywords": [ "addon", diff --git a/code/addons/links/package.json b/code/addons/links/package.json index 4467f4116aa0..87017f5a5ca5 100644 --- a/code/addons/links/package.json +++ b/code/addons/links/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-links", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Link stories together to build demos and prototypes with your UI components", "keywords": [ "storybook-addons", diff --git a/code/addons/measure/package.json b/code/addons/measure/package.json index 4ef6eeaf7e4c..4ee59d9b1a11 100644 --- a/code/addons/measure/package.json +++ b/code/addons/measure/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-measure", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Inspect layouts by visualizing the box model", "keywords": [ "storybook-addons", diff --git a/code/addons/onboarding/package.json b/code/addons/onboarding/package.json index 9f1f2c6f2516..1866a4c7a23e 100644 --- a/code/addons/onboarding/package.json +++ b/code/addons/onboarding/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-onboarding", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook Addon Onboarding - Introduces a new onboarding experience", "keywords": [ "storybook-addons", diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json index dc858115c2df..a77565af1a58 100644 --- a/code/addons/outline/package.json +++ b/code/addons/outline/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-outline", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Outline all elements with CSS to help with layout placement and alignment", "keywords": [ "storybook-addons", diff --git a/code/addons/storysource/package.json b/code/addons/storysource/package.json index 821bac4c9c25..91686a297644 100644 --- a/code/addons/storysource/package.json +++ b/code/addons/storysource/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storysource", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "View a story’s source code to see how it works and paste into your app", "keywords": [ "addon", diff --git a/code/addons/test/package.json b/code/addons/test/package.json index e6466e73c5e2..91eda6ad642f 100644 --- a/code/addons/test/package.json +++ b/code/addons/test/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/experimental-addon-test", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Integrate Vitest with Storybook", "keywords": [ "storybook-addons", diff --git a/code/addons/themes/package.json b/code/addons/themes/package.json index c6991f923b72..b8c6558b3775 100644 --- a/code/addons/themes/package.json +++ b/code/addons/themes/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-themes", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Switch between multiple themes for you components in Storybook", "keywords": [ "css", diff --git a/code/addons/toolbars/package.json b/code/addons/toolbars/package.json index a83c4e024eae..76a1b7027e12 100644 --- a/code/addons/toolbars/package.json +++ b/code/addons/toolbars/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-toolbars", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Create your own toolbar items that control story rendering", "keywords": [ "addon", diff --git a/code/addons/viewport/package.json b/code/addons/viewport/package.json index cc885522186e..89f88480704a 100644 --- a/code/addons/viewport/package.json +++ b/code/addons/viewport/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-viewport", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Build responsive components by adjusting Storybook’s viewport size and orientation", "keywords": [ "addon", diff --git a/code/builders/builder-vite/package.json b/code/builders/builder-vite/package.json index 1ffc4942e8b9..4486e411c45d 100644 --- a/code/builders/builder-vite/package.json +++ b/code/builders/builder-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-vite", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "A plugin to run and build Storybooks with Vite", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/builders/builder-vite/#readme", "bugs": { diff --git a/code/builders/builder-webpack5/package.json b/code/builders/builder-webpack5/package.json index 6da556c43e8c..c4ecddf9347f 100644 --- a/code/builders/builder-webpack5/package.json +++ b/code/builders/builder-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-webpack5", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/core/package.json b/code/core/package.json index fa40c03053e0..a68f7f8a0d13 100644 --- a/code/core/package.json +++ b/code/core/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/core/src/common/versions.ts b/code/core/src/common/versions.ts index 1f2b5d2aef7d..03638c05d5a1 100644 --- a/code/core/src/common/versions.ts +++ b/code/core/src/common/versions.ts @@ -1,87 +1,87 @@ // auto generated file, do not edit export default { - '@storybook/addon-a11y': '8.4.0-alpha.6', - '@storybook/addon-actions': '8.4.0-alpha.6', - '@storybook/addon-backgrounds': '8.4.0-alpha.6', - '@storybook/addon-controls': '8.4.0-alpha.6', - '@storybook/addon-docs': '8.4.0-alpha.6', - '@storybook/addon-essentials': '8.4.0-alpha.6', - '@storybook/addon-mdx-gfm': '8.4.0-alpha.6', - '@storybook/addon-highlight': '8.4.0-alpha.6', - '@storybook/addon-interactions': '8.4.0-alpha.6', - '@storybook/addon-jest': '8.4.0-alpha.6', - '@storybook/addon-links': '8.4.0-alpha.6', - '@storybook/addon-measure': '8.4.0-alpha.6', - '@storybook/addon-onboarding': '8.4.0-alpha.6', - '@storybook/addon-outline': '8.4.0-alpha.6', - '@storybook/addon-storysource': '8.4.0-alpha.6', - '@storybook/experimental-addon-test': '8.4.0-alpha.6', - '@storybook/addon-themes': '8.4.0-alpha.6', - '@storybook/addon-toolbars': '8.4.0-alpha.6', - '@storybook/addon-viewport': '8.4.0-alpha.6', - '@storybook/builder-vite': '8.4.0-alpha.6', - '@storybook/builder-webpack5': '8.4.0-alpha.6', - '@storybook/core': '8.4.0-alpha.6', - '@storybook/builder-manager': '8.4.0-alpha.6', - '@storybook/channels': '8.4.0-alpha.6', - '@storybook/client-logger': '8.4.0-alpha.6', - '@storybook/components': '8.4.0-alpha.6', - '@storybook/core-common': '8.4.0-alpha.6', - '@storybook/core-events': '8.4.0-alpha.6', - '@storybook/core-server': '8.4.0-alpha.6', - '@storybook/csf-tools': '8.4.0-alpha.6', - '@storybook/docs-tools': '8.4.0-alpha.6', - '@storybook/manager': '8.4.0-alpha.6', - '@storybook/manager-api': '8.4.0-alpha.6', - '@storybook/node-logger': '8.4.0-alpha.6', - '@storybook/preview': '8.4.0-alpha.6', - '@storybook/preview-api': '8.4.0-alpha.6', - '@storybook/router': '8.4.0-alpha.6', - '@storybook/telemetry': '8.4.0-alpha.6', - '@storybook/theming': '8.4.0-alpha.6', - '@storybook/types': '8.4.0-alpha.6', - '@storybook/angular': '8.4.0-alpha.6', - '@storybook/ember': '8.4.0-alpha.6', - '@storybook/experimental-nextjs-vite': '8.4.0-alpha.6', - '@storybook/html-vite': '8.4.0-alpha.6', - '@storybook/html-webpack5': '8.4.0-alpha.6', - '@storybook/nextjs': '8.4.0-alpha.6', - '@storybook/preact-vite': '8.4.0-alpha.6', - '@storybook/preact-webpack5': '8.4.0-alpha.6', - '@storybook/react-vite': '8.4.0-alpha.6', - '@storybook/react-webpack5': '8.4.0-alpha.6', - '@storybook/server-webpack5': '8.4.0-alpha.6', - '@storybook/svelte-vite': '8.4.0-alpha.6', - '@storybook/svelte-webpack5': '8.4.0-alpha.6', - '@storybook/sveltekit': '8.4.0-alpha.6', - '@storybook/vue3-vite': '8.4.0-alpha.6', - '@storybook/vue3-webpack5': '8.4.0-alpha.6', - '@storybook/web-components-vite': '8.4.0-alpha.6', - '@storybook/web-components-webpack5': '8.4.0-alpha.6', - '@storybook/blocks': '8.4.0-alpha.6', - storybook: '8.4.0-alpha.6', - sb: '8.4.0-alpha.6', - '@storybook/cli': '8.4.0-alpha.6', - '@storybook/codemod': '8.4.0-alpha.6', - '@storybook/core-webpack': '8.4.0-alpha.6', - 'create-storybook': '8.4.0-alpha.6', - '@storybook/csf-plugin': '8.4.0-alpha.6', - '@storybook/instrumenter': '8.4.0-alpha.6', - '@storybook/react-dom-shim': '8.4.0-alpha.6', - '@storybook/source-loader': '8.4.0-alpha.6', - '@storybook/test': '8.4.0-alpha.6', - '@storybook/preset-create-react-app': '8.4.0-alpha.6', - '@storybook/preset-html-webpack': '8.4.0-alpha.6', - '@storybook/preset-preact-webpack': '8.4.0-alpha.6', - '@storybook/preset-react-webpack': '8.4.0-alpha.6', - '@storybook/preset-server-webpack': '8.4.0-alpha.6', - '@storybook/preset-svelte-webpack': '8.4.0-alpha.6', - '@storybook/preset-vue3-webpack': '8.4.0-alpha.6', - '@storybook/html': '8.4.0-alpha.6', - '@storybook/preact': '8.4.0-alpha.6', - '@storybook/react': '8.4.0-alpha.6', - '@storybook/server': '8.4.0-alpha.6', - '@storybook/svelte': '8.4.0-alpha.6', - '@storybook/vue3': '8.4.0-alpha.6', - '@storybook/web-components': '8.4.0-alpha.6', + '@storybook/addon-a11y': '8.4.0-alpha.7', + '@storybook/addon-actions': '8.4.0-alpha.7', + '@storybook/addon-backgrounds': '8.4.0-alpha.7', + '@storybook/addon-controls': '8.4.0-alpha.7', + '@storybook/addon-docs': '8.4.0-alpha.7', + '@storybook/addon-essentials': '8.4.0-alpha.7', + '@storybook/addon-mdx-gfm': '8.4.0-alpha.7', + '@storybook/addon-highlight': '8.4.0-alpha.7', + '@storybook/addon-interactions': '8.4.0-alpha.7', + '@storybook/addon-jest': '8.4.0-alpha.7', + '@storybook/addon-links': '8.4.0-alpha.7', + '@storybook/addon-measure': '8.4.0-alpha.7', + '@storybook/addon-onboarding': '8.4.0-alpha.7', + '@storybook/addon-outline': '8.4.0-alpha.7', + '@storybook/addon-storysource': '8.4.0-alpha.7', + '@storybook/experimental-addon-test': '8.4.0-alpha.7', + '@storybook/addon-themes': '8.4.0-alpha.7', + '@storybook/addon-toolbars': '8.4.0-alpha.7', + '@storybook/addon-viewport': '8.4.0-alpha.7', + '@storybook/builder-vite': '8.4.0-alpha.7', + '@storybook/builder-webpack5': '8.4.0-alpha.7', + '@storybook/core': '8.4.0-alpha.7', + '@storybook/builder-manager': '8.4.0-alpha.7', + '@storybook/channels': '8.4.0-alpha.7', + '@storybook/client-logger': '8.4.0-alpha.7', + '@storybook/components': '8.4.0-alpha.7', + '@storybook/core-common': '8.4.0-alpha.7', + '@storybook/core-events': '8.4.0-alpha.7', + '@storybook/core-server': '8.4.0-alpha.7', + '@storybook/csf-tools': '8.4.0-alpha.7', + '@storybook/docs-tools': '8.4.0-alpha.7', + '@storybook/manager': '8.4.0-alpha.7', + '@storybook/manager-api': '8.4.0-alpha.7', + '@storybook/node-logger': '8.4.0-alpha.7', + '@storybook/preview': '8.4.0-alpha.7', + '@storybook/preview-api': '8.4.0-alpha.7', + '@storybook/router': '8.4.0-alpha.7', + '@storybook/telemetry': '8.4.0-alpha.7', + '@storybook/theming': '8.4.0-alpha.7', + '@storybook/types': '8.4.0-alpha.7', + '@storybook/angular': '8.4.0-alpha.7', + '@storybook/ember': '8.4.0-alpha.7', + '@storybook/experimental-nextjs-vite': '8.4.0-alpha.7', + '@storybook/html-vite': '8.4.0-alpha.7', + '@storybook/html-webpack5': '8.4.0-alpha.7', + '@storybook/nextjs': '8.4.0-alpha.7', + '@storybook/preact-vite': '8.4.0-alpha.7', + '@storybook/preact-webpack5': '8.4.0-alpha.7', + '@storybook/react-vite': '8.4.0-alpha.7', + '@storybook/react-webpack5': '8.4.0-alpha.7', + '@storybook/server-webpack5': '8.4.0-alpha.7', + '@storybook/svelte-vite': '8.4.0-alpha.7', + '@storybook/svelte-webpack5': '8.4.0-alpha.7', + '@storybook/sveltekit': '8.4.0-alpha.7', + '@storybook/vue3-vite': '8.4.0-alpha.7', + '@storybook/vue3-webpack5': '8.4.0-alpha.7', + '@storybook/web-components-vite': '8.4.0-alpha.7', + '@storybook/web-components-webpack5': '8.4.0-alpha.7', + '@storybook/blocks': '8.4.0-alpha.7', + storybook: '8.4.0-alpha.7', + sb: '8.4.0-alpha.7', + '@storybook/cli': '8.4.0-alpha.7', + '@storybook/codemod': '8.4.0-alpha.7', + '@storybook/core-webpack': '8.4.0-alpha.7', + 'create-storybook': '8.4.0-alpha.7', + '@storybook/csf-plugin': '8.4.0-alpha.7', + '@storybook/instrumenter': '8.4.0-alpha.7', + '@storybook/react-dom-shim': '8.4.0-alpha.7', + '@storybook/source-loader': '8.4.0-alpha.7', + '@storybook/test': '8.4.0-alpha.7', + '@storybook/preset-create-react-app': '8.4.0-alpha.7', + '@storybook/preset-html-webpack': '8.4.0-alpha.7', + '@storybook/preset-preact-webpack': '8.4.0-alpha.7', + '@storybook/preset-react-webpack': '8.4.0-alpha.7', + '@storybook/preset-server-webpack': '8.4.0-alpha.7', + '@storybook/preset-svelte-webpack': '8.4.0-alpha.7', + '@storybook/preset-vue3-webpack': '8.4.0-alpha.7', + '@storybook/html': '8.4.0-alpha.7', + '@storybook/preact': '8.4.0-alpha.7', + '@storybook/react': '8.4.0-alpha.7', + '@storybook/server': '8.4.0-alpha.7', + '@storybook/svelte': '8.4.0-alpha.7', + '@storybook/vue3': '8.4.0-alpha.7', + '@storybook/web-components': '8.4.0-alpha.7', }; diff --git a/code/core/src/manager-api/version.ts b/code/core/src/manager-api/version.ts index 3e7463603e83..de04e48fe1b3 100644 --- a/code/core/src/manager-api/version.ts +++ b/code/core/src/manager-api/version.ts @@ -1 +1 @@ -export const version = '8.4.0-alpha.6'; +export const version = '8.4.0-alpha.7'; diff --git a/code/deprecated/builder-manager/package.json b/code/deprecated/builder-manager/package.json index e934907f9b14..55ea89cc1ffe 100644 --- a/code/deprecated/builder-manager/package.json +++ b/code/deprecated/builder-manager/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-manager", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook manager builder", "keywords": [ "storybook" diff --git a/code/deprecated/channels/package.json b/code/deprecated/channels/package.json index 0436cb647d46..2959a41fa039 100644 --- a/code/deprecated/channels/package.json +++ b/code/deprecated/channels/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channels", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/client-logger/package.json b/code/deprecated/client-logger/package.json index d1323998298c..325aabfeeb3d 100644 --- a/code/deprecated/client-logger/package.json +++ b/code/deprecated/client-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/client-logger", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/components/package.json b/code/deprecated/components/package.json index 2d398c4ab7ae..48cf196630e4 100644 --- a/code/deprecated/components/package.json +++ b/code/deprecated/components/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/components", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Core Storybook Components", "keywords": [ "storybook" diff --git a/code/deprecated/core-common/package.json b/code/deprecated/core-common/package.json index eb392f0fbdde..3e651691a07a 100644 --- a/code/deprecated/core-common/package.json +++ b/code/deprecated/core-common/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-common", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/deprecated/core-events/package.json b/code/deprecated/core-events/package.json index 3230ef8494e4..8ece8cc79411 100644 --- a/code/deprecated/core-events/package.json +++ b/code/deprecated/core-events/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-events", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Event names used in storybook core", "keywords": [ "storybook" diff --git a/code/deprecated/core-server/package.json b/code/deprecated/core-server/package.json index bf9132d6a8fc..eeac3f147d25 100644 --- a/code/deprecated/core-server/package.json +++ b/code/deprecated/core-server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-server", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/deprecated/csf-tools/package.json b/code/deprecated/csf-tools/package.json index bf3373793dae..29d6b33b414a 100644 --- a/code/deprecated/csf-tools/package.json +++ b/code/deprecated/csf-tools/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/csf-tools", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Parse and manipulate CSF and Storybook config files", "keywords": [ "storybook" diff --git a/code/deprecated/docs-tools/package.json b/code/deprecated/docs-tools/package.json index 51b035d50216..b4e6406baa56 100644 --- a/code/deprecated/docs-tools/package.json +++ b/code/deprecated/docs-tools/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/docs-tools", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Shared utility functions for frameworks to implement docs", "keywords": [ "storybook" diff --git a/code/deprecated/manager-api/package.json b/code/deprecated/manager-api/package.json index 2fdedd7db193..06a2697a407c 100644 --- a/code/deprecated/manager-api/package.json +++ b/code/deprecated/manager-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/manager-api", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Core Storybook Manager API & Context", "keywords": [ "storybook" diff --git a/code/deprecated/manager/package.json b/code/deprecated/manager/package.json index 256121c97eca..e09af35c9f0e 100644 --- a/code/deprecated/manager/package.json +++ b/code/deprecated/manager/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/manager", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Core Storybook UI", "keywords": [ "storybook" diff --git a/code/deprecated/node-logger/package.json b/code/deprecated/node-logger/package.json index bf91317796eb..641a398be8f5 100644 --- a/code/deprecated/node-logger/package.json +++ b/code/deprecated/node-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/node-logger", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/preview-api/package.json b/code/deprecated/preview-api/package.json index 442b27074ef0..70469323bda0 100644 --- a/code/deprecated/preview-api/package.json +++ b/code/deprecated/preview-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview-api", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/preview/package.json b/code/deprecated/preview/package.json index 05c15f015b34..3cdbd0f6ba5e 100644 --- a/code/deprecated/preview/package.json +++ b/code/deprecated/preview/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "", "keywords": [ "storybook" diff --git a/code/deprecated/router/package.json b/code/deprecated/router/package.json index 8863504f4040..8beb6975d4a3 100644 --- a/code/deprecated/router/package.json +++ b/code/deprecated/router/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/router", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Core Storybook Router", "keywords": [ "storybook" diff --git a/code/deprecated/telemetry/package.json b/code/deprecated/telemetry/package.json index 0b1eb51a7ae9..bcfcbb572486 100644 --- a/code/deprecated/telemetry/package.json +++ b/code/deprecated/telemetry/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/telemetry", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Telemetry logging for crash reports and usage statistics", "keywords": [ "storybook" diff --git a/code/deprecated/theming/package.json b/code/deprecated/theming/package.json index b53d7599a2e4..ed155f9adc27 100644 --- a/code/deprecated/theming/package.json +++ b/code/deprecated/theming/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/theming", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Core Storybook Components", "keywords": [ "storybook" diff --git a/code/deprecated/types/package.json b/code/deprecated/types/package.json index 1a9401f7ef31..f6132c644861 100644 --- a/code/deprecated/types/package.json +++ b/code/deprecated/types/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/types", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Core Storybook TS Types", "keywords": [ "storybook" diff --git a/code/frameworks/angular/package.json b/code/frameworks/angular/package.json index 83c0e69c1bc8..6a36b0f5807a 100644 --- a/code/frameworks/angular/package.json +++ b/code/frameworks/angular/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/angular", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.", "keywords": [ "storybook", diff --git a/code/frameworks/ember/package.json b/code/frameworks/ember/package.json index f3ff8f099ae1..6368bde66552 100644 --- a/code/frameworks/ember/package.json +++ b/code/frameworks/ember/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/ember", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/ember", "bugs": { diff --git a/code/frameworks/experimental-nextjs-vite/package.json b/code/frameworks/experimental-nextjs-vite/package.json index dd1f137219e0..6f7a3fb395b4 100644 --- a/code/frameworks/experimental-nextjs-vite/package.json +++ b/code/frameworks/experimental-nextjs-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/experimental-nextjs-vite", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for Next.js and Vite", "keywords": [ "storybook", diff --git a/code/frameworks/html-vite/package.json b/code/frameworks/html-vite/package.json index 024d64fb0f8e..5a2d3846ca4d 100644 --- a/code/frameworks/html-vite/package.json +++ b/code/frameworks/html-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html-vite", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for HTML and Vite: Develop HTML in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/html-webpack5/package.json b/code/frameworks/html-webpack5/package.json index 20d06b691009..64d5544f2f71 100644 --- a/code/frameworks/html-webpack5/package.json +++ b/code/frameworks/html-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html-webpack5", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/nextjs/package.json b/code/frameworks/nextjs/package.json index df683a8f5226..dc4be0600c67 100644 --- a/code/frameworks/nextjs/package.json +++ b/code/frameworks/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/nextjs", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for Next.js", "keywords": [ "storybook", diff --git a/code/frameworks/preact-vite/package.json b/code/frameworks/preact-vite/package.json index 9a13683d3693..9b9f0b3a4623 100644 --- a/code/frameworks/preact-vite/package.json +++ b/code/frameworks/preact-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact-vite", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for Preact and Vite: Develop Preact components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/preact-webpack5/package.json b/code/frameworks/preact-webpack5/package.json index 4b2da816dbc4..86de08ba035f 100644 --- a/code/frameworks/preact-webpack5/package.json +++ b/code/frameworks/preact-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact-webpack5", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" diff --git a/code/frameworks/react-vite/package.json b/code/frameworks/react-vite/package.json index 07d799ad2f7e..d51e29ed8d10 100644 --- a/code/frameworks/react-vite/package.json +++ b/code/frameworks/react-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-vite", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/react-webpack5/package.json b/code/frameworks/react-webpack5/package.json index 0c64a575a31e..1c39f5a44b99 100644 --- a/code/frameworks/react-webpack5/package.json +++ b/code/frameworks/react-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-webpack5", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/server-webpack5/package.json b/code/frameworks/server-webpack5/package.json index 44511928801c..caa7296cc335 100644 --- a/code/frameworks/server-webpack5/package.json +++ b/code/frameworks/server-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server-webpack5", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/svelte-vite/package.json b/code/frameworks/svelte-vite/package.json index e3f06894167d..0fa571b8cb0f 100644 --- a/code/frameworks/svelte-vite/package.json +++ b/code/frameworks/svelte-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte-vite", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for Svelte and Vite: Develop Svelte components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/svelte-webpack5/package.json b/code/frameworks/svelte-webpack5/package.json index 707e21cf75cc..c3ef079637ef 100644 --- a/code/frameworks/svelte-webpack5/package.json +++ b/code/frameworks/svelte-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte-webpack5", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/sveltekit/package.json b/code/frameworks/sveltekit/package.json index 0b1a39539ac5..3371c67e61d6 100644 --- a/code/frameworks/sveltekit/package.json +++ b/code/frameworks/sveltekit/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/sveltekit", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for SvelteKit", "keywords": [ "storybook", diff --git a/code/frameworks/vue3-vite/package.json b/code/frameworks/vue3-vite/package.json index b58b9904cd1a..682383e94dd0 100644 --- a/code/frameworks/vue3-vite/package.json +++ b/code/frameworks/vue3-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3-vite", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for Vue3 and Vite: Develop Vue3 components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/vue3-webpack5/package.json b/code/frameworks/vue3-webpack5/package.json index 49a3cef60359..650d040f09ca 100644 --- a/code/frameworks/vue3-webpack5/package.json +++ b/code/frameworks/vue3-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3-webpack5", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/web-components-vite/package.json b/code/frameworks/web-components-vite/package.json index 90c2abe2cc49..9e3d1e09c398 100644 --- a/code/frameworks/web-components-vite/package.json +++ b/code/frameworks/web-components-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components-vite", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for web-components and Vite: Develop Web Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/web-components-webpack5/package.json b/code/frameworks/web-components-webpack5/package.json index 48c89238af3d..b431b08ce7cc 100644 --- a/code/frameworks/web-components-webpack5/package.json +++ b/code/frameworks/web-components-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components-webpack5", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.", "keywords": [ "lit", diff --git a/code/lib/blocks/package.json b/code/lib/blocks/package.json index c713a99ebf45..1cfab3fadf71 100644 --- a/code/lib/blocks/package.json +++ b/code/lib/blocks/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/blocks", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook Doc Blocks", "keywords": [ "storybook" diff --git a/code/lib/cli-sb/package.json b/code/lib/cli-sb/package.json index 93269c7c4449..d803ca1246ab 100644 --- a/code/lib/cli-sb/package.json +++ b/code/lib/cli-sb/package.json @@ -1,6 +1,6 @@ { "name": "sb", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook CLI", "keywords": [ "storybook" diff --git a/code/lib/cli-storybook/package.json b/code/lib/cli-storybook/package.json index c67eecd7aeaf..2a1e908cdf6e 100644 --- a/code/lib/cli-storybook/package.json +++ b/code/lib/cli-storybook/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/cli", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook CLI", "keywords": [ "storybook" diff --git a/code/lib/cli/package.json b/code/lib/cli/package.json index db2ab24c2871..88454e37529f 100644 --- a/code/lib/cli/package.json +++ b/code/lib/cli/package.json @@ -1,6 +1,6 @@ { "name": "storybook", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook's CLI - install, dev, build, upgrade, and more", "keywords": [ "cli", diff --git a/code/lib/codemod/package.json b/code/lib/codemod/package.json index c450b993d8cf..679fb6032099 100644 --- a/code/lib/codemod/package.json +++ b/code/lib/codemod/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/codemod", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "A collection of codemod scripts written with JSCodeshift", "keywords": [ "storybook" diff --git a/code/lib/core-webpack/package.json b/code/lib/core-webpack/package.json index 87bcc3acf5af..099a9c01ec47 100644 --- a/code/lib/core-webpack/package.json +++ b/code/lib/core-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-webpack", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/lib/create-storybook/package.json b/code/lib/create-storybook/package.json index c0631a738814..74b31d3aa46e 100644 --- a/code/lib/create-storybook/package.json +++ b/code/lib/create-storybook/package.json @@ -1,6 +1,6 @@ { "name": "create-storybook", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Initialize Storybook into your project", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/lib/create-storybook", "bugs": { diff --git a/code/lib/csf-plugin/package.json b/code/lib/csf-plugin/package.json index 3c5b00e8ba4f..9cfc419b5af5 100644 --- a/code/lib/csf-plugin/package.json +++ b/code/lib/csf-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/csf-plugin", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Enrich CSF files via static analysis", "keywords": [ "storybook" diff --git a/code/lib/instrumenter/package.json b/code/lib/instrumenter/package.json index 08d0efeabbb4..04d6624131ca 100644 --- a/code/lib/instrumenter/package.json +++ b/code/lib/instrumenter/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/instrumenter", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "", "keywords": [ "storybook" diff --git a/code/lib/react-dom-shim/package.json b/code/lib/react-dom-shim/package.json index 35c20f531d52..b7712437a2ad 100644 --- a/code/lib/react-dom-shim/package.json +++ b/code/lib/react-dom-shim/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-dom-shim", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "", "keywords": [ "storybook" diff --git a/code/lib/source-loader/package.json b/code/lib/source-loader/package.json index b58751b4f8fa..4545ef26d8fc 100644 --- a/code/lib/source-loader/package.json +++ b/code/lib/source-loader/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/source-loader", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Source loader", "keywords": [ "lib", diff --git a/code/lib/test/package.json b/code/lib/test/package.json index 02ae1082974c..e144837404fb 100644 --- a/code/lib/test/package.json +++ b/code/lib/test/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/test", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "", "keywords": [ "storybook" diff --git a/code/package.json b/code/package.json index fd61251fa13f..c0aa1f651051 100644 --- a/code/package.json +++ b/code/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/root", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "private": true, "description": "Storybook root", "homepage": "https://storybook.js.org/", @@ -293,6 +293,5 @@ "Dependency Upgrades" ] ] - }, - "deferredNextVersion": "8.4.0-alpha.7" + } } diff --git a/code/presets/create-react-app/package.json b/code/presets/create-react-app/package.json index 440bed5ca22c..a566c2f465c4 100644 --- a/code/presets/create-react-app/package.json +++ b/code/presets/create-react-app/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-create-react-app", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for Create React App preset", "keywords": [ "storybook" diff --git a/code/presets/html-webpack/package.json b/code/presets/html-webpack/package.json index 907be048f235..431dbc0d0b15 100644 --- a/code/presets/html-webpack/package.json +++ b/code/presets/html-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-html-webpack", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/preact-webpack/package.json b/code/presets/preact-webpack/package.json index 6149b9b39966..97681802923a 100644 --- a/code/presets/preact-webpack/package.json +++ b/code/presets/preact-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-preact-webpack", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" diff --git a/code/presets/react-webpack/package.json b/code/presets/react-webpack/package.json index c4545042945b..62671290832c 100644 --- a/code/presets/react-webpack/package.json +++ b/code/presets/react-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-react-webpack", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading", "keywords": [ "storybook" diff --git a/code/presets/server-webpack/package.json b/code/presets/server-webpack/package.json index 5c12e755277f..b27e1969af9c 100644 --- a/code/presets/server-webpack/package.json +++ b/code/presets/server-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-server-webpack", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/svelte-webpack/package.json b/code/presets/svelte-webpack/package.json index 7a6db7a30d48..bc995f0e1f7d 100644 --- a/code/presets/svelte-webpack/package.json +++ b/code/presets/svelte-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-svelte-webpack", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/vue3-webpack/package.json b/code/presets/vue3-webpack/package.json index adf687f2198f..40d012335cea 100644 --- a/code/presets/vue3-webpack/package.json +++ b/code/presets/vue3-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-vue3-webpack", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/renderers/html/package.json b/code/renderers/html/package.json index d1fd583cc093..44398d844371 100644 --- a/code/renderers/html/package.json +++ b/code/renderers/html/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook HTML renderer", "keywords": [ "storybook" diff --git a/code/renderers/preact/package.json b/code/renderers/preact/package.json index 7b655c4f7f2a..25fbf00cb163 100644 --- a/code/renderers/preact/package.json +++ b/code/renderers/preact/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook Preact renderer", "keywords": [ "storybook" diff --git a/code/renderers/react/package.json b/code/renderers/react/package.json index 71c85982561f..f1180e122899 100644 --- a/code/renderers/react/package.json +++ b/code/renderers/react/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook React renderer", "keywords": [ "storybook" diff --git a/code/renderers/server/package.json b/code/renderers/server/package.json index a56cfca23e6c..9658133d098e 100644 --- a/code/renderers/server/package.json +++ b/code/renderers/server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook Server renderer", "keywords": [ "storybook" diff --git a/code/renderers/svelte/package.json b/code/renderers/svelte/package.json index d5c86963935f..db0cd01b454b 100644 --- a/code/renderers/svelte/package.json +++ b/code/renderers/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook Svelte renderer", "keywords": [ "storybook" diff --git a/code/renderers/vue3/package.json b/code/renderers/vue3/package.json index cdc676706504..01ea304a350d 100644 --- a/code/renderers/vue3/package.json +++ b/code/renderers/vue3/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook Vue 3 renderer", "keywords": [ "storybook" diff --git a/code/renderers/web-components/package.json b/code/renderers/web-components/package.json index b4b0d832e3b5..ab0d88f156a2 100644 --- a/code/renderers/web-components/package.json +++ b/code/renderers/web-components/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components", - "version": "8.4.0-alpha.6", + "version": "8.4.0-alpha.7", "description": "Storybook web-components renderer", "keywords": [ "lit", From a088fc080c3fc98db1ac2ae4db13b82628afbd37 Mon Sep 17 00:00:00 2001 From: David Leuliette Date: Mon, 14 Oct 2024 11:27:34 +0200 Subject: [PATCH 64/64] docs: drop /react slug from addons reference --- code/addons/actions/ADVANCED.md | 2 +- code/addons/actions/README.md | 2 +- code/addons/backgrounds/README.md | 2 +- code/addons/controls/README.md | 6 +++--- code/addons/docs/docs/props-tables.md | 6 +++--- code/addons/toolbars/README.md | 4 ++-- code/addons/viewport/README.md | 2 +- code/core/src/preview-api/modules/store/inferArgTypes.ts | 4 ++-- code/lib/blocks/src/blocks/Canvas.stories.tsx | 2 +- code/lib/blocks/src/components/ArgsTable/ArgControl.tsx | 2 +- code/lib/blocks/src/examples/CanvasParameters.stories.tsx | 2 +- code/lib/test/src/testing-library.ts | 2 +- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/code/addons/actions/ADVANCED.md b/code/addons/actions/ADVANCED.md index 7cca56342dee..d71320209288 100644 --- a/code/addons/actions/ADVANCED.md +++ b/code/addons/actions/ADVANCED.md @@ -1,6 +1,6 @@ ## Advanced/Legacy Actions usage -For basic usage, see the [documentation](https://storybook.js.org/docs/react/essentials/actions). +For basic usage, see the [documentation](https://storybook.js.org/docs/essentials/actions). This document describes the pre-6.0 usage of the addon, and as such is no longer recommended (although it will be supported until at least 7.0). diff --git a/code/addons/actions/README.md b/code/addons/actions/README.md index 80d2bd5d746c..a24f0e7052a2 100644 --- a/code/addons/actions/README.md +++ b/code/addons/actions/README.md @@ -24,4 +24,4 @@ export default { ## Usage -The basic usage is documented in the [documentation](https://storybook.js.org/docs/react/essentials/actions). For legacy usage, see the [advanced README](./ADVANCED.md). +The basic usage is documented in the [documentation](https://storybook.js.org/docs/essentials/actions). For legacy usage, see the [advanced README](./ADVANCED.md). diff --git a/code/addons/backgrounds/README.md b/code/addons/backgrounds/README.md index 481ba54bcd2f..a720847d4bf0 100644 --- a/code/addons/backgrounds/README.md +++ b/code/addons/backgrounds/README.md @@ -26,4 +26,4 @@ export default { ## Usage -The usage is documented in the [documentation](https://storybook.js.org/docs/react/essentials/backgrounds). +The usage is documented in the [documentation](https://storybook.js.org/docs/essentials/backgrounds). diff --git a/code/addons/controls/README.md b/code/addons/controls/README.md index 192a112e07fe..b3c097e53eeb 100644 --- a/code/addons/controls/README.md +++ b/code/addons/controls/README.md @@ -24,7 +24,7 @@ export default { ## Usage -The usage is documented in the [documentation](https://storybook.js.org/docs/react/essentials/controls). +The usage is documented in the [documentation](https://storybook.js.org/docs/essentials/controls). ## FAQs @@ -92,7 +92,7 @@ export const Reflow = () => { }; ``` -And again, as above, this can be rewritten using [fully custom args](https://storybook.js.org/docs/react/essentials/controls#fully-custom-args): +And again, as above, this can be rewritten using [fully custom args](https://storybook.js.org/docs/essentials/controls#fully-custom-args): ```jsx export const Reflow = ({ count, label, ...args }) => ( @@ -147,7 +147,7 @@ Basic.args = { }; ``` -The `argTypes` annotation (which can also be applied to individual stories if needed), gives Storybook the hints it needs to generate controls in these unsupported cases. See [control annotations](https://storybook.js.org/docs/react/essentials/controls#annotation) for a full list of control types. +The `argTypes` annotation (which can also be applied to individual stories if needed), gives Storybook the hints it needs to generate controls in these unsupported cases. See [control annotations](https://storybook.js.org/docs/essentials/controls#annotation) for a full list of control types. It's also possible that your Storybook is misconfigured. If you think this might be the case, please search through Storybook's [Github issues](https://github.com/storybookjs/storybook/issues), and file a new issue if you don't find one that matches your use case. diff --git a/code/addons/docs/docs/props-tables.md b/code/addons/docs/docs/props-tables.md index 7a44a6c653ae..6cb5029b00a6 100644 --- a/code/addons/docs/docs/props-tables.md +++ b/code/addons/docs/docs/props-tables.md @@ -82,7 +82,7 @@ export const WithControls = (args) => ; ``` -For a very detailed walkthrough of how to write stories that use controls, read the [documentation](https://storybook.js.org/docs/react/essentials/controls). +For a very detailed walkthrough of how to write stories that use controls, read the [documentation](https://storybook.js.org/docs/essentials/controls). ## Customization @@ -187,7 +187,7 @@ This would render a row with a modified description, a type display with a dropd > - `type: 'number'` is shorthand for `type: { name: 'number' }` > - `control: 'radio'` is shorthand for `control: { type: 'radio' }` -Controls customization has an entire section in the [documentation](https://storybook.js.org/docs/react/essentials/controls#configuration). +Controls customization has an entire section in the [documentation](https://storybook.js.org/docs/essentials/controls#configuration). Here are the possible customizations for the rest of the prop table: @@ -200,7 +200,7 @@ Here are the possible customizations for the rest of the prop table: | `table.type.detail` | A longer version of the type (if it's a complex type) | | `table.defaultValue.summary` | A short version of the default value | | `table.defaultValue.detail` | A longer version of the default value (if it's a complex value) | -| `control` | See [`addon-controls` README](https://storybook.js.org/docs/react/essentials/controls#configuration) | +| `control` | See [`addon-controls` README](https://storybook.js.org/docs/essentials/controls#configuration) | ## Reporting a bug diff --git a/code/addons/toolbars/README.md b/code/addons/toolbars/README.md index dcb9b9c4deef..2e37dc6c6168 100644 --- a/code/addons/toolbars/README.md +++ b/code/addons/toolbars/README.md @@ -28,7 +28,7 @@ export default { ## Usage -The usage is documented in the [documentation](https://storybook.js.org/docs/react/essentials/toolbars-and-globals). +The usage is documented in the [documentation](https://storybook.js.org/docs/essentials/toolbars-and-globals). ## FAQs @@ -40,6 +40,6 @@ The primary difference between the two packages is that `addon-toolbars` makes u - **Standardization**. Args are built into Storybook in 6.x. Since `addon-toolbars` is based on args, you don't need to learn any addon-specific APIs to use it. -- **Ergonomics**. Global args are easy to consume [in stories](https://storybook.js.org/docs/react/essentials/toolbars-and-globals#consuming-globals-from-within-a-story), in [Storybook Docs](https://github.com/storybookjs/storybook/tree/next/code/addons/docs), or even in other addons. +- **Ergonomics**. Global args are easy to consume [in stories](https://storybook.js.org/docs/essentials/toolbars-and-globals#consuming-globals-from-within-a-story), in [Storybook Docs](https://github.com/storybookjs/storybook/tree/next/code/addons/docs), or even in other addons. * **Framework compatibility**. Args are completely framework-independent, so `addon-toolbars` is compatible with React, Vue 3, Angular, etc. out of the box with no framework logic needed in the addon. diff --git a/code/addons/viewport/README.md b/code/addons/viewport/README.md index 7975688745fd..6444f180db9f 100644 --- a/code/addons/viewport/README.md +++ b/code/addons/viewport/README.md @@ -26,4 +26,4 @@ You should now be able to see the viewport addon icon in the toolbar at the top ## Usage -The usage is documented in the [documentation](https://storybook.js.org/docs/react/essentials/viewport). +The usage is documented in the [documentation](https://storybook.js.org/docs/essentials/viewport). diff --git a/code/core/src/preview-api/modules/store/inferArgTypes.ts b/code/core/src/preview-api/modules/store/inferArgTypes.ts index 007b4971a173..35e840fedcd8 100644 --- a/code/core/src/preview-api/modules/store/inferArgTypes.ts +++ b/code/core/src/preview-api/modules/store/inferArgTypes.ts @@ -25,8 +25,8 @@ const inferType = (value: any, name: string, visited: Set): SBType => { We've detected a cycle in arg '${name}'. Args should be JSON-serializable. Consider using the mapping feature or fully custom args: - - Mapping: https://storybook.js.org/docs/react/writing-stories/args#mapping-to-complex-arg-values - - Custom args: https://storybook.js.org/docs/react/essentials/controls#fully-custom-args + - Mapping: https://storybook.js.org/docs/writing-stories/args#mapping-to-complex-arg-values + - Custom args: https://storybook.js.org/docs/essentials/controls#fully-custom-args `); return { name: 'other', value: 'cyclic object' }; } diff --git a/code/lib/blocks/src/blocks/Canvas.stories.tsx b/code/lib/blocks/src/blocks/Canvas.stories.tsx index 4a7e25f6706d..bdedf650e534 100644 --- a/code/lib/blocks/src/blocks/Canvas.stories.tsx +++ b/code/lib/blocks/src/blocks/Canvas.stories.tsx @@ -94,7 +94,7 @@ export const PropAdditionalActions: Story = { title: 'Go to documentation', onClick: () => { window.open( - 'https://storybook.js.org/docs/react/essentials/controls#annotation', + 'https://storybook.js.org/docs/essentials/controls#annotation', '_blank' ); }, diff --git a/code/lib/blocks/src/components/ArgsTable/ArgControl.tsx b/code/lib/blocks/src/components/ArgsTable/ArgControl.tsx index 36e75aa81d36..e90609eb51c2 100644 --- a/code/lib/blocks/src/components/ArgsTable/ArgControl.tsx +++ b/code/lib/blocks/src/components/ArgsTable/ArgControl.tsx @@ -72,7 +72,7 @@ export const ArgControl: FC = ({ row, arg, updateArgs, isHovere const canBeSetup = control?.disable !== true && row?.type?.name !== 'function'; return isHovered && canBeSetup ? ( diff --git a/code/lib/blocks/src/examples/CanvasParameters.stories.tsx b/code/lib/blocks/src/examples/CanvasParameters.stories.tsx index aa9affefbfec..6f0c3cb3484c 100644 --- a/code/lib/blocks/src/examples/CanvasParameters.stories.tsx +++ b/code/lib/blocks/src/examples/CanvasParameters.stories.tsx @@ -31,7 +31,7 @@ export const AdditionalActions: Story = { title: 'Go to documentation', onClick: () => { window.open( - 'https://storybook.js.org/docs/react/essentials/controls#annotation', + 'https://storybook.js.org/docs/essentials/controls#annotation', '_blank' ); }, diff --git a/code/lib/test/src/testing-library.ts b/code/lib/test/src/testing-library.ts index 1aa814dafdce..4ff01e47eacf 100644 --- a/code/lib/test/src/testing-library.ts +++ b/code/lib/test/src/testing-library.ts @@ -28,7 +28,7 @@ testingLibrary.screen = new Proxy(testingLibrary.screen, { get(target, prop, receiver) { once.warn(dedent` You are using Testing Library's \`screen\` object. Use \`within(canvasElement)\` instead. - More info: https://storybook.js.org/docs/react/essentials/interactions + More info: https://storybook.js.org/docs/essentials/interactions `); return Reflect.get(target, prop, receiver); },