@nexim/alpine 1.1.7 → 1.1.8

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/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.1.8](https://github.com/the-nexim/nanolib/compare/@nexim/alpine@1.1.7...@nexim/alpine@1.1.8) (2025-11-22)
7
+
8
+ **Note:** Version bump only for package @nexim/alpine
9
+
6
10
  ## [1.1.7](https://github.com/the-nexim/nanolib/compare/@nexim/alpine@1.1.6...@nexim/alpine@1.1.7) (2025-08-30)
7
11
 
8
12
  **Note:** Version bump only for package @nexim/alpine
package/dist/main.cjs CHANGED
@@ -1,194 +1,4 @@
1
- /* @nexim/alpine v1.1.7 */
2
- "use strict";
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
-
31
- // src/main.ts
32
- var main_exports = {};
33
- __export(main_exports, {
34
- AlpineStore: () => AlpineStore,
35
- AlpineStoreWithBackup: () => AlpineStoreWithBackup,
36
- alpineStoreGenerator: () => alpineStoreGenerator
37
- });
38
- module.exports = __toCommonJS(main_exports);
39
- var import_package_tracer = require("@alwatr/package-tracer");
40
-
41
- // src/store/store-generator.ts
42
- var import_logger = require("@alwatr/logger");
43
- var import_alpinejs = __toESM(require("alpinejs"), 1);
44
- var logger = (0, import_logger.createLogger)("@nexim/alpine");
45
- function alpineStoreGenerator(config) {
46
- logger.logMethodArgs?.("alpineStoreGenerator", { config });
47
- import_alpinejs.default.store(config.name, config.defaultValue);
48
- const store = import_alpinejs.default.store(config.name);
49
- return store;
50
- }
51
-
52
- // src/store/store.ts
53
- var import_logger2 = require("@alwatr/logger");
54
- var AlpineStore = class {
55
- /**
56
- * Provides a Alpine.js pure store implementation with logger.
57
- *
58
- * @param config - Configuration object.
59
- *
60
- * @example
61
- * ```ts
62
- * import {AlpineStore} from '@nexim/alpine';
63
- *
64
- * const {store} = new AlpineStore({
65
- * name: 'myStore',
66
- * defaultValue: {data: 'root'},
67
- * });
68
- * console.log(store.data); // Output: { data: 'root' }
69
- *
70
- * store.data = 'user';
71
- * console.log(store.data); // Output: { data: 'user' }
72
- * ```
73
- */
74
- constructor(config) {
75
- this.logger_ = (0, import_logger2.createLogger)(`${"@nexim/alpine"}:${config.name}`);
76
- this.logger_.logMethodArgs?.("constructor", config);
77
- this.store = alpineStoreGenerator(config);
78
- }
79
- };
80
-
81
- // src/store/store-with-backup.ts
82
- var import_local_storage = require("@alwatr/local-storage");
83
- var import_parse_duration = require("@alwatr/parse-duration");
84
- var schemaVersion = 1;
85
- var AlpineStoreWithBackup = class extends AlpineStore {
86
- /**
87
- * Provides a Alpine.js store implementation with backup and expiration.
88
- *
89
- * @param config__ - Configuration object.
90
- *
91
- * @example
92
- * ```ts
93
- * import {AlpineStoreWithBackup} from '@nexim/alpine';
94
- *
95
- * const storeWithBackup = new AlpineStoreWithBackup({
96
- * name: 'myStoreWithBackup',
97
- * version: 1,
98
- * defaultValue: {data: 'root'},
99
- * expireDuration: '1d',
100
- * });
101
- *
102
- * storeWithBackup.store.data = 'user';
103
- *
104
- * storeWithBackup.save();
105
- * console.log(storeWithBackup.store.data); // Output: { data: 'user' }
106
- *
107
- * storeWithBackup.clear();
108
- * console.log(storeWithBackup.store.data); // Output: { data: 'root' }
109
- * ```
110
- */
111
- constructor(config__) {
112
- super(config__);
113
- this.config__ = config__;
114
- /**
115
- * Keys for storing data and expire time in local storage with version.
116
- */
117
- this.localStorageKey__ = {
118
- data: `[${"@nexim/alpine"}:data:sv${schemaVersion.toString()}]:${this.config__.name}`,
119
- expireTime: `[${"@nexim/alpine"}:expire-time:sv${schemaVersion.toString()}]:${this.config__.name}`
120
- };
121
- if (this.config__.expireDuration != null) {
122
- this.handleDataExpiration__();
123
- }
124
- this.load__();
125
- }
126
- /**
127
- * Saves the current data to local storage. If the data is null, it clears the stored data.
128
- *
129
- * Also updates the expiration time.
130
- */
131
- save() {
132
- this.logger_.logMethodArgs?.("save", { data: this.store.data });
133
- if (this.store.data === null) {
134
- this.clear();
135
- return;
136
- }
137
- import_local_storage.localJsonStorage.setItem(this.localStorageKey__.data, this.store.data, this.config__.version);
138
- this.updateExpireTime__();
139
- }
140
- /**
141
- * Clears the stored data.
142
- */
143
- clear() {
144
- this.logger_.logMethod?.("clear");
145
- import_local_storage.localJsonStorage.removeItem(this.localStorageKey__.data, this.config__.version);
146
- import_local_storage.localJsonStorage.removeItem(this.localStorageKey__.expireTime, this.config__.version);
147
- this.store = this.config__.defaultValue;
148
- }
149
- /**
150
- * Handles the expiration duration by checking if the stored data has expired.
151
- * If expired, it clears the stored data.
152
- */
153
- handleDataExpiration__() {
154
- this.logger_.logMethod?.("handleDataExpiration__");
155
- const expireDuration = import_local_storage.localJsonStorage.getItem(
156
- this.localStorageKey__.expireTime,
157
- { time: -1 },
158
- this.config__.version
159
- ).time;
160
- if (expireDuration !== -1 && expireDuration < Date.now()) {
161
- this.clear();
162
- }
163
- }
164
- /**
165
- * Loads data from local storage and updates the store's data.
166
- *
167
- * When data is not found or invalid in local storage, it uses the default value.
168
- *
169
- * FIXME: remove `NonNullable` from `<T['data']>`, after local storage new version.
170
- */
171
- load__() {
172
- this.logger_.logMethod?.("load__");
173
- const newData = import_local_storage.localJsonStorage.getItem(
174
- this.localStorageKey__.data,
175
- this.config__.defaultValue.data,
176
- this.config__.version
177
- );
178
- this.store.data = newData;
179
- }
180
- /**
181
- * Updates the expiration time in local storage to the current time plus the configured expiration duration.
182
- */
183
- updateExpireTime__() {
184
- if (this.config__.expireDuration == null) return;
185
- this.logger_.logMethod?.("updateExpireTime__");
186
- const newExpireTime = Date.now() + (0, import_parse_duration.parseDuration)(this.config__.expireDuration);
187
- import_local_storage.localJsonStorage.setItem(this.localStorageKey__.expireTime, { time: newExpireTime }, this.config__.version);
188
- this.logger_.logOther?.("updated_expire_time", { newExpireTime });
189
- }
190
- };
191
-
192
- // src/main.ts
193
- __dev_mode__: import_package_tracer.packageTracer.add("@nexim/alpine", "1.1.7");
1
+ /** 📦 @nexim/alpine v1.1.8 */
2
+ __dev_mode__: console.debug("📦 @nexim/alpine v1.1.8");
3
+ "use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from==="object"||typeof from==="function"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:true}):target,mod));var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:true}),mod);var main_exports={};__export(main_exports,{AlpineStore:()=>AlpineStore,AlpineStoreWithBackup:()=>AlpineStoreWithBackup,alpineStoreGenerator:()=>alpineStoreGenerator});module.exports=__toCommonJS(main_exports);var import_package_tracer=require("@alwatr/package-tracer");var import_logger=require("@alwatr/logger");var import_alpinejs=__toESM(require("alpinejs"),1);var logger=(0,import_logger.createLogger)("@nexim/alpine");function alpineStoreGenerator(config){logger.logMethodArgs?.("alpineStoreGenerator",{config});import_alpinejs.default.store(config.name,config.defaultValue);const store=import_alpinejs.default.store(config.name);return store}var import_logger2=require("@alwatr/logger");var AlpineStore=class{constructor(config){this.logger_=(0,import_logger2.createLogger)(`${"@nexim/alpine"}:${config.name}`);this.logger_.logMethodArgs?.("constructor",config);this.store=alpineStoreGenerator(config)}};var import_local_storage=require("@alwatr/local-storage");var import_parse_duration=require("@alwatr/parse-duration");var schemaVersion=1;var AlpineStoreWithBackup=class extends AlpineStore{constructor(config__){super(config__);this.config__=config__;this.localStorageKey__={data:`[${"@nexim/alpine"}:data:sv${schemaVersion.toString()}]:${this.config__.name}`,expireTime:`[${"@nexim/alpine"}:expire-time:sv${schemaVersion.toString()}]:${this.config__.name}`};if(this.config__.expireDuration!=null){this.handleDataExpiration__()}this.load__()}save(){this.logger_.logMethodArgs?.("save",{data:this.store.data});if(this.store.data===null){this.clear();return}import_local_storage.localJsonStorage.setItem(this.localStorageKey__.data,this.store.data,this.config__.version);this.updateExpireTime__()}clear(){this.logger_.logMethod?.("clear");import_local_storage.localJsonStorage.removeItem(this.localStorageKey__.data,this.config__.version);import_local_storage.localJsonStorage.removeItem(this.localStorageKey__.expireTime,this.config__.version);this.store=this.config__.defaultValue}handleDataExpiration__(){this.logger_.logMethod?.("handleDataExpiration__");const expireDuration=import_local_storage.localJsonStorage.getItem(this.localStorageKey__.expireTime,{time:-1},this.config__.version).time;if(expireDuration!==-1&&expireDuration<Date.now()){this.clear()}}load__(){this.logger_.logMethod?.("load__");const newData=import_local_storage.localJsonStorage.getItem(this.localStorageKey__.data,this.config__.defaultValue.data,this.config__.version);this.store.data=newData}updateExpireTime__(){if(this.config__.expireDuration==null)return;this.logger_.logMethod?.("updateExpireTime__");const newExpireTime=Date.now()+(0,import_parse_duration.parseDuration)(this.config__.expireDuration);import_local_storage.localJsonStorage.setItem(this.localStorageKey__.expireTime,{time:newExpireTime},this.config__.version);this.logger_.logOther?.("updated_expire_time",{newExpireTime})}};__dev_mode__:import_package_tracer.packageTracer.add("@nexim/alpine","1.1.8");
194
4
  //# sourceMappingURL=main.cjs.map
package/dist/main.cjs.map CHANGED
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/main.ts", "../src/store/store-generator.ts", "../src/store/store.ts", "../src/store/store-with-backup.ts"],
4
4
  "sourcesContent": ["import { packageTracer } from '@alwatr/package-tracer';\n\n__dev_mode__: packageTracer.add(__package_name__, __package_version__);\n\nexport * from './store/store-generator.js';\nexport * from './store/store.js';\nexport * from './store/store-with-backup.js';\n", "import { createLogger } from '@alwatr/logger';\nimport alpine from 'alpinejs';\n\nconst logger = createLogger(__package_name__);\n\n/**\n * alpineStoreGenerator Options.\n *\n * @typeParam T - The type of the default value.\n */\nexport type AlpineStoreGeneratorOptions<T extends DictionaryReq> = {\n /**\n * The name of the store.\n */\n name: string;\n\n /**\n * The default value of the store.\n */\n defaultValue: T;\n};\n\n/**\n * Generates an Alpine.js store with default value.\n *\n * @typeParam T - The type of the data.\n *\n * @param config - The configuration object for the store.\n * @returns - The initialized store instance.\n *\n * @remarks\n *\n * This function uses Alpine.js to create a reactive store with a default value.\n * The store is identified by a unique name and can be accessed and manipulated\n * throughout the application. Alpine.js stores provide a simple way to manage\n * data in your application, making it easy to keep your UI in sync with your data.\n *\n * @see {@link https://alpinejs.dev/globals/alpine-store}\n *\n * @example\n * ```ts\n * const store = alpineStoreGenerator({\n * name: 'user',\n * defaultValue: {type: 'root'},\n * });\n *\n * console.log(store.type); // Output: root\n *```\n */\nexport function alpineStoreGenerator<T extends DictionaryReq>(config: AlpineStoreGeneratorOptions<T>): T {\n logger.logMethodArgs?.('alpineStoreGenerator', { config });\n\n alpine.store(config.name, config.defaultValue);\n\n // Get store Proxy\n const store = alpine.store(config.name) as T;\n return store;\n}\n", "import { type AlwatrLogger, createLogger } from '@alwatr/logger';\n\nimport { alpineStoreGenerator } from './store-generator.js';\n\n/**\n * AlpineStore Options.\n *\n * @typeParam T - The type of the store value.\n */\nexport type AlpineStoreOptions<T extends DictionaryReq> = {\n /**\n * The name of the store.\n */\n name: string;\n\n /**\n * The default value of the store.\n */\n defaultValue: T;\n};\n\n/**\n * Provides a Alpine.js pure store implementation with logger.\n */\nexport class AlpineStore<T extends DictionaryReq> {\n /**\n * The store's data.\n */\n store: T;\n\n protected logger_: AlwatrLogger;\n\n /**\n * Provides a Alpine.js pure store implementation with logger.\n *\n * @param config - Configuration object.\n *\n * @example\n * ```ts\n * import {AlpineStore} from '@nexim/alpine';\n *\n * const {store} = new AlpineStore({\n * name: 'myStore',\n * defaultValue: {data: 'root'},\n * });\n * console.log(store.data); // Output: { data: 'root' }\n *\n * store.data = 'user';\n * console.log(store.data); // Output: { data: 'user' }\n * ```\n */\n constructor(config: AlpineStoreOptions<T>) {\n this.logger_ = createLogger(`${__package_name__}:${config.name}`);\n this.logger_.logMethodArgs?.('constructor', config);\n\n this.store = alpineStoreGenerator(config);\n }\n}\n", "import { localJsonStorage } from '@alwatr/local-storage';\nimport { type Duration, parseDuration } from '@alwatr/parse-duration';\n\nimport { AlpineStore } from './store.js';\n\n/**\n * Type for the store's data to extends from them.\n */\nexport type AlpineStoreWithBackupType = {\n data: DictionaryReq | null;\n};\n\n/**\n * AlpineStoreWithBackup Options.\n *\n * @typeParam T - The type of the store value.\n */\nexport type AlpineStoreWithBackupOptions<T extends AlpineStoreWithBackupType> = {\n /**\n * The name of the store.\n */\n name: string;\n\n /**\n * The version of the store.\n */\n version: number;\n\n /**\n * The default value of the store.\n */\n defaultValue: T;\n\n /**\n * Optional. The duration after which the store expires.\n */\n expireDuration?: Duration;\n};\n\n/**\n * Version of the schema for storing data in local storage.\n *\n * Change when this schema changes.\n */\nconst schemaVersion = 1;\n\n/**\n * Provides a Alpine.js store implementation with backup and expiration.\n */\nexport class AlpineStoreWithBackup<T extends AlpineStoreWithBackupType> extends AlpineStore<T> {\n /**\n * Keys for storing data and expire time in local storage with version.\n */\n private localStorageKey__ = {\n data: `[${__package_name__}:data:sv${schemaVersion.toString()}]:${this.config__.name}`,\n expireTime: `[${__package_name__}:expire-time:sv${schemaVersion.toString()}]:${this.config__.name}`,\n };\n\n /**\n * Provides a Alpine.js store implementation with backup and expiration.\n *\n * @param config__ - Configuration object.\n *\n * @example\n * ```ts\n * import {AlpineStoreWithBackup} from '@nexim/alpine';\n *\n * const storeWithBackup = new AlpineStoreWithBackup({\n * name: 'myStoreWithBackup',\n * version: 1,\n * defaultValue: {data: 'root'},\n * expireDuration: '1d',\n * });\n *\n * storeWithBackup.store.data = 'user';\n *\n * storeWithBackup.save();\n * console.log(storeWithBackup.store.data); // Output: { data: 'user' }\n *\n * storeWithBackup.clear();\n * console.log(storeWithBackup.store.data); // Output: { data: 'root' }\n * ```\n */\n constructor(private config__: AlpineStoreWithBackupOptions<T>) {\n super(config__);\n\n if (this.config__.expireDuration != null) {\n this.handleDataExpiration__();\n }\n\n this.load__();\n }\n\n /**\n * Saves the current data to local storage. If the data is null, it clears the stored data.\n *\n * Also updates the expiration time.\n */\n save(): void {\n this.logger_.logMethodArgs?.('save', { data: this.store.data });\n\n if (this.store.data === null) {\n this.clear();\n return;\n }\n\n localJsonStorage.setItem(this.localStorageKey__.data, this.store.data, this.config__.version);\n this.updateExpireTime__();\n }\n\n /**\n * Clears the stored data.\n */\n clear(): void {\n this.logger_.logMethod?.('clear');\n\n localJsonStorage.removeItem(this.localStorageKey__.data, this.config__.version);\n localJsonStorage.removeItem(this.localStorageKey__.expireTime, this.config__.version);\n\n this.store = this.config__.defaultValue;\n }\n\n /**\n * Handles the expiration duration by checking if the stored data has expired.\n * If expired, it clears the stored data.\n */\n private handleDataExpiration__(): void {\n this.logger_.logMethod?.('handleDataExpiration__');\n\n // FIXME: use null if not set, after local storage new version.\n const expireDuration = localJsonStorage.getItem<{ time: number }>(\n this.localStorageKey__.expireTime,\n { time: -1 },\n this.config__.version,\n ).time;\n\n if (expireDuration !== -1 && expireDuration < Date.now()) {\n this.clear();\n }\n }\n\n /**\n * Loads data from local storage and updates the store's data.\n *\n * When data is not found or invalid in local storage, it uses the default value.\n *\n * FIXME: remove `NonNullable` from `<T['data']>`, after local storage new version.\n */\n private load__(): void {\n this.logger_.logMethod?.('load__');\n\n const newData = localJsonStorage.getItem<NonNullable<T['data']>>(\n this.localStorageKey__.data,\n this.config__.defaultValue.data as NonNullable<T['data']>,\n this.config__.version,\n ) as T['data'];\n this.store.data = newData;\n }\n\n /**\n * Updates the expiration time in local storage to the current time plus the configured expiration duration.\n */\n private updateExpireTime__(): void {\n if (this.config__.expireDuration == null) return;\n this.logger_.logMethod?.('updateExpireTime__');\n\n const newExpireTime = Date.now() + parseDuration(this.config__.expireDuration);\n localJsonStorage.setItem(this.localStorageKey__.expireTime, { time: newExpireTime }, this.config__.version);\n\n this.logger_.logOther?.('updated_expire_time', { newExpireTime });\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA8B;;;ACA9B,oBAA6B;AAC7B,sBAAmB;AAEnB,IAAM,aAAS,4BAAa,eAAgB;AA8CrC,SAAS,qBAA8C,QAA2C;AACvG,SAAO,gBAAgB,wBAAwB,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AM,KAAK,SAAS,OAAO,EAC5F,KAAK,mBAAmB,CAC1B,CAKA,OAAc,CACZ,KAAK,QAAQ,YAAY,OAAO,EAEhC,sCAAiB,WAAW,KAAK,kBAAkB,KAAM,KAAK,SAAS,OAAO,EAC9E,sCAAiB,WAAW,KAAK,kBAAkB,WAAY,KAAK,SAAS,OAAO,EAEpF,KAAK,MAAQ,KAAK,SAAS,YAC7B,CAMQ,wBAA+B,CACrC,KAAK,QAAQ,YAAY,wBAAwB,EAGjD,MAAM,eAAiB,sCAAiB,QACtC,KAAK,kBAAkB,WACvB,CAAE,KAAM,EAAG,EACX,KAAK,SAAS,OAChB,EAAE,KAEF,GAAI,iBAAmB,IAAM,eAAiB,KAAK,IAAI,EAAG,CACxD,KAAK,MAAM,CACb,CACF,CASQ,QAAe,CACrB,KAAK,QAAQ,YAAY,QAAQ,EAEjC,MAAM,QAAU,sCAAiB,QAC/B,KAAK,kBAAkB,KACvB,KAAK,SAAS,aAAa,KAC3B,KAAK,SAAS,OAChB,EACA,KAAK,MAAM,KAAO,OACpB,CAKQ,oBAA2B,CACjC,GAAI,KAAK,SAAS,gBAAkB,KAAM,OAC1C,KAAK,QAAQ,YAAY,oBAAoB,EAE7C,MAAM,cAAgB,KAAK,IAAI,KAAI,qCAAc,KAAK,SAAS,cAAc,EAC7E,sCAAiB,QAAQ,KAAK,kBAAkB,WAAY,CAAE,KAAM,aAAc,EAAG,KAAK,SAAS,OAAO,EAE1G,KAAK,QAAQ,WAAW,sBAAuB,CAAE,aAAc,CAAC,CAClE,CACF,EHzKA,aAAc,oCAAc,IAAI,gBAAkB,OAAmB",
6
6
  "names": ["alpine", "import_logger"]
7
7
  }
package/dist/main.mjs CHANGED
@@ -1,164 +1,4 @@
1
- /* @nexim/alpine v1.1.7 */
2
-
3
- // src/main.ts
4
- import { packageTracer } from "@alwatr/package-tracer";
5
-
6
- // src/store/store-generator.ts
7
- import { createLogger } from "@alwatr/logger";
8
- import alpine from "alpinejs";
9
- var logger = createLogger("@nexim/alpine");
10
- function alpineStoreGenerator(config) {
11
- logger.logMethodArgs?.("alpineStoreGenerator", { config });
12
- alpine.store(config.name, config.defaultValue);
13
- const store = alpine.store(config.name);
14
- return store;
15
- }
16
-
17
- // src/store/store.ts
18
- import { createLogger as createLogger2 } from "@alwatr/logger";
19
- var AlpineStore = class {
20
- /**
21
- * Provides a Alpine.js pure store implementation with logger.
22
- *
23
- * @param config - Configuration object.
24
- *
25
- * @example
26
- * ```ts
27
- * import {AlpineStore} from '@nexim/alpine';
28
- *
29
- * const {store} = new AlpineStore({
30
- * name: 'myStore',
31
- * defaultValue: {data: 'root'},
32
- * });
33
- * console.log(store.data); // Output: { data: 'root' }
34
- *
35
- * store.data = 'user';
36
- * console.log(store.data); // Output: { data: 'user' }
37
- * ```
38
- */
39
- constructor(config) {
40
- this.logger_ = createLogger2(`${"@nexim/alpine"}:${config.name}`);
41
- this.logger_.logMethodArgs?.("constructor", config);
42
- this.store = alpineStoreGenerator(config);
43
- }
44
- };
45
-
46
- // src/store/store-with-backup.ts
47
- import { localJsonStorage } from "@alwatr/local-storage";
48
- import { parseDuration } from "@alwatr/parse-duration";
49
- var schemaVersion = 1;
50
- var AlpineStoreWithBackup = class extends AlpineStore {
51
- /**
52
- * Provides a Alpine.js store implementation with backup and expiration.
53
- *
54
- * @param config__ - Configuration object.
55
- *
56
- * @example
57
- * ```ts
58
- * import {AlpineStoreWithBackup} from '@nexim/alpine';
59
- *
60
- * const storeWithBackup = new AlpineStoreWithBackup({
61
- * name: 'myStoreWithBackup',
62
- * version: 1,
63
- * defaultValue: {data: 'root'},
64
- * expireDuration: '1d',
65
- * });
66
- *
67
- * storeWithBackup.store.data = 'user';
68
- *
69
- * storeWithBackup.save();
70
- * console.log(storeWithBackup.store.data); // Output: { data: 'user' }
71
- *
72
- * storeWithBackup.clear();
73
- * console.log(storeWithBackup.store.data); // Output: { data: 'root' }
74
- * ```
75
- */
76
- constructor(config__) {
77
- super(config__);
78
- this.config__ = config__;
79
- /**
80
- * Keys for storing data and expire time in local storage with version.
81
- */
82
- this.localStorageKey__ = {
83
- data: `[${"@nexim/alpine"}:data:sv${schemaVersion.toString()}]:${this.config__.name}`,
84
- expireTime: `[${"@nexim/alpine"}:expire-time:sv${schemaVersion.toString()}]:${this.config__.name}`
85
- };
86
- if (this.config__.expireDuration != null) {
87
- this.handleDataExpiration__();
88
- }
89
- this.load__();
90
- }
91
- /**
92
- * Saves the current data to local storage. If the data is null, it clears the stored data.
93
- *
94
- * Also updates the expiration time.
95
- */
96
- save() {
97
- this.logger_.logMethodArgs?.("save", { data: this.store.data });
98
- if (this.store.data === null) {
99
- this.clear();
100
- return;
101
- }
102
- localJsonStorage.setItem(this.localStorageKey__.data, this.store.data, this.config__.version);
103
- this.updateExpireTime__();
104
- }
105
- /**
106
- * Clears the stored data.
107
- */
108
- clear() {
109
- this.logger_.logMethod?.("clear");
110
- localJsonStorage.removeItem(this.localStorageKey__.data, this.config__.version);
111
- localJsonStorage.removeItem(this.localStorageKey__.expireTime, this.config__.version);
112
- this.store = this.config__.defaultValue;
113
- }
114
- /**
115
- * Handles the expiration duration by checking if the stored data has expired.
116
- * If expired, it clears the stored data.
117
- */
118
- handleDataExpiration__() {
119
- this.logger_.logMethod?.("handleDataExpiration__");
120
- const expireDuration = localJsonStorage.getItem(
121
- this.localStorageKey__.expireTime,
122
- { time: -1 },
123
- this.config__.version
124
- ).time;
125
- if (expireDuration !== -1 && expireDuration < Date.now()) {
126
- this.clear();
127
- }
128
- }
129
- /**
130
- * Loads data from local storage and updates the store's data.
131
- *
132
- * When data is not found or invalid in local storage, it uses the default value.
133
- *
134
- * FIXME: remove `NonNullable` from `<T['data']>`, after local storage new version.
135
- */
136
- load__() {
137
- this.logger_.logMethod?.("load__");
138
- const newData = localJsonStorage.getItem(
139
- this.localStorageKey__.data,
140
- this.config__.defaultValue.data,
141
- this.config__.version
142
- );
143
- this.store.data = newData;
144
- }
145
- /**
146
- * Updates the expiration time in local storage to the current time plus the configured expiration duration.
147
- */
148
- updateExpireTime__() {
149
- if (this.config__.expireDuration == null) return;
150
- this.logger_.logMethod?.("updateExpireTime__");
151
- const newExpireTime = Date.now() + parseDuration(this.config__.expireDuration);
152
- localJsonStorage.setItem(this.localStorageKey__.expireTime, { time: newExpireTime }, this.config__.version);
153
- this.logger_.logOther?.("updated_expire_time", { newExpireTime });
154
- }
155
- };
156
-
157
- // src/main.ts
158
- __dev_mode__: packageTracer.add("@nexim/alpine", "1.1.7");
159
- export {
160
- AlpineStore,
161
- AlpineStoreWithBackup,
162
- alpineStoreGenerator
163
- };
1
+ /** 📦 @nexim/alpine v1.1.8 */
2
+ __dev_mode__: console.debug("📦 @nexim/alpine v1.1.8");
3
+ import{packageTracer}from"@alwatr/package-tracer";import{createLogger}from"@alwatr/logger";import alpine from"alpinejs";var logger=createLogger("@nexim/alpine");function alpineStoreGenerator(config){logger.logMethodArgs?.("alpineStoreGenerator",{config});alpine.store(config.name,config.defaultValue);const store=alpine.store(config.name);return store}import{createLogger as createLogger2}from"@alwatr/logger";var AlpineStore=class{constructor(config){this.logger_=createLogger2(`${"@nexim/alpine"}:${config.name}`);this.logger_.logMethodArgs?.("constructor",config);this.store=alpineStoreGenerator(config)}};import{localJsonStorage}from"@alwatr/local-storage";import{parseDuration}from"@alwatr/parse-duration";var schemaVersion=1;var AlpineStoreWithBackup=class extends AlpineStore{constructor(config__){super(config__);this.config__=config__;this.localStorageKey__={data:`[${"@nexim/alpine"}:data:sv${schemaVersion.toString()}]:${this.config__.name}`,expireTime:`[${"@nexim/alpine"}:expire-time:sv${schemaVersion.toString()}]:${this.config__.name}`};if(this.config__.expireDuration!=null){this.handleDataExpiration__()}this.load__()}save(){this.logger_.logMethodArgs?.("save",{data:this.store.data});if(this.store.data===null){this.clear();return}localJsonStorage.setItem(this.localStorageKey__.data,this.store.data,this.config__.version);this.updateExpireTime__()}clear(){this.logger_.logMethod?.("clear");localJsonStorage.removeItem(this.localStorageKey__.data,this.config__.version);localJsonStorage.removeItem(this.localStorageKey__.expireTime,this.config__.version);this.store=this.config__.defaultValue}handleDataExpiration__(){this.logger_.logMethod?.("handleDataExpiration__");const expireDuration=localJsonStorage.getItem(this.localStorageKey__.expireTime,{time:-1},this.config__.version).time;if(expireDuration!==-1&&expireDuration<Date.now()){this.clear()}}load__(){this.logger_.logMethod?.("load__");const newData=localJsonStorage.getItem(this.localStorageKey__.data,this.config__.defaultValue.data,this.config__.version);this.store.data=newData}updateExpireTime__(){if(this.config__.expireDuration==null)return;this.logger_.logMethod?.("updateExpireTime__");const newExpireTime=Date.now()+parseDuration(this.config__.expireDuration);localJsonStorage.setItem(this.localStorageKey__.expireTime,{time:newExpireTime},this.config__.version);this.logger_.logOther?.("updated_expire_time",{newExpireTime})}};__dev_mode__:packageTracer.add("@nexim/alpine","1.1.8");export{AlpineStore,AlpineStoreWithBackup,alpineStoreGenerator};
164
4
  //# sourceMappingURL=main.mjs.map
package/dist/main.mjs.map CHANGED
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/main.ts", "../src/store/store-generator.ts", "../src/store/store.ts", "../src/store/store-with-backup.ts"],
4
4
  "sourcesContent": ["import { packageTracer } from '@alwatr/package-tracer';\n\n__dev_mode__: packageTracer.add(__package_name__, __package_version__);\n\nexport * from './store/store-generator.js';\nexport * from './store/store.js';\nexport * from './store/store-with-backup.js';\n", "import { createLogger } from '@alwatr/logger';\nimport alpine from 'alpinejs';\n\nconst logger = createLogger(__package_name__);\n\n/**\n * alpineStoreGenerator Options.\n *\n * @typeParam T - The type of the default value.\n */\nexport type AlpineStoreGeneratorOptions<T extends DictionaryReq> = {\n /**\n * The name of the store.\n */\n name: string;\n\n /**\n * The default value of the store.\n */\n defaultValue: T;\n};\n\n/**\n * Generates an Alpine.js store with default value.\n *\n * @typeParam T - The type of the data.\n *\n * @param config - The configuration object for the store.\n * @returns - The initialized store instance.\n *\n * @remarks\n *\n * This function uses Alpine.js to create a reactive store with a default value.\n * The store is identified by a unique name and can be accessed and manipulated\n * throughout the application. Alpine.js stores provide a simple way to manage\n * data in your application, making it easy to keep your UI in sync with your data.\n *\n * @see {@link https://alpinejs.dev/globals/alpine-store}\n *\n * @example\n * ```ts\n * const store = alpineStoreGenerator({\n * name: 'user',\n * defaultValue: {type: 'root'},\n * });\n *\n * console.log(store.type); // Output: root\n *```\n */\nexport function alpineStoreGenerator<T extends DictionaryReq>(config: AlpineStoreGeneratorOptions<T>): T {\n logger.logMethodArgs?.('alpineStoreGenerator', { config });\n\n alpine.store(config.name, config.defaultValue);\n\n // Get store Proxy\n const store = alpine.store(config.name) as T;\n return store;\n}\n", "import { type AlwatrLogger, createLogger } from '@alwatr/logger';\n\nimport { alpineStoreGenerator } from './store-generator.js';\n\n/**\n * AlpineStore Options.\n *\n * @typeParam T - The type of the store value.\n */\nexport type AlpineStoreOptions<T extends DictionaryReq> = {\n /**\n * The name of the store.\n */\n name: string;\n\n /**\n * The default value of the store.\n */\n defaultValue: T;\n};\n\n/**\n * Provides a Alpine.js pure store implementation with logger.\n */\nexport class AlpineStore<T extends DictionaryReq> {\n /**\n * The store's data.\n */\n store: T;\n\n protected logger_: AlwatrLogger;\n\n /**\n * Provides a Alpine.js pure store implementation with logger.\n *\n * @param config - Configuration object.\n *\n * @example\n * ```ts\n * import {AlpineStore} from '@nexim/alpine';\n *\n * const {store} = new AlpineStore({\n * name: 'myStore',\n * defaultValue: {data: 'root'},\n * });\n * console.log(store.data); // Output: { data: 'root' }\n *\n * store.data = 'user';\n * console.log(store.data); // Output: { data: 'user' }\n * ```\n */\n constructor(config: AlpineStoreOptions<T>) {\n this.logger_ = createLogger(`${__package_name__}:${config.name}`);\n this.logger_.logMethodArgs?.('constructor', config);\n\n this.store = alpineStoreGenerator(config);\n }\n}\n", "import { localJsonStorage } from '@alwatr/local-storage';\nimport { type Duration, parseDuration } from '@alwatr/parse-duration';\n\nimport { AlpineStore } from './store.js';\n\n/**\n * Type for the store's data to extends from them.\n */\nexport type AlpineStoreWithBackupType = {\n data: DictionaryReq | null;\n};\n\n/**\n * AlpineStoreWithBackup Options.\n *\n * @typeParam T - The type of the store value.\n */\nexport type AlpineStoreWithBackupOptions<T extends AlpineStoreWithBackupType> = {\n /**\n * The name of the store.\n */\n name: string;\n\n /**\n * The version of the store.\n */\n version: number;\n\n /**\n * The default value of the store.\n */\n defaultValue: T;\n\n /**\n * Optional. The duration after which the store expires.\n */\n expireDuration?: Duration;\n};\n\n/**\n * Version of the schema for storing data in local storage.\n *\n * Change when this schema changes.\n */\nconst schemaVersion = 1;\n\n/**\n * Provides a Alpine.js store implementation with backup and expiration.\n */\nexport class AlpineStoreWithBackup<T extends AlpineStoreWithBackupType> extends AlpineStore<T> {\n /**\n * Keys for storing data and expire time in local storage with version.\n */\n private localStorageKey__ = {\n data: `[${__package_name__}:data:sv${schemaVersion.toString()}]:${this.config__.name}`,\n expireTime: `[${__package_name__}:expire-time:sv${schemaVersion.toString()}]:${this.config__.name}`,\n };\n\n /**\n * Provides a Alpine.js store implementation with backup and expiration.\n *\n * @param config__ - Configuration object.\n *\n * @example\n * ```ts\n * import {AlpineStoreWithBackup} from '@nexim/alpine';\n *\n * const storeWithBackup = new AlpineStoreWithBackup({\n * name: 'myStoreWithBackup',\n * version: 1,\n * defaultValue: {data: 'root'},\n * expireDuration: '1d',\n * });\n *\n * storeWithBackup.store.data = 'user';\n *\n * storeWithBackup.save();\n * console.log(storeWithBackup.store.data); // Output: { data: 'user' }\n *\n * storeWithBackup.clear();\n * console.log(storeWithBackup.store.data); // Output: { data: 'root' }\n * ```\n */\n constructor(private config__: AlpineStoreWithBackupOptions<T>) {\n super(config__);\n\n if (this.config__.expireDuration != null) {\n this.handleDataExpiration__();\n }\n\n this.load__();\n }\n\n /**\n * Saves the current data to local storage. If the data is null, it clears the stored data.\n *\n * Also updates the expiration time.\n */\n save(): void {\n this.logger_.logMethodArgs?.('save', { data: this.store.data });\n\n if (this.store.data === null) {\n this.clear();\n return;\n }\n\n localJsonStorage.setItem(this.localStorageKey__.data, this.store.data, this.config__.version);\n this.updateExpireTime__();\n }\n\n /**\n * Clears the stored data.\n */\n clear(): void {\n this.logger_.logMethod?.('clear');\n\n localJsonStorage.removeItem(this.localStorageKey__.data, this.config__.version);\n localJsonStorage.removeItem(this.localStorageKey__.expireTime, this.config__.version);\n\n this.store = this.config__.defaultValue;\n }\n\n /**\n * Handles the expiration duration by checking if the stored data has expired.\n * If expired, it clears the stored data.\n */\n private handleDataExpiration__(): void {\n this.logger_.logMethod?.('handleDataExpiration__');\n\n // FIXME: use null if not set, after local storage new version.\n const expireDuration = localJsonStorage.getItem<{ time: number }>(\n this.localStorageKey__.expireTime,\n { time: -1 },\n this.config__.version,\n ).time;\n\n if (expireDuration !== -1 && expireDuration < Date.now()) {\n this.clear();\n }\n }\n\n /**\n * Loads data from local storage and updates the store's data.\n *\n * When data is not found or invalid in local storage, it uses the default value.\n *\n * FIXME: remove `NonNullable` from `<T['data']>`, after local storage new version.\n */\n private load__(): void {\n this.logger_.logMethod?.('load__');\n\n const newData = localJsonStorage.getItem<NonNullable<T['data']>>(\n this.localStorageKey__.data,\n this.config__.defaultValue.data as NonNullable<T['data']>,\n this.config__.version,\n ) as T['data'];\n this.store.data = newData;\n }\n\n /**\n * Updates the expiration time in local storage to the current time plus the configured expiration duration.\n */\n private updateExpireTime__(): void {\n if (this.config__.expireDuration == null) return;\n this.logger_.logMethod?.('updateExpireTime__');\n\n const newExpireTime = Date.now() + parseDuration(this.config__.expireDuration);\n localJsonStorage.setItem(this.localStorageKey__.expireTime, { time: newExpireTime }, this.config__.version);\n\n this.logger_.logOther?.('updated_expire_time', { newExpireTime });\n }\n}\n"],
5
- "mappings": ";;;AAAA,SAAS,qBAAqB;;;ACA9B,SAAS,oBAAoB;AAC7B,OAAO,YAAY;AAEnB,IAAM,SAAS,aAAa,eAAgB;AA8CrC,SAAS,qBAA8C,QAA2C;AACvG,SAAO,gBAAgB,wBAAwB,EAAE,OAAO,CAAC;AAEzD,SAAO,MAAM,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AO,EAC5F,KAAK,mBAAmB,CAC1B,CAKA,OAAc,CACZ,KAAK,QAAQ,YAAY,OAAO,EAEhC,iBAAiB,WAAW,KAAK,kBAAkB,KAAM,KAAK,SAAS,OAAO,EAC9E,iBAAiB,WAAW,KAAK,kBAAkB,WAAY,KAAK,SAAS,OAAO,EAEpF,KAAK,MAAQ,KAAK,SAAS,YAC7B,CAMQ,wBAA+B,CACrC,KAAK,QAAQ,YAAY,wBAAwB,EAGjD,MAAM,eAAiB,iBAAiB,QACtC,KAAK,kBAAkB,WACvB,CAAE,KAAM,EAAG,EACX,KAAK,SAAS,OAChB,EAAE,KAEF,GAAI,iBAAmB,IAAM,eAAiB,KAAK,IAAI,EAAG,CACxD,KAAK,MAAM,CACb,CACF,CASQ,QAAe,CACrB,KAAK,QAAQ,YAAY,QAAQ,EAEjC,MAAM,QAAU,iBAAiB,QAC/B,KAAK,kBAAkB,KACvB,KAAK,SAAS,aAAa,KAC3B,KAAK,SAAS,OAChB,EACA,KAAK,MAAM,KAAO,OACpB,CAKQ,oBAA2B,CACjC,GAAI,KAAK,SAAS,gBAAkB,KAAM,OAC1C,KAAK,QAAQ,YAAY,oBAAoB,EAE7C,MAAM,cAAgB,KAAK,IAAI,EAAI,cAAc,KAAK,SAAS,cAAc,EAC7E,iBAAiB,QAAQ,KAAK,kBAAkB,WAAY,CAAE,KAAM,aAAc,EAAG,KAAK,SAAS,OAAO,EAE1G,KAAK,QAAQ,WAAW,sBAAuB,CAAE,aAAc,CAAC,CAClE,CACF,EHzKA,aAAc,cAAc,IAAI,gBAAkB,OAAmB",
6
6
  "names": ["createLogger", "createLogger"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexim/alpine",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "Utility functions to enhance Alpine.js usage with backup support.",
5
5
  "keywords": [
6
6
  "alpinejs",
@@ -46,22 +46,22 @@
46
46
  "watch": "wireit"
47
47
  },
48
48
  "dependencies": {
49
- "@alwatr/local-storage": "^5.5.6",
50
- "@alwatr/logger": "^5.5.6",
51
- "@alwatr/package-tracer": "^5.5.6",
52
- "@alwatr/parse-duration": "^5.5.7",
53
- "alpinejs": "^3.14.9"
49
+ "@alwatr/local-storage": "^5.5.10",
50
+ "@alwatr/logger": "^5.6.2",
51
+ "@alwatr/package-tracer": "^5.5.23",
52
+ "@alwatr/parse-duration": "^5.5.25",
53
+ "alpinejs": "^3.15.2"
54
54
  },
55
55
  "devDependencies": {
56
- "@alwatr/nano-build": "^6.0.1",
56
+ "@alwatr/nano-build": "^6.3.9",
57
57
  "@alwatr/type-helper": "^5.4.4",
58
58
  "@nexim/typescript-config": "^2.0.1",
59
59
  "@types/alpinejs": "^3.13.11",
60
60
  "ava": "^6.4.1",
61
- "typedoc": "^0.28.11",
62
- "typedoc-plugin-markdown": "^4.8.1",
61
+ "typedoc": "^0.28.14",
62
+ "typedoc-plugin-markdown": "^4.9.0",
63
63
  "typedoc-plugin-no-inherit": "^1.6.1",
64
- "typescript": "^5.9.2",
64
+ "typescript": "^5.9.3",
65
65
  "wireit": "^0.14.12"
66
66
  },
67
67
  "publishConfig": {
@@ -114,5 +114,5 @@
114
114
  "command": "typedoc"
115
115
  }
116
116
  },
117
- "gitHead": "e9784c58e523a33fc5dc6959559ba60cbdd55ab1"
117
+ "gitHead": "aa1bbda5f949163da8a2e11e658afe02aad75458"
118
118
  }