sibujs 4.4.0 → 4.6.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/README.md +11 -0
- package/dist/browser.cjs +339 -130
- package/dist/browser.d.cts +61 -16
- package/dist/browser.d.ts +61 -16
- package/dist/browser.js +8 -6
- package/dist/build.cjs +273 -82
- package/dist/build.js +15 -16
- package/dist/cdn.dev.global.js +12 -12
- package/dist/cdn.full.dev.global.js +11 -11
- package/dist/cdn.full.global.js +10 -10
- package/dist/cdn.global.js +12 -12
- package/dist/{chunk-IXKSNWV5.js → chunk-2INLLLMZ.js} +1 -1
- package/dist/chunk-3ISI6ACU.js +44 -0
- package/dist/{chunk-VCTAEPSB.js → chunk-47M47FOM.js} +11 -3
- package/dist/chunk-5HZXGZ6T.js +24 -0
- package/dist/{chunk-KKLW7YWL.js → chunk-5MT6SJ3P.js} +275 -144
- package/dist/{chunk-3BTTCZ5J.js → chunk-5Q4R7HCL.js} +42 -4
- package/dist/{chunk-ADM46X22.js → chunk-7GQCWFOE.js} +157 -61
- package/dist/{chunk-4Z3SPQ67.js → chunk-7NCARGJW.js} +16 -8
- package/dist/{chunk-5DXA2J44.js → chunk-7XHATCIH.js} +5 -2
- package/dist/{chunk-LQFGQNMV.js → chunk-AIF3Z2T7.js} +302 -39
- package/dist/{chunk-UCALUKB5.js → chunk-BAAG6ZTI.js} +98 -29
- package/dist/{chunk-NVNJH22U.js → chunk-D33YTSX5.js} +2 -2
- package/dist/{chunk-M2F7TZHH.js → chunk-DKGBBKOF.js} +136 -80
- package/dist/{chunk-NIOYEGBQ.js → chunk-HURREPU2.js} +27 -13
- package/dist/{chunk-HFCOH2GN.js → chunk-HYXDKS4N.js} +153 -110
- package/dist/chunk-J6FW5TV6.js +233 -0
- package/dist/{chunk-36S2YPP4.js → chunk-JSXPZCET.js} +1 -1
- package/dist/chunk-NYNYSPK7.js +318 -0
- package/dist/{chunk-HQSEH5F6.js → chunk-ORMZXBKQ.js} +108 -45
- package/dist/{chunk-LYVUX7NT.js → chunk-OXUY2A6L.js} +287 -130
- package/dist/{chunk-6GSIXTWX.js → chunk-PK6FK2G2.js} +187 -66
- package/dist/{chunk-W2EQ7X2L.js → chunk-QE4TTDU3.js} +47 -9
- package/dist/{chunk-XLO7SLIX.js → chunk-SXXVZMKZ.js} +262 -70
- package/dist/{chunk-R25EFXXC.js → chunk-TUCPL2HB.js} +3 -3
- package/dist/{chunk-RR7M3FHM.js → chunk-UZQ6ALFS.js} +3 -3
- package/dist/{chunk-PNIRUQ4C.js → chunk-VVWPJ543.js} +6 -8
- package/dist/{chunk-7GIHSAWB.js → chunk-XC4MEKGA.js} +3 -3
- package/dist/{chunk-SKPTERHP.js → chunk-XRRZKZYX.js} +55 -31
- package/dist/{contracts-DBdg9J_a.d.cts → contracts-DRIuclVT.d.cts} +10 -2
- package/dist/{contracts-DBdg9J_a.d.ts → contracts-DRIuclVT.d.ts} +10 -2
- package/dist/{customElement-CNZxEB9G.d.ts → customElement-MmInOW1U.d.cts} +59 -10
- package/dist/{customElement-CNZxEB9G.d.cts → customElement-MmInOW1U.d.ts} +59 -10
- package/dist/data.cjs +293 -125
- package/dist/data.d.cts +47 -9
- package/dist/data.d.ts +47 -9
- package/dist/data.js +12 -9
- package/dist/devtools.cjs +121 -58
- package/dist/devtools.js +7 -8
- package/dist/dispose-GEIG2KOF.js +28 -0
- package/dist/ecosystem.cjs +391 -112
- package/dist/ecosystem.d.cts +31 -7
- package/dist/ecosystem.d.ts +31 -7
- package/dist/ecosystem.js +12 -12
- package/dist/extras.cjs +2250 -879
- package/dist/extras.d.cts +10 -9
- package/dist/extras.d.ts +10 -9
- package/dist/extras.js +39 -28
- package/dist/index.cjs +273 -82
- package/dist/index.d.cts +44 -154
- package/dist/index.d.ts +44 -154
- package/dist/index.js +24 -27
- package/dist/motion.cjs +137 -42
- package/dist/motion.js +5 -5
- package/dist/patterns.cjs +397 -48
- package/dist/patterns.d.cts +32 -9
- package/dist/patterns.d.ts +32 -9
- package/dist/patterns.js +8 -8
- package/dist/performance.cjs +338 -217
- package/dist/performance.d.cts +2 -2
- package/dist/performance.d.ts +2 -2
- package/dist/performance.js +8 -9
- package/dist/plugin-DVgSnTfK.d.cts +112 -0
- package/dist/plugin-DVgSnTfK.d.ts +112 -0
- package/dist/plugins.cjs +587 -203
- package/dist/plugins.d.cts +3 -3
- package/dist/plugins.d.ts +3 -3
- package/dist/plugins.js +35 -23
- package/dist/signal-EotCj4hS.d.cts +110 -0
- package/dist/signal-EotCj4hS.d.ts +110 -0
- package/dist/{ssr-BiPRdZ6n.d.cts → ssr-Bli9XRW5.d.cts} +5 -0
- package/dist/{ssr-BiPRdZ6n.d.ts → ssr-Bli9XRW5.d.ts} +5 -0
- package/dist/{ssr-Y7XOEPEN.js → ssr-XOTUASDO.js} +4 -5
- package/dist/ssr.cjs +214 -73
- package/dist/ssr.d.cts +9 -3
- package/dist/ssr.d.ts +9 -3
- package/dist/ssr.js +11 -12
- package/dist/{startup-BMpaiMhP.d.ts → startup-BLfSeL15.d.cts} +73 -22
- package/dist/{startup-BMpaiMhP.d.cts → startup-BLfSeL15.d.ts} +73 -22
- package/dist/tagFactory-DFstCLQV.d.cts +117 -0
- package/dist/tagFactory-DkaNVUNV.d.ts +117 -0
- package/dist/testing.cjs +2481 -2153
- package/dist/testing.d.cts +56 -5
- package/dist/testing.d.ts +56 -5
- package/dist/testing.js +580 -307
- package/dist/ui.cjs +798 -328
- package/dist/ui.d.cts +40 -7
- package/dist/ui.d.ts +40 -7
- package/dist/ui.js +151 -56
- package/dist/widgets.cjs +319 -285
- package/dist/widgets.js +9 -10
- package/package.json +2 -2
- package/dist/chunk-2WLZ6757.js +0 -149
- package/dist/chunk-7NBDXVHS.js +0 -60
- package/dist/chunk-CCSJMTRN.js +0 -15
- package/dist/chunk-QKRPLZ2V.js +0 -108
- package/dist/chunk-WWV3SJ3L.js +0 -131
- package/dist/dispose-46BOMMQJ.js +0 -19
- package/dist/plugin-D30wlGW5.d.cts +0 -71
- package/dist/plugin-D30wlGW5.d.ts +0 -71
- package/dist/tagFactory-Bzupt4Pj.d.cts +0 -55
- package/dist/tagFactory-Bzupt4Pj.d.ts +0 -55
|
@@ -26,32 +26,45 @@ declare function createModuleRegistry(): {
|
|
|
26
26
|
* Returns an object with only the requested exports.
|
|
27
27
|
*/
|
|
28
28
|
declare function createBundle<T extends object>(modules: Record<string, () => unknown>): T;
|
|
29
|
+
/** Handle returned by {@link lazyModule}. */
|
|
30
|
+
interface LazyModule<T> {
|
|
31
|
+
/** Whether a load has completed successfully. Read-only. */
|
|
32
|
+
readonly loaded: boolean;
|
|
33
|
+
/** Load the module (once) and resolve to it. Concurrent calls share one load. */
|
|
34
|
+
get(): Promise<T>;
|
|
35
|
+
}
|
|
29
36
|
/**
|
|
30
37
|
* Lazy module loader that only imports a module when first accessed.
|
|
31
38
|
* Uses ES module dynamic import under the hood.
|
|
32
39
|
* Caches the result after the first successful load.
|
|
40
|
+
*
|
|
41
|
+
* Concurrent `get()` calls made before the first load settles share that one
|
|
42
|
+
* load. A failed load is not cached: the next `get()` retries.
|
|
33
43
|
*/
|
|
34
|
-
declare function lazyModule<T>(loader: () => Promise<T>):
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
declare function lazyModule<T>(loader: () => Promise<T>): LazyModule<T>;
|
|
45
|
+
/** One `exports` entry: a module entry point, or a prebuilt CDN script. */
|
|
46
|
+
type PackageExportTarget = {
|
|
47
|
+
types: string;
|
|
48
|
+
import: string;
|
|
49
|
+
require: string;
|
|
50
|
+
} | {
|
|
51
|
+
default: string;
|
|
37
52
|
};
|
|
38
53
|
/**
|
|
39
54
|
* Package metadata for distribution tooling.
|
|
40
|
-
* Provides entry point information and
|
|
55
|
+
* Provides entry point information and generates the Node.js subpath exports
|
|
56
|
+
* map that the published package actually uses.
|
|
41
57
|
*/
|
|
42
58
|
declare const packageInfo: {
|
|
43
59
|
name: string;
|
|
44
60
|
version: string;
|
|
45
61
|
entryPoints: Record<string, string>;
|
|
46
62
|
/**
|
|
47
|
-
* Generate
|
|
48
|
-
*
|
|
63
|
+
* Generate the package.json `exports` map. Module entries resolve to the
|
|
64
|
+
* `.js` (ESM), `.cjs` and `.d.ts` files tsup emits into `dist/`; CDN entries
|
|
65
|
+
* resolve to their prebuilt global script.
|
|
49
66
|
*/
|
|
50
|
-
generateExportsMap(): Record<string,
|
|
51
|
-
import: string;
|
|
52
|
-
require: string;
|
|
53
|
-
types: string;
|
|
54
|
-
}>;
|
|
67
|
+
generateExportsMap(): Record<string, PackageExportTarget>;
|
|
55
68
|
};
|
|
56
69
|
|
|
57
70
|
/**
|
|
@@ -127,16 +140,14 @@ declare const env: {
|
|
|
127
140
|
isTest: boolean;
|
|
128
141
|
};
|
|
129
142
|
|
|
130
|
-
/**
|
|
131
|
-
* Versioning and migration utilities for SibuJS applications.
|
|
132
|
-
* Provides semantic version management, migration tooling, and compatibility checks.
|
|
133
|
-
*/
|
|
134
143
|
/** Semantic version representation */
|
|
135
144
|
interface SemVer {
|
|
136
145
|
major: number;
|
|
137
146
|
minor: number;
|
|
138
147
|
patch: number;
|
|
139
148
|
prerelease?: string;
|
|
149
|
+
/** Build metadata (after `+`). Ignored when comparing versions. */
|
|
150
|
+
build?: string;
|
|
140
151
|
}
|
|
141
152
|
/** Migration definition */
|
|
142
153
|
interface Migration {
|
|
@@ -146,11 +157,19 @@ interface Migration {
|
|
|
146
157
|
down?: () => void | Promise<void>;
|
|
147
158
|
}
|
|
148
159
|
/**
|
|
149
|
-
* Framework version
|
|
160
|
+
* Framework version: the published package version, stamped at build time.
|
|
161
|
+
* Only raw, unbundled source reports "dev". (It was hard-coded to "1.0.0", so
|
|
162
|
+
* compatibility checks compared against a version the package never had.)
|
|
150
163
|
*/
|
|
151
|
-
declare const VERSION
|
|
164
|
+
declare const VERSION: string;
|
|
152
165
|
/**
|
|
153
166
|
* Parse a semantic version string into components.
|
|
167
|
+
*
|
|
168
|
+
* Accepts full SemVer 2.0.0 (`1.2.3`, `1.2.3-beta.1`, `1.2.3+build.5`), an
|
|
169
|
+
* optional leading `v`, surrounding whitespace, and the abbreviated `1` and
|
|
170
|
+
* `1.2` forms. Anything else — trailing characters, extra components, empty or
|
|
171
|
+
* illegal identifiers, numeric leading zeros — throws. (`parseInt` used to accept
|
|
172
|
+
* numeric prefixes such as `1.2.3garbage` and ignore extra components.)
|
|
154
173
|
*/
|
|
155
174
|
declare function parseSemVer(version: string): SemVer;
|
|
156
175
|
/**
|
|
@@ -162,22 +181,46 @@ declare function compareSemVer(a: string | SemVer, b: string | SemVer): -1 | 0 |
|
|
|
162
181
|
* Check if a version satisfies a semver range (supports ^, ~, >=, <=, =).
|
|
163
182
|
*/
|
|
164
183
|
declare function satisfies(version: string, range: string): boolean;
|
|
184
|
+
/**
|
|
185
|
+
* A migration step succeeded but recording its version in storage failed.
|
|
186
|
+
*
|
|
187
|
+
* Reported separately from a failing `up()` / `down()` because the migration's
|
|
188
|
+
* own work DID happen: storage is now behind reality and needs attention, but
|
|
189
|
+
* the step itself must not be retried as if it had failed.
|
|
190
|
+
*/
|
|
191
|
+
declare class MigrationStorageError extends Error {
|
|
192
|
+
/** The migration whose checkpoint could not be written. */
|
|
193
|
+
readonly version: string;
|
|
194
|
+
constructor(version: string, cause: unknown);
|
|
195
|
+
}
|
|
165
196
|
/**
|
|
166
197
|
* Create a migration runner for managing schema/state version upgrades.
|
|
198
|
+
*
|
|
199
|
+
* `migrate()` and `rollback()` are serialized across ALL runners in this realm
|
|
200
|
+
* that use the same storage object and storage key; runners with a different
|
|
201
|
+
* key (or storage) run independently. Coordination does not extend across
|
|
202
|
+
* tabs or workers.
|
|
167
203
|
*/
|
|
168
204
|
declare function createMigrationRunner(config: {
|
|
169
205
|
/** Current version of the app/data */
|
|
170
206
|
currentVersion: string;
|
|
171
207
|
/** Storage key for persisting applied migration version */
|
|
172
208
|
storageKey?: string;
|
|
209
|
+
/** Storage holding the applied version (default: `localStorage`) */
|
|
210
|
+
storage?: Storage;
|
|
173
211
|
/** Available migrations, sorted by version */
|
|
174
212
|
migrations: Migration[];
|
|
175
213
|
}): {
|
|
176
214
|
/** Get the last applied migration version from storage */
|
|
177
|
-
getAppliedVersion()
|
|
215
|
+
getAppliedVersion: () => string | null;
|
|
178
216
|
/** Get pending migrations that haven't been applied */
|
|
179
|
-
getPending()
|
|
180
|
-
/**
|
|
217
|
+
getPending: () => Migration[];
|
|
218
|
+
/**
|
|
219
|
+
* Run all pending migrations in order. Concurrent calls (and calls racing
|
|
220
|
+
* `rollback()`) run one after another, each recomputing what is pending —
|
|
221
|
+
* on this runner and on every other runner in this realm sharing its
|
|
222
|
+
* storage and storage key.
|
|
223
|
+
*/
|
|
181
224
|
migrate(): Promise<{
|
|
182
225
|
applied: string[];
|
|
183
226
|
errors: Array<{
|
|
@@ -185,7 +228,15 @@ declare function createMigrationRunner(config: {
|
|
|
185
228
|
error: Error;
|
|
186
229
|
}>;
|
|
187
230
|
}>;
|
|
188
|
-
/**
|
|
231
|
+
/**
|
|
232
|
+
* Rollback to a specific version.
|
|
233
|
+
*
|
|
234
|
+
* The applied version is checkpointed after EVERY successful `down()`, so a
|
|
235
|
+
* rollback that fails part-way leaves storage describing what is actually
|
|
236
|
+
* still applied, and a retry does not repeat completed `down()` steps.
|
|
237
|
+
* Throws the failing `down()`'s error, a missing-`down()` error, or a
|
|
238
|
+
* {@link MigrationStorageError} if a checkpoint cannot be written.
|
|
239
|
+
*/
|
|
189
240
|
rollback(targetVersion: string): Promise<{
|
|
190
241
|
rolledBack: string[];
|
|
191
242
|
}>;
|
|
@@ -288,4 +339,4 @@ declare function createBootSequence(): {
|
|
|
288
339
|
}>;
|
|
289
340
|
};
|
|
290
341
|
|
|
291
|
-
export { type Migration as M, type SemVer as S, VERSION as V,
|
|
342
|
+
export { type LazyModule as L, type Migration as M, type PackageExportTarget as P, type SemVer as S, VERSION as V, MigrationStorageError as a, bundlerMetadata as b, checkCompatibility as c, compareSemVer as d, createBootSequence as e, createBundle as f, createMigrationRunner as g, createModuleRegistry as h, createSSRCache as i, createTestHarness as j, deferNonCritical as k, env as l, healthCheck as m, lazyModule as n, parseSemVer as o, packageInfo as p, preloadCritical as q, prerenderRoutes as r, satisfies as s };
|
|
@@ -26,32 +26,45 @@ declare function createModuleRegistry(): {
|
|
|
26
26
|
* Returns an object with only the requested exports.
|
|
27
27
|
*/
|
|
28
28
|
declare function createBundle<T extends object>(modules: Record<string, () => unknown>): T;
|
|
29
|
+
/** Handle returned by {@link lazyModule}. */
|
|
30
|
+
interface LazyModule<T> {
|
|
31
|
+
/** Whether a load has completed successfully. Read-only. */
|
|
32
|
+
readonly loaded: boolean;
|
|
33
|
+
/** Load the module (once) and resolve to it. Concurrent calls share one load. */
|
|
34
|
+
get(): Promise<T>;
|
|
35
|
+
}
|
|
29
36
|
/**
|
|
30
37
|
* Lazy module loader that only imports a module when first accessed.
|
|
31
38
|
* Uses ES module dynamic import under the hood.
|
|
32
39
|
* Caches the result after the first successful load.
|
|
40
|
+
*
|
|
41
|
+
* Concurrent `get()` calls made before the first load settles share that one
|
|
42
|
+
* load. A failed load is not cached: the next `get()` retries.
|
|
33
43
|
*/
|
|
34
|
-
declare function lazyModule<T>(loader: () => Promise<T>):
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
declare function lazyModule<T>(loader: () => Promise<T>): LazyModule<T>;
|
|
45
|
+
/** One `exports` entry: a module entry point, or a prebuilt CDN script. */
|
|
46
|
+
type PackageExportTarget = {
|
|
47
|
+
types: string;
|
|
48
|
+
import: string;
|
|
49
|
+
require: string;
|
|
50
|
+
} | {
|
|
51
|
+
default: string;
|
|
37
52
|
};
|
|
38
53
|
/**
|
|
39
54
|
* Package metadata for distribution tooling.
|
|
40
|
-
* Provides entry point information and
|
|
55
|
+
* Provides entry point information and generates the Node.js subpath exports
|
|
56
|
+
* map that the published package actually uses.
|
|
41
57
|
*/
|
|
42
58
|
declare const packageInfo: {
|
|
43
59
|
name: string;
|
|
44
60
|
version: string;
|
|
45
61
|
entryPoints: Record<string, string>;
|
|
46
62
|
/**
|
|
47
|
-
* Generate
|
|
48
|
-
*
|
|
63
|
+
* Generate the package.json `exports` map. Module entries resolve to the
|
|
64
|
+
* `.js` (ESM), `.cjs` and `.d.ts` files tsup emits into `dist/`; CDN entries
|
|
65
|
+
* resolve to their prebuilt global script.
|
|
49
66
|
*/
|
|
50
|
-
generateExportsMap(): Record<string,
|
|
51
|
-
import: string;
|
|
52
|
-
require: string;
|
|
53
|
-
types: string;
|
|
54
|
-
}>;
|
|
67
|
+
generateExportsMap(): Record<string, PackageExportTarget>;
|
|
55
68
|
};
|
|
56
69
|
|
|
57
70
|
/**
|
|
@@ -127,16 +140,14 @@ declare const env: {
|
|
|
127
140
|
isTest: boolean;
|
|
128
141
|
};
|
|
129
142
|
|
|
130
|
-
/**
|
|
131
|
-
* Versioning and migration utilities for SibuJS applications.
|
|
132
|
-
* Provides semantic version management, migration tooling, and compatibility checks.
|
|
133
|
-
*/
|
|
134
143
|
/** Semantic version representation */
|
|
135
144
|
interface SemVer {
|
|
136
145
|
major: number;
|
|
137
146
|
minor: number;
|
|
138
147
|
patch: number;
|
|
139
148
|
prerelease?: string;
|
|
149
|
+
/** Build metadata (after `+`). Ignored when comparing versions. */
|
|
150
|
+
build?: string;
|
|
140
151
|
}
|
|
141
152
|
/** Migration definition */
|
|
142
153
|
interface Migration {
|
|
@@ -146,11 +157,19 @@ interface Migration {
|
|
|
146
157
|
down?: () => void | Promise<void>;
|
|
147
158
|
}
|
|
148
159
|
/**
|
|
149
|
-
* Framework version
|
|
160
|
+
* Framework version: the published package version, stamped at build time.
|
|
161
|
+
* Only raw, unbundled source reports "dev". (It was hard-coded to "1.0.0", so
|
|
162
|
+
* compatibility checks compared against a version the package never had.)
|
|
150
163
|
*/
|
|
151
|
-
declare const VERSION
|
|
164
|
+
declare const VERSION: string;
|
|
152
165
|
/**
|
|
153
166
|
* Parse a semantic version string into components.
|
|
167
|
+
*
|
|
168
|
+
* Accepts full SemVer 2.0.0 (`1.2.3`, `1.2.3-beta.1`, `1.2.3+build.5`), an
|
|
169
|
+
* optional leading `v`, surrounding whitespace, and the abbreviated `1` and
|
|
170
|
+
* `1.2` forms. Anything else — trailing characters, extra components, empty or
|
|
171
|
+
* illegal identifiers, numeric leading zeros — throws. (`parseInt` used to accept
|
|
172
|
+
* numeric prefixes such as `1.2.3garbage` and ignore extra components.)
|
|
154
173
|
*/
|
|
155
174
|
declare function parseSemVer(version: string): SemVer;
|
|
156
175
|
/**
|
|
@@ -162,22 +181,46 @@ declare function compareSemVer(a: string | SemVer, b: string | SemVer): -1 | 0 |
|
|
|
162
181
|
* Check if a version satisfies a semver range (supports ^, ~, >=, <=, =).
|
|
163
182
|
*/
|
|
164
183
|
declare function satisfies(version: string, range: string): boolean;
|
|
184
|
+
/**
|
|
185
|
+
* A migration step succeeded but recording its version in storage failed.
|
|
186
|
+
*
|
|
187
|
+
* Reported separately from a failing `up()` / `down()` because the migration's
|
|
188
|
+
* own work DID happen: storage is now behind reality and needs attention, but
|
|
189
|
+
* the step itself must not be retried as if it had failed.
|
|
190
|
+
*/
|
|
191
|
+
declare class MigrationStorageError extends Error {
|
|
192
|
+
/** The migration whose checkpoint could not be written. */
|
|
193
|
+
readonly version: string;
|
|
194
|
+
constructor(version: string, cause: unknown);
|
|
195
|
+
}
|
|
165
196
|
/**
|
|
166
197
|
* Create a migration runner for managing schema/state version upgrades.
|
|
198
|
+
*
|
|
199
|
+
* `migrate()` and `rollback()` are serialized across ALL runners in this realm
|
|
200
|
+
* that use the same storage object and storage key; runners with a different
|
|
201
|
+
* key (or storage) run independently. Coordination does not extend across
|
|
202
|
+
* tabs or workers.
|
|
167
203
|
*/
|
|
168
204
|
declare function createMigrationRunner(config: {
|
|
169
205
|
/** Current version of the app/data */
|
|
170
206
|
currentVersion: string;
|
|
171
207
|
/** Storage key for persisting applied migration version */
|
|
172
208
|
storageKey?: string;
|
|
209
|
+
/** Storage holding the applied version (default: `localStorage`) */
|
|
210
|
+
storage?: Storage;
|
|
173
211
|
/** Available migrations, sorted by version */
|
|
174
212
|
migrations: Migration[];
|
|
175
213
|
}): {
|
|
176
214
|
/** Get the last applied migration version from storage */
|
|
177
|
-
getAppliedVersion()
|
|
215
|
+
getAppliedVersion: () => string | null;
|
|
178
216
|
/** Get pending migrations that haven't been applied */
|
|
179
|
-
getPending()
|
|
180
|
-
/**
|
|
217
|
+
getPending: () => Migration[];
|
|
218
|
+
/**
|
|
219
|
+
* Run all pending migrations in order. Concurrent calls (and calls racing
|
|
220
|
+
* `rollback()`) run one after another, each recomputing what is pending —
|
|
221
|
+
* on this runner and on every other runner in this realm sharing its
|
|
222
|
+
* storage and storage key.
|
|
223
|
+
*/
|
|
181
224
|
migrate(): Promise<{
|
|
182
225
|
applied: string[];
|
|
183
226
|
errors: Array<{
|
|
@@ -185,7 +228,15 @@ declare function createMigrationRunner(config: {
|
|
|
185
228
|
error: Error;
|
|
186
229
|
}>;
|
|
187
230
|
}>;
|
|
188
|
-
/**
|
|
231
|
+
/**
|
|
232
|
+
* Rollback to a specific version.
|
|
233
|
+
*
|
|
234
|
+
* The applied version is checkpointed after EVERY successful `down()`, so a
|
|
235
|
+
* rollback that fails part-way leaves storage describing what is actually
|
|
236
|
+
* still applied, and a retry does not repeat completed `down()` steps.
|
|
237
|
+
* Throws the failing `down()`'s error, a missing-`down()` error, or a
|
|
238
|
+
* {@link MigrationStorageError} if a checkpoint cannot be written.
|
|
239
|
+
*/
|
|
189
240
|
rollback(targetVersion: string): Promise<{
|
|
190
241
|
rolledBack: string[];
|
|
191
242
|
}>;
|
|
@@ -288,4 +339,4 @@ declare function createBootSequence(): {
|
|
|
288
339
|
}>;
|
|
289
340
|
};
|
|
290
341
|
|
|
291
|
-
export { type Migration as M, type SemVer as S, VERSION as V,
|
|
342
|
+
export { type LazyModule as L, type Migration as M, type PackageExportTarget as P, type SemVer as S, VERSION as V, MigrationStorageError as a, bundlerMetadata as b, checkCompatibility as c, compareSemVer as d, createBootSequence as e, createBundle as f, createMigrationRunner as g, createModuleRegistry as h, createSSRCache as i, createTestHarness as j, deferNonCritical as k, env as l, healthCheck as m, lazyModule as n, parseSemVer as o, packageInfo as p, preloadCritical as q, prerenderRoutes as r, satisfies as s };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { A as Accessor } from './signal-EotCj4hS.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* derived creates a derived reactive signal whose value updates when dependencies change.
|
|
5
|
+
*
|
|
6
|
+
* Uses lazy pull-based evaluation with a single dirty flag:
|
|
7
|
+
* - When a dependency changes, the computed is marked dirty (no re-evaluation).
|
|
8
|
+
* - Dirtiness propagates downstream via propagateDirty.
|
|
9
|
+
* - The getter only re-evaluates when actually read (pull-based).
|
|
10
|
+
* - On re-evaluation, dependencies are re-tracked via retrack() so that
|
|
11
|
+
* derived-of-derived chains propagate correctly without paying the full
|
|
12
|
+
* Set-delete + re-add cost of track()'s cleanup phase.
|
|
13
|
+
*
|
|
14
|
+
* STABILIZATION — why a dirty flag is enough:
|
|
15
|
+
*
|
|
16
|
+
* A dirty computed does NOT imply a changed value. Downstream effects are
|
|
17
|
+
* enqueued by `propagateDirty` at write time, before this computed has had a
|
|
18
|
+
* chance to recompute and compare. Rather than adding a three-color
|
|
19
|
+
* (CLEAN/CHECK/DIRTY) propagation pass — which an earlier revision measured as
|
|
20
|
+
* a regression on every benchmark, because the extra state has nothing to skip
|
|
21
|
+
* when values genuinely change — the engine settles the question lazily at
|
|
22
|
+
* DRAIN time: `cs._validate` recomputes a dirty computed and `cs.__v` is bumped
|
|
23
|
+
* ONLY when the new value differs under this computed's comparator. The
|
|
24
|
+
* scheduler compares that version against what each subscriber last observed
|
|
25
|
+
* and suppresses the run when nothing changed (see `depsChanged` in
|
|
26
|
+
* ../../reactivity/track-core.ts).
|
|
27
|
+
*
|
|
28
|
+
* That keeps the cheap boolean dirty flag AND makes `equals` actually stop
|
|
29
|
+
* propagation, with recomputation still fully lazy: `_validate` only ever runs
|
|
30
|
+
* when an effect is genuinely about to observe the value.
|
|
31
|
+
*
|
|
32
|
+
* DISPOSAL — a derived subscribes to its sources when it is created, and those
|
|
33
|
+
* edges live as long as the sources do. A derived created per mount (one per
|
|
34
|
+
* virtualized row, say) must be released when its owner goes away:
|
|
35
|
+
* `flag.dispose()`, or `onCleanup(flag.dispose, rowNode)` to tie it to a node.
|
|
36
|
+
* A disposed accessor is inert: it keeps returning the last value it settled,
|
|
37
|
+
* never recomputes, never re-subscribes, and never wakes downstream readers.
|
|
38
|
+
* Disposal is idempotent.
|
|
39
|
+
*
|
|
40
|
+
* ERRORS — a recomputation that throws is thrown to the next reader, in that
|
|
41
|
+
* reader's context: a binding reports it with its node (so the nearest
|
|
42
|
+
* `ErrorBoundary` can claim it), an effect reports it, a direct caller can catch
|
|
43
|
+
* it, and a derived reading another derived passes it on. A live derived stays
|
|
44
|
+
* dirty and recomputes on the following read; a derived that disposed itself
|
|
45
|
+
* during the failing run returns its frozen value afterwards.
|
|
46
|
+
*
|
|
47
|
+
* @returns An accessor for the computed value. It recomputes lazily on read
|
|
48
|
+
* after any dependency changes, and carries `dispose()` to release its source
|
|
49
|
+
* subscriptions.
|
|
50
|
+
*/
|
|
51
|
+
declare function derived<T>(getter: () => T, options?: {
|
|
52
|
+
name?: string;
|
|
53
|
+
/** Custom equality — when the recomputed value equals the previous,
|
|
54
|
+
* downstream subscribers are not notified. Defaults to `Object.is`. */
|
|
55
|
+
equals?: (a: T, b: T) => boolean;
|
|
56
|
+
}): DerivedAccessor<T>;
|
|
57
|
+
/** Accessor returned by {@link derived}: read it like any getter, release it with `dispose()`. */
|
|
58
|
+
type DerivedAccessor<T> = Accessor<T> & {
|
|
59
|
+
/** Release every source subscription. The accessor then returns its last settled value. Idempotent. */
|
|
60
|
+
dispose: () => void;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Canonical disposer/teardown signature used across the framework.
|
|
65
|
+
*
|
|
66
|
+
* Returned by `effect()`, `track()`, widget `bind()` methods, and other
|
|
67
|
+
* subscription/lifecycle helpers. All disposers MUST be idempotent — calling
|
|
68
|
+
* twice should be a no-op rather than an error.
|
|
69
|
+
*/
|
|
70
|
+
type Dispose = () => void;
|
|
71
|
+
type NodeChild = Node | Element | Text | Comment | string | number | boolean | (() => NodeChild) | null | undefined;
|
|
72
|
+
type NodeChildren = NodeChild | NodeChild[] | NodeChild[][] | (() => NodeChild | NodeChild[]);
|
|
73
|
+
|
|
74
|
+
declare const SVG_NS = "http://www.w3.org/2000/svg";
|
|
75
|
+
interface TagProps {
|
|
76
|
+
id?: string;
|
|
77
|
+
class?: string | (() => string) | Record<string, boolean | (() => boolean)>;
|
|
78
|
+
style?: Record<string, string | number | (() => string | number)> | string | (() => string);
|
|
79
|
+
ref?: {
|
|
80
|
+
current: Element | null;
|
|
81
|
+
};
|
|
82
|
+
nodes?: NodeChildren;
|
|
83
|
+
on?: Record<string, (ev: Event) => void>;
|
|
84
|
+
/** Called with the element after creation — useful for imperative bindings */
|
|
85
|
+
onElement?: (el: HTMLElement) => void;
|
|
86
|
+
[attr: string]: unknown;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Factory for creating HTML or SVG elements with reactive props and nodes.
|
|
90
|
+
*
|
|
91
|
+
* Calling conventions:
|
|
92
|
+
*
|
|
93
|
+
* tag() empty element
|
|
94
|
+
* tag("text") element with text content
|
|
95
|
+
* tag(42) element with numeric text content
|
|
96
|
+
* tag([childA, childB]) element with children (array)
|
|
97
|
+
* tag(node) element wrapping a single existing node
|
|
98
|
+
* tag(getter) element with a reactive child
|
|
99
|
+
* tag("className", children) positional: class + children
|
|
100
|
+
* tag({ ...props }) full props object (children via props.nodes)
|
|
101
|
+
* tag({ ...props }, children) props + children (no need for `nodes:` key!)
|
|
102
|
+
*
|
|
103
|
+
* The last form is the "deeply-nested shorthand" the codebase favours:
|
|
104
|
+
*
|
|
105
|
+
* div({ class: "card" }, [
|
|
106
|
+
* h1({ class: "title" }, "Hello"),
|
|
107
|
+
* p({ class: "body" }, "World"),
|
|
108
|
+
* div({ class: "row" }, [
|
|
109
|
+
* span({ id: "x" }, "child"),
|
|
110
|
+
* ]),
|
|
111
|
+
* ])
|
|
112
|
+
*
|
|
113
|
+
* `children` overrides `props.nodes` when both are present.
|
|
114
|
+
*/
|
|
115
|
+
declare const tagFactory: (tag: string, ns?: string) => (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
|
|
116
|
+
|
|
117
|
+
export { type DerivedAccessor as D, type NodeChild as N, SVG_NS as S, type TagProps as T, type NodeChildren as a, type Dispose as b, derived as d, tagFactory as t };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { A as Accessor } from './signal-EotCj4hS.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* derived creates a derived reactive signal whose value updates when dependencies change.
|
|
5
|
+
*
|
|
6
|
+
* Uses lazy pull-based evaluation with a single dirty flag:
|
|
7
|
+
* - When a dependency changes, the computed is marked dirty (no re-evaluation).
|
|
8
|
+
* - Dirtiness propagates downstream via propagateDirty.
|
|
9
|
+
* - The getter only re-evaluates when actually read (pull-based).
|
|
10
|
+
* - On re-evaluation, dependencies are re-tracked via retrack() so that
|
|
11
|
+
* derived-of-derived chains propagate correctly without paying the full
|
|
12
|
+
* Set-delete + re-add cost of track()'s cleanup phase.
|
|
13
|
+
*
|
|
14
|
+
* STABILIZATION — why a dirty flag is enough:
|
|
15
|
+
*
|
|
16
|
+
* A dirty computed does NOT imply a changed value. Downstream effects are
|
|
17
|
+
* enqueued by `propagateDirty` at write time, before this computed has had a
|
|
18
|
+
* chance to recompute and compare. Rather than adding a three-color
|
|
19
|
+
* (CLEAN/CHECK/DIRTY) propagation pass — which an earlier revision measured as
|
|
20
|
+
* a regression on every benchmark, because the extra state has nothing to skip
|
|
21
|
+
* when values genuinely change — the engine settles the question lazily at
|
|
22
|
+
* DRAIN time: `cs._validate` recomputes a dirty computed and `cs.__v` is bumped
|
|
23
|
+
* ONLY when the new value differs under this computed's comparator. The
|
|
24
|
+
* scheduler compares that version against what each subscriber last observed
|
|
25
|
+
* and suppresses the run when nothing changed (see `depsChanged` in
|
|
26
|
+
* ../../reactivity/track-core.ts).
|
|
27
|
+
*
|
|
28
|
+
* That keeps the cheap boolean dirty flag AND makes `equals` actually stop
|
|
29
|
+
* propagation, with recomputation still fully lazy: `_validate` only ever runs
|
|
30
|
+
* when an effect is genuinely about to observe the value.
|
|
31
|
+
*
|
|
32
|
+
* DISPOSAL — a derived subscribes to its sources when it is created, and those
|
|
33
|
+
* edges live as long as the sources do. A derived created per mount (one per
|
|
34
|
+
* virtualized row, say) must be released when its owner goes away:
|
|
35
|
+
* `flag.dispose()`, or `onCleanup(flag.dispose, rowNode)` to tie it to a node.
|
|
36
|
+
* A disposed accessor is inert: it keeps returning the last value it settled,
|
|
37
|
+
* never recomputes, never re-subscribes, and never wakes downstream readers.
|
|
38
|
+
* Disposal is idempotent.
|
|
39
|
+
*
|
|
40
|
+
* ERRORS — a recomputation that throws is thrown to the next reader, in that
|
|
41
|
+
* reader's context: a binding reports it with its node (so the nearest
|
|
42
|
+
* `ErrorBoundary` can claim it), an effect reports it, a direct caller can catch
|
|
43
|
+
* it, and a derived reading another derived passes it on. A live derived stays
|
|
44
|
+
* dirty and recomputes on the following read; a derived that disposed itself
|
|
45
|
+
* during the failing run returns its frozen value afterwards.
|
|
46
|
+
*
|
|
47
|
+
* @returns An accessor for the computed value. It recomputes lazily on read
|
|
48
|
+
* after any dependency changes, and carries `dispose()` to release its source
|
|
49
|
+
* subscriptions.
|
|
50
|
+
*/
|
|
51
|
+
declare function derived<T>(getter: () => T, options?: {
|
|
52
|
+
name?: string;
|
|
53
|
+
/** Custom equality — when the recomputed value equals the previous,
|
|
54
|
+
* downstream subscribers are not notified. Defaults to `Object.is`. */
|
|
55
|
+
equals?: (a: T, b: T) => boolean;
|
|
56
|
+
}): DerivedAccessor<T>;
|
|
57
|
+
/** Accessor returned by {@link derived}: read it like any getter, release it with `dispose()`. */
|
|
58
|
+
type DerivedAccessor<T> = Accessor<T> & {
|
|
59
|
+
/** Release every source subscription. The accessor then returns its last settled value. Idempotent. */
|
|
60
|
+
dispose: () => void;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Canonical disposer/teardown signature used across the framework.
|
|
65
|
+
*
|
|
66
|
+
* Returned by `effect()`, `track()`, widget `bind()` methods, and other
|
|
67
|
+
* subscription/lifecycle helpers. All disposers MUST be idempotent — calling
|
|
68
|
+
* twice should be a no-op rather than an error.
|
|
69
|
+
*/
|
|
70
|
+
type Dispose = () => void;
|
|
71
|
+
type NodeChild = Node | Element | Text | Comment | string | number | boolean | (() => NodeChild) | null | undefined;
|
|
72
|
+
type NodeChildren = NodeChild | NodeChild[] | NodeChild[][] | (() => NodeChild | NodeChild[]);
|
|
73
|
+
|
|
74
|
+
declare const SVG_NS = "http://www.w3.org/2000/svg";
|
|
75
|
+
interface TagProps {
|
|
76
|
+
id?: string;
|
|
77
|
+
class?: string | (() => string) | Record<string, boolean | (() => boolean)>;
|
|
78
|
+
style?: Record<string, string | number | (() => string | number)> | string | (() => string);
|
|
79
|
+
ref?: {
|
|
80
|
+
current: Element | null;
|
|
81
|
+
};
|
|
82
|
+
nodes?: NodeChildren;
|
|
83
|
+
on?: Record<string, (ev: Event) => void>;
|
|
84
|
+
/** Called with the element after creation — useful for imperative bindings */
|
|
85
|
+
onElement?: (el: HTMLElement) => void;
|
|
86
|
+
[attr: string]: unknown;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Factory for creating HTML or SVG elements with reactive props and nodes.
|
|
90
|
+
*
|
|
91
|
+
* Calling conventions:
|
|
92
|
+
*
|
|
93
|
+
* tag() empty element
|
|
94
|
+
* tag("text") element with text content
|
|
95
|
+
* tag(42) element with numeric text content
|
|
96
|
+
* tag([childA, childB]) element with children (array)
|
|
97
|
+
* tag(node) element wrapping a single existing node
|
|
98
|
+
* tag(getter) element with a reactive child
|
|
99
|
+
* tag("className", children) positional: class + children
|
|
100
|
+
* tag({ ...props }) full props object (children via props.nodes)
|
|
101
|
+
* tag({ ...props }, children) props + children (no need for `nodes:` key!)
|
|
102
|
+
*
|
|
103
|
+
* The last form is the "deeply-nested shorthand" the codebase favours:
|
|
104
|
+
*
|
|
105
|
+
* div({ class: "card" }, [
|
|
106
|
+
* h1({ class: "title" }, "Hello"),
|
|
107
|
+
* p({ class: "body" }, "World"),
|
|
108
|
+
* div({ class: "row" }, [
|
|
109
|
+
* span({ id: "x" }, "child"),
|
|
110
|
+
* ]),
|
|
111
|
+
* ])
|
|
112
|
+
*
|
|
113
|
+
* `children` overrides `props.nodes` when both are present.
|
|
114
|
+
*/
|
|
115
|
+
declare const tagFactory: (tag: string, ns?: string) => (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
|
|
116
|
+
|
|
117
|
+
export { type DerivedAccessor as D, type NodeChild as N, SVG_NS as S, type TagProps as T, type NodeChildren as a, type Dispose as b, derived as d, tagFactory as t };
|