sprint-es 0.0.105 → 0.0.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/cli.cjs +11 -8
- package/dist/esm/cli.js +11 -8
- package/package.json +2 -1
package/dist/cjs/cli.cjs
CHANGED
|
@@ -171,10 +171,7 @@ function runCommand(cmd, envVars) {
|
|
|
171
171
|
});
|
|
172
172
|
child.on("exit", (code) => {
|
|
173
173
|
if (code === 0 || code === null) resolve2();
|
|
174
|
-
else {
|
|
175
|
-
console.error(`Command failed with exit code ${code}`);
|
|
176
|
-
process.exit(code);
|
|
177
|
-
}
|
|
174
|
+
else reject(new Error(`Command failed with exit code ${code}`));
|
|
178
175
|
});
|
|
179
176
|
});
|
|
180
177
|
}
|
|
@@ -403,7 +400,6 @@ async function main() {
|
|
|
403
400
|
case "build": {
|
|
404
401
|
console.log("🚀 Building for production...");
|
|
405
402
|
const isTS = fs.existsSync(path.join(projectRoot, "sprint.config.ts"));
|
|
406
|
-
const buildCmd = "tsc && tsc-esm-fix --src=dist --ext=.js && tsc-alias";
|
|
407
403
|
if (isTS) {
|
|
408
404
|
const tsconfigPath = path.join(projectRoot, "tsconfig.json");
|
|
409
405
|
const tsconfig = JSON.parse(stripJsonComments(fs.readFileSync(tsconfigPath, "utf-8")));
|
|
@@ -412,16 +408,23 @@ async function main() {
|
|
|
412
408
|
if (patched.length !== originalInclude.length) {
|
|
413
409
|
fs.writeFileSync(tsconfigPath, JSON.stringify({ ...tsconfig, include: patched }, null, 4));
|
|
414
410
|
try {
|
|
415
|
-
await runCommand(
|
|
411
|
+
await runCommand("tsc", { NODE_ENV: "production" });
|
|
412
|
+
await runCommand("tsc-alias", { NODE_ENV: "production" });
|
|
416
413
|
} finally {
|
|
417
414
|
fs.writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 4));
|
|
418
415
|
}
|
|
419
|
-
} else
|
|
416
|
+
} else {
|
|
417
|
+
await runCommand("tsc", { NODE_ENV: "production" });
|
|
418
|
+
await runCommand("tsc-alias", { NODE_ENV: "production" });
|
|
419
|
+
}
|
|
420
420
|
await runCommand(
|
|
421
421
|
"esbuild sprint.config.ts --outfile=dist/sprint.config.js --platform=node --format=esm --bundle=false",
|
|
422
422
|
{ NODE_ENV: "production" }
|
|
423
423
|
);
|
|
424
|
-
} else
|
|
424
|
+
} else {
|
|
425
|
+
await runCommand("tsc", { NODE_ENV: "production" });
|
|
426
|
+
await runCommand("tsc-alias", { NODE_ENV: "production" });
|
|
427
|
+
}
|
|
425
428
|
break;
|
|
426
429
|
}
|
|
427
430
|
case "start": {
|
package/dist/esm/cli.js
CHANGED
|
@@ -152,10 +152,7 @@ function runCommand(cmd, envVars) {
|
|
|
152
152
|
});
|
|
153
153
|
child.on("exit", (code) => {
|
|
154
154
|
if (code === 0 || code === null) resolve2();
|
|
155
|
-
else {
|
|
156
|
-
console.error(`Command failed with exit code ${code}`);
|
|
157
|
-
process.exit(code);
|
|
158
|
-
}
|
|
155
|
+
else reject(new Error(`Command failed with exit code ${code}`));
|
|
159
156
|
});
|
|
160
157
|
});
|
|
161
158
|
}
|
|
@@ -384,7 +381,6 @@ async function main() {
|
|
|
384
381
|
case "build": {
|
|
385
382
|
console.log("🚀 Building for production...");
|
|
386
383
|
const isTS = existsSync(join(projectRoot, "sprint.config.ts"));
|
|
387
|
-
const buildCmd = "tsc && tsc-esm-fix --src=dist --ext=.js && tsc-alias";
|
|
388
384
|
if (isTS) {
|
|
389
385
|
const tsconfigPath = join(projectRoot, "tsconfig.json");
|
|
390
386
|
const tsconfig = JSON.parse(stripJsonComments(readFileSync(tsconfigPath, "utf-8")));
|
|
@@ -393,16 +389,23 @@ async function main() {
|
|
|
393
389
|
if (patched.length !== originalInclude.length) {
|
|
394
390
|
writeFileSync(tsconfigPath, JSON.stringify({ ...tsconfig, include: patched }, null, 4));
|
|
395
391
|
try {
|
|
396
|
-
await runCommand(
|
|
392
|
+
await runCommand("tsc", { NODE_ENV: "production" });
|
|
393
|
+
await runCommand("tsc-alias", { NODE_ENV: "production" });
|
|
397
394
|
} finally {
|
|
398
395
|
writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 4));
|
|
399
396
|
}
|
|
400
|
-
} else
|
|
397
|
+
} else {
|
|
398
|
+
await runCommand("tsc", { NODE_ENV: "production" });
|
|
399
|
+
await runCommand("tsc-alias", { NODE_ENV: "production" });
|
|
400
|
+
}
|
|
401
401
|
await runCommand(
|
|
402
402
|
"esbuild sprint.config.ts --outfile=dist/sprint.config.js --platform=node --format=esm --bundle=false",
|
|
403
403
|
{ NODE_ENV: "production" }
|
|
404
404
|
);
|
|
405
|
-
} else
|
|
405
|
+
} else {
|
|
406
|
+
await runCommand("tsc", { NODE_ENV: "production" });
|
|
407
|
+
await runCommand("tsc-alias", { NODE_ENV: "production" });
|
|
408
|
+
}
|
|
406
409
|
break;
|
|
407
410
|
}
|
|
408
411
|
case "start": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sprint-es",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.107",
|
|
4
4
|
"description": "Sprint - Quickly API",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"axios": "^1.13.2",
|
|
83
83
|
"cors": "^2.8.5",
|
|
84
84
|
"dotenv": "^17.3.1",
|
|
85
|
+
"esbuild": "^0.27.3",
|
|
85
86
|
"express": "^5.1.0",
|
|
86
87
|
"morgan": "^1.10.1",
|
|
87
88
|
"node-cron": "^3.0.3",
|