@alloy-js/core 0.1.0
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.
- package/LICENSE.txt +7 -0
- package/api-extractor.json +11 -0
- package/babel.config.cjs +4 -0
- package/dist/src/binder.d.ts +333 -0
- package/dist/src/binder.d.ts.map +1 -0
- package/dist/src/binder.js +444 -0
- package/dist/src/binder.js.map +1 -0
- package/dist/src/code.d.ts +3 -0
- package/dist/src/code.d.ts.map +1 -0
- package/dist/src/code.js +156 -0
- package/dist/src/code.js.map +1 -0
- package/dist/src/components/Declaration.d.ts +29 -0
- package/dist/src/components/Declaration.d.ts.map +1 -0
- package/dist/src/components/Declaration.js +47 -0
- package/dist/src/components/Declaration.js.map +1 -0
- package/dist/src/components/Indent.d.ts +13 -0
- package/dist/src/components/Indent.d.ts.map +1 -0
- package/dist/src/components/Indent.js +23 -0
- package/dist/src/components/Indent.js.map +1 -0
- package/dist/src/components/MemberDeclaration.d.ts +30 -0
- package/dist/src/components/MemberDeclaration.d.ts.map +1 -0
- package/dist/src/components/MemberDeclaration.js +52 -0
- package/dist/src/components/MemberDeclaration.js.map +1 -0
- package/dist/src/components/MemberName.d.ts +2 -0
- package/dist/src/components/MemberName.d.ts.map +1 -0
- package/dist/src/components/MemberName.js +11 -0
- package/dist/src/components/MemberName.js.map +1 -0
- package/dist/src/components/MemberScope.d.ts +27 -0
- package/dist/src/components/MemberScope.d.ts.map +1 -0
- package/dist/src/components/MemberScope.js +28 -0
- package/dist/src/components/MemberScope.js.map +1 -0
- package/dist/src/components/Name.d.ts +2 -0
- package/dist/src/components/Name.d.ts.map +1 -0
- package/dist/src/components/Name.js +11 -0
- package/dist/src/components/Name.js.map +1 -0
- package/dist/src/components/Output.d.ts +31 -0
- package/dist/src/components/Output.d.ts.map +1 -0
- package/dist/src/components/Output.js +44 -0
- package/dist/src/components/Output.js.map +1 -0
- package/dist/src/components/Scope.d.ts +10 -0
- package/dist/src/components/Scope.d.ts.map +1 -0
- package/dist/src/components/Scope.js +25 -0
- package/dist/src/components/Scope.js.map +1 -0
- package/dist/src/components/SourceDirectory.d.ts +7 -0
- package/dist/src/components/SourceDirectory.d.ts.map +1 -0
- package/dist/src/components/SourceDirectory.js +38 -0
- package/dist/src/components/SourceDirectory.js.map +1 -0
- package/dist/src/components/SourceFile.d.ts +12 -0
- package/dist/src/components/SourceFile.d.ts.map +1 -0
- package/dist/src/components/SourceFile.js +26 -0
- package/dist/src/components/SourceFile.js.map +1 -0
- package/dist/src/components/index.d.ts +11 -0
- package/dist/src/components/index.d.ts.map +1 -0
- package/dist/src/components/index.js +11 -0
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/components/stc/index.d.ts +26 -0
- package/dist/src/components/stc/index.d.ts.map +1 -0
- package/dist/src/components/stc/index.js +9 -0
- package/dist/src/components/stc/index.js.map +1 -0
- package/dist/src/context/assignment.d.ts +39 -0
- package/dist/src/context/assignment.d.ts.map +1 -0
- package/dist/src/context/assignment.js +39 -0
- package/dist/src/context/assignment.js.map +1 -0
- package/dist/src/context/binder.d.ts +9 -0
- package/dist/src/context/binder.d.ts.map +1 -0
- package/dist/src/context/binder.js +12 -0
- package/dist/src/context/binder.js.map +1 -0
- package/dist/src/context/declaration.d.ts +4 -0
- package/dist/src/context/declaration.d.ts.map +1 -0
- package/dist/src/context/declaration.js +3 -0
- package/dist/src/context/declaration.js.map +1 -0
- package/dist/src/context/indent.d.ts +5 -0
- package/dist/src/context/indent.d.ts.map +1 -0
- package/dist/src/context/indent.js +8 -0
- package/dist/src/context/indent.js.map +1 -0
- package/dist/src/context/index.d.ts +11 -0
- package/dist/src/context/index.d.ts.map +1 -0
- package/dist/src/context/index.js +11 -0
- package/dist/src/context/index.js.map +1 -0
- package/dist/src/context/member-declaration.d.ts +9 -0
- package/dist/src/context/member-declaration.d.ts.map +1 -0
- package/dist/src/context/member-declaration.js +9 -0
- package/dist/src/context/member-declaration.js.map +1 -0
- package/dist/src/context/member-scope.d.ts +13 -0
- package/dist/src/context/member-scope.d.ts.map +1 -0
- package/dist/src/context/member-scope.js +12 -0
- package/dist/src/context/member-scope.js.map +1 -0
- package/dist/src/context/name-policy.d.ts +5 -0
- package/dist/src/context/name-policy.d.ts.map +1 -0
- package/dist/src/context/name-policy.js +10 -0
- package/dist/src/context/name-policy.js.map +1 -0
- package/dist/src/context/scope.d.ts +5 -0
- package/dist/src/context/scope.d.ts.map +1 -0
- package/dist/src/context/scope.js +6 -0
- package/dist/src/context/scope.js.map +1 -0
- package/dist/src/context/source-directory.d.ts +9 -0
- package/dist/src/context/source-directory.d.ts.map +1 -0
- package/dist/src/context/source-directory.js +3 -0
- package/dist/src/context/source-directory.js.map +1 -0
- package/dist/src/context/source-file.d.ts +12 -0
- package/dist/src/context/source-file.d.ts.map +1 -0
- package/dist/src/context/source-file.js +3 -0
- package/dist/src/context/source-file.js.map +1 -0
- package/dist/src/context.d.ts +13 -0
- package/dist/src/context.d.ts.map +1 -0
- package/dist/src/context.js +30 -0
- package/dist/src/context.js.map +1 -0
- package/dist/src/index.d.ts +13 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +13 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/jsx-runtime.d.ts +43 -0
- package/dist/src/jsx-runtime.d.ts.map +1 -0
- package/dist/src/jsx-runtime.js +172 -0
- package/dist/src/jsx-runtime.js.map +1 -0
- package/dist/src/name-policy.d.ts +5 -0
- package/dist/src/name-policy.d.ts.map +1 -0
- package/dist/src/name-policy.js +8 -0
- package/dist/src/name-policy.js.map +1 -0
- package/dist/src/refkey.d.ts +9 -0
- package/dist/src/refkey.d.ts.map +1 -0
- package/dist/src/refkey.js +44 -0
- package/dist/src/refkey.js.map +1 -0
- package/dist/src/render.d.ts +147 -0
- package/dist/src/render.d.ts.map +1 -0
- package/dist/src/render.js +317 -0
- package/dist/src/render.js.map +1 -0
- package/dist/src/tsdoc-metadata.json +11 -0
- package/dist/src/utils.d.ts +80 -0
- package/dist/src/utils.d.ts.map +1 -0
- package/dist/src/utils.js +219 -0
- package/dist/src/utils.js.map +1 -0
- package/dist/test/children.test.d.ts +2 -0
- package/dist/test/children.test.d.ts.map +1 -0
- package/dist/test/components/source-file.test.d.ts +2 -0
- package/dist/test/components/source-file.test.d.ts.map +1 -0
- package/dist/test/name-policy.test.d.ts +2 -0
- package/dist/test/name-policy.test.d.ts.map +1 -0
- package/dist/test/reactivity/ref-rendering.test.d.ts +2 -0
- package/dist/test/reactivity/ref-rendering.test.d.ts.map +1 -0
- package/dist/test/reactivity/test.test.d.ts +2 -0
- package/dist/test/reactivity/test.test.d.ts.map +1 -0
- package/dist/test/refkey.test.d.ts +2 -0
- package/dist/test/refkey.test.d.ts.map +1 -0
- package/dist/test/rendering/basic.test.d.ts +2 -0
- package/dist/test/rendering/basic.test.d.ts.map +1 -0
- package/dist/test/rendering/code.test.d.ts +2 -0
- package/dist/test/rendering/code.test.d.ts.map +1 -0
- package/dist/test/rendering/indent.test.d.ts +2 -0
- package/dist/test/rendering/indent.test.d.ts.map +1 -0
- package/dist/test/rendering/linebreaks.test.d.ts +2 -0
- package/dist/test/rendering/linebreaks.test.d.ts.map +1 -0
- package/dist/test/rendering/refkeys.test.d.ts +2 -0
- package/dist/test/rendering/refkeys.test.d.ts.map +1 -0
- package/dist/test/stc.test.d.ts +2 -0
- package/dist/test/stc.test.d.ts.map +1 -0
- package/dist/test/symbols.test.d.ts +2 -0
- package/dist/test/symbols.test.d.ts.map +1 -0
- package/dist/test/utils.test.d.ts +2 -0
- package/dist/test/utils.test.d.ts.map +1 -0
- package/dist/testing/extend-expect.d.ts +2 -0
- package/dist/testing/extend-expect.d.ts.map +1 -0
- package/dist/testing/extend-expect.js +22 -0
- package/dist/testing/extend-expect.js.map +1 -0
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +3 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/render.d.ts +7 -0
- package/dist/testing/render.d.ts.map +1 -0
- package/dist/testing/render.js +25 -0
- package/dist/testing/render.js.map +1 -0
- package/dist/testing/vitest.d.js +1 -0
- package/dist/testing/vitest.d.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +64 -0
- package/src/binder.ts +838 -0
- package/src/code.ts +220 -0
- package/src/components/Declaration.tsx +53 -0
- package/src/components/Indent.tsx +33 -0
- package/src/components/MemberDeclaration.tsx +62 -0
- package/src/components/MemberName.tsx +11 -0
- package/src/components/MemberScope.tsx +40 -0
- package/src/components/Name.tsx +11 -0
- package/src/components/Output.tsx +69 -0
- package/src/components/Scope.tsx +27 -0
- package/src/components/SourceDirectory.tsx +43 -0
- package/src/components/SourceFile.tsx +33 -0
- package/src/components/index.tsx +10 -0
- package/src/components/stc/index.ts +9 -0
- package/src/context/assignment.ts +57 -0
- package/src/context/binder.ts +14 -0
- package/src/context/declaration.ts +5 -0
- package/src/context/indent.ts +10 -0
- package/src/context/index.ts +10 -0
- package/src/context/member-declaration.ts +10 -0
- package/src/context/member-scope.ts +17 -0
- package/src/context/name-policy.ts +13 -0
- package/src/context/scope.ts +8 -0
- package/src/context/source-directory.ts +11 -0
- package/src/context/source-file.ts +12 -0
- package/src/context.ts +53 -0
- package/src/index.ts +21 -0
- package/src/jsx-runtime.ts +266 -0
- package/src/name-policy.ts +13 -0
- package/src/refkey.ts +62 -0
- package/src/render.ts +389 -0
- package/src/utils.ts +288 -0
- package/temp/api.json +8840 -0
- package/test/children.test.tsx +33 -0
- package/test/components/source-file.test.tsx +45 -0
- package/test/name-policy.test.tsx +19 -0
- package/test/reactivity/ref-rendering.test.tsx +50 -0
- package/test/reactivity/test.test.tsx +83 -0
- package/test/refkey.test.ts +32 -0
- package/test/rendering/basic.test.tsx +156 -0
- package/test/rendering/code.test.tsx +62 -0
- package/test/rendering/indent.test.tsx +608 -0
- package/test/rendering/linebreaks.test.tsx +72 -0
- package/test/rendering/refkeys.test.tsx +35 -0
- package/test/stc.test.tsx +21 -0
- package/test/symbols.test.ts +406 -0
- package/test/utils.test.tsx +150 -0
- package/testing/extend-expect.ts +20 -0
- package/testing/index.ts +2 -0
- package/testing/render.ts +37 -0
- package/testing/vitest.d.ts +10 -0
- package/tsconfig.json +17 -0
- package/vitest.config.ts +18 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
// Much of the implementations in this file are inspired by vuerx-js
|
|
2
|
+
// See: https://github.com/ryansolid/vuerx-jsx.
|
|
3
|
+
import { pauseTracking, resetTracking, shallowRef, stop, effect as vueEffect } from "@vue/reactivity";
|
|
4
|
+
if (globalThis.ALLOY) {
|
|
5
|
+
throw new Error("Multiple versions of the JSX Runtime have been loaded. This will likely cause undesirable behavior.");
|
|
6
|
+
}
|
|
7
|
+
globalThis.ALLOY = true;
|
|
8
|
+
let globalContext = null;
|
|
9
|
+
export function getContext() {
|
|
10
|
+
return globalContext;
|
|
11
|
+
}
|
|
12
|
+
export function root(fn, src) {
|
|
13
|
+
globalContext = {
|
|
14
|
+
src,
|
|
15
|
+
disposables: [],
|
|
16
|
+
owner: globalContext,
|
|
17
|
+
context: {}
|
|
18
|
+
};
|
|
19
|
+
let ret;
|
|
20
|
+
try {
|
|
21
|
+
ret = untrack(() => fn(() => {
|
|
22
|
+
for (const d of globalContext.disposables) {
|
|
23
|
+
d();
|
|
24
|
+
}
|
|
25
|
+
}));
|
|
26
|
+
} finally {
|
|
27
|
+
globalContext = globalContext.owner;
|
|
28
|
+
}
|
|
29
|
+
return ret;
|
|
30
|
+
}
|
|
31
|
+
export function untrack(fn) {
|
|
32
|
+
pauseTracking();
|
|
33
|
+
const v = fn();
|
|
34
|
+
resetTracking();
|
|
35
|
+
return v;
|
|
36
|
+
}
|
|
37
|
+
export function memo(fn, equal) {
|
|
38
|
+
const o = shallowRef();
|
|
39
|
+
effect(prev => {
|
|
40
|
+
const res = fn();
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
42
|
+
(!equal || prev !== res) && (o.value = res);
|
|
43
|
+
return res;
|
|
44
|
+
});
|
|
45
|
+
return () => o.value;
|
|
46
|
+
}
|
|
47
|
+
export function effect(fn, current) {
|
|
48
|
+
const context = {
|
|
49
|
+
src: "effect",
|
|
50
|
+
context: {},
|
|
51
|
+
disposables: [],
|
|
52
|
+
owner: globalContext
|
|
53
|
+
};
|
|
54
|
+
const cleanupFn = final => {
|
|
55
|
+
const d = context.disposables;
|
|
56
|
+
context.disposables = [];
|
|
57
|
+
for (let k = 0, len = d.length; k < len; k++) d[k]();
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
59
|
+
final && stop(c);
|
|
60
|
+
};
|
|
61
|
+
const c = vueEffect(() => {
|
|
62
|
+
cleanupFn(false);
|
|
63
|
+
const oldContext = globalContext;
|
|
64
|
+
globalContext = context;
|
|
65
|
+
try {
|
|
66
|
+
current = fn(current);
|
|
67
|
+
} finally {
|
|
68
|
+
globalContext = oldContext;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
cleanup(() => cleanupFn(true));
|
|
72
|
+
}
|
|
73
|
+
function cleanup(fn) {
|
|
74
|
+
if (globalContext != null) {
|
|
75
|
+
globalContext.disposables.push(fn);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
// debugging utilities
|
|
79
|
+
const renderStack = [];
|
|
80
|
+
export const shouldDebug = !!process.env.ALLOY_DEBUG;
|
|
81
|
+
export function pushStack(component, props) {
|
|
82
|
+
if (!shouldDebug) return;
|
|
83
|
+
renderStack.push({
|
|
84
|
+
component,
|
|
85
|
+
props
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
export function popStack() {
|
|
89
|
+
if (!shouldDebug) return;
|
|
90
|
+
renderStack.pop();
|
|
91
|
+
}
|
|
92
|
+
export function printRenderStack() {
|
|
93
|
+
if (!shouldDebug) return;
|
|
94
|
+
|
|
95
|
+
// eslint-disable-next-line no-console
|
|
96
|
+
console.error("Error rendering:");
|
|
97
|
+
for (let i = renderStack.length - 1; i >= 0; i--) {
|
|
98
|
+
const {
|
|
99
|
+
component,
|
|
100
|
+
props
|
|
101
|
+
} = renderStack[i];
|
|
102
|
+
// eslint-disable-next-line no-console
|
|
103
|
+
console.error(` at ${component.name}(${inspectProps(props)})`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function inspectProps(props) {
|
|
107
|
+
return JSON.stringify(Object.fromEntries(Object.entries(props).map(([key, value]) => {
|
|
108
|
+
let safeValue;
|
|
109
|
+
switch (typeof value) {
|
|
110
|
+
case "string":
|
|
111
|
+
case "number":
|
|
112
|
+
case "boolean":
|
|
113
|
+
safeValue = value;
|
|
114
|
+
break;
|
|
115
|
+
case "undefined":
|
|
116
|
+
safeValue = "undefined";
|
|
117
|
+
break;
|
|
118
|
+
case "object":
|
|
119
|
+
safeValue = value ? "{...}" : null;
|
|
120
|
+
break;
|
|
121
|
+
case "function":
|
|
122
|
+
safeValue = "function";
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
return [key, safeValue];
|
|
126
|
+
})));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// These can be removed with a smarter transform that encodes the information we
|
|
130
|
+
// need in the compiled JSX output.
|
|
131
|
+
export function isComponentCreator(item) {
|
|
132
|
+
return typeof item === "function" && item.component;
|
|
133
|
+
}
|
|
134
|
+
export function createComponent(C, props) {
|
|
135
|
+
const creator = () => /* */C(props);
|
|
136
|
+
creator.props = props;
|
|
137
|
+
creator.component = C;
|
|
138
|
+
if (C.tag) {
|
|
139
|
+
creator.tag = C.tag;
|
|
140
|
+
}
|
|
141
|
+
return creator;
|
|
142
|
+
}
|
|
143
|
+
export function taggedComponent(tag, component) {
|
|
144
|
+
component.tag = tag;
|
|
145
|
+
return component;
|
|
146
|
+
}
|
|
147
|
+
export function mergeProps(...sources) {
|
|
148
|
+
const target = {};
|
|
149
|
+
for (let i = 0; i < sources.length; i++) {
|
|
150
|
+
let source = sources[i];
|
|
151
|
+
if (typeof source === "function") source = source();
|
|
152
|
+
if (source) {
|
|
153
|
+
const descriptors = Object.getOwnPropertyDescriptors(source);
|
|
154
|
+
for (const key in descriptors) {
|
|
155
|
+
if (key in target) continue;
|
|
156
|
+
Object.defineProperty(target, key, {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get() {
|
|
159
|
+
for (let i = sources.length - 1; i >= 0; i--) {
|
|
160
|
+
let s = sources[i];
|
|
161
|
+
if (typeof s === "function") s = s();
|
|
162
|
+
const v = (s || {})[key];
|
|
163
|
+
if (v !== undefined) return v;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return target;
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=jsx-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime.js","names":["pauseTracking","resetTracking","shallowRef","stop","effect","vueEffect","globalThis","ALLOY","Error","globalContext","getContext","root","fn","src","disposables","owner","context","ret","untrack","d","v","memo","equal","o","prev","res","value","current","cleanupFn","final","k","len","length","c","oldContext","cleanup","push","renderStack","shouldDebug","process","env","ALLOY_DEBUG","pushStack","component","props","popStack","pop","printRenderStack","console","error","i","name","inspectProps","JSON","stringify","Object","fromEntries","entries","map","key","safeValue","isComponentCreator","item","createComponent","C","creator","tag","taggedComponent","mergeProps","sources","target","source","descriptors","getOwnPropertyDescriptors","defineProperty","enumerable","get","s","undefined"],"sources":["../../src/jsx-runtime.ts"],"sourcesContent":[null],"mappings":"AAAA;AACA;AACA,SACEA,aAAa,EAEbC,aAAa,EACbC,UAAU,EACVC,IAAI,EACJC,MAAM,IAAIC,SAAS,QACd,iBAAiB;AAGxB,IAAKC,UAAU,CAASC,KAAK,EAAE;EAC7B,MAAM,IAAIC,KAAK,CACb,qGACF,CAAC;AACH;AACCF,UAAU,CAASC,KAAK,GAAG,IAAI;AAiBhC,IAAIE,aAA6B,GAAG,IAAI;AACxC,OAAO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,MAAMzD,CAAC,GAAG,CAACyD,CAAC,IAAI,CAAC,CAAC,EAAElB,GAAG,CAAC;cACxB,IAAIvC,CAAC,KAAK0D,SAAS,EAAE,OAAO1D,CAAC;YAC/B;UACF;QACF,CAAC,CAAC;MACJ;IACF;EACF;EACA,OAAOkD,MAAM;AACf","ignoreList":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export interface NamePolicy<TElements extends string> {
|
|
2
|
+
getName(originalName: string, element: TElements): string;
|
|
3
|
+
}
|
|
4
|
+
export declare function createNamePolicy<T extends string>(namer: (name: string, elements: T) => string): NamePolicy<T>;
|
|
5
|
+
//# sourceMappingURL=name-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"name-policy.d.ts","sourceRoot":"","sources":["../../src/name-policy.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU,CAAC,SAAS,SAAS,MAAM;IAClD,OAAO,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,GAAG,MAAM,CAAC;CAC3D;AAED,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAC/C,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,MAAM,GAC3C,UAAU,CAAC,CAAC,CAAC,CAMf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"name-policy.js","names":["createNamePolicy","namer","getName","name","element"],"sources":["../../src/name-policy.ts"],"sourcesContent":[null],"mappings":"AAIA,OAAO,SAASA,gBAAgBA,CAC9BC,KAA4C,EAC7B;EACf,OAAO;IACLC,OAAOA,CAACC,IAAI,EAAEC,OAAO,EAAE;MACrB,OAAOH,KAAK,CAACE,IAAI,EAAEC,OAAO,CAAC;IAC7B;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const RefkeySym: unique symbol;
|
|
2
|
+
export type Refkey = {
|
|
3
|
+
key: string;
|
|
4
|
+
[RefkeySym]: true;
|
|
5
|
+
};
|
|
6
|
+
export declare function isRefkey(value: unknown): value is Refkey;
|
|
7
|
+
export declare function refkey(...args: unknown[]): Refkey;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=refkey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refkey.d.ts","sourceRoot":"","sources":["../../src/refkey.ts"],"names":[],"mappings":"AAgBA,QAAA,MAAM,SAAS,EAAE,OAAO,MAAiB,CAAC;AAE1C,MAAM,MAAM,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,CAAC,SAAS,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAaxD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAMxD;AAaD,wBAAgB,MAAM,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAWjD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { markRaw } from "@vue/reactivity";
|
|
2
|
+
const objectIds = new WeakMap();
|
|
3
|
+
let objId = 0;
|
|
4
|
+
function getObjectKey(value) {
|
|
5
|
+
if (objectIds.has(value)) {
|
|
6
|
+
return objectIds.get(value);
|
|
7
|
+
}
|
|
8
|
+
const key = createRefkey(`o${objId++}`);
|
|
9
|
+
objectIds.set(value, key);
|
|
10
|
+
return key;
|
|
11
|
+
}
|
|
12
|
+
const RefkeySym = Symbol();
|
|
13
|
+
function createRefkey(key) {
|
|
14
|
+
const refkey = {
|
|
15
|
+
key,
|
|
16
|
+
[RefkeySym]: true
|
|
17
|
+
};
|
|
18
|
+
markRaw(refkey);
|
|
19
|
+
return refkey;
|
|
20
|
+
}
|
|
21
|
+
export function isRefkey(value) {
|
|
22
|
+
return typeof value === "object" && value !== null && Object.hasOwn(value, RefkeySym);
|
|
23
|
+
}
|
|
24
|
+
function getKey(value) {
|
|
25
|
+
if (isRefkey(value)) {
|
|
26
|
+
return value;
|
|
27
|
+
} else if (typeof value === "object" && value !== null) {
|
|
28
|
+
return getObjectKey(value);
|
|
29
|
+
} else {
|
|
30
|
+
return createRefkey(`s${String(value)}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const knownRefkeys = new Map();
|
|
34
|
+
export function refkey(...args) {
|
|
35
|
+
const keys = args.length === 0 ? [getKey({})] : args.map(v => getKey(v));
|
|
36
|
+
const compositeKey = keys.map(v => v.key).join("\u2063");
|
|
37
|
+
if (knownRefkeys.has(compositeKey)) {
|
|
38
|
+
return knownRefkeys.get(compositeKey);
|
|
39
|
+
}
|
|
40
|
+
const key = createRefkey(compositeKey);
|
|
41
|
+
knownRefkeys.set(compositeKey, key);
|
|
42
|
+
return key;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=refkey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refkey.js","names":["markRaw","objectIds","WeakMap","objId","getObjectKey","value","has","get","key","createRefkey","set","RefkeySym","Symbol","refkey","isRefkey","Object","hasOwn","getKey","String","knownRefkeys","Map","args","keys","length","map","v","compositeKey","join"],"sources":["../../src/refkey.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,OAAO,QAAQ,iBAAiB;AAEzC,MAAMC,SAAS,GAAG,IAAIC,OAAO,CAAkB,CAAC;AAChD,IAAIC,KAAK,GAAG,CAAC;AAEb,SAASC,YAAYA,CAACC,KAAc,EAAE;EACpC,IAAIJ,SAAS,CAACK,GAAG,CAACD,KAAK,CAAC,EAAE;IACxB,OAAOJ,SAAS,CAACM,GAAG,CAACF,KAAK,CAAC;EAC7B;EAEA,MAAMG,GAAG,GAAGC,YAAY,CAAC,IAAIN,KAAK,EAAE,EAAE,CAAC;EACvCF,SAAS,CAACS,GAAG,CAACL,KAAK,EAAEG,GAAG,CAAC;EAEzB,OAAOA,GAAG;AACZ;AAEA,MAAMG,SAAwB,GAAGC,MAAM,CAAC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AY,CAAC;EACtCP,YAAY,CAACT,GAAG,CAACgB,YAAY,EAAElB,GAAG,CAAC;EACnC,OAAOA,GAAG;AACZ","ignoreList":[]}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { Children, Context } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* The component tree is constructed as the result of transforming JSX with
|
|
4
|
+
* `@alloy-js/babel-preset`. Elements in the component tree (represented by the type
|
|
5
|
+
* Children) are three distinct types of things:
|
|
6
|
+
*
|
|
7
|
+
* 1. Primitive data types, which are either literal JSX or substitutions
|
|
8
|
+
* 2. Components, which are created via `createComponent`
|
|
9
|
+
* 3. Memos, which are created via `memo`, and represent substitutions like
|
|
10
|
+
* property accesses and function calls that might be reactive.
|
|
11
|
+
*
|
|
12
|
+
* This tree is then compiled into a render tree, which is a normalized form of
|
|
13
|
+
* the component tree. The render tree is constructed by traversing the
|
|
14
|
+
* component tree, invoking components, wrapping memos, doing whitespace
|
|
15
|
+
* normalization, and other activities. There are four types of nodes in the
|
|
16
|
+
* render tree.
|
|
17
|
+
*
|
|
18
|
+
* 1. Strings, which are either literal JSX or substitutions. Other primitive
|
|
19
|
+
* types are either converted to the empty string or stringified as
|
|
20
|
+
* appropriate.
|
|
21
|
+
* 2. Components, which are possibly wrapped if they are indented.
|
|
22
|
+
* 3. Memos, which are wrapped in a reactive effect which updates its render
|
|
23
|
+
* tree nodes when its value changes.
|
|
24
|
+
* 4. Arrays of these things.
|
|
25
|
+
*
|
|
26
|
+
* The render tree is whitespace normalized and indentation preserving. When the
|
|
27
|
+
* component increases the literal indent level and then embeds a component,
|
|
28
|
+
* memo, or array, the contents of that substitution are indented appropriately.
|
|
29
|
+
* This is accomplished by wrapping those substitutions in an indent component.
|
|
30
|
+
*
|
|
31
|
+
* So the high level process for rendering while normalizing whitespace is as
|
|
32
|
+
* follows:
|
|
33
|
+
*
|
|
34
|
+
* 1. For an array of elements in the render tree (which may be a component or
|
|
35
|
+
* array of elements):
|
|
36
|
+
* 1. Normalize all primitive values other than strings to strings.
|
|
37
|
+
* Recursively normalize nested array elements.
|
|
38
|
+
* 2. Use the first text node to determine the literal indent level of the
|
|
39
|
+
* children. Remove all preceding whitespace - any indent of the first
|
|
40
|
+
* line is provided in the text nodes preceding the reference to this
|
|
41
|
+
* component. If the first element is not a literal string, then no
|
|
42
|
+
* literal indent is applied, and all indentation within the component
|
|
43
|
+
* becomes significant.
|
|
44
|
+
* 3. For each child of the component, render it:
|
|
45
|
+
* 1. If it is a string, reindent it by splitting on lines and replacing
|
|
46
|
+
* the detected literal whitespace with the current indent level,
|
|
47
|
+
* skipping the first line. If the string ends with a larger literal
|
|
48
|
+
* indent than the detected literal indent, then a subsequent child
|
|
49
|
+
* will be indented.
|
|
50
|
+
* 2. If it's a component, if the next child should be indented, create an
|
|
51
|
+
* Indent component and wrap the component's children in it.
|
|
52
|
+
* 3. If it's a function, if the next child should be indented, wrap it in
|
|
53
|
+
* an indent component. Any elements processed as a result of executing
|
|
54
|
+
* the memo are treated as first elements in a child array are with
|
|
55
|
+
* respect to establishing literal indent level and whitespace trimming
|
|
56
|
+
* behavior.
|
|
57
|
+
* 4. If it's an array, if the next child should be indented, create an
|
|
58
|
+
* Indent component and wrap it the array in it.
|
|
59
|
+
*
|
|
60
|
+
* Let's look at a few examples of each of these phases:
|
|
61
|
+
*
|
|
62
|
+
* ## Explicit indentation
|
|
63
|
+
*
|
|
64
|
+
* ### Input
|
|
65
|
+
* ```
|
|
66
|
+
* <Indent>
|
|
67
|
+
* <Foo />
|
|
68
|
+
* <Foo />
|
|
69
|
+
* </Indent>
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* ### Compiled tree
|
|
73
|
+
* ```
|
|
74
|
+
* [
|
|
75
|
+
* createComponent(Indent, {
|
|
76
|
+
* get children() {
|
|
77
|
+
* return [
|
|
78
|
+
* "\n ",
|
|
79
|
+
* createComponent(Foo, {}),
|
|
80
|
+
* "\n ",
|
|
81
|
+
* createComponent(Foo, {}),
|
|
82
|
+
* "\n"
|
|
83
|
+
* ]
|
|
84
|
+
* }
|
|
85
|
+
* })
|
|
86
|
+
* ]
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* ### Render tree
|
|
90
|
+
* ```
|
|
91
|
+
* [ // node for Indent
|
|
92
|
+
* [ // node for Context Provider
|
|
93
|
+
* " ", // indent from the children of Indent
|
|
94
|
+
* [ // component for Foo
|
|
95
|
+
* "Foo" // result of calling Foo
|
|
96
|
+
* ],
|
|
97
|
+
* "\n ", // indent and line break from the children of Ident
|
|
98
|
+
* [ "Foo" ] // second foo component
|
|
99
|
+
* ]
|
|
100
|
+
* ]
|
|
101
|
+
* ```
|
|
102
|
+
* ### Rendered text
|
|
103
|
+
* ```
|
|
104
|
+
* FooFoo
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* ## Implicit indentation
|
|
108
|
+
*
|
|
109
|
+
* ### Input
|
|
110
|
+
* ```
|
|
111
|
+
* <>
|
|
112
|
+
* base
|
|
113
|
+
* <Foo /> <Foo />
|
|
114
|
+
* </>
|
|
115
|
+
* ```
|
|
116
|
+
*
|
|
117
|
+
* ### Render tree
|
|
118
|
+
* ```
|
|
119
|
+
* [ // node for top-level fragment
|
|
120
|
+
* "base\n ", // contents of fragment, including trailing indent
|
|
121
|
+
* [ // node for implicitly created Indent component
|
|
122
|
+
* [ // node for its context provider [ "Foo" ], // contents of Foo "\n"
|
|
123
|
+
* ]
|
|
124
|
+
* ```
|
|
125
|
+
* ## Rendered text
|
|
126
|
+
* ```
|
|
127
|
+
* base
|
|
128
|
+
* Foo Foo
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
export interface OutputDirectory {
|
|
132
|
+
kind: "directory";
|
|
133
|
+
path: string;
|
|
134
|
+
contents: (OutputDirectory | OutputFile)[];
|
|
135
|
+
}
|
|
136
|
+
export interface OutputFile {
|
|
137
|
+
kind: "file";
|
|
138
|
+
contents: string;
|
|
139
|
+
path: string;
|
|
140
|
+
filetype: string;
|
|
141
|
+
}
|
|
142
|
+
export declare function getContextForRenderNode(node: RenderTextTree): Context | undefined;
|
|
143
|
+
export type RenderStructure = {};
|
|
144
|
+
export type RenderTextTree = (string | RenderTextTree)[];
|
|
145
|
+
export declare function render(children: Children): OutputDirectory;
|
|
146
|
+
export declare function renderTree(children: Children): RenderTextTree;
|
|
147
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/render.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,OAAO,EASR,MAAM,4BAA4B,CAAC;AAQpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgIG;AAGH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,CAAC,eAAe,GAAG,UAAU,CAAC,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAID,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,cAAc,uBAE3D;AACD,MAAM,MAAM,eAAe,GAAG,EAAE,CAAC;AAEjC,MAAM,MAAM,cAAc,GAAG,CAAC,MAAM,GAAG,cAAc,CAAC,EAAE,CAAC;AAOzD,wBAAgB,MAAM,CAAC,QAAQ,EAAE,QAAQ,GAAG,eAAe,CAgE1D;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,kBAe5C"}
|