sprint-es 0.0.114 → 0.0.116

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 CHANGED
@@ -401,39 +401,43 @@ 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 ✓");
408
- 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));
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
+ const aliasConfig = {
420
+ extends: "./tsconfig.json",
421
+ compilerOptions: {
422
+ outDir: "./dist",
423
+ noEmit: false
423
424
  }
425
+ };
426
+ const aliasConfigPath = path.join(projectRoot, "tsconfig.alias.json");
427
+ fs.writeFileSync(aliasConfigPath, JSON.stringify(aliasConfig, null, 4));
428
+ try {
429
+ await runCommand(`tsc-alias --project "${aliasConfigPath}"`, { NODE_ENV: "production" });
430
+ console.log("[Sprint] Aliases resolved ✓");
431
+ } finally {
432
+ fs.rmSync(aliasConfigPath, { force: true });
433
+ }
434
+ if (isTS) {
424
435
  console.log("[Sprint] Compiling sprint.config.ts...");
425
436
  await runCommand(
426
437
  `esbuild "${path.join(projectRoot, "sprint.config.ts")}" --outfile="${path.join(projectRoot, "dist/sprint.config.js")}" --platform=node --format=cjs --bundle=false`,
427
438
  { NODE_ENV: "production" }
428
439
  );
429
440
  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
441
  }
438
442
  console.log("✅ Build completed successfully!");
439
443
  break;
package/dist/esm/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { existsSync, rmSync, readFileSync, writeFileSync, readdirSync, statSync } from "fs";
2
+ import { existsSync, rmSync, writeFileSync, 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,43 @@ 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 ✓");
389
- 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));
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
+ const aliasConfig = {
401
+ extends: "./tsconfig.json",
402
+ compilerOptions: {
403
+ outDir: "./dist",
404
+ noEmit: false
404
405
  }
406
+ };
407
+ const aliasConfigPath = join(projectRoot, "tsconfig.alias.json");
408
+ writeFileSync(aliasConfigPath, JSON.stringify(aliasConfig, null, 4));
409
+ try {
410
+ await runCommand(`tsc-alias --project "${aliasConfigPath}"`, { NODE_ENV: "production" });
411
+ console.log("[Sprint] Aliases resolved ✓");
412
+ } finally {
413
+ rmSync(aliasConfigPath, { force: true });
414
+ }
415
+ if (isTS) {
405
416
  console.log("[Sprint] Compiling sprint.config.ts...");
406
417
  await runCommand(
407
418
  `esbuild "${join(projectRoot, "sprint.config.ts")}" --outfile="${join(projectRoot, "dist/sprint.config.js")}" --platform=node --format=cjs --bundle=false`,
408
419
  { NODE_ENV: "production" }
409
420
  );
410
421
  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
422
  }
419
423
  console.log("✅ Build completed successfully!");
420
424
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprint-es",
3
- "version": "0.0.114",
3
+ "version": "0.0.116",
4
4
  "description": "Sprint - Quickly API",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",