@foldkit/vite-plugin 0.28.0 → 0.29.0-canary.2d944dbae71b

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgDA,OAAO,KAAK,EAEV,MAAM,EAIP,MAAM,MAAM,CAAA;AAQb,OAAO,EAAE,KAAK,mBAAmB,EAAgB,MAAM,YAAY,CAAA;AAMnE,OAAO,EAAE,KAAK,iBAAiB,EAAc,MAAM,UAAU,CAAA;AAG7D,OAAO,EAAE,KAAK,eAAe,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACzE,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,YAAY,GACb,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,KAAK,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAC7D,OAAO,EACL,KAAK,2BAA2B,EAChC,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,mBAAmB,CAAA;AAE1B,6CAA6C;AAC7C,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAC1C;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IAChC;;;;;;;OAOG;IACH,GAAG,CAAC,EAAE,IAAI,CACR,iBAAiB,EACjB,SAAS,GAAG,gBAAgB,GAAG,aAAa,GAAG,aAAa,CAC7D,GACC,CACI,QAAQ,CAAC;QACP,kFAAkF;QAClF,WAAW,EAAE,MAAM,CAAA;QACnB,WAAW,CAAC,EAAE,KAAK,CAAA;QACnB;;;;;;;;WAQG;QACH,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC,mBAAmB,EAAE,aAAa,CAAC,CAAA;KAC3D,CAAC,GACF,QAAQ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AE,MAAM,CAAA;QACnB,WAAW,CAAC,EAAE,KAAK,CAAA;QACnB;;;;;;;;WAQG;QACH,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC,mBAAmB,EAAE,aAAa,CAAC,CAAA;KAC3D,CAAC,GACF,QAAQ,CAAC;QACP,kEAAkE;QAClE,WAAW,CAAC,EAAE,KAAK,CAAA;QACnB,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,KAAK,CAAC,EAAE,KAAK,CAAA;KACd,CAAC,CACL,CAAA;IACH;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAC,CAAA;AAmgCF,eAAO,MAAM,OAAO,aAAa,oBAAoB,KAAQ,KAAK,CAAC,MAAM,CA+IxE,CAAA"}
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
- import { Array, Clock, ConfigProvider, Console, Crypto, Data, Duration, Effect, Exit, Fiber, HashMap, Layer, Match, Number, Option, Order, Predicate, Queue, Ref, Schedule, Schema, Stream, pipe, } from 'effect';
1
+ import { Array, Clock, ConfigProvider, Console, Data, Duration, Effect, Exit, Fiber, HashMap, Layer, Match, Number, Option, Order, Predicate, Queue, Ref, Schedule, Schema, Stream, pipe, } from 'effect';
2
+ import { SecureRandom } from 'effect/crypto';
2
3
  import { Event as DevToolsEvent, EventFrame, RELAY_RECORD_VERSION, RequestFrame, Response, ResponseFrame, } from 'foldkit/devtools-protocol';
3
4
  import { PreserveModelMessage, RequestModelMessage, RestoreModelMessage, } from 'foldkit/model-preservation';
4
5
  import { createHmac, timingSafeEqual } from 'node:crypto';
