sprint-es 0.0.106 → 0.0.108
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 +36 -4
- package/dist/esm/cli.js +36 -4
- package/package.json +2 -1
package/dist/cjs/cli.cjs
CHANGED
|
@@ -400,25 +400,57 @@ async function main() {
|
|
|
400
400
|
case "build": {
|
|
401
401
|
console.log("🚀 Building for production...");
|
|
402
402
|
const isTS = fs.existsSync(path.join(projectRoot, "sprint.config.ts"));
|
|
403
|
-
|
|
403
|
+
console.log(`[Sprint] Project type: ${isTS ? "TypeScript" : "JavaScript"}`);
|
|
404
|
+
console.log(`[Sprint] Project root: ${projectRoot}`);
|
|
404
405
|
if (isTS) {
|
|
405
406
|
const tsconfigPath = path.join(projectRoot, "tsconfig.json");
|
|
407
|
+
console.log(`[Sprint] tsconfig path: ${tsconfigPath}`);
|
|
408
|
+
console.log(`[Sprint] tsconfig exists: ${fs.existsSync(tsconfigPath)}`);
|
|
406
409
|
const tsconfig = JSON.parse(stripJsonComments(fs.readFileSync(tsconfigPath, "utf-8")));
|
|
410
|
+
console.log(`[Sprint] tsconfig include: ${JSON.stringify(tsconfig.include)}`);
|
|
407
411
|
const originalInclude = tsconfig.include ?? [];
|
|
408
412
|
const patched = originalInclude.filter((p) => !p.includes("sprint.config"));
|
|
413
|
+
console.log(`[Sprint] patched include: ${JSON.stringify(patched)}`);
|
|
414
|
+
console.log(`[Sprint] needs patching: ${patched.length !== originalInclude.length}`);
|
|
409
415
|
if (patched.length !== originalInclude.length) {
|
|
416
|
+
console.log("[Sprint] Patching tsconfig temporarily...");
|
|
410
417
|
fs.writeFileSync(tsconfigPath, JSON.stringify({ ...tsconfig, include: patched }, null, 4));
|
|
418
|
+
console.log("[Sprint] tsconfig patched ✓");
|
|
411
419
|
try {
|
|
412
|
-
|
|
420
|
+
console.log("[Sprint] Running tsc...");
|
|
421
|
+
await runCommand("tsc", { NODE_ENV: "production" });
|
|
422
|
+
console.log("[Sprint] tsc completed ✓");
|
|
423
|
+
console.log("[Sprint] Running tsc-alias...");
|
|
424
|
+
await runCommand("tsc-alias", { NODE_ENV: "production" });
|
|
425
|
+
console.log("[Sprint] tsc-alias completed ✓");
|
|
413
426
|
} finally {
|
|
427
|
+
console.log("[Sprint] Restoring tsconfig...");
|
|
414
428
|
fs.writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 4));
|
|
429
|
+
console.log("[Sprint] tsconfig restored ✓");
|
|
415
430
|
}
|
|
416
|
-
} else
|
|
431
|
+
} else {
|
|
432
|
+
console.log("[Sprint] No patching needed");
|
|
433
|
+
console.log("[Sprint] Running tsc...");
|
|
434
|
+
await runCommand("tsc", { NODE_ENV: "production" });
|
|
435
|
+
console.log("[Sprint] tsc completed ✓");
|
|
436
|
+
console.log("[Sprint] Running tsc-alias...");
|
|
437
|
+
await runCommand("tsc-alias", { NODE_ENV: "production" });
|
|
438
|
+
console.log("[Sprint] tsc-alias completed ✓");
|
|
439
|
+
}
|
|
440
|
+
console.log("[Sprint] Compiling sprint.config.ts with esbuild...");
|
|
417
441
|
await runCommand(
|
|
418
442
|
"esbuild sprint.config.ts --outfile=dist/sprint.config.js --platform=node --format=esm --bundle=false",
|
|
419
443
|
{ NODE_ENV: "production" }
|
|
420
444
|
);
|
|
421
|
-
|
|
445
|
+
console.log("[Sprint] sprint.config.js generated ✓");
|
|
446
|
+
} else {
|
|
447
|
+
console.log("[Sprint] Running tsc...");
|
|
448
|
+
await runCommand("tsc", { NODE_ENV: "production" });
|
|
449
|
+
console.log("[Sprint] tsc completed ✓");
|
|
450
|
+
console.log("[Sprint] Running tsc-alias...");
|
|
451
|
+
await runCommand("tsc-alias", { NODE_ENV: "production" });
|
|
452
|
+
console.log("[Sprint] tsc-alias completed ✓");
|
|
453
|
+
}
|
|
422
454
|
break;
|
|
423
455
|
}
|
|
424
456
|
case "start": {
|
package/dist/esm/cli.js
CHANGED
|
@@ -381,25 +381,57 @@ async function main() {
|
|
|
381
381
|
case "build": {
|
|
382
382
|
console.log("🚀 Building for production...");
|
|
383
383
|
const isTS = existsSync(join(projectRoot, "sprint.config.ts"));
|
|
384
|
-
|
|
384
|
+
console.log(`[Sprint] Project type: ${isTS ? "TypeScript" : "JavaScript"}`);
|
|
385
|
+
console.log(`[Sprint] Project root: ${projectRoot}`);
|
|
385
386
|
if (isTS) {
|
|
386
387
|
const tsconfigPath = join(projectRoot, "tsconfig.json");
|
|
388
|
+
console.log(`[Sprint] tsconfig path: ${tsconfigPath}`);
|
|
389
|
+
console.log(`[Sprint] tsconfig exists: ${existsSync(tsconfigPath)}`);
|
|
387
390
|
const tsconfig = JSON.parse(stripJsonComments(readFileSync(tsconfigPath, "utf-8")));
|
|
391
|
+
console.log(`[Sprint] tsconfig include: ${JSON.stringify(tsconfig.include)}`);
|
|
388
392
|
const originalInclude = tsconfig.include ?? [];
|
|
389
393
|
const patched = originalInclude.filter((p) => !p.includes("sprint.config"));
|
|
394
|
+
console.log(`[Sprint] patched include: ${JSON.stringify(patched)}`);
|
|
395
|
+
console.log(`[Sprint] needs patching: ${patched.length !== originalInclude.length}`);
|
|
390
396
|
if (patched.length !== originalInclude.length) {
|
|
397
|
+
console.log("[Sprint] Patching tsconfig temporarily...");
|
|
391
398
|
writeFileSync(tsconfigPath, JSON.stringify({ ...tsconfig, include: patched }, null, 4));
|
|
399
|
+
console.log("[Sprint] tsconfig patched ✓");
|
|
392
400
|
try {
|
|
393
|
-
|
|
401
|
+
console.log("[Sprint] Running tsc...");
|
|
402
|
+
await runCommand("tsc", { NODE_ENV: "production" });
|
|
403
|
+
console.log("[Sprint] tsc completed ✓");
|
|
404
|
+
console.log("[Sprint] Running tsc-alias...");
|
|
405
|
+
await runCommand("tsc-alias", { NODE_ENV: "production" });
|
|
406
|
+
console.log("[Sprint] tsc-alias completed ✓");
|
|
394
407
|
} finally {
|
|
408
|
+
console.log("[Sprint] Restoring tsconfig...");
|
|
395
409
|
writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 4));
|
|
410
|
+
console.log("[Sprint] tsconfig restored ✓");
|
|
396
411
|
}
|
|
397
|
-
} else
|
|
412
|
+
} else {
|
|
413
|
+
console.log("[Sprint] No patching needed");
|
|
414
|
+
console.log("[Sprint] Running tsc...");
|
|
415
|
+
await runCommand("tsc", { NODE_ENV: "production" });
|
|
416
|
+
console.log("[Sprint] tsc completed ✓");
|
|
417
|
+
console.log("[Sprint] Running tsc-alias...");
|
|
418
|
+
await runCommand("tsc-alias", { NODE_ENV: "production" });
|
|
419
|
+
console.log("[Sprint] tsc-alias completed ✓");
|
|
420
|
+
}
|
|
421
|
+
console.log("[Sprint] Compiling sprint.config.ts with esbuild...");
|
|
398
422
|
await runCommand(
|
|
399
423
|
"esbuild sprint.config.ts --outfile=dist/sprint.config.js --platform=node --format=esm --bundle=false",
|
|
400
424
|
{ NODE_ENV: "production" }
|
|
401
425
|
);
|
|
402
|
-
|
|
426
|
+
console.log("[Sprint] sprint.config.js generated ✓");
|
|
427
|
+
} else {
|
|
428
|
+
console.log("[Sprint] Running tsc...");
|
|
429
|
+
await runCommand("tsc", { NODE_ENV: "production" });
|
|
430
|
+
console.log("[Sprint] tsc completed ✓");
|
|
431
|
+
console.log("[Sprint] Running tsc-alias...");
|
|
432
|
+
await runCommand("tsc-alias", { NODE_ENV: "production" });
|
|
433
|
+
console.log("[Sprint] tsc-alias completed ✓");
|
|
434
|
+
}
|
|
403
435
|
break;
|
|
404
436
|
}
|
|
405
437
|
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.108",
|
|
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",
|