From d4ecd0d9a992bb602c317a6dbc37d922904ef74a Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Wed, 27 Nov 2024 11:32:15 +0100 Subject: [PATCH 1/2] Revert "temporarily remove react native sandbox" This reverts commit bb0fd7ea338a6d3e458771b27d3f1b14a5009b4f. --- .circleci/config.yml | 10 +++++----- code/lib/cli-storybook/src/sandbox-templates.ts | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e2921e6fa20c..550dc9e6b994 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -986,22 +986,22 @@ workflows: requires: - build - create-sandboxes: - parallelism: 37 + parallelism: 38 requires: - build # - smoke-test-sandboxes: # disabled for now # requires: # - create-sandboxes - build-sandboxes: - parallelism: 37 + parallelism: 38 requires: - create-sandboxes - chromatic-sandboxes: - parallelism: 34 + parallelism: 35 requires: - build-sandboxes - e2e-production: - parallelism: 32 + parallelism: 33 requires: - build-sandboxes - e2e-dev: @@ -1009,7 +1009,7 @@ workflows: requires: - create-sandboxes - test-runner-production: - parallelism: 32 + parallelism: 33 requires: - build-sandboxes - vitest-integration: diff --git a/code/lib/cli-storybook/src/sandbox-templates.ts b/code/lib/cli-storybook/src/sandbox-templates.ts index 1a29411a093e..fe89f9decae0 100644 --- a/code/lib/cli-storybook/src/sandbox-templates.ts +++ b/code/lib/cli-storybook/src/sandbox-templates.ts @@ -853,8 +853,7 @@ export const daily: TemplateKey[] = [ 'html-vite/default-js', 'internal/react16-webpack', 'internal/react18-webpack-babel', - // TODO: bring this back once ts-docgen supports Vite 6 - // 'react-native-web-vite/expo-ts', + 'react-native-web-vite/expo-ts', // 'react-native-web-vite/rn-cli-ts', ]; From 182c509faf2e779c216ae8c53c2e4297e8bb3395 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Wed, 27 Nov 2024 12:24:05 +0100 Subject: [PATCH 2/2] Build: Temporarily downgrade Vite --- scripts/tasks/sandbox-parts.ts | 5 +++-- scripts/utils/yarn.ts | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/scripts/tasks/sandbox-parts.ts b/scripts/tasks/sandbox-parts.ts index 4f8dd85ecc46..72a362c86f12 100644 --- a/scripts/tasks/sandbox-parts.ts +++ b/scripts/tasks/sandbox-parts.ts @@ -109,9 +109,10 @@ export const install: Task['run'] = async ({ sandboxDir, key }, { link, dryRun, 'svelte-vite/default-ts', 'vue3-vite/default-js', 'vue3-vite/default-ts', + 'svelte-kit/skeleton-ts', ]; - if (sandboxesNeedingWorkarounds.includes(key)) { - await addWorkaroundResolutions({ cwd, dryRun, debug }); + if (sandboxesNeedingWorkarounds.includes(key) || key.includes('vite')) { + await addWorkaroundResolutions({ cwd, dryRun, debug, key }); } await exec( diff --git a/scripts/utils/yarn.ts b/scripts/utils/yarn.ts index 6272134a755e..505ddf3a78b4 100644 --- a/scripts/utils/yarn.ts +++ b/scripts/utils/yarn.ts @@ -67,7 +67,11 @@ export const installYarn2 = async ({ cwd, dryRun, debug }: YarnOptions) => { ); }; -export const addWorkaroundResolutions = async ({ cwd, dryRun }: YarnOptions) => { +export const addWorkaroundResolutions = async ({ + cwd, + dryRun, + key, +}: YarnOptions & { key?: TemplateKey }) => { logger.info(`🔢 Adding resolutions for workarounds`); if (dryRun) { @@ -81,10 +85,19 @@ export const addWorkaroundResolutions = async ({ cwd, dryRun }: YarnOptions) => // Due to our support of older vite versions '@vitejs/plugin-react': '4.2.0', '@vitejs/plugin-vue': '4.5.0', + // TODO: Remove this once we figure out how to properly test Vite 4, 5 and 6 in our sandboxes + vite: '^5.0.0', + // We need to downgrade the plugin so that it works with Vite 5 projects + '@sveltejs/vite-plugin-svelte': '4.0.2', '@testing-library/dom': '^9.3.4', '@testing-library/jest-dom': '^6.5.0', '@testing-library/user-event': '^14.5.2', }; + + if (key.includes('svelte-kit')) { + packageJson.resolutions['@sveltejs/vite-plugin-svelte'] = '^3.0.0'; + } + await writeJSON(packageJsonPath, packageJson, { spaces: 2 }); };