@@ -30,8 +31,10 @@ export { foldkitViewIdentity, transformViewIdentity, } from './viewIdentity.js';
30
31
  const FORCE_INCLUDED_EFFECT_ENTRIES = [
31
32
  'effect',
32
33
  'effect/Array',
34
+ 'effect/BigDecimal',
33
35
  'effect/Boolean',
34
36
  'effect/Cause',
37
+ 'effect/Chunk',
35
38
  'effect/Clock',
36
39
  'effect/Context',
37
40
  'effect/Data',
@@ -49,6 +52,7 @@ const FORCE_INCLUDED_EFFECT_ENTRIES = [
49
52
  'effect/Layer',
50
53
  'effect/Logger',
51
54
  'effect/Match',
55
+ 'effect/MutableRef',
52
56
  'effect/Number',
53
57
  'effect/Option',
54
58
  'effect/Order',
@@ -287,8 +291,8 @@ class RelayBindFailed extends Data.TaggedError('RelayBindFailed') {
287
291
  }
288
292
  const isPortInUse = (error) => Predicate.hasProperty(error, 'code') && error.code === 'EADDRINUSE';
289
293
  const relayId = Effect.gen(function* () {
290
- const crypto = yield* Crypto.Crypto;
291
- return yield* crypto.randomUUIDv4.pipe(Effect.orDie);
294
+ const secureRandom = yield* SecureRandom.SecureRandom;
295
+ return yield* secureRandom.uuidV4();
292
296
  });
293
297
  const attachRelayHandlers = (wss, enqueue) => {
294
298
  wss.on('connection', client => {
@@ -306,8 +310,8 @@ const boundPort = (address) => address === null || Predicate.isString(address)
306
310
  : Option.some(address.port);
307
311
  const relayHasNoBoundPort = () => new Error('[foldkit:devTools] the MCP relay listener has no bound port');
308
312
  const relayToken = Effect.gen(function* () {
309
- const crypto = yield* Crypto.Crypto;
310
- const bytes = yield* crypto.randomBytes(RELAY_TOKEN_BYTES).pipe(Effect.orDie);
313
+ const secureRandom = yield* SecureRandom.SecureRandom;
314
+ const bytes = yield* secureRandom.randomBytes(RELAY_TOKEN_BYTES);
311
315
  return Buffer.from(bytes).toString('hex');
312
316
  });
313
317
  const relayUrlForLog = (url) => {
@@ -533,7 +537,7 @@ const main = (server, events, options) => Effect.gen(function* () {
533
537
  * an array; Vite flattens nested plugin arrays, so `plugins: [foldkit()]`
534
538
  * keeps working.
535
539
  */
536
- const relayRegistryLayer = Layer.provideMerge(NodeChildProcessSpawner.layer, Layer.mergeAll(NodeFileSystem.layer, NodePath.layer, NodeCrypto.layer));
540
+ const relayRegistryLayer = Layer.provideMerge(NodeChildProcessSpawner.layer, Layer.mergeAll(NodeFileSystem.layer, NodePath.layer, NodeCrypto.layerSecureRandom));
537
541
  export const foldkit = (options = {}) => {
538
542
  // NOTE: During a Vite restart, old and new servers overlap. Separate queues
539
543
  // and fibers keep their events and shutdowns attached to the right server.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foldkit/vite-plugin",
3
- "version": "0.28.0",
3
+ "version": "0.29.0-canary.2d944dbae71b",
4
4
  "description": "Vite plugin for Foldkit with state-preserving live reload",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -16,13 +16,13 @@
16
16
  "dist"
17
17
  ],
18
18
  "peerDependencies": {
19
- "effect": "4.0.0",
20
- "foldkit": ">=0.167.0",
19
+ "effect": "~4.1.0",
20
+ "foldkit": "0.170.0-canary.2d944dbae71b",
21
21
  "vite": "^8.0.0"
22
22
  },
23
23
  "dependencies": {
24
- "@effect/platform-node": "4.0.0",
25
- "@effect/platform-node-shared": "4.0.0",
24
+ "@effect/platform-node": "~4.1.0",
25
+ "@effect/platform-node-shared": "~4.1.0",
26
26
  "magic-string": "^1.4.2",
27
27
  "vitefu": "^1.1.3",
28
28
  "ws": "^8.21.3"
@@ -31,8 +31,8 @@
31
31
  "@types/node": "26.4.0",
32
32
  "@types/ws": "^8.18.1",
33
33
  "@vitejs/plugin-basic-ssl": "^2.3.0",
34
- "effect": "4.0.0",
35
- "foldkit": "0.169.0",
34
+ "effect": "4.1.0",
35
+ "foldkit": "0.170.0-canary.2d944dbae71b",
36
36
  "happy-dom": "^20.14.5",
37
37
  "rimraf": "^6.1.3",
38
38
  "typescript": "^7.0.2",
@@ -58,7 +58,7 @@
58
58
  "access": "public"
59
59
  },
60
60
  "engines": {
61
- "node": ">=20.19.0"
61
+ "node": ">=22.19.0"
62
62
  },
63
63
  "scripts": {
64
64
  "clean": "rimraf dist *.tsbuildinfo",