@vmz/plugin 0.0.3 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/index.d.ts +67 -0
- 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
|
|
package/index.d.ts
CHANGED
|
@@ -97,8 +97,75 @@ 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
|
+
* Delivery: named profiles (`default` + `profiles`) or legacy site sugar.
|
|
104
|
+
* Pure data only; never a parallel `vmz.site.ts` entry.
|
|
105
|
+
*/
|
|
106
|
+
delivery?: DeliveryAuthoring;
|
|
100
107
|
}
|
|
101
108
|
|
|
109
|
+
/** Site resource sources (embedded | filesystem | remote) — orthogonal to assembly. */
|
|
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;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export type DeliveryAssembly = 'local-static' | 'static-cdn' | 'server-host' | 'cdn+server' | 'rust-embedded';
|
|
142
|
+
|
|
143
|
+
export type DeliveryServerRuntime = 'node' | 'worker' | 'deno' | 'bun' | 'rust-host';
|
|
144
|
+
|
|
145
|
+
export interface DeliveryProfileAuthoring {
|
|
146
|
+
host?: 'browser';
|
|
147
|
+
assembly: DeliveryAssembly;
|
|
148
|
+
serverRuntime?: DeliveryServerRuntime;
|
|
149
|
+
/** Inline site sources or `defineSite({...})`. */
|
|
150
|
+
sources?: SiteDeliveryAuthoring | SiteDeliveryAuthoring['sources'];
|
|
151
|
+
artifact?: string;
|
|
152
|
+
resolution?: SiteDeliveryAuthoring['resolution'];
|
|
153
|
+
activation?: SiteDeliveryAuthoring['activation'];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** Named profiles (preferred) or legacy site-only sugar. */
|
|
157
|
+
export type DeliveryAuthoring =
|
|
158
|
+
| {
|
|
159
|
+
default?: string;
|
|
160
|
+
profiles: Record<string, DeliveryProfileAuthoring>;
|
|
161
|
+
}
|
|
162
|
+
| (SiteDeliveryAuthoring & {
|
|
163
|
+
default?: string;
|
|
164
|
+
assembly?: DeliveryAssembly;
|
|
165
|
+
host?: 'browser';
|
|
166
|
+
serverRuntime?: DeliveryServerRuntime;
|
|
167
|
+
});
|
|
168
|
+
|
|
102
169
|
export type DefinePluginInput = PluginManifest & {
|
|
103
170
|
contribute?: VmzPlugin['contribute'];
|
|
104
171
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vmz/plugin",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
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.1.0"
|
|
22
22
|
},
|
|
23
23
|
"keywords": [
|
|
24
24
|
"vmz",
|