@absolutejs/absolute 0.20.0-beta.154 → 0.20.0-beta.156

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.
@@ -1338,7 +1338,7 @@ var loadAbsoluteMobileDevModules = async () => {
1338
1338
  expoNativeWatcher
1339
1339
  ] = await Promise.all([
1340
1340
  import("./config-hy5dkexz.js"),
1341
- import("./expoProject-f3eb0040.js"),
1341
+ import("./expoProject-z1gxrw3s.js"),
1342
1342
  import("./expoDevController-hen9sra5.js"),
1343
1343
  import("./nativeAuth-ysv0x5dy.js"),
1344
1344
  import("./androidEmulatorController-3zn6a4j3.js"),
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  writeAbsoluteExpoProject2,
4
4
  syncAbsoluteExpoWebAssets2
5
- } from "./index-snz4z0tq.js";
5
+ } from "./index-x3a66ym4.js";
6
6
  import"./index-pch0v1z6.js";
7
7
  export {
8
8
  syncAbsoluteExpoWebAssets2 as syncAbsoluteExpoWebAssets,
@@ -7,7 +7,7 @@ import {
7
7
  resolveAbsoluteMobileUpdateRuntime,
8
8
  writeAbsoluteExpoProject2,
9
9
  syncAbsoluteExpoWebAssets2
10
- } from "./index-snz4z0tq.js";
10
+ } from "./index-x3a66ym4.js";
11
11
  import {
12
12
  toPascal
13
13
  } from "./index-92g14j47.js";
@@ -283,4 +283,66 @@ var maskLiterals = (src) => {
283
283
  return { masked: state.parts.join(""), restore };
284
284
  };
285
285
 
