@fluixi/compiler 1.0.0-alpha.69 → 1.0.0-alpha.71

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 (94) hide show
  1. package/dist/babel-DFIRSRWC.mjs +2 -0
  2. package/dist/chunk-EF6V4GTD.mjs +1 -0
  3. package/dist/codegen/backend.cjs +1 -1
  4. package/dist/codegen/backend.d.ts +14 -0
  5. package/dist/codegen/backend.d.ts.map +1 -1
  6. package/dist/codegen/backends/imperative.cjs +1 -1
  7. package/dist/codegen/backends/imperative.d.ts +10 -1
  8. package/dist/codegen/backends/imperative.d.ts.map +1 -1
  9. package/dist/codegen/backends/imperative.js +127 -16
  10. package/dist/codegen/backends/imperative.mjs +1 -1
  11. package/dist/codegen/partial-template.cjs +1 -0
  12. package/dist/codegen/partial-template.d.ts +62 -0
  13. package/dist/codegen/partial-template.d.ts.map +1 -0
  14. package/dist/codegen/partial-template.js +0 -0
  15. package/dist/codegen/partial-template.mjs +1 -0
  16. package/dist/codegen/serialize-static.cjs +1 -0
  17. package/dist/codegen/serialize-static.d.ts +23 -0
  18. package/dist/codegen/serialize-static.d.ts.map +1 -0
  19. package/dist/codegen/serialize-static.js +140 -0
  20. package/dist/codegen/serialize-static.mjs +1 -0
  21. package/dist/frontend/babel/build-ir-lit.cjs +1 -1
  22. package/dist/frontend/babel/build-ir-lit.d.ts.map +1 -1
  23. package/dist/frontend/babel/build-ir-lit.js +5 -1
  24. package/dist/frontend/babel/build-ir-lit.mjs +1 -1
  25. package/dist/frontend/babel/build-ir.cjs +1 -1
  26. package/dist/frontend/babel/build-ir.d.ts.map +1 -1
  27. package/dist/frontend/babel/build-ir.js +36 -8
  28. package/dist/frontend/babel/build-ir.mjs +1 -1
  29. package/dist/frontend/babel/index.cjs +2 -2
  30. package/dist/frontend/babel/index.mjs +2 -2
  31. package/dist/frontend/babel/lower-template.cjs +1 -1
  32. package/dist/frontend/babel/lower-template.d.ts.map +1 -1
  33. package/dist/frontend/babel/lower-template.js +34 -5
  34. package/dist/frontend/babel/lower-template.mjs +1 -1
  35. package/dist/frontend/babel/plugin.cjs +2 -2
  36. package/dist/frontend/babel/plugin.d.ts +4 -0
  37. package/dist/frontend/babel/plugin.d.ts.map +1 -1
  38. package/dist/frontend/babel/plugin.js +276 -50
  39. package/dist/frontend/babel/plugin.mjs +2 -2
  40. package/dist/index.cjs +22 -1
  41. package/dist/index.d.ts +4 -0
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +4 -0
  44. package/dist/index.mjs +22 -1
  45. package/dist/integrations.cjs +29 -8
  46. package/dist/integrations.d.ts +22 -0
  47. package/dist/integrations.d.ts.map +1 -1
  48. package/dist/integrations.js +14 -0
  49. package/dist/integrations.mjs +26 -5
  50. package/dist/ir/nodes.cjs +1 -1
  51. package/dist/ir/nodes.d.ts +43 -0
  52. package/dist/ir/nodes.d.ts.map +1 -1
  53. package/dist/optimize/analyze-static.cjs +1 -0
  54. package/dist/optimize/analyze-static.d.ts +40 -0
  55. package/dist/optimize/analyze-static.d.ts.map +1 -0
  56. package/dist/optimize/analyze-static.js +131 -0
  57. package/dist/optimize/analyze-static.mjs +1 -0
  58. package/dist/optimize/collapse-strategies.cjs +1 -0
  59. package/dist/optimize/collapse-strategies.d.ts +31 -0
  60. package/dist/optimize/collapse-strategies.d.ts.map +1 -0
  61. package/dist/optimize/collapse-strategies.js +33 -0
  62. package/dist/optimize/collapse-strategies.mjs +1 -0
  63. package/dist/options.cjs +1 -1
  64. package/dist/options.d.ts +18 -0
  65. package/dist/options.d.ts.map +1 -1
  66. package/dist/resolve/builtins.cjs +1 -0
  67. package/dist/resolve/builtins.d.ts +69 -0
  68. package/dist/resolve/builtins.d.ts.map +1 -0
  69. package/dist/resolve/builtins.js +64 -0
  70. package/dist/resolve/builtins.mjs +1 -0
  71. package/dist/resolve/component-globals.cjs +22 -0
  72. package/dist/resolve/component-globals.d.ts +73 -0
  73. package/dist/resolve/component-globals.d.ts.map +1 -0
  74. package/dist/resolve/component-globals.js +137 -0
  75. package/dist/resolve/component-globals.mjs +22 -0
  76. package/dist/resolve/load-directive.cjs +1 -0
  77. package/dist/resolve/load-directive.d.ts +54 -0
  78. package/dist/resolve/load-directive.d.ts.map +1 -0
  79. package/dist/resolve/load-directive.js +93 -0
  80. package/dist/resolve/load-directive.mjs +1 -0
  81. package/dist/resolve/resolve-ir.cjs +1 -0
  82. package/dist/resolve/resolve-ir.d.ts +54 -0
  83. package/dist/resolve/resolve-ir.d.ts.map +1 -0
  84. package/dist/resolve/resolve-ir.js +58 -0
  85. package/dist/resolve/resolve-ir.mjs +1 -0
  86. package/dist/resolve/write-globals.cjs +22 -0
  87. package/dist/resolve/write-globals.d.ts +31 -0
  88. package/dist/resolve/write-globals.d.ts.map +1 -0
  89. package/dist/resolve/write-globals.js +136 -0
  90. package/dist/resolve/write-globals.mjs +22 -0
  91. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  92. package/package.json +4 -4
  93. package/dist/babel-UKVEBBZL.mjs +0 -2
  94. package/dist/chunk-3SAEGOMQ.mjs +0 -1
