@kimesh/pinia 0.0.1 → 0.1.0-nightly.20260119171158

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,2 +1,2 @@
1
- import { tryUseKimeshPinia$1 as tryUseKimeshPinia, useKimeshPinia$1 as useKimeshPinia } from "../index-BI7uRRJC.js";
1
+ import { tryUseKimeshPinia$1 as tryUseKimeshPinia, useKimeshPinia$1 as useKimeshPinia } from "../index-CAUlXznX.js";
2
2
  export { tryUseKimeshPinia, useKimeshPinia };
@@ -19,5 +19,4 @@ function tryUseKimeshPinia() {
19
19
  }
20
20
 
21
21
  //#endregion
22
- export { tryUseKimeshPinia, useKimeshPinia };
23
- //# sourceMappingURL=composables-DRL29fIt.js.map
22
+ export { tryUseKimeshPinia, useKimeshPinia };
@@ -11,7 +11,5 @@ declare function useKimeshPinia(): Pinia;
11
11
  * Try to get the Pinia instance without throwing.
12
12
  */
13
13
  declare function tryUseKimeshPinia(): Pinia | undefined;
14
- //# sourceMappingURL=use-pinia.d.ts.map
15
14
  //#endregion
16
- export { tryUseKimeshPinia as tryUseKimeshPinia$1, useKimeshPinia as useKimeshPinia$1 };
17
- //# sourceMappingURL=index-BI7uRRJC.d.ts.map
15
+ export { tryUseKimeshPinia as tryUseKimeshPinia$1, useKimeshPinia as useKimeshPinia$1 };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { tryUseKimeshPinia$1 as tryUseKimeshPinia, useKimeshPinia$1 as useKimeshPinia } from "./index-BI7uRRJC.js";
1
+ import { tryUseKimeshPinia$1 as tryUseKimeshPinia, useKimeshPinia$1 as useKimeshPinia } from "./index-CAUlXznX.js";
2
2
  import { PiniaPluginOptions, piniaPlugin$1 as piniaPlugin } from "./plugin-C_cuPpfH.js";
3
3
  import * as _kimesh_kit0 from "@kimesh/kit";
4
4
  import { Pinia, PiniaPlugin, PiniaPlugin as PiniaPlugin$1, Store, StoreDefinition } from "pinia";
@@ -29,10 +29,8 @@ interface PiniaRuntimePluginOptions {
29
29
  devtools: boolean;
30
30
  plugins: PiniaPlugin$1[];
31
31
  }
32
- //# sourceMappingURL=types.d.ts.map
33
32
  //#endregion
34
33
  //#region src/module.d.ts
35
34
  declare const _default: _kimesh_kit0.KimeshModule<KimeshPiniaConfig>;
36
35
  //#endregion
37
- export { type KimeshPiniaConfig, type Pinia, type PiniaPlugin, type PiniaPluginOptions, type PiniaRuntimePluginOptions, type Store, type StoreDefinition, _default as default, _default as pinia, piniaPlugin, tryUseKimeshPinia, useKimeshPinia };
38
- //# sourceMappingURL=index.d.ts.map
36
+ export { type KimeshPiniaConfig, type Pinia, type PiniaPlugin, type PiniaPluginOptions, type PiniaRuntimePluginOptions, type Store, type StoreDefinition, _default as default, _default as pinia, piniaPlugin, tryUseKimeshPinia, useKimeshPinia };
package/dist/index.js CHANGED
@@ -80,5 +80,4 @@ var module_default = defineKimeshModule({
80
80
  });
81
81
 
82
82
  //#endregion
