@debangchowdhury/core 1.0.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/LICENSE +21 -0
- package/dist/index.cjs +79 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +27 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/package.json +32 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Axiom Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
createStore: () => createStore
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
|
+
|
|
27
|
+
// src/vanilla.ts
|
|
28
|
+
var createStoreImpl = (createState) => {
|
|
29
|
+
let state;
|
|
30
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
31
|
+
const setStateInternal = (partial, replace) => {
|
|
32
|
+
const nextState = typeof partial === "function" ? partial(state) : partial;
|
|
33
|
+
if (Object.is(nextState, state)) return;
|
|
34
|
+
const previousState = state;
|
|
35
|
+
const shouldReplace = replace ?? (typeof nextState !== "object" || nextState === null);
|
|
36
|
+
state = shouldReplace ? nextState : Object.assign({}, state, nextState);
|
|
37
|
+
if (!shouldReplace) {
|
|
38
|
+
let hasChanged = false;
|
|
39
|
+
for (const key of Object.keys(nextState)) {
|
|
40
|
+
if (!Object.is(
|
|
41
|
+
previousState[key],
|
|
42
|
+
nextState[key]
|
|
43
|
+
)) {
|
|
44
|
+
hasChanged = true;
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (!hasChanged) {
|
|
49
|
+
state = previousState;
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
listeners.forEach((listener) => listener(state, previousState));
|
|
54
|
+
};
|
|
55
|
+
const getState = () => state;
|
|
56
|
+
const getInitialState = () => initialState;
|
|
57
|
+
const subscribe = (listener) => {
|
|
58
|
+
listeners.add(listener);
|
|
59
|
+
return () => listeners.delete(listener);
|
|
60
|
+
};
|
|
61
|
+
const destroy = () => {
|
|
62
|
+
listeners.clear();
|
|
63
|
+
};
|
|
64
|
+
const api = {
|
|
65
|
+
setState: setStateInternal,
|
|
66
|
+
getState,
|
|
67
|
+
getInitialState,
|
|
68
|
+
subscribe,
|
|
69
|
+
destroy
|
|
70
|
+
};
|
|
71
|
+
const initialState = state = createState(setStateInternal, getState, api);
|
|
72
|
+
return api;
|
|
73
|
+
};
|
|
74
|
+
var createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);
|
|
75
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
76
|
+
0 && (module.exports = {
|
|
77
|
+
createStore
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/vanilla.ts"],"sourcesContent":["export { createStore } from './vanilla'\nexport type {\n State,\n StoreApi,\n GetState,\n SetState,\n Subscribe,\n Destroy,\n Listener,\n StateCreator,\n CreateStore,\n Selector,\n EqualityFn,\n StoreMutatorIdentifier,\n StoreMutators,\n Mutate,\n} from './types'\n","import type {\n State,\n StoreApi,\n GetState,\n Subscribe,\n Destroy,\n Listener,\n StateCreator,\n CreateStore,\n SetStateInternal,\n} from './types'\n\ntype CreateStoreImpl = <T extends State>(\n createState: StateCreator<T, [], []>\n) => StoreApi<T>\n\nconst createStoreImpl: CreateStoreImpl = (createState) => {\n type TState = ReturnType<typeof createState>\n type TListener = Listener<TState>\n\n let state: TState\n const listeners: Set<TListener> = new Set()\n\n const setStateInternal: SetStateInternal<TState>['_'] = (partial, replace) => {\n const nextState =\n typeof partial === 'function'\n ? (partial as (state: TState) => TState | Partial<TState>)(state)\n : partial\n\n if (Object.is(nextState, state)) return\n\n const previousState = state\n const shouldReplace = replace ?? (typeof nextState !== 'object' || nextState === null)\n state = shouldReplace\n ? (nextState as TState)\n : Object.assign({}, state, nextState)\n\n // For merges, check if any value actually changed\n if (!shouldReplace) {\n let hasChanged = false\n for (const key of Object.keys(nextState as object)) {\n if (!Object.is(\n (previousState as Record<string, unknown>)[key],\n (nextState as Record<string, unknown>)[key]\n )) {\n hasChanged = true\n break\n }\n }\n if (!hasChanged) {\n state = previousState\n return\n }\n }\n\n listeners.forEach((listener) => listener(state, previousState))\n }\n\n const getState: GetState<TState> = () => state\n\n const getInitialState: GetState<TState> = () => initialState\n\n const subscribe: Subscribe<TState> = (listener) => {\n listeners.add(listener)\n return () => listeners.delete(listener)\n }\n\n const destroy: Destroy = () => {\n listeners.clear()\n }\n\n const api: StoreApi<TState> = {\n setState: setStateInternal,\n getState,\n getInitialState,\n subscribe,\n destroy,\n }\n\n const initialState = (state = createState(setStateInternal, getState, api))\n return api\n}\n\nexport const createStore = ((createState) =>\n createState ? createStoreImpl(createState as StateCreator<any, [], []>) : createStoreImpl) as CreateStore\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACgBA,IAAM,kBAAmC,CAAC,gBAAgB;AAIxD,MAAI;AACJ,QAAM,YAA4B,oBAAI,IAAI;AAE1C,QAAM,mBAAkD,CAAC,SAAS,YAAY;AAC5E,UAAM,YACJ,OAAO,YAAY,aACd,QAAwD,KAAK,IAC9D;AAEN,QAAI,OAAO,GAAG,WAAW,KAAK,EAAG;AAEjC,UAAM,gBAAgB;AACtB,UAAM,gBAAgB,YAAY,OAAO,cAAc,YAAY,cAAc;AACjF,YAAQ,gBACH,YACD,OAAO,OAAO,CAAC,GAAG,OAAO,SAAS;AAGtC,QAAI,CAAC,eAAe;AAClB,UAAI,aAAa;AACjB,iBAAW,OAAO,OAAO,KAAK,SAAmB,GAAG;AAClD,YAAI,CAAC,OAAO;AAAA,UACT,cAA0C,GAAG;AAAA,UAC7C,UAAsC,GAAG;AAAA,QAC5C,GAAG;AACD,uBAAa;AACb;AAAA,QACF;AAAA,MACF;AACA,UAAI,CAAC,YAAY;AACf,gBAAQ;AACR;AAAA,MACF;AAAA,IACF;AAEA,cAAU,QAAQ,CAAC,aAAa,SAAS,OAAO,aAAa,CAAC;AAAA,EAChE;AAEA,QAAM,WAA6B,MAAM;AAEzC,QAAM,kBAAoC,MAAM;AAEhD,QAAM,YAA+B,CAAC,aAAa;AACjD,cAAU,IAAI,QAAQ;AACtB,WAAO,MAAM,UAAU,OAAO,QAAQ;AAAA,EACxC;AAEA,QAAM,UAAmB,MAAM;AAC7B,cAAU,MAAM;AAAA,EAClB;AAEA,QAAM,MAAwB;AAAA,IAC5B,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,eAAgB,QAAQ,YAAY,kBAAkB,UAAU,GAAG;AACzE,SAAO;AACT;AAEO,IAAM,eAAe,CAAC,gBAC3B,cAAc,gBAAgB,WAAwC,IAAI;","names":[]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type State = object;
|
|
2
|
+
interface StoreApi<T extends State> {
|
|
3
|
+
setState: SetState<T>;
|
|
4
|
+
getState: GetState<T>;
|
|
5
|
+
getInitialState: GetState<T>;
|
|
6
|
+
subscribe: Subscribe<T>;
|
|
7
|
+
destroy: Destroy;
|
|
8
|
+
}
|
|
9
|
+
type GetState<T> = () => T;
|
|
10
|
+
type SetState<T> = (partial: T | Partial<T> | ((state: T) => T | Partial<T>), replace?: boolean) => void;
|
|
11
|
+
type Subscribe<T> = (listener: (state: T, prevState: T) => void) => () => void;
|
|
12
|
+
type Destroy = () => void;
|
|
13
|
+
type StateCreator<T extends State, _Mis extends [StoreMutatorIdentifier, unknown][] = [], Mos extends [StoreMutatorIdentifier, unknown][] = [], U = T> = ((setState: SetState<T>, getState: GetState<T>, store: StoreApi<T>) => U) & {
|
|
14
|
+
$$storeMutators?: Mos;
|
|
15
|
+
};
|
|
16
|
+
interface StoreMutators<_T extends State = State, _U = unknown> {
|
|
17
|
+
}
|
|
18
|
+
type StoreMutatorIdentifier = string;
|
|
19
|
+
type Mutate<S extends State, A> = A extends [] ? S : A extends [[infer i, infer a], ...infer rest] ? i extends keyof StoreMutators<S, a> ? Mutate<StoreMutators<S, a>[i], rest> : never : S;
|
|
20
|
+
type CreateStore = <T extends State, Mos extends [StoreMutatorIdentifier, unknown][] = []>(initializer: StateCreator<T, [], Mos>) => Mutate<StoreApi<T>, Mos>;
|
|
21
|
+
type Listener<T> = (state: T, prevState: T) => void;
|
|
22
|
+
type EqualityFn<T> = (a: T, b: T) => boolean;
|
|
23
|
+
type Selector<T, U> = (state: T) => U;
|
|
24
|
+
|
|
25
|
+
declare const createStore: CreateStore;
|
|
26
|
+
|
|
27
|
+
export { type CreateStore, type Destroy, type EqualityFn, type GetState, type Listener, type Mutate, type Selector, type SetState, type State, type StateCreator, type StoreApi, type StoreMutatorIdentifier, type StoreMutators, type Subscribe, createStore };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type State = object;
|
|
2
|
+
interface StoreApi<T extends State> {
|
|
3
|
+
setState: SetState<T>;
|
|
4
|
+
getState: GetState<T>;
|
|
5
|
+
getInitialState: GetState<T>;
|
|
6
|
+
subscribe: Subscribe<T>;
|
|
7
|
+
destroy: Destroy;
|
|
8
|
+
}
|
|
9
|
+
type GetState<T> = () => T;
|
|
10
|
+
type SetState<T> = (partial: T | Partial<T> | ((state: T) => T | Partial<T>), replace?: boolean) => void;
|
|
11
|
+
type Subscribe<T> = (listener: (state: T, prevState: T) => void) => () => void;
|
|
12
|
+
type Destroy = () => void;
|
|
13
|
+
type StateCreator<T extends State, _Mis extends [StoreMutatorIdentifier, unknown][] = [], Mos extends [StoreMutatorIdentifier, unknown][] = [], U = T> = ((setState: SetState<T>, getState: GetState<T>, store: StoreApi<T>) => U) & {
|
|
14
|
+
$$storeMutators?: Mos;
|
|
15
|
+
};
|
|
16
|
+
interface StoreMutators<_T extends State = State, _U = unknown> {
|
|
17
|
+
}
|
|
18
|
+
type StoreMutatorIdentifier = string;
|
|
19
|
+
type Mutate<S extends State, A> = A extends [] ? S : A extends [[infer i, infer a], ...infer rest] ? i extends keyof StoreMutators<S, a> ? Mutate<StoreMutators<S, a>[i], rest> : never : S;
|
|
20
|
+
type CreateStore = <T extends State, Mos extends [StoreMutatorIdentifier, unknown][] = []>(initializer: StateCreator<T, [], Mos>) => Mutate<StoreApi<T>, Mos>;
|
|
21
|
+
type Listener<T> = (state: T, prevState: T) => void;
|
|
22
|
+
type EqualityFn<T> = (a: T, b: T) => boolean;
|
|
23
|
+
type Selector<T, U> = (state: T) => U;
|
|
24
|
+
|
|
25
|
+
declare const createStore: CreateStore;
|
|
26
|
+
|
|
27
|
+
export { type CreateStore, type Destroy, type EqualityFn, type GetState, type Listener, type Mutate, type Selector, type SetState, type State, type StateCreator, type StoreApi, type StoreMutatorIdentifier, type StoreMutators, type Subscribe, createStore };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// src/vanilla.ts
|
|
2
|
+
var createStoreImpl = (createState) => {
|
|
3
|
+
let state;
|
|
4
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
5
|
+
const setStateInternal = (partial, replace) => {
|
|
6
|
+
const nextState = typeof partial === "function" ? partial(state) : partial;
|
|
7
|
+
if (Object.is(nextState, state)) return;
|
|
8
|
+
const previousState = state;
|
|
9
|
+
const shouldReplace = replace ?? (typeof nextState !== "object" || nextState === null);
|
|
10
|
+
state = shouldReplace ? nextState : Object.assign({}, state, nextState);
|
|
11
|
+
if (!shouldReplace) {
|
|
12
|
+
let hasChanged = false;
|
|
13
|
+
for (const key of Object.keys(nextState)) {
|
|
14
|
+
if (!Object.is(
|
|
15
|
+
previousState[key],
|
|
16
|
+
nextState[key]
|
|
17
|
+
)) {
|
|
18
|
+
hasChanged = true;
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (!hasChanged) {
|
|
23
|
+
state = previousState;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
listeners.forEach((listener) => listener(state, previousState));
|
|
28
|
+
};
|
|
29
|
+
const getState = () => state;
|
|
30
|
+
const getInitialState = () => initialState;
|
|
31
|
+
const subscribe = (listener) => {
|
|
32
|
+
listeners.add(listener);
|
|
33
|
+
return () => listeners.delete(listener);
|
|
34
|
+
};
|
|
35
|
+
const destroy = () => {
|
|
36
|
+
listeners.clear();
|
|
37
|
+
};
|
|
38
|
+
const api = {
|
|
39
|
+
setState: setStateInternal,
|
|
40
|
+
getState,
|
|
41
|
+
getInitialState,
|
|
42
|
+
subscribe,
|
|
43
|
+
destroy
|
|
44
|
+
};
|
|
45
|
+
const initialState = state = createState(setStateInternal, getState, api);
|
|
46
|
+
return api;
|
|
47
|
+
};
|
|
48
|
+
var createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);
|
|
49
|
+
export {
|
|
50
|
+
createStore
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/vanilla.ts"],"sourcesContent":["import type {\n State,\n StoreApi,\n GetState,\n Subscribe,\n Destroy,\n Listener,\n StateCreator,\n CreateStore,\n SetStateInternal,\n} from './types'\n\ntype CreateStoreImpl = <T extends State>(\n createState: StateCreator<T, [], []>\n) => StoreApi<T>\n\nconst createStoreImpl: CreateStoreImpl = (createState) => {\n type TState = ReturnType<typeof createState>\n type TListener = Listener<TState>\n\n let state: TState\n const listeners: Set<TListener> = new Set()\n\n const setStateInternal: SetStateInternal<TState>['_'] = (partial, replace) => {\n const nextState =\n typeof partial === 'function'\n ? (partial as (state: TState) => TState | Partial<TState>)(state)\n : partial\n\n if (Object.is(nextState, state)) return\n\n const previousState = state\n const shouldReplace = replace ?? (typeof nextState !== 'object' || nextState === null)\n state = shouldReplace\n ? (nextState as TState)\n : Object.assign({}, state, nextState)\n\n // For merges, check if any value actually changed\n if (!shouldReplace) {\n let hasChanged = false\n for (const key of Object.keys(nextState as object)) {\n if (!Object.is(\n (previousState as Record<string, unknown>)[key],\n (nextState as Record<string, unknown>)[key]\n )) {\n hasChanged = true\n break\n }\n }\n if (!hasChanged) {\n state = previousState\n return\n }\n }\n\n listeners.forEach((listener) => listener(state, previousState))\n }\n\n const getState: GetState<TState> = () => state\n\n const getInitialState: GetState<TState> = () => initialState\n\n const subscribe: Subscribe<TState> = (listener) => {\n listeners.add(listener)\n return () => listeners.delete(listener)\n }\n\n const destroy: Destroy = () => {\n listeners.clear()\n }\n\n const api: StoreApi<TState> = {\n setState: setStateInternal,\n getState,\n getInitialState,\n subscribe,\n destroy,\n }\n\n const initialState = (state = createState(setStateInternal, getState, api))\n return api\n}\n\nexport const createStore = ((createState) =>\n createState ? createStoreImpl(createState as StateCreator<any, [], []>) : createStoreImpl) as CreateStore\n"],"mappings":";AAgBA,IAAM,kBAAmC,CAAC,gBAAgB;AAIxD,MAAI;AACJ,QAAM,YAA4B,oBAAI,IAAI;AAE1C,QAAM,mBAAkD,CAAC,SAAS,YAAY;AAC5E,UAAM,YACJ,OAAO,YAAY,aACd,QAAwD,KAAK,IAC9D;AAEN,QAAI,OAAO,GAAG,WAAW,KAAK,EAAG;AAEjC,UAAM,gBAAgB;AACtB,UAAM,gBAAgB,YAAY,OAAO,cAAc,YAAY,cAAc;AACjF,YAAQ,gBACH,YACD,OAAO,OAAO,CAAC,GAAG,OAAO,SAAS;AAGtC,QAAI,CAAC,eAAe;AAClB,UAAI,aAAa;AACjB,iBAAW,OAAO,OAAO,KAAK,SAAmB,GAAG;AAClD,YAAI,CAAC,OAAO;AAAA,UACT,cAA0C,GAAG;AAAA,UAC7C,UAAsC,GAAG;AAAA,QAC5C,GAAG;AACD,uBAAa;AACb;AAAA,QACF;AAAA,MACF;AACA,UAAI,CAAC,YAAY;AACf,gBAAQ;AACR;AAAA,MACF;AAAA,IACF;AAEA,cAAU,QAAQ,CAAC,aAAa,SAAS,OAAO,aAAa,CAAC;AAAA,EAChE;AAEA,QAAM,WAA6B,MAAM;AAEzC,QAAM,kBAAoC,MAAM;AAEhD,QAAM,YAA+B,CAAC,aAAa;AACjD,cAAU,IAAI,QAAQ;AACtB,WAAO,MAAM,UAAU,OAAO,QAAQ;AAAA,EACxC;AAEA,QAAM,UAAmB,MAAM;AAC7B,cAAU,MAAM;AAAA,EAClB;AAEA,QAAM,MAAwB;AAAA,IAC5B,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,eAAgB,QAAQ,YAAY,kBAAkB,UAAU,GAAG;AACzE,SAAO;AACT;AAEO,IAAM,eAAe,CAAC,gBAC3B,cAAc,gBAAgB,WAAwC,IAAI;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@debangchowdhury/core",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Cascade core state management engine",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"tsup": "^8.0.0",
|
|
21
|
+
"typescript": "^5.3.0",
|
|
22
|
+
"vitest": "^1.0.0"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsup src/index.ts --format cjs,esm --dts --sourcemap --clean",
|
|
29
|
+
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
30
|
+
"test": "vitest run"
|
|
31
|
+
}
|
|
32
|
+
}
|