@vitejs/devtools-kit 0.1.3 → 0.1.5

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,6 +1,20 @@
1
- import { t as EventEmitter } from "./events-B41U-zeg.js";
2
- import { Objectish, Patch, Patch as SharedStatePatch } from "immer";
1
+ import { t as EventEmitter } from "./events-BTCXlxeC.js";
3
2
 
3
+ //#region ../../node_modules/.pnpm/immer@11.1.4/node_modules/immer/dist/immer.d.ts
4
+ interface Patch {
5
+ op: "replace" | "remove" | "add";
6
+ path: (string | number)[];
7
+ value?: any;
8
+ }
9
+ type Objectish = AnyObject | AnyArray | AnyMap | AnySet;
10
+ type AnyObject = {
11
+ [key: string]: any;
12
+ };
13
+ type AnyArray = Array<any>;
14
+ type AnySet = Set<any>;
15
+ type AnyMap = Map<any, any>;
16
+ /** Returns true if the given value is an Immer draft */
17
+ //#endregion
4
18
  //#region src/utils/shared-state.d.ts
5
19
  type ImmutablePrimitive = undefined | null | boolean | string | number | Function;
6
20
  type Immutable<T> = T extends ImmutablePrimitive ? T : T extends Array<infer U> ? ImmutableArray<U> : T extends Map<infer K, infer V> ? ImmutableMap<K, V> : T extends Set<infer M> ? ImmutableSet<M> : ImmutableObject<T>;
@@ -50,4 +64,4 @@ interface SharedStateOptions<T> {
50
64
  }
51
65
  declare function createSharedState<T extends Objectish>(options: SharedStateOptions<T>): SharedState<T>;
52
66
  //#endregion
53
- export { ImmutableSet as a, SharedStateOptions as c, ImmutableObject as i, SharedStatePatch as l, ImmutableArray as n, SharedState as o, ImmutableMap as r, SharedStateEvents as s, Immutable as t, createSharedState as u };
67
+ export { ImmutableSet as a, SharedStateOptions as c, ImmutableObject as i, createSharedState as l, ImmutableArray as n, SharedState as o, ImmutableMap as r, SharedStateEvents as s, Immutable as t, Patch as u };
@@ -1,4 +1,4 @@
1
- import { r as EventsMap, t as EventEmitter } from "../events-B41U-zeg.js";
1
+ import { r as EventsMap, t as EventEmitter } from "../events-BTCXlxeC.js";
2
2
 
3
3
  //#region src/utils/events.d.ts
4
4
  /**
@@ -0,0 +1,10 @@
1
+ //#region ../../node_modules/.pnpm/human-id@4.1.3/node_modules/human-id/dist/index.d.ts
2
+ interface Options {
3
+ separator?: string;
4
+ capitalize?: boolean;
5
+ adjectiveCount?: number;
6
+ addAdverb?: boolean;
7
+ }
8
+ declare function humanId(options?: Options | string | boolean): string;
9
+ //#endregion
10
+ export { humanId };
@@ -0,0 +1,2 @@
1
+ import { t as humanId } from "../human-id-BSiGlZOw.js";
2
+ export { humanId };
@@ -1,2 +1,2 @@
1
- import { a as ImmutableSet, c as SharedStateOptions, i as ImmutableObject, l as SharedStatePatch, n as ImmutableArray, o as SharedState, r as ImmutableMap, s as SharedStateEvents, t as Immutable, u as createSharedState } from "../shared-state-BFKKxNt1.js";
2
- export { Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableSet, SharedState, SharedStateEvents, SharedStateOptions, SharedStatePatch, createSharedState };
1
+ import { a as ImmutableSet, c as SharedStateOptions, i as ImmutableObject, l as createSharedState, n as ImmutableArray, o as SharedState, r as ImmutableMap, s as SharedStateEvents, t as Immutable, u as Patch } from "../shared-state-NxkOZ3u0.js";
2
+ export { Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableSet, SharedState, SharedStateEvents, SharedStateOptions, Patch as SharedStatePatch, createSharedState };
@@ -1,36 +1,2 @@
1
- import { createEventEmitter } from "./events.js";
2
- import { nanoid } from "./nanoid.js";
3
- import { applyPatches, enablePatches, produce, produceWithPatches } from "immer";
4
- //#region src/utils/shared-state.ts
5
- function createSharedState(options) {
6
- const { enablePatches: enablePatches$1 = false } = options;
7
- const events = createEventEmitter();
8
- let state = options.initialValue;
9
- const syncIds = /* @__PURE__ */ new Set();
10
- return {
11
- on: events.on,
12
- value: () => state,
13
- patch: (patches, syncId = nanoid()) => {
14
- if (syncIds.has(syncId)) return;
15
- enablePatches();
16
- state = applyPatches(state, patches);
17
- syncIds.add(syncId);
18
- events.emit("updated", state, void 0, syncId);
19
- },
20
- mutate: (fn, syncId = nanoid()) => {
21
- if (syncIds.has(syncId)) return;
22
- syncIds.add(syncId);
23
- if (enablePatches$1) {
24
- const [newState, patches] = produceWithPatches(state, fn);
25
- state = newState;
26
- events.emit("updated", state, patches, syncId);
27
- } else {
28
- state = produce(state, fn);
29
- events.emit("updated", state, void 0, syncId);
30
- }
31
- },
32
- syncIds
33
- };
34
- }
35
- //#endregion
1
+ import { t as createSharedState } from "../shared-state-CCNEYlbv.js";
36
2
  export { createSharedState };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitejs/devtools-kit",
3
3
  "type": "module",
4
- "version": "0.1.3",
4
+ "version": "0.1.5",
5
5
  "description": "Vite DevTools Kit",
6
6
  "author": "VoidZero Inc.",
7
7
  "license": "MIT",
@@ -23,6 +23,7 @@
23
23
  "./client": "./dist/client.js",
24
24
  "./constants": "./dist/constants.js",
25
25
  "./utils/events": "./dist/utils/events.js",
26
+ "./utils/human-id": "./dist/utils/human-id.js",
26
27
  "./utils/nanoid": "./dist/utils/nanoid.js",
27
28
  "./utils/shared-state": "./dist/utils/shared-state.js",
28
29
  "./package.json": "./package.json"
@@ -37,16 +38,19 @@
37
38
  },
38
39
  "dependencies": {
39
40
  "birpc": "^4.0.0",
40
- "immer": "^11.1.4",
41
- "@vitejs/devtools-rpc": "0.1.3"
41
+ "ohash": "^2.0.11",
42
+ "@vitejs/devtools-rpc": "0.1.5"
42
43
  },
43
44
  "devDependencies": {
44
- "tsdown": "^0.21.2",
45
+ "human-id": "^4.1.3",
46
+ "immer": "^11.1.4",
47
+ "tsdown": "^0.21.4",
45
48
  "ua-parser-modern": "^0.1.1",
46
- "vite": "^8.0.0"
49
+ "vite": "^8.0.1"
47
50
  },
48
51
  "inlinedDependencies": {
49
- "ohash": "2.0.11",
52
+ "human-id": "4.1.3",
53
+ "immer": "11.1.4",
50
54
  "ua-parser-modern": "0.1.1"
51
55
  },
52
56
  "scripts": {