@reticlehq/init 3.2.0 → 3.4.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/detect/capabilities.d.ts +4 -1
- package/dist/detect/capabilities.js +45 -9
- package/dist/detect/detect.d.ts +58 -4
- package/dist/detect/detect.js +117 -7
- package/dist/detect/dev-script.d.ts +26 -2
- package/dist/detect/dev-script.js +80 -7
- package/dist/detect/non-js-project.d.ts +1 -1
- package/dist/detect/non-js-project.js +6 -1
- package/dist/detect/workspace-apps.d.ts +21 -0
- package/dist/detect/workspace-apps.js +111 -12
- package/dist/detect/workspace-redirect.d.ts +2 -1
- package/dist/detect/workspace-redirect.js +28 -2
- package/dist/diagnose/containerised-dev-server.d.ts +12 -4
- package/dist/diagnose/containerised-dev-server.js +36 -4
- package/dist/diagnose/csp-check.d.ts +12 -6
- package/dist/diagnose/csp-check.js +61 -13
- package/dist/diagnose/csp-doctor.d.ts +33 -2
- package/dist/diagnose/csp-doctor.js +103 -6
- package/dist/diagnose/csp-step.d.ts +27 -0
- package/dist/diagnose/csp-step.js +86 -0
- package/dist/diagnose/desktop-doctor.d.ts +1 -1
- package/dist/diagnose/desktop-doctor.js +8 -2
- package/dist/diagnose/install-hint.d.ts +9 -1
- package/dist/diagnose/install-hint.js +17 -7
- package/dist/diagnose/install-retries.d.ts +18 -2
- package/dist/diagnose/install-retries.js +50 -3
- package/dist/diagnose/terminal-wrap.d.ts +18 -0
- package/dist/diagnose/terminal-wrap.js +63 -0
- package/dist/host.d.ts +6 -0
- package/dist/host.js +3 -0
- package/dist/index.d.ts +8 -3
- package/dist/index.js +8 -3
- package/dist/no-package-json.d.ts +10 -0
- package/dist/no-package-json.js +121 -0
- package/dist/node-io.d.ts +9 -5
- package/dist/node-io.js +25 -7
- package/dist/patch/angular.d.ts +68 -0
- package/dist/patch/angular.js +216 -0
- package/dist/patch/astro-patch.d.ts +48 -13
- package/dist/patch/astro-patch.js +151 -43
- package/dist/patch/cra.d.ts +0 -2
- package/dist/patch/cra.js +0 -2
- package/dist/patch/electron-patch.d.ts +10 -1
- package/dist/patch/electron-patch.js +79 -27
- package/dist/patch/electron-vite-patch.js +1 -1
- package/dist/patch/nuxt-patch.d.ts +1 -1
- package/dist/patch/nuxt-patch.js +2 -2
- package/dist/patch/nuxt-snippets.d.ts +44 -0
- package/dist/patch/nuxt-snippets.js +135 -0
- package/dist/patch/remix.d.ts +24 -0
- package/dist/patch/remix.js +59 -0
- package/dist/patch/snippets.d.ts +58 -57
- package/dist/patch/snippets.js +181 -202
- package/dist/patch/static-page.d.ts +39 -0
- package/dist/patch/static-page.js +102 -0
- package/dist/patch/tanstack-start.d.ts +36 -8
- package/dist/patch/tanstack-start.js +118 -29
- package/dist/patch/vite-config.d.ts +5 -0
- package/dist/patch/vite-config.js +8 -0
- package/dist/patch/vite-env-types.d.ts +9 -0
- package/dist/patch/vite-env-types.js +19 -0
- package/dist/patch/vite-owning-config.d.ts +47 -0
- package/dist/patch/vite-owning-config.js +104 -19
- package/dist/plan/connect-steps.d.ts +10 -3
- package/dist/plan/connect-steps.js +22 -3
- package/dist/plan/framework-adapter.d.ts +5 -6
- package/dist/plan/framework-adapter.js +105 -11
- package/dist/plan/notices.js +4 -3
- package/dist/plan/plan-angular.d.ts +6 -0
- package/dist/plan/plan-angular.js +89 -0
- package/dist/plan/plan-electron-vite.d.ts +6 -3
- package/dist/plan/plan-electron-vite.js +39 -8
- package/dist/plan/plan-framework.d.ts +9 -47
- package/dist/plan/plan-framework.js +114 -323
- package/dist/plan/plan-types.d.ts +47 -2
- package/dist/plan/plan-vite.d.ts +67 -0
- package/dist/plan/plan-vite.js +256 -0
- package/dist/plan/plan.js +155 -69
- package/dist/plan/port-steps.d.ts +45 -0
- package/dist/plan/port-steps.js +119 -0
- package/dist/plan/preflight.d.ts +17 -3
- package/dist/plan/preflight.js +53 -23
- package/dist/plan/stop-hook-step.d.ts +4 -0
- package/dist/plan/stop-hook-step.js +49 -0
- package/dist/project/agent-rules.js +2 -0
- package/dist/register/mcp-clients.d.ts +13 -0
- package/dist/register/mcp-clients.js +22 -0
- package/dist/register/mcp.d.ts +26 -5
- package/dist/register/mcp.js +64 -8
- package/dist/run-types.d.ts +10 -0
- package/dist/run.js +132 -78
- package/package.json +3 -4
- package/NOTICE +0 -5
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The plan's
|
|
2
|
+
* The plan's Electron half: the renderer plugin, capabilities, and the two Electron steps — for
|
|
3
|
+
* electron-vite and for Electron Forge's Vite template, which differ only in where the renderer's
|
|
4
|
+
* Vite config lives.
|
|
3
5
|
*
|
|
4
|
-
* Its own module because
|
|
5
|
-
* a preload and a main process the web frameworks have no equivalent of.
|
|
6
|
+
* Its own module because these are the only frameworks whose wiring reaches outside the renderer,
|
|
7
|
+
* into a preload and a main process the web frameworks have no equivalent of.
|
|
6
8
|
*/
|
|
7
9
|
import { StepStatus } from './plan-types.js';
|
|
8
10
|
import { StepTitle } from './connect-steps.js';
|
|
9
|
-
import {
|
|
11
|
+
import { patchStep } from './plan-framework.js';
|
|
12
|
+
import { capabilitiesStep, viteSteps } from './plan-vite.js';
|
|
13
|
+
import { alreadyOrMovedPort } from './port-steps.js';
|
|
10
14
|
import { patchElectronViteConfig } from '../patch/electron-vite-patch.js';
|
|
11
15
|
import { patchElectronMain, patchElectronPreload } from '../patch/electron-patch.js';
|
|
12
16
|
import { ELECTRON_CAPTURE_FIX, ELECTRON_PRELOAD_FIX } from '../diagnose/desktop-doctor.js';
|
|
@@ -29,15 +33,19 @@ export function electronViteSteps(input) {
|
|
|
29
33
|
status: StepStatus.MANUAL,
|
|
30
34
|
detail: manual,
|
|
31
35
|
}
|
|
32
|
-
: patchStep(StepTitle.ELECTRON_VITE_PLUGIN, cfg.path, patchElectronViteConfig(cfg.source, port), 'add reticle({ desktop: true }) to the renderer plugins (also injects connect())', manual);
|
|
36
|
+
: alreadyOrMovedPort(patchStep(StepTitle.ELECTRON_VITE_PLUGIN, cfg.path, patchElectronViteConfig(cfg.source, port), 'add reticle({ desktop: true }) to the renderer plugins (also injects connect())', manual), cfg.source, port);
|
|
33
37
|
return [
|
|
34
38
|
plugin,
|
|
35
39
|
...capabilitiesStep(input, ELECTRON_VITE_DEV_MODULE_PATH),
|
|
36
|
-
...electronPreloadStep(input),
|
|
40
|
+
...electronPreloadStep(input, false),
|
|
37
41
|
...electronCaptureStep(input),
|
|
38
42
|
];
|
|
39
43
|
}
|
|
40
|
-
|
|
44
|
+
/**
|
|
45
|
+
* `viteTypes` is for Forge, whose tsconfig has no `import.meta.env` types for the dev guard. See
|
|
46
|
+
* `patchElectronPreload`.
|
|
47
|
+
*/
|
|
48
|
+
function electronPreloadStep(input, viteTypes) {
|
|
41
49
|
const file = input.electronPreload ?? null;
|
|
42
50
|
if (null === file) {
|
|
43
51
|
return [
|
|
@@ -50,7 +58,7 @@ function electronPreloadStep(input) {
|
|
|
50
58
|
];
|
|
51
59
|
}
|
|
52
60
|
return [
|
|
53
|
-
patchStep(StepTitle.ELECTRON_PRELOAD, file.path, patchElectronPreload(file.source, file.path), 'require the IPC shim as the first line of preload', ELECTRON_PRELOAD_FIX),
|
|
61
|
+
patchStep(StepTitle.ELECTRON_PRELOAD, file.path, patchElectronPreload(file.source, file.path, viteTypes), 'require the IPC shim as the first line of preload, dev only', ELECTRON_PRELOAD_FIX),
|
|
54
62
|
];
|
|
55
63
|
}
|
|
56
64
|
function electronCaptureStep(input) {
|
|
@@ -69,3 +77,26 @@ function electronCaptureStep(input) {
|
|
|
69
77
|
patchStep(StepTitle.ELECTRON_CAPTURE, file.path, patchElectronMain(file.source, file.path), 'installReticleCapture on the BrowserWindow so screenshots work', ELECTRON_CAPTURE_FIX),
|
|
70
78
|
];
|
|
71
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Electron Forge's Vite template: the renderer config, then the same two Electron halves.
|
|
82
|
+
*
|
|
83
|
+
* Forge's renderer config is an ordinary Vite config (`defineConfig({})`), so it is patched by the
|
|
84
|
+
* ordinary Vite patcher — `run.ts` hands it over as `viteConfig` when the framework is Forge.
|
|
85
|
+
*
|
|
86
|
+
* The plugin goes in WITHOUT `desktop: true`. `electron-forge start` serves the renderer through a
|
|
87
|
+
* real Vite dev server, so the plugin's ordinary serve-time injection reaches the window; the flag
|
|
88
|
+
* exists for a packaged renderer driven with no dev server, which is built in a non-production mode
|
|
89
|
+
* on purpose. Without it a packaged Forge app has no connect() in any mode, which is the web default
|
|
90
|
+
* and the safe direction. Measured on a
|
|
91
|
+
* scaffolded Forge 8 app: `tsc --noEmit` and `electron-forge package` both pass after `init`, and the
|
|
92
|
+
* packaged renderer carries no Reticle code.
|
|
93
|
+
*/
|
|
94
|
+
const FORGE_RENDERER_DETAIL = 'add reticle() to the renderer plugins — the only one of Forge’s three Vite builds with a ' +
|
|
95
|
+
'document (also injects connect() while `electron-forge start` serves it)';
|
|
96
|
+
export function electronForgeSteps(input) {
|
|
97
|
+
return [
|
|
98
|
+
...viteSteps(input, FORGE_RENDERER_DETAIL),
|
|
99
|
+
...electronPreloadStep(input, true),
|
|
100
|
+
...electronCaptureStep(input),
|
|
101
|
+
];
|
|
102
|
+
}
|
|
@@ -1,40 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* How each framework gets wired: the
|
|
3
|
-
* `plan.ts` is the plan's SHAPE (statuses, ordering, the agent/MCP steps); this is the
|
|
4
|
-
* detail, and they grow for different reasons.
|
|
2
|
+
* How each framework gets wired: the three Next files, the SvelteKit client hook, CRA, Nuxt, Astro
|
|
3
|
+
* and the rest. `plan.ts` is the plan's SHAPE (statuses, ordering, the agent/MCP steps); this is the
|
|
4
|
+
* per-framework detail, and they grow for different reasons. The Vite plugin and the capabilities
|
|
5
|
+
* module every Vite-based stack shares live in `plan-vite.ts`.
|
|
5
6
|
*/
|
|
6
7
|
import { type SourcePatch } from '../patch/patch-kind.js';
|
|
7
8
|
import { type PlanInput, type Step } from './plan-types.js';
|
|
8
9
|
import { StepTitle } from './connect-steps.js';
|
|
9
|
-
/** What adding `reticle()` to a Vite config buys, which differs by framework. */
|
|
10
|
-
export declare const VITE_PLUGIN_DETAIL: {
|
|
11
|
-
/** A plain Vite app gets both halves from the plugin. */
|
|
12
|
-
readonly VITE: "add reticle() to plugins (also injects connect())";
|
|
13
|
-
/**
|
|
14
|
-
* SvelteKit renders through app.html, so the plugin's HTML injection never fires and connect()
|
|
15
|
-
* comes from the client hook instead. The plugin is still required: it is what stamps
|
|
16
|
-
* data-reticle-source into .svelte components, and without it every verdict on a SvelteKit app
|
|
17
|
-
* comes back with no file:line at all.
|
|
18
|
-
*/
|
|
19
|
-
readonly SVELTEKIT: "add reticle() to plugins (stamps data-reticle-source in .svelte components)";
|
|
20
|
-
/**
|
|
21
|
-
* React Router framework mode renders through its own request handler, so the plugin's HTML
|
|
22
|
-
* injection never fires and connect() comes from the client entry instead. The plugin is still
|
|
23
|
-
* required for the same reason it is under SvelteKit: without it every verdict on the app comes
|
|
24
|
-
* back with no file:line at all.
|
|
25
|
-
*/
|
|
26
|
-
readonly REACT_ROUTER: "add reticle() to plugins (stamps data-reticle-source in .tsx components)";
|
|
27
|
-
/**
|
|
28
|
-
* TanStack Start SSRs its own HTML, so the plugin's HTML injection never fires and connect()
|
|
29
|
-
* comes from a client effect instead. `inject: false` is load-bearing honesty: leaving the
|
|
30
|
-
* default would keep reporting "also injects connect()" for a transform that never runs.
|
|
31
|
-
* The plugin is still required for the same reason it is under SvelteKit: without it every
|
|
32
|
-
* verdict on the app comes back with no file:line at all.
|
|
33
|
-
*/
|
|
34
|
-
readonly TANSTACK_START: "add reticle({ inject: false }) to plugins (stamps data-reticle-source; Start SSRs its own HTML so connect() cannot come from the plugin)";
|
|
35
|
-
};
|
|
36
|
-
export declare function capabilitiesStep(input: PlanInput, path?: string): Step[];
|
|
37
|
-
export declare function viteSteps(input: PlanInput, detail?: string, inject?: boolean): Step[];
|
|
38
10
|
/**
|
|
39
11
|
* Turn a conservative source patch into a step: applied when it patched, already when the wiring is
|
|
40
12
|
* there, and the hand-edit instructions when the file shape wasn't one we recognise.
|
|
@@ -75,17 +47,17 @@ export declare function nuxtSteps(input: PlanInput): Step[];
|
|
|
75
47
|
* would replace that default with one that never hydrates. When it is present, one line is added to
|
|
76
48
|
* it and nothing else is touched.
|
|
77
49
|
*/
|
|
78
|
-
export declare function reactRouterSteps(input: PlanInput): Step[];
|
|
50
|
+
export declare function reactRouterSteps(input: PlanInput, title?: StepTitle, newEntry?: () => string): Step[];
|
|
79
51
|
/**
|
|
80
|
-
* TanStack Start:
|
|
52
|
+
* TanStack Start: a client connect component, written, and rendered in the root document.
|
|
81
53
|
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
54
|
+
* ATOMIC, like Astro: the component on disk with nothing rendering it is a guaranteed
|
|
55
|
+
* non-connection, so when the root cannot be patched BOTH halves go back to the recipe.
|
|
84
56
|
*/
|
|
85
57
|
export declare function tanstackStartSteps(input: PlanInput): Step[];
|
|
86
58
|
export declare function svelteKitSteps(input: PlanInput): Step[];
|
|
87
59
|
/**
|
|
88
|
-
* Astro: the config
|
|
60
|
+
* Astro: the config build target, and the connect script (with the pairing token) in ONE layout.
|
|
89
61
|
*
|
|
90
62
|
* Astro was the last gated stack left printing a recipe it did not apply. It still falls back to the
|
|
91
63
|
* printed one whenever the choice is not obvious — no config, no single layout, or a shape the
|
|
@@ -93,16 +65,6 @@ export declare function svelteKitSteps(input: PlanInput): Step[];
|
|
|
93
65
|
* and a half-edited build config is worse than a documented manual step.
|
|
94
66
|
*/
|
|
95
67
|
export declare function astroSteps(input: PlanInput): Step[];
|
|
96
|
-
/**
|
|
97
|
-
* A Content-Security-Policy whose `connect-src` excludes the bridge, said out loud at install time.
|
|
98
|
-
*
|
|
99
|
-
* Both reported cases were Next apps where `init` printed success for every step and the app then
|
|
100
|
-
* never connected: the browser blocked the WebSocket and reported it in its own console, which
|
|
101
|
-
* nothing on this side reads. A NOTICE rather than a step, because editing someone's security policy
|
|
102
|
-
* is theirs to do — but it carries the exact text to paste, which is the difference between a
|
|
103
|
-
* warning and a fix.
|
|
104
|
-
*/
|
|
105
|
-
export declare function cspStep(input: PlanInput): Step[];
|
|
106
68
|
/**
|
|
107
69
|
* The plain-HTML path: no bundler to hook, so the connect snippet is printed for a hand edit.
|
|
108
70
|
*
|