@timber-js/app 0.2.0-alpha.117 → 0.2.0-alpha.118

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.
@@ -42,15 +42,6 @@ export declare const RESOLVED_LOCAL = "\0@timber/fonts/local";
42
42
  export declare const VIRTUAL_FONT_CSS_PREFIX = "virtual:timber-font-css/";
43
43
  export declare const VIRTUAL_FONT_CSS_SUFFIX = ".css";
44
44
  export declare const RESOLVED_FONT_CSS_PREFIX: string;
45
- /**
46
- * In-memory map from the short hash used in virtual module ids back to
47
- * the absolute importer path. Populated by `virtualFontCssIdFor()` when
48
- * the transform hook registers an importer and read by the plugin's
49
- * `load` hook when Vite asks for the CSS content.
50
- *
51
- * Scoped to a single `FontPipeline` instance to avoid cross-plugin-
52
- * instance collisions during multi-build pipelines.
53
- */
54
45
  export declare class VirtualFontCssIdMap {
55
46
  private readonly map;
56
47
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"virtual-modules.d.ts","sourceRoot":"","sources":["../../src/fonts/virtual-modules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAKpE,eAAO,MAAM,cAAc,yBAAyB,CAAC;AACrD,eAAO,MAAM,aAAa,wBAAwB,CAAC;AACnD,eAAO,MAAM,eAAe,2BAA2B,CAAC;AACxD,eAAO,MAAM,cAAc,0BAA0B,CAAC;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,6BAA6B,CAAC;AAClE,eAAO,MAAM,uBAAuB,SAAS,CAAC;AAC9C,eAAO,MAAM,wBAAwB,QAAiC,CAAC;AAEvE;;;;;;;;GAQG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAA6B;IAEjD;;;;OAIG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,MAA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;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAM/B,0EAA0E;IAC1E,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAW3C,+DAA+D;IAC/D,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAK5B,oDAAoD;IACpD,KAAK,IAAI,IAAI;CAGd;AAUD;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,GAAG,MAAM,CAoClF;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CAanD;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,EAAE,WAAW,CAAC,EAAE,kBAAkB,EAAE,GAAG,MAAM,CAwB/F;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,EACpC,kBAAkB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,CAAC,GACrD,MAAM,CAOR"}
package/dist/index.js CHANGED
@@ -3889,6 +3889,11 @@ var VIRTUAL_FONT_CSS_SUFFIX = ".css";
3889
3889
  * Scoped to a single `FontPipeline` instance to avoid cross-plugin-
3890
3890
  * instance collisions during multi-build pipelines.
3891
3891
  */
3892
+ function stripIdDecorations(id) {
3893
+ const bare = id.startsWith("\0") ? id.slice(1) : id;
3894
+ const qIdx = bare.indexOf("?");
3895
+ return qIdx === -1 ? bare : bare.slice(0, qIdx);
3896
+ }
3892
3897
  var VirtualFontCssIdMap = class {
3893
3898
  map = /* @__PURE__ */ new Map();
3894
3899
  /**
@@ -3903,7 +3908,7 @@ var VirtualFontCssIdMap = class {
3903
3908
  }
3904
3909
  /** Decode the importer from a resolved (or unresolved) virtual css id. */
3905
3910
  importerFor(id) {
3906
- const body = id.startsWith("\0") ? id.slice(1) : id;
3911
+ const body = stripIdDecorations(id);
3907
3912
  if (!body.startsWith("virtual:timber-font-css/")) return void 0;
3908
3913
  if (!body.endsWith(".css")) return void 0;
3909
3914
  const hash = body.slice(24, body.length - 4);
@@ -3911,7 +3916,7 @@ var VirtualFontCssIdMap = class {
3911
3916
  }
3912
3917
  /** True if `id` is any form of the virtual font css module. */
3913
3918
  matches(id) {
3914
- const body = id.startsWith("\0") ? id.slice(1) : id;
3919
+ const body = stripIdDecorations(id);
3915
3920
  return body.startsWith("virtual:timber-font-css/") && body.endsWith(".css");
3916
3921
  }
3917
3922
  /** Drop every registered mapping. Used by tests. */
@@ -5496,6 +5501,8 @@ function timberFonts(ctx) {
5496
5501
  enforce: "pre",
5497
5502
  resolveId(id) {
5498
5503
  let cleanId = id.startsWith("\0") ? id.slice(1) : id;
5504
+ const qIdx = cleanId.indexOf("?");
5505
+ if (qIdx !== -1) cleanId = cleanId.slice(0, qIdx);
5499
5506
  if (cleanId.startsWith(ctx.root)) {
5500
5507
  const stripped = cleanId.slice(ctx.root.length);
5501
5508
  if (stripped.startsWith("/") || stripped.startsWith("\\")) cleanId = stripped.slice(1);