fix(cli): prevent duplicate shebang in npm bundle
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
import { Command } from "commander";
|
import { Command } from "commander";
|
||||||
import { onboard } from "./commands/onboard.js";
|
import { onboard } from "./commands/onboard.js";
|
||||||
import { doctor } from "./commands/doctor.js";
|
import { doctor } from "./commands/doctor.js";
|
||||||
|
|||||||
@@ -49,14 +49,18 @@ await esbuild.build(config);
|
|||||||
|
|
||||||
chmod +x dist/index.js
|
chmod +x dist/index.js
|
||||||
|
|
||||||
# ── Step 4: Back up dev package.json, generate publishable one ─────────────────
|
# ── Step 4: Validate bundled entrypoint syntax ─────────────────────────────────
|
||||||
echo " [4/5] Generating publishable package.json..."
|
echo " [4/6] Verifying bundled entrypoint syntax..."
|
||||||
|
node --check "$DIST_DIR/index.js"
|
||||||
|
|
||||||
|
# ── Step 5: Back up dev package.json, generate publishable one ─────────────────
|
||||||
|
echo " [5/6] Generating publishable package.json..."
|
||||||
cp "$CLI_DIR/package.json" "$CLI_DIR/package.dev.json"
|
cp "$CLI_DIR/package.json" "$CLI_DIR/package.dev.json"
|
||||||
node "$REPO_ROOT/scripts/generate-npm-package-json.mjs"
|
node "$REPO_ROOT/scripts/generate-npm-package-json.mjs"
|
||||||
|
|
||||||
# ── Step 5: Summary ───────────────────────────────────────────────────────────
|
# ── Step 6: Summary ───────────────────────────────────────────────────────────
|
||||||
BUNDLE_SIZE=$(wc -c < "$DIST_DIR/index.js" | xargs)
|
BUNDLE_SIZE=$(wc -c < "$DIST_DIR/index.js" | xargs)
|
||||||
echo " [5/5] Build verification..."
|
echo " [6/6] Build verification..."
|
||||||
echo ""
|
echo ""
|
||||||
echo "Build complete."
|
echo "Build complete."
|
||||||
echo " Bundle: cli/dist/index.js (${BUNDLE_SIZE} bytes)"
|
echo " Bundle: cli/dist/index.js (${BUNDLE_SIZE} bytes)"
|
||||||
|
|||||||
Reference in New Issue
Block a user