@bquery/bquery 1.1.1 → 1.2.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/package.json CHANGED
@@ -1,120 +1,132 @@
1
- {
2
- "name": "@bquery/bquery",
3
- "version": "1.1.1",
4
- "description": "The jQuery for the Modern Web Platform - Zero build, TypeScript-first library with reactivity, components, and motion",
5
- "type": "module",
6
- "main": "./dist/full.umd.js",
7
- "module": "./dist/index.es.mjs",
8
- "types": "./dist/index.d.ts",
9
- "unpkg": "./dist/full.umd.js",
10
- "jsdelivr": "./dist/full.umd.js",
11
- "exports": {
12
- ".": {
13
- "import": "./dist/index.es.mjs",
14
- "require": "./dist/full.umd.js",
15
- "types": "./dist/index.d.ts"
16
- },
17
- "./full": {
18
- "import": "./dist/full.es.mjs",
19
- "require": "./dist/full.umd.js",
20
- "types": "./dist/full.d.ts"
21
- },
22
- "./core": {
23
- "import": "./dist/core.es.mjs",
24
- "types": "./dist/core/index.d.ts"
25
- },
26
- "./reactive": {
27
- "import": "./dist/reactive.es.mjs",
28
- "types": "./dist/reactive/index.d.ts"
29
- },
30
- "./component": {
31
- "import": "./dist/component.es.mjs",
32
- "types": "./dist/component/index.d.ts"
33
- },
34
- "./motion": {
35
- "import": "./dist/motion.es.mjs",
36
- "types": "./dist/motion/index.d.ts"
37
- },
38
- "./security": {
39
- "import": "./dist/security.es.mjs",
40
- "types": "./dist/security/index.d.ts"
41
- },
42
- "./platform": {
43
- "import": "./dist/platform.es.mjs",
44
- "types": "./dist/platform/index.d.ts"
45
- }
46
- },
47
- "files": [
48
- "dist",
49
- "src",
50
- "README.md",
51
- "LICENSE.md"
52
- ],
53
- "sideEffects": false,
54
- "scripts": {
55
- "dev": "vitepress dev docs",
56
- "build:docs": "vitepress build docs",
57
- "preview": "vitepress preview docs",
58
- "playground": "vite dev playground",
59
- "build": "bun run build:lib && bun run build:umd && bun run build:types",
60
- "build:lib": "vite build",
61
- "build:umd": "vite build --config vite.umd.config.ts",
62
- "build:types": "tsc --emitDeclarationOnly --outDir dist",
63
- "test": "bun test",
64
- "test:watch": "bun test --watch",
65
- "lint": "eslint . --fix",
66
- "lint:types": "tsc --noEmit",
67
- "format": "prettier --write .",
68
- "format:check": "prettier --check .",
69
- "docs:api": "typedoc",
70
- "clean": "rimraf dist",
71
- "prepublishOnly": "bun run clean && bun run build && bun test"
72
- },
73
- "keywords": [
74
- "dom",
75
- "manipulation",
76
- "jquery",
77
- "modern",
78
- "typescript",
79
- "signals",
80
- "reactive",
81
- "components",
82
- "web-components",
83
- "animation",
84
- "motion",
85
- "zero-build",
86
- "cdn"
87
- ],
88
- "author": "Jonas Pfalzgraf <support@josunlp.de>",
89
- "license": "MIT",
90
- "repository": {
91
- "type": "git",
92
- "url": "https://github.com/bQuery/bQuery.git"
93
- },
94
- "homepage": "https://bQuery.flausch-code.de",
95
- "bugs": {
96
- "url": "https://github.com/bQuery/bQuery/issues"
97
- },
98
- "publishConfig": {
99
- "access": "public",
100
- "registry": "https://registry.npmjs.org/"
101
- },
102
- "engines": {
103
- "node": ">=18.0.0"
104
- },
105
- "devDependencies": {
106
- "@typescript-eslint/eslint-plugin": "^8.53.1",
107
- "@typescript-eslint/parser": "^8.53.1",
108
- "bun-types": "^1.3.6",
109
- "eslint": "^9.39.2",
110
- "eslint-config-prettier": "^9.1.2",
111
- "globals": "^15.15.0",
112
- "happy-dom": "^20.3.7",
113
- "prettier": "^3.8.1",
114
- "rimraf": "^5.0.10",
115
- "typedoc": "^0.25.13",
116
- "typescript": "^5.9.3",
117
- "vite": "^5.4.21",
118
- "vitepress": "^1.6.4"
119
- }
120
- }
1
+ {
2
+ "name": "@bquery/bquery",
3
+ "version": "1.2.0",
4
+ "description": "The jQuery for the Modern Web Platform - Zero build, TypeScript-first library with reactivity, components, and motion",
5
+ "type": "module",
6
+ "main": "./dist/full.umd.js",
7
+ "module": "./dist/index.es.mjs",
8
+ "types": "./dist/index.d.ts",
9
+ "unpkg": "./dist/full.umd.js",
10
+ "jsdelivr": "./dist/full.umd.js",
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.es.mjs",
14
+ "require": "./dist/full.umd.js",
15
+ "types": "./dist/index.d.ts"
16
+ },
17
+ "./full": {
18
+ "import": "./dist/full.es.mjs",
19
+ "require": "./dist/full.umd.js",
20
+ "types": "./dist/full.d.ts"
21
+ },
22
+ "./core": {
23
+ "import": "./dist/core.es.mjs",
24
+ "types": "./dist/core/index.d.ts"
25
+ },
26
+ "./reactive": {
27
+ "import": "./dist/reactive.es.mjs",
28
+ "types": "./dist/reactive/index.d.ts"
29
+ },
30
+ "./component": {
31
+ "import": "./dist/component.es.mjs",
32
+ "types": "./dist/component/index.d.ts"
33
+ },
34
+ "./motion": {
35
+ "import": "./dist/motion.es.mjs",
36
+ "types": "./dist/motion/index.d.ts"
37
+ },
38
+ "./security": {
39
+ "import": "./dist/security.es.mjs",
40
+ "types": "./dist/security/index.d.ts"
41
+ },
42
+ "./platform": {
43
+ "import": "./dist/platform.es.mjs",
44
+ "types": "./dist/platform/index.d.ts"
45
+ },
46
+ "./router": {
47
+ "import": "./dist/router.es.mjs",
48
+ "types": "./dist/router/index.d.ts"
49
+ },
50
+ "./store": {
51
+ "import": "./dist/store.es.mjs",
52
+ "types": "./dist/store/index.d.ts"
53
+ },
54
+ "./view": {
55
+ "import": "./dist/view.es.mjs",
56
+ "types": "./dist/view/index.d.ts"
57
+ }
58
+ },
59
+ "files": [
60
+ "dist",
61
+ "src",
62
+ "README.md",
63
+ "LICENSE.md"
64
+ ],
65
+ "sideEffects": false,
66
+ "scripts": {
67
+ "dev": "vitepress dev docs",
68
+ "build:docs": "vitepress build docs",
69
+ "preview": "vitepress preview docs",
70
+ "playground": "vite dev playground",
71
+ "build": "bun run build:lib && bun run build:umd && bun run build:types",
72
+ "build:lib": "vite build",
73
+ "build:umd": "vite build --config vite.umd.config.ts",
74
+ "build:types": "tsc --emitDeclarationOnly --outDir dist",
75
+ "test": "bun test",
76
+ "test:watch": "bun test --watch",
77
+ "lint": "eslint . --fix",
78
+ "lint:types": "tsc --noEmit",
79
+ "format": "prettier --write .",
80
+ "format:check": "prettier --check .",
81
+ "docs:api": "typedoc",
82
+ "clean": "rimraf dist",
83
+ "prepublishOnly": "bun run clean && bun run build && bun test"
84
+ },
85
+ "keywords": [
86
+ "dom",
87
+ "manipulation",
88
+ "jquery",
89
+ "modern",
90
+ "typescript",
91
+ "signals",
92
+ "reactive",
93
+ "components",
94
+ "web-components",
95
+ "animation",
96
+ "motion",
97
+ "zero-build",
98
+ "cdn"
99
+ ],
100
+ "author": "Jonas Pfalzgraf <support@josunlp.de>",
101
+ "license": "MIT",
102
+ "repository": {
103
+ "type": "git",
104
+ "url": "https://github.com/bQuery/bQuery.git"
105
+ },
106
+ "homepage": "https://bQuery.flausch-code.de",
107
+ "bugs": {
108
+ "url": "https://github.com/bQuery/bQuery/issues"
109
+ },
110
+ "publishConfig": {
111
+ "access": "public",
112
+ "registry": "https://registry.npmjs.org/"
113
+ },
114
+ "engines": {
115
+ "node": ">=18.0.0"
116
+ },
117
+ "devDependencies": {
118
+ "@typescript-eslint/eslint-plugin": "^8.53.1",
119
+ "@typescript-eslint/parser": "^8.53.1",
120
+ "bun-types": "^1.3.6",
121
+ "eslint": "^9.39.2",
122
+ "eslint-config-prettier": "^9.1.2",
123
+ "globals": "^15.15.0",
124
+ "happy-dom": "^20.3.7",
125
+ "prettier": "^3.8.1",
126
+ "rimraf": "^5.0.10",
127
+ "typedoc": "^0.25.13",
128
+ "typescript": "^5.9.3",
129
+ "vite": "^5.4.21",
130
+ "vitepress": "^1.6.4"
131
+ }
132
+ }
package/src/full.ts CHANGED
@@ -104,3 +104,47 @@ export type {
104
104
  NotificationOptions,
105
105
  StorageAdapter,
106
106
  } from './platform/index';
