@atom.io/spa 0.0.7 → 0.0.9

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 (152) hide show
  1. package/README.md +169 -25
  2. package/README.mdx +62 -15
  3. package/dist/astro-application.d.ts +1 -1
  4. package/dist/astro-client.d.ts +1 -1
  5. package/dist/astro-client.d.ts.map +1 -1
  6. package/dist/astro-client.js +5 -4
  7. package/dist/astro-client.js.map +1 -1
  8. package/dist/astro-resumability-client.d.ts +1 -1
  9. package/dist/astro-server.js +4 -4
  10. package/dist/astro-server.js.map +1 -1
  11. package/dist/{astro-shared-83hxw7-M.js → astro-shared-DBwINQav.js} +2 -2
  12. package/dist/{astro-shared-83hxw7-M.js.map → astro-shared-DBwINQav.js.map} +1 -1
  13. package/dist/{astro-shared-DZp1x8RQ.d.ts → astro-shared-KxK9OUSj.d.ts} +2 -2
  14. package/dist/{astro-shared-DZp1x8RQ.d.ts.map → astro-shared-KxK9OUSj.d.ts.map} +1 -1
  15. package/dist/astro.d.ts +1 -1
  16. package/dist/astro.js +1 -1
  17. package/dist/{capabilities-DNcnGRv_.d.ts → capabilities-ChgSs6bp.d.ts} +34 -6
  18. package/dist/capabilities-ChgSs6bp.d.ts.map +1 -0
  19. package/dist/client.min.js +1 -1
  20. package/dist/core-DD2giR6E.js +451 -0
  21. package/dist/core-DD2giR6E.js.map +1 -0
  22. package/dist/development/astro-client.js +5 -4
  23. package/dist/development/astro-client.js.map +1 -1
  24. package/dist/development/astro-server.js +4 -4
  25. package/dist/development/astro-server.js.map +1 -1
  26. package/dist/development/{astro-shared-83hxw7-M.js → astro-shared-DBwINQav.js} +2 -2
  27. package/dist/development/{astro-shared-83hxw7-M.js.map → astro-shared-DBwINQav.js.map} +1 -1
  28. package/dist/development/astro.js +1 -1
  29. package/dist/development/core-DrUd8x25.js +465 -0
  30. package/dist/development/core-DrUd8x25.js.map +1 -0
  31. package/dist/development/{dom-DQ0M3rLL.js → dom-BRFv7FP_.js} +150 -35
  32. package/dist/development/dom-BRFv7FP_.js.map +1 -0
  33. package/dist/development/floating.js +2 -6
  34. package/dist/development/floating.js.map +1 -1
  35. package/dist/development/hot.js +164 -0
  36. package/dist/development/hot.js.map +1 -0
  37. package/dist/development/identity-DwB8MTM1.js +121 -0
  38. package/dist/development/identity-DwB8MTM1.js.map +1 -0
  39. package/dist/development/index.js +5 -5
  40. package/dist/development/jsx-runtime-BGDPK50B.js +49 -0
  41. package/dist/development/jsx-runtime-BGDPK50B.js.map +1 -0
  42. package/dist/development/jsx-runtime.js +1 -25
  43. package/dist/development/konva.js +12 -5
  44. package/dist/development/konva.js.map +1 -1
  45. package/dist/development/motion.js +4 -21
  46. package/dist/development/motion.js.map +1 -1
  47. package/dist/development/renderer.js +41 -40
  48. package/dist/development/renderer.js.map +1 -1
  49. package/dist/development/{server-renderer-DCLoMdOX.js → server-renderer-u1-c5PGd.js} +8 -18
  50. package/dist/development/server-renderer-u1-c5PGd.js.map +1 -0
  51. package/dist/development/server.js +1 -1
  52. package/dist/{src-Bme1kz2b.js → development/src-CB7ruwRs.js} +3 -3
  53. package/dist/development/src-CB7ruwRs.js.map +1 -0
  54. package/dist/development/three.js +20 -19
  55. package/dist/development/three.js.map +1 -1
  56. package/dist/development/vite-WUiz1ju6.js +545 -0
  57. package/dist/development/vite-WUiz1ju6.js.map +1 -0
  58. package/dist/development/vite.js +1 -1
  59. package/dist/{dom-D8g3roX9.js → dom--HZvmgqd.js} +139 -32
  60. package/dist/dom--HZvmgqd.js.map +1 -0
  61. package/dist/floating.d.ts +1 -1
  62. package/dist/floating.d.ts.map +1 -1
  63. package/dist/floating.js +2 -6
  64. package/dist/floating.js.map +1 -1
  65. package/dist/hot.d.ts +15 -0
  66. package/dist/hot.d.ts.map +1 -0
  67. package/dist/hot.js +19 -0
  68. package/dist/hot.js.map +1 -0
  69. package/dist/identity-oFU5p-Qj.js +121 -0
  70. package/dist/identity-oFU5p-Qj.js.map +1 -0
  71. package/dist/{index-BFnXIfOj.d.ts → index-DdA39aMv.d.ts} +4 -4
  72. package/dist/{index-BFnXIfOj.d.ts.map → index-DdA39aMv.d.ts.map} +1 -1
  73. package/dist/index.d.ts +4 -4
  74. package/dist/index.js +5 -5
  75. package/dist/jsx-runtime-BGDPK50B.js +49 -0
  76. package/dist/jsx-runtime-BGDPK50B.js.map +1 -0
  77. package/dist/{jsx-runtime-DQnpyT_g.d.ts → jsx-runtime-CCvcEosg.d.ts} +14 -9
  78. package/dist/jsx-runtime-CCvcEosg.d.ts.map +1 -0
  79. package/dist/jsx-runtime.d.ts +1 -1
  80. package/dist/jsx-runtime.js +1 -25
  81. package/dist/konva.d.ts +46 -9
  82. package/dist/konva.d.ts.map +1 -1
  83. package/dist/konva.js +12 -5
  84. package/dist/konva.js.map +1 -1
  85. package/dist/motion.d.ts +1 -1
  86. package/dist/motion.js +4 -21
  87. package/dist/motion.js.map +1 -1
  88. package/dist/renderer.d.ts +1 -1
  89. package/dist/renderer.d.ts.map +1 -1
  90. package/dist/renderer.js +39 -40
  91. package/dist/renderer.js.map +1 -1
  92. package/dist/{server-renderer-D0rsFL_-.js → server-renderer-BYFDmqnM.js} +8 -18
  93. package/dist/server-renderer-BYFDmqnM.js.map +1 -0
  94. package/dist/server.d.ts +1 -1
  95. package/dist/server.js +1 -1
  96. package/dist/size.json +12 -12
  97. package/dist/{development/src-DoQgCX-O.js → src-B2W_TA_X.js} +3 -3
  98. package/dist/src-B2W_TA_X.js.map +1 -0
  99. package/dist/three.d.ts +3 -3
  100. package/dist/three.d.ts.map +1 -1
  101. package/dist/three.js +20 -19
  102. package/dist/three.js.map +1 -1
  103. package/dist/vite-WUiz1ju6.js +545 -0
  104. package/dist/vite-WUiz1ju6.js.map +1 -0
  105. package/dist/vite.d.ts.map +1 -1
  106. package/dist/vite.js +1 -1
  107. package/package.json +16 -9
  108. package/src/astro-client.ts +3 -2
  109. package/src/astro-server.ts +2 -2
  110. package/src/capabilities.ts +48 -21
  111. package/src/compiler-hmr.ts +297 -0
  112. package/src/compiler.ts +127 -25
  113. package/src/core.ts +282 -33
  114. package/src/dom-forms.ts +127 -0
  115. package/src/dom.ts +116 -52
  116. package/src/floating.ts +2 -6
  117. package/src/hot.ts +190 -0
  118. package/src/identity.ts +39 -0
  119. package/src/index.ts +2 -0
  120. package/src/jsx-runtime.ts +6 -26
  121. package/src/jsx-types.d.ts +8 -3
  122. package/src/konva.ts +66 -10
  123. package/src/motion.ts +3 -1
  124. package/src/presence.ts +11 -23
  125. package/src/props.ts +55 -0
  126. package/src/renderer.ts +91 -71
  127. package/src/server-renderer.ts +18 -13
  128. package/src/three.ts +23 -24
  129. package/src/use-loadable.ts +2 -2
  130. package/src/vite.ts +44 -4
  131. package/dist/capabilities-DNcnGRv_.d.ts.map +0 -1
  132. package/dist/capabilities-nOIitQ-_.js +0 -65
  133. package/dist/capabilities-nOIitQ-_.js.map +0 -1
  134. package/dist/core-B4rJ0xdc.js +0 -268
  135. package/dist/core-B4rJ0xdc.js.map +0 -1
  136. package/dist/development/capabilities-nOIitQ-_.js +0 -65
  137. package/dist/development/capabilities-nOIitQ-_.js.map +0 -1
  138. package/dist/development/core-BHA7I1nf.js +0 -271
  139. package/dist/development/core-BHA7I1nf.js.map +0 -1
  140. package/dist/development/dom-DQ0M3rLL.js.map +0 -1
  141. package/dist/development/jsx-runtime.js.map +0 -1
  142. package/dist/development/server-renderer-DCLoMdOX.js.map +0 -1
  143. package/dist/development/src-DoQgCX-O.js.map +0 -1
  144. package/dist/development/vite-Bmyb6P5w.js +0 -265
  145. package/dist/development/vite-Bmyb6P5w.js.map +0 -1
  146. package/dist/dom-D8g3roX9.js.map +0 -1
  147. package/dist/jsx-runtime-DQnpyT_g.d.ts.map +0 -1
  148. package/dist/jsx-runtime.js.map +0 -1
  149. package/dist/server-renderer-D0rsFL_-.js.map +0 -1
  150. package/dist/src-Bme1kz2b.js.map +0 -1
  151. package/dist/vite-Bmyb6P5w.js +0 -265
  152. package/dist/vite-Bmyb6P5w.js.map +0 -1
