sprint-es 0.0.116 → 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 +9 -1
- package/dist/esm/cli.js +10 -2
- 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 ✓");
|
package/dist/esm/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { existsSync, rmSync,
|
|
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 ✓");
|