sprint-es 0.0.113 → 0.0.115
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 +13 -22
- package/dist/esm/cli.js +14 -23
- package/package.json +1 -1
package/dist/cjs/cli.cjs
CHANGED
|
@@ -401,39 +401,30 @@ async function main() {
|
|
|
401
401
|
console.log("🚀 Building for production...");
|
|
402
402
|
const isTS = fs.existsSync(path.join(projectRoot, "sprint.config.ts"));
|
|
403
403
|
const distPath = path.join(projectRoot, "dist");
|
|
404
|
+
const srcPath = path.join(projectRoot, "src");
|
|
404
405
|
const tsconfigPath = path.join(projectRoot, "tsconfig.json");
|
|
405
406
|
console.log("[Sprint] Cleaning dist...");
|
|
406
407
|
fs.rmSync(distPath, { recursive: true, force: true });
|
|
407
408
|
console.log("[Sprint] dist cleaned ✓");
|
|
409
|
+
console.log("[Sprint] Compiling with esbuild...");
|
|
410
|
+
await runCommand(
|
|
411
|
+
`esbuild "${srcPath}/**/*.ts" --outdir="${distPath}" --platform=node --format=cjs --bundle=false --sourcemap --outbase="${srcPath}"`,
|
|
412
|
+
{ NODE_ENV: "production" }
|
|
413
|
+
);
|
|
414
|
+
console.log("[Sprint] Compilation completed ✓");
|
|
415
|
+
console.log("[Sprint] Type checking...");
|
|
416
|
+
await runCommand(`tsc --project "${tsconfigPath}" --noEmit`, { NODE_ENV: "production" });
|
|
417
|
+
console.log("[Sprint] Type check completed ✓");
|
|
418
|
+
console.log("[Sprint] Resolving aliases...");
|
|
419
|
+
await runCommand(`tsc-alias --project "${tsconfigPath}"`, { NODE_ENV: "production" });
|
|
420
|
+
console.log("[Sprint] Aliases resolved ✓");
|
|
408
421
|
if (isTS) {
|
|
409
|
-
const tsconfig = JSON.parse(stripJsonComments(fs.readFileSync(tsconfigPath, "utf-8")));
|
|
410
|
-
const originalInclude = tsconfig.include ?? [];
|
|
411
|
-
const patched = originalInclude.filter((p) => !p.includes("sprint.config"));
|
|
412
|
-
const needsPatching = patched.length !== originalInclude.length;
|
|
413
|
-
if (needsPatching) fs.writeFileSync(tsconfigPath, JSON.stringify({ ...tsconfig, include: patched }, null, 4));
|
|
414
|
-
try {
|
|
415
|
-
console.log("[Sprint] Running tsc...");
|
|
416
|
-
await runCommand(`tsc --project "${tsconfigPath}"`, { NODE_ENV: "production" });
|
|
417
|
-
console.log("[Sprint] tsc completed ✓");
|
|
418
|
-
console.log("[Sprint] Running tsc-alias...");
|
|
419
|
-
await runCommand(`tsc-alias --project "${tsconfigPath}"`, { NODE_ENV: "production" });
|
|
420
|
-
console.log("[Sprint] tsc-alias completed ✓");
|
|
421
|
-
} finally {
|
|
422
|
-
if (needsPatching) fs.writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 4));
|
|
423
|
-
}
|
|
424
422
|
console.log("[Sprint] Compiling sprint.config.ts...");
|
|
425
423
|
await runCommand(
|
|
426
424
|
`esbuild "${path.join(projectRoot, "sprint.config.ts")}" --outfile="${path.join(projectRoot, "dist/sprint.config.js")}" --platform=node --format=cjs --bundle=false`,
|
|
427
425
|
{ NODE_ENV: "production" }
|
|
428
426
|
);
|
|
429
427
|
console.log("[Sprint] sprint.config.js generated ✓");
|
|
430
|
-
} else {
|
|
431
|
-
console.log("[Sprint] Running tsc...");
|
|
432
|
-
await runCommand(`tsc --project "${tsconfigPath}"`, { NODE_ENV: "production" });
|
|
433
|
-
console.log("[Sprint] tsc completed ✓");
|
|
434
|
-
console.log("[Sprint] Running tsc-alias...");
|
|
435
|
-
await runCommand(`tsc-alias --project "${tsconfigPath}"`, { NODE_ENV: "production" });
|
|
436
|
-
console.log("[Sprint] tsc-alias completed ✓");
|
|
437
428
|
}
|
|
438
429
|
console.log("✅ Build completed successfully!");
|
|
439
430
|
break;
|
package/dist/esm/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { existsSync, rmSync, readFileSync,
|
|
2
|
+
import { existsSync, rmSync, readFileSync, readdirSync, statSync } from "fs";
|
|
3
3
|
import * as crypto from "crypto";
|
|
4
4
|
import { resolve, join } from "path";
|
|
5
5
|
import { spawn } from "child_process";
|
|
@@ -382,39 +382,30 @@ async function main() {
|
|
|
382
382
|
console.log("🚀 Building for production...");
|
|
383
383
|
const isTS = existsSync(join(projectRoot, "sprint.config.ts"));
|
|
384
384
|
const distPath = join(projectRoot, "dist");
|
|
385
|
+
const srcPath = join(projectRoot, "src");
|
|
385
386
|
const tsconfigPath = join(projectRoot, "tsconfig.json");
|
|
386
387
|
console.log("[Sprint] Cleaning dist...");
|
|
387
388
|
rmSync(distPath, { recursive: true, force: true });
|
|
388
389
|
console.log("[Sprint] dist cleaned ✓");
|
|
390
|
+
console.log("[Sprint] Compiling with esbuild...");
|
|
391
|
+
await runCommand(
|
|
392
|
+
`esbuild "${srcPath}/**/*.ts" --outdir="${distPath}" --platform=node --format=cjs --bundle=false --sourcemap --outbase="${srcPath}"`,
|
|
393
|
+
{ NODE_ENV: "production" }
|
|
394
|
+
);
|
|
395
|
+
console.log("[Sprint] Compilation completed ✓");
|
|
396
|
+
console.log("[Sprint] Type checking...");
|
|
397
|
+
await runCommand(`tsc --project "${tsconfigPath}" --noEmit`, { NODE_ENV: "production" });
|
|
398
|
+
console.log("[Sprint] Type check completed ✓");
|
|
399
|
+
console.log("[Sprint] Resolving aliases...");
|
|
400
|
+
await runCommand(`tsc-alias --project "${tsconfigPath}"`, { NODE_ENV: "production" });
|
|
401
|
+
console.log("[Sprint] Aliases resolved ✓");
|
|
389
402
|
if (isTS) {
|
|
390
|
-
const tsconfig = JSON.parse(stripJsonComments(readFileSync(tsconfigPath, "utf-8")));
|
|
391
|
-
const originalInclude = tsconfig.include ?? [];
|
|
392
|
-
const patched = originalInclude.filter((p) => !p.includes("sprint.config"));
|
|
393
|
-
const needsPatching = patched.length !== originalInclude.length;
|
|
394
|
-
if (needsPatching) writeFileSync(tsconfigPath, JSON.stringify({ ...tsconfig, include: patched }, null, 4));
|
|
395
|
-
try {
|
|
396
|
-
console.log("[Sprint] Running tsc...");
|
|
397
|
-
await runCommand(`tsc --project "${tsconfigPath}"`, { NODE_ENV: "production" });
|
|
398
|
-
console.log("[Sprint] tsc completed ✓");
|
|
399
|
-
console.log("[Sprint] Running tsc-alias...");
|
|
400
|
-
await runCommand(`tsc-alias --project "${tsconfigPath}"`, { NODE_ENV: "production" });
|
|
401
|
-
console.log("[Sprint] tsc-alias completed ✓");
|
|
402
|
-
} finally {
|
|
403
|
-
if (needsPatching) writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 4));
|
|
404
|
-
}
|
|
405
403
|
console.log("[Sprint] Compiling sprint.config.ts...");
|
|
406
404
|
await runCommand(
|
|
407
405
|
`esbuild "${join(projectRoot, "sprint.config.ts")}" --outfile="${join(projectRoot, "dist/sprint.config.js")}" --platform=node --format=cjs --bundle=false`,
|
|
408
406
|
{ NODE_ENV: "production" }
|
|
409
407
|
);
|
|
410
408
|
console.log("[Sprint] sprint.config.js generated ✓");
|
|
411
|
-
} else {
|
|
412
|
-
console.log("[Sprint] Running tsc...");
|
|
413
|
-
await runCommand(`tsc --project "${tsconfigPath}"`, { NODE_ENV: "production" });
|
|
414
|
-
console.log("[Sprint] tsc completed ✓");
|
|
415
|
-
console.log("[Sprint] Running tsc-alias...");
|
|
416
|
-
await runCommand(`tsc-alias --project "${tsconfigPath}"`, { NODE_ENV: "production" });
|
|
417
|
-
console.log("[Sprint] tsc-alias completed ✓");
|
|
418
409
|
}
|
|
419
410
|
console.log("✅ Build completed successfully!");
|
|
420
411
|
break;
|