Skip to content

Commit

Permalink
Merge pull request #28838 from storybookjs/valentin/fix-for-vite-ecos…
Browse files Browse the repository at this point in the history
…ystem-ci

Build: Fixes to enable vite-ecosystem-ci
  • Loading branch information
valentinpalkovic authored Aug 9, 2024
2 parents 7f138a4 + 688044c commit edd0fd5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions code/addons/docs/template/stories/toc/basic.stories.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { global as globalThis } from '@storybook/global';
import { fn } from '@storybook/test';

export default {
component: globalThis.Components.Button,
Expand Down
2 changes: 1 addition & 1 deletion code/lib/cli-storybook/src/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const link = async ({ target, local, start }: LinkOptions) => {
}

// ensure that linking is possible
await exec(`yarn add @types/node@18`, { cwd: reproDir });
await exec(`yarn add @types/node@22`, { cwd: reproDir });

if (start) {
logger.info(`Running ${reproName} storybook`);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test": "cd code; yarn test",
"upload-bench": "cd scripts; yarn upload-bench",
"vite-ecosystem-ci:before-test": "node ./scripts/vite-ecosystem-ci/before-test.js && cd ./sandbox/react-vite-default-ts && yarn install",
"vite-ecosystem-ci:build": "yarn task --task sandbox --template react-vite/default-ts",
"vite-ecosystem-ci:build": "yarn task --task sandbox --template react-vite/default-ts --start-from=install",
"vite-ecosystem-ci:test": "yarn task --task test-runner-dev --template react-vite/default-ts --start-from=dev"
}
}
4 changes: 4 additions & 0 deletions scripts/vite-ecosystem-ci/before-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import { execaCommand, execa } from 'execa';

const filename = fileURLToPath(import.meta.url);
const dirname = path.dirname(filename);
Expand All @@ -26,3 +27,6 @@ sandboxPackageJson.resolutions = {
};

await fs.promises.writeFile(sandboxPackageJsonPath, JSON.stringify(sandboxPackageJson, null, 2));
const sandboxFolder = path.dirname(sandboxPackageJsonPath);
await execa('yarn add playwright', { cwd: sandboxFolder, shell: true });
await execaCommand('yarn playwright install', { cwd: sandboxFolder, shell: true });

0 comments on commit edd0fd5

Please sign in to comment.