286
- export { SENTINEL, maskLiterals };
286
+ // src/build/specifierRewriter.ts
287
+ var escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
288
+ var PLACEHOLDER = `${SENTINEL}\\d+${SENTINEL}`;
289
+ var GAP = `(?:\\s|${PLACEHOLDER}|/\\*${PLACEHOLDER}\\*/|//${PLACEHOLDER})*`;
290
+ var QUOTE = `["']`;
291
+ var ADJACENT_PREFIXES = [`from\\s*${QUOTE}`, `import\\s*${QUOTE}`];
292
+ var ADJACENT_DYNAMIC_PREFIX = `import\\s*\\(\\s*${QUOTE}`;
293
+ var ADJACENT_DYNAMIC_SUFFIX = `${QUOTE}\\s*\\)`;
294
+ var SWEEP_PREFIXES = [
295
+ `\\bfrom${GAP}${QUOTE}`,
296
+ `\\bimport${GAP}${QUOTE}`,
297
+ `\\b(?:import|require)${GAP}\\(${GAP}${QUOTE}`
298
+ ];
299
+ var rewriterCache = new Map;
300
+ var cacheKey = (vendorPaths) => Object.entries(vendorPaths).sort(([left], [right]) => left.localeCompare(right)).map(([specifier, webPath]) => `${specifier}\x00${webPath}\x00`).join("");
301
+ var compileRegex = (prefixes, alternation, withAdjacentDynamic) => {
302
+ const plain = `(${prefixes.join("|")})(${alternation})(${QUOTE})`;
303
+ if (!withAdjacentDynamic)
304
+ return new RegExp(plain, "g");
305
+ const dynamic = `(${ADJACENT_DYNAMIC_PREFIX})(${alternation})(${ADJACENT_DYNAMIC_SUFFIX})`;
306
+ return new RegExp(`${plain}|${dynamic}`, "g");
307
+ };
308
+ var compileSpecifierRewriter = (vendorPaths) => {
309
+ const key = cacheKey(vendorPaths);
310
+ const cached = rewriterCache.get(key);
311
+ if (cached)
312
+ return cached;
313
+ const replacements = Object.entries(vendorPaths).sort(([specA], [specB]) => specB.length - specA.length);
314
+ const alternation = replacements.map(([specifier]) => escapeRegex(specifier)).join("|");
315
+ const rewriter = {
316
+ lookup: new Map(replacements),
317
+ mainRegex: compileRegex(ADJACENT_PREFIXES, alternation, true),
318
+ quotedSpecifiers: replacements.flatMap(([specifier]) => [
319
+ `"${specifier}`,
320
+ `'${specifier}`
321
+ ]),
322
+ sweepRegex: compileRegex(SWEEP_PREFIXES, alternation, false),
323
+ unionRegex: compileRegex([...ADJACENT_PREFIXES, ...SWEEP_PREFIXES], alternation, true)
324
+ };
325
+ rewriterCache.set(key, rewriter);
326
+ return rewriter;
327
+ };
328
+ var hasSpecifierCandidate = (content, rewriter) => rewriter.quotedSpecifiers.some((quoted) => content.includes(quoted));
329
+ var asGroup = (value) => typeof value === "string" ? value : undefined;
330
+ var replaceSpecifier = (lookup) => (match, ...groups) => {
331
+ const [prefixA, specA, suffixA, prefixB, specB, suffixB] = groups;
332
+ const prefix = asGroup(prefixA) ?? asGroup(prefixB);
333
+ const specifier = asGroup(specA) ?? asGroup(specB);
334
+ const suffix = asGroup(suffixA) ?? asGroup(suffixB);
335
+ if (prefix === undefined || specifier === undefined || suffix === undefined)
336
+ return match;
337
+ const webPath = lookup.get(specifier);
338
+ return webPath === undefined ? match : `${prefix}${webPath}${suffix}`;
339
+ };
340
+ var rewriteContentSpecifiers = (content, rewriter, options) => {
341
+ if (!hasSpecifierCandidate(content, rewriter))
342
+ return content;
343
+ const { masked, restore } = maskLiterals(content);
344
+ return restore(rewriteSpecifiers(masked, rewriter, options));
345
+ };
346
+ var rewriteSpecifiers = (masked, rewriter, options) => masked.replace(options.sweep ? rewriter.unionRegex : rewriter.mainRegex, replaceSpecifier(rewriter.lookup));
347
+
348
+ export { maskLiterals, compileSpecifierRewriter, rewriteContentSpecifiers };
@@ -20,7 +20,7 @@ import {
20
20
  createElysiaOpenApiTypeboxPlugin,
21
21
  createOptionalPeerPlugin,
22
22
  resolveServerBundleExternals
23
- } from "./index-f6mqr467.js";
23
+ } from "./index-3n1vqn3y.js";
24
24
  import {
25
25
  normalizeAbsoluteMobileConfig2
26
26
  } from "./index-t7yf3vxs.js";
@@ -420,7 +420,7 @@ var start2 = async (serverEntry, outdir, configPath, options = {}) => {
420
420
  angularServerVendorPaths[specifier] = relPath.startsWith(".") ? relPath : `./${relPath}`;
421
421
  }
422
422
  if (Object.keys(angularServerVendorPaths).length > 0) {
423
- const { rewriteImports } = await import("./rewriteImports-k6rjjmg1.js");
423
+ const { rewriteImports } = await import("./rewriteImports-z6629aww.js");
424
424
  await rewriteImports([outputPath], angularServerVendorPaths);
425
425
  }
426
426
  }
