@b9g/libuild 0.1.14 → 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 +5 -0
- package/package.json +1 -1
- package/src/libuild.cjs +17 -13
- package/src/libuild.js +17 -13
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
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
|
+
|
|
5
10
|
## [0.1.14] - 2025-01-14
|
|
6
11
|
|
|
7
12
|
### Fixed
|
package/package.json
CHANGED
package/src/libuild.cjs
CHANGED
|
@@ -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
|
@@ -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;
|