@stacksjs/stx 0.2.154 → 0.2.156
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/a11y.d.ts +87 -46
- package/dist/animation.d.ts +96 -42
- package/dist/appearance-bootstrap.d.ts +49 -15
- package/dist/asset-roots.d.ts +32 -0
- package/dist/asset-roots.js +7 -0
- package/dist/assets.d.ts +9 -7
- package/dist/async-components.d.ts +78 -56
- package/dist/auth.d.ts +3 -0
- package/dist/build-externalize.d.ts +40 -0
- package/dist/build-externalize.js +63 -0
- package/dist/build-id.d.ts +22 -22
- package/dist/build-message.d.ts +73 -2
- package/dist/build-message.js +47 -8
- package/dist/builtins/attrs.d.ts +14 -0
- package/dist/builtins/drawer.d.ts +22 -0
- package/dist/builtins/icon.d.ts +16 -2
- package/dist/builtins/index.d.ts +5 -15
- package/dist/builtins/modal.d.ts +24 -0
- package/dist/builtins/safe-image.d.ts +42 -0
- package/dist/builtins/stx-image.d.ts +27 -0
- package/dist/builtins/stx-link.d.ts +9 -0
- package/dist/builtins/stx-loading-indicator.d.ts +11 -0
- package/dist/builtins/suspense.d.ts +28 -0
- package/dist/builtins/toast.d.ts +17 -0
- package/dist/builtins/transition-group.d.ts +25 -0
- package/dist/caching.d.ts +12 -15
- package/dist/cli.js +1798 -908
- package/dist/client/directive.d.ts +7 -0
- package/dist/client/index.d.ts +0 -1
- package/dist/client-script-bundler.d.ts +63 -5
- package/dist/client-script-bundler.js +30 -2
- package/dist/client-script.d.ts +102 -47
- package/dist/client-script.js +15 -3
- package/dist/codemod.d.ts +56 -0
- package/dist/codemod.js +192 -0
- package/dist/color-mode-boot.d.ts +83 -65
- package/dist/component-client-factories.d.ts +1 -6
- package/dist/component-processing.d.ts +58 -49
- package/dist/component-processing.js +1 -1
- package/dist/component-registry.d.ts +94 -31
- package/dist/component-renderer.d.ts +18 -0
- package/dist/composable-loader.d.ts +24 -0
- package/dist/composable-loader.js +12 -9
- package/dist/composables/index.d.ts +7 -0
- package/dist/composables/index.js +1 -0
- package/dist/composables/use-fetch.js +30 -2
- package/dist/composables/use-form.d.ts +91 -0
- package/dist/composables/use-form.js +112 -0
- package/dist/composables.d.ts +64 -60
- package/dist/computed.d.ts +86 -92
- package/dist/conditionals.d.ts +24 -8
- package/dist/conditionals.js +16 -0
- package/dist/config.d.ts +34 -21
- package/dist/config.js +35 -14
- package/dist/craft.js +1476 -768
- package/dist/crosswind-config.d.ts +58 -0
- package/dist/crosswind-config.js +40 -0
- package/dist/csp.d.ts +107 -41
- package/dist/defer.d.ts +24 -0
- package/dist/dev-server/crosswind.d.ts +35 -26
- package/dist/dev-server/crosswind.js +2 -18
- package/dist/dev-server/serve-app.js +4 -3
- package/dist/dev-server/terminal-colors.d.ts +32 -32
- package/dist/directive-api.d.ts +86 -43
- package/dist/document-shell.d.ts +54 -41
- package/dist/dynamic-components.d.ts +9 -0
- package/dist/error-boundaries.d.ts +47 -41
- package/dist/error-handling.d.ts +1 -1
- package/dist/errors/codes.d.ts +51 -43
- package/dist/errors/formatter.d.ts +58 -38
- package/dist/errors/index.d.ts +5 -61
- package/dist/errors/logger.d.ts +114 -40
- package/dist/errors/sanitizer.d.ts +53 -23
- package/dist/errors/types.d.ts +44 -31
- package/dist/events.d.ts +86 -25
- package/dist/expressions.d.ts +50 -42
- package/dist/forms-validation.d.ts +138 -123
- package/dist/forms-validation.js +1 -90
- package/dist/forms.d.ts +120 -66
- package/dist/forms.js +31 -11
- package/dist/fragment-container.d.ts +57 -0
- package/dist/fragment-container.js +109 -0
- package/dist/framework-composables.d.ts +32 -0
- package/dist/head.d.ts +156 -114
- package/dist/heatmap.d.ts +152 -72
- package/dist/html-masking.d.ts +40 -34
- package/dist/hydration-runtime.d.ts +20 -24
- package/dist/i18n.d.ts +93 -32
- package/dist/image-optimization/auto-sibling.d.ts +32 -4
- package/dist/includes.d.ts +69 -7
- package/dist/index.d.ts +66 -0
- package/dist/index.js +23 -0
- package/dist/internal-markdown.d.ts +12 -8
- package/dist/island-chunking.d.ts +30 -13
- package/dist/keep-alive.d.ts +72 -52
- package/dist/layout-types.d.ts +45 -0
- package/dist/layout-types.js +56 -0
- package/dist/lazy-module.d.ts +10 -0
- package/dist/loops.d.ts +66 -0
- package/dist/loops.js +47 -6
- package/dist/markdown.d.ts +0 -1
- package/dist/media/image/component.d.ts +25 -9
- package/dist/media/image/directive.d.ts +15 -1
- package/dist/media/image/placeholder.d.ts +20 -9
- package/dist/media/image/processor/cache.d.ts +40 -18
- package/dist/media/image/processor/index.d.ts +1 -10
- package/dist/media/image/processor/optimizer.d.ts +12 -1
- package/dist/media/image/processor/responsive.d.ts +16 -6
- package/dist/media/image/srcset.d.ts +47 -50
- package/dist/media/shared/cache.d.ts +51 -31
- package/dist/media/shared/hash.d.ts +7 -0
- package/dist/media/types.d.ts +1235 -754
- package/dist/media/video/directive.d.ts +15 -1
- package/dist/media/video/index.d.ts +39 -17
- package/dist/media/video/processor/cache.d.ts +42 -19
- package/dist/media/video/processor/index.d.ts +1 -18
- package/dist/media/video/processor/streaming.d.ts +17 -10
- package/dist/media/video/processor/thumbnail.d.ts +21 -15
- package/dist/media/video/processor/transcoder.d.ts +11 -1
- package/dist/method-spoofing.d.ts +7 -0
- package/dist/middleware.d.ts +60 -0
- package/dist/owned-routes.d.ts +42 -0
- package/dist/owned-routes.js +26 -0
- package/dist/page-meta.d.ts +38 -0
- package/dist/page-meta.js +16 -0
- package/dist/parser/directive-parser.d.ts +57 -45
- package/dist/parser/expression-parser.d.ts +33 -35
- package/dist/parser/index.d.ts +4 -39
- package/dist/parser/tokenizer.d.ts +61 -49
- package/dist/partial-hydration.d.ts +82 -50
- package/dist/performance-utils.d.ts +217 -124
- package/dist/placeholder.d.ts +18 -9
- package/dist/plugin-system.d.ts +264 -115
- package/dist/process.d.ts +11 -6
- package/dist/process.js +21 -4
- package/dist/production-builder.js +7 -0
- package/dist/prop-sentinels.d.ts +11 -11
- package/dist/public-env.d.ts +14 -0
- package/dist/pwa/directives.d.ts +12 -3
- package/dist/pwa/inject.d.ts +10 -0
- package/dist/pwa/precache.d.ts +22 -16
- package/dist/pwa/service-worker.d.ts +12 -0
- package/dist/pwa.js +1318 -610
- package/dist/reactive-bindings.d.ts +34 -11
- package/dist/reactive.d.ts +58 -30
- package/dist/reactive.js +56 -31
- package/dist/render.js +1 -0
- package/dist/route-middleware.d.ts +2 -35
- package/dist/route-types.d.ts +134 -0
- package/dist/route-types.js +24 -0
- package/dist/router.d.ts +5 -7
- package/dist/routes.d.ts +1 -3
- package/dist/runtime-globals.d.ts +147 -24
- package/dist/runtime-globals.js +16 -1
- package/dist/runtime-injection.d.ts +8 -0
- package/dist/runtime-injection.js +33 -24
- package/dist/script-emit.d.ts +30 -0
- package/dist/script-json.d.ts +36 -0
- package/dist/script-json.js +6 -0
- package/dist/script-validation.d.ts +21 -4
- package/dist/seo.d.ts +118 -47
- package/dist/server-bindings.d.ts +21 -0
- package/dist/sfc-template.d.ts +8 -8
- package/dist/signal-processing.d.ts +35 -15
- package/dist/signals-api.d.ts +117 -58
- package/dist/signals-api.js +7 -4
- package/dist/signals.d.ts +24 -17
- package/dist/signals.js +765 -60
- package/dist/site-builder/build.js +8 -0
- package/dist/site-url.d.ts +46 -0
- package/dist/site-url.js +70 -0
- package/dist/slots.d.ts +86 -20
- package/dist/source-signature.d.ts +45 -0
- package/dist/source-signature.js +20 -0
- package/dist/ssg.d.ts +285 -142
- package/dist/ssg.js +1268 -556
- package/dist/state-dir.d.ts +4 -4
- package/dist/state-management.d.ts +0 -12
- package/dist/state-management.js +8 -25
- package/dist/store-imports.d.ts +23 -0
- package/dist/store-imports.js +3 -0
- package/dist/store-loader.d.ts +10 -0
- package/dist/store-loader.js +10 -9
- package/dist/story/analytics.d.ts +138 -60
- package/dist/story/bookmarks.d.ts +87 -34
- package/dist/story/cli.d.ts +123 -69
- package/dist/story/collect/scanner.d.ts +4 -0
- package/dist/story/collect/tree.d.ts +8 -1
- package/dist/story/commands/build.d.ts +11 -6
- package/dist/story/commands/dev.d.ts +15 -8
- package/dist/story/commands/preview.d.ts +13 -7
- package/dist/story/config-watcher.d.ts +20 -13
- package/dist/story/config.d.ts +11 -8
- package/dist/story/context.d.ts +14 -8
- package/dist/story/hmr.d.ts +24 -26
- package/dist/story/hot-swap.d.ts +34 -23
- package/dist/story/keyboard-shortcuts.d.ts +23 -18
- package/dist/story/output.d.ts +46 -44
- package/dist/story/performance.d.ts +107 -45
- package/dist/story/presets.d.ts +107 -41
- package/dist/story/renderer.d.ts +41 -27
- package/dist/story/search.d.ts +23 -12
- package/dist/story/server.d.ts +21 -11
- package/dist/story/setup.d.ts +23 -15
- package/dist/story/testing.d.ts +65 -40
- package/dist/story/types.d.ts +262 -160
- package/dist/streaming.d.ts +119 -57
- package/dist/stx-virtual-ts.d.ts +165 -0
- package/dist/stx-virtual-ts.js +372 -0
- package/dist/stx.d.ts +78 -1
- package/dist/style-scoping.d.ts +17 -4
- package/dist/suspense.d.ts +67 -52
- package/dist/teleport.d.ts +22 -0
- package/dist/template-tag-balance.d.ts +22 -6
- package/dist/transitions.d.ts +66 -55
- package/dist/typecheck.d.ts +77 -0
- package/dist/typecheck.js +156 -0
- package/dist/types/component-types.d.ts +187 -122
- package/dist/types/config-types.d.ts +758 -297
- package/dist/types/context-types.d.ts +46 -24
- package/dist/types/csp-types.d.ts +70 -66
- package/dist/types/directive-types.d.ts +211 -155
- package/dist/types/index.d.ts +6 -109
- package/dist/types/pwa-types.d.ts +273 -148
- package/dist/types.d.ts +0 -1
- package/dist/typescript-templates.d.ts +11 -0
- package/dist/unresolved-identifiers.d.ts +24 -22
- package/dist/unresolved-identifiers.js +2 -0
- package/dist/utils.d.ts +24 -21
- package/dist/validator.d.ts +28 -26
- package/dist/variable-extractor.d.ts +48 -13
- package/dist/variable-extractor.js +27 -4
- package/dist/view-composers.d.ts +80 -81
- package/dist/virtual-scrolling.d.ts +101 -81
- package/dist/vue-template.d.ts +23 -0
- package/dist/web-components/css-scoping.d.ts +21 -11
- package/dist/web-components.d.ts +81 -58
- package/dist/x-element.d.ts +0 -1
- package/package.json +5 -5
- package/stx.d.ts +78 -1
|
@@ -1,213 +1,338 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Progressive Web App (PWA) Types
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* PWA caching strategy for service worker routes
|
|
6
|
+
*/
|
|
7
|
+
export type PwaCacheStrategy = 'cache-first' | 'network-first' | 'stale-while-revalidate' | 'network-only' | 'cache-only';
|
|
1
8
|
/**
|
|
2
9
|
* PWA route cache configuration
|
|
3
10
|
* Defines how specific routes should be cached by the service worker
|
|
4
11
|
*/
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
export interface PwaRouteCache {
|
|
13
|
+
/** Route pattern (glob-style, e.g., '/api/*', '*.{js,css}') */
|
|
14
|
+
pattern: string;
|
|
15
|
+
/** Caching strategy for this route */
|
|
16
|
+
strategy: PwaCacheStrategy;
|
|
17
|
+
/** Custom cache name for this route group */
|
|
18
|
+
cacheName?: string;
|
|
19
|
+
/** Cache expiration in seconds */
|
|
20
|
+
maxAgeSeconds?: number;
|
|
21
|
+
/** Maximum number of entries in cache */
|
|
22
|
+
maxEntries?: number;
|
|
11
23
|
}
|
|
12
24
|
/**
|
|
13
25
|
* PWA icon configuration for automatic generation
|
|
14
26
|
*/
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
export interface PwaIconConfig {
|
|
28
|
+
/** Source icon path (512x512 PNG recommended) */
|
|
29
|
+
src: string;
|
|
30
|
+
/** Sizes to generate (default: [72, 96, 128, 144, 152, 192, 384, 512]) */
|
|
31
|
+
sizes?: number[];
|
|
32
|
+
/** Generate WebP variants alongside PNG */
|
|
33
|
+
generateWebP?: boolean;
|
|
34
|
+
/** Generate Apple touch icon variants */
|
|
35
|
+
generateAppleIcons?: boolean;
|
|
36
|
+
/** Output directory for generated icons (relative to output dir) */
|
|
37
|
+
outputDir?: string;
|
|
38
|
+
/** Icon purpose for manifest ('any', 'maskable', 'monochrome') */
|
|
39
|
+
purpose?: ('any' | 'maskable' | 'monochrome')[];
|
|
22
40
|
}
|
|
23
41
|
/**
|
|
24
42
|
* PWA shortcut definition for app shortcuts menu
|
|
25
43
|
*/
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
44
|
+
export interface PwaShortcut {
|
|
45
|
+
/** Shortcut name */
|
|
46
|
+
name: string;
|
|
47
|
+
/** Short name (optional) */
|
|
48
|
+
shortName?: string;
|
|
49
|
+
/** Description of the shortcut */
|
|
50
|
+
description?: string;
|
|
51
|
+
/** URL to navigate to */
|
|
52
|
+
url: string;
|
|
53
|
+
/** Icons for the shortcut */
|
|
54
|
+
icons?: Array<{
|
|
55
|
+
src: string;
|
|
56
|
+
sizes: string;
|
|
57
|
+
type?: string;
|
|
58
|
+
}>;
|
|
32
59
|
}
|
|
33
60
|
/**
|
|
34
61
|
* PWA screenshot definition for app store listings
|
|
35
62
|
*/
|
|
36
|
-
export
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
63
|
+
export interface PwaScreenshot {
|
|
64
|
+
/** Screenshot image path */
|
|
65
|
+
src: string;
|
|
66
|
+
/** Image dimensions (e.g., '1280x720') */
|
|
67
|
+
sizes: string;
|
|
68
|
+
/** Image MIME type */
|
|
69
|
+
type?: string;
|
|
70
|
+
/** Screenshot label/description */
|
|
71
|
+
label?: string;
|
|
72
|
+
/** Platform: 'wide' for desktop, 'narrow' for mobile */
|
|
73
|
+
platform?: 'wide' | 'narrow';
|
|
42
74
|
}
|
|
43
75
|
/**
|
|
44
76
|
* PWA Web App Manifest configuration
|
|
45
77
|
*/
|
|
46
|
-
export
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
78
|
+
export interface PwaManifestConfig {
|
|
79
|
+
/** Full application name */
|
|
80
|
+
name: string;
|
|
81
|
+
/** Short name (displayed on home screen) */
|
|
82
|
+
shortName?: string;
|
|
83
|
+
/** Application description */
|
|
84
|
+
description?: string;
|
|
85
|
+
/** Start URL when app is launched */
|
|
86
|
+
startUrl?: string;
|
|
87
|
+
/** Display mode for the app */
|
|
88
|
+
display?: 'fullscreen' | 'standalone' | 'minimal-ui' | 'browser';
|
|
89
|
+
/** Display mode override order */
|
|
90
|
+
displayOverride?: string[];
|
|
91
|
+
/** Preferred orientation */
|
|
92
|
+
orientation?: 'portrait' | 'landscape' | 'any' | 'portrait-primary' | 'portrait-secondary' | 'landscape-primary' | 'landscape-secondary';
|
|
93
|
+
/** Theme color (affects browser UI) */
|
|
94
|
+
themeColor?: string;
|
|
95
|
+
/** Background color (splash screen) */
|
|
96
|
+
backgroundColor?: string;
|
|
97
|
+
/** Scope of the PWA */
|
|
98
|
+
scope?: string;
|
|
99
|
+
/** Primary language */
|
|
100
|
+
lang?: string;
|
|
101
|
+
/** Text direction */
|
|
102
|
+
dir?: 'ltr' | 'rtl' | 'auto';
|
|
103
|
+
/** Unique app ID */
|
|
104
|
+
id?: string;
|
|
105
|
+
/** App categories for store listings */
|
|
106
|
+
categories?: string[];
|
|
107
|
+
/** App shortcuts for quick actions */
|
|
108
|
+
shortcuts?: PwaShortcut[];
|
|
109
|
+
/** Screenshots for app store listings */
|
|
110
|
+
screenshots?: PwaScreenshot[];
|
|
111
|
+
/** Launch handler behavior */
|
|
112
|
+
launchHandler?: 'auto' | 'focus-existing' | 'navigate-new' | 'navigate-existing';
|
|
113
|
+
/** How to handle links */
|
|
114
|
+
handleLinks?: 'auto' | 'preferred' | 'not-preferred';
|
|
115
|
+
/** Edge side panel configuration */
|
|
116
|
+
edgeSidePanel?: {
|
|
117
|
+
enabled: boolean;
|
|
118
|
+
preferredWidth?: number;
|
|
119
|
+
};
|
|
69
120
|
}
|
|
70
121
|
/**
|
|
71
122
|
* PWA offline fallback page configuration
|
|
72
123
|
*/
|
|
73
|
-
export
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
124
|
+
export interface PwaOfflineConfig {
|
|
125
|
+
/** Enable offline support */
|
|
126
|
+
enabled: boolean;
|
|
127
|
+
/** Path to custom offline page (.stx file) */
|
|
128
|
+
page?: string;
|
|
129
|
+
/** Fallback title when offline */
|
|
130
|
+
fallbackTitle?: string;
|
|
131
|
+
/** Fallback message when offline */
|
|
132
|
+
fallbackMessage?: string;
|
|
133
|
+
/** Additional assets to precache for offline access */
|
|
134
|
+
precacheAssets?: string[];
|
|
79
135
|
}
|
|
80
136
|
/**
|
|
81
137
|
* Service worker configuration
|
|
82
138
|
*/
|
|
83
|
-
export
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
139
|
+
export interface PwaServiceWorkerConfig {
|
|
140
|
+
/** Service worker file name (default: 'sw.js') */
|
|
141
|
+
fileName?: string;
|
|
142
|
+
/** Cache version for cache busting */
|
|
143
|
+
cacheVersion?: string;
|
|
144
|
+
/** Skip waiting and activate immediately */
|
|
145
|
+
skipWaiting?: boolean;
|
|
146
|
+
/** Claim all clients immediately */
|
|
147
|
+
clientsClaim?: boolean;
|
|
148
|
+
/** Enable navigation preload */
|
|
149
|
+
navigationPreload?: boolean;
|
|
150
|
+
/** Routes to exclude from caching (glob patterns) */
|
|
151
|
+
excludeRoutes?: string[];
|
|
152
|
+
/** File types to cache (extensions without dot) */
|
|
153
|
+
cacheFileTypes?: string[];
|
|
154
|
+
/** Use Workbox library instead of custom SW (requires workbox-* packages) */
|
|
155
|
+
useWorkbox?: boolean;
|
|
92
156
|
}
|
|
93
157
|
/**
|
|
94
158
|
* Push notification configuration
|
|
95
159
|
*/
|
|
96
|
-
export
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
160
|
+
export interface PwaPushConfig {
|
|
161
|
+
/** Enable push notifications */
|
|
162
|
+
enabled: boolean;
|
|
163
|
+
/** VAPID public key for push subscriptions */
|
|
164
|
+
vapidPublicKey?: string;
|
|
165
|
+
/** Server endpoint for push subscription registration */
|
|
166
|
+
subscriptionEndpoint?: string;
|
|
167
|
+
/** Default notification icon path */
|
|
168
|
+
defaultIcon?: string;
|
|
169
|
+
/** Default notification badge path */
|
|
170
|
+
defaultBadge?: string;
|
|
171
|
+
/** Default notification options */
|
|
172
|
+
defaultOptions?: {
|
|
173
|
+
/** Enable vibration */
|
|
174
|
+
vibrate?: number[];
|
|
175
|
+
/** Require interaction to dismiss */
|
|
176
|
+
requireInteraction?: boolean;
|
|
177
|
+
};
|
|
106
178
|
}
|
|
107
179
|
/**
|
|
108
180
|
* Background sync configuration
|
|
109
181
|
*/
|
|
110
|
-
export
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
182
|
+
export interface PwaBackgroundSyncConfig {
|
|
183
|
+
/** Enable background sync */
|
|
184
|
+
enabled: boolean;
|
|
185
|
+
/** Queue name for sync operations */
|
|
186
|
+
queueName?: string;
|
|
187
|
+
/** Maximum retention time in minutes */
|
|
188
|
+
maxRetentionMinutes?: number;
|
|
189
|
+
/** Maximum retry attempts */
|
|
190
|
+
maxRetries?: number;
|
|
191
|
+
/** Minimum interval between retries in ms */
|
|
192
|
+
minInterval?: number;
|
|
193
|
+
/** Forms to enable background sync for (CSS selectors) */
|
|
194
|
+
forms?: string[];
|
|
195
|
+
/** API endpoints to queue when offline */
|
|
196
|
+
endpoints?: string[];
|
|
118
197
|
}
|
|
119
198
|
/**
|
|
120
199
|
* Share target configuration for receiving shared content
|
|
121
200
|
*/
|
|
122
|
-
export
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
201
|
+
export interface PwaShareTargetConfig {
|
|
202
|
+
/** Enable share target */
|
|
203
|
+
enabled: boolean;
|
|
204
|
+
/** Action URL to handle shared content */
|
|
205
|
+
action: string;
|
|
206
|
+
/** HTTP method for share action */
|
|
207
|
+
method?: 'GET' | 'POST';
|
|
208
|
+
/** Encoding type for POST */
|
|
209
|
+
enctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data';
|
|
210
|
+
/** Parameter configuration */
|
|
211
|
+
params?: {
|
|
212
|
+
/** Parameter name for shared title */
|
|
213
|
+
title?: string;
|
|
214
|
+
/** Parameter name for shared text */
|
|
215
|
+
text?: string;
|
|
216
|
+
/** Parameter name for shared URL */
|
|
217
|
+
url?: string;
|
|
218
|
+
};
|
|
219
|
+
/** Accept file types for sharing */
|
|
220
|
+
acceptFiles?: Array<{
|
|
221
|
+
name: string;
|
|
222
|
+
accept: string[];
|
|
223
|
+
}>;
|
|
136
224
|
}
|
|
137
225
|
/**
|
|
138
226
|
* File handler configuration for handling specific file types
|
|
139
227
|
*/
|
|
140
|
-
export
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
228
|
+
export interface PwaFileHandlerConfig {
|
|
229
|
+
/** Enable file handling */
|
|
230
|
+
enabled: boolean;
|
|
231
|
+
/** Action URL to handle files */
|
|
232
|
+
action?: string;
|
|
233
|
+
/** Accepted MIME types and extensions (e.g., { 'text/markdown': ['.md'] }) */
|
|
234
|
+
accept?: Record<string, string[]>;
|
|
235
|
+
/** Launch type */
|
|
236
|
+
launchType?: 'single-client' | 'multiple-clients';
|
|
237
|
+
/** Icons for file handler */
|
|
238
|
+
icons?: Array<{
|
|
239
|
+
src: string;
|
|
240
|
+
sizes: string;
|
|
241
|
+
type: string;
|
|
242
|
+
}>;
|
|
146
243
|
}
|
|
147
244
|
/**
|
|
148
245
|
* Protocol handler configuration
|
|
149
246
|
*/
|
|
150
|
-
export
|
|
151
|
-
|
|
152
|
-
|
|
247
|
+
export interface PwaProtocolHandlerConfig {
|
|
248
|
+
/** Protocol scheme (e.g., 'web+myapp') */
|
|
249
|
+
protocol: string;
|
|
250
|
+
/** URL to handle the protocol */
|
|
251
|
+
url: string;
|
|
153
252
|
}
|
|
154
253
|
/**
|
|
155
254
|
* Cache storage limits configuration
|
|
156
255
|
*/
|
|
157
|
-
export
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
256
|
+
export interface PwaCacheStorageConfig {
|
|
257
|
+
/** Maximum cache size in MB */
|
|
258
|
+
maxSize?: number;
|
|
259
|
+
/** Maximum number of cached entries */
|
|
260
|
+
maxEntries?: number;
|
|
261
|
+
/** Maximum age of cached items in days */
|
|
262
|
+
maxAge?: number;
|
|
263
|
+
/** Purge strategy when limits exceeded */
|
|
264
|
+
purgeStrategy?: 'lru' | 'fifo' | 'lfu';
|
|
162
265
|
}
|
|
163
266
|
/**
|
|
164
267
|
* Update notification configuration
|
|
165
268
|
*/
|
|
166
|
-
export
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
269
|
+
export interface PwaUpdateConfig {
|
|
270
|
+
/** Enable update notifications */
|
|
271
|
+
enabled: boolean;
|
|
272
|
+
/** Show prompt when update available */
|
|
273
|
+
promptUser?: boolean;
|
|
274
|
+
/** Auto-reload after update */
|
|
275
|
+
autoReload?: boolean;
|
|
276
|
+
/** Custom update notification message */
|
|
277
|
+
message?: string;
|
|
278
|
+
/** Selector for custom update UI element */
|
|
279
|
+
uiSelector?: string;
|
|
172
280
|
}
|
|
173
281
|
/**
|
|
174
282
|
* Auto-precaching configuration
|
|
175
283
|
*/
|
|
176
|
-
export
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
284
|
+
export interface PwaPrecacheConfig {
|
|
285
|
+
/** Enable auto-precaching of build output */
|
|
286
|
+
enabled: boolean;
|
|
287
|
+
/** Include HTML files */
|
|
288
|
+
includeHtml?: boolean;
|
|
289
|
+
/** Include JS files */
|
|
290
|
+
includeJs?: boolean;
|
|
291
|
+
/** Include CSS files */
|
|
292
|
+
includeCss?: boolean;
|
|
293
|
+
/** Include images */
|
|
294
|
+
includeImages?: boolean;
|
|
295
|
+
/** Include fonts */
|
|
296
|
+
includeFonts?: boolean;
|
|
297
|
+
/** Additional glob patterns to include */
|
|
298
|
+
include?: string[];
|
|
299
|
+
/** Glob patterns to exclude */
|
|
300
|
+
exclude?: string[];
|
|
301
|
+
/** Maximum file size to precache (in KB) */
|
|
302
|
+
maxFileSizeKB?: number;
|
|
186
303
|
}
|
|
187
304
|
/**
|
|
188
305
|
* Complete PWA configuration
|
|
189
306
|
*/
|
|
190
|
-
export
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
307
|
+
export interface PwaConfig {
|
|
308
|
+
/** Enable PWA features */
|
|
309
|
+
enabled: boolean;
|
|
310
|
+
/** Web App Manifest configuration */
|
|
311
|
+
manifest: PwaManifestConfig;
|
|
312
|
+
/** Icon generation configuration */
|
|
313
|
+
icons?: PwaIconConfig;
|
|
314
|
+
/** Route-based caching strategies */
|
|
315
|
+
routes?: PwaRouteCache[];
|
|
316
|
+
/** Offline fallback configuration */
|
|
317
|
+
offline?: PwaOfflineConfig;
|
|
318
|
+
/** Service worker configuration */
|
|
319
|
+
serviceWorker?: PwaServiceWorkerConfig;
|
|
320
|
+
/** Auto-inject PWA meta tags and service worker registration */
|
|
321
|
+
autoInject?: boolean;
|
|
322
|
+
/** Push notification configuration */
|
|
323
|
+
push?: PwaPushConfig;
|
|
324
|
+
/** Background sync configuration */
|
|
325
|
+
backgroundSync?: PwaBackgroundSyncConfig;
|
|
326
|
+
/** Share target configuration */
|
|
327
|
+
shareTarget?: PwaShareTargetConfig;
|
|
328
|
+
/** File handler configuration */
|
|
329
|
+
fileHandlers?: PwaFileHandlerConfig;
|
|
330
|
+
/** Protocol handlers */
|
|
331
|
+
protocolHandlers?: PwaProtocolHandlerConfig[];
|
|
332
|
+
/** Cache storage limits */
|
|
333
|
+
cacheStorage?: PwaCacheStorageConfig;
|
|
334
|
+
/** Update notification configuration */
|
|
335
|
+
updates?: PwaUpdateConfig;
|
|
336
|
+
/** Auto-precaching configuration */
|
|
337
|
+
precache?: PwaPrecacheConfig;
|
|
206
338
|
}
|
|
207
|
-
/**
|
|
208
|
-
* Progressive Web App (PWA) Types
|
|
209
|
-
*/
|
|
210
|
-
/**
|
|
211
|
-
* PWA caching strategy for service worker routes
|
|
212
|
-
*/
|
|
213
|
-
export type PwaCacheStrategy = 'cache-first' | 'network-first' | 'stale-while-revalidate' | 'network-only' | 'cache-only';
|
package/dist/types.d.ts
CHANGED
|
@@ -35,6 +35,17 @@ export declare function inferTypeFromValue(value: unknown): TSType;
|
|
|
35
35
|
/**
|
|
36
36
|
* Type-check an expression against the type context.
|
|
37
37
|
*
|
|
38
|
+
* Superseded for `.stx` files by `stx typecheck`, which hands template
|
|
39
|
+
* expressions to the real compiler (`stx-virtual-ts.ts` builds the buffer,
|
|
40
|
+
* `typecheck.ts` runs it). #1852 asked for this function to be exported and
|
|
41
|
+
* given a real checker; it got the real checker instead, and deliberately did
|
|
42
|
+
* NOT get exported — two template checkers that disagree is the failure mode
|
|
43
|
+
* this repo keeps hitting.
|
|
44
|
+
*
|
|
45
|
+
* This walk only understands a bare identifier and a dotted member chain, and
|
|
46
|
+
* returns `any` for everything else. Reach for it only where a full compiler
|
|
47
|
+
* pass is not available.
|
|
48
|
+
*
|
|
38
49
|
* @returns The inferred type of the expression, or an error
|
|
39
50
|
*/
|
|
40
51
|
export declare function typeCheckExpression(expression: string, context: TemplateTypeContext): TSType | TypeCheckError;
|
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Find identifiers a script CALLS that resolve to nothing in the browser.
|
|
3
|
-
*
|
|
4
|
-
* Restricted to names we can name a cause for — exports of `composables/` with
|
|
5
|
-
* no runtime counterpart. A broader "looks like a hook and is not in scope"
|
|
6
|
-
* heuristic would fire on legitimate local helpers and app composables, and a
|
|
7
|
-
* warning people learn to ignore is worse than no warning.
|
|
8
|
-
*
|
|
9
|
-
* @param source the script body, after imports have been transformed
|
|
10
|
-
* @param provided names already in scope (runtime globals, locals, imports)
|
|
11
|
-
*/
|
|
12
|
-
export declare function findUnresolvedIdentifiers(source: string, provided: Iterable<string>): UnresolvedIdentifier[];
|
|
13
|
-
/**
|
|
14
|
-
* Report unresolved identifiers against a file, once each.
|
|
15
|
-
*
|
|
16
|
-
* Returns the diagnostics so callers can assert on them without capturing
|
|
17
|
-
* console output.
|
|
18
|
-
*/
|
|
19
|
-
export declare function reportUnresolvedIdentifiers(source: string, provided: Iterable<string>, filePath: string): UnresolvedIdentifier[];
|
|
20
1
|
/**
|
|
21
2
|
* Diagnose an identifier a client script calls that will not exist in the browser.
|
|
22
3
|
*
|
|
@@ -44,7 +25,28 @@ export declare function reportUnresolvedIdentifiers(source: string, provided: It
|
|
|
44
25
|
* the auto-import list did (#1804).
|
|
45
26
|
*/
|
|
46
27
|
export declare const SERVER_ONLY_COMPOSABLES: readonly string[];
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
|
|
28
|
+
export interface UnresolvedIdentifier {
|
|
29
|
+
/** The identifier as written. */
|
|
30
|
+
name: string;
|
|
31
|
+
/** Human-readable explanation, including the fix. */
|
|
32
|
+
message: string;
|
|
50
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Find identifiers a script CALLS that resolve to nothing in the browser.
|
|
36
|
+
*
|
|
37
|
+
* Restricted to names we can name a cause for — exports of `composables/` with
|
|
38
|
+
* no runtime counterpart. A broader "looks like a hook and is not in scope"
|
|
39
|
+
* heuristic would fire on legitimate local helpers and app composables, and a
|
|
40
|
+
* warning people learn to ignore is worse than no warning.
|
|
41
|
+
*
|
|
42
|
+
* @param source the script body, after imports have been transformed
|
|
43
|
+
* @param provided names already in scope (runtime globals, locals, imports)
|
|
44
|
+
*/
|
|
45
|
+
export declare function findUnresolvedIdentifiers(source: string, provided: Iterable<string>): UnresolvedIdentifier[];
|
|
46
|
+
/**
|
|
47
|
+
* Report unresolved identifiers against a file, once each.
|
|
48
|
+
*
|
|
49
|
+
* Returns the diagnostics so callers can assert on them without capturing
|
|
50
|
+
* console output.
|
|
51
|
+
*/
|
|
52
|
+
export declare function reportUnresolvedIdentifiers(source: string, provided: Iterable<string>, filePath: string): UnresolvedIdentifier[];
|
|
@@ -7,6 +7,7 @@ export const SERVER_ONLY_COMPOSABLES = [
|
|
|
7
7
|
"clearStorage",
|
|
8
8
|
"copyToClipboard",
|
|
9
9
|
"createShareableFile",
|
|
10
|
+
"defineForm",
|
|
10
11
|
"getBatteryLevel",
|
|
11
12
|
"getCookie",
|
|
12
13
|
"getCurrentPosition",
|
|
@@ -75,6 +76,7 @@ export const SERVER_ONLY_COMPOSABLES = [
|
|
|
75
76
|
"useEventSource",
|
|
76
77
|
"useEyeDropper",
|
|
77
78
|
"useFavicon",
|
|
79
|
+
"useForm",
|
|
78
80
|
"useFullscreen",
|
|
79
81
|
"useGeolocation",
|
|
80
82
|
"useGeolocationWatch",
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for the stx compiler
|
|
3
|
+
*
|
|
4
|
+
* This module provides core utilities for template processing.
|
|
5
|
+
* Some functionality has been extracted to dedicated modules:
|
|
6
|
+
*
|
|
7
|
+
* - validator.ts - Template validation utilities
|
|
8
|
+
* - variable-extractor.ts - Script variable extraction
|
|
9
|
+
*
|
|
10
|
+
* @module utils
|
|
11
|
+
*/
|
|
1
12
|
import type { StxOptions } from './types';
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from './validator';
|
|
13
|
+
export { extractDirectiveNames, getPositionInfo, hasDirectives, validateDirective, validateTemplate, } from './validator';
|
|
14
|
+
export type { TemplateValidationError, TemplateValidationResult, } from './validator';
|
|
15
|
+
export { convertToCommonJS, extractScriptFromTemplate, extractVariables, hasVariables, } from './variable-extractor';
|
|
6
16
|
/**
|
|
7
17
|
* Check if script should be treated as plain JavaScript (opt-out from TypeScript)
|
|
8
18
|
* By default ALL scripts are TypeScript. Use <script js> or <script lang="js"> to opt-out.
|
|
@@ -54,7 +64,7 @@ export declare function slotContentHasExpressions(slotContent: string): boolean;
|
|
|
54
64
|
* named `title` also exists in the server context.
|
|
55
65
|
*/
|
|
56
66
|
export declare function componentClientSignalNames(scripts: string[]): string[];
|
|
57
|
-
export declare function renderComponentWithSlot(componentPath: string, props: Record<string, unknown>, slotContent: string, componentsDir: string, parentContext: Record<string, unknown>, parentFilePath: string, options: StxOptions, processedComponents
|
|
67
|
+
export declare function renderComponentWithSlot(componentPath: string, props: Record<string, unknown>, slotContent: string, componentsDir: string, parentContext: Record<string, unknown>, parentFilePath: string, options: StxOptions, processedComponents: Set<string> | undefined, dependencies: Set<string>): Promise<string>;
|
|
58
68
|
/**
|
|
59
69
|
* Check if a file exists
|
|
60
70
|
*/
|
|
@@ -71,7 +81,11 @@ export declare function resolveTemplatePath(templatePath: string, currentFilePat
|
|
|
71
81
|
* @param errorPattern The pattern to locate in the template (fallback if position not available)
|
|
72
82
|
* @returns Line number and context information
|
|
73
83
|
*/
|
|
74
|
-
export declare function getSourceLineInfo(template: string, errorPosition?: number, errorPattern?: string): {
|
|
84
|
+
export declare function getSourceLineInfo(template: string, errorPosition?: number, errorPattern?: string): {
|
|
85
|
+
lineNumber: number;
|
|
86
|
+
lineContent: string;
|
|
87
|
+
context: string;
|
|
88
|
+
};
|
|
75
89
|
/**
|
|
76
90
|
* Create a descriptive error message with line information
|
|
77
91
|
* @param errorType Type of error (e.g., "Expression", "Directive")
|
|
@@ -91,18 +105,7 @@ export declare function clearComponentCache(): void;
|
|
|
91
105
|
/**
|
|
92
106
|
* Get component cache statistics
|
|
93
107
|
*/
|
|
94
|
-
export declare function getComponentCacheStats(): {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
getPositionInfo,
|
|
99
|
-
hasDirectives,
|
|
100
|
-
validateDirective,
|
|
101
|
-
validateTemplate,
|
|
102
|
-
} from './validator';
|
|
103
|
-
export {
|
|
104
|
-
convertToCommonJS,
|
|
105
|
-
extractScriptFromTemplate,
|
|
106
|
-
extractVariables,
|
|
107
|
-
hasVariables,
|
|
108
|
-
} from './variable-extractor';
|
|
108
|
+
export declare function getComponentCacheStats(): {
|
|
109
|
+
size: number;
|
|
110
|
+
maxSize: number;
|
|
111
|
+
};
|