sprint-es 0.0.115 → 0.0.117
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 +24 -3
- package/dist/esm/cli.js +25 -4
- package/package.json +1 -1
package/dist/cjs/cli.cjs
CHANGED
|
@@ -407,8 +407,16 @@ async function main() {
|
|
|
407
407
|
fs.rmSync(distPath, { recursive: true, force: true });
|
|
408
408
|
console.log("[Sprint] dist cleaned ✓");
|
|
409
409
|
console.log("[Sprint] Compiling with esbuild...");
|
|
410
|
+
const packageJson = JSON.parse(fs.readFileSync(path.join(projectRoot, "package.json"), "utf-8"));
|
|
411
|
+
const deps = [
|
|
412
|
+
...Object.keys(packageJson.dependencies ?? {}),
|
|
413
|
+
...Object.keys(packageJson.devDependencies ?? {}),
|
|
414
|
+
...Object.keys(packageJson.optionalDependencies ?? {}),
|
|
415
|
+
...Object.keys(packageJson.peerDependencies ?? {})
|
|
416
|
+
];
|
|
417
|
+
const externals = deps.map((d) => `--external:${d}`).join(" ");
|
|
410
418
|
await runCommand(
|
|
411
|
-
`esbuild "${srcPath}/**/*.ts" --outdir="${distPath}" --platform=node --format=cjs --bundle=false --sourcemap --outbase="${srcPath}"`,
|
|
419
|
+
`esbuild "${srcPath}/**/*.ts" --outdir="${distPath}" --platform=node --format=cjs --bundle=false --sourcemap --outbase="${srcPath}" ${externals}`,
|
|
412
420
|
{ NODE_ENV: "production" }
|
|
413
421
|
);
|
|
414
422
|
console.log("[Sprint] Compilation completed ✓");
|
|
@@ -416,8 +424,21 @@ async function main() {
|
|
|
416
424
|
await runCommand(`tsc --project "${tsconfigPath}" --noEmit`, { NODE_ENV: "production" });
|
|
417
425
|
console.log("[Sprint] Type check completed ✓");
|
|
418
426
|
console.log("[Sprint] Resolving aliases...");
|
|
419
|
-
|
|
420
|
-
|
|
427
|
+
const aliasConfig = {
|
|
428
|
+
extends: "./tsconfig.json",
|
|
429
|
+
compilerOptions: {
|
|
430
|
+
outDir: "./dist",
|
|
431
|
+
noEmit: false
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
const aliasConfigPath = path.join(projectRoot, "tsconfig.alias.json");
|
|
435
|
+
fs.writeFileSync(aliasConfigPath, JSON.stringify(aliasConfig, null, 4));
|
|
436
|
+
try {
|
|
437
|
+
await runCommand(`tsc-alias --project "${aliasConfigPath}"`, { NODE_ENV: "production" });
|
|
438
|
+
console.log("[Sprint] Aliases resolved ✓");
|
|
439
|
+
} finally {
|
|
440
|
+
fs.rmSync(aliasConfigPath, { force: true });
|
|
441
|
+
}
|
|
421
442
|
if (isTS) {
|
|
422
443
|
console.log("[Sprint] Compiling sprint.config.ts...");
|
|
423
444
|
await runCommand(
|
package/dist/esm/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { existsSync, rmSync, readFileSync, readdirSync, statSync } from "fs";
|
|
2
|
+
import { existsSync, rmSync, readFileSync, writeFileSync, 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";
|
|
@@ -388,8 +388,16 @@ async function main() {
|
|
|
388
388
|
rmSync(distPath, { recursive: true, force: true });
|
|
389
389
|
console.log("[Sprint] dist cleaned ✓");
|
|
390
390
|
console.log("[Sprint] Compiling with esbuild...");
|
|
391
|
+
const packageJson = JSON.parse(readFileSync(join(projectRoot, "package.json"), "utf-8"));
|
|
392
|
+
const deps = [
|
|
393
|
+
...Object.keys(packageJson.dependencies ?? {}),
|
|
394
|
+
...Object.keys(packageJson.devDependencies ?? {}),
|
|
395
|
+
...Object.keys(packageJson.optionalDependencies ?? {}),
|
|
396
|
+
...Object.keys(packageJson.peerDependencies ?? {})
|
|
397
|
+
];
|
|
398
|
+
const externals = deps.map((d) => `--external:${d}`).join(" ");
|
|
391
399
|
await runCommand(
|
|
392
|
-
`esbuild "${srcPath}/**/*.ts" --outdir="${distPath}" --platform=node --format=cjs --bundle=false --sourcemap --outbase="${srcPath}"`,
|
|
400
|
+
`esbuild "${srcPath}/**/*.ts" --outdir="${distPath}" --platform=node --format=cjs --bundle=false --sourcemap --outbase="${srcPath}" ${externals}`,
|
|
393
401
|
{ NODE_ENV: "production" }
|
|
394
402
|
);
|
|
395
403
|
console.log("[Sprint] Compilation completed ✓");
|
|
@@ -397,8 +405,21 @@ async function main() {
|
|
|
397
405
|
await runCommand(`tsc --project "${tsconfigPath}" --noEmit`, { NODE_ENV: "production" });
|
|
398
406
|
console.log("[Sprint] Type check completed ✓");
|
|
399
407
|
console.log("[Sprint] Resolving aliases...");
|
|
400
|
-
|
|
401
|
-
|
|
408
|
+
const aliasConfig = {
|
|
409
|
+
extends: "./tsconfig.json",
|
|
410
|
+
compilerOptions: {
|
|
411
|
+
outDir: "./dist",
|
|
412
|
+
noEmit: false
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
const aliasConfigPath = join(projectRoot, "tsconfig.alias.json");
|
|
416
|
+
writeFileSync(aliasConfigPath, JSON.stringify(aliasConfig, null, 4));
|
|
417
|
+
try {
|
|
418
|
+
await runCommand(`tsc-alias --project "${aliasConfigPath}"`, { NODE_ENV: "production" });
|
|
419
|
+
console.log("[Sprint] Aliases resolved ✓");
|
|
420
|
+
} finally {
|
|
421
|
+
rmSync(aliasConfigPath, { force: true });
|
|
422
|
+
}
|
|
402
423
|
if (isTS) {
|
|
403
424
|
console.log("[Sprint] Compiling sprint.config.ts...");
|
|
404
425
|
await runCommand(
|