summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/package.json7
-rw-r--r--scripts/smoke/cleanup.js6
-rw-r--r--scripts/smoke/index.js20
3 files changed, 22 insertions, 11 deletions
diff --git a/scripts/package.json b/scripts/package.json
index 3ada24d0c..a20d95c82 100644
--- a/scripts/package.json
+++ b/scripts/package.json
@@ -8,10 +8,17 @@
"astro-scripts": "./index.js"
},
"dependencies": {
+ "@astrojs/webapi": "workspace:*",
+ "@astrojs/renderer-preact": "workspace:*",
+ "@astrojs/renderer-react": "workspace:*",
+ "@astrojs/renderer-vue": "workspace:*",
+ "@astrojs/renderer-svelte": "workspace:*",
"adm-zip": "^0.5.9",
"arg": "^5.0.0",
"esbuild": "0.13.7",
"globby": "^12.0.2",
+ "kleur": "^4.1.4",
+ "svelte": "^3.46.2",
"tar": "^6.1.0"
}
}
diff --git a/scripts/smoke/cleanup.js b/scripts/smoke/cleanup.js
index a198ba56d..0d7db79f3 100644
--- a/scripts/smoke/cleanup.js
+++ b/scripts/smoke/cleanup.js
@@ -1,4 +1,4 @@
-/** @file Remove all smoke tests and may remove extra smoke-test dependencies from `yarn.lock`. */
+/** @file Remove all smoke tests and may remove extra smoke-test dependencies from `pnpm-lock.yaml`. */
// @ts-check
@@ -37,9 +37,9 @@ async function run() {
console.log();
- console.log('🤖', 'Resetting', 'yarn');
+ console.log('🤖', 'Resetting', 'pnpm');
- await execa('yarn', [], { cwd: fileURLToPath(rootDir), stdout: 'inherit', stderr: 'inherit' });
+ await execa('pnpm', ['install'], { cwd: fileURLToPath(rootDir), stdout: 'inherit', stderr: 'inherit' });
}
/* Functionality
diff --git a/scripts/smoke/index.js b/scripts/smoke/index.js
index ec56e0a09..26ca3632d 100644
--- a/scripts/smoke/index.js
+++ b/scripts/smoke/index.js
@@ -1,4 +1,5 @@
-/** @file Runs all smoke tests and may add extra smoke-test dependencies to `yarn.lock`. */
+/** @file Runs all smoke tests and may add extra smoke-test dependencies to `pnpm-lock.yaml`. */
+
// @ts-check
import { execa } from 'execa';
@@ -33,29 +34,32 @@ const getChildDirectories = async (/** @type {URL} */ dir) => {
async function run() {
console.log('');
- const directories = [...(await getChildDirectories(exampleDir)), ...(await getChildDirectories(smokeDir))];
+ const directories = [...(await getChildDirectories(smokeDir)), ...(await getChildDirectories(exampleDir))];
- console.log('🤖', 'Preparing', 'yarn');
+ console.log('🤖', 'Preparing', 'pnpm');
- await execa('yarn', [], { cwd: fileURLToPath(rootDir), stdio: 'inherit' });
+ await execa('pnpm', ['install', '--frozen-lockfile=false'], { cwd: fileURLToPath(rootDir), stdio: 'inherit' });
for (const directory of directories) {
- console.log('🤖', 'Testing', directory.pathname.split('/').at(-1));
+ const name = directory.pathname.split('/').at(-1) ?? "";
+ const isExternal = directory.pathname.includes(smokeDir.pathname);
+ console.log('🤖', 'Testing', name);
try {
- await execa('yarn', ['run', 'build'], { cwd: fileURLToPath(directory), stdio: 'inherit' });
+ await execa('pnpm', ['install', '--ignore-scripts', '--frozen-lockfile=false', isExternal ? '--shamefully-hoist' : ''].filter(x => x), { cwd: fileURLToPath(directory), stdio: 'inherit' });
+ await execa('pnpm', ['run', 'build'], { cwd: fileURLToPath(directory), stdio: 'inherit' });
} catch (err) {
console.log(err);
process.exit(1);
}
// Run with the static build too (skip for remote repos)
- if (directory.pathname.includes(smokeDir.pathname)) {
+ if (isExternal) {
continue;
}
try {
- await execa('yarn', ['build', '--', '--experimental-static-build'], { cwd: fileURLToPath(directory), stdout: 'inherit', stderr: 'inherit' });
+ await execa('pnpm', ['run', 'build', '--', '--experimental-static-build'], { cwd: fileURLToPath(directory), stdout: 'inherit', stderr: 'inherit' });
} catch (err) {
console.log(err);
process.exit(1);