@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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b9g/libuild",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "Zero-config library builds",
5
5
  "keywords": [
6
6
  "build",
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 (!exports2["."]) {
215509
- exports2["."] = await createExportEntry(mainEntry);
215510
- } else {
215511
- exports2["."] = expandExistingExport(exports2["."], mainEntry);
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 (options.formats.cjs) {
215887
- cleaned.main = `src/${mainEntry}.cjs`;
215888
- }
215889
- cleaned.module = `src/${mainEntry}.js`;
215890
- if (distDir) {
215891
- const dtsPath = Path3.join(distDir, "src", `${mainEntry}.d.ts`);
215892
- const exists = await fileExists(dtsPath);
215893
- if (exists) {
215894
- cleaned.types = `src/${mainEntry}.d.ts`;
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 (!exports["."]) {
496
- exports["."] = await createExportEntry(mainEntry);
497
- } else {
498
- exports["."] = expandExistingExport(exports["."], mainEntry);
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 (options.formats.cjs) {
874
- cleaned.main = `src/${mainEntry}.cjs`;
875
- }
876
- cleaned.module = `src/${mainEntry}.js`;
877
- if (distDir) {
878
- const dtsPath = Path3.join(distDir, "src", `${mainEntry}.d.ts`);
879
- const exists = await fileExists(dtsPath);
880
- if (exists) {
881
- cleaned.types = `src/${mainEntry}.d.ts`;
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;