@absolutejs/absolute 0.19.0-beta.24 → 0.19.0-beta.26
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/.absolutejs/tsconfig.tsbuildinfo +1 -1
- package/dist/build.js +17 -42
- package/dist/build.js.map +4 -4
- package/dist/index.js +17 -42
- package/dist/index.js.map +4 -4
- package/native/packages/darwin-arm64/package.json +1 -1
- package/native/packages/darwin-x64/package.json +1 -1
- package/native/packages/linux-arm64/package.json +1 -1
- package/native/packages/linux-x64/package.json +1 -1
- package/package.json +5 -5
package/dist/build.js
CHANGED
|
@@ -202161,20 +202161,13 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, TRANSPILABLE, REACT_EXTENSIONS, escape
|
|
|
202161
202161
|
return { dynamicRegex, fromRegex, lookup, sideEffectRegex };
|
|
202162
202162
|
}, rewriteImports2 = (code, filePath, projectRoot, rewriter) => {
|
|
202163
202163
|
let result = code;
|
|
202164
|
-
|
|
202165
|
-
|
|
202166
|
-
|
|
202167
|
-
|
|
202168
|
-
return _match;
|
|
202164
|
+
const bareSpecifierRe = /((?:from|import)\s*["'])([^"'./][^"']*)(["'])/g;
|
|
202165
|
+
result = result.replace(bareSpecifierRe, (_match, prefix, specifier, suffix) => {
|
|
202166
|
+
const webPath = rewriter?.lookup.get(specifier);
|
|
202167
|
+
if (webPath)
|
|
202169
202168
|
return `${prefix}${webPath}${suffix}`;
|
|
202170
|
-
}
|
|
202171
|
-
|
|
202172
|
-
rewriter.sideEffectRegex.lastIndex = 0;
|
|
202173
|
-
rewriter.dynamicRegex.lastIndex = 0;
|
|
202174
|
-
result = result.replace(rewriter.fromRegex, replacer);
|
|
202175
|
-
result = result.replace(rewriter.sideEffectRegex, replacer);
|
|
202176
|
-
result = result.replace(rewriter.dynamicRegex, replacer);
|
|
202177
|
-
}
|
|
202169
|
+
return `${prefix}/@stub/${encodeURIComponent(specifier)}${suffix}`;
|
|
202170
|
+
});
|
|
202178
202171
|
const fileDir = dirname7(filePath);
|
|
202179
202172
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => {
|
|
202180
202173
|
const absPath = resolve16(fileDir, relPath);
|
|
@@ -202282,6 +202275,14 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, TRANSPILABLE, REACT_EXTENSIONS, escape
|
|
|
202282
202275
|
const { projectRoot, vendorPaths } = config;
|
|
202283
202276
|
const rewriter = buildImportRewriter(vendorPaths);
|
|
202284
202277
|
return (pathname) => {
|
|
202278
|
+
if (pathname.startsWith("/@stub/")) {
|
|
202279
|
+
return new Response("export default {}; export {};", {
|
|
202280
|
+
headers: {
|
|
202281
|
+
"Cache-Control": "no-cache",
|
|
202282
|
+
"Content-Type": "application/javascript"
|
|
202283
|
+
}
|
|
202284
|
+
});
|
|
202285
|
+
}
|
|
202285
202286
|
if (!pathname.startsWith(SRC_PREFIX))
|
|
202286
202287
|
return;
|
|
202287
202288
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
@@ -203778,34 +203779,8 @@ var toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
203778
203779
|
} catch {}
|
|
203779
203780
|
}
|
|
203780
203781
|
return Array.from(specifiers).filter(isResolvable2);
|
|
203781
|
-
}, generateEntrySource2 =
|
|
203782
|
-
|
|
203783
|
-
const mod = await import(specifier);
|
|
203784
|
-
const exportNames = Object.keys(mod).filter((key) => key !== "default" && key !== "__esModule");
|
|
203785
|
-
const lines = [];
|
|
203786
|
-
if (exportNames.length > 0) {
|
|
203787
|
-
lines.push(`export { ${exportNames.join(", ")} } from '${specifier}';`);
|
|
203788
|
-
}
|
|
203789
|
-
try {
|
|
203790
|
-
const resolved = __require.resolve(specifier);
|
|
203791
|
-
const source = await Bun.file(resolved).text();
|
|
203792
|
-
const hasExportDefault = /export\s+default\b/.test(source) || /module\.exports\s*=/.test(source);
|
|
203793
|
-
if (hasExportDefault) {
|
|
203794
|
-
lines.push(`export { default } from '${specifier}';`);
|
|
203795
|
-
}
|
|
203796
|
-
} catch {}
|
|
203797
|
-
if (lines.length === 0) {
|
|
203798
|
-
return `export * from '${specifier}';
|
|
203799
|
-
`;
|
|
203800
|
-
}
|
|
203801
|
-
return lines.join(`
|
|
203802
|
-
`) + `
|
|
203803
|
-
`;
|
|
203804
|
-
} catch {
|
|
203805
|
-
return `export * from '${specifier}';
|
|
203806
|
-
`;
|
|
203807
|
-
}
|
|
203808
|
-
}, computeDepVendorPaths = async (directories) => {
|
|
203782
|
+
}, generateEntrySource2 = (specifier) => `export * from '${specifier}';
|
|
203783
|
+
`, computeDepVendorPaths = async (directories) => {
|
|
203809
203784
|
const specifiers = await scanBareImports(directories);
|
|
203810
203785
|
const paths = {};
|
|
203811
203786
|
for (const specifier of specifiers) {
|
|
@@ -204120,5 +204095,5 @@ export {
|
|
|
204120
204095
|
build
|
|
204121
204096
|
};
|
|
204122
204097
|
|
|
204123
|
-
//# debugId=
|
|
204098
|
+
//# debugId=B82AAE7439B05C6764756E2164756E21
|
|
204124
204099
|
//# sourceMappingURL=build.js.map
|