107
+
108
+ // ============================================================================
109
+ // Router Module: SPA routing, navigation guards, lazy loading
110
+ // ============================================================================
111
+ export {
112
+ back,
113
+ createRouter,
114
+ currentRoute,
115
+ forward,
116
+ interceptLinks,
117
+ isActive,
118
+ isActiveSignal,
119
+ link,
120
+ navigate,
121
+ resolve,
122
+ } from './router/index';
123
+ export type {
124
+ NavigationGuard,
125
+ Route,
126
+ RouteDefinition,
127
+ Router,
128
+ RouterOptions,
129
+ } from './router/index';
130
+
131
+ // ============================================================================
132
+ // Store Module: Signal-based state management
133
+ // ============================================================================
134
+ export {
135
+ createPersistedStore,
136
+ createStore,
137
+ destroyStore,
138
+ getStore,
139
+ listStores,
140
+ mapActions,
141
+ mapState,
142
+ registerPlugin,
143
+ } from './store/index';
144
+ export type { StateFactory, Store, StoreDefinition, StorePlugin } from './store/index';
145
+
146
+ // ============================================================================
147
+ // View Module: Declarative DOM bindings without compiler
148
+ // ============================================================================
149
+ export { createTemplate, mount } from './view/index';
150
+ export type { BindingContext, MountOptions, View } from './view/index';
package/src/index.ts CHANGED
@@ -25,3 +25,12 @@ export * from './security/index';
25
25
 
26
26
  // Platform module: storage, buckets, notifications, cache
27
27
  export * from './platform/index';
28
+
29
+ // Router module: SPA routing, navigation guards
30
+ export * from './router/index';
31
+
32
+ // Store module: state management with signals
33
+ export * from './store/index';
34
+
35
+ // View module: declarative DOM bindings
36
+ export * from './view/index';
@@ -205,6 +205,20 @@ export class Computed<T> {
205
205
  }
206
206
  return this.cachedValue;
207
207
  }
208
+
209
+ /**
210
+ * Reads the current computed value without tracking.
211
+ * Useful when you need the value but don't want to create a dependency.
212
+ *
213
+ * @returns The current cached value (recomputes if dirty)
214
+ */
215
+ peek(): T {
216
+ if (this.dirty) {
217
+ this.dirty = false;
218
+ this.cachedValue = track(this.markDirty, this.compute);
219
+ }
220
+ return this.cachedValue;
221
+ }
208
222
  }
209
223
 
210
224
  /**