@farm.js/core 0.1.0-beta.10 → 0.1.0-beta.13

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.
Files changed (79) hide show
  1. package/dist/{chunk-3QDB3IA6.mjs → chunk-3WIRO3N7.mjs} +2 -2
  2. package/dist/chunk-3WIRO3N7.mjs.map +1 -0
  3. package/dist/chunk-53MVSX3R.mjs +168 -0
  4. package/dist/chunk-53MVSX3R.mjs.map +1 -0
  5. package/dist/{chunk-AW6I64AP.mjs → chunk-6ZXIQSXE.mjs} +16 -1
  6. package/dist/chunk-6ZXIQSXE.mjs.map +1 -0
  7. package/dist/chunk-7ZVN3YZI.mjs +333 -0
  8. package/dist/chunk-7ZVN3YZI.mjs.map +1 -0
  9. package/dist/{chunk-7N62DNSO.mjs → chunk-H3TE3LOV.mjs} +2 -2
  10. package/dist/{chunk-QTZZ2ISQ.mjs → chunk-KLA67WKG.mjs} +1 -1
  11. package/dist/chunk-KLA67WKG.mjs.map +1 -0
  12. package/dist/{chunk-K5ZTUF22.mjs → chunk-L2PE36GQ.mjs} +7 -3
  13. package/dist/chunk-L2PE36GQ.mjs.map +1 -0
  14. package/dist/{chunk-4LND3PXF.mjs → chunk-OPHK6OJN.mjs} +513 -48
  15. package/dist/chunk-OPHK6OJN.mjs.map +1 -0
  16. package/dist/chunk-USLFXFFH.mjs +46 -0
  17. package/dist/chunk-USLFXFFH.mjs.map +1 -0
  18. package/dist/{chunk-DTOWEQRV.mjs → chunk-VSDZEB5M.mjs} +368 -103
  19. package/dist/chunk-VSDZEB5M.mjs.map +1 -0
  20. package/dist/{chunk-E2AI2CW7.mjs → chunk-Z3YG4OZT.mjs} +727 -148
  21. package/dist/chunk-Z3YG4OZT.mjs.map +1 -0
  22. package/dist/client.cjs.map +1 -1
  23. package/dist/client.mjs +1 -1
  24. package/dist/{devtools-A22KUJZT.mjs → devtools-GAZ7F3KL.mjs} +4 -3
  25. package/dist/{devtools-A22KUJZT.mjs.map → devtools-GAZ7F3KL.mjs.map} +1 -1
  26. package/dist/docs.cjs +622 -124
  27. package/dist/docs.cjs.map +1 -1
  28. package/dist/docs.mjs +5 -3
  29. package/dist/font.cjs +19 -2
  30. package/dist/font.cjs.map +1 -1
  31. package/dist/font.mjs +7 -3
  32. package/dist/index.cjs +2208 -681
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.mjs +27 -19
  35. package/dist/index.mjs.map +1 -1
  36. package/dist/internal/build-runtime.cjs +2035 -517
  37. package/dist/internal/build-runtime.cjs.map +1 -1
  38. package/dist/internal/build-runtime.mjs +13 -10
  39. package/dist/internal/client-runtime.cjs +169 -2
  40. package/dist/internal/client-runtime.cjs.map +1 -1
  41. package/dist/internal/client-runtime.mjs +170 -2
  42. package/dist/internal/client-runtime.mjs.map +1 -1
  43. package/dist/internal/config-runtime.cjs +22 -0
  44. package/dist/internal/config-runtime.cjs.map +1 -1
  45. package/dist/internal/config-runtime.mjs +3 -2
  46. package/dist/internal/metadata-image-runtime.cjs +199 -0
  47. package/dist/internal/metadata-image-runtime.cjs.map +1 -0
  48. package/dist/internal/metadata-image-runtime.mjs +8 -0
  49. package/dist/internal/metadata-image-runtime.mjs.map +1 -0
  50. package/dist/internal/production-runtime.cjs +310 -0
  51. package/dist/internal/production-runtime.cjs.map +1 -1
  52. package/dist/internal/production-runtime.mjs +10 -0
  53. package/dist/internal/production-runtime.mjs.map +1 -1
  54. package/dist/navigation.cjs.map +1 -1
  55. package/dist/navigation.mjs +2 -2
  56. package/dist/plugin.cjs +1523 -340
  57. package/dist/plugin.cjs.map +1 -1
  58. package/dist/plugin.mjs +9 -5
  59. package/dist/server.cjs +1636 -411
  60. package/dist/server.cjs.map +1 -1
  61. package/dist/server.mjs +17 -19
  62. package/dist/server.mjs.map +1 -1
  63. package/dist/version.cjs +1 -1
  64. package/dist/version.cjs.map +1 -1
  65. package/dist/version.mjs +1 -1
  66. package/dist/vite.cjs +1577 -350
  67. package/dist/vite.cjs.map +1 -1
  68. package/dist/vite.mjs +9 -5
  69. package/package.json +10 -1
  70. package/dist/chunk-3QDB3IA6.mjs.map +0 -1
  71. package/dist/chunk-4LND3PXF.mjs.map +0 -1
  72. package/dist/chunk-AW6I64AP.mjs.map +0 -1
  73. package/dist/chunk-DTOWEQRV.mjs.map +0 -1
  74. package/dist/chunk-E2AI2CW7.mjs.map +0 -1
  75. package/dist/chunk-K5ZTUF22.mjs.map +0 -1
  76. package/dist/chunk-QM746KUO.mjs +0 -56
  77. package/dist/chunk-QM746KUO.mjs.map +0 -1
  78. package/dist/chunk-QTZZ2ISQ.mjs.map +0 -1
  79. /package/dist/{chunk-7N62DNSO.mjs.map → chunk-H3TE3LOV.mjs.map} +0 -0
