@doweljs/vite 0.0.0-stage → 0.2.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 +21 -0
- package/README.md +47 -2
- package/dist/analysis/analyze.d.ts +62 -0
- package/dist/analysis/analyze.d.ts.map +1 -0
- package/dist/analysis/analyze.js +396 -0
- package/dist/analysis/analyze.js.map +1 -0
- package/dist/analysis/registry.d.ts +74 -0
- package/dist/analysis/registry.d.ts.map +1 -0
- package/dist/analysis/registry.js +195 -0
- package/dist/analysis/registry.js.map +1 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +112 -0
- package/dist/index.js.map +1 -0
- package/dist/inject.d.ts +21 -0
- package/dist/inject.d.ts.map +1 -0
- package/dist/inject.js +33 -0
- package/dist/inject.js.map +1 -0
- package/dist/overlay.d.ts +15 -0
- package/dist/overlay.d.ts.map +1 -0
- package/dist/overlay.js +19 -0
- package/dist/overlay.js.map +1 -0
- package/package.json +39 -5
- package/src/analysis/analyze.ts +475 -0
- package/src/analysis/registry.ts +239 -0
- package/src/index.ts +155 -0
- package/src/inject.ts +48 -0
- package/src/overlay.ts +27 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jack Weilage
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,48 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @doweljs/vite
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Vite integration for [dowel](../dowel): hot replacement of services, and diagnostics for the dependency graph.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
// vite.config.ts
|
|
7
|
+
import dowel from '@doweljs/vite'
|
|
8
|
+
import { defineConfig } from 'vite'
|
|
9
|
+
|
|
10
|
+
export default defineConfig({ plugins: [dowel()] })
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Hot replacement
|
|
14
|
+
|
|
15
|
+
Edit a module, and every declaration in it is swapped inside every live container, in every environment (client and SSR alike), without a reload:
|
|
16
|
+
|
|
17
|
+
- Services that depend on what changed are recreated.
|
|
18
|
+
- Instances declared in untouched modules, such as a database connection, stay alive.
|
|
19
|
+
- Opened containers are disposed, so the next request sees the new code.
|
|
20
|
+
|
|
21
|
+
The terminal and the browser console log each swap, as in `[dowel] replaced Users`.
|
|
22
|
+
|
|
23
|
+
The new generation is initialized before the old one is torn down. If it fails, because of an unbound slot or a factory that throws, Vite's error overlay shows why, and the container keeps running its previous generation. [`@doweljs/devtools`](../devtools) marks the container as failed until an update succeeds.
|
|
24
|
+
|
|
25
|
+
A module accepts its own updates when every export is a slot, service, scope or execution, and it doesn't build a container. Other modules fall back to Vite's normal propagation, which still updates containers once it reaches a module that accepts. Set `hot: 'always'` to make every declaring module accept its own updates, or `hot: false` to inject nothing.
|
|
26
|
+
|
|
27
|
+
## Diagnostics
|
|
28
|
+
|
|
29
|
+
When two modules declare a slot or service with the same name, the plugin warns at transform time and names both locations. Hot replacement identifies nodes by name, so it would treat the two as one.
|
|
30
|
+
|
|
31
|
+
## Options
|
|
32
|
+
|
|
33
|
+
| Option | Default | Description |
|
|
34
|
+
| --------- | ------------------- | ----------------------------------------------------- |
|
|
35
|
+
| `hot` | `'auto'` | `'auto'`, `'always'` or `false`. See above. |
|
|
36
|
+
| `include` | `/\.[cm]?[jt]sx?$/` | Module ids to analyze. |
|
|
37
|
+
| `exclude` | none | Module ids to skip. `node_modules` is always skipped. |
|
|
38
|
+
|
|
39
|
+
Other plugins reach this one through its `api`:
|
|
40
|
+
|
|
41
|
+
- `api.graph()` returns the dependency graph known from static analysis.
|
|
42
|
+
- `api.addClientModule(id)` makes every module with hot code also import the module `id`.
|
|
43
|
+
|
|
44
|
+
## How it works
|
|
45
|
+
|
|
46
|
+
The plugin only recognizes top-level declarations: `const X = service(…)`, `const T = slot(…)()`, `const S = scope(…)` and `const E = execution(…)`. That restriction is what makes the graph knowable without running any code.
|
|
47
|
+
|
|
48
|
+
In development, the plugin appends a snippet to each module that declares nodes. After every evaluation, the snippet registers the module's declarations with `@doweljs/core/hot`. Production builds are left untouched.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static analysis of a module's dowel declarations.
|
|
3
|
+
*
|
|
4
|
+
* Only top-level `const X = service(...)` / `slot(...)()` declarations are
|
|
5
|
+
* recognized. That is deliberate: a dependency graph declared at the top
|
|
6
|
+
* level of a module is what makes hot replacement and devtools possible without running
|
|
7
|
+
* the code.
|
|
8
|
+
*/
|
|
9
|
+
/** A reference a static graph can follow: a local identifier, or a member of a namespace import (`ns.Name`). */
|
|
10
|
+
export interface Ref {
|
|
11
|
+
readonly local: string;
|
|
12
|
+
readonly member: string | null;
|
|
13
|
+
}
|
|
14
|
+
interface DepRef {
|
|
15
|
+
readonly key: string;
|
|
16
|
+
/** What the dependency refers to; `null` when the edge is kept but cannot be resolved statically. */
|
|
17
|
+
readonly ref: Ref | null;
|
|
18
|
+
readonly optional: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface Declaration {
|
|
21
|
+
readonly local: string;
|
|
22
|
+
readonly kind: 'slot' | 'service' | 'scope' | 'execution';
|
|
23
|
+
readonly name: string;
|
|
24
|
+
/** The scope name when it is known statically: `root` for a slot or scope declared without one. */
|
|
25
|
+
readonly scope: string | null;
|
|
26
|
+
/** A slot's or service's `scope` option, or a scope's parent. */
|
|
27
|
+
readonly scopeRef: Ref | null;
|
|
28
|
+
/** Whether a slot is a multi-binding; null when its options cannot be read. */
|
|
29
|
+
readonly many: boolean | null;
|
|
30
|
+
readonly deps: readonly DepRef[];
|
|
31
|
+
/** Offsets of the declaring call in the code this plugin received, after earlier transforms. */
|
|
32
|
+
readonly start: number;
|
|
33
|
+
readonly end: number;
|
|
34
|
+
}
|
|
35
|
+
interface ImportRef {
|
|
36
|
+
readonly source: string;
|
|
37
|
+
/** Exported name in the source module (`default` for default imports). */
|
|
38
|
+
readonly imported: string;
|
|
39
|
+
}
|
|
40
|
+
export interface ModuleAnalysis {
|
|
41
|
+
readonly declarations: readonly Declaration[];
|
|
42
|
+
/** Local name to the import it comes from, for resolving dependency references. */
|
|
43
|
+
readonly imports: ReadonlyMap<string, ImportRef>;
|
|
44
|
+
/** Exported name to local name. */
|
|
45
|
+
readonly exports: ReadonlyMap<string, string>;
|
|
46
|
+
/** Exported name to what it re-exports: `export { Db } from '../db'`, `export * as ns from`. */
|
|
47
|
+
readonly reexports: ReadonlyMap<string, ImportRef>;
|
|
48
|
+
/** Sources of `export * from` statements, searched in order for names not exported otherwise. */
|
|
49
|
+
readonly stars: readonly string[];
|
|
50
|
+
/**
|
|
51
|
+
* True when every export is a dowel declaration, so the module can accept
|
|
52
|
+
* its own hot updates without leaving importers with stale values.
|
|
53
|
+
*/
|
|
54
|
+
readonly selfContained: boolean;
|
|
55
|
+
/** True when the module calls `container()`, which makes it an app root. */
|
|
56
|
+
readonly buildsContainer: boolean;
|
|
57
|
+
}
|
|
58
|
+
/** Cheap pre-check so most modules never reach the parser: they neither use dowel nor re-export. */
|
|
59
|
+
export declare function mayDeclare(code: string): boolean;
|
|
60
|
+
export declare function analyze(id: string, code: string): ModuleAnalysis | null;
|
|
61
|
+
export {};
|
|
62
|
+
//# sourceMappingURL=analyze.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/analysis/analyze.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,gHAAgH;AAChH,MAAM,WAAW,GAAG;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B;AAED,UAAU,MAAM;IACf,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,qGAAqG;IACrG,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAAA;IACxB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;CAC1B;AAED,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,CAAA;IACzD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,mGAAmG;IACnG,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,iEAAiE;IACjE,QAAQ,CAAC,QAAQ,EAAE,GAAG,GAAG,IAAI,CAAA;IAC7B,+EAA+E;IAC/E,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAA;IAC7B,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;IAChC,gGAAgG;IAChG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CACpB;AAED,UAAU,SAAS;IAClB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,YAAY,EAAE,SAAS,WAAW,EAAE,CAAA;IAC7C,mFAAmF;IACnF,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IAChD,mCAAmC;IACnC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7C,gGAAgG;IAChG,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IAClD,iGAAiG;IACjG,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC;;;OAGG;IACH,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;IAC/B,4EAA4E;IAC5E,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAA;CACjC;AAkBD,oGAAoG;AACpG,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAgGvE"}
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static analysis of a module's dowel declarations.
|
|
3
|
+
*
|
|
4
|
+
* Only top-level `const X = service(...)` / `slot(...)()` declarations are
|
|
5
|
+
* recognized. That is deliberate: a dependency graph declared at the top
|
|
6
|
+
* level of a module is what makes hot replacement and devtools possible without running
|
|
7
|
+
* the code.
|
|
8
|
+
*/
|
|
9
|
+
import { parseSync } from 'vite';
|
|
10
|
+
const DOWEL_EXPORTS = ['service', 'slot', 'optional', 'container', 'scope', 'execution'];
|
|
11
|
+
const isDowelExport = (name) => DOWEL_EXPORTS.includes(name);
|
|
12
|
+
const REEXPORT = /\bexport\s*(?:\*|\{[^}]*\})\s*(?:as\s+\w+\s*)?from\b/;
|
|
13
|
+
/** Cheap pre-check so most modules never reach the parser: they neither use dowel nor re-export. */
|
|
14
|
+
export function mayDeclare(code) {
|
|
15
|
+
return code.includes('@doweljs/core') || REEXPORT.test(code);
|
|
16
|
+
}
|
|
17
|
+
export function analyze(id, code) {
|
|
18
|
+
const { program, errors } = parseSync(id, code);
|
|
19
|
+
if (errors.length > 0)
|
|
20
|
+
return null;
|
|
21
|
+
const dowel = collectDowelImports(program);
|
|
22
|
+
const declarations = [];
|
|
23
|
+
const imports = new Map();
|
|
24
|
+
const exports = new Map();
|
|
25
|
+
const reexports = new Map();
|
|
26
|
+
const stars = [];
|
|
27
|
+
// Whether the module exports anything besides its dowel declarations.
|
|
28
|
+
let mixed = false;
|
|
29
|
+
for (const statement of program.body) {
|
|
30
|
+
switch (statement.type) {
|
|
31
|
+
case 'ImportDeclaration':
|
|
32
|
+
for (const specifier of statement.specifiers) {
|
|
33
|
+
const imported = specifier.type === 'ImportSpecifier'
|
|
34
|
+
? moduleExportName(specifier.imported)
|
|
35
|
+
: specifier.type === 'ImportDefaultSpecifier'
|
|
36
|
+
? 'default'
|
|
37
|
+
: '*';
|
|
38
|
+
imports.set(specifier.local.name, { source: statement.source.value, imported });
|
|
39
|
+
}
|
|
40
|
+
break;
|
|
41
|
+
case 'VariableDeclaration':
|
|
42
|
+
declarations.push(...declarationsOf(statement, dowel));
|
|
43
|
+
break;
|
|
44
|
+
case 'ExportNamedDeclaration': {
|
|
45
|
+
const { declaration } = statement;
|
|
46
|
+
if (declaration?.type === 'VariableDeclaration') {
|
|
47
|
+
const found = declarationsOf(declaration, dowel);
|
|
48
|
+
declarations.push(...found);
|
|
49
|
+
for (const declarator of declaration.declarations) {
|
|
50
|
+
for (const name of boundNames(declarator.id)) {
|
|
51
|
+
exports.set(name, name);
|
|
52
|
+
if (!found.some((d) => d.local === name))
|
|
53
|
+
mixed = true;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else if (declaration !== null) {
|
|
58
|
+
mixed = true;
|
|
59
|
+
}
|
|
60
|
+
else if (statement.source !== null) {
|
|
61
|
+
mixed = true;
|
|
62
|
+
for (const specifier of statement.specifiers) {
|
|
63
|
+
reexports.set(moduleExportName(specifier.exported), {
|
|
64
|
+
source: statement.source.value,
|
|
65
|
+
imported: moduleExportName(specifier.local),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
for (const specifier of statement.specifiers) {
|
|
71
|
+
exports.set(moduleExportName(specifier.exported), moduleExportName(specifier.local));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
case 'ExportDefaultDeclaration':
|
|
77
|
+
if (statement.declaration.type === 'Identifier') {
|
|
78
|
+
exports.set('default', statement.declaration.name);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
mixed = true;
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
case 'ExportAllDeclaration':
|
|
85
|
+
mixed = true;
|
|
86
|
+
if (statement.exported === null)
|
|
87
|
+
stars.push(statement.source.value);
|
|
88
|
+
else {
|
|
89
|
+
reexports.set(moduleExportName(statement.exported), {
|
|
90
|
+
source: statement.source.value,
|
|
91
|
+
imported: '*',
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
break;
|
|
95
|
+
default:
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (dowel.size === 0 && reexports.size === 0 && stars.length === 0)
|
|
100
|
+
return null;
|
|
101
|
+
const locals = new Set(declarations.map((d) => d.local));
|
|
102
|
+
for (const local of exports.values())
|
|
103
|
+
if (!locals.has(local))
|
|
104
|
+
mixed = true;
|
|
105
|
+
const containerLocal = [...dowel].find(([, name]) => name === 'container')?.[0];
|
|
106
|
+
const buildsContainer = containerLocal !== undefined && callsIdentifier(program, containerLocal);
|
|
107
|
+
return {
|
|
108
|
+
declarations,
|
|
109
|
+
imports,
|
|
110
|
+
exports,
|
|
111
|
+
reexports,
|
|
112
|
+
stars,
|
|
113
|
+
selfContained: !mixed && !buildsContainer,
|
|
114
|
+
buildsContainer,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
/** `Name` or `ns.Name`, the references a static graph can follow. */
|
|
118
|
+
function refOf(node) {
|
|
119
|
+
const value = unwrap(node);
|
|
120
|
+
if (value.type === 'Identifier')
|
|
121
|
+
return { local: value.name, member: null };
|
|
122
|
+
if (value.type === 'MemberExpression' &&
|
|
123
|
+
!value.computed &&
|
|
124
|
+
value.object.type === 'Identifier' &&
|
|
125
|
+
value.property.type === 'Identifier') {
|
|
126
|
+
return { local: value.object.name, member: value.property.name };
|
|
127
|
+
}
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* The properties of an options object literal by key: empty when there are
|
|
132
|
+
* no options, null when the analysis cannot read all of them (not a literal,
|
|
133
|
+
* or a literal with spread or computed properties).
|
|
134
|
+
*/
|
|
135
|
+
function optionsOf(node) {
|
|
136
|
+
if (node === undefined)
|
|
137
|
+
return new Map();
|
|
138
|
+
const options = unwrap(node);
|
|
139
|
+
if (options.type !== 'ObjectExpression')
|
|
140
|
+
return null;
|
|
141
|
+
const properties = new Map();
|
|
142
|
+
for (const property of options.properties) {
|
|
143
|
+
if (property.type !== 'Property' || property.computed)
|
|
144
|
+
return null;
|
|
145
|
+
const key = propertyKey(property.key);
|
|
146
|
+
if (key === null)
|
|
147
|
+
return null;
|
|
148
|
+
properties.set(key, unwrap(property.value));
|
|
149
|
+
}
|
|
150
|
+
return properties;
|
|
151
|
+
}
|
|
152
|
+
/** `true` or `false` when the option is absent or a boolean literal; null when it cannot be read. */
|
|
153
|
+
function literalFlag(node) {
|
|
154
|
+
if (node === undefined)
|
|
155
|
+
return false;
|
|
156
|
+
return node.type === 'Literal' && typeof node.value === 'boolean' ? node.value : null;
|
|
157
|
+
}
|
|
158
|
+
/** A scope argument: absent (the default), a reference to resolve, or an expression that cannot be followed. */
|
|
159
|
+
function scopeArgument(node, fallback) {
|
|
160
|
+
if (node === undefined)
|
|
161
|
+
return { scope: fallback, scopeRef: null };
|
|
162
|
+
return { scope: null, scopeRef: refOf(node) };
|
|
163
|
+
}
|
|
164
|
+
function collectDowelImports(program) {
|
|
165
|
+
const result = new Map();
|
|
166
|
+
for (const statement of program.body) {
|
|
167
|
+
if (statement.type !== 'ImportDeclaration' || statement.source.value !== '@doweljs/core')
|
|
168
|
+
continue;
|
|
169
|
+
for (const specifier of statement.specifiers) {
|
|
170
|
+
if (specifier.type !== 'ImportSpecifier')
|
|
171
|
+
continue;
|
|
172
|
+
const imported = moduleExportName(specifier.imported);
|
|
173
|
+
if (isDowelExport(imported))
|
|
174
|
+
result.set(specifier.local.name, imported);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return result;
|
|
178
|
+
}
|
|
179
|
+
function declarationsOf(statement, dowel) {
|
|
180
|
+
const found = [];
|
|
181
|
+
for (const declarator of statement.declarations) {
|
|
182
|
+
if (declarator.id.type !== 'Identifier' || declarator.init === null)
|
|
183
|
+
continue;
|
|
184
|
+
const init = unwrap(declarator.init);
|
|
185
|
+
if (init.type !== 'CallExpression')
|
|
186
|
+
continue;
|
|
187
|
+
const declaration = parseService(declarator.id.name, init, dowel) ??
|
|
188
|
+
parseSlot(declarator.id.name, init, dowel) ??
|
|
189
|
+
parseScope(declarator.id.name, init, dowel) ??
|
|
190
|
+
parseExecution(declarator.id.name, init, dowel);
|
|
191
|
+
if (declaration !== null)
|
|
192
|
+
found.push(declaration);
|
|
193
|
+
}
|
|
194
|
+
return found;
|
|
195
|
+
}
|
|
196
|
+
/** `service('Name', deps?, factory, options?)` */
|
|
197
|
+
function parseService(local, call, dowel) {
|
|
198
|
+
if (call.callee.type !== 'Identifier' || dowel.get(call.callee.name) !== 'service')
|
|
199
|
+
return null;
|
|
200
|
+
const [nameArg, second, third, fourth] = call.arguments;
|
|
201
|
+
const name = stringValue(nameArg);
|
|
202
|
+
if (name === null)
|
|
203
|
+
return null;
|
|
204
|
+
const hasDeps = second?.type === 'ObjectExpression';
|
|
205
|
+
const options = hasDeps ? fourth : third;
|
|
206
|
+
const deps = [];
|
|
207
|
+
if (hasDeps) {
|
|
208
|
+
for (const property of second.properties) {
|
|
209
|
+
if (property.type !== 'Property' || property.computed)
|
|
210
|
+
continue;
|
|
211
|
+
const key = propertyKey(property.key);
|
|
212
|
+
if (key === null)
|
|
213
|
+
continue;
|
|
214
|
+
const value = unwrap(property.value);
|
|
215
|
+
const isOptional = value.type === 'CallExpression' &&
|
|
216
|
+
value.callee.type === 'Identifier' &&
|
|
217
|
+
dowel.get(value.callee.name) === 'optional';
|
|
218
|
+
const target = isOptional ? value.arguments[0] : value;
|
|
219
|
+
deps.push({
|
|
220
|
+
key,
|
|
221
|
+
ref: target === undefined || target.type === 'SpreadElement' ? null : refOf(target),
|
|
222
|
+
optional: isOptional,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return {
|
|
227
|
+
local,
|
|
228
|
+
kind: 'service',
|
|
229
|
+
name,
|
|
230
|
+
...scopeArgument(optionsOf(options)?.get('scope'), null),
|
|
231
|
+
many: false,
|
|
232
|
+
deps,
|
|
233
|
+
start: call.start,
|
|
234
|
+
end: call.end,
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
/** `slot('Name', options?)()` */
|
|
238
|
+
function parseSlot(local, call, dowel) {
|
|
239
|
+
const inner = unwrap(call.callee);
|
|
240
|
+
if (inner.type !== 'CallExpression')
|
|
241
|
+
return null;
|
|
242
|
+
if (inner.callee.type !== 'Identifier' || dowel.get(inner.callee.name) !== 'slot')
|
|
243
|
+
return null;
|
|
244
|
+
const [nameArg, optionsArg] = inner.arguments;
|
|
245
|
+
const name = stringValue(nameArg);
|
|
246
|
+
if (name === null)
|
|
247
|
+
return null;
|
|
248
|
+
const options = optionsOf(optionsArg);
|
|
249
|
+
return {
|
|
250
|
+
local,
|
|
251
|
+
kind: 'slot',
|
|
252
|
+
name,
|
|
253
|
+
// Options the analysis cannot read leave the scope unknown.
|
|
254
|
+
...(options === null
|
|
255
|
+
? { scope: null, scopeRef: null }
|
|
256
|
+
: scopeArgument(options.get('scope'), 'root')),
|
|
257
|
+
many: options === null ? null : literalFlag(options.get('many')),
|
|
258
|
+
deps: [],
|
|
259
|
+
start: call.start,
|
|
260
|
+
end: call.end,
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
/** `scope('name', Parent?)` */
|
|
264
|
+
function parseScope(local, call, dowel) {
|
|
265
|
+
if (call.callee.type !== 'Identifier' || dowel.get(call.callee.name) !== 'scope')
|
|
266
|
+
return null;
|
|
267
|
+
const name = stringValue(call.arguments[0]);
|
|
268
|
+
if (name === null)
|
|
269
|
+
return null;
|
|
270
|
+
const parent = call.arguments[1];
|
|
271
|
+
return {
|
|
272
|
+
local,
|
|
273
|
+
kind: 'scope',
|
|
274
|
+
name,
|
|
275
|
+
...scopeArgument(parent?.type === 'SpreadElement' ? undefined : parent, 'root'),
|
|
276
|
+
many: false,
|
|
277
|
+
deps: [],
|
|
278
|
+
start: call.start,
|
|
279
|
+
end: call.end,
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
/** `execution('Name', { scope: S, entry: E, inputs: { key: Slot } })` */
|
|
283
|
+
function parseExecution(local, call, dowel) {
|
|
284
|
+
if (call.callee.type !== 'Identifier' || dowel.get(call.callee.name) !== 'execution')
|
|
285
|
+
return null;
|
|
286
|
+
const name = stringValue(call.arguments[0]);
|
|
287
|
+
if (name === null)
|
|
288
|
+
return null;
|
|
289
|
+
// Options it cannot read still declare the execution; its scope and dependencies stay unknown.
|
|
290
|
+
const options = optionsOf(call.arguments[1]) ?? new Map();
|
|
291
|
+
const scope = options.get('scope');
|
|
292
|
+
const entry = options.get('entry');
|
|
293
|
+
const inputs = options.get('inputs');
|
|
294
|
+
const deps = [];
|
|
295
|
+
if (entry !== undefined)
|
|
296
|
+
deps.push({ key: 'entry', ref: refOf(entry), optional: false });
|
|
297
|
+
// Keyed as at runtime, by the key each run passes the input's value under.
|
|
298
|
+
for (const [key, input] of optionsOf(inputs) ?? []) {
|
|
299
|
+
deps.push({ key, ref: refOf(input), optional: false });
|
|
300
|
+
}
|
|
301
|
+
return {
|
|
302
|
+
local,
|
|
303
|
+
kind: 'execution',
|
|
304
|
+
name,
|
|
305
|
+
// Known once its scope reference resolves: the parent of the scope its runs open containers for.
|
|
306
|
+
scope: null,
|
|
307
|
+
scopeRef: scope === undefined ? null : refOf(scope),
|
|
308
|
+
many: false,
|
|
309
|
+
deps,
|
|
310
|
+
start: call.start,
|
|
311
|
+
end: call.end,
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
/** Strips TypeScript wrappers that may survive transpilation, such as `satisfies`. */
|
|
315
|
+
function unwrap(node) {
|
|
316
|
+
let current = node;
|
|
317
|
+
for (;;) {
|
|
318
|
+
switch (current.type) {
|
|
319
|
+
case 'ParenthesizedExpression':
|
|
320
|
+
case 'TSAsExpression':
|
|
321
|
+
case 'TSSatisfiesExpression':
|
|
322
|
+
case 'TSNonNullExpression':
|
|
323
|
+
case 'TSTypeAssertion':
|
|
324
|
+
current = current.expression;
|
|
325
|
+
continue;
|
|
326
|
+
default:
|
|
327
|
+
return current;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
function stringValue(node) {
|
|
332
|
+
if (node === undefined)
|
|
333
|
+
return null;
|
|
334
|
+
const value = unwrap(node);
|
|
335
|
+
if (value.type === 'Literal' && typeof value.value === 'string')
|
|
336
|
+
return value.value;
|
|
337
|
+
if (value.type === 'TemplateLiteral' && value.expressions.length === 0) {
|
|
338
|
+
return value.quasis[0]?.value.cooked ?? null;
|
|
339
|
+
}
|
|
340
|
+
return null;
|
|
341
|
+
}
|
|
342
|
+
function propertyKey(key) {
|
|
343
|
+
if (key.type === 'Identifier')
|
|
344
|
+
return key.name;
|
|
345
|
+
if (key.type === 'Literal' && typeof key.value === 'string')
|
|
346
|
+
return key.value;
|
|
347
|
+
return null;
|
|
348
|
+
}
|
|
349
|
+
function moduleExportName(node) {
|
|
350
|
+
return node.type === 'Identifier' ? node.name : String(node.value);
|
|
351
|
+
}
|
|
352
|
+
function boundNames(pattern) {
|
|
353
|
+
switch (pattern.type) {
|
|
354
|
+
case 'Identifier':
|
|
355
|
+
return [pattern.name];
|
|
356
|
+
case 'ObjectPattern':
|
|
357
|
+
return pattern.properties.flatMap((property) => property.type === 'RestElement'
|
|
358
|
+
? boundNames(property.argument)
|
|
359
|
+
: boundNames(property.value));
|
|
360
|
+
case 'ArrayPattern':
|
|
361
|
+
return pattern.elements.flatMap((element) => element === null
|
|
362
|
+
? []
|
|
363
|
+
: element.type === 'RestElement'
|
|
364
|
+
? boundNames(element.argument)
|
|
365
|
+
: boundNames(element));
|
|
366
|
+
case 'AssignmentPattern':
|
|
367
|
+
return boundNames(pattern.left);
|
|
368
|
+
default:
|
|
369
|
+
return [];
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
/** Whether any call expression in the tree calls the given identifier. */
|
|
373
|
+
function callsIdentifier(root, name) {
|
|
374
|
+
const stack = [root];
|
|
375
|
+
while (stack.length > 0) {
|
|
376
|
+
const current = stack.pop();
|
|
377
|
+
if (typeof current !== 'object' || current === null)
|
|
378
|
+
continue;
|
|
379
|
+
if (Array.isArray(current)) {
|
|
380
|
+
stack.push(...current);
|
|
381
|
+
continue;
|
|
382
|
+
}
|
|
383
|
+
const node = current;
|
|
384
|
+
if (node.type === 'CallExpression' &&
|
|
385
|
+
node.callee.type === 'Identifier' &&
|
|
386
|
+
node.callee.name === name) {
|
|
387
|
+
return true;
|
|
388
|
+
}
|
|
389
|
+
for (const [key, value] of Object.entries(node)) {
|
|
390
|
+
if (key !== 'parent' && typeof value === 'object' && value !== null)
|
|
391
|
+
stack.push(value);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
return false;
|
|
395
|
+
}
|
|
396
|
+
//# sourceMappingURL=analyze.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze.js","sourceRoot":"","sources":["../../src/analysis/analyze.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AA6DhC,MAAM,aAAa,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,CAAU,CAAA;AAGjG,MAAM,aAAa,GAAG,CAAC,IAAY,EAAuB,EAAE,CAC1D,aAAmC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;AAKpD,MAAM,QAAQ,GAAG,sDAAsD,CAAA;AAEvE,oGAAoG;AACpG,MAAM,UAAU,UAAU,CAAC,IAAY;IACtC,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC7D,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,EAAU,EAAE,IAAY;IAC/C,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC,CAAA;IAC/C,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,CAAA;IAElC,MAAM,KAAK,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAA;IAC1C,MAAM,YAAY,GAAkB,EAAE,CAAA;IACtC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAqB,CAAA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ACD,MAAM,IAAI,GAAG,OAAe,CAAA;QAC5B,IACC,IAAI,CAAC,IAAI,KAAK,gBAAgB;YAC9B,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,YAAY;YACjC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,EACxB,CAAC;YACF,OAAO,IAAI,CAAA;QACZ,CAAC;QACD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACjD,IAAI,GAAG,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;gBAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACvF,CAAC;IACF,CAAC;IACD,OAAO,KAAK,CAAA;AACb,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The project-wide graph assembled from per-module analyses.
|
|
3
|
+
*
|
|
4
|
+
* Nodes are identified by `kind:name`. Names are unique the way the runtime
|
|
5
|
+
* requires: scopes share one name space, and slots, services and executions
|
|
6
|
+
* share another. Dependency references are resolved through each module's
|
|
7
|
+
* imports and re-exports, so edges cross module boundaries and barrels.
|
|
8
|
+
*/
|
|
9
|
+
import type { ModuleAnalysis } from './analyze.ts';
|
|
10
|
+
export interface GraphEdge {
|
|
11
|
+
readonly key: string;
|
|
12
|
+
/** Target node id, or null when the reference could not be resolved statically. */
|
|
13
|
+
readonly target: string | null;
|
|
14
|
+
readonly optional: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface GraphNode {
|
|
17
|
+
readonly id: string;
|
|
18
|
+
readonly kind: 'slot' | 'service' | 'scope' | 'execution';
|
|
19
|
+
readonly name: string;
|
|
20
|
+
/** The scope's name when known statically, or null when it is inferred at runtime. */
|
|
21
|
+
readonly scope: string | null;
|
|
22
|
+
/** For scopes: the parent scope's node id. */
|
|
23
|
+
readonly parent: string | null;
|
|
24
|
+
/** Whether a slot is a multi-binding; null when its options cannot be read statically. */
|
|
25
|
+
readonly many: boolean | null;
|
|
26
|
+
readonly module: string;
|
|
27
|
+
readonly local: string;
|
|
28
|
+
/** Offsets of the declaration in the code the plugin received, after earlier transforms. */
|
|
29
|
+
readonly start: number;
|
|
30
|
+
readonly end: number;
|
|
31
|
+
readonly deps: readonly GraphEdge[];
|
|
32
|
+
}
|
|
33
|
+
export interface Duplicate {
|
|
34
|
+
/** The name, prefixed with `scope ` for scopes. */
|
|
35
|
+
readonly id: string;
|
|
36
|
+
/** Every module declaring it, once per declaration. */
|
|
37
|
+
readonly modules: readonly string[];
|
|
38
|
+
}
|
|
39
|
+
export interface Graph {
|
|
40
|
+
readonly nodes: readonly GraphNode[];
|
|
41
|
+
readonly duplicates: readonly Duplicate[];
|
|
42
|
+
}
|
|
43
|
+
export declare class Registry {
|
|
44
|
+
private readonly modules;
|
|
45
|
+
/** Declarations by node id, then by module. */
|
|
46
|
+
private readonly byId;
|
|
47
|
+
/** Declaration counts by name key, then by module. */
|
|
48
|
+
private readonly byName;
|
|
49
|
+
set(id: string, analysis: ModuleAnalysis, resolved: ReadonlyMap<string, string>): void;
|
|
50
|
+
delete(id: string): void;
|
|
51
|
+
/** Forgets every module of a deleted file, queries included. */
|
|
52
|
+
deleteFile(file: string): void;
|
|
53
|
+
/** Names a module declares that are also declared elsewhere, or more than once in it. */
|
|
54
|
+
duplicatesOf(id: string): Duplicate[];
|
|
55
|
+
graph(): Graph;
|
|
56
|
+
/**
|
|
57
|
+
* The scope name of a declaration: literal, or the name of the referenced
|
|
58
|
+
* scope declaration. An execution lives in the parent of the scope its
|
|
59
|
+
* runs open, as it does at runtime.
|
|
60
|
+
*/
|
|
61
|
+
private resolveScope;
|
|
62
|
+
private find;
|
|
63
|
+
/** Resolves a reference in a module to a node id, following imports and re-exports. */
|
|
64
|
+
private resolveRef;
|
|
65
|
+
/** Resolves a name a module exports to a node id. */
|
|
66
|
+
private resolveExport;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The import and re-export sources a module's graph edges may lead through:
|
|
70
|
+
* those `Registry` follows when it resolves the module's references and
|
|
71
|
+
* exports. The plugin resolves exactly these to module ids.
|
|
72
|
+
*/
|
|
73
|
+
export declare function sourcesToResolve(analysis: ModuleAnalysis): Set<string>;
|
|
74
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/analysis/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAe,cAAc,EAAO,MAAM,cAAc,CAAA;AAEpE,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,mFAAmF;IACnF,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;CAC1B;AAED,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,CAAA;IACzD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,sFAAsF;IACtF,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,8CAA8C;IAC9C,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,0FAA0F;IAC1F,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAA;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,4FAA4F;IAC5F,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,IAAI,EAAE,SAA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