@kimesh/pinia 0.2.40 → 0.2.41
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/composables/index.d.mts +2 -0
- package/dist/composables/index.mjs +3 -0
- package/dist/{composables-DRL29fIt.js → composables-B7jw3q9w.mjs} +1 -1
- package/dist/{index-CAUlXznX.d.ts → index-CwVpYEog.d.mts} +1 -2
- package/dist/{index.d.ts → index.d.mts} +2 -3
- package/dist/{index.js → index.mjs} +12 -11
- package/dist/{plugin-BE8kPeGM.d.ts → plugin.d.mts} +4 -5
- package/dist/{plugin-CIfIwAj8.js → plugin.mjs} +6 -2
- package/package.json +20 -20
- package/dist/composables/index.d.ts +0 -2
- package/dist/composables/index.js +0 -3
- package/dist/plugin.d.ts +0 -2
- package/dist/plugin.js +0 -3
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Pinia } from "pinia";
|
|
2
2
|
|
|
3
3
|
//#region src/composables/use-pinia.d.ts
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Get the Pinia instance from Kimesh app context.
|
|
7
6
|
* @throws Error if @kimesh/pinia module is not installed
|
|
@@ -12,4 +11,4 @@ declare function useKimeshPinia(): Pinia;
|
|
|
12
11
|
*/
|
|
13
12
|
declare function tryUseKimeshPinia(): Pinia | undefined;
|
|
14
13
|
//#endregion
|
|
15
|
-
export {
|
|
14
|
+
export { useKimeshPinia as n, tryUseKimeshPinia as t };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PiniaPluginOptions
|
|
1
|
+
import { n as useKimeshPinia, t as tryUseKimeshPinia } from "./index-CwVpYEog.mjs";
|
|
2
|
+
import piniaPlugin, { PiniaPluginOptions } from "./plugin.mjs";
|
|
3
3
|
import * as _kimesh_kit0 from "@kimesh/kit";
|
|
4
4
|
import { Pinia, PiniaPlugin, PiniaPlugin as PiniaPlugin$1, Store, StoreDefinition } from "pinia";
|
|
5
5
|
|
|
6
6
|
//#region src/types.d.ts
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* Configuration options for the Kimesh Pinia module.
|
|
10
9
|
*/
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import piniaPlugin from "./plugin.mjs";
|
|
2
|
+
import { n as useKimeshPinia, t as tryUseKimeshPinia } from "./composables-B7jw3q9w.mjs";
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import { addImportsDir, addImportsPreset, addRuntimePlugin, addVitePlugin, createResolver, defineKimeshModule } from "@kimesh/kit";
|
|
6
6
|
|
|
7
7
|
//#region src/module.ts
|
|
8
|
+
/**
|
|
9
|
+
* @kimesh/pinia - Module Implementation
|
|
10
|
+
*
|
|
11
|
+
* Pinia state management integration for Kimesh.
|
|
12
|
+
*/
|
|
8
13
|
const PINIA_IMPORTS = [
|
|
9
14
|
"defineStore",
|
|
10
15
|
"acceptHMRUpdate",
|
|
@@ -34,8 +39,7 @@ var module_default = defineKimeshModule({
|
|
|
34
39
|
},
|
|
35
40
|
async setup(options, kimesh) {
|
|
36
41
|
const { autoImports = true, storesDir = "src/stores", storePattern = "*.ts", devtools = true, autoScanStores = true } = options;
|
|
37
|
-
|
|
38
|
-
addRuntimePlugin(resolver.resolve("./plugin.js"), { append: false });
|
|
42
|
+
addRuntimePlugin(createResolver(import.meta.url).resolve("./plugin.mjs"), { append: false });
|
|
39
43
|
if (autoImports) {
|
|
40
44
|
addImportsPreset({
|
|
41
45
|
from: "pinia",
|
|
@@ -66,13 +70,10 @@ var module_default = defineKimeshModule({
|
|
|
66
70
|
addVitePlugin({
|
|
67
71
|
name: "@kimesh/pinia:inject-options",
|
|
68
72
|
transform(code, id) {
|
|
69
|
-
if (id.includes("@kimesh/pinia") && id.includes("plugin")) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
map: null
|
|
74
|
-
};
|
|
75
|
-
}
|
|
73
|
+
if (id.includes("@kimesh/pinia") && id.includes("plugin")) return {
|
|
74
|
+
code: `globalThis.__KIMESH_PINIA_OPTIONS__ = { devtools: ${devtools}, plugins: [] };\n` + code,
|
|
75
|
+
map: null
|
|
76
|
+
};
|
|
76
77
|
return null;
|
|
77
78
|
}
|
|
78
79
|
});
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { Pinia
|
|
1
|
+
import { Pinia, PiniaPlugin } from "pinia";
|
|
2
2
|
import * as _kimesh_router_runtime0 from "@kimesh/router-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin.d.ts
|
|
5
|
-
|
|
6
5
|
interface PiniaPluginOptions {
|
|
7
6
|
devtools?: boolean;
|
|
8
|
-
plugins?: PiniaPlugin
|
|
7
|
+
plugins?: PiniaPlugin[];
|
|
9
8
|
}
|
|
10
9
|
declare const piniaPlugin: _kimesh_router_runtime0.KimeshRuntimePlugin<{
|
|
11
|
-
$pinia: Pinia
|
|
10
|
+
$pinia: Pinia;
|
|
12
11
|
}>;
|
|
13
12
|
//#endregion
|
|
14
|
-
export { type Pinia
|
|
13
|
+
export { type Pinia, type PiniaPlugin, PiniaPluginOptions, piniaPlugin as default, piniaPlugin };
|
|
@@ -2,6 +2,11 @@ import { createPinia } from "pinia";
|
|
|
2
2
|
import { defineKimeshRuntimePlugin } from "@kimesh/router-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin.ts
|
|
5
|
+
/**
|
|
6
|
+
* @kimesh/pinia - Runtime Plugin
|
|
7
|
+
*
|
|
8
|
+
* Registers Pinia with Vue at application startup.
|
|
9
|
+
*/
|
|
5
10
|
function getOptions() {
|
|
6
11
|
return globalThis.__KIMESH_PINIA_OPTIONS__ ?? {
|
|
7
12
|
devtools: true,
|
|
@@ -21,7 +26,6 @@ const piniaPlugin = defineKimeshRuntimePlugin({
|
|
|
21
26
|
return { provide: { $pinia: pinia } };
|
|
22
27
|
}
|
|
23
28
|
});
|
|
24
|
-
var plugin_default = piniaPlugin;
|
|
25
29
|
|
|
26
30
|
//#endregion
|
|
27
|
-
export { piniaPlugin,
|
|
31
|
+
export { piniaPlugin as default, piniaPlugin };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kimesh/pinia",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.41",
|
|
4
4
|
"description": "Pinia state management module for Kimesh framework",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,23 +11,23 @@
|
|
|
11
11
|
"augment.d.ts"
|
|
12
12
|
],
|
|
13
13
|
"type": "module",
|
|
14
|
-
"main": "./dist/index.
|
|
15
|
-
"types": "./dist/index.d.
|
|
14
|
+
"main": "./dist/index.mjs",
|
|
15
|
+
"types": "./dist/index.d.mts",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
|
-
"types": "./dist/index.d.
|
|
19
|
-
"import": "./dist/index.
|
|
20
|
-
"default": "./dist/index.
|
|
18
|
+
"types": "./dist/index.d.mts",
|
|
19
|
+
"import": "./dist/index.mjs",
|
|
20
|
+
"default": "./dist/index.mjs"
|
|
21
21
|
},
|
|
22
22
|
"./plugin": {
|
|
23
|
-
"types": "./dist/plugin.d.
|
|
24
|
-
"import": "./dist/plugin.
|
|
25
|
-
"default": "./dist/plugin.
|
|
23
|
+
"types": "./dist/plugin.d.mts",
|
|
24
|
+
"import": "./dist/plugin.mjs",
|
|
25
|
+
"default": "./dist/plugin.mjs"
|
|
26
26
|
},
|
|
27
27
|
"./composables": {
|
|
28
|
-
"types": "./dist/composables/index.d.
|
|
29
|
-
"import": "./dist/composables/index.
|
|
30
|
-
"default": "./dist/composables/index.
|
|
28
|
+
"types": "./dist/composables/index.d.mts",
|
|
29
|
+
"import": "./dist/composables/index.mjs",
|
|
30
|
+
"default": "./dist/composables/index.mjs"
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
@@ -39,19 +39,19 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@kimesh/kit": "0.2.
|
|
43
|
-
"@kimesh/router-runtime": "0.2.
|
|
42
|
+
"@kimesh/kit": "0.2.41",
|
|
43
|
+
"@kimesh/router-runtime": "0.2.41",
|
|
44
44
|
"pinia": "^3.0.4",
|
|
45
|
-
"tsdown": "^0.
|
|
46
|
-
"typescript": "^5.
|
|
47
|
-
"vite": "^8.0.0-beta.
|
|
45
|
+
"tsdown": "^0.20.3",
|
|
46
|
+
"typescript": "^5.9.3",
|
|
47
|
+
"vite": "^8.0.0-beta.15",
|
|
48
48
|
"vue": "^3.5.29"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@kimesh/kit": "0.2.
|
|
52
|
-
"@kimesh/router-runtime": "0.2.
|
|
51
|
+
"@kimesh/kit": "0.2.41",
|
|
52
|
+
"@kimesh/router-runtime": "0.2.41",
|
|
53
53
|
"pinia": "^2.3.0 || ^3.0.0",
|
|
54
|
-
"vite": "^8.0.0-beta.
|
|
54
|
+
"vite": "^8.0.0-beta.15",
|
|
55
55
|
"vue": "^3.5.0"
|
|
56
56
|
}
|
|
57
57
|
}
|
package/dist/plugin.d.ts
DELETED
package/dist/plugin.js
DELETED