83
- export { module_default as default, module_default as pinia, piniaPlugin, tryUseKimeshPinia, useKimeshPinia };
84
- //# sourceMappingURL=index.js.map
83
+ export { module_default as default, module_default as pinia, piniaPlugin, tryUseKimeshPinia, useKimeshPinia };
@@ -24,5 +24,4 @@ const piniaPlugin = defineKimeshRuntimePlugin({
24
24
  var plugin_default = piniaPlugin;
25
25
 
26
26
  //#endregion
27
- export { piniaPlugin, plugin_default };
28
- //# sourceMappingURL=plugin-CIfIwAj8.js.map
27
+ export { piniaPlugin, plugin_default };
@@ -8,5 +8,4 @@ interface PiniaPluginOptions {
8
8
  }
9
9
  declare const piniaPlugin: any;
10
10
  //#endregion
11
- export { type Pinia$1 as Pinia, type PiniaPlugin$1 as PiniaPlugin, PiniaPluginOptions, piniaPlugin as piniaPlugin$1 };
12
- //# sourceMappingURL=plugin-C_cuPpfH.d.ts.map
11
+ export { type Pinia$1 as Pinia, type PiniaPlugin$1 as PiniaPlugin, PiniaPluginOptions, piniaPlugin as piniaPlugin$1 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kimesh/pinia",
3
- "version": "0.0.1",
3
+ "version": "0.1.0-nightly.20260119171158",
4
4
  "description": "Pinia state management module for Kimesh framework",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -34,15 +34,15 @@
34
34
  },
35
35
  "dependencies": {},
36
36
  "peerDependencies": {
37
- "@kimesh/kit": "0.0.1",
38
- "@kimesh/router-runtime": "0.0.1",
37
+ "@kimesh/kit": "0.1.0-nightly.20260119171158",
38
+ "@kimesh/router-runtime": "0.1.0-nightly.20260119171158",
39
39
  "pinia": "^2.3.0 || ^3.0.0",
40
40
  "vite": "^8.0.0-beta.8",
41
41
  "vue": "^3.5.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@kimesh/kit": "0.0.1",
45
- "@kimesh/router-runtime": "0.0.1",
44
+ "@kimesh/kit": "0.1.0-nightly.20260119171158",
45
+ "@kimesh/router-runtime": "0.1.0-nightly.20260119171158",
46
46
  "pinia": "^3.0.4",
47
47
  "tsdown": "^0.11.6",
48
48
  "typescript": "^5.8.3",
@@ -1 +0,0 @@
1
- {"version":3,"file":"composables-DRL29fIt.js","names":[],"sources":["../src/composables/use-pinia.ts"],"sourcesContent":["/**\n * @kimesh/pinia - useKimeshPinia Composable\n */\n\nimport type { Pinia } from \"pinia\";\nimport { useKimeshApp, tryUseKimeshApp } from \"@kimesh/router-runtime\";\n\n/**\n * Get the Pinia instance from Kimesh app context.\n * @throws Error if @kimesh/pinia module is not installed\n */\nexport function useKimeshPinia(): Pinia {\n const app = useKimeshApp();\n\n if (!(\"$pinia\" in app)) {\n throw new Error(\n \"[Kimesh] useKimeshPinia() requires @kimesh/pinia module. \" +\n \"Add the pinia module to your kimesh.config.ts\",\n );\n }\n\n return (app as { $pinia: Pinia }).$pinia;\n}\n\n/**\n * Try to get the Pinia instance without throwing.\n */\nexport function tryUseKimeshPinia(): Pinia | undefined {\n const app = tryUseKimeshApp();\n return app && \"$pinia\" in app ? (app as { $pinia: Pinia }).$pinia : undefined;\n}\n"],"mappings":";;;;;;;AAWA,SAAgB,iBAAwB;CACtC,MAAM,MAAM,cAAc;AAE1B,OAAM,YAAY,KAChB,OAAM,IAAI,MACR;AAKJ,QAAQ,IAA0B;AACnC;;;;AAKD,SAAgB,oBAAuC;CACrD,MAAM,MAAM,iBAAiB;AAC7B,QAAO,OAAO,YAAY,MAAO,IAA0B;AAC5D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-BI7uRRJC.d.ts","names":[],"sources":["../src/composables/use-pinia.ts"],"sourcesContent":[],"mappings":";;;;AA2BA;;;;iBAhBgB,cAAA,CAAA,GAAkB;;;;iBAgBlB,iBAAA,CAAA,GAAqB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/module.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AASA;AAuBiB,UAvBA,iBAAA,CAuByB;;;;EChBU,SAAA,CAAA,EAAA,MAAA;;;;YDIxC;;;;;;;;;UAYK,yBAAA;;WAEN;;;;;AAzBX,cCOoD,QDPnC,2BAWM,kBAAA,CAAA"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/module.ts"],"sourcesContent":["/**\n * @kimesh/pinia - Module Implementation\n *\n * Pinia state management integration for Kimesh.\n */\n\nimport { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport {\n defineKimeshModule,\n addVitePlugin,\n addImportsPreset,\n addImportsDir,\n addRuntimePlugin,\n createResolver,\n} from \"@kimesh/kit\";\nimport type { KimeshPiniaConfig } from \"./types.js\";\n\nconst PINIA_IMPORTS = [\n \"defineStore\",\n \"acceptHMRUpdate\",\n \"storeToRefs\",\n \"mapStores\",\n \"mapState\",\n \"mapGetters\",\n \"mapActions\",\n \"mapWritableState\",\n \"createPinia\",\n \"setActivePinia\",\n \"getActivePinia\",\n] as const;\n\nexport default defineKimeshModule<KimeshPiniaConfig>({\n meta: {\n name: \"@kimesh/pinia\",\n version: \"1.0.0\",\n configKey: \"pinia\",\n },\n\n defaults: {\n autoImports: true,\n storesDir: \"src/stores\",\n storePattern: \"*.ts\",\n devtools: true,\n autoScanStores: true,\n plugins: [],\n },\n\n async setup(options, kimesh) {\n const {\n autoImports = true,\n storesDir = \"src/stores\",\n storePattern = \"*.ts\",\n devtools = true,\n autoScanStores = true,\n } = options;\n\n const resolver = createResolver(import.meta.url);\n\n addRuntimePlugin(resolver.resolve(\"./plugin.js\"), { append: false });\n\n if (autoImports) {\n addImportsPreset({ from: \"pinia\", imports: [...PINIA_IMPORTS] });\n\n if (autoScanStores) {\n const storesPath = join(kimesh.root, storesDir);\n if (existsSync(storesPath)) {\n addImportsDir({ path: storesPath, pattern: storePattern });\n }\n }\n }\n\n addVitePlugin({\n name: \"@kimesh/pinia:optimize\",\n config() {\n return {\n define: {\n __SSR__: \"false\",\n __HYDRATION__: \"false\",\n \"process.server\": \"false\",\n \"import.meta.server\": \"false\",\n },\n optimizeDeps: { include: [\"pinia\"] },\n };\n },\n });\n\n addVitePlugin({\n name: \"@kimesh/pinia:inject-options\",\n transform(code, id) {\n if (id.includes(\"@kimesh/pinia\") && id.includes(\"plugin\")) {\n const optionsCode = `globalThis.__KIMESH_PINIA_OPTIONS__ = { devtools: ${devtools}, plugins: [] };\\n`;\n return { code: optionsCode + code, map: null };\n }\n return null;\n },\n });\n },\n});\n"],"mappings":";;;;;;;AAkBA,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAED,qBAAe,mBAAsC;CACnD,MAAM;EACJ,MAAM;EACN,SAAS;EACT,WAAW;CACZ;CAED,UAAU;EACR,aAAa;EACb,WAAW;EACX,cAAc;EACd,UAAU;EACV,gBAAgB;EAChB,SAAS,CAAE;CACZ;CAED,MAAM,MAAM,SAAS,QAAQ;EAC3B,MAAM,EACJ,cAAc,MACd,YAAY,cACZ,eAAe,QACf,WAAW,MACX,iBAAiB,MAClB,GAAG;EAEJ,MAAM,WAAW,eAAe,OAAO,KAAK,IAAI;AAEhD,mBAAiB,SAAS,QAAQ,cAAc,EAAE,EAAE,QAAQ,MAAO,EAAC;AAEpE,MAAI,aAAa;AACf,oBAAiB;IAAE,MAAM;IAAS,SAAS,CAAC,GAAG,aAAc;GAAE,EAAC;AAEhE,OAAI,gBAAgB;IAClB,MAAM,aAAa,KAAK,OAAO,MAAM,UAAU;AAC/C,QAAI,WAAW,WAAW,CACxB,eAAc;KAAE,MAAM;KAAY,SAAS;IAAc,EAAC;GAE7D;EACF;AAED,gBAAc;GACZ,MAAM;GACN,SAAS;AACP,WAAO;KACL,QAAQ;MACN,SAAS;MACT,eAAe;MACf,kBAAkB;MAClB,sBAAsB;KACvB;KACD,cAAc,EAAE,SAAS,CAAC,OAAQ,EAAE;IACrC;GACF;EACF,EAAC;AAEF,gBAAc;GACZ,MAAM;GACN,UAAU,MAAM,IAAI;AAClB,QAAI,GAAG,SAAS,gBAAgB,IAAI,GAAG,SAAS,SAAS,EAAE;KACzD,MAAM,eAAe,oDAAoD,SAAS;AAClF,YAAO;MAAE,MAAM,cAAc;MAAM,KAAK;KAAM;IAC/C;AACD,WAAO;GACR;EACF,EAAC;CACH;AACF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-CIfIwAj8.js","names":[],"sources":["../src/plugin.ts"],"sourcesContent":["/**\n * @kimesh/pinia - Runtime Plugin\n *\n * Registers Pinia with Vue at application startup.\n */\n\nimport { createPinia, type Pinia, type PiniaPlugin } from \"pinia\";\nimport { defineKimeshRuntimePlugin } from \"@kimesh/router-runtime\";\n\nexport interface PiniaPluginOptions {\n devtools?: boolean;\n plugins?: PiniaPlugin[];\n}\n\ndeclare const globalThis: { __KIMESH_PINIA_OPTIONS__?: PiniaPluginOptions };\n\nfunction getOptions(): PiniaPluginOptions {\n return globalThis.__KIMESH_PINIA_OPTIONS__ ?? { devtools: true, plugins: [] };\n}\n\nexport const piniaPlugin = defineKimeshRuntimePlugin<{ $pinia: Pinia }>({\n name: \"pinia\",\n enforce: \"pre\",\n\n setup(appContext) {\n const options = getOptions();\n const pinia = createPinia();\n\n for (const plugin of options.plugins ?? []) {\n pinia.use(plugin);\n }\n\n appContext.vueApp.use(pinia);\n appContext.vueApp.config.globalProperties.$pinia = pinia;\n\n if (import.meta.env.DEV && options.devtools !== false) {\n (window as { __PINIA__?: Pinia }).__PINIA__ = pinia;\n }\n\n return { provide: { $pinia: pinia } };\n },\n});\n\nexport default piniaPlugin;\n\nexport type { Pinia, PiniaPlugin };\n"],"mappings":";;;;AAgBA,SAAS,aAAiC;AACxC,QAAO,WAAW,4BAA4B;EAAE,UAAU;EAAM,SAAS,CAAE;CAAE;AAC9E;AAED,MAAa,cAAc,0BAA6C;CACtE,MAAM;CACN,SAAS;CAET,MAAM,YAAY;EAChB,MAAM,UAAU,YAAY;EAC5B,MAAM,QAAQ,aAAa;AAE3B,OAAK,MAAM,UAAU,QAAQ,WAAW,CAAE,EACxC,OAAM,IAAI,OAAO;AAGnB,aAAW,OAAO,IAAI,MAAM;AAC5B,aAAW,OAAO,OAAO,iBAAiB,SAAS;AAEnD,MAAI,OAAO,KAAK,IAAI,OAAO,QAAQ,aAAa,MAC9C,CAAC,OAAiC,YAAY;AAGhD,SAAO,EAAE,SAAS,EAAE,QAAQ,MAAO,EAAE;CACtC;AACF,EAAC;AAEF,qBAAe"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-C_cuPpfH.d.ts","names":[],"sources":["../src/plugin.ts"],"sourcesContent":[],"mappings":";;;;UASiB,kBAAA;;YAEL;;cASC"}