@b9g/libuild 0.1.13 → 0.1.15
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/CHANGELOG.md +10 -0
- package/package.json +1 -1
- package/src/cli.js +1 -1
- package/src/libuild.cjs +19 -15
- package/src/libuild.js +19 -15
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.1.15] - 2025-01-14
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- **Support bin-only packages** - Packages with only bin/ executables and no src/ library code no longer crash. Main/module/types fields and "." export are now correctly omitted for bin-only packages, while bin exports are properly generated.
|
|
9
|
+
|
|
10
|
+
## [0.1.14] - 2025-01-14
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- **Eliminate stderr noise from dual-purpose shebang** - Changed from `//bin/true` to standard polyglot pattern `':' //;` to prevent shell from attempting to execute non-existent path, eliminating "No such file or directory" errors while maintaining dual runtime detection
|
|
14
|
+
|
|
5
15
|
## [0.1.13] - 2025-01-14
|
|
6
16
|
|
|
7
17
|
### Fixed
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env sh
|
|
2
|
-
|
|
2
|
+
':' //; exec "$({ [ "${npm_config_user_agent#bun/}" != "$npm_config_user_agent" ] || true; } && command -v bun || command -v node)" "$0" "$@"
|
|
3
3
|
/// <reference types="./cli.d.ts" />
|
|
4
4
|
|
|
5
5
|
// src/cli.ts
|
package/src/libuild.cjs
CHANGED
|
@@ -215233,9 +215233,9 @@ ${content}`;
|
|
|
215233
215233
|
function generateRuntimeBanner(pkg) {
|
|
215234
215234
|
const prefersBun = pkg.engines?.bun !== void 0;
|
|
215235
215235
|
if (prefersBun) {
|
|
215236
|
-
return '
|
|
215236
|
+
return `':' //; exec "$({ [ "\${npm_config_user_agent#bun/}" != "$npm_config_user_agent" ] || true; } && command -v bun || command -v node)" "$0" "$@"`;
|
|
215237
215237
|
} else {
|
|
215238
|
-
return '
|
|
215238
|
+
return `':' //; exec "$([ "\${npm_config_user_agent#bun/}" != "$npm_config_user_agent" ] && command -v bun || command -v node)" "$0" "$@"`;
|
|
215239
215239
|
}
|
|
215240
215240
|
}
|
|
215241
215241
|
async function processJavaScriptExecutable(filePath, runtimeBanner) {
|
|
@@ -215505,10 +215505,12 @@ async function generateExports(entries, mainEntry, options, existingExports = {}
|
|
|
215505
215505
|
exports2[key] = expandExistingExport(value);
|
|
215506
215506
|
}
|
|
215507
215507
|
}
|
|
215508
|
-
if (
|
|
215509
|
-
exports2["."]
|
|
215510
|
-
|
|
215511
|
-
|
|
215508
|
+
if (mainEntry) {
|
|
215509
|
+
if (!exports2["."]) {
|
|
215510
|
+
exports2["."] = await createExportEntry(mainEntry);
|
|
215511
|
+
} else {
|
|
215512
|
+
exports2["."] = expandExistingExport(exports2["."], mainEntry);
|
|
215513
|
+
}
|
|
215512
215514
|
}
|
|
215513
215515
|
for (const entry of entries) {
|
|
215514
215516
|
if (entry === "umd")
|
|
@@ -215883,15 +215885,17 @@ async function cleanPackageJSON(pkg, mainEntry, options, cwd, distDir) {
|
|
|
215883
215885
|
if (!cleaned.type) {
|
|
215884
215886
|
cleaned.type = "module";
|
|
215885
215887
|
}
|
|
215886
|
-
if (
|
|
215887
|
-
|
|
215888
|
-
|
|
215889
|
-
|
|
215890
|
-
|
|
215891
|
-
|
|
215892
|
-
|
|
215893
|
-
|
|
215894
|
-
|
|
215888
|
+
if (mainEntry) {
|
|
215889
|
+
if (options.formats.cjs) {
|
|
215890
|
+
cleaned.main = `src/${mainEntry}.cjs`;
|
|
215891
|
+
}
|
|
215892
|
+
cleaned.module = `src/${mainEntry}.js`;
|
|
215893
|
+
if (distDir) {
|
|
215894
|
+
const dtsPath = Path3.join(distDir, "src", `${mainEntry}.d.ts`);
|
|
215895
|
+
const exists = await fileExists(dtsPath);
|
|
215896
|
+
if (exists) {
|
|
215897
|
+
cleaned.types = `src/${mainEntry}.d.ts`;
|
|
215898
|
+
}
|
|
215895
215899
|
}
|
|
215896
215900
|
}
|
|
215897
215901
|
return cleaned;
|
package/src/libuild.js
CHANGED
|
@@ -220,9 +220,9 @@ ${content}`;
|
|
|
220
220
|
function generateRuntimeBanner(pkg) {
|
|
221
221
|
const prefersBun = pkg.engines?.bun !== void 0;
|
|
222
222
|
if (prefersBun) {
|
|
223
|
-
return '
|
|
223
|
+
return `':' //; exec "$({ [ "\${npm_config_user_agent#bun/}" != "$npm_config_user_agent" ] || true; } && command -v bun || command -v node)" "$0" "$@"`;
|
|
224
224
|
} else {
|
|
225
|
-
return '
|
|
225
|
+
return `':' //; exec "$([ "\${npm_config_user_agent#bun/}" != "$npm_config_user_agent" ] && command -v bun || command -v node)" "$0" "$@"`;
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
async function processJavaScriptExecutable(filePath, runtimeBanner) {
|
|
@@ -492,10 +492,12 @@ async function generateExports(entries, mainEntry, options, existingExports = {}
|
|
|
492
492
|
exports[key] = expandExistingExport(value);
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
|
-
if (
|
|
496
|
-
exports["."]
|
|
497
|
-
|
|
498
|
-
|
|
495
|
+
if (mainEntry) {
|
|
496
|
+
if (!exports["."]) {
|
|
497
|
+
exports["."] = await createExportEntry(mainEntry);
|
|
498
|
+
} else {
|
|
499
|
+
exports["."] = expandExistingExport(exports["."], mainEntry);
|
|
500
|
+
}
|
|
499
501
|
}
|
|
500
502
|
for (const entry of entries) {
|
|
501
503
|
if (entry === "umd")
|
|
@@ -870,15 +872,17 @@ async function cleanPackageJSON(pkg, mainEntry, options, cwd, distDir) {
|
|
|
870
872
|
if (!cleaned.type) {
|
|
871
873
|
cleaned.type = "module";
|
|
872
874
|
}
|
|
873
|
-
if (
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
875
|
+
if (mainEntry) {
|
|
876
|
+
if (options.formats.cjs) {
|
|
877
|
+
cleaned.main = `src/${mainEntry}.cjs`;
|
|
878
|
+
}
|
|
879
|
+
cleaned.module = `src/${mainEntry}.js`;
|
|
880
|
+
if (distDir) {
|
|
881
|
+
const dtsPath = Path3.join(distDir, "src", `${mainEntry}.d.ts`);
|
|
882
|
+
const exists = await fileExists(dtsPath);
|
|
883
|
+
if (exists) {
|
|
884
|
+
cleaned.types = `src/${mainEntry}.d.ts`;
|
|
885
|
+
}
|
|
882
886
|
}
|
|
883
887
|
}
|
|
884
888
|
return cleaned;
|