@@ -0,0 +1,545 @@
1
+ import { decode } from "html-entities";
2
+ import MagicString from "magic-string";
3
+ import { parseSync, visitorKeys } from "oxc-parser";
4
+ import remapping from "@jridgewell/remapping";
5
+ // src/compiler.ts
6
+ const decodeJsx = (value) => decode(value, {
7
+ level: `html4`,
8
+ scope: `strict`
9
+ });
10
+ /** Match JSX's multiline whitespace rules without reprinting JavaScript. */
11
+ function text(value) {
12
+ const lines = value.split(/\r\n|\n|\r/);
13
+ let last = 0;
14
+ for (let i = 0; i < lines.length; i++) if (/[^ \t]/.test(lines[i])) last = i;
15
+ return lines.map((line, i) => {
16
+ line = line.replace(/\t/g, ` `);
17
+ if (i > 0) line = line.replace(/^ +/, ``);
18
+ if (i < lines.length - 1) line = line.replace(/ +$/, ``);
19
+ return line && i < last ? `${line} ` : line;
20
+ }).join(``);
21
+ }
22
+ function eager(node, allowJsx = false) {
23
+ if (node.type === `ParenthesizedExpression`) return eager(node.expression, allowJsx);
24
+ return node.type === `Literal` || node.type === `FunctionExpression` || node.type === `ArrowFunctionExpression` || allowJsx && (node.type === `JSXElement` || node.type === `JSXFragment`) || node.type === `TemplateLiteral` && node.expressions.length === 0;
25
+ }
26
+ function containsSuspension(node) {
27
+ if (isFunction(node)) return false;
28
+ if (node.type === `AwaitExpression` || node.type === `YieldExpression`) return true;
29
+ return visitorKeys[node.type].some((key) => {
30
+ const value = node[key];
31
+ return Array.isArray(value) ? value.some((child) => child && containsSuspension(child)) : Boolean(value && containsSuspension(value));
32
+ });
33
+ }
34
+ function isFunction(node) {
35
+ return node.type === `FunctionDeclaration` || node.type === `FunctionExpression` || node.type === `ArrowFunctionExpression`;
36
+ }
37
+ function compile(code, filename) {
38
+ const parsed = parseSync(filename, code, {
39
+ lang: `tsx`,
40
+ preserveParens: true
41
+ });
42
+ if (parsed.errors.length) {
43
+ const error = parsed.errors[0];
44
+ throw new SyntaxError([`${filename}: ${error.message}`, error.codeframe].filter(Boolean).join(`\n`));
45
+ }
46
+ const output = new MagicString(code);
47
+ const parents = /* @__PURE__ */ new WeakMap();
48
+ const identifiers = /* @__PURE__ */ new Set();
49
+ const elements = [];
50
+ const receivers = [];
51
+ const functions = /* @__PURE__ */ new Set();
52
+ function walk(node, parent, outerFunction) {
53
+ if (parent) parents.set(node, parent);
54
+ output.addSourcemapLocation(node.start);
55
+ output.addSourcemapLocation(node.end);
56
+ if (node.type === `Identifier` || node.type === `JSXIdentifier`) identifiers.add(node.name);
57
+ if (!outerFunction && isFunction(node)) outerFunction = node;
58
+ if (node.type === `ThisExpression` || node.type === `JSXIdentifier` && node.name === `this` && (parent?.type === `JSXMemberExpression` && parent.object === node || parent?.type === `JSXOpeningElement` && parent.name === node)) receivers.push(node);
59
+ if (node.type === `JSXElement` || node.type === `JSXFragment`) {
60
+ elements.push(node);
61
+ if (outerFunction) functions.add(outerFunction);
62
+ }
63
+ for (const key of visitorKeys[node.type]) {
64
+ const value = node[key];
65
+ if (Array.isArray(value)) {
66
+ for (const child of value) if (child) walk(child, node, outerFunction);
67
+ } else if (value) walk(value, node, outerFunction);
68
+ }
69
+ }
70
+ walk(parsed.program);
71
+ function uid(base) {
72
+ let name = `_${base}`;
73
+ let suffix = 1;
74
+ while (identifiers.has(name)) name = `_${base}${++suffix}`;
75
+ identifiers.add(name);
76
+ return name;
77
+ }
78
+ const create = uid(`spa`);
79
+ const merge = uid(`props`);
80
+ const captures = /* @__PURE__ */ new Map();
81
+ const tagReceivers = /* @__PURE__ */ new WeakMap();
82
+ for (const reference of receivers) {
83
+ let root;
84
+ let ancestor = parents.get(reference);
85
+ while (ancestor && (!isFunction(ancestor) || ancestor.type === `ArrowFunctionExpression`)) {
86
+ if (ancestor.type === `JSXElement` || ancestor.type === `JSXFragment`) root = ancestor;
87
+ ancestor = parents.get(ancestor);
88
+ }
89
+ if (!root) continue;
90
+ let scope = parents.get(root);
91
+ while (scope && !isFunction(scope)) scope = parents.get(scope);
92
+ if (scope && root.start < scope.body.start) scope = void 0;
93
+ const enclosing = scope ?? root;
94
+ let capture = captures.get(enclosing);
95
+ if (!capture) {
96
+ capture = {
97
+ name: uid(`self$`),
98
+ scope,
99
+ root
100
+ };
101
+ captures.set(enclosing, capture);
102
+ }
103
+ if (reference.type === `ThisExpression`) output.update(reference.start, reference.end, capture.name);
104
+ else tagReceivers.set(reference, capture.name);
105
+ }
106
+ const join = (parts, separator) => parts.flatMap((part, i) => i ? [separator, ...part] : part);
107
+ const expression = (node) => eager(node, true) ? [
108
+ `(`,
109
+ node,
110
+ `)`
111
+ ] : [
112
+ `() => (`,
113
+ node,
114
+ `)`
115
+ ];
116
+ function tag(node) {
117
+ if (node.type === `JSXNamespacedName`) return JSON.stringify(`${node.namespace.name}:${node.name.name}`);
118
+ if (node.type === `JSXMemberExpression`) {
119
+ let root = node.object;
120
+ while (root.type === `JSXMemberExpression`) root = root.object;
121
+ return (tagReceivers.get(root) ?? root.name) + code.slice(root.end, node.end);
122
+ }
123
+ if (tagReceivers.has(node)) return tagReceivers.get(node);
124
+ return /^[a-z]/.test(node.name) || node.name.includes(`-`) ? JSON.stringify(node.name) : node.name;
125
+ }
126
+ function checkAttribute(node, name) {
127
+ if (containsSuspension(node)) throw new SyntaxError(`${filename}: JSX attribute ${JSON.stringify(name)} cannot contain await or yield outside a nested function`);
128
+ }
129
+ /** Rewrite syntax around untouched expression spans, including nested JSX. */
130
+ function rewrite(node, parts) {
131
+ let cursor = node.start;
132
+ let replacement = ``;
133
+ for (const part of parts) {
134
+ if (typeof part === `string`) {
135
+ replacement += part;
136
+ continue;
137
+ }
138
+ if (cursor < part.start) output.update(cursor, part.start, replacement);
139
+ else output.appendLeft(cursor, replacement);
140
+ cursor = part.end;
141
+ replacement = ``;
142
+ }
143
+ output.update(cursor, node.end, replacement);
144
+ }
145
+ for (const node of elements) {
146
+ const chunks = [];
147
+ let properties = [];
148
+ const flush = () => {
149
+ if (properties.length) chunks.push([
150
+ `{`,
151
+ ...join(properties, `, `),
152
+ `}`
153
+ ]);
154
+ properties = [];
155
+ };
156
+ if (node.type === `JSXElement`) for (const attribute of node.openingElement.attributes) {
157
+ if (attribute.type === `JSXSpreadAttribute`) {
158
+ checkAttribute(attribute.argument, `spread`);
159
+ flush();
160
+ chunks.push([
161
+ `() => (`,
162
+ attribute.argument,
163
+ `)`
164
+ ]);
165
+ continue;
166
+ }
167
+ const attributeName = attribute.name.type === `JSXNamespacedName` ? `${attribute.name.namespace.name}:${attribute.name.name.name}` : attribute.name.name;
168
+ const key = JSON.stringify(attributeName);
169
+ const value = attribute.value;
170
+ if (!value) properties.push([`${key}: true`]);
171
+ else if (value.type === `Literal`) properties.push([`${key}: ${JSON.stringify(decodeJsx(value.value))}`]);
172
+ else {
173
+ const expr = value.type === `JSXExpressionContainer` ? value.expression : value;
174
+ checkAttribute(expr, attributeName);
175
+ properties.push(eager(expr) ? [
176
+ `${key}: (`,
177
+ expr,
178
+ `)`
179
+ ] : [
180
+ `get ${key}(){ return (`,
181
+ expr,
182
+ `); }`
183
+ ]);
184
+ }
185
+ }
186
+ const component = node.type === `JSXElement` && !tag(node.openingElement.name).startsWith(`"`);
187
+ const children = [];
188
+ let lazyChildren = false;
189
+ for (const child of node.children) if (child.type === `JSXText`) {
190
+ const value = text(decodeJsx(child.value));
191
+ if (value) children.push([JSON.stringify(value)]);
192
+ } else if (child.type === `JSXElement` || child.type === `JSXFragment`) children.push([child]);
193
+ else if (child.type === `JSXExpressionContainer`) {
194
+ if (child.expression.type !== `JSXEmptyExpression`) {
195
+ checkAttribute(child.expression, `children`);
196
+ if (component) {
197
+ children.push([
198
+ `(`,
199
+ child.expression,
200
+ `)`
201
+ ]);
202
+ if (!eager(child.expression, true)) lazyChildren = true;
203
+ } else children.push(expression(child.expression));
204
+ }
205
+ } else throw new SyntaxError(`${filename}: JSX spread children are unsupported`);
206
+ if (children.length) {
207
+ const value = children.length === 1 ? children[0] : [
208
+ `[`,
209
+ ...join(children, `, `),
210
+ `]`
211
+ ];
212
+ properties.push(lazyChildren ? [
213
+ `get children(){ return (`,
214
+ ...value,
215
+ `); }`
216
+ ] : [`children: `, ...value]);
217
+ }
218
+ flush();
219
+ const props = node.type === `JSXElement` && node.openingElement.attributes.some((attr) => attr.type === `JSXSpreadAttribute`) ? [
220
+ `${merge}(`,
221
+ ...join(chunks, `, `),
222
+ `)`
223
+ ] : chunks[0] ?? [`{}`];
224
+ const capture = captures.get(node);
225
+ rewrite(node, [
226
+ capture ? `(() => { const ${capture.name} = this; return ` : ``,
227
+ `${create}(${node.type === `JSXElement` ? tag(node.openingElement.name) : `null`}, `,
228
+ ...props,
229
+ `)`,
230
+ capture ? `; })()` : ``
231
+ ]);
232
+ }
233
+ for (const { name, scope, root } of captures.values()) {
234
+ if (!scope) continue;
235
+ const body = scope.body;
236
+ if (body.type !== `BlockStatement`) {
237
+ output.prependLeft(body.start, `{ const ${name} = this; return `);
238
+ output.appendLeft(body.end, `; }`);
239
+ continue;
240
+ }
241
+ let position = body.start + 1;
242
+ if (parents.get(scope)?.type === `MethodDefinition`) {
243
+ let statement = root;
244
+ while (parents.get(statement) !== body) statement = parents.get(statement);
245
+ position = statement.start;
246
+ } else for (const statement of body.body) {
247
+ if (statement.type !== `ExpressionStatement` || !statement.directive) break;
248
+ position = statement.end;
249
+ }
250
+ output.prependLeft(position, `\nconst ${name} = this;\n`);
251
+ }
252
+ const components = /* @__PURE__ */ new Set();
253
+ for (const fn of functions) {
254
+ let node = fn;
255
+ let parent = parents.get(node);
256
+ while (parent?.type === `ParenthesizedExpression`) {
257
+ node = parent;
258
+ parent = parents.get(node);
259
+ }
260
+ if (fn.type === `FunctionDeclaration` && fn.id) components.add(fn.id.name);
261
+ else if (parent?.type === `VariableDeclarator` && parent.id.type === `Identifier`) components.add(parent.id.name);
262
+ else if (parent?.type === `ExportDefaultDeclaration`) {
263
+ const name = uid(`Component`);
264
+ if (fn.type === `FunctionDeclaration`) {
265
+ const token = [...code.slice(fn.start, fn.body.start).matchAll(/\/\*[\s\S]*?\*\/|\/\/[^\r\n]*|\bfunction\b|\*/g)].find((match) => match[0] === (fn.generator ? `*` : `function`));
266
+ output.appendLeft(fn.start + token.index + token[0].length, ` ${name}`);
267
+ } else {
268
+ const prefix = code.slice(parent.start, node.start);
269
+ for (const token of prefix.matchAll(/\/\*[\s\S]*?\*\/|\/\/[^\r\n]*|\b(?:export|default)\b/g)) {
270
+ if (token[0] !== `export` && token[0] !== `default`) continue;
271
+ output.update(parent.start + token.index, parent.start + token.index + token[0].length, token[0] === `export` ? `const ${name} =` : ``);
272
+ }
273
+ output.appendLeft(parent.end, `;\nexport default ${name};`);
274
+ }
275
+ components.add(name);
276
+ }
277
+ }
278
+ if (elements.length) {
279
+ let position = parsed.program.hashbang?.end ?? 0;
280
+ for (const statement of parsed.program.body) {
281
+ if (statement.type !== `ExpressionStatement` || !statement.directive) break;
282
+ position = statement.end;
283
+ }
284
+ output.appendLeft(position, `\nimport { jsx as ${create}, merge as ${merge} } from "@atom.io/spa/jsx-runtime";\n`);
285
+ for (const component of components) output.append(`\n;${component}.spa = true;`);
286
+ }
287
+ return {
288
+ code: output.toString(),
289
+ map: output.generateMap({
290
+ source: filename,
291
+ includeContent: true,
292
+ hires: true
293
+ })
294
+ };
295
+ }
296
+ // src/compiler-hmr.ts
297
+ function walk(node, visit) {
298
+ visit(node);
299
+ for (const key of visitorKeys[node.type]) {
300
+ const value = node[key];
301
+ if (Array.isArray(value)) {
302
+ for (const child of value) if (child) walk(child, visit);
303
+ } else if (value) walk(value, visit);
304
+ }
305
+ }
306
+ const factories = /* @__PURE__ */ new Set([
307
+ `atom`,
308
+ `atomFamily`,
309
+ `selector`,
310
+ `selectorFamily`,
311
+ `transaction`,
312
+ `timeline`,
313
+ `timelineFamily`,
314
+ `Silo`
315
+ ]);
316
+ function stateIn(program) {
317
+ const names = new Set(factories);
318
+ walk(program, (node) => {
319
+ if (node.type === `ImportDeclaration` && node.source.value.startsWith(`atom.io`)) {
320
+ for (const specifier of node.specifiers) if (specifier.type === `ImportSpecifier` && specifier.imported.type === `Identifier` && factories.has(specifier.imported.name)) names.add(specifier.local.name);
321
+ }
322
+ });
323
+ let found = false;
324
+ walk(program, (node) => {
325
+ if (node.type === `CallExpression` || node.type === `NewExpression`) {
326
+ const callee = node.callee;
327
+ if (callee.type === `Identifier` && names.has(callee.name) || callee.type === `MemberExpression` && !callee.computed && callee.property.type === `Identifier` && factories.has(callee.property.name)) found = true;
328
+ }
329
+ });
330
+ return found;
331
+ }
332
+ function requiresModuleReload(code, filename) {
333
+ const program = parseSync(filename, code, { lang: `tsx` }).program;
334
+ return stateIn(program) || program.body.some((node) => {
335
+ if (node.type === `ExportDefaultDeclaration`) return true;
336
+ if (node.type === `ExportAllDeclaration`) return node.exportKind !== `type`;
337
+ if (node.type !== `ExportNamedDeclaration` || node.exportKind === `type`) return false;
338
+ if (node.declaration) return ![
339
+ `TSInterfaceDeclaration`,
340
+ `TSTypeAliasDeclaration`,
341
+ `TSDeclareFunction`
342
+ ].includes(node.declaration.type);
343
+ return node.specifiers.some((specifier) => specifier.exportKind !== `type`);
344
+ });
345
+ }
346
+ /** Instrument only local component exports, composing both edits back to authored JSX. */
347
+ function hotModule(code, filename, originalMap) {
348
+ const program = parseSync(filename, code, {
349
+ lang: `tsx`,
350
+ preserveParens: true
351
+ }).program;
352
+ if (stateIn(program)) return;
353
+ const components = /* @__PURE__ */ new Set();
354
+ const declarations = /* @__PURE__ */ new Map();
355
+ const exports = /* @__PURE__ */ new Map();
356
+ const defaults = [];
357
+ const identifiers = /* @__PURE__ */ new Set();
358
+ walk(program, (node) => {
359
+ if (node.type === `Identifier`) identifiers.add(node.name);
360
+ });
361
+ const branded = (node) => {
362
+ if (node.type !== `ExpressionStatement` || node.expression.type !== `AssignmentExpression`) return false;
363
+ const { left, right } = node.expression;
364
+ if (left.type !== `MemberExpression` || left.computed || left.object.type !== `Identifier` || left.property.type !== `Identifier` || left.property.name !== `spa` || right.type !== `Literal` || right.value !== true) return false;
365
+ components.add(left.object.name);
366
+ return true;
367
+ };
368
+ const declaration = (node) => {
369
+ if (node.type === `FunctionDeclaration` && node.id) {
370
+ declarations.set(node.id.name, node);
371
+ return true;
372
+ }
373
+ if (node.type === `VariableDeclaration`) {
374
+ for (const entry of node.declarations) {
375
+ if (entry.id.type === `Identifier`) declarations.set(entry.id.name, node);
376
+ let unsafe = false;
377
+ let init = entry.init;
378
+ while (init?.type === `ParenthesizedExpression`) init = init.expression;
379
+ if (init && init.type !== `ArrowFunctionExpression` && init.type !== `FunctionExpression`) walk(init, (child) => {
380
+ if ([
381
+ `CallExpression`,
382
+ `NewExpression`,
383
+ `TaggedTemplateExpression`
384
+ ].includes(child.type)) unsafe = true;
385
+ });
386
+ if (unsafe) return false;
387
+ }
388
+ return true;
389
+ }
390
+ return [
391
+ `TSInterfaceDeclaration`,
392
+ `TSTypeAliasDeclaration`,
393
+ `TSDeclareFunction`
394
+ ].includes(node.type);
395
+ };
396
+ const add = (local, exported) => {
397
+ exports.set(local, [...exports.get(local) ?? [], exported]);
398
+ };
399
+ for (const statement of program.body) {
400
+ if (statement.type === `ExportAllDeclaration` && statement.exportKind === `type`) continue;
401
+ if (statement.type === `ImportDeclaration` || statement.type === `EmptyStatement`) continue;
402
+ if (statement.type === `ExpressionStatement` && (statement.directive || branded(statement))) continue;
403
+ if (statement.type === `ExportNamedDeclaration`) {
404
+ if (statement.exportKind === `type`) continue;
405
+ if (statement.source) return;
406
+ if (statement.declaration) {
407
+ const node = statement.declaration;
408
+ if (!declaration(node)) return;
409
+ if (node.type === `FunctionDeclaration` && node.id) add(node.id.name, node.id.name);
410
+ if (node.type === `VariableDeclaration`) for (const entry of node.declarations) {
411
+ if (entry.id.type !== `Identifier`) return;
412
+ add(entry.id.name, entry.id.name);
413
+ }
414
+ } else for (const specifier of statement.specifiers) {
415
+ if (specifier.exportKind === `type`) continue;
416
+ add(specifier.local.name, specifier.exported.type === `Identifier` ? specifier.exported.name : specifier.exported.value);
417
+ }
418
+ } else if (statement.type === `ExportDefaultDeclaration`) {
419
+ const node = statement.declaration;
420
+ if (node.type === `Identifier`) add(node.name, `default`);
421
+ else if (node.type === `FunctionDeclaration` && node.id) {
422
+ declaration(node);
423
+ add(node.id.name, `default`);
424
+ } else return;
425
+ defaults.push(statement);
426
+ } else if (!declaration(statement)) return;
427
+ }
428
+ if (!exports.size || [...exports.keys()].some((name) => !components.has(name) || !declarations.has(name))) return;
429
+ const output = new MagicString(code);
430
+ const mutable = /* @__PURE__ */ new Set();
431
+ for (const name of exports.keys()) {
432
+ const node = declarations.get(name);
433
+ if (node.type === `VariableDeclaration` && node.kind === `const` && !mutable.has(node)) {
434
+ output.update(node.start, node.start + 5, `let`);
435
+ mutable.add(node);
436
+ }
437
+ }
438
+ for (const node of defaults) {
439
+ const value = node.declaration;
440
+ const name = value.type === `Identifier` ? value.name : value.id.name;
441
+ const prefix = code.slice(node.start, value.start);
442
+ for (const token of prefix.matchAll(/\/\*[\s\S]*?\*\/|\/\/[^\r\n]*|\b(?:export|default)\b/g)) if (token[0] === `export` || token[0] === `default`) output.update(node.start + token.index, node.start + token.index + token[0].length, value.type === `Identifier` && token[0] === `export` ? `export {` : ``);
443
+ if (value.type === `Identifier`) output.appendLeft(value.end, ` as default }`);
444
+ else output.appendLeft(node.end, `;\nexport { ${name} as default };`);
445
+ }
446
+ const uid = (base) => {
447
+ let name = base;
448
+ while (identifiers.has(name)) name += `_`;
449
+ identifiers.add(name);
450
+ return name;
451
+ };
452
+ const register = uid(`__spaHotRegister`), refresh = uid(`__spaHotRefresh`);
453
+ let position = program.hashbang?.end ?? 0;
454
+ for (const statement of program.body) {
455
+ if (statement.type !== `ExpressionStatement` || !statement.directive) break;
456
+ position = statement.end;
457
+ }
458
+ output.appendLeft(position, `\nimport { registerComponent as ${register}, refresh as ${refresh} } from "@atom.io/spa/hot";\n`);
459
+ output.append(`\nif (import.meta.hot) {\n`);
460
+ for (const [name, aliases] of exports) output.append(`${name} = ${register}(${JSON.stringify(filename)}, ${JSON.stringify(aliases.sort()[0])}, ${name});\n`);
461
+ output.append(`import.meta.hot.accept(() => ${refresh}(${JSON.stringify(filename)}));\n}\n`);
462
+ return {
463
+ code: output.toString(),
464
+ map: remapping([output.generateMap({
465
+ source: filename,
466
+ includeContent: true,
467
+ hires: true
468
+ }).toString(), originalMap.toString()], () => null).toString(),
469
+ exports: [...exports.values()].flat().sort()
470
+ };
471
+ }
472
+ // src/vite.ts
473
+ function spa(options = {}) {
474
+ const include = options.include ?? /\.[jt]sx$/;
475
+ let development = false;
476
+ const signatures = /* @__PURE__ */ new Map();
477
+ const matches = (id) => {
478
+ include.lastIndex = 0;
479
+ return !id.includes(`/node_modules/`) && include.test(id.split(`?`)[0]);
480
+ };
481
+ return {
482
+ name: `spa`,
483
+ enforce: `pre`,
484
+ configResolved(config) {
485
+ development = config.command === `serve` && config.mode !== `test`;
486
+ },
487
+ config() {
488
+ return {
489
+ resolve: { dedupe: [`@atom.io/spa`, `atom.io`] },
490
+ optimizeDeps: { exclude: [`@atom.io/spa`, `atom.io`] }
491
+ };
492
+ },
493
+ configEnvironment: {
494
+ order: `post`,
495
+ handler(_name, config) {
496
+ if (config.optimizeDeps?.include) config.optimizeDeps.include = config.optimizeDeps.include.filter((id) => !/^(@atom\.io\/spa|atom\.io)(\/|$)/.test(id));
497
+ }
498
+ },
499
+ transform(code, id, environment) {
500
+ if (!matches(id)) return;
501
+ const compiled = compile(code, id);
502
+ if (development && !environment?.ssr) {
503
+ const key = id.split(`?`)[0];
504
+ const hot = hotModule(compiled.code, id, compiled.map);
505
+ if (hot) {
506
+ signatures.set(key, hot.exports.join(`\0`));
507
+ return {
508
+ code: hot.code,
509
+ map: hot.map
510
+ };
511
+ }
512
+ if (id === key) signatures.delete(key);
513
+ }
514
+ return compiled;
515
+ },
516
+ async handleHotUpdate({ server, file, read }) {
517
+ if (matches(file)) {
518
+ try {
519
+ const compiled = compile(await read(), file);
520
+ const hot = development ? hotModule(compiled.code, file, compiled.map) : void 0;
521
+ if (hot && signatures.get(file) === hot.exports.join(`\0`)) return;
522
+ } catch (error) {
523
+ server.ws.send({
524
+ type: `error`,
525
+ err: {
526
+ message: String(error),
527
+ stack: error instanceof Error ? error.stack ?? `` : ``,
528
+ id: file
529
+ }
530
+ });
531
+ return [];
532
+ }
533
+ server.ws.send({ type: `full-reload` });
534
+ return [];
535
+ }
536
+ if (!file.includes(`/node_modules/`) && /\.[cm]?[jt]sx?$/.test(file) && requiresModuleReload(await read(), file)) {
537
+ server.ws.send({ type: `full-reload` });
538
+ return [];
539
+ }
540
+ }
541
+ };
542
+ }
543
+ export { spa as t };
544
+
545
+ //# sourceMappingURL=vite-WUiz1ju6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite-WUiz1ju6.js","names":[],"sources":["../../src/compiler.ts","../../src/compiler-hmr.ts","../../src/vite.ts"],"sourcesContent":["import { decode } from \"html-entities\"\nimport type { SourceMap } from \"magic-string\"\nimport MagicString from \"magic-string\"\nimport type {\n\tExpression,\n\tJSXElement,\n\tJSXElementName,\n\tJSXFragment,\n\tNode,\n} from \"oxc-parser\"\nimport { parseSync, visitorKeys } from \"oxc-parser\"\n\ntype Part = string | Node\ntype FunctionNode = Extract<\n\tNode,\n\t{\n\t\ttype:\n\t\t\t| `FunctionDeclaration`\n\t\t\t| `FunctionExpression`\n\t\t\t| `ArrowFunctionExpression`\n\t}\n>\ntype JSXNode = JSXElement | JSXFragment\n\nconst decodeJsx = (value: string): string =>\n\tdecode(value, { level: `html4`, scope: `strict` })\n\n/** Match JSX's multiline whitespace rules without reprinting JavaScript. */\nfunction text(value: string): string {\n\tconst lines = value.split(/\\r\\n|\\n|\\r/)\n\tlet last = 0\n\tfor (let i = 0; i < lines.length; i++) if (/[^ \\t]/.test(lines[i])) last = i\n\treturn lines\n\t\t.map((line, i) => {\n\t\t\tline = line.replace(/\\t/g, ` `)\n\t\t\tif (i > 0) line = line.replace(/^ +/, ``)\n\t\t\tif (i < lines.length - 1) line = line.replace(/ +$/, ``)\n\t\t\treturn line && i < last ? `${line} ` : line\n\t\t})\n\t\t.join(``)\n}\n\nfunction eager(node: Node, allowJsx = false): boolean {\n\tif (node.type === `ParenthesizedExpression`)\n\t\treturn eager(node.expression, allowJsx)\n\treturn (\n\t\tnode.type === `Literal` ||\n\t\tnode.type === `FunctionExpression` ||\n\t\tnode.type === `ArrowFunctionExpression` ||\n\t\t(allowJsx && (node.type === `JSXElement` || node.type === `JSXFragment`)) ||\n\t\t(node.type === `TemplateLiteral` && node.expressions.length === 0)\n\t)\n}\n\nfunction containsSuspension(node: Node): boolean {\n\tif (isFunction(node)) return false\n\tif (node.type === `AwaitExpression` || node.type === `YieldExpression`)\n\t\treturn true\n\treturn visitorKeys[node.type].some((key) => {\n\t\tconst value = (node as unknown as Record<string, unknown>)[key]\n\t\treturn Array.isArray(value)\n\t\t\t? value.some((child) => child && containsSuspension(child))\n\t\t\t: Boolean(value && containsSuspension(value as Node))\n\t})\n}\n\nfunction isFunction(node: Node): node is FunctionNode {\n\treturn (\n\t\tnode.type === `FunctionDeclaration` ||\n\t\tnode.type === `FunctionExpression` ||\n\t\tnode.type === `ArrowFunctionExpression`\n\t)\n}\n\nexport function compile(\n\tcode: string,\n\tfilename: string,\n): { code: string; map: SourceMap } {\n\tconst parsed = parseSync(filename, code, {\n\t\tlang: `tsx`,\n\t\tpreserveParens: true,\n\t})\n\tif (parsed.errors.length) {\n\t\tconst error = parsed.errors[0]\n\t\tthrow new SyntaxError(\n\t\t\t[`${filename}: ${error.message}`, error.codeframe]\n\t\t\t\t.filter(Boolean)\n\t\t\t\t.join(`\\n`),\n\t\t)\n\t}\n\tconst output = new MagicString(code)\n\tconst parents = new WeakMap<Node, Node>()\n\tconst identifiers = new Set<string>()\n\tconst elements: JSXNode[] = []\n\tconst receivers: Node[] = []\n\tconst functions = new Set<Node>()\n\tfunction walk(node: Node, parent?: Node, outerFunction?: Node): void {\n\t\tif (parent) parents.set(node, parent)\n\t\toutput.addSourcemapLocation(node.start)\n\t\toutput.addSourcemapLocation(node.end)\n\t\tif (node.type === `Identifier` || node.type === `JSXIdentifier`)\n\t\t\tidentifiers.add(node.name)\n\t\tif (!outerFunction && isFunction(node)) outerFunction = node\n\t\tif (\n\t\t\tnode.type === `ThisExpression` ||\n\t\t\t(node.type === `JSXIdentifier` &&\n\t\t\t\tnode.name === `this` &&\n\t\t\t\t((parent?.type === `JSXMemberExpression` && parent.object === node) ||\n\t\t\t\t\t(parent?.type === `JSXOpeningElement` && parent.name === node)))\n\t\t)\n\t\t\treceivers.push(node)\n\t\tif (node.type === `JSXElement` || node.type === `JSXFragment`) {\n\t\t\telements.push(node)\n\t\t\tif (outerFunction) functions.add(outerFunction)\n\t\t}\n\t\tfor (const key of visitorKeys[node.type]) {\n\t\t\tconst value = (node as unknown as Record<string, unknown>)[key]\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tfor (const child of value) if (child) walk(child, node, outerFunction)\n\t\t\t} else if (value) walk(value as Node, node, outerFunction)\n\t\t}\n\t}\n\twalk(parsed.program)\n\tfunction uid(base: string): string {\n\t\tlet name = `_${base}`\n\t\tlet suffix = 1\n\t\twhile (identifiers.has(name)) name = `_${base}${++suffix}`\n\t\tidentifiers.add(name)\n\t\treturn name\n\t}\n\tconst create = uid(`spa`)\n\tconst merge = uid(`props`)\n\tconst captures = new Map<\n\t\tNode,\n\t\t{\n\t\t\tname: string\n\t\t\tscope: FunctionNode | undefined\n\t\t\troot: JSXNode\n\t\t}\n\t>()\n\tconst tagReceivers = new WeakMap<Node, string>()\n\tfor (const reference of receivers) {\n\t\tlet root: JSXNode | undefined\n\t\tlet ancestor = parents.get(reference)\n\t\t// Arrows inside a JSX tree share its receiver. A normal function starts\n\t\t// a separate receiver scope for any JSX it contains.\n\t\twhile (\n\t\t\tancestor &&\n\t\t\t(!isFunction(ancestor) || ancestor.type === `ArrowFunctionExpression`)\n\t\t) {\n\t\t\tif (ancestor.type === `JSXElement` || ancestor.type === `JSXFragment`)\n\t\t\t\troot = ancestor\n\t\t\tancestor = parents.get(ancestor)\n\t\t}\n\t\tif (!root) continue\n\t\tlet scope = parents.get(root)\n\t\twhile (scope && !isFunction(scope)) scope = parents.get(scope)\n\t\t// Default parameters run before declarations in the function body.\n\t\tif (scope && root.start < scope.body.start) scope = undefined\n\t\tconst enclosing = scope ?? root\n\t\tlet capture = captures.get(enclosing)\n\t\tif (!capture) {\n\t\t\tcapture = { name: uid(`self$`), scope, root }\n\t\t\tcaptures.set(enclosing, capture)\n\t\t}\n\t\tif (reference.type === `ThisExpression`)\n\t\t\toutput.update(reference.start, reference.end, capture.name)\n\t\telse tagReceivers.set(reference, capture.name)\n\t}\n\tconst join = (parts: Part[][], separator: string): Part[] =>\n\t\tparts.flatMap((part, i) => (i ? [separator, ...part] : part))\n\tconst expression = (node: Expression): Part[] =>\n\t\teager(node, true) ? [`(`, node, `)`] : [`() => (`, node, `)`]\n\tfunction tag(node: JSXElementName): string {\n\t\tif (node.type === `JSXNamespacedName`)\n\t\t\treturn JSON.stringify(`${node.namespace.name}:${node.name.name}`)\n\t\tif (node.type === `JSXMemberExpression`) {\n\t\t\tlet root = node.object\n\t\t\twhile (root.type === `JSXMemberExpression`) root = root.object\n\t\t\treturn (\n\t\t\t\t(tagReceivers.get(root) ?? root.name) + code.slice(root.end, node.end)\n\t\t\t)\n\t\t}\n\t\tif (tagReceivers.has(node)) return tagReceivers.get(node)!\n\t\treturn /^[a-z]/.test(node.name) || node.name.includes(`-`)\n\t\t\t? JSON.stringify(node.name)\n\t\t\t: node.name\n\t}\n\tfunction checkAttribute(node: Node, name: string): void {\n\t\tif (containsSuspension(node))\n\t\t\tthrow new SyntaxError(\n\t\t\t\t`${filename}: JSX attribute ${JSON.stringify(name)} cannot contain await or yield outside a nested function`,\n\t\t\t)\n\t}\n\t/** Rewrite syntax around untouched expression spans, including nested JSX. */\n\tfunction rewrite(node: JSXElement | JSXFragment, parts: Part[]): void {\n\t\tlet cursor = node.start\n\t\tlet replacement = ``\n\t\tfor (const part of parts) {\n\t\t\tif (typeof part === `string`) {\n\t\t\t\treplacement += part\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (cursor < part.start) output.update(cursor, part.start, replacement)\n\t\t\telse output.appendLeft(cursor, replacement)\n\t\t\tcursor = part.end\n\t\t\treplacement = ``\n\t\t}\n\t\t// Every JSX node ends with closing syntax after its last expression span.\n\t\toutput.update(cursor, node.end, replacement)\n\t}\n\tfor (const node of elements) {\n\t\tconst chunks: Part[][] = []\n\t\tlet properties: Part[][] = []\n\t\tconst flush = () => {\n\t\t\tif (properties.length) chunks.push([`{`, ...join(properties, `, `), `}`])\n\t\t\tproperties = []\n\t\t}\n\t\tif (node.type === `JSXElement`) {\n\t\t\tfor (const attribute of node.openingElement.attributes) {\n\t\t\t\tif (attribute.type === `JSXSpreadAttribute`) {\n\t\t\t\t\tcheckAttribute(attribute.argument, `spread`)\n\t\t\t\t\tflush()\n\t\t\t\t\tchunks.push([`() => (`, attribute.argument, `)`])\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst attributeName =\n\t\t\t\t\tattribute.name.type === `JSXNamespacedName`\n\t\t\t\t\t\t? `${attribute.name.namespace.name}:${attribute.name.name.name}`\n\t\t\t\t\t\t: attribute.name.name\n\t\t\t\tconst key = JSON.stringify(attributeName)\n\t\t\t\tconst value = attribute.value\n\t\t\t\tif (!value) properties.push([`${key}: true`])\n\t\t\t\telse if (value.type === `Literal`)\n\t\t\t\t\tproperties.push([`${key}: ${JSON.stringify(decodeJsx(value.value))}`])\n\t\t\t\telse {\n\t\t\t\t\tconst expr =\n\t\t\t\t\t\tvalue.type === `JSXExpressionContainer` ? value.expression : value\n\t\t\t\t\tcheckAttribute(expr, attributeName)\n\t\t\t\t\tproperties.push(\n\t\t\t\t\t\teager(expr)\n\t\t\t\t\t\t\t? [`${key}: (`, expr, `)`]\n\t\t\t\t\t\t\t: [`get ${key}(){ return (`, expr, `); }`],\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst component =\n\t\t\tnode.type === `JSXElement` &&\n\t\t\t!tag(node.openingElement.name).startsWith(`\"`)\n\t\tconst children: Part[][] = []\n\t\tlet lazyChildren = false\n\t\tfor (const child of node.children) {\n\t\t\tif (child.type === `JSXText`) {\n\t\t\t\tconst value = text(decodeJsx(child.value))\n\t\t\t\tif (value) children.push([JSON.stringify(value)])\n\t\t\t} else if (child.type === `JSXElement` || child.type === `JSXFragment`)\n\t\t\t\tchildren.push([child])\n\t\t\telse if (child.type === `JSXExpressionContainer`) {\n\t\t\t\tif (child.expression.type !== `JSXEmptyExpression`) {\n\t\t\t\t\tcheckAttribute(child.expression, `children`)\n\t\t\t\t\tif (component) {\n\t\t\t\t\t\t// Component props expose their declared values, including callbacks.\n\t\t\t\t\t\tchildren.push([`(`, child.expression, `)`])\n\t\t\t\t\t\tif (!eager(child.expression, true)) lazyChildren = true\n\t\t\t\t\t} else children.push(expression(child.expression))\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\tthrow new SyntaxError(`${filename}: JSX spread children are unsupported`)\n\t\t}\n\t\tif (children.length) {\n\t\t\tconst value =\n\t\t\t\tchildren.length === 1 ? children[0] : [`[`, ...join(children, `, `), `]`]\n\t\t\tproperties.push(\n\t\t\t\tlazyChildren\n\t\t\t\t\t? [`get children(){ return (`, ...value, `); }`]\n\t\t\t\t\t: [`children: `, ...value],\n\t\t\t)\n\t\t}\n\t\tflush()\n\t\tconst spreads =\n\t\t\tnode.type === `JSXElement` &&\n\t\t\tnode.openingElement.attributes.some(\n\t\t\t\t(attr) => attr.type === `JSXSpreadAttribute`,\n\t\t\t)\n\t\tconst props = spreads\n\t\t\t? [`${merge}(`, ...join(chunks, `, `), `)`]\n\t\t\t: (chunks[0] ?? [`{}`])\n\t\tconst capture = captures.get(node)\n\t\trewrite(node, [\n\t\t\tcapture ? `(() => { const ${capture.name} = this; return ` : ``,\n\t\t\t`${create}(${node.type === `JSXElement` ? tag(node.openingElement.name) : `null`}, `,\n\t\t\t...props,\n\t\t\t`)`,\n\t\t\tcapture ? `; })()` : ``,\n\t\t])\n\t}\n\tfor (const { name, scope, root } of captures.values()) {\n\t\tif (!scope) continue\n\t\tconst body = scope.body\n\t\tif (body.type !== `BlockStatement`) {\n\t\t\toutput.prependLeft(body.start, `{ const ${name} = this; return `)\n\t\t\toutput.appendLeft(body.end, `; }`)\n\t\t\tcontinue\n\t\t}\n\t\tlet position = body.start + 1\n\t\tif (parents.get(scope)?.type === `MethodDefinition`) {\n\t\t\tlet statement: Node = root\n\t\t\twhile (parents.get(statement) !== body) statement = parents.get(statement)!\n\t\t\tposition = statement.start\n\t\t} else {\n\t\t\tfor (const statement of body.body) {\n\t\t\t\tif (statement.type !== `ExpressionStatement` || !statement.directive)\n\t\t\t\t\tbreak\n\t\t\t\tposition = statement.end\n\t\t\t}\n\t\t}\n\t\toutput.prependLeft(position, `\\nconst ${name} = this;\\n`)\n\t}\n\tconst components = new Set<string>()\n\tfor (const fn of functions) {\n\t\tlet node = fn\n\t\tlet parent = parents.get(node)\n\t\twhile (parent?.type === `ParenthesizedExpression`) {\n\t\t\tnode = parent\n\t\t\tparent = parents.get(node)\n\t\t}\n\t\tif (fn.type === `FunctionDeclaration` && fn.id) components.add(fn.id.name)\n\t\telse if (\n\t\t\tparent?.type === `VariableDeclarator` &&\n\t\t\tparent.id.type === `Identifier`\n\t\t)\n\t\t\tcomponents.add(parent.id.name)\n\t\telse if (parent?.type === `ExportDefaultDeclaration`) {\n\t\t\tconst name = uid(`Component`)\n\t\t\tif (fn.type === `FunctionDeclaration`) {\n\t\t\t\t// Keep anonymous default function declarations hoisted.\n\t\t\t\tconst token = [\n\t\t\t\t\t...code\n\t\t\t\t\t\t.slice(fn.start, fn.body!.start)\n\t\t\t\t\t\t.matchAll(/\\/\\*[\\s\\S]*?\\*\\/|\\/\\/[^\\r\\n]*|\\bfunction\\b|\\*/g),\n\t\t\t\t].find((match) => match[0] === (fn.generator ? `*` : `function`))!\n\t\t\t\toutput.appendLeft(fn.start + token.index + token[0].length, ` ${name}`)\n\t\t\t} else {\n\t\t\t\t// Replace only keywords so intervening comments and annotations survive.\n\t\t\t\tconst prefix = code.slice(parent.start, node.start)\n\t\t\t\tfor (const token of prefix.matchAll(\n\t\t\t\t\t/\\/\\*[\\s\\S]*?\\*\\/|\\/\\/[^\\r\\n]*|\\b(?:export|default)\\b/g,\n\t\t\t\t)) {\n\t\t\t\t\tif (token[0] !== `export` && token[0] !== `default`) continue\n\t\t\t\t\toutput.update(\n\t\t\t\t\t\tparent.start + token.index,\n\t\t\t\t\t\tparent.start + token.index + token[0].length,\n\t\t\t\t\t\ttoken[0] === `export` ? `const ${name} =` : ``,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\toutput.appendLeft(parent.end, `;\\nexport default ${name};`)\n\t\t\t}\n\t\t\tcomponents.add(name)\n\t\t}\n\t}\n\tif (elements.length) {\n\t\t// Keep hashbangs and directive prologues ahead of generated imports.\n\t\tlet position = parsed.program.hashbang?.end ?? 0\n\t\tfor (const statement of parsed.program.body) {\n\t\t\tif (statement.type !== `ExpressionStatement` || !statement.directive) break\n\t\t\tposition = statement.end\n\t\t}\n\t\toutput.appendLeft(\n\t\t\tposition,\n\t\t\t`\\nimport { jsx as ${create}, merge as ${merge} } from \"@atom.io/spa/jsx-runtime\";\\n`,\n\t\t)\n\t\tfor (const component of components)\n\t\t\toutput.append(`\\n;${component}.spa = true;`)\n\t}\n\treturn {\n\t\tcode: output.toString(),\n\t\tmap: output.generateMap({\n\t\t\tsource: filename,\n\t\t\tincludeContent: true,\n\t\t\thires: true,\n\t\t}),\n\t}\n}\n","import remapping from \"@jridgewell/remapping\"\nimport type { SourceMap } from \"magic-string\"\nimport MagicString from \"magic-string\"\nimport type { Node } from \"oxc-parser\"\nimport { parseSync, visitorKeys } from \"oxc-parser\"\n\nfunction walk(node: Node, visit: (node: Node) => void): void {\n\tvisit(node)\n\tfor (const key of visitorKeys[node.type]) {\n\t\tconst value = (node as unknown as Record<string, unknown>)[key]\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (const child of value) if (child) walk(child, visit)\n\t\t} else if (value) walk(value as Node, visit)\n\t}\n}\nconst factories = new Set([\n\t`atom`,\n\t`atomFamily`,\n\t`selector`,\n\t`selectorFamily`,\n\t`transaction`,\n\t`timeline`,\n\t`timelineFamily`,\n\t`Silo`,\n])\nfunction stateIn(program: Node): boolean {\n\tconst names = new Set(factories)\n\twalk(program, (node) => {\n\t\tif (\n\t\t\tnode.type === `ImportDeclaration` &&\n\t\t\tnode.source.value.startsWith(`atom.io`)\n\t\t) {\n\t\t\tfor (const specifier of node.specifiers) {\n\t\t\t\tif (\n\t\t\t\t\tspecifier.type === `ImportSpecifier` &&\n\t\t\t\t\tspecifier.imported.type === `Identifier` &&\n\t\t\t\t\tfactories.has(specifier.imported.name)\n\t\t\t\t)\n\t\t\t\t\tnames.add(specifier.local.name)\n\t\t\t}\n\t\t}\n\t})\n\tlet found = false\n\twalk(program, (node) => {\n\t\tif (node.type === `CallExpression` || node.type === `NewExpression`) {\n\t\t\tconst callee = node.callee\n\t\t\tif (\n\t\t\t\t(callee.type === `Identifier` && names.has(callee.name)) ||\n\t\t\t\t(callee.type === `MemberExpression` &&\n\t\t\t\t\t!callee.computed &&\n\t\t\t\t\tcallee.property.type === `Identifier` &&\n\t\t\t\t\tfactories.has(callee.property.name))\n\t\t\t)\n\t\t\t\tfound = true\n\t\t}\n\t})\n\treturn found\n}\n\nexport function requiresModuleReload(code: string, filename: string): boolean {\n\tconst program = parseSync(filename, code, { lang: `tsx` }).program\n\treturn (\n\t\tstateIn(program) ||\n\t\tprogram.body.some((node) => {\n\t\t\tif (node.type === `ExportDefaultDeclaration`) return true\n\t\t\tif (node.type === `ExportAllDeclaration`) return node.exportKind !== `type`\n\t\t\tif (node.type !== `ExportNamedDeclaration` || node.exportKind === `type`)\n\t\t\t\treturn false\n\t\t\tif (node.declaration)\n\t\t\t\treturn ![\n\t\t\t\t\t`TSInterfaceDeclaration`,\n\t\t\t\t\t`TSTypeAliasDeclaration`,\n\t\t\t\t\t`TSDeclareFunction`,\n\t\t\t\t].includes(node.declaration.type)\n\t\t\treturn node.specifiers.some((specifier) => specifier.exportKind !== `type`)\n\t\t})\n\t)\n}\n\n/** Instrument only local component exports, composing both edits back to authored JSX. */\nexport function hotModule(\n\tcode: string,\n\tfilename: string,\n\toriginalMap: SourceMap,\n):\n\t| {\n\t\t\tcode: string\n\t\t\tmap: string\n\t\t\texports: string[]\n\t }\n\t| undefined {\n\tconst program = parseSync(filename, code, {\n\t\tlang: `tsx`,\n\t\tpreserveParens: true,\n\t}).program\n\tif (stateIn(program)) return\n\tconst components = new Set<string>()\n\tconst declarations = new Map<string, Node>()\n\tconst exports = new Map<string, string[]>()\n\tconst defaults: Extract<Node, { type: `ExportDefaultDeclaration` }>[] = []\n\tconst identifiers = new Set<string>()\n\twalk(program, (node) => {\n\t\tif (node.type === `Identifier`) identifiers.add(node.name)\n\t})\n\tconst branded = (node: Node): boolean => {\n\t\tif (\n\t\t\tnode.type !== `ExpressionStatement` ||\n\t\t\tnode.expression.type !== `AssignmentExpression`\n\t\t)\n\t\t\treturn false\n\t\tconst { left, right } = node.expression\n\t\tif (\n\t\t\tleft.type !== `MemberExpression` ||\n\t\t\tleft.computed ||\n\t\t\tleft.object.type !== `Identifier` ||\n\t\t\tleft.property.type !== `Identifier` ||\n\t\t\tleft.property.name !== `spa` ||\n\t\t\tright.type !== `Literal` ||\n\t\t\tright.value !== true\n\t\t)\n\t\t\treturn false\n\t\tcomponents.add(left.object.name)\n\t\treturn true\n\t}\n\tconst declaration = (node: Node): boolean => {\n\t\tif (node.type === `FunctionDeclaration` && node.id) {\n\t\t\tdeclarations.set(node.id.name, node)\n\t\t\treturn true\n\t\t}\n\t\tif (node.type === `VariableDeclaration`) {\n\t\t\tfor (const entry of node.declarations) {\n\t\t\t\tif (entry.id.type === `Identifier`) declarations.set(entry.id.name, node)\n\t\t\t\tlet unsafe = false\n\t\t\t\tlet init = entry.init\n\t\t\t\twhile (init?.type === `ParenthesizedExpression`) init = init.expression\n\t\t\t\tif (\n\t\t\t\t\tinit &&\n\t\t\t\t\tinit.type !== `ArrowFunctionExpression` &&\n\t\t\t\t\tinit.type !== `FunctionExpression`\n\t\t\t\t)\n\t\t\t\t\twalk(init, (child) => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t`CallExpression`,\n\t\t\t\t\t\t\t\t`NewExpression`,\n\t\t\t\t\t\t\t\t`TaggedTemplateExpression`,\n\t\t\t\t\t\t\t].includes(child.type)\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\tunsafe = true\n\t\t\t\t\t})\n\t\t\t\tif (unsafe) return false\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\t\treturn [\n\t\t\t`TSInterfaceDeclaration`,\n\t\t\t`TSTypeAliasDeclaration`,\n\t\t\t`TSDeclareFunction`,\n\t\t].includes(node.type)\n\t}\n\tconst add = (local: string, exported: string) => {\n\t\texports.set(local, [...(exports.get(local) ?? []), exported])\n\t}\n\tfor (const statement of program.body) {\n\t\tif (\n\t\t\tstatement.type === `ExportAllDeclaration` &&\n\t\t\tstatement.exportKind === `type`\n\t\t)\n\t\t\tcontinue\n\t\tif (\n\t\t\tstatement.type === `ImportDeclaration` ||\n\t\t\tstatement.type === `EmptyStatement`\n\t\t)\n\t\t\tcontinue\n\t\tif (\n\t\t\tstatement.type === `ExpressionStatement` &&\n\t\t\t(statement.directive || branded(statement))\n\t\t)\n\t\t\tcontinue\n\t\tif (statement.type === `ExportNamedDeclaration`) {\n\t\t\tif (statement.exportKind === `type`) continue\n\t\t\tif (statement.source) return\n\t\t\tif (statement.declaration) {\n\t\t\t\tconst node = statement.declaration\n\t\t\t\tif (!declaration(node)) return\n\t\t\t\tif (node.type === `FunctionDeclaration` && node.id)\n\t\t\t\t\tadd(node.id.name, node.id.name)\n\t\t\t\tif (node.type === `VariableDeclaration`)\n\t\t\t\t\tfor (const entry of node.declarations) {\n\t\t\t\t\t\tif (entry.id.type !== `Identifier`) return\n\t\t\t\t\t\tadd(entry.id.name, entry.id.name)\n\t\t\t\t\t}\n\t\t\t} else\n\t\t\t\tfor (const specifier of statement.specifiers) {\n\t\t\t\t\tif (specifier.exportKind === `type`) continue\n\t\t\t\t\tadd(\n\t\t\t\t\t\t// Local export names are identifiers; string names require a source above.\n\t\t\t\t\t\t(specifier.local as { name: string }).name,\n\t\t\t\t\t\tspecifier.exported.type === `Identifier`\n\t\t\t\t\t\t\t? specifier.exported.name\n\t\t\t\t\t\t\t: specifier.exported.value,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t} else if (statement.type === `ExportDefaultDeclaration`) {\n\t\t\tconst node = statement.declaration\n\t\t\tif (node.type === `Identifier`) add(node.name, `default`)\n\t\t\telse if (node.type === `FunctionDeclaration` && node.id) {\n\t\t\t\tdeclaration(node)\n\t\t\t\tadd(node.id.name, `default`)\n\t\t\t} else return\n\t\t\tdefaults.push(statement)\n\t\t} else if (!declaration(statement)) return\n\t}\n\tif (\n\t\t!exports.size ||\n\t\t[...exports.keys()].some(\n\t\t\t(name) => !components.has(name) || !declarations.has(name),\n\t\t)\n\t)\n\t\treturn\n\tconst output = new MagicString(code)\n\tconst mutable = new Set<Node>()\n\tfor (const name of exports.keys()) {\n\t\tconst node = declarations.get(name)!\n\t\tif (\n\t\t\tnode.type === `VariableDeclaration` &&\n\t\t\tnode.kind === `const` &&\n\t\t\t!mutable.has(node)\n\t\t) {\n\t\t\toutput.update(node.start, node.start + 5, `let`)\n\t\t\tmutable.add(node)\n\t\t}\n\t}\n\tfor (const node of defaults) {\n\t\tconst value = node.declaration\n\t\tconst name =\n\t\t\tvalue.type === `Identifier`\n\t\t\t\t? value.name\n\t\t\t\t: (value as { id: { name: string } }).id.name\n\t\tconst prefix = code.slice(node.start, value.start)\n\t\tfor (const token of prefix.matchAll(\n\t\t\t/\\/\\*[\\s\\S]*?\\*\\/|\\/\\/[^\\r\\n]*|\\b(?:export|default)\\b/g,\n\t\t)) {\n\t\t\tif (token[0] === `export` || token[0] === `default`)\n\t\t\t\toutput.update(\n\t\t\t\t\tnode.start + token.index,\n\t\t\t\t\tnode.start + token.index + token[0].length,\n\t\t\t\t\tvalue.type === `Identifier` && token[0] === `export` ? `export {` : ``,\n\t\t\t\t)\n\t\t}\n\t\tif (value.type === `Identifier`)\n\t\t\toutput.appendLeft(value.end, ` as default }`)\n\t\telse output.appendLeft(node.end, `;\\nexport { ${name} as default };`)\n\t}\n\tconst uid = (base: string) => {\n\t\tlet name = base\n\t\twhile (identifiers.has(name)) name += `_`\n\t\tidentifiers.add(name)\n\t\treturn name\n\t}\n\tconst register = uid(`__spaHotRegister`),\n\t\trefresh = uid(`__spaHotRefresh`)\n\tlet position = program.hashbang?.end ?? 0\n\tfor (const statement of program.body) {\n\t\tif (statement.type !== `ExpressionStatement` || !statement.directive) break\n\t\tposition = statement.end\n\t}\n\toutput.appendLeft(\n\t\tposition,\n\t\t`\\nimport { registerComponent as ${register}, refresh as ${refresh} } from \"@atom.io/spa/hot\";\\n`,\n\t)\n\toutput.append(`\\nif (import.meta.hot) {\\n`)\n\tfor (const [name, aliases] of exports)\n\t\toutput.append(\n\t\t\t`${name} = ${register}(${JSON.stringify(filename)}, ${JSON.stringify(aliases.sort()[0])}, ${name});\\n`,\n\t\t)\n\toutput.append(\n\t\t`import.meta.hot.accept(() => ${refresh}(${JSON.stringify(filename)}));\\n}\\n`,\n\t)\n\treturn {\n\t\tcode: output.toString(),\n\t\tmap: remapping(\n\t\t\t[\n\t\t\t\toutput\n\t\t\t\t\t.generateMap({\n\t\t\t\t\t\tsource: filename,\n\t\t\t\t\t\tincludeContent: true,\n\t\t\t\t\t\thires: true,\n\t\t\t\t\t})\n\t\t\t\t\t.toString(),\n\t\t\t\toriginalMap.toString(),\n\t\t\t],\n\t\t\t() => null,\n\t\t).toString(),\n\t\texports: [...exports.values()].flat().sort(),\n\t}\n}\n","import type { Plugin } from \"vite\"\n\nimport { compile } from \"./compiler.ts\"\nimport { hotModule, requiresModuleReload } from \"./compiler-hmr.ts\"\n\nexport interface SpaPluginOptions {\n\tinclude?: RegExp\n}\nexport default function spa(options: SpaPluginOptions = {}): Plugin {\n\tconst include = options.include ?? /\\.[jt]sx$/\n\tlet development = false\n\tconst signatures = new Map<string, string>()\n\tconst matches = (id: string): boolean => {\n\t\tinclude.lastIndex = 0\n\t\treturn !id.includes(`/node_modules/`) && include.test(id.split(`?`)[0])\n\t}\n\treturn {\n\t\tname: `spa`,\n\t\tenforce: `pre`,\n\t\tconfigResolved(config) {\n\t\t\tdevelopment = config.command === `serve` && config.mode !== `test`\n\t\t},\n\t\tconfig() {\n\t\t\treturn {\n\t\t\t\tresolve: { dedupe: [`@atom.io/spa`, `atom.io`] },\n\t\t\t\toptimizeDeps: { exclude: [`@atom.io/spa`, `atom.io`] },\n\t\t\t}\n\t\t},\n\t\tconfigEnvironment: {\n\t\t\torder: `post`,\n\t\t\thandler(_name, config) {\n\t\t\t\t// Astro and its adapters force renderer entries into the optimizer.\n\t\t\t\t// Vite processes explicit includes even when their package is excluded.\n\t\t\t\t// Keep the renderer, hooks, and store in one unbundled module graph.\n\t\t\t\tif (config.optimizeDeps?.include) {\n\t\t\t\t\tconfig.optimizeDeps.include = config.optimizeDeps.include.filter(\n\t\t\t\t\t\t(id) => !/^(@atom\\.io\\/spa|atom\\.io)(\\/|$)/.test(id),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\ttransform(code, id, environment) {\n\t\t\tif (!matches(id)) return\n\t\t\tconst compiled = compile(code, id)\n\t\t\tif (development && !environment?.ssr) {\n\t\t\t\tconst key = id.split(`?`)[0]\n\t\t\t\tconst hot = hotModule(compiled.code, id, compiled.map)\n\t\t\t\tif (hot) {\n\t\t\t\t\tsignatures.set(key, hot.exports.join(`\\0`))\n\t\t\t\t\treturn { code: hot.code, map: hot.map }\n\t\t\t\t}\n\t\t\t\tif (id === key) signatures.delete(key)\n\t\t\t}\n\t\t\treturn compiled\n\t\t},\n\t\tasync handleHotUpdate({ server, file, read }) {\n\t\t\tif (matches(file)) {\n\t\t\t\ttry {\n\t\t\t\t\tconst compiled = compile(await read(), file)\n\t\t\t\t\tconst hot = development\n\t\t\t\t\t\t? hotModule(compiled.code, file, compiled.map)\n\t\t\t\t\t\t: undefined\n\t\t\t\t\tif (hot && signatures.get(file) === hot.exports.join(`\\0`)) return\n\t\t\t\t} catch (error) {\n\t\t\t\t\tserver.ws.send({\n\t\t\t\t\t\ttype: `error`,\n\t\t\t\t\t\terr: {\n\t\t\t\t\t\t\tmessage: String(error),\n\t\t\t\t\t\t\tstack: error instanceof Error ? (error.stack ?? ``) : ``,\n\t\t\t\t\t\t\tid: file,\n\t\t\t\t\t\t},\n\t\t\t\t\t})\n\t\t\t\t\treturn []\n\t\t\t\t}\n\t\t\t\tserver.ws.send({ type: `full-reload` })\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tif (\n\t\t\t\t!file.includes(`/node_modules/`) &&\n\t\t\t\t/\\.[cm]?[jt]sx?$/.test(file) &&\n\t\t\t\trequiresModuleReload(await read(), file)\n\t\t\t) {\n\t\t\t\tserver.ws.send({ type: `full-reload` })\n\t\t\t\treturn []\n\t\t\t}\n\t\t},\n\t}\n}\n"],"mappings":";;;;;AAwBA,MAAM,aAAa,UAClB,OAAO,OAAO;CAAE,OAAO;CAAS,OAAO;AAAS,CAAC;;AAGlD,SAAS,KAAK,OAAuB;CACpC,MAAM,QAAQ,MAAM,MAAM,YAAY;CACtC,IAAI,OAAO;CACX,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,IAAI,SAAS,KAAK,MAAM,EAAE,GAAG,OAAO;CAC3E,OAAO,MACL,KAAK,MAAM,MAAM;EACjB,OAAO,KAAK,QAAQ,OAAO,GAAG;EAC9B,IAAI,IAAI,GAAG,OAAO,KAAK,QAAQ,OAAO,EAAE;EACxC,IAAI,IAAI,MAAM,SAAS,GAAG,OAAO,KAAK,QAAQ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