diff --git a/package.json b/package.json index c4c5b1057f07..67fd64d39a4e 100644 --- a/package.json +++ b/package.json @@ -3,20 +3,23 @@ "scripts": { "ci-tests": "cd code; yarn ci-tests", "get-report-message": "cd scripts; yarn get-report-message", - "get-template": "cd scripts; yarn get-template", "get-sandbox-dir": "cd scripts; yarn get-sandbox-dir", + "get-template": "cd scripts; yarn get-template", "i": "yarn --cwd scripts && yarn --cwd code", "knip": "cd code; yarn knip", "lint": "cd code; yarn lint", "nx": "cd code; yarn nx", "pretty-docs": "cd scripts; yarn install >/dev/null; yarn docs:prettier:write", "start": "yarn task --task dev --template react-vite/default-ts --start-from=install", + "svelte-ecosystem-ci:before-test": "node ./scripts/ecosystem-ci/before-test.js svelte-kit/skeleton-ts && cd ./sandbox/svelte-kit-skeleton-ts && yarn install", + "svelte-ecosystem-ci:build": "yarn task --task install && yarn --cwd code build svelte && yarn task --task sandbox --template svelte-kit/skeleton-ts --start-from=compile --no-link --skip-cache", + "svelte-ecosystem-ci:test": "yarn task --task test-runner --template svelte-kit/skeleton-ts --start-from=build --no-link --skip-cache && yarn task --task vitest-integration --template svelte-kit/skeleton-ts --start-from vitest-integration --no-link --skip-cache", "task": "echo 'Installing Script Dependencies...'; cd scripts; yarn install >/dev/null; cd ..; yarn --cwd=./scripts task", "test": "cd code; yarn test", "test:watch": "cd code; yarn test:watch", "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 --start-from=install", + "vite-ecosystem-ci:before-test": "node ./scripts/ecosystem-ci/before-test.js react-vite/default-ts && cd ./sandbox/react-vite-default-ts && yarn install", + "vite-ecosystem-ci:build": "yarn task --task sandbox --template react-vite/default-ts --start-from=install --skip-cache", "vite-ecosystem-ci:test": "yarn task --task test-runner-dev --template react-vite/default-ts --start-from=dev && yarn task --task test-runner --template react-vite/default-ts --start-from=build && yarn task --task vitest-integration --template react-vite/default-ts --start-from vitest-integration" }, "packageManager": "yarn@4.9.1", diff --git a/scripts/vite-ecosystem-ci/before-test.js b/scripts/ecosystem-ci/before-test.js similarity index 77% rename from scripts/vite-ecosystem-ci/before-test.js rename to scripts/ecosystem-ci/before-test.js index 0dbeb783f27c..21171474b1eb 100644 --- a/scripts/vite-ecosystem-ci/before-test.js +++ b/scripts/ecosystem-ci/before-test.js @@ -14,10 +14,12 @@ import { execaCommand } from 'execa'; const filename = fileURLToPath(import.meta.url); const __dirname = dirname(filename); +const sandbox = process.argv[2] ?? 'react-vite/default-ts'; + const rootPackageJsonPath = resolve(__dirname, '../../package.json'); const sandboxPackageJsonPath = resolve( __dirname, - '../../sandbox/react-vite-default-ts/package.json' + `../../sandbox/${sandbox.replace('/', '-')}/package.json` ); const rootPackageJson = JSON.parse(await readFile(rootPackageJsonPath, 'utf-8')); @@ -29,7 +31,7 @@ sandboxPackageJson.resolutions = { }; await writeFile(sandboxPackageJsonPath, JSON.stringify(sandboxPackageJson, null, 2)); -const sandboxFolder = dirname(sandboxPackageJsonPath); +const sandboxDir = dirname(sandboxPackageJsonPath); -await execaCommand('yarn add playwright', { cwd: sandboxFolder, shell: true }); -await execaCommand('yarn playwright install', { cwd: sandboxFolder, shell: true }); +await execaCommand('yarn add playwright', { cwd: sandboxDir, shell: true }); +await execaCommand('yarn playwright install', { cwd: sandboxDir, shell: true });