Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"dev": "tsx watch src/index.ts",
"dev": "NODE_ENV=development tsx watch src/index.ts",
"build": "tsc",
"type-check": "tsc --noEmit",
"typecheck": "npm run type-check",
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "commonjs",
"moduleResolution": "node",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"declaration": true,
"declarationMap": true,
"outDir": "./dist",
Expand Down
17 changes: 16 additions & 1 deletion scripts/setup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@ async function checkNode() {
success(`Node.js ${version}`);
}

async function checkNodeEnv() {
if (process.env.NODE_ENV === "production") {
warn("NODE_ENV is set to 'production' in your shell.");
log("");
log(" This will break local dev (the API requires Redis in production mode).");
log(" The dev script now forces NODE_ENV=development, but other tools may still");
log(" behave differently. Consider unsetting it for local development:");
log(` ${DIM} unset NODE_ENV${RESET}`);
log("");
} else {
success(`NODE_ENV is ${process.env.NODE_ENV || "unset"} (ok for local dev)`);
}
}

async function checkNpm() {
try {
const { stdout } = await run("npm", ["--version"], { silent: true });
Expand Down Expand Up @@ -343,11 +357,12 @@ async function verifyMigrations() {
async function main() {
log(`${BOLD}OriCMS Setup${RESET}\n`);

const TOTAL_STEPS = 8;
const TOTAL_STEPS = 9;
let currentStep = 0;

step(++currentStep, TOTAL_STEPS, "Checking prerequisites");
await checkNode();
await checkNodeEnv();
await checkNpm();
await checkDocker();
await checkGit();
Expand Down
Loading