@reticlehq/vite-plugin 2.14.0 → 3.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/dist/index.cjs +540 -472
- package/dist/index.d.cts +21 -31
- package/dist/index.d.ts +21 -31
- package/dist/index.js +75 -102
- package/dist/injection-postcondition.d.ts +81 -0
- package/dist/injection-postcondition.js +123 -0
- package/dist/plugin-name.d.ts +7 -0
- package/dist/plugin-name.js +7 -0
- package/dist/project-id.d.ts +24 -6
- package/dist/project-id.js +67 -22
- package/dist/vitest-browser.d.ts +2 -2
- package/dist/vitest-browser.js +2 -2
- package/dist/watch-ignore.d.ts +3 -3
- package/dist/watch-ignore.js +3 -3
- package/package.json +7 -6
- /package/dist/{ensure-token.d.ts → token/ensure-token.d.ts} +0 -0
- /package/dist/{ensure-token.js → token/ensure-token.js} +0 -0
- /package/dist/{missing-token.d.ts → token/missing-token.d.ts} +0 -0
- /package/dist/{missing-token.js → token/missing-token.js} +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The check that says whether `reticle.connect()` actually made it into the page, and what to say
|
|
3
|
+
* when it did not.
|
|
4
|
+
*
|
|
5
|
+
* These three messages live together because choosing between them is the whole subtlety. Each says
|
|
6
|
+
* exactly as much as the plugin actually knows and no more, and getting that wrong in either
|
|
7
|
+
* direction has cost real users:
|
|
8
|
+
*
|
|
9
|
+
* - Claim "this is broken" when it is not, and the tool whose entire pitch is that it does not
|
|
10
|
+
* raise false alarms has just raised one.
|
|
11
|
+
* - Say nothing when it IS broken, and someone waits twenty minutes for a session that can never
|
|
12
|
+
* arrive.
|
|
13
|
+
*/
|
|
14
|
+
import { RETICLE_VITE_PLUGIN_NAME } from './plugin-name.js';
|
|
15
|
+
/**
|
|
16
|
+
* How long to wait before concluding that the connect script never made it in.
|
|
17
|
+
*
|
|
18
|
+
* Generous on purpose: the browser has to request the entry, and a cold dev server transforming a
|
|
19
|
+
* large app can take a moment. A false warning would train people to ignore a real one.
|
|
20
|
+
*/
|
|
21
|
+
export const DEV_INJECTION_GRACE_MS = 10_000;
|
|
22
|
+
/**
|
|
23
|
+
* The BUILD message. A build always runs every transform, so "my transform never ran" and "the
|
|
24
|
+
* bundle has no connect()" are the same statement there, and stating it as a certainty is correct.
|
|
25
|
+
*/
|
|
26
|
+
export const notInjectedMessage = () => `[${RETICLE_VITE_PLUGIN_NAME}] could not inject reticle.connect(): the HTML entry module was ` +
|
|
27
|
+
'never matched, so this app carries no instrumentation and will never connect. Check that ' +
|
|
28
|
+
'index.html references your entry with a <script type="module" src="...">, or pass ' +
|
|
29
|
+
'`inject: false` and call reticle.connect({ token: __RETICLE_TOKEN__ }) yourself. The plugin ' +
|
|
30
|
+
'still inlines that define; a connect without it is refused.';
|
|
31
|
+
/**
|
|
32
|
+
* The DEV message, which must be weaker — and this is the whole reason the two are separate.
|
|
33
|
+
*
|
|
34
|
+
* In serve, `injected` records "my transform ran THIS session", which is not the same as "the app
|
|
35
|
+
* has no connect()". Vite serves an unchanged module straight from its transform cache, so on a
|
|
36
|
+
* warm cache the transform never runs and the flag stays false, so wording that announces the app
|
|
37
|
+
* "will never connect" is a false alarm raised over a served entry that does contain the injection.
|
|
38
|
+
*
|
|
39
|
+
* So dev reports what it actually knows: unconfirmed, with the benign explanation first.
|
|
40
|
+
*/
|
|
41
|
+
export const unconfirmedInjectionMessage = () => `[${RETICLE_VITE_PLUGIN_NAME}] could not confirm reticle.connect() was injected: the HTML entry ` +
|
|
42
|
+
'module was not transformed this session. That is expected when Vite served it from its ' +
|
|
43
|
+
'transform cache. If the app does not appear in `reticle status`, restart the dev server with ' +
|
|
44
|
+
'`--force` to bypass the cache, then check that index.html references your entry with a ' +
|
|
45
|
+
'<script type="module" src="...">.';
|
|
46
|
+
/**
|
|
47
|
+
* The web message.
|
|
48
|
+
*
|
|
49
|
+
* On the web the connect script is added by `transformIndexHtml`. A framework that renders its own
|
|
50
|
+
* HTML never calls that hook, so the script is never added and the app never appears in
|
|
51
|
+
* `reticle status`. Known examples: SvelteKit, Nuxt, Astro, React Router in framework mode and
|
|
52
|
+
* TanStack Start. Each was found the same way — a user waiting on a session that could never
|
|
53
|
+
* arrive — so the plain-language cause comes first and the fix comes second.
|
|
54
|
+
*/
|
|
55
|
+
export const htmlHookNeverRanMessage = () => `[${RETICLE_VITE_PLUGIN_NAME}] this app will never connect: the dev server never asked this ` +
|
|
56
|
+
'plugin to transform any HTML, so reticle.connect() was never added to the page. That usually ' +
|
|
57
|
+
'means your framework renders its own HTML instead of serving index.html — SvelteKit, Nuxt, ' +
|
|
58
|
+
'Astro, React Router (framework mode) and TanStack Start all do. Fix: import ' +
|
|
59
|
+
"'@reticlehq/browser' and call reticle.connect({ token: __RETICLE_TOKEN__ }) yourself from your " +
|
|
60
|
+
'app entry file, and pass `inject: false` to this plugin so the two do not both try.';
|
|
61
|
+
const defaultSchedule = (run, ms) => {
|
|
62
|
+
const timer = setTimeout(run, ms);
|
|
63
|
+
// Never hold a dev server open on account of a warning it may not even need to print.
|
|
64
|
+
timer.unref?.();
|
|
65
|
+
};
|
|
66
|
+
export function createInjectionWatch(deps) {
|
|
67
|
+
/**
|
|
68
|
+
* Has a browser actually asked this dev server for a PAGE?
|
|
69
|
+
*
|
|
70
|
+
* The fact that makes "the HTML hook never ran" mean anything. `transformIndexHtml` only runs when
|
|
71
|
+
* a document is requested, so on a dev server nobody has opened it has correctly never run — and
|
|
72
|
+
* a check that cannot tell that apart from a framework owning its own HTML will call a perfectly
|
|
73
|
+
* healthy app permanently broken. That is what it did: the timer was armed at server boot, so ten
|
|
74
|
+
* seconds after startup an unopened dev server was told its app would never connect.
|
|
75
|
+
*/
|
|
76
|
+
let htmlRequested = false;
|
|
77
|
+
const isDocumentRequest = (req) => true === req.headers?.accept?.includes('text/html');
|
|
78
|
+
/**
|
|
79
|
+
* Warn when the HTML hook never ran. NOT scheduled from `transformIndexHtml` — a hook that never
|
|
80
|
+
* runs would never arm its own check, and it would be unreachable in exactly the case it exists
|
|
81
|
+
* for. It hangs off the first request instead: independent of the hook, but still evidence-based.
|
|
82
|
+
*
|
|
83
|
+
* `htmlRequested` is re-checked here rather than only at the arming site. The timer is one caller;
|
|
84
|
+
* this states the precondition where the claim is actually made, which is where somebody reading
|
|
85
|
+
* `warn(htmlHookNeverRanMessage())` needs to see it.
|
|
86
|
+
*/
|
|
87
|
+
const checkHtmlHookRan = () => {
|
|
88
|
+
if (deps.desktop || !deps.inject || deps.htmlTransformed())
|
|
89
|
+
return;
|
|
90
|
+
// Nobody has opened the app. That says nothing about whether it can connect.
|
|
91
|
+
if (!htmlRequested)
|
|
92
|
+
return;
|
|
93
|
+
deps.warn(htmlHookNeverRanMessage());
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Note a document request, and start the clock from THERE.
|
|
97
|
+
*
|
|
98
|
+
* The grace period is meant to cover "the browser asked, so the transform should have happened by
|
|
99
|
+
* now". Measured from server start it was covering "the server booted", which is a question about
|
|
100
|
+
* the developer's attention rather than about the app.
|
|
101
|
+
*/
|
|
102
|
+
const noteHtmlRequest = () => {
|
|
103
|
+
if (htmlRequested)
|
|
104
|
+
return;
|
|
105
|
+
htmlRequested = true;
|
|
106
|
+
(deps.schedule ?? defaultSchedule)(checkHtmlHookRan, DEV_INJECTION_GRACE_MS);
|
|
107
|
+
};
|
|
108
|
+
/** Warn (never throw) in dev — a running dev server should report the doubt, not die of it. */
|
|
109
|
+
const checkInjected = () => {
|
|
110
|
+
if (!deps.desktop || !deps.inject || deps.injected())
|
|
111
|
+
return;
|
|
112
|
+
deps.warn(unconfirmedInjectionMessage());
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* In serve the HTML is sent BEFORE the browser requests the entry module, so asserting at html
|
|
116
|
+
* time would fire on every healthy start. Deferred here rather than at the call site, so that
|
|
117
|
+
* every "when may this speak" rule in the plugin sits in the one file that argues about them.
|
|
118
|
+
*/
|
|
119
|
+
const armDesktopCheck = () => {
|
|
120
|
+
(deps.schedule ?? defaultSchedule)(checkInjected, DEV_INJECTION_GRACE_MS);
|
|
121
|
+
};
|
|
122
|
+
return { noteHtmlRequest, isDocumentRequest, checkHtmlHookRan, checkInjected, armDesktopCheck };
|
|
123
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The name Vite shows for this plugin, and the prefix on every message it prints.
|
|
3
|
+
*
|
|
4
|
+
* It lives in its own file so the message builders can use it without importing the plugin itself,
|
|
5
|
+
* which would be a circular import.
|
|
6
|
+
*/
|
|
7
|
+
export declare const RETICLE_VITE_PLUGIN_NAME = "reticle";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The name Vite shows for this plugin, and the prefix on every message it prints.
|
|
3
|
+
*
|
|
4
|
+
* It lives in its own file so the message builders can use it without importing the plugin itself,
|
|
5
|
+
* which would be a circular import.
|
|
6
|
+
*/
|
|
7
|
+
export const RETICLE_VITE_PLUGIN_NAME = 'reticle';
|
package/dist/project-id.d.ts
CHANGED
|
@@ -13,13 +13,31 @@ export declare function shortHash(input: string): string;
|
|
|
13
13
|
* Derive the stable projectId from the package name (may be undefined) and the absolute root path.
|
|
14
14
|
*
|
|
15
15
|
* The rule itself is core's `projectIdFrom`, shared with `reticle init`: this id is what scopes a
|
|
16
|
-
* session to an app, so what the plugin stamps and what init records must be the same string
|
|
17
|
-
*
|
|
16
|
+
* session to an app, so what the plugin stamps and what init records must be the same string — ONE
|
|
17
|
+
* implementation, not two copies kept in step by hand.
|
|
18
18
|
*/
|
|
19
19
|
export declare function deriveProjectId(pkgName: string | undefined, rootPath: string): string;
|
|
20
|
+
/** Reads a file, or throws — the one filesystem touch these walkers make, injectable for tests. */
|
|
21
|
+
type ReadFile = (path: string) => string;
|
|
20
22
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
23
|
+
* Read the `projectId` `reticle init` recorded in the nearest `.reticle.json`, or undefined.
|
|
24
|
+
*
|
|
25
|
+
* This is the id of RECORD. The derivation below is a fallback for a project that has never been
|
|
26
|
+
* through `init` — it is not a second opinion, and where the two disagree the config wins.
|
|
27
|
+
*/
|
|
28
|
+
export declare function readConfiguredProjectId(startDir: string, readFile?: ReadFile): string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Resolve the projectId for a plugin instance, most-local statement of intent first: an explicit
|
|
31
|
+
* option, then the id `reticle init` recorded in `.reticle.json`, then derivation.
|
|
32
|
+
*
|
|
33
|
+
* The config step is what makes the id survive a dev server that does not share a filesystem with
|
|
34
|
+
* the CLI. Derivation hashes the ABSOLUTE ROOT, so a containerised Vite (`/app`) and the host `init`
|
|
35
|
+
* that wired it produce different ids for one project — the page announces one, the daemon expects
|
|
36
|
+
* the other, and the bridge refuses the connection with `authentication failed`, which names
|
|
37
|
+
* neither. Reading the file `init` already wrote costs one `readFileSync` at config time and makes
|
|
38
|
+
* the two halves agree by construction rather than by coincidence of working directory.
|
|
39
|
+
*
|
|
40
|
+
* `cwd`, `readPkgName` and `readConfiguredId` are injectable so resolution is unit-tested without
|
|
41
|
+
* touching the real filesystem.
|
|
24
42
|
*/
|
|
25
|
-
export declare function resolveProjectId(explicit: string | undefined, cwd: string, readPkgName?: (dir: string) => string | undefined): string;
|
|
43
|
+
export declare function resolveProjectId(explicit: string | undefined, cwd: string, readPkgName?: (dir: string) => string | undefined, readConfiguredId?: (dir: string) => string | undefined): string;
|
package/dist/project-id.js
CHANGED
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { createHash } from 'node:crypto';
|
|
10
10
|
import { dirname, join } from 'node:path';
|
|
11
|
-
import {
|
|
11
|
+
import { readFileSync } from 'node:fs';
|
|
12
12
|
import { PROJECT_ID_HASH_LENGTH, projectIdFrom } from '@reticlehq/core';
|
|
13
|
+
/** The project config `reticle init` writes, and the id of record it carries. */
|
|
14
|
+
const RETICLE_CONFIG_BASENAME = '.reticle.json';
|
|
13
15
|
export { slugifyPackageName } from '@reticlehq/core';
|
|
14
16
|
/** A short, stable hex fingerprint of the absolute project root (disambiguates same-named checkouts). */
|
|
15
17
|
export function shortHash(input) {
|
|
@@ -19,30 +21,48 @@ export function shortHash(input) {
|
|
|
19
21
|
* Derive the stable projectId from the package name (may be undefined) and the absolute root path.
|
|
20
22
|
*
|
|
21
23
|
* The rule itself is core's `projectIdFrom`, shared with `reticle init`: this id is what scopes a
|
|
22
|
-
* session to an app, so what the plugin stamps and what init records must be the same string
|
|
23
|
-
*
|
|
24
|
+
* session to an app, so what the plugin stamps and what init records must be the same string — ONE
|
|
25
|
+
* implementation, not two copies kept in step by hand.
|
|
24
26
|
*/
|
|
25
27
|
export function deriveProjectId(pkgName, rootPath) {
|
|
26
28
|
return projectIdFrom(pkgName, rootPath, shortHash);
|
|
27
29
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
const readFileOrThrow = (path) => readFileSync(path, 'utf8');
|
|
31
|
+
/**
|
|
32
|
+
* How far up to look for `.reticle.json`, and WHY it is not the package.json depth below.
|
|
33
|
+
*
|
|
34
|
+
* The same number, for the same reason, as the server's `MAX_CONFIG_SEARCH_DEPTH`: deep enough for
|
|
35
|
+
* an app in `frontend/` or `apps/web/`, a worktree beside its main checkout, and a package inside a
|
|
36
|
+
* monorepo — and shallow enough that a dev server started somewhere unrelated cannot silently adopt
|
|
37
|
+
* a distant ancestor's config and announce another app's identity. The two walkers have to agree,
|
|
38
|
+
* because the whole point of reading this file is that the plugin and the CLI stop disagreeing.
|
|
39
|
+
*/
|
|
40
|
+
const MAX_CONFIG_SEARCH_DEPTH = 6;
|
|
41
|
+
/**
|
|
42
|
+
* How far up to look for `package.json`, which is a different question with a different answer.
|
|
43
|
+
*
|
|
44
|
+
* A package name is only ever used to BUILD an id, never to adopt one, so an over-eager walk here
|
|
45
|
+
* costs a less specific name rather than the wrong app's identity. Left as it was.
|
|
46
|
+
*/
|
|
47
|
+
const MAX_PACKAGE_SEARCH_DEPTH = 50;
|
|
48
|
+
/**
|
|
49
|
+
* Walk up from `startDir` looking for `basename`, and return the first non-empty string `field`
|
|
50
|
+
* yields. Unreadable and unparseable files are skipped rather than fatal: a dev server must start.
|
|
51
|
+
*/
|
|
52
|
+
function readNearestField(startDir, basename, field, readFile, maxDepth) {
|
|
30
53
|
let dir = startDir;
|
|
31
|
-
for (let depth = 0; depth
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
if ('
|
|
37
|
-
|
|
38
|
-
if ('string' === typeof name && name.length > 0)
|
|
39
|
-
return name;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
catch {
|
|
43
|
-
// unreadable package.json → keep walking up
|
|
54
|
+
for (let depth = 0; depth <= maxDepth; depth++) {
|
|
55
|
+
try {
|
|
56
|
+
const parsed = JSON.parse(readFile(join(dir, basename)));
|
|
57
|
+
if ('object' === typeof parsed && parsed !== null) {
|
|
58
|
+
const value = parsed[field];
|
|
59
|
+
if ('string' === typeof value && value.length > 0)
|
|
60
|
+
return value;
|
|
44
61
|
}
|
|
45
62
|
}
|
|
63
|
+
catch {
|
|
64
|
+
// missing, unreadable or unparseable → keep walking up
|
|
65
|
+
}
|
|
46
66
|
const parent = dirname(dir);
|
|
47
67
|
if (parent === dir)
|
|
48
68
|
break; // reached filesystem root
|
|
@@ -50,13 +70,38 @@ function readNearestPackageName(startDir) {
|
|
|
50
70
|
}
|
|
51
71
|
return undefined;
|
|
52
72
|
}
|
|
73
|
+
/** Read the `name` from the nearest package.json at or above `startDir`, or undefined if none. */
|
|
74
|
+
function readNearestPackageName(startDir, readFile = readFileOrThrow) {
|
|
75
|
+
return readNearestField(startDir, 'package.json', 'name', readFile, MAX_PACKAGE_SEARCH_DEPTH);
|
|
76
|
+
}
|
|
53
77
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
78
|
+
* Read the `projectId` `reticle init` recorded in the nearest `.reticle.json`, or undefined.
|
|
79
|
+
*
|
|
80
|
+
* This is the id of RECORD. The derivation below is a fallback for a project that has never been
|
|
81
|
+
* through `init` — it is not a second opinion, and where the two disagree the config wins.
|
|
82
|
+
*/
|
|
83
|
+
export function readConfiguredProjectId(startDir, readFile = readFileOrThrow) {
|
|
84
|
+
return readNearestField(startDir, RETICLE_CONFIG_BASENAME, 'projectId', readFile, MAX_CONFIG_SEARCH_DEPTH);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Resolve the projectId for a plugin instance, most-local statement of intent first: an explicit
|
|
88
|
+
* option, then the id `reticle init` recorded in `.reticle.json`, then derivation.
|
|
89
|
+
*
|
|
90
|
+
* The config step is what makes the id survive a dev server that does not share a filesystem with
|
|
91
|
+
* the CLI. Derivation hashes the ABSOLUTE ROOT, so a containerised Vite (`/app`) and the host `init`
|
|
92
|
+
* that wired it produce different ids for one project — the page announces one, the daemon expects
|
|
93
|
+
* the other, and the bridge refuses the connection with `authentication failed`, which names
|
|
94
|
+
* neither. Reading the file `init` already wrote costs one `readFileSync` at config time and makes
|
|
95
|
+
* the two halves agree by construction rather than by coincidence of working directory.
|
|
96
|
+
*
|
|
97
|
+
* `cwd`, `readPkgName` and `readConfiguredId` are injectable so resolution is unit-tested without
|
|
98
|
+
* touching the real filesystem.
|
|
57
99
|
*/
|
|
58
|
-
export function resolveProjectId(explicit, cwd, readPkgName = readNearestPackageName) {
|
|
100
|
+
export function resolveProjectId(explicit, cwd, readPkgName = readNearestPackageName, readConfiguredId = readConfiguredProjectId) {
|
|
59
101
|
if (explicit !== undefined && explicit.length > 0)
|
|
60
102
|
return explicit;
|
|
103
|
+
const configured = readConfiguredId(cwd);
|
|
104
|
+
if (configured !== undefined && configured.length > 0)
|
|
105
|
+
return configured;
|
|
61
106
|
return deriveProjectId(readPkgName(cwd), cwd);
|
|
62
107
|
}
|
package/dist/vitest-browser.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Telling Vitest's browser-mode runner apart from every other Vite server.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Small, but it is the discriminator a wrong cut gets wrong in production, so it earns its own file
|
|
5
|
+
* and its own name.
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
8
|
* Is THIS server Vitest's browser-mode runner?
|
package/dist/vitest-browser.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Telling Vitest's browser-mode runner apart from every other Vite server.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Small, but it is the discriminator a wrong cut gets wrong in production, so it earns its own file
|
|
5
|
+
* and its own name.
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
8
|
* Is THIS server Vitest's browser-mode runner?
|
package/dist/watch-ignore.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Normalising Vite's watcher `ignored` list, which is not a list.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Small but cohesive: one third-party type shape, one runtime hazard it hides, and the guard that
|
|
5
|
+
* makes the plugin's return assignable without a cast.
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
|
-
* Append
|
|
8
|
+
* Append Reticle's journal pattern to whatever the app already ignored, without assuming it is an array.
|
|
9
9
|
*
|
|
10
10
|
* Vite's `ignored` is `AnymatchMatcher`, so `watch: { ignored: '**\/fixtures/**' }` is a legal
|
|
11
11
|
* config. Spreading that string would explode it into one pattern PER CHARACTER — every one of
|
package/dist/watch-ignore.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Normalising Vite's watcher `ignored` list, which is not a list.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Small but cohesive: one third-party type shape, one runtime hazard it hides, and the guard that
|
|
5
|
+
* makes the plugin's return assignable without a cast.
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
|
-
* Append
|
|
8
|
+
* Append Reticle's journal pattern to whatever the app already ignored, without assuming it is an array.
|
|
9
9
|
*
|
|
10
10
|
* Vite's `ignored` is `AnymatchMatcher`, so `watch: { ignored: '**\/fixtures/**' }` is a legal
|
|
11
11
|
* config. Spreading that string would explode it into one pattern PER CHARACTER — every one of
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reticlehq/vite-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.1.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",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git+https://github.com/reticlehq/reticle.git",
|
|
11
|
-
"directory": "
|
|
11
|
+
"directory": "adapters/build/vite"
|
|
12
12
|
},
|
|
13
13
|
"homepage": "https://github.com/reticlehq/reticle#readme",
|
|
14
14
|
"bugs": "https://github.com/reticlehq/reticle/issues",
|
|
@@ -41,14 +41,15 @@
|
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@babel/core": "^7.26.0",
|
|
44
|
-
"@reticlehq/babel-plugin": "
|
|
45
|
-
"@reticlehq/core": "
|
|
44
|
+
"@reticlehq/babel-plugin": "3.1.0",
|
|
45
|
+
"@reticlehq/core": "3.1.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/babel__core": "^7.20.5",
|
|
49
|
+
"esbuild": "^0.28.2",
|
|
49
50
|
"svelte": "^5.56.10",
|
|
50
51
|
"vite": "^8",
|
|
51
|
-
"
|
|
52
|
+
"@reticlehq/react": "3.1.0"
|
|
52
53
|
},
|
|
53
54
|
"peerDependencies": {
|
|
54
55
|
"vite": ">=4"
|
|
@@ -65,7 +66,7 @@
|
|
|
65
66
|
"node": ">=20.0.0"
|
|
66
67
|
},
|
|
67
68
|
"scripts": {
|
|
68
|
-
"build": "tsc -b && node scripts/build-cjs.mjs",
|
|
69
|
+
"build": "tsc -b && node ../../../scripts/alias-dist.mjs && node scripts/build-cjs.mjs",
|
|
69
70
|
"typecheck": "tsc -b",
|
|
70
71
|
"lint": "eslint src",
|
|
71
72
|
"test:unit": "vitest run src --passWithNoTests",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|