@foldkit/vite-plugin 0.21.0 → 0.22.0-canary.5059f483f1be
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/build.js +1 -1
- package/dist/ssr.d.ts.map +1 -1
- package/dist/ssr.js +5 -9
- package/dist/viewIdentity.d.ts +1 -6
- package/dist/viewIdentity.d.ts.map +1 -1
- package/dist/viewIdentity.js +1 -12
- package/package.json +7 -7
package/dist/build.js
CHANGED
package/dist/ssr.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr.d.ts","sourceRoot":"","sources":["../src/ssr.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAGV,MAAM,EAGP,MAAM,MAAM,CAAA;AAIb,0EAA0E;AAC1E,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC;;;;;OAKG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"ssr.d.ts","sourceRoot":"","sources":["../src/ssr.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAGV,MAAM,EAGP,MAAM,MAAM,CAAA;AAIb,0EAA0E;AAC1E,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC;;;;;OAKG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB,CAAC,CAAA;AAosBF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,YAAa,iBAAiB,KAAG,MAgEvD,CAAA"}
|
package/dist/ssr.js
CHANGED
|
@@ -4,15 +4,11 @@ import { readFile } from 'node:fs/promises';
|
|
|
4
4
|
import { resolve } from 'node:path';
|
|
5
5
|
import { Readable } from 'node:stream';
|
|
6
6
|
import { buildIdForCommand } from './buildToken.js';
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
// reports a perfectly runnable environment as not runnable. The lazily
|
|
13
|
-
// constructed `runner` accessor is the shape every major agrees on, and `in`
|
|
14
|
-
// reads the descriptor rather than invoking the getter, so probing costs
|
|
15
|
-
// nothing.
|
|
7
|
+
// NOTE: Vite's `isRunnableDevEnvironment` is an `instanceof` check against the
|
|
8
|
+
// plugin's own copy of Vite, and the server may have been created by another
|
|
9
|
+
// copy, so it can call a runnable environment not runnable. The lazy `runner`
|
|
10
|
+
// getter is the shape every copy shares, and `in` reads its descriptor without
|
|
11
|
+
// invoking it.
|
|
16
12
|
const isRunnable = (environment) => 'runner' in environment;
|
|
17
13
|
const isEntryModule = (loadedModule) => Predicate.isObject(loadedModule) &&
|
|
18
14
|
Predicate.hasProperty(loadedModule, 'renderPage') &&
|
package/dist/viewIdentity.d.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { type SourceMap } from 'magic-string';
|
|
2
2
|
import { type Plugin } from 'vite';
|
|
3
|
-
type ViteCompatibleSourceMap = SourceMap & {
|
|
4
|
-
file: string;
|
|
5
|
-
sourcesContent: Array<string> | undefined;
|
|
6
|
-
};
|
|
7
3
|
/** Result of {@link transformViewIdentity}: rewritten code plus a source map. */
|
|
8
4
|
export type ViewIdentityTransformResult = Readonly<{
|
|
9
5
|
code: string;
|
|
10
|
-
map:
|
|
6
|
+
map: SourceMap;
|
|
11
7
|
}>;
|
|
12
8
|
/**
|
|
13
9
|
* Brands the return value of every function in a module with that function's
|
|
@@ -64,5 +60,4 @@ export declare const transformViewIdentity: (code: string, id: string, root: str
|
|
|
64
60
|
* whose own `foldkit` alias would otherwise swallow the subpath.
|
|
65
61
|
*/
|
|
66
62
|
export declare const foldkitViewIdentity: () => Plugin;
|
|
67
|
-
export {};
|
|
68
63
|
//# sourceMappingURL=viewIdentity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewIdentity.d.ts","sourceRoot":"","sources":["../src/viewIdentity.ts"],"names":[],"mappings":"AAAA,OAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAI1D,OAAO,EAAE,KAAK,MAAM,EAAY,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"viewIdentity.d.ts","sourceRoot":"","sources":["../src/viewIdentity.ts"],"names":[],"mappings":"AAAA,OAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAI1D,OAAO,EAAE,KAAK,MAAM,EAAY,MAAM,MAAM,CAAA;AA6a5C,iFAAiF;AACjF,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC;IACjD,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,SAAS,CAAA;CACf,CAAC,CAAA;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,qBAAqB,SAC1B,MAAM,MACR,MAAM,QACJ,MAAM,YACF,QAAQ,CAAC;IACjB,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,CAAC,KACD,2BAA2B,GAAG,IAyChC,CAAA;AA8DD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,QAAO,MA0CtC,CAAA"}
|
package/dist/viewIdentity.js
CHANGED
|
@@ -280,17 +280,6 @@ const uniqueBrandAlias = (code) => {
|
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
};
|
|
283
|
-
const isViteCompatibleSourceMap = (sourceMap) => sourceMap.sourcesContent === undefined ||
|
|
284
|
-
sourceMap.sourcesContent.every(content => content !== null);
|
|
285
|
-
const toViteCompatibleSourceMap = (sourceMap) => {
|
|
286
|
-
if (sourceMap.sourcesContent !== undefined) {
|
|
287
|
-
sourceMap.sourcesContent = sourceMap.sourcesContent.map(content => content ?? '');
|
|
288
|
-
}
|
|
289
|
-
if (isViteCompatibleSourceMap(sourceMap)) {
|
|
290
|
-
return sourceMap;
|
|
291
|
-
}
|
|
292
|
-
throw new Error('Failed to normalize the generated source map');
|
|
293
|
-
};
|
|
294
283
|
/**
|
|
295
284
|
* Brands the return value of every function in a module with that function's
|
|
296
285
|
* identity via `brandViewResult` from `foldkit/brand`.
|
|
@@ -368,7 +357,7 @@ export const transformViewIdentity = (code, id, root, options) => {
|
|
|
368
357
|
}
|
|
369
358
|
return {
|
|
370
359
|
code: sourceText.toString(),
|
|
371
|
-
map:
|
|
360
|
+
map: sourceText.generateMap({ hires: 'boundary' }),
|
|
372
361
|
};
|
|
373
362
|
};
|
|
374
363
|
// RESOLUTION
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foldkit/vite-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0-canary.5059f483f1be",
|
|
4
4
|
"description": "Vite plugin for Foldkit with state-preserving live reload",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"effect": "4.0.0-rc.
|
|
20
|
-
"foldkit": "
|
|
21
|
-
"vite": "^
|
|
19
|
+
"effect": "4.0.0-rc.115",
|
|
20
|
+
"foldkit": "0.160.0-canary.5059f483f1be",
|
|
21
|
+
"vite": "^8.0.0"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"magic-string": "^1.2.3",
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^26.4.0",
|
|
29
29
|
"@types/ws": "^8.18.1",
|
|
30
|
-
"effect": "4.0.0-rc.
|
|
30
|
+
"effect": "4.0.0-rc.115",
|
|
31
31
|
"happy-dom": "^20.11.13",
|
|
32
32
|
"rimraf": "^6.1.3",
|
|
33
33
|
"typescript": "^7.0.2",
|
|
34
34
|
"vite": "^8.2.2",
|
|
35
|
-
"
|
|
35
|
+
"vite-host": "npm:vite@8.2.1",
|
|
36
36
|
"vitest": "^4.1.11",
|
|
37
|
-
"foldkit": "0.
|
|
37
|
+
"foldkit": "0.160.0-canary.5059f483f1be"
|
|
38
38
|
},
|
|
39
39
|
"keywords": [
|
|
40
40
|
"vite",
|