sprint-es 0.0.95 → 0.0.97

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
@@ -308,8 +308,22 @@ switch (command) {
308
308
  console.log("🚀 Building for production...");
309
309
  const isTS = fs.existsSync(path.join(projectRoot, "sprint.config.ts"));
310
310
  if (isTS) {
311
- runCommand("tsc && tsc-alias", { NODE_ENV: "production" });
312
- runCommand("tsc sprint.config.ts --outDir dist --noEmit false --skipLibCheck true", { NODE_ENV: "production" });
311
+ const tsconfigPath = path.join(projectRoot, "tsconfig.json");
312
+ const tsconfig = JSON.parse(fs.readFileSync(tsconfigPath, "utf-8"));
313
+ const originalInclude = tsconfig.include ?? [];
314
+ const patched = originalInclude.filter((p) => !p.includes("sprint.config"));
315
+ if (patched.length !== originalInclude.length) {
316
+ fs.writeFileSync(tsconfigPath, JSON.stringify({ ...tsconfig, include: patched }, null, 4));
317
+ try {
318
+ runCommand("tsc && tsc-alias", { NODE_ENV: "production" });
319
+ } finally {
320
+ fs.writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 4));
321
+ }
322
+ } else runCommand("tsc && tsc-alias", { NODE_ENV: "production" });
323
+ runCommand(
324
+ "esbuild sprint.config.ts --outfile=dist/sprint.config.js --platform=node --format=cjs --bundle=false",
325
+ { NODE_ENV: "production" }
326
+ );
313
327
  } else runCommand("tsc && tsc-alias", { NODE_ENV: "production" });
314
328
  break;
315
329
  }
package/dist/esm/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { existsSync, readFileSync, readdirSync, statSync } from "fs";
2
+ import { existsSync, readFileSync, writeFileSync, readdirSync, statSync } from "fs";
3
3
  import * as crypto from "crypto";
4
4
  import { join, resolve } from "path";
5
5
  import { spawn } from "child_process";
@@ -290,8 +290,22 @@ switch (command) {
290
290
  console.log("🚀 Building for production...");
291
291
  const isTS = existsSync(join(projectRoot, "sprint.config.ts"));
292
292
  if (isTS) {
293
- runCommand("tsc && tsc-alias", { NODE_ENV: "production" });
294
- runCommand("tsc sprint.config.ts --outDir dist --noEmit false --skipLibCheck true", { NODE_ENV: "production" });
293
+ const tsconfigPath = join(projectRoot, "tsconfig.json");
294
+ const tsconfig = JSON.parse(readFileSync(tsconfigPath, "utf-8"));
295
+ const originalInclude = tsconfig.include ?? [];
296
+ const patched = originalInclude.filter((p) => !p.includes("sprint.config"));
297
+ if (patched.length !== originalInclude.length) {
298
+ writeFileSync(tsconfigPath, JSON.stringify({ ...tsconfig, include: patched }, null, 4));
299
+ try {
300
+ runCommand("tsc && tsc-alias", { NODE_ENV: "production" });
301
+ } finally {
302
+ writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 4));
303
+ }
304
+ } else runCommand("tsc && tsc-alias", { NODE_ENV: "production" });
305
+ runCommand(
306
+ "esbuild sprint.config.ts --outfile=dist/sprint.config.js --platform=node --format=cjs --bundle=false",
307
+ { NODE_ENV: "production" }
308
+ );
295
309
  } else runCommand("tsc && tsc-alias", { NODE_ENV: "production" });
296
310
  break;
297
311
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprint-es",
3
- "version": "0.0.95",
3
+ "version": "0.0.97",
4
4
  "description": "Sprint - Quickly API",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",