diff --git a/.circleci/config.yml b/.circleci/config.yml index 18ad245f250b..0708f3aec02f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -257,7 +257,7 @@ jobs: # executor: # class: large # name: sb_cypress_8_node_14 - # parallelism: 2 + # parallelism: 8 # steps: # - git-shallow-clone/checkout_advanced: # clone_options: '--depth 1 --verbose' @@ -462,7 +462,7 @@ jobs: executor: class: medium+ name: sb_node_14_browsers - parallelism: 2 + parallelism: 8 steps: - git-shallow-clone/checkout_advanced: clone_options: '--depth 1 --verbose' @@ -482,7 +482,7 @@ jobs: executor: class: medium+ name: sb_node_14_browsers - parallelism: 2 + parallelism: 8 steps: - git-shallow-clone/checkout_advanced: clone_options: '--depth 1 --verbose' @@ -498,7 +498,7 @@ jobs: executor: class: medium+ name: sb_node_14_browsers - parallelism: 2 + parallelism: 8 steps: - git-shallow-clone/checkout_advanced: clone_options: '--depth 1 --verbose' @@ -518,7 +518,7 @@ jobs: executor: class: medium+ name: sb_node_14_browsers - parallelism: 2 + parallelism: 8 steps: - git-shallow-clone/checkout_advanced: clone_options: '--depth 1 --verbose' @@ -534,7 +534,7 @@ jobs: executor: class: medium+ name: sb_node_14_browsers - parallelism: 2 + parallelism: 8 steps: - git-shallow-clone/checkout_advanced: clone_options: '--depth 1 --verbose' @@ -549,7 +549,7 @@ jobs: e2e-sandboxes: docker: - image: mcr.microsoft.com/playwright:v1.24.0-focal - parallelism: 2 + parallelism: 8 steps: - git-shallow-clone/checkout_advanced: clone_options: '--depth 1 --verbose' diff --git a/code/.eslintrc.js b/code/.eslintrc.js index 1129908e7eb0..0e590a380807 100644 --- a/code/.eslintrc.js +++ b/code/.eslintrc.js @@ -101,5 +101,11 @@ module.exports = { 'jest/no-test-callback': 'off', // These aren't jest tests }, }, + { + files: ['**/builder-vite/input/iframe.html'], + rules: { + 'no-undef': 'off', // ignore "window" undef errors + }, + }, ], }; diff --git a/code/lib/builder-vite/src/source-loader-plugin.ts b/code/lib/builder-vite/src/source-loader-plugin.ts index 65d5a4d2682a..2192653c9097 100644 --- a/code/lib/builder-vite/src/source-loader-plugin.ts +++ b/code/lib/builder-vite/src/source-loader-plugin.ts @@ -1,13 +1,17 @@ import type { Plugin } from 'vite'; import sourceLoaderTransform from '@storybook/source-loader'; -import type { ExtendedOptions } from './types'; import MagicString from 'magic-string'; +import type { ExtendedOptions } from './types'; const storyPattern = /\.stories\.[jt]sx?$/; const storySourcePattern = /var __STORY__ = "(.*)"/; const storySourceReplacement = '--STORY_SOURCE_REPLACEMENT--'; -const mockClassLoader = (id: string) => ({ emitWarning: (message: string) => console.warn(message), resourcePath: id }); +const mockClassLoader = (id: string) => ({ + // eslint-disable-next-line no-console + emitWarning: (message: string) => console.warn(message), + resourcePath: id, +}); // HACK: Until we can support only node 15+ and use string.prototype.replaceAll const replaceAll = (str: string, search: string, replacement: string) => { @@ -31,6 +35,7 @@ export function sourceLoaderPlugin(config: ExtendedOptions): Plugin | Plugin[] { map: s.generateMap({ hires: true, source: id }), }; } + return undefined; }, }; } @@ -66,6 +71,7 @@ export function sourceLoaderPlugin(config: ExtendedOptions): Plugin | Plugin[] { map: s.generateMap(), }; } + return undefined; }, }, { @@ -90,6 +96,7 @@ export function sourceLoaderPlugin(config: ExtendedOptions): Plugin | Plugin[] { map: s.generateMap(), }; } + return undefined; }, }, ]; diff --git a/code/lib/core-server/src/build-dev.ts b/code/lib/core-server/src/build-dev.ts index 365dafb9a734..ff25cd76112b 100644 --- a/code/lib/core-server/src/build-dev.ts +++ b/code/lib/core-server/src/build-dev.ts @@ -119,7 +119,7 @@ export async function buildDevStandalone(options: CLIOptions & LoadOptions & Bui if (options.smokeTest) { const warnings: Error[] = []; warnings.push(...((managerStats && managerStats.toJson().warnings) || [])); - warnings.push(...((managerStats && previewStats.toJson().warnings) || [])); + warnings.push(...((previewStats && previewStats.toJson().warnings) || [])); const problems = warnings .filter((warning) => !warning.message.includes(`export 'useInsertionEffect'`)) @@ -128,6 +128,7 @@ export async function buildDevStandalone(options: CLIOptions & LoadOptions & Bui (warning) => !warning.message.includes(`Conflicting values for 'process.env.NODE_ENV'`) ); + // eslint-disable-next-line no-console console.log(problems.map((p) => p.stack)); process.exit(problems.length > 0 ? 1 : 0); return; diff --git a/code/package.json b/code/package.json index 599c5232472e..ae2200157639 100644 --- a/code/package.json +++ b/code/package.json @@ -191,6 +191,7 @@ "@storybook/codemod": "workspace:*", "@storybook/components": "workspace:*", "@storybook/core-events": "workspace:*", + "@storybook/core-vite": "workspace:*", "@storybook/core-webpack": "workspace:*", "@storybook/csf-tools": "workspace:*", "@storybook/docs-tools": "workspace:*", diff --git a/scripts/build-package.js b/scripts/build-package.js index 70468be2e0ea..f9df57b1f7c2 100644 --- a/scripts/build-package.js +++ b/scripts/build-package.js @@ -113,7 +113,7 @@ async function run() { } selection?.filter(Boolean).forEach(async (v) => { - const commmand = (await readJSON(resolve(v.location, 'package.json'))).scripts.prep; + const commmand = (await readJSON(resolve(v.location, 'package.json'))).scripts.prepare; const cwd = resolve(__dirname, '..', 'code', v.location); const sub = require('execa').command( `${commmand}${watchMode ? ' --watch' : ''}${prodMode ? ' --optimized' : ''}`,