mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
spacetime db ci change
This commit is contained in:
parent
e16040c908
commit
a07dbab3a6
@ -4,7 +4,7 @@
|
||||
"version": "2.8.80",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "pnpm spacetime:publish:local && next dev --turbopack --port ${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}41",
|
||||
"dev": "node scripts/pre-dev.mjs && next dev --turbopack --port ${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}41",
|
||||
"build": "next build",
|
||||
"start": "next start --port ${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}41",
|
||||
"typecheck": "tsc --noEmit",
|
||||
|
||||
23
apps/internal-tool/scripts/pre-dev.mjs
Normal file
23
apps/internal-tool/scripts/pre-dev.mjs
Normal file
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env node
|
||||
// Runs before `next dev`. Publishes the SpacetimeDB module to the local server
|
||||
// if the spacetime CLI is installed. Otherwise, warns and continues so the
|
||||
// dev server still starts (useful in CI and for contributors who haven't
|
||||
// installed the CLI yet).
|
||||
|
||||
import { spawnSync } from "node:child_process";
|
||||
|
||||
const which = spawnSync(process.platform === "win32" ? "where" : "which", ["spacetime"], {
|
||||
stdio: "ignore",
|
||||
});
|
||||
|
||||
if (which.status !== 0) {
|
||||
console.warn("\n[internal-tool] spacetime CLI not found, skipping publish.");
|
||||
console.warn("[internal-tool] To install it: curl -sSf https://install.spacetimedb.com | sh\n");
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const publish = spawnSync("pnpm", ["spacetime:publish:local"], {
|
||||
stdio: "inherit",
|
||||
});
|
||||
|
||||
process.exit(publish.status ?? 1);
|
||||
Loading…
Reference in New Issue
Block a user