@absolutejs/absolute 0.20.0-beta.131 → 0.20.0-beta.133

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.
@@ -11,8 +11,9 @@ import {
11
11
  finalizeAbsoluteMobileCompatibilityBuild,
12
12
  createAbsoluteMobileRouteMetadataPlugin,
13
13
  createElysiaOpenApiTypeboxPlugin,
14
+ createOptionalPeerPlugin,
14
15
  resolveServerBundleExternals
15
- } from "./index-r6k4xmdb.js";
16
+ } from "./index-hfvxsgf4.js";
16
17
  import {
17
18
  normalizeAbsoluteMobileConfig2
18
19
  } from "./index-rrxeqrbn.js";
@@ -1158,6 +1159,7 @@ export default server;
1158
1159
  external: resolveServerBundleExternals(buildConfig),
1159
1160
  outdir: resolvedOutdir,
1160
1161
  plugins: [
1162
+ createOptionalPeerPlugin(),
1161
1163
  ...islandRegistryPlugin ? [islandRegistryPlugin] : [],
1162
1164
  ...buildConfig.mobile ? [
1163
1165
  createAbsoluteMobileRouteMetadataPlugin({
@@ -15,7 +15,7 @@ import {
15
15
  } from "./index-m1vntzf1.js";
16
16
  import {
17
17
  resolveDevBunExecutable2
18
- } from "./index-r915cvqp.js";
18
+ } from "./index-cc8eay5y.js";
19
19
  import"./index-43a1vvb7.js";
20
20
  import {
21
21
  updateLockMetadata,
@@ -18,8 +18,9 @@ import {
18
18
  finalizeAbsoluteMobileCompatibilityBuild,
19
19
  createAbsoluteMobileRouteMetadataPlugin,
20
20
  createElysiaOpenApiTypeboxPlugin,
21
+ createOptionalPeerPlugin,
21
22
  resolveServerBundleExternals
22
- } from "./index-r6k4xmdb.js";
23
+ } from "./index-hfvxsgf4.js";
23
24
  import {
24
25
  normalizeAbsoluteMobileConfig2
25
26
  } from "./index-rrxeqrbn.js";
@@ -382,6 +383,7 @@ var start2 = async (serverEntry, outdir, configPath, options = {}) => {
382
383
  external: resolveServerBundleExternals(buildConfig),
383
384
  outdir: resolvedOutdir,
384
385
  plugins: [
386
+ createOptionalPeerPlugin(),
385
387
  ...islandRegistryPlugin ? [islandRegistryPlugin] : [],
386
388
  ...buildConfig.mobile ? [
387
389
  createAbsoluteMobileRouteMetadataPlugin({
@@ -2,80 +2,34 @@
2
2
  // src/cli/patchedBun.ts
3
3
  import { spawnSync } from "child_process";
4
4
  import {
5
- chmodSync,
6
5
  existsSync,
7
6
  mkdirSync,
8
7
  readFileSync,
9
- renameSync,
10
8
  rmSync,
11
9
  writeFileSync
12
10
  } from "fs";
13
11
  import { homedir } from "os";
14
12
  import { dirname, join } from "path";
15
13
  import { createInterface } from "readline/promises";
16
- import { inflateRawSync } from "zlib";
17
14
  var PATCHED_BUN_RELEASE = {
18
15
  bunVersion: "1.4.2",
19
16
  issue: "https://github.com/oven-sh/bun/issues/32919",
20
17
  repo: "absolutejs/patched-bun",
21
- sha256: {
22
- "bun-darwin-aarch64": "75f45c72eac0c01e579f81ec48c8530bbec72406604c09abdd1fe6947ec4ac05",
23
- "bun-darwin-x64": "0ad06bff1c847de7a592ecac2e92060dfc8f56361fe92ca52ece8a685cbf416d",
24
- "bun-freebsd-aarch64": "bbc981e3d890b65e042fbf15128d8499acf11bf29d82b1a15efc07a8d02c424d",
25
- "bun-freebsd-x64": "344e1cc9b01541ee16b93be9a946d33f9766e235aa95af758e3b7bd9ebccb354",
26
- "bun-linux-aarch64": "7ad50219c85899ba5d5ffb6728cb128a08f106d99857be7f505ec6b520a2315c",
27
- "bun-linux-aarch64-android": "699c6eb9a1ffcb6787811729ca8f4812e2f4d8969ac3c0bc6b4cfc8265bfd65c",
28
- "bun-linux-aarch64-musl": "70089d21421103d03f9bf657bba48beefb22d58b16dd974cd552ea28d1f7c087",
29
- "bun-linux-x64": "efc724f5c613ae4ae9bb884c067ac8a2b935b959a60082f204b08b4736b531e9",
30
- "bun-linux-x64-android": "e68a9486017e8a2fa02d0144807e2b48b10db3a09be05ad05b66e3bbf5197610",
31
- "bun-linux-x64-musl": "86afabbaacca2a652f9eb4821c5163935eac42ee4c966db323c066b95737fdaa",
32
- "bun-windows-aarch64": "88157fccfac80028c45609d969da819f7ba6d9dafc3c887793188b56d4bf518c",
33
- "bun-windows-x64": "6dbf24593722d1c94e9c54fafd2087a3e8966aa954f753a565e52522162634c8"
34
- },
35
- tag: "bun-v1.4.2-absolute.1"
18
+ version: "1.4.2-absolute.1"
36
19
  };
37
20
  var HOURS_PER_DAY = 24;
38
21
  var MS_PER_HOUR = 3600000;
39
22
  var ASK_LATER_MS = HOURS_PER_DAY * MS_PER_HOUR;
40
23
  var PREFERENCE_FILE = "patched-bun.json";
41
- var EXECUTABLE_MODE = 493;
42
24
  var VERSION_PARTS = 3;
43
25
  var PROBE_TIMEOUT_MS = 30000;
44
- var MUSL_LOADERS = ["/lib/ld-musl-x86_64.so.1", "/lib/ld-musl-aarch64.so.1"];
45
26
  var DEPENDENCY_FIELDS = [
46
27
  "dependencies",
47
28
  "devDependencies",
48
29
  "peerDependencies"
49
30
  ];
50
- var ZIP = {
51
- directoryEntry: 33639248,
52
- endDirectoryOffset: 16,
53
- endEntryCount: 10,
54
- endOfDirectory: 101010256,
55
- endRecordSize: 22,
56
- entryCommentLength: 32,
57
- entryCompressedSize: 20,
58
- entryExtraLength: 30,
59
- entryHeaderSize: 46,
60
- entryLocalOffset: 42,
61
- entryMethod: 10,
62
- entryNameLength: 28,
63
- localExtraLength: 28,
64
- localHeader: 67324752,
65
- localHeaderSize: 30,
66
- localNameLength: 26,
67
- methodDeflate: 8,
68
- methodStored: 0
69
- };
70
- var isAsset = (name) => Object.hasOwn(PATCHED_BUN_RELEASE.sha256, name);
71
- var detectLibc = () => {
72
- if (process.platform === "android")
73
- return "android";
74
- if (MUSL_LOADERS.some((loader) => existsSync(loader)))
75
- return "musl";
76
- return "glibc";
77
- };
78
31
  var absoluteHome = (home) => join(home, ".absolutejs");
32
+ var legacyInstallDirectory = (home) => join(absoluteHome(home), "bun");
79
33
  var compareVersions = (left, right) => {
80
34
  const parse = (version) => version.split("-")[0]?.split(".").map(Number) ?? [];
81
35
  const leftParts = parse(left);
@@ -84,29 +38,44 @@ var compareVersions = (left, right) => {
84
38
  return differences.find((difference) => difference !== 0) ?? 0;
85
39
  };
86
40
  var preferencePath = (home) => join(absoluteHome(home), PREFERENCE_FILE);
87
- var installedPatchedBun = (home = homedir()) => {
88
- const asset = patchedBunAsset();
89
- if (!asset)
41
+ var bvmPlatformPackage = (platform = process.platform, arch = process.arch) => {
42
+ const system = { darwin: "darwin", linux: "linux", win32: "windows" }[platform];
43
+ const cpu = { arm64: "arm64", x64: "x64" }[arch];
44
+ if (!system || !cpu)
90
45
  return null;
91
- const path = patchedBunPath(asset, home);
92
- return existsSync(path) ? path : null;
46
+ return `@absolutejs/bvm-${system}-${cpu}`;
47
+ };
48
+ var bvmRunner = (bvm) => (args, inherit = false) => {
49
+ const result = spawnSync(bvm, args, {
50
+ encoding: "utf-8",
51
+ stdio: inherit ? "inherit" : ["ignore", "pipe", "pipe"]
52
+ });
53
+ return { status: result.status, stdout: result.stdout ?? "" };
93
54
  };
94
- var patchedBunAsset = (platform = process.platform, arch = process.arch, libc = detectLibc()) => {
95
- const cpu = { arm64: "aarch64", x64: "x64" }[arch];
96
- const system = {
97
- android: "linux",
98
- darwin: "darwin",
99
- freebsd: "freebsd",
100
- linux: "linux",
101
- win32: "windows"
102
- }[platform];
103
- if (!cpu || !system)
55
+ var bundledBvm = (pkg) => {
56
+ try {
57
+ const launcher = dirname(Bun.resolveSync("@absolutejs/bvm/package.json", import.meta.dir));
58
+ const binary = join(dirname(Bun.resolveSync(`${pkg}/package.json`, launcher)), "bin", process.platform === "win32" ? "bvm.exe" : "bvm");
59
+ return existsSync(binary) ? binary : null;
60
+ } catch {
104
61
  return null;
105
- const abi = system === "linux" && libc !== "glibc" ? `-${libc}` : "";
106
- const name = `bun-${system}-${cpu}${abi}`;
107
- return isAsset(name) ? name : null;
62
+ }
63
+ };
64
+ var findBvm = () => {
65
+ const pkg = bvmPlatformPackage();
66
+ return (pkg ? bundledBvm(pkg) : null) ?? Bun.which("bvm");
67
+ };
68
+ var defaultRunner = () => {
69
+ const bvm = findBvm();
70
+ return bvm ? bvmRunner(bvm) : null;
71
+ };
72
+ var installedPatchedBun = (run = defaultRunner()) => {
73
+ if (!run)
74
+ return null;
75
+ const result = run(["which", PATCHED_BUN_RELEASE.version]);
76
+ const path = result.stdout.trim();
77
+ return result.status === 0 && path ? path : null;
108
78
  };
109
- var patchedBunPath = (asset, home = homedir()) => join(absoluteHome(home), "bun", PATCHED_BUN_RELEASE.tag, asset, asset.startsWith("bun-windows") ? "bun.exe" : "bun");
110
79
  var runtimeSupportsReactFastRefresh = () => {
111
80
  const options = { loader: "tsx", reactFastRefresh: true };
112
81
  try {
@@ -136,7 +105,7 @@ var patchedBunOfferState = (context) => {
136
105
  return "installed";
137
106
  if (!context.usesReact)
138
107
  return "not-a-react-project";
139
- if (!context.asset)
108
+ if (!context.bvm)
140
109
  return "unsupported-platform";
141
110
  if (compareVersions(context.bunVersion, PATCHED_BUN_RELEASE.bunVersion) > 0)
142
111
  return "runtime-newer";
@@ -155,49 +124,6 @@ var readPatchedBunPreference = (home = homedir()) => {
155
124
  return null;
156
125
  }
157
126
  };
158
- var findEndOfDirectory = (view) => {
159
- for (let offset = view.byteLength - ZIP.endRecordSize;offset >= 0; offset--) {
160
- if (view.getUint32(offset, true) === ZIP.endOfDirectory)
161
- return offset;
162
- }
163
- throw new Error("Not a zip archive.");
164
- };
165
- var inflateEntry = (data, method) => {
166
- if (method === ZIP.methodStored)
167
- return data;
168
- if (method === ZIP.methodDeflate)
169
- return new Uint8Array(inflateRawSync(data));
170
- throw new Error(`Unsupported zip compression method ${method}.`);
171
- };
172
- var readEntryData = (archive, view, entry) => {
173
- if (view.getUint32(entry.localOffset, true) !== ZIP.localHeader)
174
- throw new Error("Corrupt zip entry.");
175
- const dataStart = entry.localOffset + ZIP.localHeaderSize + view.getUint16(entry.localOffset + ZIP.localNameLength, true) + view.getUint16(entry.localOffset + ZIP.localExtraLength, true);
176
- return inflateEntry(archive.subarray(dataStart, dataStart + entry.compressedSize), entry.method);
177
- };
178
- var readZipEntry = (archive, entryName) => {
179
- const view = new DataView(archive.buffer, archive.byteOffset, archive.byteLength);
180
- const end = findEndOfDirectory(view);
181
- const entries = view.getUint16(end + ZIP.endEntryCount, true);
182
- const decoder = new TextDecoder;
183
- let cursor = view.getUint32(end + ZIP.endDirectoryOffset, true);
184
- for (let index = 0;index < entries; index++) {
185
- if (view.getUint32(cursor, true) !== ZIP.directoryEntry)
186
- throw new Error("Corrupt zip directory.");
187
- const nameLength = view.getUint16(cursor + ZIP.entryNameLength, true);
188
- const nameStart = cursor + ZIP.entryHeaderSize;
189
- const name = decoder.decode(archive.subarray(nameStart, nameStart + nameLength));
190
- const entry = {
191
- compressedSize: view.getUint32(cursor + ZIP.entryCompressedSize, true),
192
- localOffset: view.getUint32(cursor + ZIP.entryLocalOffset, true),
193
- method: view.getUint16(cursor + ZIP.entryMethod, true)
194
- };
195
- if (name === entryName)
196
- return readEntryData(archive, view, entry);
197
- cursor += ZIP.entryHeaderSize + nameLength + view.getUint16(cursor + ZIP.entryExtraLength, true) + view.getUint16(cursor + ZIP.entryCommentLength, true);
198
- }
199
- throw new Error(`${entryName} is not in the archive.`);
200
- };
201
127
  var writePatchedBunPreference = (preference, home = homedir()) => {
202
128
  const path = preferencePath(home);
203
129
  if (preference === null) {
@@ -208,7 +134,6 @@ var writePatchedBunPreference = (preference, home = homedir()) => {
208
134
  writeFileSync(path, `${JSON.stringify(preference, null, "\t")}
209
135
  `);
210
136
  };
211
- var sha256 = (bytes) => new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
212
137
  var projectUsesReact = (projectDir) => {
213
138
  const hasReact = (deps) => typeof deps === "object" && deps !== null && Object.hasOwn(deps, "react");
214
139
  try {
@@ -225,33 +150,18 @@ var PATCHED_BUN_EXPLANATION = [
225
150
  `Stock Bun ignores \`reactFastRefresh\` on Bun.Transpiler (${PATCHED_BUN_RELEASE.issue}),`,
226
151
  "so React Fast Refresh cannot keep state across edits. Until Bun ships the fix,",
227
152
  `AbsoluteJS publishes Bun ${PATCHED_BUN_RELEASE.bunVersion} with only that fix: https://github.com/${PATCHED_BUN_RELEASE.repo}`,
228
- "It installs to ~/.absolutejs/bun and only `absolute dev` uses it; your `bun` is unchanged."
153
+ "bvm installs it after checking its signature; only `absolute dev` uses it, your `bun` is unchanged."
229
154
  ];
230
- var installPatchedBun = async (options = {}) => {
231
- const asset = options.asset ?? patchedBunAsset();
232
- if (!asset)
233
- throw new Error(`No patched Bun build for ${process.platform}-${process.arch}.`);
234
- const home = options.home ?? homedir();
235
- const log = options.log ?? console.log;
236
- const url = patchedBunDownloadUrl(asset);
237
- log(`Downloading ${url}`);
238
- const response = await (options.fetchImpl ?? fetch)(url);
239
- if (!response.ok)
240
- throw new Error(`Download failed: ${url} answered ${response.status}.`);
241
- const archive = new Uint8Array(await response.arrayBuffer());
242
- const expected = (options.checksums ?? PATCHED_BUN_RELEASE.sha256)[asset];
243
- const actual = sha256(archive);
244
- if (actual !== expected)
245
- throw new Error(`${asset}.zip does not match its pinned SHA-256 (expected ${expected}, got ${actual}); not installing it.`);
246
- const target = patchedBunPath(asset, home);
247
- const binary = readZipEntry(archive, `${asset}/${target.endsWith(".exe") ? "bun.exe" : "bun"}`);
248
- mkdirSync(dirname(target), { recursive: true });
249
- const staging = `${target}.${process.pid}.tmp`;
250
- writeFileSync(staging, binary);
251
- chmodSync(staging, EXECUTABLE_MODE);
252
- renameSync(staging, target);
253
- log(`Installed patched Bun ${PATCHED_BUN_RELEASE.bunVersion} at ${target}`);
254
- return target;
155
+ var installPatchedBun = (run = defaultRunner()) => {
156
+ if (!run)
157
+ throw new Error(`bvm is not available for ${process.platform}-${process.arch}; see https://github.com/absolutejs/bvm`);
158
+ const install = run(["install", PATCHED_BUN_RELEASE.version], true);
159
+ if (install.status !== 0)
160
+ throw new Error(`bvm could not install Bun ${PATCHED_BUN_RELEASE.version}`);
161
+ const path = installedPatchedBun(run);
162
+ if (!path)
163
+ throw new Error(`bvm installed Bun ${PATCHED_BUN_RELEASE.version} but cannot find it`);
164
+ return path;
255
165
  };
256
166
  var parsePatchedBunChoice = (answer) => {
257
167
  const normalized = answer.trim().toLowerCase();
@@ -271,7 +181,6 @@ var parsePatchedBunChoice = (answer) => {
271
181
  ];
272
182
  return choices.find(({ matches }) => matches)?.choice ?? null;
273
183
  };
274
- var patchedBunDownloadUrl = (asset) => `https://github.com/${PATCHED_BUN_RELEASE.repo}/releases/download/${PATCHED_BUN_RELEASE.tag}/${asset}.zip`;
275
184
  var verifyPatchedBun = (path) => {
276
185
  const probe = spawnSync(path, [
277
186
  "-e",
@@ -302,13 +211,14 @@ ${PATCHED_BUN_EXPLANATION.join(`
302
211
  prompt.close();
303
212
  }
304
213
  };
305
- var installVerified = async (home) => {
306
- const path = await installPatchedBun({ home });
307
- if (!verifyPatchedBun(path)) {
308
- rmSync(path, { force: true });
214
+ var installVerifiedPatchedBun = (home, run, verify = verifyPatchedBun) => {
215
+ const path = installPatchedBun(run);
216
+ if (!verify(path)) {
217
+ run?.(["uninstall", PATCHED_BUN_RELEASE.version]);
309
218
  throw new Error("the installed binary did not pass its check; removed it");
310
219
  }
311
220
  writePatchedBunPreference(null, home);
221
+ rmSync(legacyInstallDirectory(home), { force: true, recursive: true });
312
222
  return path;
313
223
  };
314
224
  var recordDecline = (choice, home) => {
@@ -323,17 +233,30 @@ var recordDecline = (choice, home) => {
323
233
  }, home);
324
234
  console.log("OK, asking again tomorrow. `absolute bun-patch install` installs it any time.");
325
235
  };
236
+ var describeError = (error) => error instanceof Error ? error.message : String(error);
237
+ var migrateLegacyPatchedBun = (home, run, verify = verifyPatchedBun) => {
238
+ if (!run || !existsSync(legacyInstallDirectory(home)))
239
+ return null;
240
+ console.log(`Moving AbsoluteJS's patched Bun to bvm (Bun ${PATCHED_BUN_RELEASE.version}).`);
241
+ try {
242
+ return installVerifiedPatchedBun(home, run, verify);
243
+ } catch (error) {
244
+ console.error(`Could not move the patched Bun to bvm (${describeError(error)}). Run \`absolute bun-patch install\` to retry.`);
245
+ return null;
246
+ }
247
+ };
326
248
  var resolveDevBunExecutable2 = async (projectDir = process.cwd(), home = homedir()) => {
327
249
  if (process.env.ABSOLUTE_PATCHED_BUN === "0")
328
250
  return "bun";
329
- const installed = installedPatchedBun(home);
251
+ const run = defaultRunner();
252
+ const installed = installedPatchedBun(run) ?? migrateLegacyPatchedBun(home, run);
330
253
  if (installed) {
331
- console.log(`Using AbsoluteJS patched Bun ${PATCHED_BUN_RELEASE.bunVersion} for React Fast Refresh (${installed}).`);
254
+ console.log(`Using AbsoluteJS patched Bun ${PATCHED_BUN_RELEASE.version} for React Fast Refresh (${installed}).`);
332
255
  return installed;
333
256
  }
334
257
  const state = patchedBunOfferState({
335
- asset: patchedBunAsset(),
336
258
  bunVersion: Bun.version,
259
+ bvm: run !== null,
337
260
  ci: Boolean(process.env.CI),
338
261
  installed: false,
339
262
  interactive: Boolean(process.stdin.isTTY && process.stdout.isTTY),
@@ -352,9 +275,9 @@ var resolveDevBunExecutable2 = async (projectDir = process.cwd(), home = homedir
352
275
  return "bun";
353
276
  }
354
277
  try {
355
- return await installVerified(home);
278
+ return installVerifiedPatchedBun(home, run);
356
279
  } catch (error) {
357
- console.error(`Could not install the patched Bun (${error instanceof Error ? error.message : String(error)}). Continuing with your bun; React edits will reload the page.`);
280
+ console.error(`Could not install the patched Bun (${describeError(error)}). Continuing with your bun; React edits will reload the page.`);
358
281
  return "bun";
359
282
  }
360
283
  };
@@ -374,28 +297,27 @@ var describeInstalled = (installed) => {
374
297
  };
375
298
  var printStatus = (home) => {
376
299
  const supported = runtimeSupportsReactFastRefresh();
377
- console.log(`Release: ${PATCHED_BUN_RELEASE.tag} (${PATCHED_BUN_RELEASE.issue})`);
378
- console.log(`Platform build: ${patchedBunAsset() ?? "none for this platform"}`);
300
+ const bvm = findBvm();
301
+ console.log(`Release: ${PATCHED_BUN_RELEASE.version} (${PATCHED_BUN_RELEASE.issue})`);
302
+ console.log(`bvm: ${bvm ?? "not available for this platform"}`);
379
303
  console.log(`Your bun: ${Bun.version} (${supported ? "already has the fix" : "stock, no fix"})`);
380
- console.log(`Installed: ${describeInstalled(installedPatchedBun(home))}`);
304
+ console.log(`Installed: ${describeInstalled(installedPatchedBun(bvm ? bvmRunner(bvm) : null))}`);
381
305
  console.log(`Prompt: ${describePreference(readPatchedBunPreference(home))}`);
382
306
  };
383
- var bunPatch2 = async (args, home = homedir()) => {
307
+ var bunPatch2 = (args, home = homedir()) => {
384
308
  const [action = "status"] = args;
385
309
  if (action === "status") {
386
310
  printStatus(home);
387
311
  return;
388
312
  }
389
313
  if (action === "install") {
390
- await installVerified(home);
314
+ installVerifiedPatchedBun(home, defaultRunner());
391
315
  console.log("`absolute dev` will use it from now on.");
392
316
  return;
393
317
  }
394
318
  if (action === "remove") {
395
- rmSync(join(absoluteHome(home), "bun"), {
396
- force: true,
397
- recursive: true
398
- });
319
+ defaultRunner()?.(["uninstall", PATCHED_BUN_RELEASE.version], true);
320
+ rmSync(legacyInstallDirectory(home), { force: true, recursive: true });
399
321
  console.log("Removed the patched Bun. `absolute dev` uses your bun again.");
400
322
  return;
401
323
  }
@@ -1999,7 +1999,7 @@ var createElysiaOpenApiTypeboxPlugin = () => ({
1999
1999
 
2000
2000
  // src/cli/serverBundleExternals.ts
2001
2001
  import { existsSync as existsSync3, readFileSync as readFileSync2 } from "fs";
2002
- import { join as join5 } from "path";
2002
+ import { dirname as dirname6, join as join5 } from "path";
2003
2003
  var FRAMEWORK_EXTERNALS = [
2004
2004
  "react",
2005
2005
  "react/jsx-runtime",
@@ -2038,14 +2038,32 @@ var readManifest = (file) => {
2038
2038
  return;
2039
2039
  }
2040
2040
  };
2041
- var isInstalled = (specifier, projectRoot) => existsSync3(join5(projectRoot, "node_modules", specifier, "package.json"));
2042
- var collectMissingOptionalPeers = (projectRoot) => {
2041
+ var collectOptionalPeers = (projectRoot) => {
2043
2042
  const app = readManifest(join5(projectRoot, "package.json"));
2044
- const optionalPeers = Object.keys(app?.dependencies ?? {}).flatMap((dependency) => Object.entries(readManifest(join5(projectRoot, "node_modules", dependency, "package.json"))?.peerDependenciesMeta ?? {}).filter(([, meta]) => meta.optional === true).map(([peer]) => peer));
2045
- const missing = new Set(optionalPeers.filter((peer) => !isInstalled(peer, projectRoot)));
2046
- return [...missing].flatMap((peer) => [peer, `${peer}/*`]);
2043
+ return [
2044
+ ...new Set(Object.keys(app?.dependencies ?? {}).flatMap((dependency) => Object.entries(readManifest(join5(projectRoot, "node_modules", dependency, "package.json"))?.peerDependenciesMeta ?? {}).filter(([, meta]) => meta.optional === true).map(([peer]) => peer)))
2045
+ ];
2047
2046
  };
2048
- var resolveServerBundleExternals = (buildConfig, projectRoot = process.cwd()) => [
2047
+ var escapeRegExp2 = (text) => text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
2048
+ var createOptionalPeerPlugin = (projectRoot = process.cwd()) => ({
2049
+ name: "absolute-optional-peers",
2050
+ setup(build) {
2051
+ const peers = collectOptionalPeers(projectRoot);
2052
+ if (peers.length === 0)
2053
+ return;
2054
+ const filter = new RegExp(`^(?:${peers.map(escapeRegExp2).join("|")})(?:/.*)?$`);
2055
+ build.onResolve({ filter }, (args) => {
2056
+ const from = args.importer ? dirname6(args.importer) : projectRoot;
2057
+ try {
2058
+ Bun.resolveSync(args.path, from);
2059
+ return;
2060
+ } catch {
2061
+ return { external: true, path: args.path };
2062
+ }
2063
+ });
2064
+ }
2065
+ });
2066
+ var resolveServerBundleExternals = (buildConfig) => [
2049
2067
  ...FRAMEWORK_EXTERNALS.filter((specifier) => {
2050
2068
  if (buildConfig.reactDirectory && (specifier === "react" || specifier.startsWith("react/") || specifier.startsWith("react-dom")))
2051
2069
  return false;
@@ -2055,8 +2073,7 @@ var resolveServerBundleExternals = (buildConfig, projectRoot = process.cwd()) =>
2055
2073
  return false;
2056
2074
  return true;
2057
2075
  }),
2058
- ...collectUserServerExternals(buildConfig),
2059
- ...collectMissingOptionalPeers(projectRoot)
2076
+ ...collectUserServerExternals(buildConfig)
2060
2077
  ];
2061
2078
 
2062
- export { createIslandRegistryDefinitionPlugin, createBunStringRawUnicodePlugin, resolveAbsoluteMobileRoute, ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION, ABSOLUTE_MOBILE_CLIENT_MANIFEST_FORMAT, finalizeAbsoluteMobileCompatibilityBuild, createAbsoluteMobileRouteMetadataPlugin, createElysiaOpenApiTypeboxPlugin, resolveServerBundleExternals };
2079
+ export { createIslandRegistryDefinitionPlugin, createBunStringRawUnicodePlugin, resolveAbsoluteMobileRoute, ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION, ABSOLUTE_MOBILE_CLIENT_MANIFEST_FORMAT, finalizeAbsoluteMobileCompatibilityBuild, createAbsoluteMobileRouteMetadataPlugin, createElysiaOpenApiTypeboxPlugin, createOptionalPeerPlugin, resolveServerBundleExternals };
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-6f0gry3y.js");
57
+ const { dev } = await import("./dev-j3dhb396.js");
58
58
  await dev(serverEntry, configPath, {
59
59
  androidDevice,
60
60
  eager: args.includes("--eager"),
@@ -62,15 +62,15 @@ if (command === "dev") {
62
62
  mobile: !args.includes("--no-mobile")
63
63
  });
64
64
  } else if (command === "bun-patch") {
65
- const { bunPatch } = await import("./patchedBun-m7vj5sks.js");
66
- await bunPatch(args);
65
+ const { bunPatch } = await import("./patchedBun-541bbnee.js");
66
+ bunPatch(args);
67
67
  } else if (command === "start") {
68
68
  sendTelemetryEvent("cli:command", { command });
69
69
  const outdir = parseNamedArg("--outdir");
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-36w63t6h.js");
73
+ const { start } = await import("./start-3z3gtgm0.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-36w63t6h.js");
83
+ const { start } = await import("./start-3z3gtgm0.js");
84
84
  await start(serverEntry, outdir, configPath, { prepareOnly: true });
85
85
  } else if (command === "build") {
86
86
  sendTelemetryEvent("cli:command", { command });
@@ -201,13 +201,13 @@ if (command === "dev") {
201
201
  const configPath = parseNamedArg("--config");
202
202
  const positionalArgs = stripNamedArgs("--outdir", "--outfile", "--config");
203
203
  const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
204
- const { compile } = await import("./compile-qygwqezx.js");
204
+ const { compile } = await import("./compile-nf4qsqyd.js");
205
205
  await compile(serverEntry, outdir, outfile, configPath);
206
206
  } else if (command === "mobile") {
207
207
  sendTelemetryEvent("cli:command", {
208
208
  command: `mobile:${workspaceCommand ?? "unknown"}`
209
209
  });
210
- const { runMobile } = await import("./mobile-w295dx0t.js");
210
+ const { runMobile } = await import("./mobile-m0cdh8cf.js");
211
211
  try {
212
212
  await runMobile(args);
213
213
  } catch (error) {
@@ -58,7 +58,7 @@ import {
58
58
  resolveAbsoluteMobileRoute,
59
59
  ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION,
60
60
  ABSOLUTE_MOBILE_CLIENT_MANIFEST_FORMAT
61
- } from "./index-r6k4xmdb.js";
61
+ } from "./index-hfvxsgf4.js";
62
62
  import {
63
63
  buildAbsoluteExpoAndroidWslBundle2
64
64
  } from "./index-jcjwsdqt.js";
@@ -75,7 +75,7 @@ import {
75
75
  import"./index-e6ysp900.js";
76
76
  import {
77
77
  start2
78
- } from "./index-9ehbfmeq.js";
78
+ } from "./index-c3tqbpkq.js";
79
79
  import {
80
80
  captureAbsoluteRemoteMacCommand2,
81
81
  getAbsoluteRemoteMacProfile2,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  resolveDevBunExecutable2,
4
4
  bunPatch2
5
- } from "./index-r915cvqp.js";
5
+ } from "./index-cc8eay5y.js";
6
6
  export {
7
7
  bunPatch2 as bunPatch,
8
8
  resolveDevBunExecutable2 as resolveDevBunExecutable
@@ -1,8 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  start2
4
- } from "./index-9ehbfmeq.js";
5
- import"./index-r6k4xmdb.js";
4
+ } from "./index-c3tqbpkq.js";
5
+ import"./index-hfvxsgf4.js";
6
6
  import"./index-e6ysp900.js";
7
7
  import"./index-71gchbzt.js";
8
8
  import"./index-h7qhz02e.js";
@@ -3810,7 +3810,7 @@ var require_source_map_support = __commonJS(function(exports, module) {
3810
3810
 
3811
3811
  // node_modules/typescript/lib/typescript.js
3812
3812
  var require_typescript = __commonJS(function(exports, module) {
3813
- var __dirname = "/tmp/claude-1000/-home-alexkahn-abs-PAAS/9b0057a2-5737-48f9-9dbe-dcb83ea02b04/scratchpad/ajs-upgrade/node_modules/typescript/lib", __filename = "/tmp/claude-1000/-home-alexkahn-abs-PAAS/9b0057a2-5737-48f9-9dbe-dcb83ea02b04/scratchpad/ajs-upgrade/node_modules/typescript/lib/typescript.js";
3813
+ var __dirname = "/tmp/claude-1000/-home-alexkahn-abs-PAAS/9b0057a2-5737-48f9-9dbe-dcb83ea02b04/scratchpad/abs-release/node_modules/typescript/lib", __filename = "/tmp/claude-1000/-home-alexkahn-abs-PAAS/9b0057a2-5737-48f9-9dbe-dcb83ea02b04/scratchpad/abs-release/node_modules/typescript/lib/typescript.js";
3814
3814
  /*! *****************************************************************************
3815
3815
  Copyright (c) Microsoft Corporation. All rights reserved.
3816
3816
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
package/dist/index.js CHANGED
@@ -24667,7 +24667,7 @@ var init_compileAngular = __esm(() => {
24667
24667
 
24668
24668
  // node_modules/content-tag/pkg/node/content_tag.cjs
24669
24669
  var require_content_tag = __commonJS(function(exports, module) {
24670
- var __dirname = "/tmp/claude-1000/-home-alexkahn-abs-PAAS/9b0057a2-5737-48f9-9dbe-dcb83ea02b04/scratchpad/ajs-upgrade/node_modules/content-tag/pkg/node";
24670
+ var __dirname = "/tmp/claude-1000/-home-alexkahn-abs-PAAS/9b0057a2-5737-48f9-9dbe-dcb83ea02b04/scratchpad/abs-release/node_modules/content-tag/pkg/node";
24671
24671
  var imports = {};
24672
24672
  imports["__wbindgen_placeholder__"] = exports;
24673
24673
  var wasm;
@@ -43800,5 +43800,5 @@ export {
43800
43800
  wrapPageHandlerWithStreamingSlots
43801
43801
  };
43802
43802
 
43803
- //# debugId=D127E0789CBB573164756E2164756E21
43803
+ //# debugId=6F1E1785E74A52C164756E2164756E21
43804
43804
  //# sourceMappingURL=index.js.map