@absolutejs/absolute 0.19.0-beta.733 → 0.19.0-beta.734

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.
@@ -0,0 +1,26 @@
1
+ /** Generate a vendor entry source that re-exports both named AND default
2
+ * exports robustly, regardless of whether the source has a default export.
3
+ *
4
+ * Why this is non-trivial:
5
+ * - Per ECMA spec, `export *` re-exports only NAMED exports — never the
6
+ * default. So a vendor wrapping `firebase/compat/app` (whose entire
7
+ * surface is `export { default } from '@firebase/app-compat'`) ends up
8
+ * completely empty, breaking `import firebase from "/vendor/X.js"`.
9
+ * - Naively adding `export { default } from 'X'` makes Bun.build fail with
10
+ * "No matching export for 'default'" when X has no default export.
11
+ * - Heuristic detection from the resolved file (e.g. checking for
12
+ * `export default` or `module.exports`) is unreliable because
13
+ * `Bun.resolveSync` and `Bun.build` can pick different files for the
14
+ * same specifier (CJS `index.js` vs ESM `index.mjs` via the package's
15
+ * `exports` map).
16
+ *
17
+ * Solution: import the package as a namespace and re-export the namespace's
18
+ * default. Works for every shape:
19
+ * - ESM with default: `__ns.default` is the original default value
20
+ * - ESM without default: `__ns.default` is `undefined` (consumer that
21
+ * imports default would have failed against the original package too)
22
+ * - CJS: Bun's interop synthesizes a default on the namespace
23
+ *
24
+ * The namespace import has no compile-time check on `default` existence,
25
+ * so Bun.build accepts it for all packages. */
26
+ export declare const generateVendorEntrySource: (specifier: string) => string;
package/package.json CHANGED
@@ -336,5 +336,5 @@
336
336
  ]
337
337
  }
338
338
  },
339
- "version": "0.19.0-beta.733"
339
+ "version": "0.19.0-beta.734"
340
340
  }
@@ -1,10 +0,0 @@
1
- /** Heuristic check for whether a module exposes a default export.
2
- *
3
- * Required because `export *` (per ECMA spec) re-exports only NAMED exports,
4
- * dropping the default. Without this, vendor files for packages whose surface
5
- * is primarily a default (e.g. `firebase/compat/app`, classic CJS modules)
6
- * ship empty, breaking `import x from "/vendor/pkg.js"` consumers.
7
- *
8
- * Conversely, blindly emitting `export { default } from 'X'` for a package
9
- * with no default makes Bun.build fail. We must detect from the entry source. */
10
- export declare const hasDefaultExport: (specifier: string) => Promise<boolean>;