resuxjs 0.4.0-beta.2 → 0.4.0-beta.4
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/bin.d.ts +1 -1
- package/dist/bin.js +3 -2
- package/dist/bin.js.map +1 -1
- package/dist/build/index.d.ts +9 -8
- package/dist/build/index.js +2 -2
- package/dist/build/index.js.map +1 -1
- package/dist/cli.d.ts +5 -4
- package/dist/cli.js +115 -127
- package/dist/cli.js.map +1 -1
- package/dist/compiler/adapter.d.ts +6 -5
- package/dist/compiler/adapter.js +2 -1
- package/dist/compiler/adapter.js.map +1 -1
- package/dist/compiler/dev-warnings.d.ts +6 -5
- package/dist/compiler/dev-warnings.js +7 -6
- package/dist/compiler/dev-warnings.js.map +1 -1
- package/dist/compiler/directives.d.ts +4 -3
- package/dist/compiler/directives.js +2 -1
- package/dist/compiler/directives.js.map +1 -1
- package/dist/compiler/implementation.d.ts +21 -19
- package/dist/compiler/implementation.js +124 -133
- package/dist/compiler/index.d.ts +6 -5
- package/dist/compiler/index.js +2 -1
- package/dist/compiler/index.js.map +1 -1
- package/dist/core/config.d.ts +7 -5
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/hooks.d.ts +7 -6
- package/dist/core/hooks.js +1 -1
- package/dist/core/hooks.js.map +1 -1
- package/dist/core/index.js +2 -1
- package/dist/core/module-container.d.ts +22 -20
- package/dist/core/module-container.js +3 -3
- package/dist/core/module-container.js.map +1 -1
- package/dist/core/resux.d.ts +5 -3
- package/dist/core/resux.js +2 -1
- package/dist/core/resux.js.map +1 -1
- package/dist/create-bin.d.ts +1 -1
- package/dist/create-bin.js +3 -2
- package/dist/create-bin.js.map +1 -1
- package/dist/create.d.ts +3 -2
- package/dist/create.js +7 -10
- package/dist/create.js.map +1 -1
- package/dist/deploy/cloudflare.d.ts +3 -1
- package/dist/deploy/cloudflare.js +2 -1
- package/dist/deploy/cloudflare.js.map +1 -1
- package/dist/deploy/common.d.ts +13 -11
- package/dist/deploy/common.js +2 -1
- package/dist/deploy/common.js.map +1 -1
- package/dist/deploy/framework-runtime.d.ts +2 -1
- package/dist/deploy/framework-runtime.js +5 -1
- package/dist/deploy/framework-runtime.js.map +1 -1
- package/dist/deploy/index.d.ts +4 -2
- package/dist/deploy/index.js +4 -6
- package/dist/deploy/index.js.map +1 -1
- package/dist/deploy/netlify.d.ts +3 -1
- package/dist/deploy/netlify.js +3 -2
- package/dist/deploy/netlify.js.map +1 -1
- package/dist/deploy/node.d.ts +3 -1
- package/dist/deploy/node.js +3 -3
- package/dist/deploy/node.js.map +1 -1
- package/dist/deploy/production-report.d.ts +2 -1
- package/dist/deploy/production-report.js +2 -1
- package/dist/deploy/production-report.js.map +1 -1
- package/dist/deploy/runtime-dependencies.d.ts +5 -4
- package/dist/deploy/runtime-dependencies.js +3 -3
- package/dist/deploy/runtime-dependencies.js.map +1 -1
- package/dist/deploy/static.d.ts +3 -1
- package/dist/deploy/static.js +2 -1
- package/dist/deploy/static.js.map +1 -1
- package/dist/deploy/types.d.ts +8 -7
- package/dist/deploy/types.js +1 -1
- package/dist/deploy/vercel.d.ts +4 -2
- package/dist/deploy/vercel.js +3 -2
- package/dist/deploy/vercel.js.map +1 -1
- package/dist/fonts/index.d.ts +5 -4
- package/dist/fonts/index.js +3 -2
- package/dist/fonts/index.js.map +1 -1
- package/dist/globals.d.ts +2 -2
- package/dist/globals.js +1 -1
- package/dist/halal-core/ai/classifyProject.d.ts +5 -3
- package/dist/halal-core/ai/classifyProject.js +2 -1
- package/dist/halal-core/ai/classifyProject.js.map +1 -1
- package/dist/halal-core/ai/classifyRuntimeContent.d.ts +3 -1
- package/dist/halal-core/ai/classifyRuntimeContent.js +2 -1
- package/dist/halal-core/ai/classifyRuntimeContent.js.map +1 -1
- package/dist/halal-core/ai/createProjectSummary.d.ts +2 -1
- package/dist/halal-core/ai/createProjectSummary.js +2 -1
- package/dist/halal-core/ai/createProjectSummary.js.map +1 -1
- package/dist/halal-core/ai/halalClassifierPrompt.d.ts +2 -1
- package/dist/halal-core/ai/halalClassifierPrompt.js +1 -1
- package/dist/halal-core/ai/redactSensitiveData.d.ts +2 -1
- package/dist/halal-core/ai/redactSensitiveData.js +1 -1
- package/dist/halal-core/ai/redactSensitiveData.js.map +1 -1
- package/dist/halal-core/ai/validateAiResponse.d.ts +3 -1
- package/dist/halal-core/ai/validateAiResponse.js +3 -3
- package/dist/halal-core/ai/validateAiResponse.js.map +1 -1
- package/dist/halal-core/cli/check.d.ts +2 -1
- package/dist/halal-core/cli/check.js +3 -3
- package/dist/halal-core/cli/check.js.map +1 -1
- package/dist/halal-core/cli/explain.d.ts +2 -1
- package/dist/halal-core/cli/explain.js +3 -3
- package/dist/halal-core/cli/explain.js.map +1 -1
- package/dist/halal-core/cli/report.d.ts +2 -1
- package/dist/halal-core/cli/report.js +3 -3
- package/dist/halal-core/cli/report.js.map +1 -1
- package/dist/halal-core/cli/submitReview.d.ts +2 -1
- package/dist/halal-core/cli/submitReview.js +3 -3
- package/dist/halal-core/cli/submitReview.js.map +1 -1
- package/dist/halal-core/cli/verifyReview.d.ts +2 -1
- package/dist/halal-core/cli/verifyReview.js +3 -4
- package/dist/halal-core/cli/verifyReview.js.map +1 -1
- package/dist/halal-core/config.d.ts +9 -8
- package/dist/halal-core/config.js +2 -1
- package/dist/halal-core/config.js.map +1 -1
- package/dist/halal-core/crypto/integrity.d.ts +6 -5
- package/dist/halal-core/crypto/integrity.js +2 -1
- package/dist/halal-core/crypto/integrity.js.map +1 -1
- package/dist/halal-core/enforce.d.ts +6 -5
- package/dist/halal-core/enforce.js +13 -15
- package/dist/halal-core/enforce.js.map +1 -1
- package/dist/halal-core/index.js +2 -1
- package/dist/halal-core/lifecycle.d.ts +2 -1
- package/dist/halal-core/lifecycle.js +2 -1
- package/dist/halal-core/lifecycle.js.map +1 -1
- package/dist/halal-core/policy.d.ts +3 -1
- package/dist/halal-core/policy.js +2 -1
- package/dist/halal-core/policy.js.map +1 -1
- package/dist/halal-core/report/formatBrowserOverlay.d.ts +3 -1
- package/dist/halal-core/report/formatBrowserOverlay.js +1 -1
- package/dist/halal-core/report/formatBrowserOverlay.js.map +1 -1
- package/dist/halal-core/report/formatTerminalReport.d.ts +3 -1
- package/dist/halal-core/report/formatTerminalReport.js +1 -1
- package/dist/halal-core/report/formatTerminalReport.js.map +1 -1
- package/dist/halal-core/report/generateHalalReport.d.ts +4 -2
- package/dist/halal-core/report/generateHalalReport.js +5 -7
- package/dist/halal-core/report/generateHalalReport.js.map +1 -1
- package/dist/halal-core/report/signReport.d.ts +4 -2
- package/dist/halal-core/report/signReport.js +2 -1
- package/dist/halal-core/report/signReport.js.map +1 -1
- package/dist/halal-core/report/verifyReport.d.ts +5 -3
- package/dist/halal-core/report/verifyReport.js +4 -3
- package/dist/halal-core/report/verifyReport.js.map +1 -1
- package/dist/halal-core/review/createReviewRequest.d.ts +3 -1
- package/dist/halal-core/review/createReviewRequest.js +3 -3
- package/dist/halal-core/review/createReviewRequest.js.map +1 -1
- package/dist/halal-core/review/reviewPolicy.d.ts +4 -3
- package/dist/halal-core/review/reviewPolicy.js +1 -1
- package/dist/halal-core/review/reviewPolicy.js.map +1 -1
- package/dist/halal-core/review/signedReviewFile.d.ts +6 -4
- package/dist/halal-core/review/signedReviewFile.js +2 -1
- package/dist/halal-core/review/signedReviewFile.js.map +1 -1
- package/dist/halal-core/review/verifyReviewApproval.d.ts +3 -2
- package/dist/halal-core/review/verifyReviewApproval.js +2 -1
- package/dist/halal-core/review/verifyReviewApproval.js.map +1 -1
- package/dist/halal-core/rules/adultContentRules.d.ts +3 -2
- package/dist/halal-core/rules/adultContentRules.js +1 -1
- package/dist/halal-core/rules/adultContentRules.js.map +1 -1
- package/dist/halal-core/rules/alcoholDrugVapeRules.d.ts +3 -2
- package/dist/halal-core/rules/alcoholDrugVapeRules.js +1 -1
- package/dist/halal-core/rules/alcoholDrugVapeRules.js.map +1 -1
- package/dist/halal-core/rules/childSafetyRules.d.ts +3 -2
- package/dist/halal-core/rules/childSafetyRules.js +1 -1
- package/dist/halal-core/rules/childSafetyRules.js.map +1 -1
- package/dist/halal-core/rules/coreCategories.d.ts +3 -2
- package/dist/halal-core/rules/coreCategories.js +1 -1
- package/dist/halal-core/rules/coreCategories.js.map +1 -1
- package/dist/halal-core/rules/cyberAbuseRules.d.ts +3 -2
- package/dist/halal-core/rules/cyberAbuseRules.js +1 -1
- package/dist/halal-core/rules/cyberAbuseRules.js.map +1 -1
- package/dist/halal-core/rules/defaultBlockedRules.d.ts +3 -1
- package/dist/halal-core/rules/defaultBlockedRules.js +9 -11
- package/dist/halal-core/rules/defaultBlockedRules.js.map +1 -1
- package/dist/halal-core/rules/dependencyRules.d.ts +3 -2
- package/dist/halal-core/rules/dependencyRules.js +1 -1
- package/dist/halal-core/rules/dependencyRules.js.map +1 -1
- package/dist/halal-core/rules/endpointRules.d.ts +3 -2
- package/dist/halal-core/rules/endpointRules.js +1 -1
- package/dist/halal-core/rules/endpointRules.js.map +1 -1
- package/dist/halal-core/rules/environmentalHarmRules.d.ts +3 -2
- package/dist/halal-core/rules/environmentalHarmRules.js +1 -1
- package/dist/halal-core/rules/environmentalHarmRules.js.map +1 -1
- package/dist/halal-core/rules/financeRibaRules.d.ts +3 -2
- package/dist/halal-core/rules/financeRibaRules.js +1 -1
- package/dist/halal-core/rules/financeRibaRules.js.map +1 -1
- package/dist/halal-core/rules/gamblingRules.d.ts +3 -2
- package/dist/halal-core/rules/gamblingRules.js +1 -1
- package/dist/halal-core/rules/gamblingRules.js.map +1 -1
- package/dist/halal-core/rules/generalHarmRules.d.ts +3 -2
- package/dist/halal-core/rules/generalHarmRules.js +1 -1
- package/dist/halal-core/rules/generalHarmRules.js.map +1 -1
- package/dist/halal-core/rules/healthHarmRules.d.ts +3 -2
- package/dist/halal-core/rules/healthHarmRules.js +1 -1
- package/dist/halal-core/rules/healthHarmRules.js.map +1 -1
- package/dist/halal-core/rules/keywordRules.d.ts +2 -1
- package/dist/halal-core/rules/keywordRules.js +1 -1
- package/dist/halal-core/rules/keywordRules.js.map +1 -1
- package/dist/halal-core/rules/privacyAbuseRules.d.ts +3 -2
- package/dist/halal-core/rules/privacyAbuseRules.js +1 -1
- package/dist/halal-core/rules/privacyAbuseRules.js.map +1 -1
- package/dist/halal-core/rules/scamFraudRules.d.ts +3 -2
- package/dist/halal-core/rules/scamFraudRules.js +1 -1
- package/dist/halal-core/rules/scamFraudRules.js.map +1 -1
- package/dist/halal-core/rules/selfHarmRules.d.ts +3 -2
- package/dist/halal-core/rules/selfHarmRules.js +1 -1
- package/dist/halal-core/rules/selfHarmRules.js.map +1 -1
- package/dist/halal-core/rules/violenceExtremismRules.d.ts +3 -2
- package/dist/halal-core/rules/violenceExtremismRules.js +1 -1
- package/dist/halal-core/rules/violenceExtremismRules.js.map +1 -1
- package/dist/halal-core/runtime/guard.d.ts +5 -3
- package/dist/halal-core/runtime/guard.js +2 -1
- package/dist/halal-core/runtime/guard.js.map +1 -1
- package/dist/halal-core/runtime/index.js +2 -1
- package/dist/halal-core/runtime/reviewedMemory.d.ts +6 -4
- package/dist/halal-core/runtime/reviewedMemory.js +3 -2
- package/dist/halal-core/runtime/reviewedMemory.js.map +1 -1
- package/dist/halal-core/runtime/serializeRuntimeContent.d.ts +7 -5
- package/dist/halal-core/runtime/serializeRuntimeContent.js +4 -3
- package/dist/halal-core/runtime/serializeRuntimeContent.js.map +1 -1
- package/dist/halal-core/runtime/types.d.ts +11 -9
- package/dist/halal-core/runtime/types.js +1 -1
- package/dist/halal-core/scanner/scanApiRoutes.d.ts +2 -1
- package/dist/halal-core/scanner/scanApiRoutes.js +2 -1
- package/dist/halal-core/scanner/scanApiRoutes.js.map +1 -1
- package/dist/halal-core/scanner/scanComponents.d.ts +2 -1
- package/dist/halal-core/scanner/scanComponents.js +2 -1
- package/dist/halal-core/scanner/scanComponents.js.map +1 -1
- package/dist/halal-core/scanner/scanContent.d.ts +3 -2
- package/dist/halal-core/scanner/scanContent.js +4 -3
- package/dist/halal-core/scanner/scanContent.js.map +1 -1
- package/dist/halal-core/scanner/scanDependencies.d.ts +2 -1
- package/dist/halal-core/scanner/scanDependencies.js +2 -1
- package/dist/halal-core/scanner/scanDependencies.js.map +1 -1
- package/dist/halal-core/scanner/scanDomains.d.ts +2 -1
- package/dist/halal-core/scanner/scanDomains.js +1 -1
- package/dist/halal-core/scanner/scanDomains.js.map +1 -1
- package/dist/halal-core/scanner/scanEnvNames.d.ts +2 -1
- package/dist/halal-core/scanner/scanEnvNames.js +2 -1
- package/dist/halal-core/scanner/scanEnvNames.js.map +1 -1
- package/dist/halal-core/scanner/scanMetadata.d.ts +3 -2
- package/dist/halal-core/scanner/scanMetadata.js +2 -1
- package/dist/halal-core/scanner/scanMetadata.js.map +1 -1
- package/dist/halal-core/scanner/scanPages.d.ts +2 -1
- package/dist/halal-core/scanner/scanPages.js +2 -1
- package/dist/halal-core/scanner/scanPages.js.map +1 -1
- package/dist/halal-core/scanner/scanProject.d.ts +4 -2
- package/dist/halal-core/scanner/scanProject.js +2 -1
- package/dist/halal-core/scanner/scanProject.js.map +1 -1
- package/dist/halal-core/scanner/scanRoutes.d.ts +2 -1
- package/dist/halal-core/scanner/scanRoutes.js +2 -1
- package/dist/halal-core/scanner/scanRoutes.js.map +1 -1
- package/dist/halal-core/scanner/scanTranslations.d.ts +2 -1
- package/dist/halal-core/scanner/scanTranslations.js +2 -1
- package/dist/halal-core/scanner/scanTranslations.js.map +1 -1
- package/dist/halal-core/status.d.ts +3 -2
- package/dist/halal-core/status.js +1 -1
- package/dist/halal-core/tamper/verifyCoreIntegrity.d.ts +2 -1
- package/dist/halal-core/tamper/verifyCoreIntegrity.js +2 -1
- package/dist/halal-core/tamper/verifyCoreIntegrity.js.map +1 -1
- package/dist/halal-core/tamper/verifyLifecycleHooks.d.ts +2 -1
- package/dist/halal-core/tamper/verifyLifecycleHooks.js +1 -1
- package/dist/halal-core/tamper/verifyLifecycleHooks.js.map +1 -1
- package/dist/halal-core/tamper/verifyReportSignature.d.ts +3 -1
- package/dist/halal-core/tamper/verifyReportSignature.js +3 -3
- package/dist/halal-core/tamper/verifyReportSignature.js.map +1 -1
- package/dist/halal.js +2 -1
- package/dist/i18n/index.d.ts +12 -11
- package/dist/i18n/index.js +5 -6
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/shared.d.ts +15 -14
- package/dist/i18n/shared.js +4 -4
- package/dist/i18n/shared.js.map +1 -1
- package/dist/icons/index.d.ts +18 -16
- package/dist/icons/index.js +5 -4
- package/dist/icons/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/kit/index.d.ts +23 -21
- package/dist/kit/index.js +2 -1
- package/dist/kit/index.js.map +1 -1
- package/dist/nitro-server/index.d.ts +3 -2
- package/dist/nitro-server/index.js +1 -1
- package/dist/nitro-server/index.js.map +1 -1
- package/dist/node.d.ts +4 -2
- package/dist/node.js +7 -6
- package/dist/node.js.map +1 -1
- package/dist/reactivity/computed.d.ts +5 -3
- package/dist/reactivity/computed.js +3 -3
- package/dist/reactivity/computed.js.map +1 -1
- package/dist/reactivity/effect.d.ts +15 -13
- package/dist/reactivity/effect.js +9 -10
- package/dist/reactivity/effect.js.map +1 -1
- package/dist/reactivity/index.js +2 -1
- package/dist/reactivity/reactive.d.ts +6 -5
- package/dist/reactivity/reactive.js +5 -4
- package/dist/reactivity/reactive.js.map +1 -1
- package/dist/reactivity/readonly.js +2 -1
- package/dist/reactivity/ref.d.ts +9 -7
- package/dist/reactivity/ref.js +2 -4
- package/dist/reactivity/ref.js.map +1 -1
- package/dist/reactivity/scheduler.d.ts +5 -4
- package/dist/reactivity/scheduler.js +1 -1
- package/dist/reactivity/scheduler.js.map +1 -1
- package/dist/reactivity/types.d.ts +12 -11
- package/dist/reactivity/types.js +1 -1
- package/dist/reactivity/utils.d.ts +10 -9
- package/dist/reactivity/utils.js +1 -1
- package/dist/reactivity/utils.js.map +1 -1
- package/dist/reactivity/watch.d.ts +4 -2
- package/dist/reactivity/watch.js +4 -5
- package/dist/reactivity/watch.js.map +1 -1
- package/dist/runtime/core.d.ts +5 -4
- package/dist/runtime/core.js +9 -10
- package/dist/runtime/core.js.map +1 -1
- package/dist/runtime/index.d.ts +123 -122
- package/dist/runtime/index.js +45 -58
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/reactivity.js +2 -1
- package/dist/runtime/resume.d.ts +15 -14
- package/dist/runtime/resume.js +3 -3
- package/dist/runtime/resume.js.map +1 -1
- package/dist/runtime/router.d.ts +5 -4
- package/dist/runtime/router.js +1 -1
- package/dist/runtime/router.js.map +1 -1
- package/dist/runtime/streaming.d.ts +7 -6
- package/dist/runtime/streaming.js +3 -3
- package/dist/runtime/streaming.js.map +1 -1
- package/dist/security/media-fetch.d.ts +11 -10
- package/dist/security/media-fetch.js +5 -4
- package/dist/security/media-fetch.js.map +1 -1
- package/dist/security/path-boundary.d.ts +5 -4
- package/dist/security/path-boundary.js +2 -1
- package/dist/security/path-boundary.js.map +1 -1
- package/dist/ui/index.d.ts +195 -193
- package/dist/ui/index.js +7 -8
- package/dist/ui/index.js.map +1 -1
- package/dist/vite-builder/index.d.ts +3 -2
- package/dist/vite-builder/index.js +1 -1
- package/dist/vite-builder/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { BuildOptions, BuildResult, ClientEnhancementManifestEntry, CompileErrorLocation, CompiledComponent, CompiledMiddleware, CompiledPlugin, CompiledServerMiddleware, ResuxCompileError, RouteManifestRecord, RouteRuleConfig, ServerHandlerRecord, VueIslandRecord, createRouteManifest, fileUrl, resolveFileExtension } from "./index.js";
|
|
2
2
|
import { normalizeResuxDirectiveSyntax, normalizeResuxSfcSource } from "./directives.js";
|
|
3
|
+
|
|
3
4
|
//#region src/compiler/adapter.d.ts
|
|
4
|
-
|
|
5
|
+
interface ResuxCompileVueSourceOptions {
|
|
5
6
|
file: string;
|
|
6
7
|
id: string;
|
|
7
8
|
name: string;
|
|
8
9
|
/** Enables development-only compiler diagnostics. */
|
|
9
10
|
dev?: boolean;
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
declare function compileVueSource(source: string, options: ResuxCompileVueSourceOptions): CompiledComponent;
|
|
13
|
+
declare function compileVueFile(file: string, options: {
|
|
13
14
|
id: string;
|
|
14
15
|
name?: string;
|
|
15
16
|
dev?: boolean;
|
|
16
17
|
}): Promise<CompiledComponent>;
|
|
17
|
-
|
|
18
|
+
declare function buildProject(appRoot: string, outDir?: string, options?: BuildOptions): Promise<BuildResult>;
|
|
18
19
|
//#endregion
|
|
19
|
-
export { BuildOptions, BuildResult, ClientEnhancementManifestEntry, CompileErrorLocation, CompiledComponent, CompiledMiddleware, CompiledPlugin, CompiledServerMiddleware, ResuxCompileError, RouteManifestRecord, RouteRuleConfig, ServerHandlerRecord, VueIslandRecord, createRouteManifest, fileUrl, normalizeResuxDirectiveSyntax, normalizeResuxSfcSource, resolveFileExtension };
|
|
20
|
+
export { BuildOptions, BuildResult, ClientEnhancementManifestEntry, CompileErrorLocation, CompiledComponent, CompiledMiddleware, CompiledPlugin, CompiledServerMiddleware, ResuxCompileError, ResuxCompileVueSourceOptions, RouteManifestRecord, RouteRuleConfig, ServerHandlerRecord, VueIslandRecord, buildProject, compileVueFile, compileVueSource, createRouteManifest, fileUrl, normalizeResuxDirectiveSyntax, normalizeResuxSfcSource, resolveFileExtension };
|
|
20
21
|
//# sourceMappingURL=adapter.d.ts.map
|
package/dist/compiler/adapter.js
CHANGED
|
@@ -5,6 +5,7 @@ import { syncBuiltinESMExports } from "node:module";
|
|
|
5
5
|
import { promises } from "node:fs";
|
|
6
6
|
import { readFile } from "node:fs/promises";
|
|
7
7
|
import path from "node:path";
|
|
8
|
+
|
|
8
9
|
//#region src/compiler/adapter.ts
|
|
9
10
|
function compileVueSource(source, options) {
|
|
10
11
|
const usesResuxDirectives = source.includes("rx-");
|
|
@@ -75,7 +76,7 @@ async function withResuxDirectiveFileReads(task, emittedDevWarnings) {
|
|
|
75
76
|
function pascalCase(value) {
|
|
76
77
|
return value.replace(/\[[^\]]+\]/g, (match) => match.slice(1, -1)).split(/[^A-Za-z0-9]+/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
77
78
|
}
|
|
79
|
+
|
|
78
80
|
//#endregion
|
|
79
81
|
export { ResuxCompileError, buildProject, compileVueFile, compileVueSource, createRouteManifest, fileUrl, normalizeResuxDirectiveSyntax, normalizeResuxSfcSource, resolveFileExtension };
|
|
80
|
-
|
|
81
82
|
//# sourceMappingURL=adapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","names":["implementation.compileVueSource","implementation.buildProject","fsPromises"],"sources":["../../src/compiler/adapter.ts"],"sourcesContent":["import { promises as fsPromises } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { syncBuiltinESMExports } from \"node:module\";\nimport path from \"node:path\";\nimport * as implementation from \"./implementation.js\";\nimport {\n normalizeResuxSfcSource,\n rethrowWithResuxDirectiveBrand,\n} from \"./directives.js\";\nimport { emitResuxDevWarnings } from \"./dev-warnings.js\";\nimport type { BuildOptions, BuildResult, CompiledComponent } from \"./implementation.js\";\n\nexport * from \"./implementation.js\";\nexport { normalizeResuxDirectiveSyntax, normalizeResuxSfcSource } from \"./directives.js\";\n\nexport interface ResuxCompileVueSourceOptions {\n file: string;\n id: string;\n name: string;\n /** Enables development-only compiler diagnostics. */\n dev?: boolean;\n}\n\nexport function compileVueSource(\n source: string,\n options: ResuxCompileVueSourceOptions,\n): CompiledComponent {\n const usesResuxDirectives = source.includes(\"rx-\");\n\n if (options.dev === true) {\n emitResuxDevWarnings(source, options.file);\n }\n\n try {\n return implementation.compileVueSource(\n normalizeResuxSfcSource(source, options.file),\n {\n file: options.file,\n id: options.id,\n name: options.name,\n },\n );\n } catch (error) {\n if (usesResuxDirectives) {\n return rethrowWithResuxDirectiveBrand(error);\n }\n throw error;\n }\n}\n\nexport async function compileVueFile(\n file: string,\n options: { id: string; name?: string; dev?: boolean },\n): Promise<CompiledComponent> {\n const source = await readFile(file, \"utf8\");\n return compileVueSource(source, {\n file,\n id: options.id,\n name: options.name ?? pascalCase(path.basename(file, \".vue\")),\n dev: options.dev,\n });\n}\n\nlet buildQueue: Promise<void> = Promise.resolve();\nconst emittedBuildDevWarnings = new Set<string>();\n\nexport function buildProject(\n appRoot: string,\n outDir?: string,\n options?: BuildOptions,\n): Promise<BuildResult> {\n return enqueueBuild(async () => {\n const emittedDevWarnings = options?.vite === \"dev\"\n ? emittedBuildDevWarnings\n : undefined;\n\n try {\n return await withResuxDirectiveFileReads(\n () => implementation.buildProject(appRoot, outDir, options),\n emittedDevWarnings,\n );\n } catch (error) {\n return rethrowWithResuxDirectiveBrand(error);\n }\n });\n}\n\nfunction enqueueBuild<T>(task: () => Promise<T>): Promise<T> {\n const run = buildQueue.then(task, task);\n buildQueue = run.then(() => undefined, () => undefined);\n return run;\n}\n\nasync function withResuxDirectiveFileReads<T>(\n task: () => Promise<T>,\n emittedDevWarnings?: Set<string>,\n): Promise<T> {\n const mutableFs = fsPromises as typeof fsPromises & { readFile: typeof fsPromises.readFile };\n const originalReadFile = mutableFs.readFile;\n\n mutableFs.readFile = (async (...args: Parameters<typeof originalReadFile>) => {\n const result = await originalReadFile(...args);\n const file = args[0];\n const filename = typeof file === \"string\"\n ? file\n : file instanceof URL\n ? file.pathname\n : Buffer.isBuffer(file)\n ? file.toString()\n : String(file);\n\n if (!filename.toLowerCase().endsWith(\".vue\")) {\n return result;\n }\n\n if (typeof result === \"string\") {\n if (emittedDevWarnings) {\n emitResuxDevWarnings(result, filename, emittedDevWarnings);\n }\n return normalizeResuxSfcSource(result, filename);\n }\n\n if (Buffer.isBuffer(result)) {\n const source = result.toString(\"utf8\");\n if (emittedDevWarnings) {\n emitResuxDevWarnings(source, filename, emittedDevWarnings);\n }\n return Buffer.from(normalizeResuxSfcSource(source, filename), \"utf8\");\n }\n\n return result;\n }) as typeof originalReadFile;\n\n syncBuiltinESMExports();\n\n try {\n return await task();\n } finally {\n mutableFs.readFile = originalReadFile;\n syncBuiltinESMExports();\n }\n}\n\nfunction pascalCase(value: string): string {\n return value\n .replace(/\\[[^\\]]+\\]/g, (match) => match.slice(1, -1))\n .split(/[^A-Za-z0-9]+/)\n .filter(Boolean)\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(\"\");\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"adapter.js","names":["implementation.compileVueSource","implementation.buildProject","fsPromises"],"sources":["../../src/compiler/adapter.ts"],"sourcesContent":["import { promises as fsPromises } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { syncBuiltinESMExports } from \"node:module\";\nimport path from \"node:path\";\nimport * as implementation from \"./implementation.js\";\nimport {\n normalizeResuxSfcSource,\n rethrowWithResuxDirectiveBrand,\n} from \"./directives.js\";\nimport { emitResuxDevWarnings } from \"./dev-warnings.js\";\nimport type { BuildOptions, BuildResult, CompiledComponent } from \"./implementation.js\";\n\nexport * from \"./implementation.js\";\nexport { normalizeResuxDirectiveSyntax, normalizeResuxSfcSource } from \"./directives.js\";\n\nexport interface ResuxCompileVueSourceOptions {\n file: string;\n id: string;\n name: string;\n /** Enables development-only compiler diagnostics. */\n dev?: boolean;\n}\n\nexport function compileVueSource(\n source: string,\n options: ResuxCompileVueSourceOptions,\n): CompiledComponent {\n const usesResuxDirectives = source.includes(\"rx-\");\n\n if (options.dev === true) {\n emitResuxDevWarnings(source, options.file);\n }\n\n try {\n return implementation.compileVueSource(\n normalizeResuxSfcSource(source, options.file),\n {\n file: options.file,\n id: options.id,\n name: options.name,\n },\n );\n } catch (error) {\n if (usesResuxDirectives) {\n return rethrowWithResuxDirectiveBrand(error);\n }\n throw error;\n }\n}\n\nexport async function compileVueFile(\n file: string,\n options: { id: string; name?: string; dev?: boolean },\n): Promise<CompiledComponent> {\n const source = await readFile(file, \"utf8\");\n return compileVueSource(source, {\n file,\n id: options.id,\n name: options.name ?? pascalCase(path.basename(file, \".vue\")),\n dev: options.dev,\n });\n}\n\nlet buildQueue: Promise<void> = Promise.resolve();\nconst emittedBuildDevWarnings = new Set<string>();\n\nexport function buildProject(\n appRoot: string,\n outDir?: string,\n options?: BuildOptions,\n): Promise<BuildResult> {\n return enqueueBuild(async () => {\n const emittedDevWarnings = options?.vite === \"dev\"\n ? emittedBuildDevWarnings\n : undefined;\n\n try {\n return await withResuxDirectiveFileReads(\n () => implementation.buildProject(appRoot, outDir, options),\n emittedDevWarnings,\n );\n } catch (error) {\n return rethrowWithResuxDirectiveBrand(error);\n }\n });\n}\n\nfunction enqueueBuild<T>(task: () => Promise<T>): Promise<T> {\n const run = buildQueue.then(task, task);\n buildQueue = run.then(() => undefined, () => undefined);\n return run;\n}\n\nasync function withResuxDirectiveFileReads<T>(\n task: () => Promise<T>,\n emittedDevWarnings?: Set<string>,\n): Promise<T> {\n const mutableFs = fsPromises as typeof fsPromises & { readFile: typeof fsPromises.readFile };\n const originalReadFile = mutableFs.readFile;\n\n mutableFs.readFile = (async (...args: Parameters<typeof originalReadFile>) => {\n const result = await originalReadFile(...args);\n const file = args[0];\n const filename = typeof file === \"string\"\n ? file\n : file instanceof URL\n ? file.pathname\n : Buffer.isBuffer(file)\n ? file.toString()\n : String(file);\n\n if (!filename.toLowerCase().endsWith(\".vue\")) {\n return result;\n }\n\n if (typeof result === \"string\") {\n if (emittedDevWarnings) {\n emitResuxDevWarnings(result, filename, emittedDevWarnings);\n }\n return normalizeResuxSfcSource(result, filename);\n }\n\n if (Buffer.isBuffer(result)) {\n const source = result.toString(\"utf8\");\n if (emittedDevWarnings) {\n emitResuxDevWarnings(source, filename, emittedDevWarnings);\n }\n return Buffer.from(normalizeResuxSfcSource(source, filename), \"utf8\");\n }\n\n return result;\n }) as typeof originalReadFile;\n\n syncBuiltinESMExports();\n\n try {\n return await task();\n } finally {\n mutableFs.readFile = originalReadFile;\n syncBuiltinESMExports();\n }\n}\n\nfunction pascalCase(value: string): string {\n return value\n .replace(/\\[[^\\]]+\\]/g, (match) => match.slice(1, -1))\n .split(/[^A-Za-z0-9]+/)\n .filter(Boolean)\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(\"\");\n}\n"],"mappings":";;;;;;;;;AAuBA,SAAgB,iBACd,QACA,SACmB;CACnB,MAAM,sBAAsB,OAAO,SAAS,MAAM;AAElD,KAAI,QAAQ,QAAQ,KAClB,sBAAqB,QAAQ,QAAQ,KAAK;AAG5C,KAAI;AACF,SAAOA,mBACL,wBAAwB,QAAQ,QAAQ,KAAK,EAC7C;GACE,MAAM,QAAQ;GACd,IAAI,QAAQ;GACZ,MAAM,QAAQ;GACf,CACF;UACM,OAAO;AACd,MAAI,oBACF,QAAO,+BAA+B,MAAM;AAE9C,QAAM;;;AAIV,eAAsB,eACpB,MACA,SAC4B;AAE5B,QAAO,iBADQ,MAAM,SAAS,MAAM,OAAO,EACX;EAC9B;EACA,IAAI,QAAQ;EACZ,MAAM,QAAQ,QAAQ,WAAW,KAAK,SAAS,MAAM,OAAO,CAAC;EAC7D,KAAK,QAAQ;EACd,CAAC;;AAGJ,IAAI,aAA4B,QAAQ,SAAS;AACjD,MAAM,0CAA0B,IAAI,KAAa;AAEjD,SAAgB,aACd,SACA,QACA,SACsB;AACtB,QAAO,aAAa,YAAY;EAC9B,MAAM,qBAAqB,SAAS,SAAS,QACzC,0BACA;AAEJ,MAAI;AACF,UAAO,MAAM,kCACLC,eAA4B,SAAS,QAAQ,QAAQ,EAC3D,mBACD;WACM,OAAO;AACd,UAAO,+BAA+B,MAAM;;GAE9C;;AAGJ,SAAS,aAAgB,MAAoC;CAC3D,MAAM,MAAM,WAAW,KAAK,MAAM,KAAK;AACvC,cAAa,IAAI,WAAW,cAAiB,OAAU;AACvD,QAAO;;AAGT,eAAe,4BACb,MACA,oBACY;CACZ,MAAM,YAAYC;CAClB,MAAM,mBAAmB,UAAU;AAEnC,WAAU,YAAY,OAAO,GAAG,SAA8C;EAC5E,MAAM,SAAS,MAAM,iBAAiB,GAAG,KAAK;EAC9C,MAAM,OAAO,KAAK;EAClB,MAAM,WAAW,OAAO,SAAS,WAC7B,OACA,gBAAgB,MACd,KAAK,WACL,OAAO,SAAS,KAAK,GACnB,KAAK,UAAU,GACf,OAAO,KAAK;AAEpB,MAAI,CAAC,SAAS,aAAa,CAAC,SAAS,OAAO,CAC1C,QAAO;AAGT,MAAI,OAAO,WAAW,UAAU;AAC9B,OAAI,mBACF,sBAAqB,QAAQ,UAAU,mBAAmB;AAE5D,UAAO,wBAAwB,QAAQ,SAAS;;AAGlD,MAAI,OAAO,SAAS,OAAO,EAAE;GAC3B,MAAM,SAAS,OAAO,SAAS,OAAO;AACtC,OAAI,mBACF,sBAAqB,QAAQ,UAAU,mBAAmB;AAE5D,UAAO,OAAO,KAAK,wBAAwB,QAAQ,SAAS,EAAE,OAAO;;AAGvE,SAAO;;AAGT,wBAAuB;AAEvB,KAAI;AACF,SAAO,MAAM,MAAM;WACX;AACR,YAAU,WAAW;AACrB,yBAAuB;;;AAI3B,SAAS,WAAW,OAAuB;AACzC,QAAO,MACJ,QAAQ,gBAAgB,UAAU,MAAM,MAAM,GAAG,GAAG,CAAC,CACrD,MAAM,gBAAgB,CACtB,OAAO,QAAQ,CACf,KAAK,SAAS,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE,CAAC,CAC3D,KAAK,GAAG"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
//#region src/compiler/dev-warnings.d.ts
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type ResuxDevWarningCode = "RX_EVENT_INLINE_ATTRIBUTE" | "RX_EVENT_DIRECT_LISTENER";
|
|
3
|
+
interface ResuxDevWarning {
|
|
4
4
|
code: ResuxDevWarningCode;
|
|
5
5
|
file: string;
|
|
6
6
|
line: number;
|
|
7
7
|
column: number;
|
|
8
8
|
message: string;
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
declare function collectResuxDevWarnings(source: string, file?: string): ResuxDevWarning[];
|
|
11
|
+
declare function emitResuxDevWarnings(source: string, file: string, emitted?: Set<string>): void;
|
|
12
|
+
declare function formatResuxDevWarning(warning: ResuxDevWarning): string;
|
|
13
13
|
//#endregion
|
|
14
|
+
export { ResuxDevWarning, ResuxDevWarningCode, collectResuxDevWarnings, emitResuxDevWarnings, formatResuxDevWarning };
|
|
14
15
|
//# sourceMappingURL=dev-warnings.d.ts.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
import { NodeTypes, parse } from "@vue/compiler-dom";
|
|
3
3
|
import { parse as parse$1 } from "@vue/compiler-sfc";
|
|
4
|
+
|
|
4
5
|
//#region src/compiler/dev-warnings.ts
|
|
5
|
-
const INLINE_DOM_EVENT_ATTRIBUTES =
|
|
6
|
+
const INLINE_DOM_EVENT_ATTRIBUTES = new Set([
|
|
6
7
|
"onabort",
|
|
7
8
|
"onanimationcancel",
|
|
8
9
|
"onanimationend",
|
|
@@ -98,7 +99,7 @@ const INLINE_DOM_EVENT_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
|
98
99
|
"onwaiting",
|
|
99
100
|
"onwheel"
|
|
100
101
|
]);
|
|
101
|
-
const DOM_QUERY_METHODS =
|
|
102
|
+
const DOM_QUERY_METHODS = new Set([
|
|
102
103
|
"getElementById",
|
|
103
104
|
"getElementsByClassName",
|
|
104
105
|
"getElementsByName",
|
|
@@ -107,7 +108,7 @@ const DOM_QUERY_METHODS = /* @__PURE__ */ new Set([
|
|
|
107
108
|
"querySelector",
|
|
108
109
|
"querySelectorAll"
|
|
109
110
|
]);
|
|
110
|
-
const GLOBAL_EVENT_TARGETS =
|
|
111
|
+
const GLOBAL_EVENT_TARGETS = new Set([
|
|
111
112
|
"document",
|
|
112
113
|
"globalThis",
|
|
113
114
|
"window"
|
|
@@ -204,8 +205,8 @@ function isLikelyDomElement(expression, domTargets) {
|
|
|
204
205
|
if (ts.isCallExpression(value)) return isDomQueryExpression(value);
|
|
205
206
|
if (ts.isPropertyAccessExpression(value)) {
|
|
206
207
|
if (value.name.text === "value") {
|
|
207
|
-
const root = rootIdentifier(value.expression);
|
|
208
|
-
return Boolean(root && domTargets.has(root));
|
|
208
|
+
const root$1 = rootIdentifier(value.expression);
|
|
209
|
+
return Boolean(root$1 && domTargets.has(root$1));
|
|
209
210
|
}
|
|
210
211
|
const root = rootIdentifier(value);
|
|
211
212
|
return Boolean(root && domTargets.has(root));
|
|
@@ -281,7 +282,7 @@ function dedupeWarnings(warnings) {
|
|
|
281
282
|
return true;
|
|
282
283
|
});
|
|
283
284
|
}
|
|
285
|
+
|
|
284
286
|
//#endregion
|
|
285
287
|
export { collectResuxDevWarnings, emitResuxDevWarnings, formatResuxDevWarning };
|
|
286
|
-
|
|
287
288
|
//# sourceMappingURL=dev-warnings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-warnings.js","names":["parseSfc","parseTemplate"],"sources":["../../src/compiler/dev-warnings.ts"],"sourcesContent":["import { NodeTypes, parse as parseTemplate, type ElementNode, type RootNode, type TemplateChildNode } from \"@vue/compiler-dom\";\nimport { parse as parseSfc, type SFCBlock } from \"@vue/compiler-sfc\";\nimport ts from \"typescript\";\n\nexport type ResuxDevWarningCode =\n | \"RX_EVENT_INLINE_ATTRIBUTE\"\n | \"RX_EVENT_DIRECT_LISTENER\";\n\nexport interface ResuxDevWarning {\n code: ResuxDevWarningCode;\n file: string;\n line: number;\n column: number;\n message: string;\n}\n\nconst INLINE_DOM_EVENT_ATTRIBUTES = new Set([\n \"onabort\",\n \"onanimationcancel\",\n \"onanimationend\",\n \"onanimationiteration\",\n \"onanimationstart\",\n \"onauxclick\",\n \"onbeforeinput\",\n \"onbeforetoggle\",\n \"onblur\",\n \"oncancel\",\n \"oncanplay\",\n \"oncanplaythrough\",\n \"onchange\",\n \"onclick\",\n \"onclose\",\n \"oncontextmenu\",\n \"oncopy\",\n \"oncut\",\n \"ondblclick\",\n \"ondrag\",\n \"ondragend\",\n \"ondragenter\",\n \"ondragleave\",\n \"ondragover\",\n \"ondragstart\",\n \"ondrop\",\n \"ondurationchange\",\n \"onemptied\",\n \"onended\",\n \"onerror\",\n \"onfocus\",\n \"onfocusin\",\n \"onfocusout\",\n \"onformdata\",\n \"onfullscreenchange\",\n \"onfullscreenerror\",\n \"ongotpointercapture\",\n \"oninput\",\n \"oninvalid\",\n \"onkeydown\",\n \"onkeypress\",\n \"onkeyup\",\n \"onload\",\n \"onloadeddata\",\n \"onloadedmetadata\",\n \"onloadstart\",\n \"onlostpointercapture\",\n \"onmousedown\",\n \"onmouseenter\",\n \"onmouseleave\",\n \"onmousemove\",\n \"onmouseout\",\n \"onmouseover\",\n \"onmouseup\",\n \"onpaste\",\n \"onpause\",\n \"onplay\",\n \"onplaying\",\n \"onpointercancel\",\n \"onpointerdown\",\n \"onpointerenter\",\n \"onpointerleave\",\n \"onpointermove\",\n \"onpointerout\",\n \"onpointerover\",\n \"onpointerup\",\n \"onprogress\",\n \"onratechange\",\n \"onreset\",\n \"onresize\",\n \"onscroll\",\n \"onscrollend\",\n \"onseeked\",\n \"onseeking\",\n \"onselect\",\n \"onselectionchange\",\n \"onselectstart\",\n \"onslotchange\",\n \"onstalled\",\n \"onsubmit\",\n \"onsuspend\",\n \"ontimeupdate\",\n \"ontoggle\",\n \"ontouchcancel\",\n \"ontouchend\",\n \"ontouchmove\",\n \"ontouchstart\",\n \"ontransitioncancel\",\n \"ontransitionend\",\n \"ontransitionrun\",\n \"ontransitionstart\",\n \"onvolumechange\",\n \"onwaiting\",\n \"onwheel\",\n]);\n\nconst DOM_QUERY_METHODS = new Set([\n \"getElementById\",\n \"getElementsByClassName\",\n \"getElementsByName\",\n \"getElementsByTagName\",\n \"getElementsByTagNameNS\",\n \"querySelector\",\n \"querySelectorAll\",\n]);\n\nconst GLOBAL_EVENT_TARGETS = new Set([\"document\", \"globalThis\", \"window\"]);\n\nexport function collectResuxDevWarnings(source: string, file = \"component.vue\"): ResuxDevWarning[] {\n if (!isNormalResuxComponent(file)) {\n return [];\n }\n\n try {\n const parsed = parseSfc(source, { filename: file });\n if (parsed.errors.length > 0) {\n return [];\n }\n\n const warnings: ResuxDevWarning[] = [];\n const templateRefs = new Set<string>();\n const template = parsed.descriptor.template;\n\n if (template) {\n collectTemplateWarnings(source, file, template, templateRefs, warnings);\n }\n\n for (const block of [parsed.descriptor.script, parsed.descriptor.scriptSetup]) {\n if (block) {\n collectScriptWarnings(source, file, block, templateRefs, warnings);\n }\n }\n\n return dedupeWarnings(warnings);\n } catch {\n // Development diagnostics must never make a valid compilation fail.\n return [];\n }\n}\n\nexport function emitResuxDevWarnings(\n source: string,\n file: string,\n emitted = new Set<string>(),\n): void {\n for (const warning of collectResuxDevWarnings(source, file)) {\n const key = `${warning.code}:${warning.file}:${warning.line}:${warning.column}:${warning.message}`;\n if (emitted.has(key)) {\n continue;\n }\n emitted.add(key);\n console.warn(formatResuxDevWarning(warning));\n }\n}\n\nexport function formatResuxDevWarning(warning: ResuxDevWarning): string {\n return `[Resux dev:${warning.code}] ${warning.file}:${warning.line}:${warning.column} ${warning.message}`;\n}\n\nfunction collectTemplateWarnings(\n source: string,\n file: string,\n block: SFCBlock,\n templateRefs: Set<string>,\n warnings: ResuxDevWarning[],\n): void {\n const contentOffset = resolveBlockContentOffset(source, block);\n if (contentOffset < 0) {\n return;\n }\n\n const root = parseTemplate(block.content, { comments: false });\n visitTemplateChildren(root, (element) => {\n for (const property of element.props) {\n if (property.type !== NodeTypes.ATTRIBUTE) {\n continue;\n }\n\n const attributeName = property.name.toLowerCase();\n if (attributeName === \"ref\" && property.value?.content) {\n templateRefs.add(property.value.content);\n }\n\n if (!INLINE_DOM_EVENT_ATTRIBUTES.has(attributeName)) {\n continue;\n }\n\n const eventName = attributeName.slice(2);\n const location = locate(source, contentOffset + property.loc.start.offset);\n warnings.push({\n code: \"RX_EVENT_INLINE_ATTRIBUTE\",\n file,\n ...location,\n message: `Inline DOM handler \\`${property.name}\\` bypasses Resux event delegation. Use \\`@${eventName}\\` or \\`rx-on:${eventName}\\` instead.`,\n });\n }\n });\n}\n\nfunction collectScriptWarnings(\n source: string,\n file: string,\n block: SFCBlock,\n templateRefs: ReadonlySet<string>,\n warnings: ResuxDevWarning[],\n): void {\n const contentOffset = resolveBlockContentOffset(source, block);\n if (contentOffset < 0) {\n return;\n }\n\n const sourceFile = ts.createSourceFile(\n file,\n block.content,\n ts.ScriptTarget.Latest,\n true,\n scriptKindFor(block.lang),\n );\n const domTargets = new Set(templateRefs);\n\n walk(sourceFile, (node) => {\n if (!ts.isVariableDeclaration(node) || !ts.isIdentifier(node.name)) {\n return;\n }\n\n if (\n templateRefs.has(node.name.text)\n || typeLooksLikeDomElement(node.type, sourceFile)\n || isDomQueryExpression(node.initializer)\n ) {\n domTargets.add(node.name.text);\n }\n });\n\n walk(sourceFile, (node) => {\n if (!ts.isCallExpression(node) || !ts.isPropertyAccessExpression(node.expression)) {\n return;\n }\n if (node.expression.name.text !== \"addEventListener\") {\n return;\n }\n\n const receiver = unwrapExpression(node.expression.expression);\n if (isGlobalEventTarget(receiver) || !isLikelyDomElement(receiver, domTargets)) {\n return;\n }\n\n const eventName = readStringLiteral(node.arguments[0]);\n const eventLabel = eventName && /^[a-z][\\w:-]*$/i.test(eventName)\n ? `@${eventName}`\n : \"a template @event handler\";\n const listenerLabel = eventName\n ? `addEventListener(\"${eventName}\")`\n : \"addEventListener\";\n const location = locate(source, contentOffset + node.expression.name.getStart(sourceFile));\n warnings.push({\n code: \"RX_EVENT_DIRECT_LISTENER\",\n file,\n ...location,\n message: `Direct DOM \\`${listenerLabel}\\` bypasses Resux's resumable event delegation. Prefer \\`${eventLabel}\\` on the template element. Keep direct listeners for global or third-party EventTargets and always remove manually managed listeners during cleanup.`,\n });\n });\n}\n\nfunction visitTemplateChildren(\n root: RootNode,\n visit: (element: ElementNode) => void,\n): void {\n const traverse = (children: TemplateChildNode[]): void => {\n for (const child of children) {\n if (child.type !== NodeTypes.ELEMENT) {\n continue;\n }\n visit(child);\n traverse(child.children);\n }\n };\n\n traverse(root.children);\n}\n\nfunction walk(node: ts.Node, visit: (node: ts.Node) => void): void {\n visit(node);\n node.forEachChild((child) => walk(child, visit));\n}\n\nfunction isLikelyDomElement(expression: ts.Expression, domTargets: ReadonlySet<string>): boolean {\n const value = unwrapExpression(expression);\n\n if (ts.isIdentifier(value)) {\n return domTargets.has(value.text);\n }\n\n if (ts.isCallExpression(value)) {\n return isDomQueryExpression(value);\n }\n\n if (ts.isPropertyAccessExpression(value)) {\n if (value.name.text === \"value\") {\n const root = rootIdentifier(value.expression);\n return Boolean(root && domTargets.has(root));\n }\n const root = rootIdentifier(value);\n return Boolean(root && domTargets.has(root));\n }\n\n if (ts.isElementAccessExpression(value)) {\n const root = rootIdentifier(value.expression);\n return Boolean(root && domTargets.has(root));\n }\n\n return false;\n}\n\nfunction isGlobalEventTarget(expression: ts.Expression): boolean {\n const root = rootIdentifier(expression);\n return Boolean(root && GLOBAL_EVENT_TARGETS.has(root));\n}\n\nfunction rootIdentifier(expression: ts.Expression): string | undefined {\n const value = unwrapExpression(expression);\n if (ts.isIdentifier(value)) {\n return value.text;\n }\n if (ts.isPropertyAccessExpression(value) || ts.isElementAccessExpression(value)) {\n return rootIdentifier(value.expression);\n }\n return undefined;\n}\n\nfunction isDomQueryExpression(expression: ts.Expression | undefined): boolean {\n if (!expression) {\n return false;\n }\n const value = unwrapExpression(expression);\n if (!ts.isCallExpression(value) || !ts.isPropertyAccessExpression(value.expression)) {\n return false;\n }\n if (!DOM_QUERY_METHODS.has(value.expression.name.text)) {\n return false;\n }\n const root = rootIdentifier(value.expression.expression);\n return root === \"document\";\n}\n\nfunction typeLooksLikeDomElement(type: ts.TypeNode | undefined, sourceFile: ts.SourceFile): boolean {\n if (!type) {\n return false;\n }\n return /\\b(?:Element|[A-Z][A-Za-z0-9]*Element)\\b/.test(type.getText(sourceFile));\n}\n\nfunction readStringLiteral(node: ts.Expression | undefined): string | undefined {\n if (!node) {\n return undefined;\n }\n return ts.isStringLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node)\n ? node.text\n : undefined;\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let value = expression;\n while (\n ts.isParenthesizedExpression(value)\n || ts.isAsExpression(value)\n || ts.isTypeAssertionExpression(value)\n || ts.isNonNullExpression(value)\n || ts.isSatisfiesExpression(value)\n ) {\n value = value.expression;\n }\n return value;\n}\n\nfunction scriptKindFor(lang: string | undefined): ts.ScriptKind {\n switch (lang?.toLowerCase()) {\n case \"js\":\n return ts.ScriptKind.JS;\n case \"jsx\":\n return ts.ScriptKind.JSX;\n case \"tsx\":\n return ts.ScriptKind.TSX;\n default:\n return ts.ScriptKind.TS;\n }\n}\n\nfunction resolveBlockContentOffset(source: string, block: SFCBlock): number {\n const reportedOffset = block.loc.start.offset;\n if (source.slice(reportedOffset, reportedOffset + block.content.length) === block.content) {\n return reportedOffset;\n }\n const fallback = source.indexOf(block.content, Math.max(0, reportedOffset));\n return fallback >= 0 ? fallback : source.indexOf(block.content);\n}\n\nfunction locate(source: string, offset: number): { line: number; column: number } {\n const safeOffset = Math.max(0, Math.min(offset, source.length));\n const before = source.slice(0, safeOffset);\n const lastNewline = before.lastIndexOf(\"\\n\");\n return {\n line: before.split(\"\\n\").length,\n column: safeOffset - lastNewline,\n };\n}\n\nfunction isNormalResuxComponent(file: string): boolean {\n const normalized = file.replaceAll(\"\\\\\", \"/\").toLowerCase();\n return normalized.endsWith(\".vue\")\n && !/(?:^|\\/)node_modules\\//.test(normalized)\n && !/(?:^|\\/)islands\\/vue\\//.test(normalized);\n}\n\nfunction dedupeWarnings(warnings: ResuxDevWarning[]): ResuxDevWarning[] {\n const seen = new Set<string>();\n return warnings.filter((warning) => {\n const key = `${warning.code}:${warning.line}:${warning.column}:${warning.message}`;\n if (seen.has(key)) {\n return false;\n }\n seen.add(key);\n return true;\n });\n}\n"],"mappings":";;;;AAgBA,MAAM,8CAA8B,IAAI,IAAI;CAC1C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,oCAAoB,IAAI,IAAI;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,uCAAuB,IAAI,IAAI;CAAC;CAAY;CAAc;AAAQ,CAAC;AAEzE,SAAgB,wBAAwB,QAAgB,OAAO,iBAAoC;CACjG,IAAI,CAAC,uBAAuB,IAAI,GAC9B,OAAO,CAAC;CAGV,IAAI;EACF,MAAM,SAASA,QAAS,QAAQ,EAAE,UAAU,KAAK,CAAC;EAClD,IAAI,OAAO,OAAO,SAAS,GACzB,OAAO,CAAC;EAGV,MAAM,WAA8B,CAAC;EACrC,MAAM,+BAAe,IAAI,IAAY;EACrC,MAAM,WAAW,OAAO,WAAW;EAEnC,IAAI,UACF,wBAAwB,QAAQ,MAAM,UAAU,cAAc,QAAQ;EAGxE,KAAK,MAAM,SAAS,CAAC,OAAO,WAAW,QAAQ,OAAO,WAAW,WAAW,GAC1E,IAAI,OACF,sBAAsB,QAAQ,MAAM,OAAO,cAAc,QAAQ;EAIrE,OAAO,eAAe,QAAQ;CAChC,QAAQ;EAEN,OAAO,CAAC;CACV;AACF;AAEA,SAAg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M,OAAO,MAAM,IAAI,CAAC,CAAC;EACzB,QAAQ,aAAa;CACvB;AACF;AAEA,SAAS,uBAAuB,MAAuB;CACrD,MAAM,aAAa,KAAK,WAAW,MAAM,GAAG,CAAC,CAAC,YAAY;CAC1D,OAAO,WAAW,SAAS,MAAM,KAC5B,CAAC,yBAAyB,KAAK,UAAU,KACzC,CAAC,yBAAyB,KAAK,UAAU;AAChD;AAEA,SAAS,eAAe,UAAgD;CACtE,MAAM,uBAAO,IAAI,IAAY;CAC7B,OAAO,SAAS,QAAQ,YAAY;EAClC,MAAM,MAAM,GAAG,QAAQ,KAAK,GAAG,QAAQ,KAAK,GAAG,QAAQ,OAAO,GAAG,QAAQ;EACzE,IAAI,KAAK,IAAI,GAAG,GACd,OAAO;EAET,KAAK,IAAI,GAAG;EACZ,OAAO;CACT,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"dev-warnings.js","names":["parseSfc","parseTemplate","root"],"sources":["../../src/compiler/dev-warnings.ts"],"sourcesContent":["import { NodeTypes, parse as parseTemplate, type ElementNode, type RootNode, type TemplateChildNode } from \"@vue/compiler-dom\";\nimport { parse as parseSfc, type SFCBlock } from \"@vue/compiler-sfc\";\nimport ts from \"typescript\";\n\nexport type ResuxDevWarningCode =\n | \"RX_EVENT_INLINE_ATTRIBUTE\"\n | \"RX_EVENT_DIRECT_LISTENER\";\n\nexport interface ResuxDevWarning {\n code: ResuxDevWarningCode;\n file: string;\n line: number;\n column: number;\n message: string;\n}\n\nconst INLINE_DOM_EVENT_ATTRIBUTES = new Set([\n \"onabort\",\n \"onanimationcancel\",\n \"onanimationend\",\n \"onanimationiteration\",\n \"onanimationstart\",\n \"onauxclick\",\n \"onbeforeinput\",\n \"onbeforetoggle\",\n \"onblur\",\n \"oncancel\",\n \"oncanplay\",\n \"oncanplaythrough\",\n \"onchange\",\n \"onclick\",\n \"onclose\",\n \"oncontextmenu\",\n \"oncopy\",\n \"oncut\",\n \"ondblclick\",\n \"ondrag\",\n \"ondragend\",\n \"ondragenter\",\n \"ondragleave\",\n \"ondragover\",\n \"ondragstart\",\n \"ondrop\",\n \"ondurationchange\",\n \"onemptied\",\n \"onended\",\n \"onerror\",\n \"onfocus\",\n \"onfocusin\",\n \"onfocusout\",\n \"onformdata\",\n \"onfullscreenchange\",\n \"onfullscreenerror\",\n \"ongotpointercapture\",\n \"oninput\",\n \"oninvalid\",\n \"onkeydown\",\n \"onkeypress\",\n \"onkeyup\",\n \"onload\",\n \"onloadeddata\",\n \"onloadedmetadata\",\n \"onloadstart\",\n \"onlostpointercapture\",\n \"onmousedown\",\n \"onmouseenter\",\n \"onmouseleave\",\n \"onmousemove\",\n \"onmouseout\",\n \"onmouseover\",\n \"onmouseup\",\n \"onpaste\",\n \"onpause\",\n \"onplay\",\n \"onplaying\",\n \"onpointercancel\",\n \"onpointerdown\",\n \"onpointerenter\",\n \"onpointerleave\",\n \"onpointermove\",\n \"onpointerout\",\n \"onpointerover\",\n \"onpointerup\",\n \"onprogress\",\n \"onratechange\",\n \"onreset\",\n \"onresize\",\n \"onscroll\",\n \"onscrollend\",\n \"onseeked\",\n \"onseeking\",\n \"onselect\",\n \"onselectionchange\",\n \"onselectstart\",\n \"onslotchange\",\n \"onstalled\",\n \"onsubmit\",\n \"onsuspend\",\n \"ontimeupdate\",\n \"ontoggle\",\n \"ontouchcancel\",\n \"ontouchend\",\n \"ontouchmove\",\n \"ontouchstart\",\n \"ontransitioncancel\",\n \"ontransitionend\",\n \"ontransitionrun\",\n \"ontransitionstart\",\n \"onvolumechange\",\n \"onwaiting\",\n \"onwheel\",\n]);\n\nconst DOM_QUERY_METHODS = new Set([\n \"getElementById\",\n \"getElementsByClassName\",\n \"getElementsByName\",\n \"getElementsByTagName\",\n \"getElementsByTagNameNS\",\n \"querySelector\",\n \"querySelectorAll\",\n]);\n\nconst GLOBAL_EVENT_TARGETS = new Set([\"document\", \"globalThis\", \"window\"]);\n\nexport function collectResuxDevWarnings(source: string, file = \"component.vue\"): ResuxDevWarning[] {\n if (!isNormalResuxComponent(file)) {\n return [];\n }\n\n try {\n const parsed = parseSfc(source, { filename: file });\n if (parsed.errors.length > 0) {\n return [];\n }\n\n const warnings: ResuxDevWarning[] = [];\n const templateRefs = new Set<string>();\n const template = parsed.descriptor.template;\n\n if (template) {\n collectTemplateWarnings(source, file, template, templateRefs, warnings);\n }\n\n for (const block of [parsed.descriptor.script, parsed.descriptor.scriptSetup]) {\n if (block) {\n collectScriptWarnings(source, file, block, templateRefs, warnings);\n }\n }\n\n return dedupeWarnings(warnings);\n } catch {\n // Development diagnostics must never make a valid compilation fail.\n return [];\n }\n}\n\nexport function emitResuxDevWarnings(\n source: string,\n file: string,\n emitted = new Set<string>(),\n): void {\n for (const warning of collectResuxDevWarnings(source, file)) {\n const key = `${warning.code}:${warning.file}:${warning.line}:${warning.column}:${warning.message}`;\n if (emitted.has(key)) {\n continue;\n }\n emitted.add(key);\n console.warn(formatResuxDevWarning(warning));\n }\n}\n\nexport function formatResuxDevWarning(warning: ResuxDevWarning): string {\n return `[Resux dev:${warning.code}] ${warning.file}:${warning.line}:${warning.column} ${warning.message}`;\n}\n\nfunction collectTemplateWarnings(\n source: string,\n file: string,\n block: SFCBlock,\n templateRefs: Set<string>,\n warnings: ResuxDevWarning[],\n): void {\n const contentOffset = resolveBlockContentOffset(source, block);\n if (contentOffset < 0) {\n return;\n }\n\n const root = parseTemplate(block.content, { comments: false });\n visitTemplateChildren(root, (element) => {\n for (const property of element.props) {\n if (property.type !== NodeTypes.ATTRIBUTE) {\n continue;\n }\n\n const attributeName = property.name.toLowerCase();\n if (attributeName === \"ref\" && property.value?.content) {\n templateRefs.add(property.value.content);\n }\n\n if (!INLINE_DOM_EVENT_ATTRIBUTES.has(attributeName)) {\n continue;\n }\n\n const eventName = attributeName.slice(2);\n const location = locate(source, contentOffset + property.loc.start.offset);\n warnings.push({\n code: \"RX_EVENT_INLINE_ATTRIBUTE\",\n file,\n ...location,\n message: `Inline DOM handler \\`${property.name}\\` bypasses Resux event delegation. Use \\`@${eventName}\\` or \\`rx-on:${eventName}\\` instead.`,\n });\n }\n });\n}\n\nfunction collectScriptWarnings(\n source: string,\n file: string,\n block: SFCBlock,\n templateRefs: ReadonlySet<string>,\n warnings: ResuxDevWarning[],\n): void {\n const contentOffset = resolveBlockContentOffset(source, block);\n if (contentOffset < 0) {\n return;\n }\n\n const sourceFile = ts.createSourceFile(\n file,\n block.content,\n ts.ScriptTarget.Latest,\n true,\n scriptKindFor(block.lang),\n );\n const domTargets = new Set(templateRefs);\n\n walk(sourceFile, (node) => {\n if (!ts.isVariableDeclaration(node) || !ts.isIdentifier(node.name)) {\n return;\n }\n\n if (\n templateRefs.has(node.name.text)\n || typeLooksLikeDomElement(node.type, sourceFile)\n || isDomQueryExpression(node.initializer)\n ) {\n domTargets.add(node.name.text);\n }\n });\n\n walk(sourceFile, (node) => {\n if (!ts.isCallExpression(node) || !ts.isPropertyAccessExpression(node.expression)) {\n return;\n }\n if (node.expression.name.text !== \"addEventListener\") {\n return;\n }\n\n const receiver = unwrapExpression(node.expression.expression);\n if (isGlobalEventTarget(receiver) || !isLikelyDomElement(receiver, domTargets)) {\n return;\n }\n\n const eventName = readStringLiteral(node.arguments[0]);\n const eventLabel = eventName && /^[a-z][\\w:-]*$/i.test(eventName)\n ? `@${eventName}`\n : \"a template @event handler\";\n const listenerLabel = eventName\n ? `addEventListener(\"${eventName}\")`\n : \"addEventListener\";\n const location = locate(source, contentOffset + node.expression.name.getStart(sourceFile));\n warnings.push({\n code: \"RX_EVENT_DIRECT_LISTENER\",\n file,\n ...location,\n message: `Direct DOM \\`${listenerLabel}\\` bypasses Resux's resumable event delegation. Prefer \\`${eventLabel}\\` on the template element. Keep direct listeners for global or third-party EventTargets and always remove manually managed listeners during cleanup.`,\n });\n });\n}\n\nfunction visitTemplateChildren(\n root: RootNode,\n visit: (element: ElementNode) => void,\n): void {\n const traverse = (children: TemplateChildNode[]): void => {\n for (const child of children) {\n if (child.type !== NodeTypes.ELEMENT) {\n continue;\n }\n visit(child);\n traverse(child.children);\n }\n };\n\n traverse(root.children);\n}\n\nfunction walk(node: ts.Node, visit: (node: ts.Node) => void): void {\n visit(node);\n node.forEachChild((child) => walk(child, visit));\n}\n\nfunction isLikelyDomElement(expression: ts.Expression, domTargets: ReadonlySet<string>): boolean {\n const value = unwrapExpression(expression);\n\n if (ts.isIdentifier(value)) {\n return domTargets.has(value.text);\n }\n\n if (ts.isCallExpression(value)) {\n return isDomQueryExpression(value);\n }\n\n if (ts.isPropertyAccessExpression(value)) {\n if (value.name.text === \"value\") {\n const root = rootIdentifier(value.expression);\n return Boolean(root && domTargets.has(root));\n }\n const root = rootIdentifier(value);\n return Boolean(root && domTargets.has(root));\n }\n\n if (ts.isElementAccessExpression(value)) {\n const root = rootIdentifier(value.expression);\n return Boolean(root && domTargets.has(root));\n }\n\n return false;\n}\n\nfunction isGlobalEventTarget(expression: ts.Expression): boolean {\n const root = rootIdentifier(expression);\n return Boolean(root && GLOBAL_EVENT_TARGETS.has(root));\n}\n\nfunction rootIdentifier(expression: ts.Expression): string | undefined {\n const value = unwrapExpression(expression);\n if (ts.isIdentifier(value)) {\n return value.text;\n }\n if (ts.isPropertyAccessExpression(value) || ts.isElementAccessExpression(value)) {\n return rootIdentifier(value.expression);\n }\n return undefined;\n}\n\nfunction isDomQueryExpression(expression: ts.Expression | undefined): boolean {\n if (!expression) {\n return false;\n }\n const value = unwrapExpression(expression);\n if (!ts.isCallExpression(value) || !ts.isPropertyAccessExpression(value.expression)) {\n return false;\n }\n if (!DOM_QUERY_METHODS.has(value.expression.name.text)) {\n return false;\n }\n const root = rootIdentifier(value.expression.expression);\n return root === \"document\";\n}\n\nfunction typeLooksLikeDomElement(type: ts.TypeNode | undefined, sourceFile: ts.SourceFile): boolean {\n if (!type) {\n return false;\n }\n return /\\b(?:Element|[A-Z][A-Za-z0-9]*Element)\\b/.test(type.getText(sourceFile));\n}\n\nfunction readStringLiteral(node: ts.Expression | undefined): string | undefined {\n if (!node) {\n return undefined;\n }\n return ts.isStringLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node)\n ? node.text\n : undefined;\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let value = expression;\n while (\n ts.isParenthesizedExpression(value)\n || ts.isAsExpression(value)\n || ts.isTypeAssertionExpression(value)\n || ts.isNonNullExpression(value)\n || ts.isSatisfiesExpression(value)\n ) {\n value = value.expression;\n }\n return value;\n}\n\nfunction scriptKindFor(lang: string | undefined): ts.ScriptKind {\n switch (lang?.toLowerCase()) {\n case \"js\":\n return ts.ScriptKind.JS;\n case \"jsx\":\n return ts.ScriptKind.JSX;\n case \"tsx\":\n return ts.ScriptKind.TSX;\n default:\n return ts.ScriptKind.TS;\n }\n}\n\nfunction resolveBlockContentOffset(source: string, block: SFCBlock): number {\n const reportedOffset = block.loc.start.offset;\n if (source.slice(reportedOffset, reportedOffset + block.content.length) === block.content) {\n return reportedOffset;\n }\n const fallback = source.indexOf(block.content, Math.max(0, reportedOffset));\n return fallback >= 0 ? fallback : source.indexOf(block.content);\n}\n\nfunction locate(source: string, offset: number): { line: number; column: number } {\n const safeOffset = Math.max(0, Math.min(offset, source.length));\n const before = source.slice(0, safeOffset);\n const lastNewline = before.lastIndexOf(\"\\n\");\n return {\n line: before.split(\"\\n\").length,\n column: safeOffset - lastNewline,\n };\n}\n\nfunction isNormalResuxComponent(file: string): boolean {\n const normalized = file.replaceAll(\"\\\\\", \"/\").toLowerCase();\n return normalized.endsWith(\".vue\")\n && !/(?:^|\\/)node_modules\\//.test(normalized)\n && !/(?:^|\\/)islands\\/vue\\//.test(normalized);\n}\n\nfunction dedupeWarnings(warnings: ResuxDevWarning[]): ResuxDevWarning[] {\n const seen = new Set<string>();\n return warnings.filter((warning) => {\n const key = `${warning.code}:${warning.line}:${warning.column}:${warning.message}`;\n if (seen.has(key)) {\n return false;\n }\n seen.add(key);\n return true;\n });\n}\n"],"mappings":";;;;;AAgBA,MAAM,8BAA8B,IAAI,IAAI;CAC1C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAM,oBAAoB,IAAI,IAAI;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAM,uBAAuB,IAAI,IAAI;CAAC;CAAY;CAAc;CAAS,CAAC;AAE1E,SAAgB,wBAAwB,QAAgB,OAAO,iBAAoC;AACjG,KAAI,CAAC,uBAAuB,KAAK,CAC/B,QAAO,EAAE;AAGX,KAAI;EACF,MAAM,SAASA,QAAS,QAAQ,EAAE,UAAU,MAAM,CAAC;AACnD,MAAI,OAAO,OAAO,SAAS,EACzB,QAAO,EAAE;EAGX,MAAM,WAA8B,EAAE;EACtC,MAAM,+BAAe,IAAI,KAAa;EACtC,MAAM,WAAW,OAAO,WAAW;AAEnC,MAAI,SACF,yBAAwB,QAAQ,MAAM,UAAU,cAAc,SAAS;AAGzE,OAAK,MAAM,SAAS,CAAC,OAAO,WAAW,QAAQ,OAAO,WAAW,YAAY,CAC3E,KAAI,MACF,uBAAsB,QAAQ,MAAM,OAAO,cAAc,SAAS;AAItE,SAAO,eAAe,SAAS;SACzB;AAEN,SAAO,EAAE;;;AAIb,SAAgB,qBACd,QACA,MACA,0BAAU,IAAI,KAAa,EACrB;AACN,MAAK,MAAM,WAAW,wBAAwB,QAAQ,KAAK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B,KAAK,WAAW,IAC1C,CAAC,yBAAyB,KAAK,WAAW;;AAGjD,SAAS,eAAe,UAAgD;CACtE,MAAM,uBAAO,IAAI,KAAa;AAC9B,QAAO,SAAS,QAAQ,YAAY;EAClC,MAAM,MAAM,GAAG,QAAQ,KAAK,GAAG,QAAQ,KAAK,GAAG,QAAQ,OAAO,GAAG,QAAQ;AACzE,MAAI,KAAK,IAAI,IAAI,CACf,QAAO;AAET,OAAK,IAAI,IAAI;AACb,SAAO;GACP"}
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
* understood by Vue's template parser. Only attribute names inside opening
|
|
5
5
|
* template tags are changed; text, comments and attribute values are preserved.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
declare function normalizeResuxDirectiveSyntax(template: string): string;
|
|
8
8
|
/**
|
|
9
9
|
* Normalizes only the `<template>` block of a Vue SFC. Script and style blocks
|
|
10
10
|
* are intentionally untouched, so strings such as `"rx-if"` keep their value.
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
declare function normalizeResuxSfcSource(source: string, filename?: string): string;
|
|
13
13
|
/** Rewords compiler diagnostics so the public API always speaks Resux syntax. */
|
|
14
|
-
|
|
14
|
+
declare function rethrowWithResuxDirectiveBrand(error: unknown): never;
|
|
15
15
|
//#endregion
|
|
16
|
+
export { normalizeResuxDirectiveSyntax, normalizeResuxSfcSource, rethrowWithResuxDirectiveBrand };
|
|
16
17
|
//# sourceMappingURL=directives.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { parse } from "@vue/compiler-sfc";
|
|
2
|
+
|
|
2
3
|
//#region src/compiler/directives.ts
|
|
3
4
|
const RX_DIRECTIVE_PREFIX = "rx-";
|
|
4
5
|
const VUE_DIRECTIVE_PREFIX = "v-";
|
|
@@ -135,7 +136,7 @@ function normalizeOpeningTag(tag) {
|
|
|
135
136
|
}
|
|
136
137
|
return output;
|
|
137
138
|
}
|
|
139
|
+
|
|
138
140
|
//#endregion
|
|
139
141
|
export { normalizeResuxDirectiveSyntax, normalizeResuxSfcSource, rethrowWithResuxDirectiveBrand };
|
|
140
|
-
|
|
141
142
|
//# sourceMappingURL=directives.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directives.js","names":["parseSfc"],"sources":["../../src/compiler/directives.ts"],"sourcesContent":["import { parse as parseSfc } from \"@vue/compiler-sfc\";\n\nconst RX_DIRECTIVE_PREFIX = \"rx-\";\nconst VUE_DIRECTIVE_PREFIX = \"v-\";\n\n/**\n * Converts Resux-branded directive attributes (`rx-*`) to the directive names\n * understood by Vue's template parser. Only attribute names inside opening\n * template tags are changed; text, comments and attribute values are preserved.\n */\nexport function normalizeResuxDirectiveSyntax(template: string): string {\n let output = \"\";\n let cursor = 0;\n\n while (cursor < template.length) {\n const tagStart = template.indexOf(\"<\", cursor);\n if (tagStart === -1) {\n output += template.slice(cursor);\n break;\n }\n\n output += template.slice(cursor, tagStart);\n\n if (template.startsWith(\"<!--\", tagStart)) {\n const commentEnd = template.indexOf(\"-->\", tagStart + 4);\n if (commentEnd === -1) {\n output += template.slice(tagStart);\n break;\n }\n output += template.slice(tagStart, commentEnd + 3);\n cursor = commentEnd + 3;\n continue;\n }\n\n const tagEnd = findTagEnd(template, tagStart + 1);\n if (tagEnd === -1) {\n output += template.slice(tagStart);\n break;\n }\n\n output += normalizeOpeningTag(template.slice(tagStart, tagEnd + 1));\n cursor = tagEnd + 1;\n }\n\n return output;\n}\n\n/**\n * Normalizes only the `<template>` block of a Vue SFC. Script and style blocks\n * are intentionally untouched, so strings such as `\"rx-if\"` keep their value.\n */\nexport function normalizeResuxSfcSource(source: string, filename = \"component.vue\"): string {\n if (!source.includes(RX_DIRECTIVE_PREFIX)) {\n return source;\n }\n\n const parsed = parseSfc(source, { filename });\n const template = parsed.descriptor.template;\n if (!template || !template.content.includes(RX_DIRECTIVE_PREFIX)) {\n return source;\n }\n\n const normalizedTemplate = normalizeResuxDirectiveSyntax(template.content);\n if (normalizedTemplate === template.content) {\n return source;\n }\n\n const bounds = resolveTemplateContentBounds(source, template.content, template.loc.start.offset);\n if (!bounds) {\n return source;\n }\n\n return `${source.slice(0, bounds.start)}${normalizedTemplate}${source.slice(bounds.end)}`;\n}\n\n/** Rewords compiler diagnostics so the public API always speaks Resux syntax. */\nexport function rethrowWithResuxDirectiveBrand(error: unknown): never {\n if (error instanceof Error) {\n error.message = brandDirectiveText(error.message);\n if (error.stack) {\n error.stack = brandDirectiveText(error.stack);\n }\n }\n throw error;\n}\n\nfunction brandDirectiveText(value: string): string {\n return value.replace(/\\bv-(?=[a-z][\\w-]*)/gi, RX_DIRECTIVE_PREFIX);\n}\n\nfunction resolveTemplateContentBounds(\n source: string,\n content: string,\n reportedOffset: number,\n): { start: number; end: number } | null {\n if (source.slice(reportedOffset, reportedOffset + content.length) === content) {\n return { start: reportedOffset, end: reportedOffset + content.length };\n }\n\n const templateOpen = /<template(?:\\s[^>]*)?>/i.exec(source);\n if (!templateOpen || templateOpen.index === undefined) {\n return null;\n }\n\n const openingEnd = templateOpen.index + templateOpen[0].length;\n const fallbackStart = source.indexOf(content, openingEnd);\n if (fallbackStart === -1) {\n return null;\n }\n\n return { start: fallbackStart, end: fallbackStart + content.length };\n}\n\nfunction findTagEnd(source: string, start: number): number {\n let quote: '\"' | \"'\" | null = null;\n\n for (let index = start; index < source.length; index++) {\n const char = source[index];\n if (quote) {\n if (char === quote && source[index - 1] !== \"\\\\\") {\n quote = null;\n }\n continue;\n }\n\n if (char === '\"' || char === \"'\") {\n quote = char;\n continue;\n }\n\n if (char === \">\") {\n return index;\n }\n }\n\n return -1;\n}\n\nfunction normalizeOpeningTag(tag: string): string {\n if (/^<\\s*(?:\\/|!|\\?)/.test(tag)) {\n return tag;\n }\n\n let output = \"\";\n let cursor = 0;\n let expectsUnquotedValue = false;\n\n // Copy the opening bracket, whitespace and element name unchanged.\n while (cursor < tag.length && !/\\s/.test(tag[cursor]) && tag[cursor] !== \">\") {\n output += tag[cursor++];\n }\n\n while (cursor < tag.length) {\n const char = tag[cursor];\n\n if (char === '\"' || char === \"'\") {\n const quote = char;\n const valueStart = cursor;\n cursor++;\n while (cursor < tag.length) {\n if (tag[cursor] === quote && tag[cursor - 1] !== \"\\\\\") {\n cursor++;\n break;\n }\n cursor++;\n }\n output += tag.slice(valueStart, cursor);\n expectsUnquotedValue = false;\n continue;\n }\n\n if (/\\s/.test(char) || char === \"/\" || char === \">\") {\n output += char;\n cursor++;\n continue;\n }\n\n if (char === \"=\") {\n output += char;\n cursor++;\n expectsUnquotedValue = true;\n continue;\n }\n\n const tokenStart = cursor;\n while (\n cursor < tag.length\n && !/\\s/.test(tag[cursor])\n && tag[cursor] !== \"=\"\n && tag[cursor] !== \"/\"\n && tag[cursor] !== \">\"\n ) {\n cursor++;\n }\n\n const token = tag.slice(tokenStart, cursor);\n output += !expectsUnquotedValue\n && token.startsWith(RX_DIRECTIVE_PREFIX)\n && token.length > RX_DIRECTIVE_PREFIX.length\n ? `${VUE_DIRECTIVE_PREFIX}${token.slice(RX_DIRECTIVE_PREFIX.length)}`\n : token;\n expectsUnquotedValue = false;\n }\n\n return output;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"directives.js","names":["parseSfc"],"sources":["../../src/compiler/directives.ts"],"sourcesContent":["import { parse as parseSfc } from \"@vue/compiler-sfc\";\n\nconst RX_DIRECTIVE_PREFIX = \"rx-\";\nconst VUE_DIRECTIVE_PREFIX = \"v-\";\n\n/**\n * Converts Resux-branded directive attributes (`rx-*`) to the directive names\n * understood by Vue's template parser. Only attribute names inside opening\n * template tags are changed; text, comments and attribute values are preserved.\n */\nexport function normalizeResuxDirectiveSyntax(template: string): string {\n let output = \"\";\n let cursor = 0;\n\n while (cursor < template.length) {\n const tagStart = template.indexOf(\"<\", cursor);\n if (tagStart === -1) {\n output += template.slice(cursor);\n break;\n }\n\n output += template.slice(cursor, tagStart);\n\n if (template.startsWith(\"<!--\", tagStart)) {\n const commentEnd = template.indexOf(\"-->\", tagStart + 4);\n if (commentEnd === -1) {\n output += template.slice(tagStart);\n break;\n }\n output += template.slice(tagStart, commentEnd + 3);\n cursor = commentEnd + 3;\n continue;\n }\n\n const tagEnd = findTagEnd(template, tagStart + 1);\n if (tagEnd === -1) {\n output += template.slice(tagStart);\n break;\n }\n\n output += normalizeOpeningTag(template.slice(tagStart, tagEnd + 1));\n cursor = tagEnd + 1;\n }\n\n return output;\n}\n\n/**\n * Normalizes only the `<template>` block of a Vue SFC. Script and style blocks\n * are intentionally untouched, so strings such as `\"rx-if\"` keep their value.\n */\nexport function normalizeResuxSfcSource(source: string, filename = \"component.vue\"): string {\n if (!source.includes(RX_DIRECTIVE_PREFIX)) {\n return source;\n }\n\n const parsed = parseSfc(source, { filename });\n const template = parsed.descriptor.template;\n if (!template || !template.content.includes(RX_DIRECTIVE_PREFIX)) {\n return source;\n }\n\n const normalizedTemplate = normalizeResuxDirectiveSyntax(template.content);\n if (normalizedTemplate === template.content) {\n return source;\n }\n\n const bounds = resolveTemplateContentBounds(source, template.content, template.loc.start.offset);\n if (!bounds) {\n return source;\n }\n\n return `${source.slice(0, bounds.start)}${normalizedTemplate}${source.slice(bounds.end)}`;\n}\n\n/** Rewords compiler diagnostics so the public API always speaks Resux syntax. */\nexport function rethrowWithResuxDirectiveBrand(error: unknown): never {\n if (error instanceof Error) {\n error.message = brandDirectiveText(error.message);\n if (error.stack) {\n error.stack = brandDirectiveText(error.stack);\n }\n }\n throw error;\n}\n\nfunction brandDirectiveText(value: string): string {\n return value.replace(/\\bv-(?=[a-z][\\w-]*)/gi, RX_DIRECTIVE_PREFIX);\n}\n\nfunction resolveTemplateContentBounds(\n source: string,\n content: string,\n reportedOffset: number,\n): { start: number; end: number } | null {\n if (source.slice(reportedOffset, reportedOffset + content.length) === content) {\n return { start: reportedOffset, end: reportedOffset + content.length };\n }\n\n const templateOpen = /<template(?:\\s[^>]*)?>/i.exec(source);\n if (!templateOpen || templateOpen.index === undefined) {\n return null;\n }\n\n const openingEnd = templateOpen.index + templateOpen[0].length;\n const fallbackStart = source.indexOf(content, openingEnd);\n if (fallbackStart === -1) {\n return null;\n }\n\n return { start: fallbackStart, end: fallbackStart + content.length };\n}\n\nfunction findTagEnd(source: string, start: number): number {\n let quote: '\"' | \"'\" | null = null;\n\n for (let index = start; index < source.length; index++) {\n const char = source[index];\n if (quote) {\n if (char === quote && source[index - 1] !== \"\\\\\") {\n quote = null;\n }\n continue;\n }\n\n if (char === '\"' || char === \"'\") {\n quote = char;\n continue;\n }\n\n if (char === \">\") {\n return index;\n }\n }\n\n return -1;\n}\n\nfunction normalizeOpeningTag(tag: string): string {\n if (/^<\\s*(?:\\/|!|\\?)/.test(tag)) {\n return tag;\n }\n\n let output = \"\";\n let cursor = 0;\n let expectsUnquotedValue = false;\n\n // Copy the opening bracket, whitespace and element name unchanged.\n while (cursor < tag.length && !/\\s/.test(tag[cursor]) && tag[cursor] !== \">\") {\n output += tag[cursor++];\n }\n\n while (cursor < tag.length) {\n const char = tag[cursor];\n\n if (char === '\"' || char === \"'\") {\n const quote = char;\n const valueStart = cursor;\n cursor++;\n while (cursor < tag.length) {\n if (tag[cursor] === quote && tag[cursor - 1] !== \"\\\\\") {\n cursor++;\n break;\n }\n cursor++;\n }\n output += tag.slice(valueStart, cursor);\n expectsUnquotedValue = false;\n continue;\n }\n\n if (/\\s/.test(char) || char === \"/\" || char === \">\") {\n output += char;\n cursor++;\n continue;\n }\n\n if (char === \"=\") {\n output += char;\n cursor++;\n expectsUnquotedValue = true;\n continue;\n }\n\n const tokenStart = cursor;\n while (\n cursor < tag.length\n && !/\\s/.test(tag[cursor])\n && tag[cursor] !== \"=\"\n && tag[cursor] !== \"/\"\n && tag[cursor] !== \">\"\n ) {\n cursor++;\n }\n\n const token = tag.slice(tokenStart, cursor);\n output += !expectsUnquotedValue\n && token.startsWith(RX_DIRECTIVE_PREFIX)\n && token.length > RX_DIRECTIVE_PREFIX.length\n ? `${VUE_DIRECTIVE_PREFIX}${token.slice(RX_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AI,IAAI,YAAY,IACvE,WAAU,IAAI;AAGhB,QAAO,SAAS,IAAI,QAAQ;EAC1B,MAAM,OAAO,IAAI;AAEjB,MAAI,SAAS,QAAO,SAAS,KAAK;GAChC,MAAM,QAAQ;GACd,MAAM,aAAa;AACnB;AACA,UAAO,SAAS,IAAI,QAAQ;AAC1B,QAAI,IAAI,YAAY,SAAS,IAAI,SAAS,OAAO,MAAM;AACrD;AACA;;AAEF;;AAEF,aAAU,IAAI,MAAM,YAAY,OAAO;AACvC,0BAAuB;AACvB;;AAGF,MAAI,KAAK,KAAK,KAAK,IAAI,SAAS,OAAO,SAAS,KAAK;AACnD,aAAU;AACV;AACA;;AAGF,MAAI,SAAS,KAAK;AAChB,aAAU;AACV;AACA,0BAAuB;AACvB;;EAGF,MAAM,aAAa;AACnB,SACE,SAAS,IAAI,UACV,CAAC,KAAK,KAAK,IAAI,QAAQ,IACvB,IAAI,YAAY,OAChB,IAAI,YAAY,OAChB,IAAI,YAAY,IAEnB;EAGF,MAAM,QAAQ,IAAI,MAAM,YAAY,OAAO;AAC3C,YAAU,CAAC,wBACN,MAAM,WAAW,oBAAoB,IACrC,MAAM,SAAS,IACd,GAAG,uBAAuB,MAAM,MAAM,EAA2B,KACjE;AACN,yBAAuB;;AAGzB,QAAO"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { ComponentStyle, PageMeta, TemplateNode } from "../runtime/index.js";
|
|
2
2
|
import { ResuxHooks } from "../core/hooks.js";
|
|
3
|
+
|
|
3
4
|
//#region src/compiler/index.d.ts
|
|
4
|
-
|
|
5
|
+
interface CompileErrorLocation {
|
|
5
6
|
file: string;
|
|
6
7
|
line: number;
|
|
7
8
|
column: number;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
+
declare class ResuxCompileError extends Error {
|
|
10
11
|
readonly location?: CompileErrorLocation;
|
|
11
12
|
constructor(message: string, location?: CompileErrorLocation);
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
+
interface CompiledComponent {
|
|
14
15
|
id: string;
|
|
15
16
|
name: string;
|
|
16
17
|
file: string;
|
|
@@ -28,7 +29,7 @@ export interface CompiledComponent {
|
|
|
28
29
|
locals: string[];
|
|
29
30
|
}[];
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
+
interface RouteManifestRecord {
|
|
32
33
|
id: string;
|
|
33
34
|
path: string;
|
|
34
35
|
file: string;
|
|
@@ -36,20 +37,20 @@ export interface RouteManifestRecord {
|
|
|
36
37
|
componentId: string;
|
|
37
38
|
meta?: PageMeta;
|
|
38
39
|
}
|
|
39
|
-
|
|
40
|
+
interface CompiledPlugin {
|
|
40
41
|
id: string;
|
|
41
42
|
file: string;
|
|
42
43
|
mode: "all" | "server" | "client";
|
|
43
44
|
serverSource: string;
|
|
44
45
|
clientSource: string;
|
|
45
46
|
}
|
|
46
|
-
|
|
47
|
+
interface ClientEnhancementManifestEntry {
|
|
47
48
|
name: string;
|
|
48
49
|
id: string;
|
|
49
50
|
file: string;
|
|
50
51
|
src: string;
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
+
interface CompiledMiddleware {
|
|
53
54
|
id: string;
|
|
54
55
|
name: string;
|
|
55
56
|
file: string;
|
|
@@ -58,23 +59,23 @@ export interface CompiledMiddleware {
|
|
|
58
59
|
serverSource: string;
|
|
59
60
|
clientSource: string;
|
|
60
61
|
}
|
|
61
|
-
|
|
62
|
+
interface CompiledServerMiddleware {
|
|
62
63
|
id: string;
|
|
63
64
|
file: string;
|
|
64
65
|
source: string;
|
|
65
66
|
}
|
|
66
|
-
|
|
67
|
+
interface ServerHandlerRecord {
|
|
67
68
|
id: string;
|
|
68
69
|
path: string;
|
|
69
70
|
file: string;
|
|
70
71
|
params: string[];
|
|
71
72
|
source: string;
|
|
72
73
|
}
|
|
73
|
-
|
|
74
|
+
interface VueIslandRecord {
|
|
74
75
|
name: string;
|
|
75
76
|
file: string;
|
|
76
77
|
}
|
|
77
|
-
|
|
78
|
+
interface RouteRuleConfig {
|
|
78
79
|
headers?: Record<string, string>;
|
|
79
80
|
redirect?: string | {
|
|
80
81
|
to: string;
|
|
@@ -92,7 +93,7 @@ export interface RouteRuleConfig {
|
|
|
92
93
|
credentials?: boolean;
|
|
93
94
|
};
|
|
94
95
|
}
|
|
95
|
-
|
|
96
|
+
interface BuildResult {
|
|
96
97
|
appRoot: string;
|
|
97
98
|
outDir: string;
|
|
98
99
|
routes: RouteManifestRecord[];
|
|
@@ -108,25 +109,26 @@ export interface BuildResult {
|
|
|
108
109
|
app?: CompiledComponent;
|
|
109
110
|
error?: CompiledComponent;
|
|
110
111
|
}
|
|
111
|
-
|
|
112
|
+
interface BuildOptions {
|
|
112
113
|
vite?: "build" | "dev";
|
|
113
114
|
server?: "bundle" | "modules";
|
|
114
115
|
hooks?: ResuxHooks;
|
|
115
116
|
changedPath?: string;
|
|
116
117
|
traceBuild?: boolean;
|
|
117
118
|
}
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
declare function buildProject(appRoot: string, outDir?: string, options?: BuildOptions): Promise<BuildResult>;
|
|
120
|
+
declare function compileVueFile(file: string, options: {
|
|
120
121
|
id: string;
|
|
121
122
|
name?: string;
|
|
122
123
|
}): Promise<CompiledComponent>;
|
|
123
|
-
|
|
124
|
+
declare function compileVueSource(source: string, options: {
|
|
124
125
|
file: string;
|
|
125
126
|
id: string;
|
|
126
127
|
name: string;
|
|
127
128
|
}): CompiledComponent;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
declare function createRouteManifest(root: string, files: string[], idByFile?: Map<string, string>, compiledByFile?: Map<string, CompiledComponent>): RouteManifestRecord[];
|
|
130
|
+
declare function resolveFileExtension(filePath: string): string;
|
|
131
|
+
declare function fileUrl(file: string): string;
|
|
131
132
|
//#endregion
|
|
133
|
+
export { BuildOptions, BuildResult, ClientEnhancementManifestEntry, CompileErrorLocation, CompiledComponent, CompiledMiddleware, CompiledPlugin, CompiledServerMiddleware, ResuxCompileError, RouteManifestRecord, RouteRuleConfig, ServerHandlerRecord, VueIslandRecord, buildProject, compileVueFile, compileVueSource, createRouteManifest, fileUrl, resolveFileExtension };
|
|
132
134
|
//# sourceMappingURL=index.d.ts.map
|