@stacksjs/stx 0.2.188 → 0.2.190
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-composables.d.ts +24 -7
- package/dist/browser-composables.js +58 -17
- package/dist/cli.js +729 -710
- package/dist/component-library.js +21 -4
- package/dist/composable-loader.d.ts +21 -7
- package/dist/composable-loader.js +77 -8
- package/dist/composables/use-cookie.d.ts +8 -3
- package/dist/craft.js +430 -412
- package/dist/dev-server/crosswind.d.ts +26 -0
- package/dist/dev-server/crosswind.js +50 -34
- package/dist/process.js +1 -1
- package/dist/pwa.js +455 -437
- package/dist/signals.js +21 -3
- package/dist/ssg.d.ts +14 -1
- package/dist/ssg.js +462 -444
- package/dist/stx.d.ts +37 -6
- package/dist/typecheck.js +47 -1
- package/dist/utils.js +23 -44
- package/dist/variable-extractor.js +3 -6
- package/package.json +5 -5
- package/stx.d.ts +37 -6
package/dist/signals.js
CHANGED
|
@@ -5413,16 +5413,34 @@ catch (e) {} }
|
|
|
5413
5413
|
if (opts.domain) parts.push('domain=' + opts.domain);
|
|
5414
5414
|
if (value === '') parts.push('max-age=0');
|
|
5415
5415
|
else if (typeof opts.maxAge === 'number') parts.push('max-age=' + opts.maxAge);
|
|
5416
|
-
else if (opts.expires
|
|
5416
|
+
else if (opts.expires !== undefined) {
|
|
5417
|
+
// Date, seconds-from-now, or anything Date can parse \u2014 matching the
|
|
5418
|
+
// composable. Accepting only a Date here meant the same option silently
|
|
5419
|
+
// produced a session cookie on the runtime path.
|
|
5420
|
+
var expiresDate = opts.expires instanceof Date
|
|
5421
|
+
? opts.expires
|
|
5422
|
+
: (typeof opts.expires === 'number' ? new Date(Date.now() + opts.expires * 1000) : new Date(opts.expires));
|
|
5423
|
+
parts.push('expires=' + expiresDate.toUTCString());
|
|
5424
|
+
}
|
|
5417
5425
|
parts.push('SameSite=' + (opts.sameSite || 'Lax'));
|
|
5418
5426
|
var secure = opts.secure;
|
|
5419
5427
|
if (secure === undefined) secure = typeof location !== 'undefined' && location.protocol === 'https:';
|
|
5420
5428
|
if (secure) parts.push('Secure');
|
|
5421
5429
|
return parts.join('; ');
|
|
5422
5430
|
}
|
|
5423
|
-
effect
|
|
5431
|
+
// subscribe, not effect: an effect runs once at creation, so merely
|
|
5432
|
+
// DECLARING a cookie rewrote it from these options. A second declaration
|
|
5433
|
+
// that only wanted to read - no options, because it is not the owner of the
|
|
5434
|
+
// policy - therefore reserialised it with no max-age, which is the
|
|
5435
|
+
// definition of a session cookie. A 30-day login died at browser close
|
|
5436
|
+
// because the user opened a settings page (#1933).
|
|
5437
|
+
//
|
|
5438
|
+
// subscribe fires on set() only, so construction is a pure read: read()
|
|
5439
|
+
// above already seeds the signal. This matches the composable, which has
|
|
5440
|
+
// always used subscribe.
|
|
5441
|
+
s.subscribe(function(value) {
|
|
5424
5442
|
if (typeof document === 'undefined') return;
|
|
5425
|
-
document.cookie = serialise(
|
|
5443
|
+
document.cookie = serialise(value);
|
|
5426
5444
|
});
|
|
5427
5445
|
return s;
|
|
5428
5446
|
}
|
package/dist/ssg.d.ts
CHANGED
|
@@ -113,7 +113,7 @@ export interface SSGConfig {
|
|
|
113
113
|
contentLoaders?: ContentLoader[];
|
|
114
114
|
/** Pre-render hooks */
|
|
115
115
|
hooks?: SSGHooks;
|
|
116
|
-
/** Minify HTML output (default: true
|
|
116
|
+
/** Minify HTML output (default: true) */
|
|
117
117
|
minify?: boolean;
|
|
118
118
|
/** Generate 404 page */
|
|
119
119
|
generate404?: boolean;
|
|
@@ -123,6 +123,19 @@ export interface SSGConfig {
|
|
|
123
123
|
trailingSlash?: boolean;
|
|
124
124
|
/** Clean output directory before build */
|
|
125
125
|
cleanOutput?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Extra input folded into every page's cache key.
|
|
128
|
+
*
|
|
129
|
+
* A page's key is its own file plus the dependencies collected while
|
|
130
|
+
* rendering it, which covers templates, components and layouts and nothing
|
|
131
|
+
* else. Anything build-wide — the Crosswind config, an env var the pages read
|
|
132
|
+
* — is invisible to it, and a build that reports every route `Cached` and
|
|
133
|
+
* exits 0 gives no signal that it used the old value (#1940).
|
|
134
|
+
*
|
|
135
|
+
* Defaults to a digest of the resolved Crosswind config. Set it to add your
|
|
136
|
+
* own build inputs; set it to a constant to opt out of that default.
|
|
137
|
+
*/
|
|
138
|
+
cacheSalt?: string;
|
|
126
139
|
/**
|
|
127
140
|
* Per-island chunking (#1746): lift each `client="<trigger>"` island's inline
|
|
128
141
|
* setup script into a content-hashed chunk under `_stx/islands/` that the
|