package/dist/docs.mjs CHANGED
@@ -9,15 +9,17 @@ import {
9
9
  isFarmDocsRequest,
10
10
  loadFarmDocsPage,
11
11
  resolveFarmDocsContentDir
12
- } from "./chunk-4LND3PXF.mjs";
12
+ } from "./chunk-OPHK6OJN.mjs";
13
13
  import "./chunk-V7RBCSDJ.mjs";
14
- import "./chunk-K5ZTUF22.mjs";
14
+ import "./chunk-L2PE36GQ.mjs";
15
15
  import "./chunk-UVCIEUJC.mjs";
16
16
  import "./chunk-RQ633A5I.mjs";
17
+ import "./chunk-USLFXFFH.mjs";
17
18
  import "./chunk-I4CUBGVF.mjs";
19
+ import "./chunk-7MABZJIM.mjs";
18
20
  import "./chunk-YW7OBE6Q.mjs";
19
21
  import "./chunk-74YTBPTY.mjs";
20
- import "./chunk-7MABZJIM.mjs";
22
+ import "./chunk-7ZVN3YZI.mjs";
21
23
  import "./chunk-GY2STC2S.mjs";
22
24
  import "./chunk-UB5UOSHB.mjs";
23
25
  import "./chunk-ZVWA4ZQ3.mjs";
package/dist/font.cjs CHANGED
@@ -21,10 +21,25 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  // src/font.ts
22
22
  var font_exports = {};
23
23
  __export(font_exports, {
24
+ defineLayoutFonts: () => defineLayoutFonts,
24
25
  localFont: () => localFont,
25
- remoteFont: () => remoteFont
26
+ remoteFont: () => remoteFont,
27
+ resolveFarmLayoutFonts: () => resolveFarmLayoutFonts
26
28
  });
27
29
  module.exports = __toCommonJS(font_exports);
