@absolutejs/absolute 0.19.0-beta.53 → 0.19.0-beta.55

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.
@@ -200,7 +200,11 @@
200
200
  "Bash(./scripts/use-patched-bun.sh bun:*)",
201
201
  "Bash(find native:*)",
202
202
  "Bash(PLAYWRIGHT_BROWSERS_PATH=/tmp/pw-browsers bun /tmp/docs-hmr-test.mjs 2>&1)",
203
- "Bash(PLAYWRIGHT_BROWSERS_PATH=/tmp/pw-browsers bun /tmp/docs-hmr-test2.mjs 2>&1)"
203
+ "Bash(PLAYWRIGHT_BROWSERS_PATH=/tmp/pw-browsers bun /tmp/docs-hmr-test2.mjs 2>&1)",
204
+ "Bash(npm version:*)",
205
+ "Bash(npm publish:*)",
206
+ "Bash(kill 852179)",
207
+ "Bash(sed -i 's/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.53\"\"\"\"/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.54\"\"\"\"/' package.json)"
204
208
  ]
205
209
  }
206
210
  }
package/dist/build.js CHANGED
@@ -202353,11 +202353,12 @@ __export(exports_moduleServer, {
202353
202353
  });
202354
202354
  import { existsSync as existsSync13, readFileSync as readFileSync9, statSync } from "fs";
202355
202355
  import { basename as basename7, dirname as dirname7, extname as extname3, resolve as resolve17, relative as relative7 } from "path";
202356
- var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, TRANSPILABLE, ALL_EXPORTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
202356
+ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
202357
+ const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
202357
202358
  const allExports = [];
202358
202359
  let match;
202359
202360
  ALL_EXPORTS_RE.lastIndex = 0;
202360
- while ((match = ALL_EXPORTS_RE.exec(originalSource)) !== null) {
202361
+ while ((match = ALL_EXPORTS_RE.exec(codeOnly)) !== null) {
202361
202362
  if (match[1])
202362
202363
  allExports.push(match[1]);
202363
202364
  }
@@ -202504,7 +202505,7 @@ ${stubs}
202504
202505
  ` + code;
202505
202506
  }, reactTranspiler, transformReactFile = (filePath, projectRoot, rewriter) => {
202506
202507
  const raw = readFileSync9(filePath, "utf-8");
202507
- const valueExports = tsTranspiler2.scan(raw).exports;
202508
+ const valueExports = tsxTranspiler.scan(raw).exports;
202508
202509
  let transpiled = reactTranspiler.transformSync(raw);
202509
202510
  transpiled = preserveTypeExports(raw, transpiled, valueExports);
202510
202511
  transpiled = addJsxImport(transpiled);
@@ -202521,7 +202522,8 @@ ${stubs}
202521
202522
  const raw = readFileSync9(filePath, "utf-8");
202522
202523
  const ext = extname3(filePath);
202523
202524
  const isTS = ext === ".ts" || ext === ".tsx";
202524
- const transpiler3 = isTS ? tsTranspiler2 : jsTranspiler2;
202525
+ const isTSX = ext === ".tsx" || ext === ".jsx";
202526
+ const transpiler3 = isTSX ? tsxTranspiler : isTS ? tsTranspiler2 : jsTranspiler2;
202525
202527
  const valueExports = isTS ? transpiler3.scan(raw).exports : [];
202526
202528
  let transpiled = transpiler3.transformSync(raw);
202527
202529
  if (isTS) {
@@ -202881,11 +202883,16 @@ var init_moduleServer = __esm(() => {
202881
202883
  trimUnusedImports: true
202882
202884
  });
202883
202885
  tsTranspiler2 = new Bun.Transpiler({
202886
+ loader: "ts",
202887
+ trimUnusedImports: true
202888
+ });
202889
+ tsxTranspiler = new Bun.Transpiler({
202884
202890
  loader: "tsx",
202885
202891
  trimUnusedImports: true
202886
202892
  });
202887
202893
  TRANSPILABLE = new Set([".ts", ".tsx", ".js", ".jsx", ".mjs"]);
202888
202894
  ALL_EXPORTS_RE = /export\s+(?:type|interface|const|let|var|function|class|enum|abstract\s+class)\s+(\w+)/g;
202895
+ STRING_CONTENTS_RE = /`(?:[^`\\]|\\.)*`|'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/gs;
202889
202896
  REACT_EXTENSIONS = new Set([".tsx", ".jsx"]);
202890
202897
  mtimeCache = new Map;
202891
202898
  HOOK_NAMES = new Set([
@@ -203172,19 +203179,19 @@ var parseErrorLocationFromMessage = (msg) => {
203172
203179
  const DEBOUNCE_MS = config.options?.hmr?.debounceMs ?? DEFAULT_DEBOUNCE_MS;
203173
203180
  state.rebuildTimeout = setTimeout(async () => {
203174
203181
  for (let i = 0;i < 5; i++) {
203175
- let anyChanged = false;
203182
+ let stable = true;
203176
203183
  for (const files of state.fileChangeQueue.values()) {
203177
203184
  for (const file3 of files) {
203178
- const fresh = computeFileHash(file3);
203179
- const stored = state.fileHashes.get(file3.replace(/\\/g, "/"));
203180
- if (stored === undefined || fresh !== stored) {
203181
- anyChanged = true;
203185
+ const hash1 = computeFileHash(file3);
203186
+ await Bun.sleep(10);
203187
+ const hash2 = computeFileHash(file3);
203188
+ if (hash1 !== hash2) {
203189
+ stable = false;
203182
203190
  }
203183
203191
  }
203184
203192
  }
203185
- if (anyChanged)
203193
+ if (stable)
203186
203194
  break;
203187
- await Bun.sleep(10);
203188
203195
  }
203189
203196
  const filesToProcess = buildFilesToProcess(state);
203190
203197
  state.fileChangeQueue.clear();
@@ -204820,5 +204827,5 @@ export {
204820
204827
  build
204821
204828
  };
204822
204829
 
204823
- //# debugId=2E953D5D3F1D08AA64756E2164756E21
204830
+ //# debugId=83A1C4631B880B5E64756E2164756E21
204824
204831
  //# sourceMappingURL=build.js.map