@@ -27,8 +27,8 @@ import { basename, dirname as dirname4, join as join8, relative as relative3, re
27
27
  // src/mobile/nativePackages.ts
28
28
  import { readFile } from "fs/promises";
29
29
  import { dirname, join, resolve } from "path";
30
- var ABSOLUTE_CAPACITOR_DEVICES_VERSION = "0.8.0";
31
- var ABSOLUTE_CAPACITOR_SYNC_VERSION = "0.9.4";
30
+ var ABSOLUTE_CAPACITOR_DEVICES_VERSION = "0.8.1";
31
+ var ABSOLUTE_CAPACITOR_SYNC_VERSION = "0.9.5";
32
32
  var ABSOLUTE_DEVICES_VERSION = "0.7.1";
33
33
  var ABSOLUTE_EXPO_DEVICES_VERSION = "0.0.12";
34
34
  var ABSOLUTE_NATIVE_EXACT_PACKAGES = new Set([
package/dist/cli/index.js CHANGED
@@ -54,7 +54,7 @@ if (command === "dev") {
54
54
  }
55
55
  const positionalArgs = stripNamedArgs("--config", "--android-device", "--ios-device").filter((arg) => arg !== "--no-mobile" && arg !== "--eager");
56
56
  const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
57
- const { dev } = await import("./dev-7ep6b81g.js");
57
+ const { dev } = await import("./dev-dpb0bksv.js");
58
58
  await dev(serverEntry, configPath, {
59
59
  androidDevice,
60
60
  eager: args.includes("--eager"),
@@ -70,7 +70,7 @@ if (command === "dev") {
70
70
  const configPath = parseNamedArg("--config");
71
71
  const positionalArgs = stripNamedArgs("--outdir", "--config").filter((arg) => arg !== "--prebuilt");
72
72
  const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
73
- const { start } = await import("./start-d1200qc3.js");
73
+ const { start } = await import("./start-3bbpy0md.js");
74
74
  await start(serverEntry, outdir, configPath, {
75
75
  prebuilt: args.includes("--prebuilt")
76
76
  });
@@ -80,7 +80,7 @@ if (command === "dev") {
80
80
  const configPath = parseNamedArg("--config");
81
81
  const positionalArgs = stripNamedArgs("--outdir", "--config");
82
82
  const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
83
- const { start } = await import("./start-d1200qc3.js");
83
+ const { start } = await import("./start-3bbpy0md.js");
84
84
  await start(serverEntry, outdir, configPath, { prepareOnly: true });
85
85
  } else if (command === "build") {
86
86
  sendTelemetryEvent("cli:command", { command });
@@ -205,13 +205,13 @@ if (command === "dev") {
205
205
  const configPath = parseNamedArg("--config");
206
206
  const positionalArgs = stripNamedArgs("--outdir", "--outfile", "--config");
207
207
  const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
208
- const { compile } = await import("./compile-0e7bd2db.js");
208
+ const { compile } = await import("./compile-bky8k5we.js");
209
209
  await compile(serverEntry, outdir, outfile, configPath);
210
210
  } else if (command === "mobile") {
211
211
  sendTelemetryEvent("cli:command", {
212
212
  command: `mobile:${workspaceCommand ?? "unknown"}`
213
213
  });
214
- const { runMobile } = await import("./mobile-8r10trsk.js");
214
+ const { runMobile } = await import("./mobile-gtnrcfsf.js");
215
215
  try {
216
216
  await runMobile(args);
217
217
  } catch (error) {
@@ -25,7 +25,7 @@ import {
25
25
  renderAbsoluteMobileBrandingPreview,
26
26
  writeAbsoluteExpoProject2,
27
27
  syncAbsoluteExpoWebAssets2
28
- } from "./index-snz4z0tq.js";
28
+ } from "./index-x3a66ym4.js";
29
29
  import {
30
30
  projectUsesAbsoluteAuth2,
31
31
  projectUsesAbsoluteSync2
@@ -61,7 +61,7 @@ import {
61
61
  resolveAbsoluteMobileRoute,
62
62
  ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION,
63
63
  ABSOLUTE_MOBILE_CLIENT_MANIFEST_FORMAT
64
- } from "./index-f6mqr467.js";
64
+ } from "./index-3n1vqn3y.js";
65
65
  import {
66
66
  buildAbsoluteExpoAndroidWslBundle2
67
67
  } from "./index-px7fqsfk.js";
@@ -78,7 +78,7 @@ import {
78
78
  import"./index-e6ysp900.js";
79
79
  import {
80
80
  start2
81
- } from "./index-50n5vfd1.js";
81
+ } from "./index-cnchgvtx.js";
82
82
  import {
83
83
  captureAbsoluteRemoteMacCommand2,
84
84
  getAbsoluteRemoteMacProfile2,
@@ -0,0 +1,46 @@
1
+ // @bun
2
+ import {
3
+ compileSpecifierRewriter,
4
+ rewriteContentSpecifiers
5
+ } from "./index-bp60baze.js";
6
+
7
+ // src/build/rewriteImportsPlugin.ts
8
+ var rewriteImportsInContent = (content, vendorPaths) => {
9
+ if (Object.keys(vendorPaths).length === 0)
10
+ return content;
11
+ return rewriteContentSpecifiers(content, compileSpecifierRewriter(vendorPaths), { sweep: false });
12
+ };
13
+
14
+ // src/build/rewriteImports.ts
15
+ var rewriteImports = async (outputPaths, vendorPaths) => {
16
+ const jsFiles = outputPaths.filter((path) => path.endsWith(".js"));
17
+ if (jsFiles.length === 0)
18
+ return;
19
+ if (Object.keys(vendorPaths).length === 0)
20
+ return;
21
+ await Promise.all(jsFiles.map(async (filePath) => {
22
+ let original;
23
+ try {
24
+ original = await Bun.file(filePath).text();
25
+ } catch (err) {
26
+ const code = err.code;
27
+ if (code === "ENOENT")
28
+ return;
29
+ throw err;
30
+ }
31
+ const rewritten = rewriteImportsInContent(original, vendorPaths);
32
+ if (rewritten === original)
33
+ return;
34
+ try {
35
+ await Bun.write(filePath, rewritten);
36
+ } catch (err) {
37
+ const code = err.code;
38
+ if (code === "ENOENT")
39
+ return;
40
+ throw err;
41
+ }
42
+ }));
43
+ };
44
+ export {
45
+ rewriteImports
46
+ };
@@ -1,15 +1,15 @@
1
1
  // @bun
2
2
  import {
3
3
  start2
4
- } from "./index-50n5vfd1.js";
5
- import"./index-f6mqr467.js";
4
+ } from "./index-cnchgvtx.js";
5
+ import"./index-3n1vqn3y.js";
6
6
  import"./index-e6ysp900.js";
7
7
  import"./index-71gchbzt.js";
8
8
  import"./index-h7qhz02e.js";
9
9
  import"./index-qyxd5n9a.js";
10
10
  import"./index-43a1vvb7.js";
11
11
  import"./index-t7yf3vxs.js";
12
- import"./index-snz4z0tq.js";
12
+ import"./index-x3a66ym4.js";
13
13
  import"./index-pch0v1z6.js";
14
14
  import"./index-v4cg4dvm.js";
15
15
  import"./index-74m7kh8c.js";
package/dist/index.js CHANGED
@@ -26287,7 +26287,9 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
26287
26287
  const output = nonReactClientOutputs.find((artifact) => basename17(artifact.path).startsWith(`${srcBase}.`));
26288
26288
  if (!output)
26289
26289
  continue;
26290
- urlFileMap.set(basename17(srcPath), `/${relative21(buildPath, output.path).replace(/\\/g, "/")}`);
26290
+ const url = `/${relative21(buildPath, output.path).replace(/\\/g, "/")}`;
26291
+ urlFileMap.set(basename17(srcPath), url);
26292
+ urlFileMap.set(basename17(srcPath).replace(/\.tsx?$/, ".js"), url);
26291
26293
  }
26292
26294
  return urlFileMap;
26293
26295
  }, buildUrlFileMap = (urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs) => {
@@ -44158,5 +44160,5 @@ export {
44158
44160
  wrapPageHandlerWithStreamingSlots
44159
44161
  };
44160
44162
 
44161
- //# debugId=A88F7960F78DEE6B64756E2164756E21
44163
+ //# debugId=C19421CAE2DC8E5364756E2164756E21
44162
44164
  //# sourceMappingURL=index.js.map