30
+ function defineLayoutFonts(fonts) {
31
+ return fonts;
32
+ }
33
+ __name(defineLayoutFonts, "defineLayoutFonts");
34
+ function resolveFarmLayoutFonts(layouts) {
35
+ let resolved;
36
+ for (const layout of layouts) {
37
+ if (!layout.fonts) continue;
38
+ resolved = { ...resolved, ...layout.fonts };
39
+ }
40
+ return resolved;
41
+ }
42
+ __name(resolveFarmLayoutFonts, "resolveFarmLayoutFonts");
28
43
  function fontCompilerError(loader) {
29
44
  throw new Error(
30
45
  `[Farm fonts] ${loader}() must be called at module scope with static options and compiled by the Farm Vite plugin.`
@@ -41,7 +56,9 @@ function remoteFont(_options) {
41
56
  __name(remoteFont, "remoteFont");
42
57
  // Annotate the CommonJS export names for ESM import in node:
43
58
  0 && (module.exports = {
59
+ defineLayoutFonts,
44
60
  localFont,
45
- remoteFont
61
+ remoteFont,
62
+ resolveFarmLayoutFonts
46
63
  });
47
64
  //# sourceMappingURL=font.cjs.map
package/dist/font.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/font.ts"],"sourcesContent":["export type FarmFontDisplay = \"auto\" | \"block\" | \"swap\" | \"fallback\" | \"optional\";\n\nexport interface FarmFontSource {\n /** Local file path or remote URL, depending on the loader. */\n path: string;\n /** A fixed weight (`400`) or variable range (`100 900`). */\n weight?: number | string;\n /** Font style for this source. */\n style?: string;\n /** Optional CSS unicode-range descriptor. */\n unicodeRange?: string;\n}\n\nexport interface FarmFontOptions {\n /** CSS font-family name. */\n family: string;\n /** A fixed weight (`400`) or variable range (`100 900`). */\n weight?: number | string;\n /** Font style. @default \"normal\" */\n style?: string;\n /** Browser loading behavior. @default \"swap\" */\n display?: FarmFontDisplay;\n /** CSS custom property populated by `variable`, for example `--font-sans`. */\n variable?: `--${string}`;\n /** Fallback family names appended to the generated stack. */\n fallback?: string[];\n /** Emit font preload hints. @default true */\n preload?: boolean;\n}\n\nexport interface LocalFontOptions extends FarmFontOptions {\n /**\n * A file relative to this module, a package font specifier, or explicit\n * sources for a multi-weight family.\n */\n src: string | FarmFontSource[];\n}\n\nexport interface RemoteFontSource extends FarmFontSource {\n /** Optional integrity value for this source. Overrides the family-level value. */\n integrity?: string;\n}\n\nexport interface RemoteFontOptions extends FarmFontOptions {\n /** HTTPS font URL, or explicit remote sources for a multi-weight family. */\n src: string | RemoteFontSource[];\n /** Download and fingerprint the font during the build, or retain its URL. */\n strategy?: \"self-host\" | \"external\";\n /** Optional Subresource Integrity value checked while self-hosting. */\n integrity?: string;\n}\n\nexport interface FarmFont {\n /** Generated class that applies the font family and fallback stack. */\n className: string;\n /** Generated class that defines the configured CSS custom property. */\n variable: string;\n /** Inline-style equivalent of the generated family. */\n style: Readonly<{\n fontFamily: string;\n fontStyle?: string;\n fontWeight?: number | string;\n }>;\n}\n\nfunction fontCompilerError(loader: string): never {\n throw new Error(\n `[Farm fonts] ${loader}() must be called at module scope with static options and compiled by the Farm Vite plugin.`,\n );\n}\n\n/**\n * Compile local font files into hashed application assets and generated CSS.\n * The call is removed at build time and adds no font-loader runtime code.\n */\nexport function localFont(_options: LocalFontOptions): FarmFont {\n return fontCompilerError(\"localFont\");\n}\n\n/**\n * Compile a remote font into a self-hosted application asset by default.\n * Use `strategy: \"external\"` only when the browser should retain the remote URL.\n */\nexport function remoteFont(_options: RemoteFontOptions): FarmFont {\n return fontCompilerError(\"remoteFont\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiEA,SAAS,kBAAkB,QAAuB;AAChD,QAAM,IAAI;AAAA,IACR,gBAAgB,MAAM;AAAA,EACxB;AACF;AAJS;AAUF,SAAS,UAAU,UAAsC;AAC9D,SAAO,kBAAkB,WAAW;AACtC;AAFgB;AAQT,SAAS,WAAW,UAAuC;AAChE,SAAO,kBAAkB,YAAY;AACvC;AAFgB;","names":[]}
1
+ {"version":3,"sources":["../src/font.ts"],"sourcesContent":["export type FarmFontDisplay = \"auto\" | \"block\" | \"swap\" | \"fallback\" | \"optional\";\n\nexport interface FarmFontSource {\n /** Local file path or remote URL, depending on the loader. */\n path: string;\n /** A fixed weight (`400`) or variable range (`100 900`). */\n weight?: number | string;\n /** Font style for this source. */\n style?: string;\n /** Optional CSS unicode-range descriptor. */\n unicodeRange?: string;\n}\n\nexport interface FarmFontOptions {\n /** CSS font-family name. */\n family: string;\n /** A fixed weight (`400`) or variable range (`100 900`). */\n weight?: number | string;\n /** Font style. @default \"normal\" */\n style?: string;\n /** Browser loading behavior. @default \"swap\" */\n display?: FarmFontDisplay;\n /** CSS custom property populated by `variable`, for example `--font-sans`. */\n variable?: `--${string}`;\n /** Fallback family names appended to the generated stack. */\n fallback?: string[];\n /** Emit font preload hints. @default true */\n preload?: boolean;\n}\n\nexport interface LocalFontOptions extends FarmFontOptions {\n /**\n * A file relative to this module, a package font specifier, or explicit\n * sources for a multi-weight family.\n */\n src: string | FarmFontSource[];\n}\n\nexport interface RemoteFontSource extends FarmFontSource {\n /** Optional integrity value for this source. Overrides the family-level value. */\n integrity?: string;\n}\n\nexport interface RemoteFontOptions extends FarmFontOptions {\n /** HTTPS font URL, or explicit remote sources for a multi-weight family. */\n src: string | RemoteFontSource[];\n /** Download and fingerprint the font during the build, or retain its URL. */\n strategy?: \"self-host\" | \"external\";\n /** Optional Subresource Integrity value checked while self-hosting. */\n integrity?: string;\n}\n\nexport interface FarmFont {\n /** Generated class that applies the font family and fallback stack. */\n className: string;\n /** Generated class that defines the configured CSS custom property. */\n variable: string;\n /** Inline-style equivalent of the generated family. */\n style: Readonly<{\n fontFamily: string;\n fontStyle?: string;\n fontWeight?: number | string;\n }>;\n /** Compiled resources that should be preloaded when this font is selected. */\n preloads: readonly Readonly<{\n href: string;\n type: string;\n }>[];\n}\n\n/** Semantic font roles inherited by framework-owned surfaces such as Farm Docs. */\nexport interface FarmLayoutFonts {\n /** Default text and prose font. */\n body?: FarmFont;\n /** Code, keyboard input, and other technical UI font. */\n code?: FarmFont;\n}\n\nexport interface FarmLayoutFontModule {\n fonts?: FarmLayoutFonts;\n}\n\n/**\n * Define the semantic fonts exported by a layout.\n *\n * Layouts are resolved from the root toward the requested route. A nearer\n * layout overrides only the roles it defines, so it can replace `body` while\n * continuing to inherit `code` from a parent layout.\n */\nexport function defineLayoutFonts<const T extends FarmLayoutFonts>(fonts: T): T {\n return fonts;\n}\n\n/** Resolve semantic font roles from root layout to nearest layout. */\nexport function resolveFarmLayoutFonts(\n layouts: readonly FarmLayoutFontModule[],\n): FarmLayoutFonts | undefined {\n let resolved: FarmLayoutFonts | undefined;\n\n for (const layout of layouts) {\n if (!layout.fonts) continue;\n resolved = { ...resolved, ...layout.fonts };\n }\n\n return resolved;\n}\n\nfunction fontCompilerError(loader: string): never {\n throw new Error(\n `[Farm fonts] ${loader}() must be called at module scope with static options and compiled by the Farm Vite plugin.`,\n );\n}\n\n/**\n * Compile local font files into hashed application assets and generated CSS.\n * The call is removed at build time and adds no font-loader runtime code.\n */\nexport function localFont(_options: LocalFontOptions): FarmFont {\n return fontCompilerError(\"localFont\");\n}\n\n/**\n * Compile a remote font into a self-hosted application asset by default.\n * Use `strategy: \"external\"` only when the browser should retain the remote URL.\n */\nexport function remoteFont(_options: RemoteFontOptions): FarmFont {\n return fontCompilerError(\"remoteFont\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyFO,SAAS,kBAAmD,OAAa;AAC9E,SAAO;AACT;AAFgB;AAKT,SAAS,uBACd,SAC6B;AAC7B,MAAI;AAEJ,aAAW,UAAU,SAAS;AAC5B,QAAI,CAAC,OAAO,MAAO;AACnB,eAAW,EAAE,GAAG,UAAU,GAAG,OAAO,MAAM;AAAA,EAC5C;AAEA,SAAO;AACT;AAXgB;AAahB,SAAS,kBAAkB,QAAuB;AAChD,QAAM,IAAI;AAAA,IACR,gBAAgB,MAAM;AAAA,EACxB;AACF;AAJS;AAUF,SAAS,UAAU,UAAsC;AAC9D,SAAO,kBAAkB,WAAW;AACtC;AAFgB;AAQT,SAAS,WAAW,UAAuC;AAChE,SAAO,kBAAkB,YAAY;AACvC;AAFgB;","names":[]}
package/dist/font.mjs CHANGED
@@ -1,10 +1,14 @@
1
1
  import {
2
+ defineLayoutFonts,
2
3
  localFont,
3
- remoteFont
4
- } from "./chunk-AW6I64AP.mjs";
4
+ remoteFont,
5
+ resolveFarmLayoutFonts
6
+ } from "./chunk-6ZXIQSXE.mjs";
5
7
  import "./chunk-CGILA3WO.mjs";
6
8
  export {
9
+ defineLayoutFonts,
7
10
  localFont,
8
- remoteFont
11
+ remoteFont,
12
+ resolveFarmLayoutFonts
9
13
  };
10
14
  //# sourceMappingURL=font.mjs.map