@stacksjs/stx 0.2.4 → 0.2.6
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 +2 -6
- package/dist/analytics.d.ts +1 -1
- package/dist/analyzer.d.ts +1 -1
- package/dist/animation.d.ts +10 -86
- package/dist/app.d.ts +2 -4
- package/dist/assets.d.ts +1 -1
- package/dist/ast.d.ts +3 -24
- package/dist/async-components.d.ts +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/browser-composables.d.ts +6 -4
- package/dist/build-optimizer.d.ts +4 -29
- package/dist/build-views.d.ts +20 -1
- package/dist/bundle-analyzer/collector.d.ts +1 -1
- package/dist/bundle-analyzer/index.d.ts +40 -4
- package/dist/bundle-analyzer/report.d.ts +1 -1
- package/dist/bundle-analyzer/treemap.d.ts +1 -1
- package/dist/caching.d.ts +1 -1
- package/dist/cli.js +1323 -511
- package/dist/client/directive.d.ts +1 -1
- package/dist/client/index.d.ts +6 -1
- package/dist/client/router.d.ts +3 -11
- package/dist/client/stx-router.browser.d.ts +1 -0
- package/dist/client-script.d.ts +2 -1
- package/dist/client.d.ts +2 -2
- package/dist/component-hmr.d.ts +4 -18
- package/dist/components.d.ts +1 -1
- package/dist/composables/index.d.ts +114 -1
- package/dist/composables/use-battery.d.ts +1 -1
- package/dist/composables/use-broadcast-channel.d.ts +2 -2
- package/dist/composables/use-clipboard.d.ts +1 -1
- package/dist/composables/use-color-mode.d.ts +52 -0
- package/dist/composables/use-cookie.d.ts +1 -1
- package/dist/composables/use-device-orientation.d.ts +1 -1
- package/dist/composables/use-event-listener.d.ts +35 -0
- package/dist/composables/use-event-source.d.ts +1 -1
- package/dist/composables/use-eye-dropper.d.ts +3 -2
- package/dist/composables/use-fetch.d.ts +1 -1
- package/dist/composables/use-fullscreen.d.ts +1 -1
- package/dist/composables/use-geolocation.d.ts +1 -1
- package/dist/composables/use-idle.d.ts +2 -2
- package/dist/composables/use-intersection-observer.d.ts +1 -1
- package/dist/composables/use-keyboard.d.ts +1 -2
- package/dist/composables/use-media-query.d.ts +1 -1
- package/dist/composables/use-meta.d.ts +35 -0
- package/dist/composables/use-mouse.d.ts +1 -1
- package/dist/composables/use-mutation-observer.d.ts +1 -1
- package/dist/composables/use-network.d.ts +1 -1
- package/dist/composables/use-notification.d.ts +10 -1
- package/dist/composables/use-permissions.d.ts +17 -7
- package/dist/composables/use-query.d.ts +43 -0
- package/dist/composables/use-resize-observer.d.ts +1 -1
- package/dist/composables/use-router.d.ts +59 -0
- package/dist/composables/use-share.d.ts +1 -1
- package/dist/composables/use-speech.d.ts +1 -1
- package/dist/composables/use-storage.d.ts +1 -1
- package/dist/composables/use-text-selection.d.ts +1 -1
- package/dist/composables/use-timer.d.ts +92 -0
- package/dist/composables/use-utilities.d.ts +103 -0
- package/dist/composables/use-wake-lock.d.ts +1 -1
- package/dist/composables/use-websocket.d.ts +3 -3
- package/dist/composables/use-window.d.ts +1 -1
- package/dist/composables.d.ts +10 -7
- package/dist/composition-api.d.ts +1 -14
- package/dist/computed.d.ts +10 -4
- package/dist/conditionals.d.ts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/craft-bridge.d.ts +1 -1
- package/dist/craft-compiler.d.ts +6 -3
- package/dist/craft-components.d.ts +1 -8
- package/dist/craft-entry.d.ts +1 -1
- package/dist/craft-ssr.d.ts +1 -1
- package/dist/csp.d.ts +2 -2
- package/dist/csrf.d.ts +1 -1
- package/dist/custom-directives.d.ts +1 -1
- package/dist/database.d.ts +8 -26
- package/dist/defer.d.ts +1 -1
- package/dist/deploy/config-generators.d.ts +1 -1
- package/dist/deploy/index.d.ts +6 -3
- package/dist/deploy/netlify.d.ts +1 -1
- package/dist/dev-server/crosswind.d.ts +11 -1
- package/dist/dev-server/index.d.ts +16 -1
- package/dist/dev-server/keyboard-shortcuts.d.ts +1 -1
- package/dist/dev-server/native-window.d.ts +1 -1
- package/dist/dev-server/port-utils.d.ts +2 -2
- package/dist/dev-server/terminal-colors.d.ts +1 -5
- package/dist/dev-server/theme-selector.d.ts +1 -1
- package/dist/dev-server/types.d.ts +3 -8
- package/dist/dev-server.d.ts +1 -4
- package/dist/devtools.d.ts +4 -1
- package/dist/directive-api.d.ts +3 -3
- package/dist/docs.d.ts +2 -2
- package/dist/dynamic-components.d.ts +1 -1
- package/dist/edge-runtime.d.ts +3 -3
- package/dist/env.d.ts +1 -1
- package/dist/error-boundaries.d.ts +1 -1
- package/dist/error-handling.d.ts +14 -1
- package/dist/errors/codes.d.ts +2 -17
- package/dist/errors/formatter.d.ts +1 -1
- package/dist/errors/index.d.ts +13 -1
- package/dist/errors/logger.d.ts +2 -15
- package/dist/errors/sanitizer.d.ts +1 -1
- package/dist/errors/types.d.ts +1 -1
- package/dist/events.d.ts +1 -1
- package/dist/expressions.d.ts +64 -90
- package/dist/formatter.d.ts +1 -1
- package/dist/forms-validation.d.ts +23 -24
- package/dist/forms.d.ts +5 -22
- package/dist/head.d.ts +5 -1
- package/dist/heatmap.d.ts +4 -7
- package/dist/hot-reload.d.ts +3 -8
- package/dist/hydration-runtime.d.ts +1 -1
- package/dist/hydration.d.ts +5 -32
- package/dist/i18n.d.ts +1 -9
- package/dist/image-optimization/build-plugin.d.ts +2 -2
- package/dist/image-optimization/component.d.ts +2 -2
- package/dist/image-optimization/directive.d.ts +2 -2
- package/dist/image-optimization/index.d.ts +55 -1
- package/dist/image-optimization/processor.d.ts +9 -4
- package/dist/includes.d.ts +1 -1
- package/dist/index.d.ts +29 -1
- package/dist/index.js +1387 -542
- package/dist/init.d.ts +1 -1
- package/dist/interactive.d.ts +1 -1
- package/dist/internal-markdown.d.ts +1 -1
- package/dist/js-ts.d.ts +1 -1
- package/dist/jsx-runtime.d.ts +1 -20
- package/dist/keep-alive.d.ts +1 -1
- package/dist/lazy-loader.d.ts +3 -35
- package/dist/loading-indicator.d.ts +2 -1
- package/dist/loops.d.ts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/media/client/blur-up.d.ts +1 -1
- package/dist/media/client/index.d.ts +17 -1
- package/dist/media/client/lazy-load.d.ts +1 -1
- package/dist/media/client/upload-handler.d.ts +1 -1
- package/dist/media/image/component.d.ts +2 -4
- package/dist/media/image/directive.d.ts +1 -1
- package/dist/media/image/editing.d.ts +1 -1
- package/dist/media/image/index.d.ts +25 -1
- package/dist/media/image/placeholder.d.ts +1 -1
- package/dist/media/image/processor/cache.d.ts +3 -4
- package/dist/media/image/processor/index.d.ts +9 -1
- package/dist/media/image/processor/optimizer.d.ts +2 -2
- package/dist/media/image/processor/responsive.d.ts +3 -2
- package/dist/media/image/srcset.d.ts +6 -4
- package/dist/media/index.d.ts +37 -1
- package/dist/media/manager/embed.d.ts +1 -1
- package/dist/media/protected/component.d.ts +2 -3
- package/dist/media/protected/index.d.ts +14 -1
- package/dist/media/protected/signature.d.ts +2 -2
- package/dist/media/shared/cache.d.ts +1 -1
- package/dist/media/shared/hash.d.ts +1 -1
- package/dist/media/shared/index.d.ts +6 -1
- package/dist/media/types.d.ts +16 -72
- package/dist/media/upload/component.d.ts +2 -16
- package/dist/media/upload/index.d.ts +8 -1
- package/dist/media/video/directive.d.ts +1 -1
- package/dist/media/video/index.d.ts +11 -2
- package/dist/media/video/processor/cache.d.ts +3 -4
- package/dist/media/video/processor/index.d.ts +9 -1
- package/dist/media/video/processor/streaming.d.ts +2 -2
- package/dist/media/video/processor/thumbnail.d.ts +2 -2
- package/dist/media/video/processor/transcoder.d.ts +2 -2
- package/dist/method-spoofing.d.ts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/native-build.d.ts +3 -6
- package/dist/parser/directive-parser.d.ts +1 -1
- package/dist/parser/expression-parser.d.ts +2 -1
- package/dist/parser/index.d.ts +14 -1
- package/dist/parser/tokenizer.d.ts +2 -18
- package/dist/partial-hydration.d.ts +5 -6
- package/dist/performance-utils.d.ts +5 -18
- package/dist/plugin-system.d.ts +2 -8
- package/dist/plugin.d.ts +1 -1
- package/dist/precompiler.d.ts +2 -67
- package/dist/process.d.ts +12 -2
- package/dist/production-build.d.ts +1 -37
- package/dist/props.d.ts +3 -30
- package/dist/pwa/audit.d.ts +1 -1
- package/dist/pwa/directives.d.ts +1 -1
- package/dist/pwa/icons.d.ts +7 -4
- package/dist/pwa/index.d.ts +46 -1
- package/dist/pwa/inject.d.ts +1 -1
- package/dist/pwa/manifest.d.ts +1 -1
- package/dist/pwa/offline.d.ts +1 -1
- package/dist/pwa/precache.d.ts +1 -1
- package/dist/pwa/service-worker.d.ts +1 -1
- package/dist/pwa/workbox-strategies.d.ts +1 -1
- package/dist/pwa/workbox.d.ts +1 -10
- package/dist/pwa.d.ts +1 -1
- package/dist/pwa.js +1242 -430
- package/dist/reactive-bindings.d.ts +1 -1
- package/dist/reactive.d.ts +1 -1
- package/dist/reactivity.d.ts +6 -50
- package/dist/release.d.ts +1 -1
- package/dist/route-middleware.d.ts +3 -3
- package/dist/router.d.ts +1 -1
- package/dist/routes.d.ts +2 -2
- package/dist/runtime.d.ts +4 -4
- package/dist/safe-evaluator.d.ts +1 -4
- package/dist/scaffolding.d.ts +1 -1
- package/dist/seo.d.ts +1 -5
- package/dist/serve.d.ts +1 -1
- package/dist/server-components.d.ts +1 -1
- package/dist/signals.d.ts +8 -168
- package/dist/slots.d.ts +2 -2
- package/dist/source-maps.d.ts +3 -22
- package/dist/spa-shell.d.ts +20 -0
- package/dist/ssg.d.ts +4 -6
- package/dist/ssg.js +1242 -430
- package/dist/ssr.d.ts +6 -14
- package/dist/state-management.d.ts +5 -45
- package/dist/stores-client.d.ts +3 -3
- package/dist/story/addons.d.ts +1 -1
- package/dist/story/analytics.d.ts +4 -11
- package/dist/story/auto-stories.d.ts +1 -1
- package/dist/story/bookmarks.d.ts +2 -6
- package/dist/story/bun-test.d.ts +1 -1
- package/dist/story/cli.d.ts +0 -25
- package/dist/story/collect/analyzer.d.ts +1 -1
- package/dist/story/collect/index.d.ts +5 -1
- package/dist/story/collect/parser.d.ts +1 -1
- package/dist/story/collect/scanner.d.ts +1 -1
- package/dist/story/collect/tree.d.ts +2 -2
- package/dist/story/commands/build.d.ts +1 -1
- package/dist/story/commands/dev.d.ts +1 -1
- package/dist/story/commands/index.d.ts +4 -1
- package/dist/story/commands/preview.d.ts +1 -1
- package/dist/story/compiled-output.d.ts +1 -1
- package/dist/story/composition.d.ts +1 -1
- package/dist/story/config-watcher.d.ts +1 -1
- package/dist/story/config.d.ts +2 -2
- package/dist/story/context.d.ts +1 -1
- package/dist/story/controls/index.d.ts +1 -1
- package/dist/story/crosswind.d.ts +1 -1
- package/dist/story/desktop-preview.d.ts +1 -1
- package/dist/story/docs-generator.d.ts +1 -1
- package/dist/story/errors.d.ts +1 -1
- package/dist/story/figma-export.d.ts +2 -2
- package/dist/story/generator.d.ts +1 -1
- package/dist/story/hmr.d.ts +1 -1
- package/dist/story/hot-swap.d.ts +1 -1
- package/dist/story/index.d.ts +49 -1
- package/dist/story/interactions.d.ts +1 -1
- package/dist/story/keyboard-shortcuts.d.ts +1 -1
- package/dist/story/output.d.ts +1 -1
- package/dist/story/performance.d.ts +3 -12
- package/dist/story/presets.d.ts +3 -8
- package/dist/story/props-validation.d.ts +11 -1
- package/dist/story/renderer.d.ts +1 -1
- package/dist/story/search-index.d.ts +2 -2
- package/dist/story/search.d.ts +2 -2
- package/dist/story/server.d.ts +1 -1
- package/dist/story/setup.d.ts +1 -1
- package/dist/story/snapshots.d.ts +1 -1
- package/dist/story/testing.d.ts +1 -1
- package/dist/story/theme.d.ts +1 -1
- package/dist/story/types.d.ts +3 -12
- package/dist/story/ui/code-panel.d.ts +1 -1
- package/dist/story/ui/controls-panel.d.ts +1 -1
- package/dist/story/ui/index.d.ts +5 -1
- package/dist/story/ui/navigation.d.ts +1 -1
- package/dist/story/ui/preview.d.ts +1 -1
- package/dist/story/visual-testing.d.ts +1 -1
- package/dist/streaming.d.ts +0 -59
- package/dist/suspense.d.ts +1 -1
- package/dist/teleport.d.ts +1 -1
- package/dist/testing.d.ts +62 -80
- package/dist/transitions.d.ts +1 -1
- package/dist/type-checker.d.ts +2 -26
- package/dist/types/component-types.d.ts +3 -3
- package/dist/types/config-types.d.ts +15 -30
- package/dist/types/context-types.d.ts +6 -5
- package/dist/types/csp-types.d.ts +2 -2
- package/dist/types/directive-types.d.ts +5 -5
- package/dist/types/index.d.ts +21 -1
- package/dist/types/pwa-types.d.ts +1 -6
- package/dist/types.d.ts +28 -1
- package/dist/typescript-templates.d.ts +1 -34
- package/dist/utils.d.ts +2 -1
- package/dist/validator.d.ts +1 -1
- package/dist/variable-extractor.d.ts +1 -1
- package/dist/view-composers.d.ts +1 -1
- package/dist/virtual-scrolling.d.ts +4 -1
- package/dist/visual-editor.d.ts +2 -30
- package/dist/visual-testing.d.ts +4 -1
- package/dist/vue-template.d.ts +1 -1
- package/dist/web-components/css-scoping.d.ts +1 -1
- package/dist/web-components/index.d.ts +10 -1
- package/dist/web-components/reactive-generator.d.ts +1 -1
- package/dist/web-components.d.ts +1 -1
- package/dist/x-element.d.ts +13 -6
- package/package.json +4 -4
package/dist/precompiler.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { SourceMapGenerator } from './source-maps';
|
|
2
|
-
import { TemplateParser, } from './ast';
|
|
3
|
-
import type { ASTNode, AttributeNode, ComponentNode, DirectiveNode, DocumentNode, ElementNode, ExpressionNode, } from './ast';
|
|
4
1
|
import type { SourceMapV3 } from './source-maps';
|
|
5
2
|
// Export singleton instance
|
|
6
3
|
export declare const compiler: TemplateCompiler;
|
|
@@ -25,84 +22,22 @@ export declare interface CompileResult {
|
|
|
25
22
|
code: string
|
|
26
23
|
map?: SourceMapV3
|
|
27
24
|
analysis: {
|
|
28
|
-
/** Variables used in expressions */
|
|
29
25
|
usedVariables: Set<string>
|
|
30
|
-
/** Directives used */
|
|
31
26
|
usedDirectives: Set<string>
|
|
32
|
-
/** Components used */
|
|
33
27
|
usedComponents: Set<string>
|
|
34
|
-
/** Whether template has dynamic content */
|
|
35
28
|
isDynamic: boolean
|
|
36
|
-
/** Whether template uses slots */
|
|
37
29
|
hasSlots: boolean
|
|
38
30
|
}
|
|
39
31
|
}
|
|
40
|
-
declare interface CodegenContext {
|
|
41
|
-
code: string
|
|
42
|
-
indentLevel: number
|
|
43
|
-
sourceMapGenerator?: SourceMapGenerator
|
|
44
|
-
currentLine: number
|
|
45
|
-
currentColumn: number
|
|
46
|
-
sourceFile: string
|
|
47
|
-
mode: CompileMode
|
|
48
|
-
optimize: boolean
|
|
49
|
-
dev: boolean
|
|
50
|
-
usedVariables: Set<string>
|
|
51
|
-
usedDirectives: Set<string>
|
|
52
|
-
usedComponents: Set<string>
|
|
53
|
-
hasSlots: boolean
|
|
54
|
-
varCounter: number
|
|
55
|
-
}
|
|
56
32
|
/**
|
|
57
33
|
* Compilation mode
|
|
58
34
|
*/
|
|
59
|
-
export type CompileMode = 'ssr' | 'client' | 'universal'
|
|
35
|
+
export type CompileMode = 'ssr' | 'client' | 'universal';
|
|
60
36
|
/**
|
|
61
37
|
* Template pre-compiler
|
|
62
38
|
*/
|
|
63
39
|
export declare class TemplateCompiler {
|
|
64
|
-
private parser: TemplateParser;
|
|
65
40
|
constructor();
|
|
66
41
|
compile(template: string, options?: CompileOptions): CompileResult;
|
|
67
42
|
compileFile(filePath: string, options?: CompileOptions): Promise<CompileResult>;
|
|
68
|
-
|
|
69
|
-
sourceFile: string
|
|
70
|
-
mode: CompileMode
|
|
71
|
-
optimize: boolean
|
|
72
|
-
dev: boolean
|
|
73
|
-
sourceMaps: boolean
|
|
74
|
-
}): CodegenContext;
|
|
75
|
-
private generateRenderFunction(ast: DocumentNode, ctx: CodegenContext): string;
|
|
76
|
-
private analyzeAST(ast: DocumentNode, ctx: CodegenContext): void;
|
|
77
|
-
private generateNode(node: ASTNode, ctx: CodegenContext): string;
|
|
78
|
-
private generateText(text: string, _ctx: CodegenContext): string;
|
|
79
|
-
private generateExpression(node: ExpressionNode, _ctx: CodegenContext): string;
|
|
80
|
-
private generateDirective(node: DirectiveNode, ctx: CodegenContext): string;
|
|
81
|
-
private generateIf(condition: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
|
|
82
|
-
private generateUnless(condition: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
|
|
83
|
-
private generateForeach(params: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
|
|
84
|
-
private generateFor(params: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
|
|
85
|
-
private generateWhile(condition: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
|
|
86
|
-
private generateIsset(params: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
|
|
87
|
-
private generateEmpty(params: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
|
|
88
|
-
private generateAuth(body: ASTNode[] | null, ctx: CodegenContext): string;
|
|
89
|
-
private generateGuest(body: ASTNode[] | null, ctx: CodegenContext): string;
|
|
90
|
-
private generateEnv(params: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
|
|
91
|
-
private generateSwitch(params: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
|
|
92
|
-
private generateSlot(params: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
|
|
93
|
-
private generateSection(params: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
|
|
94
|
-
private generatePush(params: string | null, body: ASTNode[] | null, ctx: CodegenContext): string;
|
|
95
|
-
private generateOnce(body: ASTNode[] | null, ctx: CodegenContext): string;
|
|
96
|
-
private generateScript(body: ASTNode[] | null, _ctx: CodegenContext): string;
|
|
97
|
-
private generateStyle(node: { content: string, scoped: boolean }, _ctx: CodegenContext): string;
|
|
98
|
-
private generateElement(node: ElementNode, ctx: CodegenContext): string;
|
|
99
|
-
private generateAttribute(attr: AttributeNode, ctx: CodegenContext): string;
|
|
100
|
-
private parseAttributeValue(value: string, ctx: CodegenContext): string;
|
|
101
|
-
private generateComponent(node: ComponentNode, ctx: CodegenContext): string;
|
|
102
|
-
private splitConditionalBody(body: ASTNode[]): {
|
|
103
|
-
ifBody: ASTNode[]
|
|
104
|
-
elseifs: Array<{ condition: string, body: ASTNode[] }>
|
|
105
|
-
elseBody: ASTNode[]
|
|
106
|
-
};
|
|
107
|
-
private wrapModule(functionCode: string, functionName: string, format: 'esm' | 'cjs' | 'iife', _ctx: CodegenContext): string;
|
|
108
|
-
}
|
|
43
|
+
}
|
package/dist/process.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StxOptions } from './types';
|
|
1
|
+
import type { StxOptions, StrictModeConfig } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Process all template directives with enhanced error handling and performance monitoring
|
|
4
4
|
*/
|
|
@@ -10,4 +10,14 @@ export declare function processJsonDirective(template: string, context: Record<s
|
|
|
10
10
|
/**
|
|
11
11
|
* Process @once directive blocks
|
|
12
12
|
*/
|
|
13
|
-
export declare function processOnceDirective(template: string): string;
|
|
13
|
+
export declare function processOnceDirective(template: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Validate client script content for prohibited DOM API patterns.
|
|
16
|
+
* When strict mode is enabled with `failOnViolation`, throws an error.
|
|
17
|
+
* Otherwise, emits warnings.
|
|
18
|
+
*
|
|
19
|
+
* @param content - The script content to validate
|
|
20
|
+
* @param filePath - The file path for error reporting
|
|
21
|
+
* @param strict - Strict mode configuration
|
|
22
|
+
*/
|
|
23
|
+
export declare function validateClientScript(content: string, filePath: string, strict?: boolean | StrictModeConfig): void;
|
|
@@ -158,42 +158,6 @@ export declare interface AssetInfo {
|
|
|
158
158
|
* Production Build orchestrator
|
|
159
159
|
*/
|
|
160
160
|
export declare class ProductionBuild {
|
|
161
|
-
private config: ProductionBuildConfig;
|
|
162
|
-
private startTime: number;
|
|
163
|
-
private outputs: OutputFile[];
|
|
164
|
-
private chunks: ChunkInfo[];
|
|
165
|
-
private assets: AssetInfo[];
|
|
166
|
-
private warnings: string[];
|
|
167
|
-
private errors: string[];
|
|
168
|
-
private moduleGraph: Map<string, Set<string>>;
|
|
169
|
-
private assetHashes: Map<string, string>;
|
|
170
161
|
constructor(config: ProductionBuildConfig);
|
|
171
162
|
build(): Promise<BuildResult>;
|
|
172
|
-
|
|
173
|
-
private buildEntry(name: string, entryPath: string): Promise<void>;
|
|
174
|
-
private resolveRelativePath(from: string, to: string): string;
|
|
175
|
-
private processTemplate(content: string, filePath: string): Promise<string>;
|
|
176
|
-
private processCss(content: string, filePath: string): Promise<string>;
|
|
177
|
-
private processScript(content: string, filePath: string): Promise<string>;
|
|
178
|
-
private extractCss(): Promise<void>;
|
|
179
|
-
private processAssets(): Promise<void>;
|
|
180
|
-
private performCodeSplitting(): Promise<void>;
|
|
181
|
-
private minifyOutputs(): Promise<void>;
|
|
182
|
-
private minifyJs(code: string): string;
|
|
183
|
-
private minifyCss(css: string): string;
|
|
184
|
-
private minifyHtml(html: string): string;
|
|
185
|
-
private generateSourceMaps(): Promise<void>;
|
|
186
|
-
private fingerprintAssets(): Promise<void>;
|
|
187
|
-
private compressOutputs(): Promise<void>;
|
|
188
|
-
private analyzeBundle(): Promise<void>;
|
|
189
|
-
private generateAnalysisHtml(analysis: any): string;
|
|
190
|
-
private generateAnalysisText(analysis: any): string;
|
|
191
|
-
private runPluginHook(hook: string, arg?: any): Promise<void>;
|
|
192
|
-
private runPluginTransform(code: string, id: string): Promise<string>;
|
|
193
|
-
private generateHash(content: string | Buffer): string;
|
|
194
|
-
private getOutputName(name: string, type: OutputFile['type'], hash: string): string;
|
|
195
|
-
private formatSize(bytes: number): string;
|
|
196
|
-
private ensureDir(dir: string): void;
|
|
197
|
-
private walkDir(dir: string, callback: (path: string) => void): void;
|
|
198
|
-
private getResult(): BuildResult;
|
|
199
|
-
}
|
|
163
|
+
}
|
package/dist/props.d.ts
CHANGED
|
@@ -140,33 +140,6 @@ export declare interface PropValidationResult {
|
|
|
140
140
|
errors: PropValidationError[]
|
|
141
141
|
warnings: string[]
|
|
142
142
|
}
|
|
143
|
-
/**
|
|
144
|
-
* STX Props System
|
|
145
|
-
*
|
|
146
|
-
* Provides type-safe component props with runtime validation.
|
|
147
|
-
*
|
|
148
|
-
* @module props
|
|
149
|
-
*
|
|
150
|
-
* @example
|
|
151
|
-
* ```html
|
|
152
|
-
* <script>
|
|
153
|
-
* import { defineProps } from 'stx'
|
|
154
|
-
*
|
|
155
|
-
* const props = defineProps<{
|
|
156
|
-
* title: string
|
|
157
|
-
* count?: number
|
|
158
|
-
* items: string[]
|
|
159
|
-
* }>({
|
|
160
|
-
* title: { required: true },
|
|
161
|
-
* count: { default: 0 },
|
|
162
|
-
* items: { default: () => [] }
|
|
163
|
-
* })
|
|
164
|
-
* </script>
|
|
165
|
-
*
|
|
166
|
-
* <h1>{{ props.title }}</h1>
|
|
167
|
-
* <p>Count: {{ props.count }}</p>
|
|
168
|
-
* ```
|
|
169
|
-
*/
|
|
170
143
|
/** Supported prop types */
|
|
171
144
|
export type PropType<T> = | StringConstructor
|
|
172
145
|
| NumberConstructor
|
|
@@ -177,7 +150,7 @@ export type PropType<T> = | StringConstructor
|
|
|
177
150
|
| DateConstructor
|
|
178
151
|
| SymbolConstructor
|
|
179
152
|
| { new (...args: unknown[]): T }
|
|
180
|
-
| PropType<T>[]
|
|
153
|
+
| PropType<T>[];
|
|
181
154
|
/** Props definition object */
|
|
182
155
|
export type PropsDefinition<T> = {
|
|
183
156
|
[K in keyof T]?: PropOptions<T[K]> | PropType<T[K]>
|
|
@@ -191,9 +164,9 @@ export type ExtractPropTypes<T extends PropsDefinition<unknown>> = {
|
|
|
191
164
|
: unknown
|
|
192
165
|
}
|
|
193
166
|
/** Event handler type */
|
|
194
|
-
export type EventHandler<T = unknown> = (payload: T) => void
|
|
167
|
+
export type EventHandler<T = unknown> = (payload: T) => void;
|
|
195
168
|
/** Emit function type */
|
|
196
169
|
export type EmitFn<E extends Record<string, unknown>> = <K extends keyof E>(
|
|
197
170
|
event: K,
|
|
198
171
|
payload: E[K],
|
|
199
|
-
) => void
|
|
172
|
+
) => void;
|
package/dist/pwa/audit.d.ts
CHANGED
package/dist/pwa/directives.d.ts
CHANGED
package/dist/pwa/icons.d.ts
CHANGED
|
@@ -18,16 +18,19 @@ export declare function getExpectedIconPaths(config: PwaIconConfig): string[];
|
|
|
18
18
|
export declare function isSharpAvailable(): Promise<boolean>;
|
|
19
19
|
/**
|
|
20
20
|
* Default icon sizes for PWA
|
|
21
|
+
* @defaultValue `[72, 96, 128, 144, 152, 192, 384, 512]`
|
|
21
22
|
*/
|
|
22
|
-
export declare const DEFAULT_ICON_SIZES:
|
|
23
|
+
export declare const DEFAULT_ICON_SIZES: number[];
|
|
23
24
|
/**
|
|
24
25
|
* Apple touch icon sizes
|
|
26
|
+
* @defaultValue `[120, 152, 167, 180]`
|
|
25
27
|
*/
|
|
26
|
-
export declare const APPLE_TOUCH_ICON_SIZES:
|
|
28
|
+
export declare const APPLE_TOUCH_ICON_SIZES: number[];
|
|
27
29
|
/**
|
|
28
30
|
* Favicon sizes
|
|
31
|
+
* @defaultValue `[16, 32]`
|
|
29
32
|
*/
|
|
30
|
-
export declare const FAVICON_SIZES:
|
|
33
|
+
export declare const FAVICON_SIZES: number[];
|
|
31
34
|
/**
|
|
32
35
|
* Icon generation result
|
|
33
36
|
*/
|
|
@@ -36,4 +39,4 @@ export declare interface IconGenerationResult {
|
|
|
36
39
|
generatedFiles: string[]
|
|
37
40
|
errors: string[]
|
|
38
41
|
warnings: string[]
|
|
39
|
-
}
|
|
42
|
+
}
|
package/dist/pwa/index.d.ts
CHANGED
|
@@ -1,9 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STX PWA Module
|
|
3
|
+
*
|
|
4
|
+
* Progressive Web App support including service worker generation,
|
|
5
|
+
* manifest generation, icon processing, and Workbox integration.
|
|
6
|
+
*
|
|
7
|
+
* @module pwa
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import {
|
|
12
|
+
* generateServiceWorkerAuto,
|
|
13
|
+
* generateManifest,
|
|
14
|
+
* generateWorkboxServiceWorker,
|
|
15
|
+
* isWorkboxEnabled,
|
|
16
|
+
* } from 'stx/pwa'
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
// ============================================================================
|
|
20
|
+
// Service Worker
|
|
21
|
+
// ============================================================================
|
|
1
22
|
export {
|
|
2
23
|
generateServiceWorker,
|
|
3
24
|
generateServiceWorkerAuto,
|
|
4
25
|
getServiceWorkerFileName,
|
|
5
26
|
isWorkboxEnabled,
|
|
6
27
|
} from './service-worker';
|
|
28
|
+
// ============================================================================
|
|
29
|
+
// Workbox Integration
|
|
30
|
+
// ============================================================================
|
|
7
31
|
export {
|
|
8
32
|
generateWorkboxConfig,
|
|
9
33
|
generateWorkboxServiceWorker,
|
|
@@ -29,31 +53,52 @@ export {
|
|
|
29
53
|
type WorkboxRoute,
|
|
30
54
|
type RuntimeCachingConfig,
|
|
31
55
|
} from './workbox-strategies';
|
|
56
|
+
// ============================================================================
|
|
57
|
+
// Manifest
|
|
58
|
+
// ============================================================================
|
|
32
59
|
export {
|
|
33
60
|
generateManifest,
|
|
34
61
|
} from './manifest';
|
|
62
|
+
// ============================================================================
|
|
63
|
+
// Icons
|
|
64
|
+
// ============================================================================
|
|
35
65
|
export {
|
|
36
66
|
generatePwaIcons,
|
|
37
67
|
type IconGenerationResult,
|
|
38
68
|
} from './icons';
|
|
69
|
+
// ============================================================================
|
|
70
|
+
// Precache
|
|
71
|
+
// ============================================================================
|
|
39
72
|
export {
|
|
40
73
|
generatePrecacheManifest,
|
|
41
74
|
generatePrecacheManifestJs,
|
|
42
75
|
formatSize,
|
|
43
76
|
type PrecacheEntry,
|
|
44
77
|
} from './precache';
|
|
78
|
+
// ============================================================================
|
|
79
|
+
// Offline
|
|
80
|
+
// ============================================================================
|
|
45
81
|
export {
|
|
46
82
|
generateOfflinePage,
|
|
47
83
|
} from './offline';
|
|
84
|
+
// ============================================================================
|
|
85
|
+
// Injection
|
|
86
|
+
// ============================================================================
|
|
48
87
|
export {
|
|
49
88
|
injectPwaTags,
|
|
50
89
|
generateSwRegistrationScript,
|
|
51
90
|
} from './inject';
|
|
91
|
+
// ============================================================================
|
|
92
|
+
// Audit
|
|
93
|
+
// ============================================================================
|
|
52
94
|
export {
|
|
53
95
|
runPwaAudit,
|
|
54
96
|
type AuditResult,
|
|
55
97
|
type AuditCheck,
|
|
56
98
|
} from './audit';
|
|
99
|
+
// ============================================================================
|
|
100
|
+
// Directives
|
|
101
|
+
// ============================================================================
|
|
57
102
|
export {
|
|
58
103
|
pwaDirectives,
|
|
59
|
-
} from './directives';
|
|
104
|
+
} from './directives';
|
package/dist/pwa/inject.d.ts
CHANGED
package/dist/pwa/manifest.d.ts
CHANGED
package/dist/pwa/offline.d.ts
CHANGED
|
@@ -5,4 +5,4 @@ import type { StxOptions } from '../types';
|
|
|
5
5
|
* If a custom offline page is specified in config, it will be processed.
|
|
6
6
|
* Otherwise, a default styled offline page is generated.
|
|
7
7
|
*/
|
|
8
|
-
export declare function generateOfflinePage(options: StxOptions): Promise<string>;
|
|
8
|
+
export declare function generateOfflinePage(options: StxOptions): Promise<string>;
|
package/dist/pwa/precache.d.ts
CHANGED
|
@@ -18,4 +18,4 @@ export declare function isWorkboxEnabled(options: StxOptions): boolean;
|
|
|
18
18
|
* @param outputDir - optional output directory for precache manifest
|
|
19
19
|
* @returns Generated service worker JavaScript code
|
|
20
20
|
*/
|
|
21
|
-
export declare function generateServiceWorkerAuto(options: StxOptions, outputDir?: string): string;
|
|
21
|
+
export declare function generateServiceWorkerAuto(options: StxOptions, outputDir?: string): string;
|
package/dist/pwa/workbox.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { } from './workbox-strategies';
|
|
2
1
|
import type { StxOptions } from '../types';
|
|
3
2
|
/**
|
|
4
3
|
* Generate Workbox configuration from stx options
|
|
@@ -8,14 +7,6 @@ export declare function generateWorkboxConfig(options: StxOptions, outputDir?: s
|
|
|
8
7
|
* Generate Workbox service worker JavaScript code
|
|
9
8
|
*/
|
|
10
9
|
export declare function generateWorkboxServiceWorker(options: StxOptions, outputDir?: string): string;
|
|
11
|
-
/**
|
|
12
|
-
* Check if Workbox mode is enabled in config
|
|
13
|
-
*/
|
|
14
|
-
export declare function isWorkboxEnabled(options: StxOptions): boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Get the appropriate service worker generator based on config
|
|
17
|
-
*/
|
|
18
|
-
export declare function getServiceWorkerGenerator(options: StxOptions): (options: StxOptions, outputDir?: string) => string;
|
|
19
10
|
// ============================================================================
|
|
20
11
|
// Types
|
|
21
12
|
// ============================================================================
|
|
@@ -49,4 +40,4 @@ export declare interface RuntimeCacheRule {
|
|
|
49
40
|
}
|
|
50
41
|
networkTimeoutSeconds?: number
|
|
51
42
|
}
|
|
52
|
-
}
|
|
43
|
+
}
|
package/dist/pwa.d.ts
CHANGED