@@ -0,0 +1,137 @@
1
+ /**
2
+ * Ambient declarations for the components `resolve` supplies without an import.
3
+ *
4
+ * The compiler injects the import, so nothing in the source imports these — which leaves
5
+ * TypeScript reporting `TS2304: Cannot find name`. The code compiles and runs; the editor
6
+ * is unusable and `tsc` fails. These declarations describe what the compiler already
7
+ * does. They do not enable it.
8
+ *
9
+ * This lives next to the resolver, and takes rules rather than a flat map, because the
10
+ * resolver is the only thing that knows the whole picture: a UI library's components, the
11
+ * project's own, and the framework builtins all arrive through the same config. A
12
+ * component library cannot generate this on its own — it does not know what else the
13
+ * project resolves — which is why the generator belongs here and the library-specific CLI
14
+ * that predates it does not.
15
+ *
16
+ * Pure, like the resolver: rules in, source out, no filesystem. Writing the file is the
17
+ * caller's job (the Vite plugin does it on config resolve; a CLI can do it in CI).
18
+ */
19
+ import { createComponentResolver, } from './component-resolver.js';
20
+ import { builtinComponentMap } from './builtins.js';
21
+ /**
22
+ * Names `lib.dom` already declares as globals.
23
+ *
24
+ * An ambient `const Text` cannot beat `lib.dom`'s `var Text`, so for these the editor
25
+ * would disagree with the compiler — resolution still works at runtime, but the type
26
+ * shown would be the DOM node's. They are left out and reported instead, since importing
27
+ * them explicitly makes both agree.
28
+ */
29
+ const DOM_GLOBALS = new Set([
30
+ 'Text',
31
+ 'Image',
32
+ 'Option',
33
+ 'Audio',
34
+ 'Comment',
35
+ 'Range',
36
+ 'Selection',
37
+ 'Notification',
38
+ 'Event',
39
+ 'Document',
40
+ 'Element',
41
+ 'Node',
42
+ 'Screen',
43
+ 'Window',
44
+ 'Location',
45
+ 'History',
46
+ 'Storage',
47
+ 'Response',
48
+ 'Request',
49
+ 'Headers',
50
+ ]);
51
+ /** The package a specifier belongs to, or undefined when it is not a package import. */
52
+ function packageOf(specifier) {
53
+ if (specifier.startsWith('.') || specifier.startsWith('/'))
54
+ return undefined;
55
+ // Alias specifiers (`@/x`, `~/x`) are project-local and resolve through tsconfig paths.
56
+ if (/^[~@]\//.test(specifier))
57
+ return undefined;
58
+ const parts = specifier.split('/');
59
+ return specifier.startsWith('@') ? parts.slice(0, 2).join('/') : parts[0];
60
+ }
61
+ /** A valid identifier for the namespace import of `module`. */
62
+ function namespaceAlias(module) {
63
+ return `_${module.replace(/[^A-Za-z0-9]/g, '_')}`;
64
+ }
65
+ /** Build the ambient `.d.ts` for the components a project's `resolve` config supplies. */
66
+ export function componentGlobals(rules, options = {}) {
67
+ const { available: availableList, builtins = true, generator = '@fluixi/compiler', specifier = (module) => module, } = options;
68
+ const all = [...rules];
69
+ if (builtins) {
70
+ // Appended, so an explicit rule for the same name still wins — the resolver is
71
+ // first-match, and a project retargeting `Router` should keep its own answer.
72
+ all.push({ components: builtinComponentMap() });
73
+ }
74
+ const resolver = createComponentResolver(all);
75
+ const available = availableList ? new Set(availableList) : undefined;
76
+ const declared = [];
77
+ const shadowedByDom = [];
78
+ const unavailable = [];
79
+ const resolved = new Map();
80
+ for (const name of [...resolver.names()].sort()) {
81
+ const target = resolver.resolve(name);
82
+ /* c8 ignore next */
83
+ if (!target)
84
+ continue;
85
+ const pkg = packageOf(target.module);
86
+ if (DOM_GLOBALS.has(name))
87
+ shadowedByDom.push(name);
88
+ else if (available && pkg && !available.has(pkg))
89
+ unavailable.push(name);
90
+ else {
91
+ declared.push(name);
92
+ resolved.set(name, target);
93
+ }
94
+ }
95
+ const modules = [...new Set(declared.map((name) => resolved.get(name).module))].sort();
96
+ const imports = modules.map((m) => `import * as ${namespaceAlias(m)} from '${specifier(m)}';`);
97
+ // `export import X = ns.X` rather than `const X: typeof import('…').X`: an alias
98
+ // resolves to the original symbol, so hover shows the real declaration
99
+ // (`Button(props: ButtonProps): ComponentChild`) and go-to-definition lands on the
100
+ // source. Both forms keep the JSDoc; the alias also keeps the shape.
101
+ //
102
+ // A default export cannot use it — `import X = ns.default` is a syntax error, since
103
+ // `default` is a reserved word in that position — so those fall back to the `const`
104
+ // form, which types and documents correctly but renders as an anonymous arrow.
105
+ const lines = declared.map((name) => {
106
+ const target = resolved.get(name);
107
+ const ns = namespaceAlias(target.module);
108
+ return target.export === 'default'
109
+ ? ` const ${name}: typeof ${ns}.default;`
110
+ : ` export import ${name} = ${ns}.${target.export};`;
111
+ });
112
+ const note = shadowedByDom.length > 0
113
+ ? `//\n// Import these explicitly — lib.dom already declares the name, so an ambient\n` +
114
+ `// declaration cannot win:\n` +
115
+ shadowedByDom
116
+ .map((n) => {
117
+ const module = resolver.resolve(n)?.module;
118
+ return `// import { ${n} } from '${module ? specifier(module) : ''}';\n`;
119
+ })
120
+ .join('')
121
+ : '';
122
+ const patternRules = rules.filter((rule) => 'match' in rule).length;
123
+ const patternNote = patternRules > 0
124
+ ? `//\n// ${patternRules} pattern rule${patternRules === 1 ? '' : 's'} cannot be declared:\n` +
125
+ `// a pattern matches unboundedly many names, so there is no list to emit. Those\n` +
126
+ `// tags still resolve at build time; declare them by hand if the editor needs them.\n`
127
+ : '';
128
+ const source = `// GENERATED by ${generator} — do not edit.\n` +
129
+ `//\n` +
130
+ `// The components \`resolve\` supplies without an import. This describes what the\n` +
131
+ `// compiler already does; it does not enable it.\n` +
132
+ note +
133
+ patternNote +
134
+ (imports.length > 0 ? `\n${imports.join('\n')}\n` : '\n') +
135
+ `\ndeclare global {\n${lines.join('\n')}\n}\n`;
136
+ return { source, declared, shadowedByDom, unavailable, patternRules };
137
+ }
@@ -0,0 +1,22 @@
1
+ var $=t=>"components"in t;function v(t,o){return t.replace(/\$(\d+)/g,(l,p)=>o[Number(p)]??l)}function N(t,o){return typeof o=="string"?{module:o,export:t}:o}function b(t=[]){let o=new Map,l=[],p=[];for(let r of t){if(!$(r)){p.push(r);continue}for(let[n,a]of Object.entries(r.components)){let s=N(n,a),m=o.get(n);if(m&&m.module!==s.module){let d=l.find(f=>f.name===n);d?d.modules.push(s.module):l.push({name:n,modules:[m.module,s.module]});continue}o.set(n,s)}}let i=new Map;return{resolve:r=>{if(i.has(r))return i.get(r);let n=o.get(r);if(!n)for(let a of p){let s=r.match(new RegExp(a.match.source,a.match.flags.replace("g","")));if(s){n={module:v(a.module,s),export:a.export?v(a.export,s):r};break}}return i.set(r,n),n},names:()=>[...o.keys()],conflicts:()=>l}}var C=["Show","For","Index","Switch","Match","Portal","Dynamic","ErrorBoundary"],h=["Suspense","SuspenseList","Await"],M=["Router","Outlet","Redirect","Link"],j=[...C,...h,...M],A=new Set([...C,...h]);function O(t={}){let{controlFlowModule:o="@fluixi/dom",coreModule:l="@fluixi/core",routerModule:p="@fluixi/core/router-next"}=t,i={};for(let u of C)i[u]=o;for(let u of h)i[u]=l;for(let u of M)i[u]=p;return i}var T=new Set(["Text","Image","Option","Audio","Comment","Range","Selection","Notification","Event","Document","Element","Node","Screen","Window","Location","History","Storage","Response","Request","Headers"]);function L(t){if(t.startsWith(".")||t.startsWith("/")||/^[~@]\//.test(t))return;let o=t.split("/");return t.startsWith("@")?o.slice(0,2).join("/"):o[0]}function y(t){return`_${t.replace(/[^A-Za-z0-9]/g,"_")}`}function W(t,o={}){let{available:l,builtins:p=!0,generator:i="@fluixi/compiler",specifier:u=e=>e}=o,r=[...t];p&&r.push({components:O()});let n=b(r),a=l?new Set(l):void 0,s=[],m=[],d=[],f=new Map;for(let e of[...n.names()].sort()){let c=n.resolve(e);if(!c)continue;let g=L(c.module);T.has(e)?m.push(e):a&&g&&!a.has(g)?d.push(e):(s.push(e),f.set(e,c))}let x=[...new Set(s.map(e=>f.get(e).module))].sort().map(e=>`import * as ${y(e)} from '${u(e)}';`),w=s.map(e=>{let c=f.get(e),g=y(c.module);return c.export==="default"?` const ${e}: typeof ${g}.default;`:` export import ${e} = ${g}.${c.export};`}),E=m.length>0?`//
2
+ // Import these explicitly — lib.dom already declares the name, so an ambient
3
+ // declaration cannot win:
4
+ `+m.map(e=>{let c=n.resolve(e)?.module;return`// import { ${e} } from '${c?u(c):""}';
5
+ `}).join(""):"",R=t.filter(e=>"match"in e).length,S=R>0?`//
6
+ // ${R} pattern rule${R===1?"":"s"} cannot be declared:
7
+ // a pattern matches unboundedly many names, so there is no list to emit. Those
8
+ // tags still resolve at build time; declare them by hand if the editor needs them.
9
+ `:"";return{source:`// GENERATED by ${i} — do not edit.
10
+ //
11
+ // The components \`resolve\` supplies without an import. This describes what the
12
+ // compiler already does; it does not enable it.
13
+ `+E+S+(x.length>0?`
14
+ ${x.join(`
15
+ `)}
16
+ `:`
17
+ `)+`
18
+ declare global {
19
+ ${w.join(`
20
+ `)}
21
+ }
22
+ `,declared:s,shadowedByDom:m,unavailable:d,patternRules:R}}export{W as componentGlobals};
@@ -0,0 +1 @@
1
+ "use strict";var o=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var k=(e,n)=>{for(var t in n)o(e,t,{get:n[t],enumerable:!0})},p=(e,n,t,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of g(n))!u.call(e,r)&&r!==t&&o(e,r,{get:()=>n[r],enumerable:!(a=l(n,r))||a.enumerable});return e};var w=e=>p(o({},"__esModule",{value:!0}),e);var y={};k(y,{DEFAULT_INTERACTION_EVENTS:()=>c,EAGER:()=>d,LoadDirectiveError:()=>i,isDeferred:()=>m,isLoadDirective:()=>v,parseLoadDirective:()=>f,strategyKey:()=>x});module.exports=w(y);var d={kind:"eager"},c=["pointerdown","focusin","keydown"],s=new Set(["eager","idle","visible","interaction","media","never"]),i=class extends Error{};function v(e){return e.startsWith("load:")}function f(e,n){let t=e.slice(5);if(!s.has(t))throw new i(`Unknown load strategy 'load:${t}'. Expected one of ${[...s].join(", ")}.`);switch(t){case"eager":return d;case"idle":return{kind:"idle"};case"never":return{kind:"never"};case"visible":return n?{kind:"visible",rootMargin:n}:{kind:"visible"};case"interaction":return{kind:"interaction",events:n?h(n):[...c]};case"media":if(!n)throw new i(`'load:media' needs a query, e.g. load:media="(min-width: 1024px)".`);return{kind:"media",query:n};default:throw new i(`Unhandled load strategy '${t}'.`)}}function h(e){let n=e.split(/[\s,]+/).map(t=>t.trim()).filter(Boolean);if(n.length===0)throw new i("'load:interaction' was given no event names.");return n}function m(e){return e.kind!=="eager"&&e.kind!=="never"}function x(e){switch(e.kind){case"visible":return`visible:${e.rootMargin??""}`;case"interaction":return`interaction:${[...e.events].sort().join(",")}`;case"media":return`media:${e.query}`;default:return e.kind}}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * The `load:` directive — when a component's code is fetched.
3
+ *
4
+ * Resolution decides *where* a component comes from; this decides *when*. They are
5
+ * separate because they vary independently: the location of `<RevenueChart>` is the
6
+ * same everywhere and belongs in config, while whether this particular usage should
7
+ * wait for the viewport is a property of the usage. Fusing them — `<Chart lazy="./Chart">`
8
+ * — was rejected for exactly that reason.
9
+ *
10
+ * `load:` joins the existing `use:`/`prop:`/`attr:`/`bool:` namespace, so it cannot
11
+ * collide with a real prop and the parser already has a directive taxonomy to hang it on.
12
+ *
13
+ * One parser for both frontends. `load:visible` is already a valid `JSXNamespacedName`,
14
+ * so JSX needs no parser change, and the html`` path produces a `LoadDirective` node —
15
+ * but both funnel through {@link parseLoadDirective}, so the two syntaxes cannot drift.
16
+ */
17
+ /** When a component's module is fetched. */
18
+ export type IRLoadStrategy = {
19
+ kind: 'eager';
20
+ } | {
21
+ kind: 'idle';
22
+ } | {
23
+ kind: 'visible';
24
+ rootMargin?: string;
25
+ } | {
26
+ kind: 'interaction';
27
+ events: string[];
28
+ } | {
29
+ kind: 'media';
30
+ query: string;
31
+ } | {
32
+ kind: 'never';
33
+ };
34
+ /** Everything is eager unless a directive says otherwise. */
35
+ export declare const EAGER: IRLoadStrategy;
36
+ /** Events that trigger an `interaction` load when none are named. */
37
+ export declare const DEFAULT_INTERACTION_EVENTS: readonly ["pointerdown", "focusin", "keydown"];
38
+ export declare class LoadDirectiveError extends Error {
39
+ }
40
+ /** True for an attribute name in the `load:` namespace. */
41
+ export declare function isLoadDirective(name: string): boolean;
42
+ /**
43
+ * Parse `load:<strategy>` plus its optional value into a strategy.
44
+ *
45
+ * `value` is the attribute's literal text — `load:visible="200px"` — or null for a bare
46
+ * directive. A `${…}` hole is rejected: the strategy has to be known at compile time
47
+ * because it decides how the module is emitted, and a runtime value cannot.
48
+ */
49
+ export declare function parseLoadDirective(name: string, value: string | null): IRLoadStrategy;
50
+ /** True when the strategy means "not in the parent chunk". */
51
+ export declare function isDeferred(strategy: IRLoadStrategy): boolean;
52
+ /** A stable key for grouping references that share a strategy. */
53
+ export declare function strategyKey(strategy: IRLoadStrategy): string;
54
+ //# sourceMappingURL=load-directive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-directive.d.ts","sourceRoot":"","sources":["../../src/resolve/load-directive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,4CAA4C;AAC5C,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACjB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEtB,6DAA6D;AAC7D,eAAO,MAAM,KAAK,EAAE,cAAkC,CAAC;AAEvD,qEAAqE;AACrE,eAAO,MAAM,0BAA0B,gDAAiD,CAAC;AAIzF,qBAAa,kBAAmB,SAAQ,KAAK;CAAG;AAEhD,2DAA2D;AAC3D,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,cAAc,CAqCrF;AAaD,8DAA8D;AAC9D,wBAAgB,UAAU,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAE5D;AAED,kEAAkE;AAClE,wBAAgB,WAAW,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,CAW5D"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * The `load:` directive — when a component's code is fetched.
3
+ *
4
+ * Resolution decides *where* a component comes from; this decides *when*. They are
5
+ * separate because they vary independently: the location of `<RevenueChart>` is the
6
+ * same everywhere and belongs in config, while whether this particular usage should
7
+ * wait for the viewport is a property of the usage. Fusing them — `<Chart lazy="./Chart">`
8
+ * — was rejected for exactly that reason.
9
+ *
10
+ * `load:` joins the existing `use:`/`prop:`/`attr:`/`bool:` namespace, so it cannot
11
+ * collide with a real prop and the parser already has a directive taxonomy to hang it on.
12
+ *
13
+ * One parser for both frontends. `load:visible` is already a valid `JSXNamespacedName`,
14
+ * so JSX needs no parser change, and the html`` path produces a `LoadDirective` node —
15
+ * but both funnel through {@link parseLoadDirective}, so the two syntaxes cannot drift.
16
+ */
17
+ /** Everything is eager unless a directive says otherwise. */
18
+ export const EAGER = { kind: 'eager' };
19
+ /** Events that trigger an `interaction` load when none are named. */
20
+ export const DEFAULT_INTERACTION_EVENTS = ['pointerdown', 'focusin', 'keydown'];
21
+ const STRATEGIES = new Set(['eager', 'idle', 'visible', 'interaction', 'media', 'never']);
22
+ export class LoadDirectiveError extends Error {
23
+ }
24
+ /** True for an attribute name in the `load:` namespace. */
25
+ export function isLoadDirective(name) {
26
+ return name.startsWith('load:');
27
+ }
28
+ /**
29
+ * Parse `load:<strategy>` plus its optional value into a strategy.
30
+ *
31
+ * `value` is the attribute's literal text — `load:visible="200px"` — or null for a bare
32
+ * directive. A `${…}` hole is rejected: the strategy has to be known at compile time
33
+ * because it decides how the module is emitted, and a runtime value cannot.
34
+ */
35
+ export function parseLoadDirective(name, value) {
36
+ const strategy = name.slice('load:'.length);
37
+ if (!STRATEGIES.has(strategy)) {
38
+ throw new LoadDirectiveError(`Unknown load strategy 'load:${strategy}'. Expected one of ${[...STRATEGIES].join(', ')}.`);
39
+ }
40
+ switch (strategy) {
41
+ case 'eager':
42
+ return EAGER;
43
+ case 'idle':
44
+ return { kind: 'idle' };
45
+ case 'never':
46
+ return { kind: 'never' };
47
+ case 'visible':
48
+ // `load:visible="200px"` starts the fetch before the element reaches the
49
+ // viewport, which is usually what you want — arriving exactly on intersection
50
+ // means the user waits for the network.
51
+ return value ? { kind: 'visible', rootMargin: value } : { kind: 'visible' };
52
+ case 'interaction':
53
+ return {
54
+ kind: 'interaction',
55
+ events: value ? splitEvents(value) : [...DEFAULT_INTERACTION_EVENTS],
56
+ };
57
+ case 'media':
58
+ if (!value) {
59
+ throw new LoadDirectiveError(`'load:media' needs a query, e.g. load:media="(min-width: 1024px)".`);
60
+ }
61
+ return { kind: 'media', query: value };
62
+ default:
63
+ /* c8 ignore next */
64
+ throw new LoadDirectiveError(`Unhandled load strategy '${strategy}'.`);
65
+ }
66
+ }
67
+ function splitEvents(value) {
68
+ const events = value
69
+ .split(/[\s,]+/)
70
+ .map((e) => e.trim())
71
+ .filter(Boolean);
72
+ if (events.length === 0) {
73
+ throw new LoadDirectiveError(`'load:interaction' was given no event names.`);
74
+ }
75
+ return events;
76
+ }
77
+ /** True when the strategy means "not in the parent chunk". */
78
+ export function isDeferred(strategy) {
79
+ return strategy.kind !== 'eager' && strategy.kind !== 'never';
80
+ }
81
+ /** A stable key for grouping references that share a strategy. */
82
+ export function strategyKey(strategy) {
83
+ switch (strategy.kind) {
84
+ case 'visible':
85
+ return `visible:${strategy.rootMargin ?? ''}`;
86
+ case 'interaction':
87
+ return `interaction:${[...strategy.events].sort().join(',')}`;
88
+ case 'media':
89
+ return `media:${strategy.query}`;
90
+ default:
91
+ return strategy.kind;
92
+ }
93
+ }
@@ -0,0 +1 @@
1
+ var o={kind:"eager"},a=["pointerdown","focusin","keydown"],r=new Set(["eager","idle","visible","interaction","media","never"]),i=class extends Error{};function d(e){return e.startsWith("load:")}function c(e,n){let t=e.slice(5);if(!r.has(t))throw new i(`Unknown load strategy 'load:${t}'. Expected one of ${[...r].join(", ")}.`);switch(t){case"eager":return o;case"idle":return{kind:"idle"};case"never":return{kind:"never"};case"visible":return n?{kind:"visible",rootMargin:n}:{kind:"visible"};case"interaction":return{kind:"interaction",events:n?s(n):[...a]};case"media":if(!n)throw new i(`'load:media' needs a query, e.g. load:media="(min-width: 1024px)".`);return{kind:"media",query:n};default:throw new i(`Unhandled load strategy '${t}'.`)}}function s(e){let n=e.split(/[\s,]+/).map(t=>t.trim()).filter(Boolean);if(n.length===0)throw new i("'load:interaction' was given no event names.");return n}function l(e){return e.kind!=="eager"&&e.kind!=="never"}function g(e){switch(e.kind){case"visible":return`visible:${e.rootMargin??""}`;case"interaction":return`interaction:${[...e.events].sort().join(",")}`;case"media":return`media:${e.query}`;default:return e.kind}}export{a as DEFAULT_INTERACTION_EVENTS,o as EAGER,i as LoadDirectiveError,l as isDeferred,d as isLoadDirective,c as parseLoadDirective,g as strategyKey};
@@ -0,0 +1 @@
1
+ "use strict";var c=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var w=(n,e)=>{for(var i in e)c(n,i,{get:e[i],enumerable:!0})},N=(n,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of y(e))!I.call(n,o)&&o!==i&&c(n,o,{get:()=>e[o],enumerable:!(s=M(e,o))||s.enumerable});return n};var k=n=>N(c({},"__esModule",{value:!0}),n);var h={};w(h,{resolveComponentSources:()=>b,walk:()=>f});module.exports=k(h);var l=["Show","For","Index","Switch","Match","Portal","Dynamic","ErrorBoundary"],p=["Suspense","SuspenseList","Await"],a=["Router","Outlet","Redirect","Link"],L=[...l,...p,...a],m=new Set([...l,...p]);function S(n={}){let{controlFlowModule:e="@fluixi/dom",coreModule:i="@fluixi/core",routerModule:s="@fluixi/core/router-next"}=n,o={};for(let d of l)o[d]=e;for(let d of p)o[d]=i;for(let d of a)o[d]=s;return o}var R={kind:"eager"};function b(n,e={}){let{resolver:i,isBound:s,modules:o,strategyFor:d}=e,g=S(o),x=new Map,v=new Set,E=t=>{let{name:r}=t;if(!r||r.includes(".")||s?.(r))return;let u=O(r);if(!u){v.add(r);return}let C=u.origin==="builtin"&&m.has(r)?R:d?.(t)??R;t.source={...u,loading:C},x.set(r,t.source)},O=t=>{if(m.has(t))return{module:g[t],export:t,origin:"builtin"};let r=i?.resolve(t);if(r)return{module:r.module,export:r.export,origin:"rule"};if(a.includes(t))return{module:g[t],export:t,origin:"builtin"}};return f(n,t=>{t.kind==="component"&&E(t)}),{resolved:x,unresolved:[...v]}}function f(n,e){let i=Array.isArray(n)?n:[n];for(let s of i){e(s);let o=s.children;o&&f(o,e)}}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * The resolve pass: annotate component references in the IR with where they come from.
3
+ *
4
+ * Runs between the frontends and the optimizer, so every later pass reads provenance off
5
+ * the node instead of re-deriving it. Nothing here emits code — the pass only records a
6
+ * decision, which is what lets the same answer drive import injection, chunk grouping,
7
+ * hint planning and diagnostics without any of them agreeing by coincidence.
8
+ *
9
+ * Two suppliers, in precedence order:
10
+ *
11
+ * 1. **Control flow** (`Show`, `For`, `Switch`, …) — the name selects a lowering, so a
12
+ * rule cannot re-point it. Recorded as `builtin` so a later pass can tell the
13
+ * difference between "configured here" and "fixed by the compiler".
14
+ * 2. **Configured rules**, then the **router built-ins**. Router components are only an
15
+ * import, so a project's own `Link` wins; see `builtins.ts`.
16
+ *
17
+ * A name bound in the file is not resolved at all: the author's import always wins, and
18
+ * the caller supplies those bindings via `isBound`.
19
+ */
20
+ import type { IRNode, IRComponent, IRComponentSource } from '../ir/nodes.js';
21
+ import type { ComponentResolver } from './component-resolver.js';
22
+ import { builtinComponentMap } from './builtins.js';
23
+ import { type IRLoadStrategy } from './load-directive.js';
24
+ export interface ResolveOptions {
25
+ /** Rules configured for the project. Omit when the project configures none. */
26
+ resolver?: ComponentResolver;
27
+ /** True when the name already has a binding in the file — an import the author wrote. */
28
+ isBound?: (name: string) => boolean;
29
+ /** Module overrides, so `routerModule` and friends are honoured. */
30
+ modules?: Parameters<typeof builtinComponentMap>[0];
31
+ /**
32
+ * The `load:` strategy for a reference, when the frontend found one on the tag.
33
+ * Keyed by node so two usages of the same component can load differently — the
34
+ * whole reason timing lives at the usage site and location does not.
35
+ */
36
+ strategyFor?: (node: IRComponent) => IRLoadStrategy | undefined;
37
+ }
38
+ export interface ResolveReport {
39
+ /** Every reference the pass annotated, by name. */
40
+ resolved: Map<string, IRComponentSource>;
41
+ /**
42
+ * Capitalised tags nothing supplies and nothing binds.
43
+ *
44
+ * These compile to a reference to an identifier that does not exist — the build
45
+ * succeeds and the page throws at runtime — so they are the pass's most useful
46
+ * output for diagnostics.
47
+ */
48
+ unresolved: string[];
49
+ }
50
+ /** Annotate every component reference in `root`, returning what was decided. */
51
+ export declare function resolveComponentSources(root: IRNode | IRNode[], options?: ResolveOptions): ResolveReport;
52
+ /** Depth-first walk over every node that can contain children. */
53
+ export declare function walk(root: IRNode | IRNode[], visit: (node: IRNode) => void): void;
54
+ //# sourceMappingURL=resolve-ir.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-ir.d.ts","sourceRoot":"","sources":["../../src/resolve/resolve-ir.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAA0C,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAS,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,yFAAyF;IACzF,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACpC,oEAAoE;IACpE,OAAO,CAAC,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,cAAc,GAAG,SAAS,CAAC;CACjE;AAED,MAAM,WAAW,aAAa;IAC5B,mDAAmD;IACnD,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACzC;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,gFAAgF;AAChF,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EACvB,OAAO,GAAE,cAAmB,GAC3B,aAAa,CA8Cf;AAED,kEAAkE;AAClE,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAOjF"}
@@ -0,0 +1,58 @@
1
+ import { RESERVED_COMPONENTS, ROUTER_COMPONENTS, builtinComponentMap } from './builtins.js';
2
+ import { EAGER } from './load-directive.js';
3
+ /** Annotate every component reference in `root`, returning what was decided. */
4
+ export function resolveComponentSources(root, options = {}) {
5
+ const { resolver, isBound, modules, strategyFor } = options;
6
+ const builtins = builtinComponentMap(modules);
7
+ const resolved = new Map();
8
+ const unresolved = new Set();
9
+ const annotate = (node) => {
10
+ const { name } = node;
11
+ // A dotted path (`Ctx.Provider`) or a dynamic tag needs its root binding, which is
12
+ // an ordinary expression the author wrote — nothing to supply.
13
+ if (!name || name.includes('.'))
14
+ return;
15
+ if (isBound?.(name))
16
+ return;
17
+ const source = sourceFor(name);
18
+ if (!source) {
19
+ unresolved.add(name);
20
+ return;
21
+ }
22
+ // Control flow is lowered by name, so a load strategy on it has nothing to defer;
23
+ // ignoring it here keeps codegen from having to special-case the combination.
24
+ const loading = source.origin === 'builtin' && RESERVED_COMPONENTS.has(name)
25
+ ? EAGER
26
+ : (strategyFor?.(node) ?? EAGER);
27
+ node.source = { ...source, loading };
28
+ resolved.set(name, node.source);
29
+ };
30
+ const sourceFor = (name) => {
31
+ // Control flow first: the name is fixed by the compiler.
32
+ if (RESERVED_COMPONENTS.has(name)) {
33
+ return { module: builtins[name], export: name, origin: 'builtin' };
34
+ }
35
+ const rule = resolver?.resolve(name);
36
+ if (rule)
37
+ return { module: rule.module, export: rule.export, origin: 'rule' };
38
+ if (ROUTER_COMPONENTS.includes(name)) {
39
+ return { module: builtins[name], export: name, origin: 'builtin' };
40
+ }
41
+ return undefined;
42
+ };
43
+ walk(root, (node) => {
44
+ if (node.kind === 'component')
45
+ annotate(node);
46
+ });
47
+ return { resolved, unresolved: [...unresolved] };
48
+ }
49
+ /** Depth-first walk over every node that can contain children. */
50
+ export function walk(root, visit) {
51
+ const nodes = Array.isArray(root) ? root : [root];
52
+ for (const node of nodes) {
53
+ visit(node);
54
+ const children = node.children;
55
+ if (children)
56
+ walk(children, visit);
57
+ }
58
+ }
@@ -0,0 +1 @@
1
+ var c=["Show","For","Index","Switch","Match","Portal","Dynamic","ErrorBoundary"],l=["Suspense","SuspenseList","Await"],a=["Router","Outlet","Redirect","Link"],C=[...c,...l,...a],p=new Set([...c,...l]);function x(t={}){let{controlFlowModule:i="@fluixi/dom",coreModule:d="@fluixi/core",routerModule:s="@fluixi/core/router-next"}=t,o={};for(let r of c)o[r]=i;for(let r of l)o[r]=d;for(let r of a)o[r]=s;return o}var m={kind:"eager"};function N(t,i={}){let{resolver:d,isBound:s,modules:o,strategyFor:r}=i,R=x(o),f=new Map,g=new Set,S=e=>{let{name:n}=e;if(!n||n.includes(".")||s?.(n))return;let u=E(n);if(!u){g.add(n);return}let O=u.origin==="builtin"&&p.has(n)?m:r?.(e)??m;e.source={...u,loading:O},f.set(n,e.source)},E=e=>{if(p.has(e))return{module:R[e],export:e,origin:"builtin"};let n=d?.resolve(e);if(n)return{module:n.module,export:n.export,origin:"rule"};if(a.includes(e))return{module:R[e],export:e,origin:"builtin"}};return v(t,e=>{e.kind==="component"&&S(e)}),{resolved:f,unresolved:[...g]}}function v(t,i){let d=Array.isArray(t)?t:[t];for(let s of d){i(s);let o=s.children;o&&v(o,i)}}export{N as resolveComponentSources,v as walk};
@@ -0,0 +1,22 @@
1
+ "use strict";var x=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var W=(e,n)=>{for(var o in n)x(e,o,{get:n[o],enumerable:!0})},B=(e,n,o,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of L(n))!_.call(e,t)&&t!==o&&x(e,t,{get:()=>n[t],enumerable:!(r=D(n,t))||r.enumerable});return e};var P=e=>B(x({},"__esModule",{value:!0}),e);var Z={};W(Z,{DEFAULT_GLOBALS_PATH:()=>N,writeComponentGlobals:()=>V});module.exports=P(Z);var f=require("node:fs"),c=require("node:path");var F=e=>"components"in e;function O(e,n){return e.replace(/\$(\d+)/g,(o,r)=>n[Number(r)]??o)}function I(e,n){return typeof n=="string"?{module:n,export:e}:n}function w(e=[]){let n=new Map,o=[],r=[];for(let i of e){if(!F(i)){r.push(i);continue}for(let[l,p]of Object.entries(i.components)){let u=I(l,p),m=n.get(l);if(m&&m.module!==u.module){let g=o.find(R=>R.name===l);g?g.modules.push(u.module):o.push({name:l,modules:[m.module,u.module]});continue}n.set(l,u)}}let t=new Map;return{resolve:i=>{if(t.has(i))return t.get(i);let l=n.get(i);if(!l)for(let p of r){let u=i.match(new RegExp(p.match.source,p.match.flags.replace("g","")));if(u){l={module:O(p.module,u),export:p.export?O(p.export,u):i};break}}return t.set(i,l),l},names:()=>[...n.keys()],conflicts:()=>o}}var b=["Show","For","Index","Switch","Match","Portal","Dynamic","ErrorBoundary"],C=["Suspense","SuspenseList","Await"],M=["Router","Outlet","Redirect","Link"],ne=[...b,...C,...M],te=new Set([...b,...C]);function E(e={}){let{controlFlowModule:n="@fluixi/dom",coreModule:o="@fluixi/core",routerModule:r="@fluixi/core/router-next"}=e,t={};for(let a of b)t[a]=n;for(let a of C)t[a]=o;for(let a of M)t[a]=r;return t}var U=new Set(["Text","Image","Option","Audio","Comment","Range","Selection","Notification","Event","Document","Element","Node","Screen","Window","Location","History","Storage","Response","Request","Headers"]);function H(e){if(e.startsWith(".")||e.startsWith("/")||/^[~@]\//.test(e))return;let n=e.split("/");return e.startsWith("@")?n.slice(0,2).join("/"):n[0]}function S(e){return`_${e.replace(/[^A-Za-z0-9]/g,"_")}`}function $(e,n={}){let{available:o,builtins:r=!0,generator:t="@fluixi/compiler",specifier:a=s=>s}=n,i=[...e];r&&i.push({components:E()});let l=w(i),p=o?new Set(o):void 0,u=[],m=[],g=[],R=new Map;for(let s of[...l.names()].sort()){let d=l.resolve(s);if(!d)continue;let h=H(d.module);U.has(s)?m.push(s):p&&h&&!p.has(h)?g.push(s):(u.push(s),R.set(s,d))}let y=[...new Set(u.map(s=>R.get(s).module))].sort().map(s=>`import * as ${S(s)} from '${a(s)}';`),A=u.map(s=>{let d=R.get(s),h=S(d.module);return d.export==="default"?` const ${s}: typeof ${h}.default;`:` export import ${s} = ${h}.${d.export};`}),G=m.length>0?`//
2
+ // Import these explicitly — lib.dom already declares the name, so an ambient
3
+ // declaration cannot win:
4
+ `+m.map(s=>{let d=l.resolve(s)?.module;return`// import { ${s} } from '${d?a(d):""}';
5
+ `}).join(""):"",v=e.filter(s=>"match"in s).length,k=v>0?`//
6
+ // ${v} pattern rule${v===1?"":"s"} cannot be declared:
7
+ // a pattern matches unboundedly many names, so there is no list to emit. Those
8
+ // tags still resolve at build time; declare them by hand if the editor needs them.
9
+ `:"";return{source:`// GENERATED by ${t} — do not edit.
10
+ //
11
+ // The components \`resolve\` supplies without an import. This describes what the
12
+ // compiler already does; it does not enable it.
13
+ `+G+k+(y.length>0?`
14
+ ${y.join(`
15
+ `)}
16
+ `:`
17
+ `)+`
18
+ declare global {
19
+ ${A.join(`
20
+ `)}
21
+ }
22
+ `,declared:u,shadowedByDom:m,unavailable:g,patternRules:v}}var J="GENERATED by @fluixi/compiler",N="fluixi.d.ts";function q(e,n){let o;try{let t=(0,f.readFileSync)((0,c.resolve)(e,"tsconfig.json"),"utf8");o=JSON.parse(t.replace(/^\s*\/\/.*$/gm,""))}catch{return}if(o.extends!==void 0)return;if(!Array.isArray(o.include))return!0;let r=T(e,n);return o.include.some(t=>{if(typeof t!="string")return!1;let a=t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*\//g,"(?:.*/)?").replace(/\*/g,"[^/]*");return new RegExp(`^${a}(?:/.*)?$`).test(r)})}function T(e,n){return(0,c.relative)(e,n).split(c.sep).join("/")}function z(e,n,o){if(!e.startsWith("/"))return e;let r=(0,c.resolve)(o,e.slice(1)),t=(0,c.relative)(n,r).split(c.sep).join("/");return t.startsWith(".")||(t=`./${t}`),t.replace(/\.(tsx|ts|jsx|mts|cts)$/,".js")}function K(e){try{let n=JSON.parse((0,f.readFileSync)((0,c.resolve)(e,"package.json"),"utf8"));return[...Object.keys(n.dependencies??{}),...Object.keys(n.devDependencies??{}),...Object.keys(n.peerDependencies??{})]}catch{return}}function V(e,n){if(e.globals===!1)return{status:"skipped",reason:"disabled"};let o=e.resolve??[],r=(0,c.resolve)(n,e.globals??N),t;try{t=(0,f.readFileSync)(r,"utf8")}catch{t=void 0}if(t!==void 0&&!t.includes(J))return{status:"skipped",reason:"foreign-file",path:r};let{source:a,declared:i}=$(o,{available:K(n),specifier:l=>z(l,(0,c.dirname)(r),n)});return t===a?{status:"unchanged",path:r,declared:i.length,warning:j(n,r)}:((0,f.mkdirSync)((0,c.dirname)(r),{recursive:!0}),(0,f.writeFileSync)(r,a),{status:"written",path:r,declared:i.length,warning:j(n,r)})}function j(e,n){if(q(e,n)!==!1)return;let o=T(e,n);return`[fluixi] ${o} is not covered by "include" in tsconfig.json, so TypeScript will ignore it and every resolved component stays "Cannot find name". Add "${o}" to "include".`}
@@ -0,0 +1,31 @@
1
+ import type { ComponentResolverRule } from './component-resolver.js';
2
+ export declare const DEFAULT_GLOBALS_PATH = "fluixi.d.ts";
3
+ export interface WriteGlobalsOptions {
4
+ resolve?: readonly ComponentResolverRule[];
5
+ globals?: string | false;
6
+ }
7
+ export type WriteGlobalsOutcome = ({
8
+ status: 'written';
9
+ path: string;
10
+ declared: number;
11
+ } | {
12
+ status: 'unchanged';
13
+ path: string;
14
+ declared: number;
15
+ } | {
16
+ status: 'skipped';
17
+ reason: 'disabled' | 'foreign-file';
18
+ path?: string;
19
+ }) & {
20
+ /**
21
+ * Set when the file was written somewhere TypeScript will not read it.
22
+ *
23
+ * Worth surfacing because the symptom is indistinguishable from the generator never
24
+ * having run: every resolved tag is still `Cannot find name`, and the file sitting
25
+ * right there makes it look like it should have worked.
26
+ */
27
+ warning?: string;
28
+ };
29
+ /** Generate and write the declarations for `root`, returning what was done. */
30
+ export declare function writeComponentGlobals(options: WriteGlobalsOptions, root: string): WriteGlobalsOutcome;
31
+ //# sourceMappingURL=write-globals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-globals.d.ts","sourceRoot":"","sources":["../../src/resolve/write-globals.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAKrE,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAElD,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAC3C,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAC1B;AAED,MAAM,MAAM,mBAAmB,GAAG,CAC9B;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACrD;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACvD;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,UAAU,GAAG,cAAc,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAC5E,GAAG;IACF;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AA2EF,+EAA+E;AAC/E,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,mBAAmB,EAC5B,IAAI,EAAE,MAAM,GACX,mBAAmB,CAwCrB"}