@mikuexe/annotator-effect 0.0.0-stage → 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.
Files changed (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +263 -2
  3. package/dist/annotator.d.ts +5 -0
  4. package/dist/annotator.d.ts.map +1 -0
  5. package/dist/annotator.js +152 -0
  6. package/dist/annotator.js.map +1 -0
  7. package/dist/capture.d.ts +27 -0
  8. package/dist/capture.d.ts.map +1 -0
  9. package/dist/capture.js +186 -0
  10. package/dist/capture.js.map +1 -0
  11. package/dist/clipboard.d.ts +5 -0
  12. package/dist/clipboard.d.ts.map +1 -0
  13. package/dist/clipboard.js +35 -0
  14. package/dist/clipboard.js.map +1 -0
  15. package/dist/constants.d.ts +24 -0
  16. package/dist/constants.d.ts.map +1 -0
  17. package/dist/constants.js +24 -0
  18. package/dist/constants.js.map +1 -0
  19. package/dist/format.d.ts +9 -0
  20. package/dist/format.d.ts.map +1 -0
  21. package/dist/format.js +109 -0
  22. package/dist/format.js.map +1 -0
  23. package/dist/hotkey.d.ts +13 -0
  24. package/dist/hotkey.d.ts.map +1 -0
  25. package/dist/hotkey.js +54 -0
  26. package/dist/hotkey.js.map +1 -0
  27. package/dist/index.d.ts +8 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +6 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/overlay/machine.d.ts +132 -0
  32. package/dist/overlay/machine.d.ts.map +1 -0
  33. package/dist/overlay/machine.js +236 -0
  34. package/dist/overlay/machine.js.map +1 -0
  35. package/dist/overlay/overlay.d.ts +26 -0
  36. package/dist/overlay/overlay.d.ts.map +1 -0
  37. package/dist/overlay/overlay.js +748 -0
  38. package/dist/overlay/overlay.js.map +1 -0
  39. package/dist/overlay/styles.d.ts +8 -0
  40. package/dist/overlay/styles.d.ts.map +1 -0
  41. package/dist/overlay/styles.js +386 -0
  42. package/dist/overlay/styles.js.map +1 -0
  43. package/dist/runtime/agent.d.ts +37 -0
  44. package/dist/runtime/agent.d.ts.map +1 -0
  45. package/dist/runtime/agent.js +142 -0
  46. package/dist/runtime/agent.js.map +1 -0
  47. package/dist/runtime/paths.d.ts +13 -0
  48. package/dist/runtime/paths.d.ts.map +1 -0
  49. package/dist/runtime/paths.js +64 -0
  50. package/dist/runtime/paths.js.map +1 -0
  51. package/dist/types.d.ts +106 -0
  52. package/dist/types.d.ts.map +1 -0
  53. package/dist/types.js +2 -0
  54. package/dist/types.js.map +1 -0
  55. package/dist/vite/analyze.d.ts +41 -0
  56. package/dist/vite/analyze.d.ts.map +1 -0
  57. package/dist/vite/analyze.js +324 -0
  58. package/dist/vite/analyze.js.map +1 -0
  59. package/dist/vite/ast.d.ts +38 -0
  60. package/dist/vite/ast.d.ts.map +1 -0
  61. package/dist/vite/ast.js +105 -0
  62. package/dist/vite/ast.js.map +1 -0
  63. package/dist/vite/index.d.ts +5 -0
  64. package/dist/vite/index.d.ts.map +1 -0
  65. package/dist/vite/index.js +3 -0
  66. package/dist/vite/index.js.map +1 -0
  67. package/dist/vite/plugin.d.ts +34 -0
  68. package/dist/vite/plugin.d.ts.map +1 -0
  69. package/dist/vite/plugin.js +181 -0
  70. package/dist/vite/plugin.js.map +1 -0
  71. package/dist/vite/scope.d.ts +39 -0
  72. package/dist/vite/scope.d.ts.map +1 -0
  73. package/dist/vite/scope.js +194 -0
  74. package/dist/vite/scope.js.map +1 -0
  75. package/dist/vite/tags.d.ts +5 -0
  76. package/dist/vite/tags.d.ts.map +1 -0
  77. package/dist/vite/tags.js +151 -0
  78. package/dist/vite/tags.js.map +1 -0
  79. package/dist/vite/transform.d.ts +39 -0
  80. package/dist/vite/transform.d.ts.map +1 -0
  81. package/dist/vite/transform.js +111 -0
  82. package/dist/vite/transform.js.map +1 -0
  83. package/package.json +107 -4
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Reads component names out of an effect/ui instance path.
3
+ *
4
+ * A path is the root segment, `/Name` or `/Name[key]`, then one segment per
5
+ * child: `/Name[key]` for a component and `/[slot]` for a placed slot. A
6
+ * segment's name ends at its first `[` and its key at the first `]/` or at
7
+ * the end of the path. Names escape `%` and `[`; keys escape `%` and the `/`
8
+ * of `]/` (effect/ui/internal/paths.ts). A root's name may itself hold `/`,
9
+ * so the root's path is passed in rather than guessed.
10
+ */
11
+ /** Component names from the root to the owning instance. */
12
+ export declare function componentNamesFromPath(path: string, rootPath: string): string[];
13
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/runtime/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,4DAA4D;AAC5D,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,MAAM,EAAE,CA0BV"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Reads component names out of an effect/ui instance path.
3
+ *
4
+ * A path is the root segment, `/Name` or `/Name[key]`, then one segment per
5
+ * child: `/Name[key]` for a component and `/[slot]` for a placed slot. A
6
+ * segment's name ends at its first `[` and its key at the first `]/` or at
7
+ * the end of the path. Names escape `%` and `[`; keys escape `%` and the `/`
8
+ * of `]/` (effect/ui/internal/paths.ts). A root's name may itself hold `/`,
9
+ * so the root's path is passed in rather than guessed.
10
+ */
11
+ /** Component names from the root to the owning instance. */
12
+ export function componentNamesFromPath(path, rootPath) {
13
+ if (!rootPath.startsWith("/") || !path.startsWith(rootPath)) {
14
+ return [];
15
+ }
16
+ const names = [rootNameOf(rootPath)];
17
+ const rest = path.slice(rootPath.length);
18
+ let index = 0;
19
+ while (index < rest.length) {
20
+ if (rest[index] !== "/") {
21
+ return [];
22
+ }
23
+ const segment = readSegment(rest, index + 1);
24
+ if (!segment) {
25
+ return [];
26
+ }
27
+ if (segment.name !== null) {
28
+ names.push(segment.name);
29
+ }
30
+ index = segment.end;
31
+ }
32
+ return names;
33
+ }
34
+ function rootNameOf(rootPath) {
35
+ const body = rootPath.slice(1);
36
+ const bracket = body.indexOf("[");
37
+ return unescapeName(bracket === -1 ? body : body.slice(0, bracket));
38
+ }
39
+ function readSegment(rest, start) {
40
+ if (rest[start] === "[") {
41
+ const end = keyEnd(rest, start + 1);
42
+ return end === -1 ? null : { name: null, end };
43
+ }
44
+ const bracket = rest.indexOf("[", start);
45
+ if (bracket === -1) {
46
+ return null;
47
+ }
48
+ const end = keyEnd(rest, bracket + 1);
49
+ return end === -1
50
+ ? null
51
+ : { name: unescapeName(rest.slice(start, bracket)), end };
52
+ }
53
+ // Returns the index just past a key's closing `]`.
54
+ function keyEnd(rest, start) {
55
+ const separator = rest.indexOf("]/", start);
56
+ if (separator !== -1) {
57
+ return separator + 1;
58
+ }
59
+ return rest.endsWith("]") && rest.length - 1 >= start ? rest.length : -1;
60
+ }
61
+ function unescapeName(name) {
62
+ return name.replace(/%(25|5B)/g, (_match, code) => code === "25" ? "%" : "[");
63
+ }
64
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/runtime/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,4DAA4D;AAC5D,MAAM,UAAU,sBAAsB,CACpC,IAAY,EACZ,QAAgB;IAEhB,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC5D,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACzC,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,OAAO,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAC3B,IAAI,IAAI,CAAC,KAAK,CAA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IAED,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC;IACtC,OAAO,GAAG,KAAK,CAAC,CAAC;QACf,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;AAC9D,CAAC;AAED,mDAAmD;AACnD,SAAS,MAAM,CAAC,IAAY,EAAE,KAAa;IACzC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5C,IAAI,SAAS,KAAK,CAAC,CAAC,EAAE,CAAC;QACrB,OAAO,SAAS,GAAG,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,IAAY,EAAE,EAAE,CACxD,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAC1B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,106 @@
1
+ import type { Layer } from "effect";
2
+ /** A position in a source file. Lines and columns are 1-based. */
3
+ export type SourceLocation = {
4
+ filePath: string;
5
+ lineNumber: number | null;
6
+ columnNumber: number | null;
7
+ };
8
+ /**
9
+ * Where `source` came from:
10
+ *
11
+ * - `element`: the picked element's own builder call site (resolution layer B).
12
+ * - `ancestor-element`: the call site of the nearest ancestor element that the
13
+ * same component instance rendered (layer B, less precise).
14
+ * - `component-definition`: the owning component's definition (layer C).
15
+ */
16
+ export type SourceKind = "element" | "ancestor-element" | "component-definition";
17
+ export type AnnotationSource = SourceLocation & {
18
+ componentName: string | null;
19
+ kind: SourceKind;
20
+ };
21
+ /**
22
+ * One component of the owner chain with its definition sites. `definitions`
23
+ * is empty when the name is not in the registry (a library component or an
24
+ * untransformed module), and has more than one entry when several
25
+ * components share the name.
26
+ */
27
+ export type ComponentFrame = {
28
+ componentName: string;
29
+ definitions: SourceLocation[];
30
+ };
31
+ export type AnnotationElement = {
32
+ tagName: string;
33
+ text: string;
34
+ html: string;
35
+ selector: string;
36
+ };
37
+ export type AnnotationTarget = {
38
+ source: AnnotationSource | null;
39
+ /** Component names from the owning component outwards to the root. */
40
+ componentPath: string[];
41
+ /** The effect/ui instance path, such as `/App/Sidebar[nav]/Card[]`. */
42
+ instancePath: string | null;
43
+ /** One frame per `componentPath` entry, in the same order. */
44
+ componentStack: ComponentFrame[];
45
+ element: AnnotationElement;
46
+ };
47
+ export type Annotation = {
48
+ id: string;
49
+ note: string;
50
+ targets: AnnotationTarget[];
51
+ };
52
+ export type PageContext = {
53
+ domain: string;
54
+ path: string;
55
+ };
56
+ export type AnnotationCollection = {
57
+ annotations: Annotation[];
58
+ createdAt: string;
59
+ page: PageContext;
60
+ };
61
+ export type AnnotatorOutput = "markdown" | "json" | "both";
62
+ export type AnnotatorTarget = Document | HTMLIFrameElement | null;
63
+ /** The corner the launcher, panel and toasts sit in. */
64
+ export type AnnotatorPosition = "bottom-right" | "bottom-left" | "top-right" | "top-left";
65
+ export type AnnotatorOptions = {
66
+ /**
67
+ * Whether the annotator runs. Defaults to `true` when the Vite plugin's
68
+ * development client is active, and `false` otherwise, so a production
69
+ * build that imports the annotator gets a no-op unless it passes `true`.
70
+ */
71
+ enabled?: boolean;
72
+ /** Toggles picking. Default: `"alt+a"`. */
73
+ hotkey?: string;
74
+ /** Clipboard format. Default: `"markdown"`. */
75
+ output?: AnnotatorOutput;
76
+ /**
77
+ * Default: `"bottom-right"`. The @effect/ui-devtools launcher also starts
78
+ * at the bottom right, so pick another corner when both run.
79
+ */
80
+ position?: AnnotatorPosition;
81
+ /** The document or same-origin iframe to annotate. Default: `document`. */
82
+ target?: AnnotatorTarget;
83
+ /** Called after the clipboard write succeeds. */
84
+ onCollect?: (payload: AnnotationCollection) => void;
85
+ };
86
+ export type AnnotatorHandle = {
87
+ /** Merges new options into the running annotator. */
88
+ update: (options: AnnotatorOptions) => void;
89
+ /** Removes the overlay and its listeners. Registered roots stay registered. */
90
+ stop: () => void;
91
+ };
92
+ export type AnnotatorApi = {
93
+ /**
94
+ * Installs the effect/ui hook and mounts the overlay. Call it before the
95
+ * app mounts so the app's roots are registered. Calling it again updates
96
+ * the options of the running annotator.
97
+ */
98
+ start: (options?: AnnotatorOptions) => AnnotatorHandle;
99
+ /**
100
+ * A Layer for `BrowserHost.mount(...).pipe(Layer.provide(...))`. It
101
+ * provides a numbering `MessageLog` and `BrowserHost.Controllables` to
102
+ * the mount, and keeps the overlay mounted while it is built.
103
+ */
104
+ layer: (options?: AnnotatorOptions) => Layer.Layer<never>;
105
+ };
106
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEpC,kEAAkE;AAClE,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GACpB,SAAS,GAAG,kBAAkB,GAAG,sBAAsB,CAAC;AAE1D,MAAM,MAAM,gBAAgB,GAAG,cAAc,GAAG;IAC9C,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,IAAI,EAAE,UAAU,CAAC;CAClB,CAAC;AAEF;;;;;GAKG;A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,CAAC,EAAE,OAAO,CAAC;IAClB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,2EAA2E;IAC3E,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,iDAAiD;IACjD,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,IAAI,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,qDAAqD;IACrD,MAAM,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC5C,+EAA+E;IAC/E,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB;;;;OAIG;IACH,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,gBAAgB,KAAK,eAAe,CAAC;IACvD;;;;OAIG;IACH,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,gBAAgB,KAAK,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;CAC3D,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,41 @@
1
+ import type { AstNode } from "./ast.js";
2
+ /**
3
+ * A place in a module where an element builder starts. `position` is the
4
+ * offset reported as the element's call site.
5
+ *
6
+ * - `chain`: `h.div.class(…)`. Insert `.attr(…)` at `at`.
7
+ * - `call`: `h.div(…)`. Insert `.attr(…).children` at `at`, since `.attr`
8
+ * turns the callable shorthand into a plain builder.
9
+ * - `el`: `h.el("x-tag", …)`. Insert `.attr(…)` after the call.
10
+ * - `value`: a bare `h.div` handed on, such as `parts.root(h.div)`. Wrap it
11
+ * so a caller that calls it still can.
12
+ * - `external`: a call that receives `h` and that this module can't see
13
+ * into, such as a kit component or an imported helper. Wrap its result;
14
+ * the runtime annotates it only if it is a builder with no source yet.
15
+ */
16
+ export type ElementSite = {
17
+ readonly kind: "chain" | "call" | "el";
18
+ readonly at: number;
19
+ readonly position: number;
20
+ } | {
21
+ readonly kind: "value" | "external";
22
+ readonly start: number;
23
+ readonly end: number;
24
+ readonly position: number;
25
+ };
26
+ export type ComponentDefinition = {
27
+ readonly name: string;
28
+ readonly position: number;
29
+ };
30
+ /** An `h` member use that is left alone, with why. */
31
+ export type SkippedSite = {
32
+ readonly reason: "computed-member" | "optional-call" | "assignment-target";
33
+ readonly position: number;
34
+ };
35
+ export type ModuleAnalysis = {
36
+ readonly sites: readonly ElementSite[];
37
+ readonly definitions: readonly ComponentDefinition[];
38
+ readonly skipped: readonly SkippedSite[];
39
+ };
40
+ export declare function analyzeModule(program: AstNode): ModuleAnalysis;
41
+ //# sourceMappingURL=analyze.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/vite/analyze.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAexC;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,WAAW,GACnB;IACE,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,UAAU,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEN,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,sDAAsD;AACtD,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,MAAM,EAAE,iBAAiB,GAAG,eAAe,GAAG,mBAAmB,CAAC;IAC3E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,CAAC;IACvC,QAAQ,CAAC,WAAW,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACrD,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;CAC1C,CAAC;AAIF,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,cAAc,CA6B9D"}
@@ -0,0 +1,324 @@
1
+ import { child, children, isFunction, nameOf, parameterIdentifier, parametersOf, stringValue, unwrap, } from "./ast.js";
2
+ import { analyzeScopes, walkWithScope } from "./scope.js";
3
+ import { ELEMENT_TAGS, HELPER_TYPE_NAMES, isEffectUiSource } from "./tags.js";
4
+ export function analyzeModule(program) {
5
+ const index = analyzeScopes(program);
6
+ const helpers = new Set();
7
+ const definitionCalls = new Map();
8
+ const calls = [];
9
+ walkWithScope(program, index, (node, _parent, scope) => {
10
+ if (node.type === "CallExpression") {
11
+ const definition = componentDefinitionOf(node, scope);
12
+ if (definition) {
13
+ definitionCalls.set(node, definition);
14
+ }
15
+ calls.push({ node, scope });
16
+ }
17
+ if (isFunction(node)) {
18
+ markTypedParameters(node, index, helpers);
19
+ }
20
+ });
21
+ const context = { index, helpers, definitionCalls };
22
+ for (const call of calls) {
23
+ seedFromDefinitionMethods(call, context);
24
+ }
25
+ propagate(calls, context);
26
+ return {
27
+ ...collectSites(program, context),
28
+ definitions: [...definitionCalls.values()],
29
+ };
30
+ }
31
+ // `Html.component({ name: "…" })`, `Component.define({ name: "…" })`, or
32
+ // either imported by name, from an effect/ui module.
33
+ function componentDefinitionOf(call, scope) {
34
+ const callee = unwrap(child(call, "callee"));
35
+ const constructorName = callee?.type === "MemberExpression" && !callee.computed
36
+ ? importedFromEffectUi(child(callee, "object"), scope)
37
+ ? nameOf(child(callee, "property"))
38
+ : null
39
+ : callee?.type === "Identifier"
40
+ ? effectUiImportName(callee, scope)
41
+ : null;
42
+ if (constructorName !== "component" && constructorName !== "define") {
43
+ return null;
44
+ }
45
+ const options = unwrap(children(call, "arguments")[0] ?? null);
46
+ if (options?.type !== "ObjectExpression") {
47
+ return null;
48
+ }
49
+ for (const property of children(options, "properties")) {
50
+ if (property.type === "Property" && propertyKey(property) === "name") {
51
+ const name = stringValue(unwrap(child(property, "value")));
52
+ const callStart = callee?.start ?? call.start;
53
+ return name ? { name, position: callStart } : null;
54
+ }
55
+ }
56
+ return null;
57
+ }
58
+ function importedFromEffectUi(node, scope) {
59
+ const name = nameOf(node);
60
+ const binding = name ? scope.lookup(name) : undefined;
61
+ return binding?.kind === "import" && isEffectUiSource(binding.importSource);
62
+ }
63
+ function effectUiImportName(node, scope) {
64
+ const name = nameOf(node);
65
+ const binding = name ? scope.lookup(name) : undefined;
66
+ return binding?.kind === "import" && isEffectUiSource(binding.importSource)
67
+ ? (binding.importedName ?? null)
68
+ : null;
69
+ }
70
+ function propertyKey(property) {
71
+ if (property.computed === true) {
72
+ return null;
73
+ }
74
+ const key = child(property, "key");
75
+ return nameOf(key) ?? stringValue(key);
76
+ }
77
+ // A parameter typed `Html.H<M>`, `View.Helper<…>` and the like is an `h`.
78
+ function markTypedParameters(fn, index, helpers) {
79
+ const scope = index.scopeOf.get(fn);
80
+ if (!scope) {
81
+ return;
82
+ }
83
+ for (const param of parametersOf(fn)) {
84
+ const identifier = parameterIdentifier(param);
85
+ const name = nameOf(identifier);
86
+ const annotation = child(child(identifier ?? param, "typeAnnotation") ?? param, "typeAnnotation");
87
+ if (name && annotation && isHelperType(annotation, scope)) {
88
+ const binding = scope.bindings.get(name);
89
+ if (binding) {
90
+ helpers.add(binding);
91
+ }
92
+ }
93
+ }
94
+ }
95
+ function isHelperType(type, scope) {
96
+ if (type.type !== "TSTypeReference") {
97
+ return false;
98
+ }
99
+ const typeName = child(type, "typeName");
100
+ if (typeName?.type === "TSQualifiedName") {
101
+ const right = nameOf(child(typeName, "right"));
102
+ return (right !== null &&
103
+ HELPER_TYPE_NAMES.has(right) &&
104
+ importedFromEffectUi(child(typeName, "left"), scope));
105
+ }
106
+ if (typeName?.type === "Identifier") {
107
+ const imported = effectUiImportName(typeName, scope);
108
+ return imported !== null && HELPER_TYPE_NAMES.has(imported);
109
+ }
110
+ return false;
111
+ }
112
+ /** Whether an expression is a component definition: the call itself or a binding of it. */
113
+ function isDefinition(node, scope, context) {
114
+ const expression = unwrap(node);
115
+ if (!expression) {
116
+ return false;
117
+ }
118
+ if (context.definitionCalls.has(expression)) {
119
+ return true;
120
+ }
121
+ const name = nameOf(expression);
122
+ const declarator = name ? scope.lookup(name)?.declarator : undefined;
123
+ const init = declarator ? unwrap(child(declarator, "init")) : null;
124
+ return init !== null && context.definitionCalls.has(init);
125
+ }
126
+ // `Def.make({ view })`, `Def.view(fn)` and `Def.fragment(fn)` hand `h` to
127
+ // their function first.
128
+ function seedFromDefinitionMethods(call, context) {
129
+ const callee = unwrap(child(call.node, "callee"));
130
+ if (callee?.type !== "MemberExpression" || callee.computed === true) {
131
+ return;
132
+ }
133
+ const method = nameOf(child(callee, "property"));
134
+ if (!isDefinition(child(callee, "object"), call.scope, context)) {
135
+ return;
136
+ }
137
+ const first = children(call.node, "arguments")[0] ?? null;
138
+ if (method === "view" || method === "fragment") {
139
+ markParameter(resolveFunction(first, call.scope, context), 0, context);
140
+ return;
141
+ }
142
+ const options = unwrap(first);
143
+ if (method !== "make" || options?.type !== "ObjectExpression") {
144
+ return;
145
+ }
146
+ for (const property of children(options, "properties")) {
147
+ if (property.type === "Property" && propertyKey(property) === "view") {
148
+ markParameter(resolveFunction(child(property, "value"), call.scope, context), 0, context);
149
+ }
150
+ }
151
+ }
152
+ /**
153
+ * The function an expression names in this module: an inline function, a
154
+ * function declaration, a variable bound to one, or a variable bound to
155
+ * `Def.view(fn)` or `Def.fragment(fn)`.
156
+ */
157
+ function resolveFunction(node, scope, context) {
158
+ const expression = unwrap(node);
159
+ if (isFunction(expression)) {
160
+ return expression;
161
+ }
162
+ const name = nameOf(expression);
163
+ const binding = name ? scope.lookup(name) : undefined;
164
+ if (binding?.fn) {
165
+ return binding.fn;
166
+ }
167
+ const init = binding?.declarator
168
+ ? unwrap(child(binding.declarator, "init"))
169
+ : null;
170
+ if (isFunction(init)) {
171
+ return init;
172
+ }
173
+ if (init?.type === "CallExpression") {
174
+ const callee = unwrap(child(init, "callee"));
175
+ const method = callee?.type === "MemberExpression"
176
+ ? nameOf(child(callee, "property"))
177
+ : null;
178
+ const wrapped = unwrap(children(init, "arguments")[0] ?? null);
179
+ if ((method === "view" || method === "fragment") &&
180
+ isDefinition(child(callee ?? init, "object"), scope, context) &&
181
+ isFunction(wrapped)) {
182
+ return wrapped;
183
+ }
184
+ }
185
+ return null;
186
+ }
187
+ function markParameter(fn, position, context) {
188
+ if (!fn) {
189
+ return false;
190
+ }
191
+ const scope = context.index.scopeOf.get(fn);
192
+ const param = parametersOf(fn)[position];
193
+ const name = param ? nameOf(parameterIdentifier(param)) : null;
194
+ const binding = name ? scope?.bindings.get(name) : undefined;
195
+ if (!binding || context.helpers.has(binding)) {
196
+ return false;
197
+ }
198
+ context.helpers.add(binding);
199
+ return true;
200
+ }
201
+ function isHelper(node, scope, context) {
202
+ const name = nameOf(node);
203
+ const binding = name ? scope.lookup(name) : undefined;
204
+ return binding !== undefined && context.helpers.has(binding);
205
+ }
206
+ // Follows `h` into this module's functions until nothing changes: a local
207
+ // function called with `h` takes it at that position, and `h.lazy(fn)`
208
+ // passes it to `fn` first.
209
+ function propagate(calls, context) {
210
+ let changed = true;
211
+ while (changed) {
212
+ changed = false;
213
+ for (const { node, scope } of calls) {
214
+ const callee = unwrap(child(node, "callee"));
215
+ const args = children(node, "arguments");
216
+ if (callee?.type === "MemberExpression" &&
217
+ callee.computed !== true &&
218
+ nameOf(child(callee, "property")) === "lazy" &&
219
+ isHelper(child(callee, "object"), scope, context)) {
220
+ changed =
221
+ markParameter(resolveFunction(args[0] ?? null, scope, context), 0, context) || changed;
222
+ continue;
223
+ }
224
+ const fn = callee?.type === "Identifier"
225
+ ? resolveFunction(callee, scope, context)
226
+ : null;
227
+ if (!fn) {
228
+ continue;
229
+ }
230
+ args.forEach((arg, argIndex) => {
231
+ if (isHelper(arg, scope, context)) {
232
+ changed = markParameter(fn, argIndex, context) || changed;
233
+ }
234
+ });
235
+ }
236
+ }
237
+ }
238
+ function collectSites(program, context) {
239
+ const sites = [];
240
+ const skipped = [];
241
+ walkWithScope(program, context.index, (node, parent, scope) => {
242
+ if (node.type === "MemberExpression" &&
243
+ isHelper(child(node, "object"), scope, context)) {
244
+ collectMemberSite(node, parent, sites, skipped);
245
+ return;
246
+ }
247
+ if (node.type === "CallExpression" &&
248
+ isExternalCall(node, scope, context)) {
249
+ sites.push({
250
+ kind: "external",
251
+ start: node.start,
252
+ end: node.end,
253
+ position: node.start,
254
+ });
255
+ }
256
+ });
257
+ return { sites, skipped };
258
+ }
259
+ function collectMemberSite(member, parent, sites, skipped) {
260
+ const name = nameOf(child(member, "property"));
261
+ if (member.computed === true) {
262
+ skipped.push({ reason: "computed-member", position: member.start });
263
+ return;
264
+ }
265
+ const isCallee = parent?.type === "CallExpression" && child(parent, "callee") === member;
266
+ if (name === "el") {
267
+ if (isCallee && parent.optional !== true) {
268
+ sites.push({ kind: "el", at: parent.end, position: parent.start });
269
+ }
270
+ return;
271
+ }
272
+ if (!name || !ELEMENT_TAGS.has(name)) {
273
+ return;
274
+ }
275
+ if (isCallee) {
276
+ if (parent.optional === true) {
277
+ skipped.push({ reason: "optional-call", position: member.start });
278
+ return;
279
+ }
280
+ sites.push({ kind: "call", at: member.end, position: member.start });
281
+ return;
282
+ }
283
+ if (parent?.type === "MemberExpression" &&
284
+ child(parent, "object") === member) {
285
+ sites.push({ kind: "chain", at: member.end, position: member.start });
286
+ return;
287
+ }
288
+ if (isAssignmentTarget(member, parent)) {
289
+ skipped.push({ reason: "assignment-target", position: member.start });
290
+ return;
291
+ }
292
+ sites.push({
293
+ kind: "value",
294
+ start: member.start,
295
+ end: member.end,
296
+ position: member.start,
297
+ });
298
+ }
299
+ function isAssignmentTarget(member, parent) {
300
+ return ((parent?.type === "AssignmentExpression" &&
301
+ child(parent, "left") === member) ||
302
+ parent?.type === "UpdateExpression" ||
303
+ (parent?.type === "UnaryExpression" && parent.operator === "delete"));
304
+ }
305
+ // A call that receives `h` and whose body this module can't follow.
306
+ function isExternalCall(call, scope, context) {
307
+ if (call.optional === true) {
308
+ return false;
309
+ }
310
+ const args = children(call, "arguments");
311
+ if (!args.some((arg) => isHelper(arg, scope, context))) {
312
+ return false;
313
+ }
314
+ const callee = unwrap(child(call, "callee"));
315
+ if (!callee || callee.type === "Super" || callee.type === "Import") {
316
+ return false;
317
+ }
318
+ if (callee.type === "MemberExpression" &&
319
+ isHelper(child(callee, "object"), scope, context)) {
320
+ return false;
321
+ }
322
+ return resolveFunction(callee, scope, context) === null;
323
+ }
324
+ //# sourceMappingURL=analyze.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze.js","sourceRoot":"","sources":["../../src/vite/analyze.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EACL,QAAQ,EACR,UAAU,EACV,MAAM,EACN,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,MAAM,GACP,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAgD9E,MAAM,UAAU,aAAa,CAAC,OAAgB;IAC5C,MAAM,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AQ,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,EACjD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * A minimal view of the ESTree (with TypeScript extensions) that Vite's
3
+ * parser returns, and a walker over it. Offsets are UTF-16 indexes into the
4
+ * parsed code.
5
+ */
6
+ export type AstNode = {
7
+ readonly type: string;
8
+ readonly start: number;
9
+ readonly end: number;
10
+ readonly [key: string]: unknown;
11
+ };
12
+ export declare function isNode(value: unknown): value is AstNode;
13
+ export declare function child(node: AstNode, key: string): AstNode | null;
14
+ export declare function children(node: AstNode, key: string): AstNode[];
15
+ export declare function nameOf(node: AstNode | null): string | null;
16
+ /** The value of a string literal, or a template literal without expressions. */
17
+ export declare function stringValue(node: AstNode | null): string | null;
18
+ /** Strips parentheses and TypeScript-only wrappers such as `as` and `satisfies`. */
19
+ export declare function unwrap(node: AstNode | null): AstNode | null;
20
+ export declare const FUNCTION_TYPES: Set<string>;
21
+ declare const functionBrand: unique symbol;
22
+ /** A function declaration, function expression or arrow function. */
23
+ export type FunctionNode = AstNode & {
24
+ readonly [functionBrand]: true;
25
+ };
26
+ export declare function isFunction(node: AstNode | null): node is FunctionNode;
27
+ /** A function's parameters without a TypeScript `this` parameter. */
28
+ export declare function parametersOf(fn: AstNode): AstNode[];
29
+ /** The plain identifier a parameter binds, through a default value or a TS parameter property. */
30
+ export declare function parameterIdentifier(param: AstNode): AstNode | null;
31
+ export type Visitor = {
32
+ /** Return `false` to skip the node's children. */
33
+ readonly enter?: (node: AstNode, parent: AstNode | null) => unknown;
34
+ readonly leave?: (node: AstNode, parent: AstNode | null) => void;
35
+ };
36
+ export declare function walk(root: AstNode, visitor: Visitor): void;
37
+ export {};
38
+ //# sourceMappingURL=ast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":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