@reticlehq/vite-plugin 2.2.1 → 2.3.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/dist/discover-port.d.ts +0 -1
- package/dist/discover-port.js +0 -1
- package/dist/index.d.ts +85 -13
- package/dist/index.js +222 -16
- package/dist/project-id.d.ts +0 -1
- package/dist/project-id.js +0 -1
- package/package.json +4 -4
- package/dist/discover-port.d.ts.map +0 -1
- package/dist/discover-port.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/project-id.d.ts.map +0 -1
- package/dist/project-id.js.map +0 -1
package/dist/discover-port.d.ts
CHANGED
|
@@ -4,4 +4,3 @@
|
|
|
4
4
|
* so the selection is unit-tested without a real ~/.reticle or real processes.
|
|
5
5
|
*/
|
|
6
6
|
export declare function discoverDaemonPort(projectId: string | undefined, home?: string, alive?: (pid: number) => boolean): number | undefined;
|
|
7
|
-
//# sourceMappingURL=discover-port.d.ts.map
|
package/dist/discover-port.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,15 @@ export declare const RETICLE_VITE_PLUGIN_NAME = "reticle";
|
|
|
6
6
|
* by the injected <script src> and served by the load hook below.
|
|
7
7
|
*/
|
|
8
8
|
export declare const RETICLE_CONNECT_MODULE = "/@reticle-connect";
|
|
9
|
+
/**
|
|
10
|
+
* The pre-hook, as source for an inline <head> script.
|
|
11
|
+
*
|
|
12
|
+
* Deliberately dependency-free ES5 in a try/catch: it runs before anything else on the page, so it
|
|
13
|
+
* must not assume a bundler, a module system, or that React is present at all. It installs a faithful
|
|
14
|
+
* devtools hook (React calls `inject` and expects a renderer id back, and stores the renderer) and
|
|
15
|
+
* counts commits into a buffer the module-side meter adopts later.
|
|
16
|
+
*/
|
|
17
|
+
export declare const RENDER_PREHOOK_SOURCE = "(function(){try{\nvar K='__REACT_DEVTOOLS_GLOBAL_HOOK__',P='__reticleRenderPreHook';\nif(globalThis[P])return;\nvar B={commits:0,sinks:[]};\nglobalThis[P]=B;\nvar fire=function(){B.commits++;for(var i=0;i<B.sinks.length;i++){try{B.sinks[i].apply(null,arguments);}catch(e){}}};\nvar h=globalThis[K];\nif(h===undefined){\nglobalThis[K]={supportsFiber:true,renderers:new Map(),inject:function(r){var id=this.renderers.size+1;this.renderers.set(id,r);return id;},\nonScheduleFiberRoot:function(){},onCommitFiberRoot:fire,onPostCommitFiberRoot:function(){},onCommitFiberUnmount:function(){}};\n}else{var prev=h.onCommitFiberRoot;h.onCommitFiberRoot=function(){try{fire.apply(null,arguments);}catch(e){}\nif(typeof prev==='function')return prev.apply(this,arguments);};}\n}catch(e){}})();";
|
|
9
18
|
export interface ReticleVitePluginOptions {
|
|
10
19
|
/** Bridge WebSocket port. Defaults to the SDK default; only baked into connect when non-default. */
|
|
11
20
|
port?: number;
|
|
@@ -22,31 +31,89 @@ export interface ReticleVitePluginOptions {
|
|
|
22
31
|
sourceMapping?: boolean;
|
|
23
32
|
/** Auto-inject the dev-gated reticle.connect call. Default true. */
|
|
24
33
|
inject?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* This build is an Electron/Tauri renderer. Changes two things a desktop shell needs and a web app
|
|
36
|
+
* must not get:
|
|
37
|
+
*
|
|
38
|
+
* - The plugin also applies to `vite build`. A packaged desktop renderer IS a production build
|
|
39
|
+
* loaded from `file://` or a custom protocol — there is no dev server — so the default
|
|
40
|
+
* `apply: 'serve'` drops the plugin entirely and the app ships with no `connect()` at all.
|
|
41
|
+
* - `connect()` is called with `allowInProduction`, because that same renderer reports
|
|
42
|
+
* NODE_ENV=production and the SDK's prod backstop would otherwise refuse to start.
|
|
43
|
+
*
|
|
44
|
+
* Off by default and never inferred: turning it on means an instrumented production BUNDLE, which
|
|
45
|
+
* is exactly what a web app must never ship. Keep it behind your own dev-only build (a dev target,
|
|
46
|
+
* or `process.env.NODE_ENV !== 'production'` in vite.config) so it cannot reach a release binary.
|
|
47
|
+
*/
|
|
48
|
+
desktop?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Record request/response BODIES on `reticle_network`, not just method/url/status.
|
|
51
|
+
*
|
|
52
|
+
* Off by default because a body is the one part of a request that routinely carries a card
|
|
53
|
+
* number, a token or a customer's address, and the daemon journals what it is told.
|
|
54
|
+
*
|
|
55
|
+
* It matters that this is reachable at all. The SDK has supported `captureNetworkBodies` on
|
|
56
|
+
* `connect()` since bodies existed, but the plugin — the documented one-line integration, and the
|
|
57
|
+
* only `connect()` most apps ever have — had no way to pass it, and calling `connect()` a second
|
|
58
|
+
* time is a no-op. So for every app wired the recommended way, a payload was unreachable: on a
|
|
59
|
+
* real payments dashboard, a refund POSTing `amount: 1187.01` into a paise field (a 100x
|
|
60
|
+
* under-refund) was visible to Playwright's request inspector and invisible here.
|
|
61
|
+
*
|
|
62
|
+
* Also settable as `VITE_RETICLE_CAPTURE_BODIES=1`, so it can be turned on for one debugging
|
|
63
|
+
* session without editing vite.config.
|
|
64
|
+
*/
|
|
65
|
+
captureNetworkBodies?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Where a diagnostic goes. Defaults to the console; injected so the dev-mode injection check is
|
|
68
|
+
* testable without capturing global console output.
|
|
69
|
+
*/
|
|
70
|
+
onWarn?: (message: string) => void;
|
|
25
71
|
}
|
|
26
72
|
/** Structural Vite plugin shape — avoids a hard dependency on `vite` while staying assignable to its `Plugin`. */
|
|
27
73
|
export interface ReticleVitePlugin {
|
|
28
74
|
name: string;
|
|
29
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Vite's `config` hook. Used to declare the SDK's CJS runtime deps for pre-bundling — see the
|
|
77
|
+
* implementation for why omitting them makes the whole SDK fail to load on linked setups.
|
|
78
|
+
*/
|
|
79
|
+
config?: (config: {
|
|
80
|
+
optimizeDeps?: {
|
|
81
|
+
include?: string[];
|
|
82
|
+
};
|
|
83
|
+
}) => {
|
|
84
|
+
optimizeDeps: {
|
|
85
|
+
include: string[];
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
/** Absent in desktop mode, where the plugin must also run for `vite build`. */
|
|
89
|
+
apply?: 'serve';
|
|
30
90
|
enforce: 'pre';
|
|
31
91
|
transform: (code: string, id: string) => {
|
|
32
92
|
code: string;
|
|
33
93
|
map: string | null;
|
|
34
94
|
} | null;
|
|
35
|
-
resolveId: (id: string) => string | null;
|
|
95
|
+
resolveId: (id: string, importer?: string) => string | null;
|
|
36
96
|
load: (id: string) => string | null;
|
|
37
97
|
transformIndexHtml: (html: string) => HtmlTag[];
|
|
98
|
+
/** Vite hands over the resolved config; used to resolve the HTML entry exactly. */
|
|
99
|
+
configResolved?: (config: {
|
|
100
|
+
root?: string;
|
|
101
|
+
command?: string;
|
|
102
|
+
}) => void;
|
|
103
|
+
/** Build-time post-condition: desktop injection must have happened. */
|
|
104
|
+
buildEnd?: () => void;
|
|
105
|
+
/** Runs the dev-mode injection check immediately. Test seam for the deferred timer. */
|
|
106
|
+
checkInjectedForTest?: () => void;
|
|
38
107
|
}
|
|
39
108
|
interface HtmlTag {
|
|
40
109
|
tag: string;
|
|
41
|
-
|
|
42
|
-
|
|
110
|
+
/** Absent on an inline script, which carries its source in `children` instead. */
|
|
111
|
+
attrs?: Record<string, string>;
|
|
112
|
+
/** Inline source, for a tag that has no `src`. */
|
|
113
|
+
children?: string;
|
|
114
|
+
/** `head-prepend` is required for the render pre-hook: it must run before any module script. */
|
|
115
|
+
injectTo: 'body' | 'head-prepend';
|
|
43
116
|
}
|
|
44
|
-
/**
|
|
45
|
-
* Read the daemon's auto-provisioned pairing token (~/.reticle/pairing-token, or the
|
|
46
|
-
* RETICLE_PAIRING_TOKEN_DIR override) so the served app can present it. Node-side only — a browser
|
|
47
|
-
* sandbox can't read the file, which is exactly why a rogue localhost app can't forge it. Best-effort:
|
|
48
|
-
* undefined if the daemon hasn't started yet (the page reloads once it has). Exported for testing.
|
|
49
|
-
*/
|
|
50
117
|
export declare function readPairingToken(): string | undefined;
|
|
51
118
|
/** The body of the connect module — real imports, resolved by Vite when the module is served. */
|
|
52
119
|
export declare function connectModuleSource(options: ReticleVitePluginOptions): string;
|
|
@@ -56,9 +123,14 @@ export declare function connectModuleSource(options: ReticleVitePluginOptions):
|
|
|
56
123
|
* import { reticle } from '@reticlehq/vite-plugin';
|
|
57
124
|
* export default defineConfig({ plugins: [react(), reticle()] });
|
|
58
125
|
*
|
|
59
|
-
* `apply: 'serve'` means Vite drops the plugin entirely from `vite build
|
|
60
|
-
*
|
|
126
|
+
* `apply: 'serve'` means Vite drops the plugin entirely from `vite build`, so a web production
|
|
127
|
+
* bundle is never instrumented — gating is the tool's job, not a user-managed env check.
|
|
128
|
+
*
|
|
129
|
+
* `desktop: true` is the ONE documented exception, and it inverts that guarantee deliberately: a
|
|
130
|
+
* packaged Electron/Tauri renderer IS a production build with no dev server, so serve-only gating
|
|
131
|
+
* would ship an app with no connect() at all. The cost is that the flag hands gating back to the
|
|
132
|
+
* caller — keep it behind your own dev-only build target so an instrumented bundle can never reach
|
|
133
|
+
* a release binary.
|
|
61
134
|
*/
|
|
62
135
|
export declare function reticle(options?: ReticleVitePluginOptions): ReticleVitePlugin;
|
|
63
136
|
export {};
|
|
64
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { homedir } from 'node:os';
|
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { transformSync } from '@babel/core';
|
|
5
5
|
import reticleSource from '@reticlehq/babel-plugin';
|
|
6
|
-
import { RETICLE_DEFAULT_PORT, bridgeWsUrl, ReticleDir, ReticleEnv } from '@reticlehq/core';
|
|
6
|
+
import { RETICLE_DEFAULT_PORT, RETICLE_RENDER_PREHOOK, bridgeWsUrl, ReticleDir, ReticleEnv, } from '@reticlehq/core';
|
|
7
7
|
import { resolveProjectId } from './project-id.js';
|
|
8
8
|
import { discoverDaemonPort } from './discover-port.js';
|
|
9
9
|
export const RETICLE_VITE_PLUGIN_NAME = 'reticle';
|
|
@@ -23,6 +23,60 @@ const NODE_MODULES = 'node_modules';
|
|
|
23
23
|
* by the injected <script src> and served by the load hook below.
|
|
24
24
|
*/
|
|
25
25
|
export const RETICLE_CONNECT_MODULE = '/@reticle-connect';
|
|
26
|
+
/**
|
|
27
|
+
* The pre-hook, as source for an inline <head> script.
|
|
28
|
+
*
|
|
29
|
+
* Deliberately dependency-free ES5 in a try/catch: it runs before anything else on the page, so it
|
|
30
|
+
* must not assume a bundler, a module system, or that React is present at all. It installs a faithful
|
|
31
|
+
* devtools hook (React calls `inject` and expects a renderer id back, and stores the renderer) and
|
|
32
|
+
* counts commits into a buffer the module-side meter adopts later.
|
|
33
|
+
*/
|
|
34
|
+
export const RENDER_PREHOOK_SOURCE = `(function(){try{
|
|
35
|
+
var K='__REACT_DEVTOOLS_GLOBAL_HOOK__',P='${RETICLE_RENDER_PREHOOK}';
|
|
36
|
+
if(globalThis[P])return;
|
|
37
|
+
var B={commits:0,sinks:[]};
|
|
38
|
+
globalThis[P]=B;
|
|
39
|
+
var fire=function(){B.commits++;for(var i=0;i<B.sinks.length;i++){try{B.sinks[i].apply(null,arguments);}catch(e){}}};
|
|
40
|
+
var h=globalThis[K];
|
|
41
|
+
if(h===undefined){
|
|
42
|
+
globalThis[K]={supportsFiber:true,renderers:new Map(),inject:function(r){var id=this.renderers.size+1;this.renderers.set(id,r);return id;},
|
|
43
|
+
onScheduleFiberRoot:function(){},onCommitFiberRoot:fire,onPostCommitFiberRoot:function(){},onCommitFiberUnmount:function(){}};
|
|
44
|
+
}else{var prev=h.onCommitFiberRoot;h.onCommitFiberRoot=function(){try{fire.apply(null,arguments);}catch(e){}
|
|
45
|
+
if(typeof prev==='function')return prev.apply(this,arguments);};}
|
|
46
|
+
}catch(e){}})();`;
|
|
47
|
+
/**
|
|
48
|
+
* How long after serving the HTML to wait before concluding the entry was never injected.
|
|
49
|
+
*
|
|
50
|
+
* Generous on purpose: the browser has to request the entry, and a cold dev server transforming a
|
|
51
|
+
* large app can take a moment. A false warning would train people to ignore a real one.
|
|
52
|
+
*/
|
|
53
|
+
const DEV_INJECTION_GRACE_MS = 10_000;
|
|
54
|
+
/**
|
|
55
|
+
* Is this resolved module id the one the HTML referenced?
|
|
56
|
+
*
|
|
57
|
+
* `resolveId` sees the specifier (`/src/main.tsx`); `transform` sees the absolute path
|
|
58
|
+
* (`/Users/me/app/src/main.tsx`). A suffix match is what bridges them. Any query suffix
|
|
59
|
+
* (`?html-proxy`, `?t=...`) is stripped first so a re-transformed module still matches.
|
|
60
|
+
*/
|
|
61
|
+
function isHtmlEntry(id, specifier, root) {
|
|
62
|
+
if (specifier === undefined)
|
|
63
|
+
return false;
|
|
64
|
+
const clean = (value) => value.split('?')[0] ?? value;
|
|
65
|
+
const target = clean(specifier);
|
|
66
|
+
const candidate = clean(id);
|
|
67
|
+
if (candidate === target)
|
|
68
|
+
return true;
|
|
69
|
+
// EXACT when the resolved root is known: Vite reports the HTML's script as a root-relative
|
|
70
|
+
// specifier (`/src/main.tsx`) while `transform` sees the absolute path, and joining the two is a
|
|
71
|
+
// real resolution rather than a guess. Suffix matching alone would also inject into
|
|
72
|
+
// `/other/src/main.tsx`, a different file that merely ends the same way.
|
|
73
|
+
if (root !== undefined && target.startsWith('/')) {
|
|
74
|
+
return candidate === `${root.replace(/\/$/, '')}${target}`;
|
|
75
|
+
}
|
|
76
|
+
// Fallback for the rare case Vite never reported a root — still better than not injecting, and the
|
|
77
|
+
// buildEnd post-condition means a wrong match cannot pass unnoticed as "nothing happened".
|
|
78
|
+
return candidate.endsWith(target.startsWith('/') ? target : `/${target}`);
|
|
79
|
+
}
|
|
26
80
|
function shouldStamp(id) {
|
|
27
81
|
if (id.startsWith(VIRTUAL_PREFIX))
|
|
28
82
|
return false;
|
|
@@ -54,6 +108,14 @@ function stamp(code, id) {
|
|
|
54
108
|
* sandbox can't read the file, which is exactly why a rogue localhost app can't forge it. Best-effort:
|
|
55
109
|
* undefined if the daemon hasn't started yet (the page reloads once it has). Exported for testing.
|
|
56
110
|
*/
|
|
111
|
+
/**
|
|
112
|
+
* CJS packages the browser SDK needs at runtime. Named, because a bare string here is exactly the
|
|
113
|
+
* kind of thing that silently rots when a dependency is renamed.
|
|
114
|
+
*/
|
|
115
|
+
const SDK_CJS_DEPS = {
|
|
116
|
+
TESTING_LIBRARY: '@testing-library/dom',
|
|
117
|
+
ARIA_QUERY: 'aria-query',
|
|
118
|
+
};
|
|
57
119
|
export function readPairingToken() {
|
|
58
120
|
const override = process.env[ReticleEnv.PAIRING_TOKEN_DIR];
|
|
59
121
|
const dir = override !== undefined && override.length > 0 ? override : join(homedir(), ReticleDir.ROOT);
|
|
@@ -77,6 +139,16 @@ function connectArgs(options) {
|
|
|
77
139
|
args['projectId'] = options.projectId;
|
|
78
140
|
if (options.token !== undefined)
|
|
79
141
|
args['token'] = options.token;
|
|
142
|
+
// A desktop renderer is a production build by construction; without this the SDK's prod backstop
|
|
143
|
+
// refuses to connect and the app is silently uninstrumented.
|
|
144
|
+
if (options.desktop === true)
|
|
145
|
+
args['allowInProduction'] = true;
|
|
146
|
+
// Env wins nothing — it only turns the flag ON, so a config that never set it can still be
|
|
147
|
+
// switched on for one debugging session without editing vite.config and restarting the mental
|
|
148
|
+
// model with it.
|
|
149
|
+
if (options.captureNetworkBodies === true || process.env['VITE_RETICLE_CAPTURE_BODIES'] === '1') {
|
|
150
|
+
args['captureNetworkBodies'] = true;
|
|
151
|
+
}
|
|
80
152
|
return Object.keys(args).length > 0 ? JSON.stringify(args) : '';
|
|
81
153
|
}
|
|
82
154
|
/** The body of the connect module — real imports, resolved by Vite when the module is served. */
|
|
@@ -90,28 +162,138 @@ export function connectModuleSource(options) {
|
|
|
90
162
|
* import { reticle } from '@reticlehq/vite-plugin';
|
|
91
163
|
* export default defineConfig({ plugins: [react(), reticle()] });
|
|
92
164
|
*
|
|
93
|
-
* `apply: 'serve'` means Vite drops the plugin entirely from `vite build
|
|
94
|
-
*
|
|
165
|
+
* `apply: 'serve'` means Vite drops the plugin entirely from `vite build`, so a web production
|
|
166
|
+
* bundle is never instrumented — gating is the tool's job, not a user-managed env check.
|
|
167
|
+
*
|
|
168
|
+
* `desktop: true` is the ONE documented exception, and it inverts that guarantee deliberately: a
|
|
169
|
+
* packaged Electron/Tauri renderer IS a production build with no dev server, so serve-only gating
|
|
170
|
+
* would ship an app with no connect() at all. The cost is that the flag hands gating back to the
|
|
171
|
+
* caller — keep it behind your own dev-only build target so an instrumented bundle can never reach
|
|
172
|
+
* a release binary.
|
|
95
173
|
*/
|
|
96
174
|
export function reticle(options = {}) {
|
|
97
175
|
const sourceMapping = options.sourceMapping !== false;
|
|
98
176
|
const inject = options.inject !== false;
|
|
177
|
+
const desktop = options.desktop === true;
|
|
99
178
|
// Resolve the stable projectId once (explicit option, else derived from package.json + cwd) so the
|
|
100
179
|
// app is identifiable across port changes with zero config.
|
|
101
180
|
const resolved = {
|
|
102
181
|
...options,
|
|
103
182
|
projectId: resolveProjectId(options.projectId, process.cwd()),
|
|
104
183
|
};
|
|
184
|
+
/**
|
|
185
|
+
* The specifier the HTML points at, e.g. `/src/main.tsx`.
|
|
186
|
+
*
|
|
187
|
+
* Stored UNRESOLVED, because that is what `resolveId` receives — while `transform` is handed the
|
|
188
|
+
* absolute resolved path. Comparing the two directly never matches, and the failure is silent:
|
|
189
|
+
* the bundle simply ships with no connect() in it. Hence `isHtmlEntry`'s suffix comparison.
|
|
190
|
+
*/
|
|
191
|
+
let htmlEntrySpecifier;
|
|
192
|
+
/** Vite's resolved project root, for exact entry resolution. Undefined until configResolved. */
|
|
193
|
+
let root;
|
|
194
|
+
/** 'serve' | 'build'. The dev check only applies to serve; buildEnd covers the other. */
|
|
195
|
+
let command;
|
|
196
|
+
const warn = options.onWarn ?? ((message) => globalThis.console.warn(message));
|
|
197
|
+
/** Whether connect() actually reached a module — asserted at buildEnd, never assumed. */
|
|
198
|
+
let injected = false;
|
|
199
|
+
/**
|
|
200
|
+
* Resolve port + token at the moment of injection, not at plugin construction. By the time a
|
|
201
|
+
* module is served or built the daemon is up and has written its pairing token; resolving early
|
|
202
|
+
* would bake in `undefined` and the app would fail auth on every connect.
|
|
203
|
+
*/
|
|
204
|
+
const resolveLazy = () => {
|
|
205
|
+
const port = resolved.port ?? discoverDaemonPort(resolved.projectId);
|
|
206
|
+
const withPort = port !== undefined ? { ...resolved, port } : resolved;
|
|
207
|
+
const token = withPort.token ?? readPairingToken();
|
|
208
|
+
return token !== undefined ? { ...withPort, token } : withPort;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* The BUILD message. A build always runs every transform, so "my transform never ran" and "the
|
|
212
|
+
* bundle has no connect()" are the same statement there, and stating it as a certainty is correct.
|
|
213
|
+
*/
|
|
214
|
+
const notInjectedMessage = () => `[${RETICLE_VITE_PLUGIN_NAME}] could not inject reticle.connect(): the HTML entry module was ` +
|
|
215
|
+
'never matched, so this app carries no instrumentation and will never connect. Check that ' +
|
|
216
|
+
'index.html references your entry with a <script type="module" src="...">, or pass ' +
|
|
217
|
+
'`inject: false` and call reticle.connect() yourself.';
|
|
218
|
+
/**
|
|
219
|
+
* The DEV message, which must be weaker — and this is the whole reason the two are separate.
|
|
220
|
+
*
|
|
221
|
+
* In serve, `injected` records "my transform ran THIS session", which is not the same as "the app
|
|
222
|
+
* has no connect()". Vite serves an unchanged module straight from its transform cache, so on a
|
|
223
|
+
* warm cache the transform never runs, the flag stays false, and the old wording announced that
|
|
224
|
+
* the app "will never connect" while the served entry demonstrably contained the injection —
|
|
225
|
+
* verified by fetching it from the dev server. A false alarm, in the tool whose entire argument is
|
|
226
|
+
* that it does not raise them.
|
|
227
|
+
*
|
|
228
|
+
* So dev reports what it actually knows: unconfirmed, with the benign explanation first.
|
|
229
|
+
*/
|
|
230
|
+
const unconfirmedInjectionMessage = () => `[${RETICLE_VITE_PLUGIN_NAME}] could not confirm reticle.connect() was injected: the HTML entry ` +
|
|
231
|
+
'module was not transformed this session. That is expected when Vite served it from its ' +
|
|
232
|
+
'transform cache. If the app does not appear in `reticle status`, restart the dev server with ' +
|
|
233
|
+
'`--force` to bypass the cache, then check that index.html references your entry with a ' +
|
|
234
|
+
'<script type="module" src="...">.';
|
|
235
|
+
/** Warn (never throw) in dev — a running dev server should report the doubt, not die of it. */
|
|
236
|
+
const checkInjected = () => {
|
|
237
|
+
if (!desktop || !inject || injected)
|
|
238
|
+
return;
|
|
239
|
+
warn(unconfirmedInjectionMessage());
|
|
240
|
+
};
|
|
105
241
|
return {
|
|
106
242
|
name: RETICLE_VITE_PLUGIN_NAME,
|
|
107
|
-
|
|
243
|
+
// Web: serve-only, so a production bundle can never carry the SDK — gating is the tool's job.
|
|
244
|
+
// Desktop: a packaged renderer IS a production build with no dev server, so the plugin must also
|
|
245
|
+
// run for `vite build` or the shipped app has no connect() at all.
|
|
246
|
+
...(options.desktop === true ? {} : { apply: 'serve' }),
|
|
108
247
|
enforce: 'pre',
|
|
248
|
+
/**
|
|
249
|
+
* Declare the SDK's CJS runtime deps so Vite pre-bundles them.
|
|
250
|
+
*
|
|
251
|
+
* `@testing-library/dom` is what `by: role` matching runs on, and it pulls CJS `aria-query`. When
|
|
252
|
+
* the SDK resolves from OUTSIDE the app's root — a linked package, a pnpm workspace, `npm link`,
|
|
253
|
+
* a monorepo alias — Vite skips pre-bundling and the named import dies with "does not provide an
|
|
254
|
+
* export named 'elementRoles'". That takes the WHOLE SDK down before connect() runs, so there is
|
|
255
|
+
* no session, no Reticle-side error, and only a console SyntaxError naming a package the
|
|
256
|
+
* developer has never heard of. Measured on the react-admin demo with the SDK aliased to a local
|
|
257
|
+
* checkout: zero sessions, and it looked like the app was failing to render.
|
|
258
|
+
*
|
|
259
|
+
* Declaring them is free when Vite would have found them anyway.
|
|
260
|
+
*/
|
|
261
|
+
config(config) {
|
|
262
|
+
return {
|
|
263
|
+
optimizeDeps: {
|
|
264
|
+
include: [
|
|
265
|
+
...(config.optimizeDeps?.include ?? []),
|
|
266
|
+
SDK_CJS_DEPS.TESTING_LIBRARY,
|
|
267
|
+
SDK_CJS_DEPS.ARIA_QUERY,
|
|
268
|
+
],
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
},
|
|
109
272
|
transform(code, id) {
|
|
273
|
+
// Desktop injection: prepend connect() to the HTML's own entry module. It is a REAL module, so
|
|
274
|
+
// its bare `@reticlehq/react` import resolves through the normal pipeline in both dev and
|
|
275
|
+
// build — which a virtual <script src> only ever did in dev.
|
|
276
|
+
if (desktop && inject && isHtmlEntry(id, htmlEntrySpecifier, root)) {
|
|
277
|
+
injected = true;
|
|
278
|
+
const withConnect = `${connectModuleSource(resolveLazy())}\n${code}`;
|
|
279
|
+
const stamped = sourceMapping && shouldStamp(id) ? stamp(withConnect, id) : null;
|
|
280
|
+
return stamped ?? { code: withConnect, map: null };
|
|
281
|
+
}
|
|
110
282
|
if (!sourceMapping || !shouldStamp(id))
|
|
111
283
|
return null;
|
|
112
284
|
return stamp(code, id);
|
|
113
285
|
},
|
|
114
|
-
resolveId(id) {
|
|
286
|
+
resolveId(id, importer) {
|
|
287
|
+
// Desktop: remember the module the HTML points at, so `transform` can prepend connect() into
|
|
288
|
+
// it. A packaged build has no dev server, so the serve-time trick below — a <script src> at a
|
|
289
|
+
// virtual URL — would emit a tag pointing at a file that does not exist. That shipped an app
|
|
290
|
+
// with a dead script and NO instrumentation, which is worse than not injecting at all.
|
|
291
|
+
// `includes`, not `endsWith`: in a BUILD Vite rewrites the html entry through an html-proxy
|
|
292
|
+
// id (`/index.html?html-proxy&index=0.js`), so an endsWith check silently never matches and
|
|
293
|
+
// nothing is injected — which is exactly how this shipped a bundle with no connect() in it.
|
|
294
|
+
if (desktop && inject && importer !== undefined && importer.includes('.html')) {
|
|
295
|
+
htmlEntrySpecifier = id;
|
|
296
|
+
}
|
|
115
297
|
// Return the id verbatim so Vite serves it back to load (the bare imports inside it then
|
|
116
298
|
// go through normal resolution). No NUL prefix: the browser requests it as a URL.
|
|
117
299
|
return inject && id === RETICLE_CONNECT_MODULE ? RETICLE_CONNECT_MODULE : null;
|
|
@@ -119,23 +301,47 @@ export function reticle(options = {}) {
|
|
|
119
301
|
load(id) {
|
|
120
302
|
if (!inject || id !== RETICLE_CONNECT_MODULE)
|
|
121
303
|
return null;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
304
|
+
return connectModuleSource(resolveLazy());
|
|
305
|
+
},
|
|
306
|
+
configResolved(config) {
|
|
307
|
+
root = config.root;
|
|
308
|
+
command = config.command;
|
|
309
|
+
},
|
|
310
|
+
/**
|
|
311
|
+
* Desktop injection is silent when it misses — the bundle simply has no connect() in it and the
|
|
312
|
+
* app looks wired while reporting nothing. That happened twice while this was being built. A
|
|
313
|
+
* build that could not instrument must fail loudly instead of shipping a binary that lies.
|
|
314
|
+
*/
|
|
315
|
+
buildEnd() {
|
|
316
|
+
if (!desktop || !inject || injected)
|
|
317
|
+
return;
|
|
318
|
+
throw new Error(notInjectedMessage());
|
|
131
319
|
},
|
|
320
|
+
checkInjectedForTest: checkInjected,
|
|
132
321
|
transformIndexHtml() {
|
|
133
|
-
|
|
322
|
+
// In serve, the HTML is sent BEFORE the browser requests the entry module, so the check has to
|
|
323
|
+
// be deferred — asserting here would fire on every healthy start. Unref'd so a dev server is
|
|
324
|
+
// never held open by it.
|
|
325
|
+
if (desktop && inject && command === 'serve') {
|
|
326
|
+
const timer = setTimeout(checkInjected, DEV_INJECTION_GRACE_MS);
|
|
327
|
+
timer.unref?.();
|
|
328
|
+
}
|
|
329
|
+
// Desktop injects via the entry module instead (see transform) — a tag here would be a dead
|
|
330
|
+
// URL in a packaged build.
|
|
331
|
+
if (!inject || desktop)
|
|
134
332
|
return [];
|
|
135
333
|
return [
|
|
334
|
+
// A CLASSIC inline script in <head>, and it has to be both.
|
|
335
|
+
//
|
|
336
|
+
// React reads `__REACT_DEVTOOLS_GLOBAL_HOOK__` when its renderer injects — which happens as
|
|
337
|
+
// soon as react-dom evaluates. A `type="module"` script runs in document order AFTER the
|
|
338
|
+
// app's entry module, so the connect module below can never install the hook in time.
|
|
339
|
+
// Measured on two independent Vite apps: the hook existed with our callback attached and
|
|
340
|
+
// `renderers.size === 0`, so the render meter counted zero forever while the docs advertised
|
|
341
|
+
// commit counts. This runs during parse, before any module, and the meter adopts its buffer.
|
|
342
|
+
{ tag: 'script', children: RENDER_PREHOOK_SOURCE, injectTo: 'head-prepend' },
|
|
136
343
|
{ tag: 'script', attrs: { type: 'module', src: RETICLE_CONNECT_MODULE }, injectTo: 'body' },
|
|
137
344
|
];
|
|
138
345
|
},
|
|
139
346
|
};
|
|
140
347
|
}
|
|
141
|
-
//# sourceMappingURL=index.js.map
|
package/dist/project-id.d.ts
CHANGED
|
@@ -24,4 +24,3 @@ export declare function deriveProjectId(pkgName: string | undefined, rootPath: s
|
|
|
24
24
|
* unit-tested without touching the real filesystem.
|
|
25
25
|
*/
|
|
26
26
|
export declare function resolveProjectId(explicit: string | undefined, cwd: string, readPkgName?: (dir: string) => string | undefined): string;
|
|
27
|
-
//# sourceMappingURL=project-id.d.ts.map
|
package/dist/project-id.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reticlehq/vite-plugin",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Vite plugin for Reticle: dev-only source-map stamping plus auto-injected reticle.connect(). apply:'serve' guarantees it never ships to production.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@babel/core": "^7.26.0",
|
|
37
|
-
"@reticlehq/babel-plugin": "2.
|
|
38
|
-
"@reticlehq/core": "2.
|
|
37
|
+
"@reticlehq/babel-plugin": "2.3.0",
|
|
38
|
+
"@reticlehq/core": "2.3.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/babel__core": "^7.20.5",
|
|
42
|
-
"vite": "^
|
|
42
|
+
"vite": "^8"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"vite": ">=4"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discover-port.d.ts","sourceRoot":"","sources":["../src/discover-port.ts"],"names":[],"mappings":"AA2BA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,IAAI,GAAE,MAAyC,EAC/C,KAAK,GAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAiB,GACxC,MAAM,GAAG,SAAS,CAoBpB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discover-port.js","sourceRoot":"","sources":["../src/discover-port.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,cAAc,EACd,UAAU,GAEX,MAAM,iBAAiB,CAAC;AAEzB,qGAAqG;AACrG,SAAS,OAAO,CAAC,GAAW;IAC1B,IAAI,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAChC,SAA6B,EAC7B,OAAe,IAAI,CAAC,OAAO,EAAE,EAAE,UAAU,CAAC,IAAI,CAAC,EAC/C,QAAkC,OAAO;IAEzC,MAAM,OAAO,GAA0B,EAAE,CAAC;IAC1C,IAAI,KAAe,CAA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