sprint-es 0.0.100 → 0.0.102
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 +6 -5
- package/dist/esm/cli.js +6 -5
- package/package.json +2 -1
package/dist/cjs/cli.cjs
CHANGED
|
@@ -162,7 +162,7 @@ function getProjectRoot() {
|
|
|
162
162
|
}
|
|
163
163
|
const projectRoot = getProjectRoot();
|
|
164
164
|
function runCommand(cmd, envVars) {
|
|
165
|
-
const child = child_process.spawn(cmd,
|
|
165
|
+
const child = child_process.spawn(cmd, [], {
|
|
166
166
|
cwd: projectRoot,
|
|
167
167
|
stdio: "inherit",
|
|
168
168
|
shell: true,
|
|
@@ -396,6 +396,7 @@ switch (command) {
|
|
|
396
396
|
case "build": {
|
|
397
397
|
console.log("🚀 Building for production...");
|
|
398
398
|
const isTS = fs.existsSync(path.join(projectRoot, "sprint.config.ts"));
|
|
399
|
+
const buildCmd = "tsc && tsc-esm-fix --src=dist --ext=.js && tsc-alias";
|
|
399
400
|
if (isTS) {
|
|
400
401
|
const tsconfigPath = path.join(projectRoot, "tsconfig.json");
|
|
401
402
|
const tsconfig = JSON.parse(stripJsonComments(fs.readFileSync(tsconfigPath, "utf-8")));
|
|
@@ -404,16 +405,16 @@ switch (command) {
|
|
|
404
405
|
if (patched.length !== originalInclude.length) {
|
|
405
406
|
fs.writeFileSync(tsconfigPath, JSON.stringify({ ...tsconfig, include: patched }, null, 4));
|
|
406
407
|
try {
|
|
407
|
-
runCommand(
|
|
408
|
+
runCommand(buildCmd, { NODE_ENV: "production" });
|
|
408
409
|
} finally {
|
|
409
410
|
fs.writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 4));
|
|
410
411
|
}
|
|
411
|
-
} else runCommand(
|
|
412
|
+
} else runCommand(buildCmd, { NODE_ENV: "production" });
|
|
412
413
|
runCommand(
|
|
413
|
-
"esbuild sprint.config.ts --outfile=dist/sprint.config.js --platform=node --format=
|
|
414
|
+
"esbuild sprint.config.ts --outfile=dist/sprint.config.js --platform=node --format=esm --bundle=false",
|
|
414
415
|
{ NODE_ENV: "production" }
|
|
415
416
|
);
|
|
416
|
-
} else runCommand(
|
|
417
|
+
} else runCommand(buildCmd, { NODE_ENV: "production" });
|
|
417
418
|
break;
|
|
418
419
|
}
|
|
419
420
|
case "start": {
|
package/dist/esm/cli.js
CHANGED
|
@@ -143,7 +143,7 @@ function getProjectRoot() {
|
|
|
143
143
|
}
|
|
144
144
|
const projectRoot = getProjectRoot();
|
|
145
145
|
function runCommand(cmd, envVars) {
|
|
146
|
-
const child = spawn(cmd,
|
|
146
|
+
const child = spawn(cmd, [], {
|
|
147
147
|
cwd: projectRoot,
|
|
148
148
|
stdio: "inherit",
|
|
149
149
|
shell: true,
|
|
@@ -377,6 +377,7 @@ switch (command) {
|
|
|
377
377
|
case "build": {
|
|
378
378
|
console.log("🚀 Building for production...");
|
|
379
379
|
const isTS = existsSync(join(projectRoot, "sprint.config.ts"));
|
|
380
|
+
const buildCmd = "tsc && tsc-esm-fix --src=dist --ext=.js && tsc-alias";
|
|
380
381
|
if (isTS) {
|
|
381
382
|
const tsconfigPath = join(projectRoot, "tsconfig.json");
|
|
382
383
|
const tsconfig = JSON.parse(stripJsonComments(readFileSync(tsconfigPath, "utf-8")));
|
|
@@ -385,16 +386,16 @@ switch (command) {
|
|
|
385
386
|
if (patched.length !== originalInclude.length) {
|
|
386
387
|
writeFileSync(tsconfigPath, JSON.stringify({ ...tsconfig, include: patched }, null, 4));
|
|
387
388
|
try {
|
|
388
|
-
runCommand(
|
|
389
|
+
runCommand(buildCmd, { NODE_ENV: "production" });
|
|
389
390
|
} finally {
|
|
390
391
|
writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 4));
|
|
391
392
|
}
|
|
392
|
-
} else runCommand(
|
|
393
|
+
} else runCommand(buildCmd, { NODE_ENV: "production" });
|
|
393
394
|
runCommand(
|
|
394
|
-
"esbuild sprint.config.ts --outfile=dist/sprint.config.js --platform=node --format=
|
|
395
|
+
"esbuild sprint.config.ts --outfile=dist/sprint.config.js --platform=node --format=esm --bundle=false",
|
|
395
396
|
{ NODE_ENV: "production" }
|
|
396
397
|
);
|
|
397
|
-
} else runCommand(
|
|
398
|
+
} else runCommand(buildCmd, { NODE_ENV: "production" });
|
|
398
399
|
break;
|
|
399
400
|
}
|
|
400
401
|
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.102",
|
|
4
4
|
"description": "Sprint - Quickly API",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -88,6 +88,7 @@
|
|
|
88
88
|
"path": "^0.12.7",
|
|
89
89
|
"serve-favicon": "^2.5.1",
|
|
90
90
|
"toolkitify": "^0.0.26",
|
|
91
|
+
"tsc-esm-fix": "^3.1.2",
|
|
91
92
|
"tsx": "^4.19.0",
|
|
92
93
|
"zod": "^3.25.0"
|
|
93
94
|
},
|