@vmz/plugin 0.0.2 → 0.0.4
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/README.md +15 -11
- package/index.d.ts +39 -0
- package/index.js +0 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -14,19 +14,19 @@ assets without forcing every project to adopt a bespoke compiler fork.
|
|
|
14
14
|
|
|
15
15
|
## The promise to application authors
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
Extensions stay transparent to the application model. A VMZ plugin is a versioned contribution surface — not an
|
|
18
|
+
unrestricted `transform(code)` escape hatch or an in-place rewrite of the program graph. Declared contributions keep
|
|
19
|
+
ownership, execution placement, SSR, resume, testing, diagnostics, and deployment explainable.
|
|
20
20
|
|
|
21
21
|
This is the tradeoff: plugin authors gain a stable way to participate in VMZ, while users retain a coherent application
|
|
22
22
|
model after installing the plugin. If an integration requires arbitrary runtime injection or hidden semantic rewrites,
|
|
23
23
|
it belongs outside the core VMZ plugin contract.
|
|
24
24
|
|
|
25
|
-
| A plugin
|
|
26
|
-
|
|
27
|
-
| A declared capability with known inputs and output |
|
|
28
|
-
| Versioned integration behavior |
|
|
29
|
-
| Assets or adapters VMZ can place and test |
|
|
25
|
+
| A plugin contributes... | So that VMZ can still... |
|
|
26
|
+
|----------------------------------------------------|----------------------------------------------------|
|
|
27
|
+
| A declared capability with known inputs and output | Keep one application runtime and Program Graph |
|
|
28
|
+
| Versioned integration behavior | Explain ownership, placement, and diagnostics |
|
|
29
|
+
| Assets or adapters VMZ can place and test | Honor server, lifecycle, and deployment boundaries |
|
|
30
30
|
|
|
31
31
|
## Who should use it
|
|
32
32
|
|
|
@@ -44,10 +44,14 @@ compiler-visible boundaries.
|
|
|
44
44
|
|
|
45
45
|
## Why contribution beats mutation
|
|
46
46
|
|
|
47
|
-
Mutation is convenient for the first plugin and expensive for the fiftieth. If every plugin can rewrite any source,
|
|
47
|
+
Mutation is convenient for the first plugin and expensive for the fiftieth. If every plugin can rewrite any source,
|
|
48
|
+
graph node, or generated artifact, composition order becomes application semantics and no tool can explain the final
|
|
49
|
+
result.
|
|
48
50
|
|
|
49
|
-
A contribution says what capability is being added, which versioned schema it follows, what it reads, what it emits, and
|
|
51
|
+
A contribution says what capability is being added, which versioned schema it follows, what it reads, what it emits, and
|
|
52
|
+
where it may execute. That extra structure is what allows npm extensibility and strong compilation to coexist.
|
|
50
53
|
|
|
51
54
|
## The litmus test
|
|
52
55
|
|
|
53
|
-
If installing the plugin makes `vmz check`, SSR, resume, tests, or deployment less able to explain the application, the
|
|
56
|
+
If installing the plugin makes `vmz check`, SSR, resume, tests, or deployment less able to explain the application, the
|
|
57
|
+
integration is using the wrong boundary. A native plugin should leave VMZ more capable, not less coherent.
|
package/index.d.ts
CHANGED
|
@@ -97,6 +97,45 @@ export interface VmzEngines {
|
|
|
97
97
|
export interface VmzUserConfig {
|
|
98
98
|
plugins?: Array<string | VmzPlugin | Promise<VmzPlugin>>;
|
|
99
99
|
engines?: VmzEngines;
|
|
100
|
+
/** Application identity (optional authoring). */
|
|
101
|
+
application?: { id?: string; [key: string]: unknown };
|
|
102
|
+
/**
|
|
103
|
+
* Site delivery (SiteDeliveryContract authoring). Pure data only.
|
|
104
|
+
* Prefer `defineSite(...)` helper; never a parallel `vmz.site.ts` entry.
|
|
105
|
+
*/
|
|
106
|
+
delivery?: SiteDeliveryAuthoring;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Authoring shape for `defineConfig({ delivery })` — normalized at build to SiteDeliveryContract. */
|
|
110
|
+
export interface SiteDeliveryAuthoring {
|
|
111
|
+
artifact: string;
|
|
112
|
+
siteId?: string;
|
|
113
|
+
sources: Array<{
|
|
114
|
+
id: string;
|
|
115
|
+
kind: 'embedded' | 'filesystem' | 'remote';
|
|
116
|
+
directory?: string;
|
|
117
|
+
baseUrl?: string;
|
|
118
|
+
artifact?: string;
|
|
119
|
+
trust?: string;
|
|
120
|
+
timeoutMs?: number;
|
|
121
|
+
priority?: number;
|
|
122
|
+
integrity?: unknown;
|
|
123
|
+
signaturePolicy?: string;
|
|
124
|
+
}>;
|
|
125
|
+
resolution?: {
|
|
126
|
+
mode?: 'release';
|
|
127
|
+
fallback?: string[];
|
|
128
|
+
};
|
|
129
|
+
activation?: 'atomic';
|
|
130
|
+
expectedCompatibility?: unknown;
|
|
131
|
+
failure?: unknown;
|
|
132
|
+
failurePolicy?: unknown;
|
|
133
|
+
update?: unknown;
|
|
134
|
+
updatePolicy?: unknown;
|
|
135
|
+
rollback?: unknown;
|
|
136
|
+
rollbackPolicy?: unknown;
|
|
137
|
+
security?: unknown;
|
|
138
|
+
securityPolicy?: unknown;
|
|
100
139
|
}
|
|
101
140
|
|
|
102
141
|
export type DefinePluginInput = PluginManifest & {
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vmz/plugin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "VMZ plugin protocol types and definePlugin / defineConfig helpers (no N-API)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"README.md"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@vmz/protocol": "0.0.
|
|
21
|
+
"@vmz/protocol": "0.0.4"
|
|
22
22
|
},
|
|
23
23
|
"keywords": [
|
|
24
24
|
"vmz",
|