resuxjs 0.4.0-beta.6 → 0.4.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -13
- package/dist/bin.d.ts +1 -1
- package/dist/bin.js +2 -4
- package/dist/bin.js.map +1 -1
- package/dist/build/index.d.ts +8 -11
- package/dist/build/index.js +3 -4
- package/dist/build/index.js.map +1 -1
- package/dist/cli.d.ts +7 -8
- package/dist/cli.js +170 -135
- package/dist/cli.js.map +1 -1
- package/dist/compiler/adapter.d.ts +5 -8
- package/dist/compiler/adapter.js +2 -4
- package/dist/compiler/adapter.js.map +1 -1
- package/dist/compiler/dev-warnings.d.ts +5 -8
- package/dist/compiler/dev-warnings.js +7 -9
- package/dist/compiler/dev-warnings.js.map +1 -1
- package/dist/compiler/directives.d.ts +3 -6
- package/dist/compiler/directives.js +2 -4
- package/dist/compiler/directives.js.map +1 -1
- package/dist/compiler/implementation.d.ts +22 -24
- package/dist/compiler/implementation.js +140 -129
- package/dist/compiler/index.d.ts +5 -8
- package/dist/compiler/index.js +2 -4
- package/dist/compiler/index.js.map +1 -1
- package/dist/core/config.d.ts +5 -9
- package/dist/core/config.js +2 -3
- package/dist/core/config.js.map +1 -1
- package/dist/core/hooks.d.ts +6 -9
- package/dist/core/hooks.js +2 -3
- package/dist/core/hooks.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -2
- package/dist/core/module-container.d.ts +20 -24
- package/dist/core/module-container.js +4 -5
- package/dist/core/module-container.js.map +1 -1
- package/dist/core/resux.d.ts +4 -8
- package/dist/core/resux.js +2 -4
- package/dist/core/resux.js.map +1 -1
- package/dist/create-bin.d.ts +1 -1
- package/dist/create-bin.js +2 -4
- package/dist/create-bin.js.map +1 -1
- package/dist/create.d.ts +2 -5
- package/dist/create.js +15 -10
- package/dist/create.js.map +1 -1
- package/dist/deploy/cloudflare.d.ts +1 -5
- package/dist/deploy/cloudflare.js +2 -4
- package/dist/deploy/cloudflare.js.map +1 -1
- package/dist/deploy/common.d.ts +12 -15
- package/dist/deploy/common.js +2 -4
- package/dist/deploy/common.js.map +1 -1
- package/dist/deploy/framework-runtime.d.ts +1 -4
- package/dist/deploy/framework-runtime.js +2 -4
- package/dist/deploy/framework-runtime.js.map +1 -1
- package/dist/deploy/index.d.ts +2 -6
- package/dist/deploy/index.js +7 -6
- package/dist/deploy/index.js.map +1 -1
- package/dist/deploy/netlify.d.ts +1 -5
- package/dist/deploy/netlify.js +3 -5
- package/dist/deploy/netlify.js.map +1 -1
- package/dist/deploy/node.d.ts +1 -5
- package/dist/deploy/node.js +4 -5
- package/dist/deploy/node.js.map +1 -1
- package/dist/deploy/production-report.d.ts +1 -4
- package/dist/deploy/production-report.js +2 -4
- package/dist/deploy/production-report.js.map +1 -1
- package/dist/deploy/runtime-dependencies.d.ts +4 -7
- package/dist/deploy/runtime-dependencies.js +4 -5
- package/dist/deploy/runtime-dependencies.js.map +1 -1
- package/dist/deploy/static.d.ts +1 -5
- package/dist/deploy/static.js +2 -4
- package/dist/deploy/static.js.map +1 -1
- package/dist/deploy/types.d.ts +7 -10
- package/dist/deploy/types.js +1 -1
- package/dist/deploy/vercel.d.ts +2 -6
- package/dist/deploy/vercel.js +3 -5
- package/dist/deploy/vercel.js.map +1 -1
- package/dist/fonts/index.d.ts +60 -11
- package/dist/fonts/index.js +422 -46
- package/dist/fonts/index.js.map +1 -1
- package/dist/globals.d.ts +1 -3
- package/dist/globals.js +1 -1
- package/dist/halal-core/ai/classifyProject.d.ts +3 -7
- package/dist/halal-core/ai/classifyProject.js +2 -4
- package/dist/halal-core/ai/classifyProject.js.map +1 -1
- package/dist/halal-core/ai/classifyRuntimeContent.d.ts +1 -5
- package/dist/halal-core/ai/classifyRuntimeContent.js +3 -5
- package/dist/halal-core/ai/classifyRuntimeContent.js.map +1 -1
- package/dist/halal-core/ai/createProjectSummary.d.ts +1 -4
- package/dist/halal-core/ai/createProjectSummary.js +2 -4
- package/dist/halal-core/ai/createProjectSummary.js.map +1 -1
- package/dist/halal-core/ai/halalClassifierPrompt.d.ts +1 -4
- package/dist/halal-core/ai/halalClassifierPrompt.js +2 -3
- package/dist/halal-core/ai/redactSensitiveData.d.ts +1 -4
- package/dist/halal-core/ai/redactSensitiveData.js +2 -3
- package/dist/halal-core/ai/redactSensitiveData.js.map +1 -1
- package/dist/halal-core/ai/validateAiResponse.d.ts +1 -5
- package/dist/halal-core/ai/validateAiResponse.js +4 -5
- package/dist/halal-core/ai/validateAiResponse.js.map +1 -1
- package/dist/halal-core/cli/check.d.ts +1 -4
- package/dist/halal-core/cli/check.js +5 -6
- package/dist/halal-core/cli/check.js.map +1 -1
- package/dist/halal-core/cli/explain.d.ts +1 -4
- package/dist/halal-core/cli/explain.js +5 -6
- package/dist/halal-core/cli/explain.js.map +1 -1
- package/dist/halal-core/cli/report.d.ts +1 -4
- package/dist/halal-core/cli/report.js +5 -6
- package/dist/halal-core/cli/report.js.map +1 -1
- package/dist/halal-core/cli/submitReview.d.ts +1 -4
- package/dist/halal-core/cli/submitReview.js +5 -6
- package/dist/halal-core/cli/submitReview.js.map +1 -1
- package/dist/halal-core/cli/verifyReview.d.ts +1 -4
- package/dist/halal-core/cli/verifyReview.js +7 -7
- package/dist/halal-core/cli/verifyReview.js.map +1 -1
- package/dist/halal-core/config.d.ts +9 -11
- package/dist/halal-core/config.js +46 -11
- package/dist/halal-core/config.js.map +1 -1
- package/dist/halal-core/crypto/integrity.d.ts +5 -8
- package/dist/halal-core/crypto/integrity.js +2 -4
- package/dist/halal-core/crypto/integrity.js.map +1 -1
- package/dist/halal-core/enforce.d.ts +5 -8
- package/dist/halal-core/enforce.js +17 -16
- package/dist/halal-core/enforce.js.map +1 -1
- package/dist/halal-core/index.d.ts +6 -6
- package/dist/halal-core/index.js +8 -9
- package/dist/halal-core/lifecycle.d.ts +1 -4
- package/dist/halal-core/lifecycle.js +2 -4
- package/dist/halal-core/lifecycle.js.map +1 -1
- package/dist/halal-core/policy.d.ts +1 -5
- package/dist/halal-core/policy.js +2 -4
- package/dist/halal-core/policy.js.map +1 -1
- package/dist/halal-core/report/formatBrowserOverlay.d.ts +1 -5
- package/dist/halal-core/report/formatBrowserOverlay.js +2 -3
- package/dist/halal-core/report/formatBrowserOverlay.js.map +1 -1
- package/dist/halal-core/report/formatTerminalReport.d.ts +1 -5
- package/dist/halal-core/report/formatTerminalReport.js +2 -3
- package/dist/halal-core/report/formatTerminalReport.js.map +1 -1
- package/dist/halal-core/report/generateHalalReport.d.ts +2 -6
- package/dist/halal-core/report/generateHalalReport.js +8 -7
- package/dist/halal-core/report/generateHalalReport.js.map +1 -1
- package/dist/halal-core/report/signReport.d.ts +2 -6
- package/dist/halal-core/report/signReport.js +2 -4
- package/dist/halal-core/report/signReport.js.map +1 -1
- package/dist/halal-core/report/verifyReport.d.ts +3 -7
- package/dist/halal-core/report/verifyReport.js +4 -6
- package/dist/halal-core/report/verifyReport.js.map +1 -1
- package/dist/halal-core/review/createReviewRequest.d.ts +1 -5
- package/dist/halal-core/review/createReviewRequest.js +4 -5
- package/dist/halal-core/review/createReviewRequest.js.map +1 -1
- package/dist/halal-core/review/reviewPolicy.d.ts +3 -6
- package/dist/halal-core/review/reviewPolicy.js +2 -3
- package/dist/halal-core/review/reviewPolicy.js.map +1 -1
- package/dist/halal-core/review/signedReviewFile.d.ts +4 -8
- package/dist/halal-core/review/signedReviewFile.js +2 -4
- package/dist/halal-core/review/signedReviewFile.js.map +1 -1
- package/dist/halal-core/review/verifyReviewApproval.d.ts +2 -5
- package/dist/halal-core/review/verifyReviewApproval.js +2 -4
- package/dist/halal-core/review/verifyReviewApproval.js.map +1 -1
- package/dist/halal-core/rules/adultContentRules.d.ts +2 -5
- package/dist/halal-core/rules/adultContentRules.js +2 -3
- package/dist/halal-core/rules/adultContentRules.js.map +1 -1
- package/dist/halal-core/rules/alcoholDrugVapeRules.d.ts +2 -5
- package/dist/halal-core/rules/alcoholDrugVapeRules.js +2 -3
- package/dist/halal-core/rules/alcoholDrugVapeRules.js.map +1 -1
- package/dist/halal-core/rules/childSafetyRules.d.ts +2 -5
- package/dist/halal-core/rules/childSafetyRules.js +2 -3
- package/dist/halal-core/rules/childSafetyRules.js.map +1 -1
- package/dist/halal-core/rules/coreCategories.d.ts +2 -5
- package/dist/halal-core/rules/coreCategories.js +2 -3
- package/dist/halal-core/rules/coreCategories.js.map +1 -1
- package/dist/halal-core/rules/cyberAbuseRules.d.ts +2 -5
- package/dist/halal-core/rules/cyberAbuseRules.js +2 -3
- package/dist/halal-core/rules/cyberAbuseRules.js.map +1 -1
- package/dist/halal-core/rules/defaultBlockedRules.d.ts +1 -5
- package/dist/halal-core/rules/defaultBlockedRules.js +12 -11
- package/dist/halal-core/rules/defaultBlockedRules.js.map +1 -1
- package/dist/halal-core/rules/dependencyRules.d.ts +2 -5
- package/dist/halal-core/rules/dependencyRules.js +2 -3
- package/dist/halal-core/rules/dependencyRules.js.map +1 -1
- package/dist/halal-core/rules/endpointRules.d.ts +2 -5
- package/dist/halal-core/rules/endpointRules.js +2 -3
- package/dist/halal-core/rules/endpointRules.js.map +1 -1
- package/dist/halal-core/rules/environmentalHarmRules.d.ts +2 -5
- package/dist/halal-core/rules/environmentalHarmRules.js +2 -3
- package/dist/halal-core/rules/environmentalHarmRules.js.map +1 -1
- package/dist/halal-core/rules/financeRibaRules.d.ts +2 -5
- package/dist/halal-core/rules/financeRibaRules.js +2 -3
- package/dist/halal-core/rules/financeRibaRules.js.map +1 -1
- package/dist/halal-core/rules/gamblingRules.d.ts +2 -5
- package/dist/halal-core/rules/gamblingRules.js +2 -3
- package/dist/halal-core/rules/gamblingRules.js.map +1 -1
- package/dist/halal-core/rules/generalHarmRules.d.ts +2 -5
- package/dist/halal-core/rules/generalHarmRules.js +2 -3
- package/dist/halal-core/rules/generalHarmRules.js.map +1 -1
- package/dist/halal-core/rules/healthHarmRules.d.ts +2 -5
- package/dist/halal-core/rules/healthHarmRules.js +2 -3
- package/dist/halal-core/rules/healthHarmRules.js.map +1 -1
- package/dist/halal-core/rules/keywordRules.d.ts +1 -4
- package/dist/halal-core/rules/keywordRules.js +2 -3
- package/dist/halal-core/rules/keywordRules.js.map +1 -1
- package/dist/halal-core/rules/privacyAbuseRules.d.ts +2 -5
- package/dist/halal-core/rules/privacyAbuseRules.js +2 -3
- package/dist/halal-core/rules/privacyAbuseRules.js.map +1 -1
- package/dist/halal-core/rules/scamFraudRules.d.ts +2 -5
- package/dist/halal-core/rules/scamFraudRules.js +2 -3
- package/dist/halal-core/rules/scamFraudRules.js.map +1 -1
- package/dist/halal-core/rules/selfHarmRules.d.ts +2 -5
- package/dist/halal-core/rules/selfHarmRules.js +2 -3
- package/dist/halal-core/rules/selfHarmRules.js.map +1 -1
- package/dist/halal-core/rules/violenceExtremismRules.d.ts +2 -5
- package/dist/halal-core/rules/violenceExtremismRules.js +2 -3
- package/dist/halal-core/rules/violenceExtremismRules.js.map +1 -1
- package/dist/halal-core/runtime/guard.d.ts +3 -7
- package/dist/halal-core/runtime/guard.js +5 -7
- package/dist/halal-core/runtime/guard.js.map +1 -1
- package/dist/halal-core/runtime/index.js +1 -2
- package/dist/halal-core/runtime/reviewedMemory.d.ts +4 -8
- package/dist/halal-core/runtime/reviewedMemory.js +3 -5
- package/dist/halal-core/runtime/reviewedMemory.js.map +1 -1
- package/dist/halal-core/runtime/serializeRuntimeContent.d.ts +5 -9
- package/dist/halal-core/runtime/serializeRuntimeContent.js +4 -6
- package/dist/halal-core/runtime/serializeRuntimeContent.js.map +1 -1
- package/dist/halal-core/runtime/types.d.ts +9 -13
- package/dist/halal-core/runtime/types.js +1 -1
- package/dist/halal-core/scanner/scanApiRoutes.d.ts +1 -4
- package/dist/halal-core/scanner/scanApiRoutes.js +2 -4
- package/dist/halal-core/scanner/scanApiRoutes.js.map +1 -1
- package/dist/halal-core/scanner/scanComponents.d.ts +1 -4
- package/dist/halal-core/scanner/scanComponents.js +2 -4
- package/dist/halal-core/scanner/scanComponents.js.map +1 -1
- package/dist/halal-core/scanner/scanContent.d.ts +2 -5
- package/dist/halal-core/scanner/scanContent.js +4 -6
- package/dist/halal-core/scanner/scanContent.js.map +1 -1
- package/dist/halal-core/scanner/scanDependencies.d.ts +1 -4
- package/dist/halal-core/scanner/scanDependencies.js +2 -4
- package/dist/halal-core/scanner/scanDependencies.js.map +1 -1
- package/dist/halal-core/scanner/scanDomains.d.ts +1 -4
- package/dist/halal-core/scanner/scanDomains.js +2 -3
- package/dist/halal-core/scanner/scanDomains.js.map +1 -1
- package/dist/halal-core/scanner/scanEnvNames.d.ts +1 -4
- package/dist/halal-core/scanner/scanEnvNames.js +2 -4
- package/dist/halal-core/scanner/scanEnvNames.js.map +1 -1
- package/dist/halal-core/scanner/scanMetadata.d.ts +2 -5
- package/dist/halal-core/scanner/scanMetadata.js +2 -4
- package/dist/halal-core/scanner/scanMetadata.js.map +1 -1
- package/dist/halal-core/scanner/scanPages.d.ts +1 -4
- package/dist/halal-core/scanner/scanPages.js +2 -4
- package/dist/halal-core/scanner/scanPages.js.map +1 -1
- package/dist/halal-core/scanner/scanProject.d.ts +2 -6
- package/dist/halal-core/scanner/scanProject.js +2 -4
- package/dist/halal-core/scanner/scanProject.js.map +1 -1
- package/dist/halal-core/scanner/scanRoutes.d.ts +1 -4
- package/dist/halal-core/scanner/scanRoutes.js +2 -4
- package/dist/halal-core/scanner/scanRoutes.js.map +1 -1
- package/dist/halal-core/scanner/scanTranslations.d.ts +1 -4
- package/dist/halal-core/scanner/scanTranslations.js +2 -4
- package/dist/halal-core/scanner/scanTranslations.js.map +1 -1
- package/dist/halal-core/status.d.ts +2 -5
- package/dist/halal-core/status.js +1 -1
- package/dist/halal-core/tamper/verifyCoreIntegrity.d.ts +1 -4
- package/dist/halal-core/tamper/verifyCoreIntegrity.js +2 -4
- package/dist/halal-core/tamper/verifyCoreIntegrity.js.map +1 -1
- package/dist/halal-core/tamper/verifyLifecycleHooks.d.ts +1 -4
- package/dist/halal-core/tamper/verifyLifecycleHooks.js +2 -3
- package/dist/halal-core/tamper/verifyLifecycleHooks.js.map +1 -1
- package/dist/halal-core/tamper/verifyReportSignature.d.ts +1 -5
- package/dist/halal-core/tamper/verifyReportSignature.js +4 -5
- package/dist/halal-core/tamper/verifyReportSignature.js.map +1 -1
- package/dist/halal.d.ts +2 -2
- package/dist/halal.js +2 -3
- package/dist/i18n/index.d.ts +11 -14
- package/dist/i18n/index.js +9 -9
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/shared.d.ts +14 -17
- package/dist/i18n/shared.js +5 -6
- package/dist/i18n/shared.js.map +1 -1
- package/dist/icons/api-fetcher.d.ts +4 -0
- package/dist/icons/api-fetcher.js +77 -0
- package/dist/icons/api-fetcher.js.map +1 -0
- package/dist/icons/cache.d.ts +22 -0
- package/dist/icons/cache.js +74 -0
- package/dist/icons/cache.js.map +1 -0
- package/dist/icons/component.d.ts +157 -0
- package/dist/icons/component.js +139 -0
- package/dist/icons/component.js.map +1 -0
- package/dist/icons/constants.d.ts +14 -0
- package/dist/icons/constants.js +16 -0
- package/dist/icons/constants.js.map +1 -0
- package/dist/icons/css-mode.d.ts +7 -0
- package/dist/icons/css-mode.js +51 -0
- package/dist/icons/css-mode.js.map +1 -0
- package/dist/icons/index.d.ts +14 -152
- package/dist/icons/index.js +30 -286
- package/dist/icons/index.js.map +1 -1
- package/dist/icons/local-svg.d.ts +5 -0
- package/dist/icons/local-svg.js +53 -0
- package/dist/icons/local-svg.js.map +1 -0
- package/dist/icons/normalize.d.ts +5 -0
- package/dist/icons/normalize.js +63 -0
- package/dist/icons/normalize.js.map +1 -0
- package/dist/icons/offline-loader.d.ts +21 -0
- package/dist/icons/offline-loader.js +94 -0
- package/dist/icons/offline-loader.js.map +1 -0
- package/dist/icons/parser.d.ts +5 -0
- package/dist/icons/parser.js +89 -0
- package/dist/icons/parser.js.map +1 -0
- package/dist/icons/registry.d.ts +6 -21
- package/dist/icons/registry.js +82 -75
- package/dist/icons/registry.js.map +1 -1
- package/dist/icons/resolver.d.ts +4 -0
- package/dist/icons/resolver.js +45 -0
- package/dist/icons/resolver.js.map +1 -0
- package/dist/icons/svg-mode.d.ts +4 -0
- package/dist/icons/svg-mode.js +54 -0
- package/dist/icons/svg-mode.js.map +1 -0
- package/dist/icons/transform.d.ts +11 -0
- package/dist/icons/transform.js +68 -0
- package/dist/icons/transform.js.map +1 -0
- package/dist/icons/types.d.ts +49 -0
- package/dist/icons/types.js +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2 -2
- package/dist/kit/index.d.ts +21 -25
- package/dist/kit/index.js +2 -4
- package/dist/kit/index.js.map +1 -1
- package/dist/nitro-server/index.d.ts +2 -5
- package/dist/nitro-server/index.js +2 -3
- package/dist/nitro-server/index.js.map +1 -1
- package/dist/node.d.ts +2 -6
- package/dist/node.js +7 -9
- package/dist/node.js.map +1 -1
- package/dist/reactivity/computed.d.ts +3 -7
- package/dist/reactivity/computed.js +4 -5
- package/dist/reactivity/computed.js.map +1 -1
- package/dist/reactivity/effect.d.ts +13 -17
- package/dist/reactivity/effect.js +11 -11
- package/dist/reactivity/effect.js.map +1 -1
- package/dist/reactivity/index.d.ts +1 -1
- package/dist/reactivity/index.js +3 -4
- package/dist/reactivity/reactive.d.ts +5 -8
- package/dist/reactivity/reactive.js +5 -7
- package/dist/reactivity/reactive.js.map +1 -1
- package/dist/reactivity/readonly.js +1 -3
- package/dist/reactivity/ref.d.ts +9 -12
- package/dist/reactivity/ref.js +6 -5
- package/dist/reactivity/ref.js.map +1 -1
- package/dist/reactivity/scheduler.d.ts +5 -7
- package/dist/reactivity/scheduler.js +2 -3
- package/dist/reactivity/scheduler.js.map +1 -1
- package/dist/reactivity/types.d.ts +11 -14
- package/dist/reactivity/types.js +1 -1
- package/dist/reactivity/utils.d.ts +9 -12
- package/dist/reactivity/utils.js +2 -3
- package/dist/reactivity/utils.js.map +1 -1
- package/dist/reactivity/watch.d.ts +3 -6
- package/dist/reactivity/watch.js +7 -7
- package/dist/reactivity/watch.js.map +1 -1
- package/dist/runtime/core.d.ts +4 -20
- package/dist/runtime/core.js +11 -24
- package/dist/runtime/core.js.map +1 -1
- package/dist/runtime/index.d.ts +162 -158
- package/dist/runtime/index.js +2749 -1025
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/reactivity.d.ts +4 -4
- package/dist/runtime/reactivity.js +2 -3
- package/dist/runtime/resume.d.ts +14 -51
- package/dist/runtime/resume.js +4 -34
- package/dist/runtime/resume.js.map +1 -1
- package/dist/runtime/router.d.ts +5 -17
- package/dist/runtime/router.js +7 -17
- package/dist/runtime/router.js.map +1 -1
- package/dist/runtime/streaming.d.ts +6 -13
- package/dist/runtime/streaming.js +4 -9
- package/dist/runtime/streaming.js.map +1 -1
- package/dist/runtime/view-transitions/detect.d.ts +11 -0
- package/dist/runtime/view-transitions/detect.js +16 -0
- package/dist/runtime/view-transitions/detect.js.map +1 -0
- package/dist/runtime/view-transitions/index.d.ts +4 -0
- package/dist/runtime/view-transitions/index.js +3 -0
- package/dist/runtime/view-transitions/transition.d.ts +4 -0
- package/dist/runtime/view-transitions/transition.js +41 -0
- package/dist/runtime/view-transitions/transition.js.map +1 -0
- package/dist/runtime/view-transitions/types.d.ts +8 -0
- package/dist/runtime/view-transitions/types.js +1 -0
- package/dist/security/media-fetch.d.ts +10 -13
- package/dist/security/media-fetch.js +5 -7
- package/dist/security/media-fetch.js.map +1 -1
- package/dist/security/path-boundary.d.ts +4 -7
- package/dist/security/path-boundary.js +2 -4
- package/dist/security/path-boundary.js.map +1 -1
- package/dist/ui/index.d.ts +367 -217
- package/dist/ui/index.js +199 -152
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/verification-code.d.ts +134 -0
- package/dist/ui/verification-code.js +472 -0
- package/dist/ui/verification-code.js.map +1 -0
- package/dist/vite-builder/index.d.ts +2 -5
- package/dist/vite-builder/index.js +2 -3
- package/dist/vite-builder/index.js.map +1 -1
- package/package.json +5 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ResuxModuleContainer } from "../core/module-container.js";
|
|
2
1
|
import { createResux } from "../core/resux.js";
|
|
2
|
+
import { ResuxModuleContainer } from "../core/module-container.js";
|
|
3
3
|
import { buildLocalePath, normalizeI18nRuntimeConfig } from "../i18n/shared.js";
|
|
4
|
-
import { getClientRuntimeSource } from "../runtime/index.js";
|
|
5
4
|
import { withResuxKitContext } from "../kit/index.js";
|
|
5
|
+
import { getClientRuntimeSource } from "../runtime/index.js";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import { existsSync, mkdirSync, statSync, writeFileSync } from "node:fs";
|
|
8
8
|
import { mkdir, readFile, readdir, rm, stat, writeFile } from "node:fs/promises";
|
|
@@ -14,8 +14,7 @@ import { NodeTypes, parse } from "@vue/compiler-dom";
|
|
|
14
14
|
import { compileStyle, parse as parse$1 } from "@vue/compiler-sfc";
|
|
15
15
|
import vuePlugin from "@vitejs/plugin-vue";
|
|
16
16
|
import { build } from "vite";
|
|
17
|
-
|
|
18
|
-
//#region src/compiler/index.ts
|
|
17
|
+
// src/compiler/index.ts
|
|
19
18
|
const require = createRequire(import.meta.url);
|
|
20
19
|
var ResuxCompileError = class extends Error {
|
|
21
20
|
location;
|
|
@@ -25,7 +24,7 @@ var ResuxCompileError = class extends Error {
|
|
|
25
24
|
this.location = location;
|
|
26
25
|
}
|
|
27
26
|
};
|
|
28
|
-
const RESUMABLE_HANDLER_ALLOWED_GLOBALS = new Set([
|
|
27
|
+
const RESUMABLE_HANDLER_ALLOWED_GLOBALS = /* @__PURE__ */ new Set([
|
|
29
28
|
"Math",
|
|
30
29
|
"Number",
|
|
31
30
|
"String",
|
|
@@ -358,8 +357,8 @@ async function buildProject(appRoot, outDir = path.join(appRoot, ".resux"), opti
|
|
|
358
357
|
const layouts = layoutFiles.map((file) => compiledByFile.get(file));
|
|
359
358
|
const plugins = unique(pluginFiles).sort((left, right) => normalizePath(left).localeCompare(normalizePath(right))).map((file, pluginIndex) => {
|
|
360
359
|
const compiled = compilePluginFile(file, pluginIndex);
|
|
361
|
-
const mode
|
|
362
|
-
if (mode
|
|
360
|
+
const mode = pluginModeByFile.get(file);
|
|
361
|
+
if (mode) compiled.mode = mode;
|
|
363
362
|
return compiled;
|
|
364
363
|
});
|
|
365
364
|
const clientEnhancements = plugins.filter((plugin) => plugin.mode !== "server" && clientEnhancementFileSet.has(normalizePath(path.resolve(plugin.file)))).map((plugin) => ({
|
|
@@ -539,6 +538,7 @@ async function buildProject(appRoot, outDir = path.join(appRoot, ".resux"), opti
|
|
|
539
538
|
serverHandlers,
|
|
540
539
|
vueIslands,
|
|
541
540
|
routeRules,
|
|
541
|
+
contributions,
|
|
542
542
|
app,
|
|
543
543
|
error
|
|
544
544
|
};
|
|
@@ -686,8 +686,7 @@ async function buildServerBundle(root, outDir) {
|
|
|
686
686
|
}
|
|
687
687
|
async function buildClientAssets(root, outDir, components, plugins, middleware, vueIslands, packageRegistry, hooks, contributions) {
|
|
688
688
|
const inputRoot = path.join(outDir, "vite-client");
|
|
689
|
-
const
|
|
690
|
-
const input = { "runtime-client": runtimeInput };
|
|
689
|
+
const input = { "runtime-client": await writeViteClientRuntime(outDir, packageRegistry) };
|
|
691
690
|
for (const component of components) input[`handlers/${component.id}`] = path.join(inputRoot, "handlers", `${component.id}.mjs`);
|
|
692
691
|
for (const plugin of plugins.filter((entry) => entry.mode !== "server")) input[`plugins/${plugin.id}`] = path.join(inputRoot, "plugins", `${plugin.id}.mjs`);
|
|
693
692
|
for (const entry of middleware.filter((candidate) => candidate.mode !== "server")) input[`middleware/${entry.id}`] = path.join(inputRoot, "middleware", `${entry.id}.mjs`);
|
|
@@ -961,30 +960,30 @@ function compileTemplateChildren(children, state) {
|
|
|
961
960
|
const conditionalDirective = resolveConditionalDirective(child, state);
|
|
962
961
|
if (!conditionalDirective) {
|
|
963
962
|
conditionalChainExpressions = null;
|
|
964
|
-
const compiledNode
|
|
965
|
-
if (compiledNode
|
|
963
|
+
const compiledNode = compileTemplateNode(child, state);
|
|
964
|
+
if (compiledNode) nodes.push(compiledNode);
|
|
966
965
|
continue;
|
|
967
966
|
}
|
|
968
967
|
if (conditionalDirective.kind === "if") {
|
|
969
968
|
const expressionResult = transformTemplateExpressionCode(conditionalDirective.expression, state.templateRefBindings, state.file, conditionalDirective.directive);
|
|
970
969
|
conditionalChainExpressions = [expressionResult.transformed];
|
|
971
|
-
const compiledNode
|
|
972
|
-
if (compiledNode
|
|
970
|
+
const compiledNode = compileTemplateNode(child, state, { ifExpressionOverride: expressionResult.transformed });
|
|
971
|
+
if (compiledNode) nodes.push(compiledNode);
|
|
973
972
|
continue;
|
|
974
973
|
}
|
|
975
974
|
if (!conditionalChainExpressions || conditionalChainExpressions.length === 0) throw new ResuxCompileError(`v-${conditionalDirective.kind} must follow a sibling with v-if or v-else-if.`, locationFromVueNode(state.file, conditionalDirective.directive));
|
|
976
975
|
if (conditionalDirective.kind === "else-if") {
|
|
977
976
|
const branchExpressionResult = transformTemplateExpressionCode(conditionalDirective.expression, state.templateRefBindings, state.file, conditionalDirective.directive);
|
|
978
|
-
const expression
|
|
977
|
+
const expression = `${buildConditionalChainGuard(conditionalChainExpressions)} && (${branchExpressionResult.transformed})`;
|
|
979
978
|
conditionalChainExpressions.push(branchExpressionResult.transformed);
|
|
980
|
-
const compiledNode
|
|
981
|
-
if (compiledNode
|
|
979
|
+
const compiledNode = compileTemplateNode(child, state, { ifExpressionOverride: expression });
|
|
980
|
+
if (compiledNode) nodes.push(compiledNode);
|
|
982
981
|
continue;
|
|
983
982
|
}
|
|
984
983
|
const expression = buildConditionalChainGuard(conditionalChainExpressions);
|
|
985
984
|
conditionalChainExpressions = null;
|
|
986
|
-
const compiledNode
|
|
987
|
-
if (compiledNode
|
|
985
|
+
const compiledNode = compileTemplateNode(child, state, { ifExpressionOverride: expression });
|
|
986
|
+
if (compiledNode) nodes.push(compiledNode);
|
|
988
987
|
continue;
|
|
989
988
|
}
|
|
990
989
|
if (child.type !== NodeTypes.TEXT || child.content.trim().length > 0) conditionalChainExpressions = null;
|
|
@@ -1077,27 +1076,27 @@ function compileTemplateNode(node, state, options = {}) {
|
|
|
1077
1076
|
if (prop.type !== NodeTypes.DIRECTIVE) continue;
|
|
1078
1077
|
if (prop.name === "bind") {
|
|
1079
1078
|
const arg = expressionContent(prop.arg);
|
|
1080
|
-
const expression
|
|
1081
|
-
if (!arg || !expression
|
|
1079
|
+
const expression = expressionContent(prop.exp);
|
|
1080
|
+
if (!arg || !expression) throw new ResuxCompileError("Dynamic bindings need an argument and expression.", locationFromVueNode(state.file, prop));
|
|
1082
1081
|
attrs.push({
|
|
1083
1082
|
kind: "dynamic",
|
|
1084
1083
|
name: arg,
|
|
1085
|
-
value: registerTemplateExpression(expression
|
|
1084
|
+
value: registerTemplateExpression(expression, state.templateRefBindings, state.file, prop, state),
|
|
1086
1085
|
bindingId: nextBindingId(state)
|
|
1087
1086
|
});
|
|
1088
1087
|
continue;
|
|
1089
1088
|
}
|
|
1090
1089
|
if (prop.name === "on") {
|
|
1091
1090
|
const arg = expressionContent(prop.arg);
|
|
1092
|
-
const expression
|
|
1091
|
+
const expression = expressionContent(prop.exp);
|
|
1093
1092
|
const modifiers = normalizeEventModifiers(prop.modifiers ?? [], state.file, prop);
|
|
1094
|
-
if (!arg || !expression
|
|
1095
|
-
const isSimpleIdentifier = /^[A-Za-z_$][\w$]*$/.test(expression
|
|
1096
|
-
if (isSimpleIdentifier && state.activeLocals.includes(expression
|
|
1097
|
-
const inlineHandler = !isSimpleIdentifier ? createInlineEventHandler(expression
|
|
1093
|
+
if (!arg || !expression) throw new ResuxCompileError("Events need an argument and expression.", locationFromVueNode(state.file, prop));
|
|
1094
|
+
const isSimpleIdentifier = /^[A-Za-z_$][\w$]*$/.test(expression);
|
|
1095
|
+
if (isSimpleIdentifier && state.activeLocals.includes(expression)) throw new ResuxCompileError(`Direct template-local event handler "${expression}" cannot be resumed because template locals are serialized by value. Call a top-level handler with serializable local data instead.`, locationFromVueNode(state.file, prop));
|
|
1096
|
+
const inlineHandler = !isSimpleIdentifier ? createInlineEventHandler(expression, state, prop) : null;
|
|
1098
1097
|
const event = {
|
|
1099
1098
|
name: arg,
|
|
1100
|
-
handler: inlineHandler?.name ?? expression
|
|
1099
|
+
handler: inlineHandler?.name ?? expression,
|
|
1101
1100
|
modifiers,
|
|
1102
1101
|
...inlineHandler?.locals.length ? { locals: inlineHandler.locals } : {}
|
|
1103
1102
|
};
|
|
@@ -1107,10 +1106,10 @@ function compileTemplateNode(node, state, options = {}) {
|
|
|
1107
1106
|
}
|
|
1108
1107
|
if (prop.name === "if") {
|
|
1109
1108
|
if (options.ifExpressionOverride) continue;
|
|
1110
|
-
const expression
|
|
1111
|
-
if (!expression
|
|
1109
|
+
const expression = expressionContent(prop.exp);
|
|
1110
|
+
if (!expression) throw new ResuxCompileError("v-if needs an expression.", locationFromVueNode(state.file, prop));
|
|
1112
1111
|
element.if = {
|
|
1113
|
-
expression: registerTemplateExpression(expression
|
|
1112
|
+
expression: registerTemplateExpression(expression, state.templateRefBindings, state.file, prop, state),
|
|
1114
1113
|
blockId: nextBindingId(state)
|
|
1115
1114
|
};
|
|
1116
1115
|
continue;
|
|
@@ -1120,50 +1119,50 @@ function compileTemplateNode(node, state, options = {}) {
|
|
|
1120
1119
|
throw new ResuxCompileError(`v-${prop.name} must follow a sibling with v-if or v-else-if.`, locationFromVueNode(state.file, prop));
|
|
1121
1120
|
}
|
|
1122
1121
|
if (prop.name === "for") {
|
|
1123
|
-
const expression
|
|
1124
|
-
if (!expression
|
|
1125
|
-
element.for = parseForExpression(expression
|
|
1122
|
+
const expression = expressionContent(prop.exp);
|
|
1123
|
+
if (!expression) throw new ResuxCompileError("v-for needs an expression.", locationFromVueNode(state.file, prop));
|
|
1124
|
+
element.for = parseForExpression(expression, state.file, prop, state);
|
|
1126
1125
|
element.for.source = registerTemplateExpression(element.for.source, state.templateRefBindings, state.file, prop, state);
|
|
1127
1126
|
continue;
|
|
1128
1127
|
}
|
|
1129
1128
|
if (prop.name === "show") {
|
|
1130
|
-
const expression
|
|
1131
|
-
if (!expression
|
|
1129
|
+
const expression = expressionContent(prop.exp);
|
|
1130
|
+
if (!expression) throw new ResuxCompileError("v-show needs an expression.", locationFromVueNode(state.file, prop));
|
|
1132
1131
|
attrs.push({
|
|
1133
1132
|
kind: "dynamic",
|
|
1134
1133
|
name: "hidden",
|
|
1135
|
-
value: registerRawTemplateExpression(`!(${transformTemplateExpressionCode(expression
|
|
1134
|
+
value: registerRawTemplateExpression(`!(${transformTemplateExpressionCode(expression, state.templateRefBindings, state.file, prop).transformed})`, expression, transformTemplateExpressionCode(expression, state.templateRefBindings, state.file, prop).identifiers, state),
|
|
1136
1135
|
bindingId: nextBindingId(state)
|
|
1137
1136
|
});
|
|
1138
1137
|
continue;
|
|
1139
1138
|
}
|
|
1140
1139
|
if (prop.name === "text") {
|
|
1141
|
-
const expression
|
|
1142
|
-
if (!expression
|
|
1140
|
+
const expression = expressionContent(prop.exp);
|
|
1141
|
+
if (!expression) throw new ResuxCompileError("v-text needs an expression.", locationFromVueNode(state.file, prop));
|
|
1143
1142
|
element.children = [{
|
|
1144
1143
|
type: "interpolation",
|
|
1145
|
-
expression: registerTemplateExpression(expression
|
|
1144
|
+
expression: registerTemplateExpression(expression, state.templateRefBindings, state.file, prop, state),
|
|
1146
1145
|
bindingId: nextBindingId(state)
|
|
1147
1146
|
}];
|
|
1148
1147
|
continue;
|
|
1149
1148
|
}
|
|
1150
1149
|
if (prop.name === "html") {
|
|
1151
|
-
const expression
|
|
1152
|
-
if (!expression
|
|
1150
|
+
const expression = expressionContent(prop.exp);
|
|
1151
|
+
if (!expression) throw new ResuxCompileError("v-html needs an expression.", locationFromVueNode(state.file, prop));
|
|
1153
1152
|
element.html = {
|
|
1154
|
-
expression: registerTemplateExpression(expression
|
|
1153
|
+
expression: registerTemplateExpression(expression, state.templateRefBindings, state.file, prop, state),
|
|
1155
1154
|
bindingId: nextBindingId(state)
|
|
1156
1155
|
};
|
|
1157
1156
|
element.children = [];
|
|
1158
1157
|
continue;
|
|
1159
1158
|
}
|
|
1160
1159
|
if (prop.name === "model") {
|
|
1161
|
-
const expression
|
|
1162
|
-
if (!expression
|
|
1163
|
-
if (!isAssignableExpression(expression
|
|
1164
|
-
const assignmentRoot = assignableExpressionRoot(expression
|
|
1160
|
+
const expression = expressionContent(prop.exp);
|
|
1161
|
+
if (!expression) throw new ResuxCompileError("v-model needs an expression.", locationFromVueNode(state.file, prop));
|
|
1162
|
+
if (!isAssignableExpression(expression)) throw new ResuxCompileError("v-model needs an assignable expression like \"message.value\".", locationFromVueNode(state.file, prop));
|
|
1163
|
+
const assignmentRoot = assignableExpressionRoot(expression);
|
|
1165
1164
|
if (assignmentRoot && state.activeLocals.includes(assignmentRoot)) throw new ResuxCompileError(`v-model cannot assign through template-local binding "${assignmentRoot}" because resumed event locals are serialized by value. Bind v-model to resumable component state instead.`, locationFromVueNode(state.file, prop));
|
|
1166
|
-
const model = createModelBinding(node.tag, node.props, expression
|
|
1165
|
+
const model = createModelBinding(node.tag, node.props, expression, state, prop);
|
|
1167
1166
|
attrs.push({
|
|
1168
1167
|
kind: "dynamic",
|
|
1169
1168
|
name: model.attribute,
|
|
@@ -1336,7 +1335,7 @@ function assignableExpressionRoot(expression) {
|
|
|
1336
1335
|
}
|
|
1337
1336
|
function normalizeEventModifiers(modifiers, file, node) {
|
|
1338
1337
|
const modifierNames = modifiers.map((modifier) => String(modifier.content));
|
|
1339
|
-
const supported = new Set([
|
|
1338
|
+
const supported = /* @__PURE__ */ new Set([
|
|
1340
1339
|
"prevent",
|
|
1341
1340
|
"stop",
|
|
1342
1341
|
"self",
|
|
@@ -1430,7 +1429,7 @@ function findProjectRoot(startFile) {
|
|
|
1430
1429
|
}
|
|
1431
1430
|
return path.dirname(startFile);
|
|
1432
1431
|
}
|
|
1433
|
-
const IMAGE_VIDEO_FONT_EXTENSIONS = new Set([
|
|
1432
|
+
const IMAGE_VIDEO_FONT_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
1434
1433
|
".webp",
|
|
1435
1434
|
".png",
|
|
1436
1435
|
".jpg",
|
|
@@ -1448,7 +1447,7 @@ const IMAGE_VIDEO_FONT_EXTENSIONS = new Set([
|
|
|
1448
1447
|
".ttf",
|
|
1449
1448
|
".eot"
|
|
1450
1449
|
]);
|
|
1451
|
-
const STYLESHEET_EXTENSIONS = new Set([
|
|
1450
|
+
const STYLESHEET_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
1452
1451
|
".css",
|
|
1453
1452
|
".scss",
|
|
1454
1453
|
".sass",
|
|
@@ -1481,11 +1480,11 @@ function ensureCompiledUserModule(resolvedFile, projectRoot, outDir, compiledSet
|
|
|
1481
1480
|
if (ext === ".ts" || ext === ".tsx" || ext === ".js" || ext === ".jsx") {
|
|
1482
1481
|
const compiledTarget = ensureCompiledUserModule(resolvedImported, projectRoot, outDir, compiledSet);
|
|
1483
1482
|
const relativeToCompiled = path.relative(path.dirname(targetJsFile), compiledTarget);
|
|
1484
|
-
const relativeImportPath
|
|
1483
|
+
const relativeImportPath = relativeToCompiled.startsWith(".") ? relativeToCompiled.replace(/\\/g, "/") : "./" + relativeToCompiled.replace(/\\/g, "/");
|
|
1485
1484
|
replacements.push({
|
|
1486
1485
|
start: specifier.getStart(sourceFile),
|
|
1487
1486
|
end: specifier.getEnd(),
|
|
1488
|
-
replacement: JSON.stringify(relativeImportPath
|
|
1487
|
+
replacement: JSON.stringify(relativeImportPath)
|
|
1489
1488
|
});
|
|
1490
1489
|
}
|
|
1491
1490
|
}
|
|
@@ -1517,41 +1516,45 @@ function processImportDeclaration(statement, sourceFile, file, client, outDir) {
|
|
|
1517
1516
|
const isRelative = importPath.startsWith(".");
|
|
1518
1517
|
const isAlias = importPath.startsWith("@/") || importPath.startsWith("~/");
|
|
1519
1518
|
const ext = path.extname(importPath).toLowerCase();
|
|
1520
|
-
if (IMAGE_VIDEO_FONT_EXTENSIONS.has(ext) || STYLESHEET_EXTENSIONS.has(ext))
|
|
1521
|
-
if (
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1519
|
+
if (IMAGE_VIDEO_FONT_EXTENSIONS.has(ext) || STYLESHEET_EXTENSIONS.has(ext)) {
|
|
1520
|
+
if (client) {
|
|
1521
|
+
if (isRelative) {
|
|
1522
|
+
const normalized = fileUrl(path.resolve(path.dirname(file), importPath));
|
|
1523
|
+
const fullText = statement.getFullText(sourceFile);
|
|
1524
|
+
const start = specifier.getStart(sourceFile) - statement.getFullStart();
|
|
1525
|
+
const end = specifier.getEnd() - statement.getFullStart();
|
|
1526
|
+
return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);
|
|
1527
|
+
}
|
|
1528
|
+
if (isAlias) {
|
|
1529
|
+
const projectRoot = findProjectRoot(file);
|
|
1530
|
+
const normalized = fileUrl(path.resolve(projectRoot, importPath.slice(2)));
|
|
1531
|
+
const fullText = statement.getFullText(sourceFile);
|
|
1532
|
+
const start = specifier.getStart(sourceFile) - statement.getFullStart();
|
|
1533
|
+
const end = specifier.getEnd() - statement.getFullStart();
|
|
1534
|
+
return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);
|
|
1535
|
+
}
|
|
1536
|
+
return statement.getFullText(sourceFile);
|
|
1537
|
+
} else {
|
|
1538
|
+
if (STYLESHEET_EXTENSIONS.has(ext)) return "";
|
|
1529
1539
|
const projectRoot = findProjectRoot(file);
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1540
|
+
let absolutePath = "";
|
|
1541
|
+
if (isAlias) absolutePath = path.resolve(projectRoot, importPath.slice(2));
|
|
1542
|
+
else if (isRelative) absolutePath = path.resolve(path.dirname(file), importPath);
|
|
1543
|
+
else absolutePath = importPath;
|
|
1544
|
+
let webPath = importPath;
|
|
1545
|
+
const relativeToRoot = path.relative(projectRoot, absolutePath);
|
|
1546
|
+
if (relativeToRoot === "" || relativeToRoot !== ".." && !relativeToRoot.startsWith(`..${path.sep}`) && !path.isAbsolute(relativeToRoot)) webPath = "/" + relativeToRoot.replace(/\\/g, "/");
|
|
1547
|
+
const clause = statement.importClause;
|
|
1548
|
+
if (!clause) return "";
|
|
1549
|
+
const bindings = [];
|
|
1550
|
+
if (clause.name) bindings.push(clause.name.text);
|
|
1551
|
+
if (clause.namedBindings) {
|
|
1552
|
+
if (ts.isNamespaceImport(clause.namedBindings)) bindings.push(clause.namedBindings.name.text);
|
|
1553
|
+
else for (const element of clause.namedBindings.elements) bindings.push(element.name.text);
|
|
1554
|
+
}
|
|
1555
|
+
if (bindings.length === 0) return "";
|
|
1556
|
+
return bindings.map((name) => `const ${name} = ${JSON.stringify(webPath)};`).join("\n");
|
|
1535
1557
|
}
|
|
1536
|
-
return statement.getFullText(sourceFile);
|
|
1537
|
-
} else {
|
|
1538
|
-
if (STYLESHEET_EXTENSIONS.has(ext)) return "";
|
|
1539
|
-
const projectRoot = findProjectRoot(file);
|
|
1540
|
-
let absolutePath = "";
|
|
1541
|
-
if (isAlias) absolutePath = path.resolve(projectRoot, importPath.slice(2));
|
|
1542
|
-
else if (isRelative) absolutePath = path.resolve(path.dirname(file), importPath);
|
|
1543
|
-
else absolutePath = importPath;
|
|
1544
|
-
let webPath = importPath;
|
|
1545
|
-
const relativeToRoot = path.relative(projectRoot, absolutePath);
|
|
1546
|
-
if (relativeToRoot === "" || relativeToRoot !== ".." && !relativeToRoot.startsWith(`..${path.sep}`) && !path.isAbsolute(relativeToRoot)) webPath = "/" + relativeToRoot.replace(/\\/g, "/");
|
|
1547
|
-
const clause = statement.importClause;
|
|
1548
|
-
if (!clause) return "";
|
|
1549
|
-
const bindings = [];
|
|
1550
|
-
if (clause.name) bindings.push(clause.name.text);
|
|
1551
|
-
if (clause.namedBindings) if (ts.isNamespaceImport(clause.namedBindings)) bindings.push(clause.namedBindings.name.text);
|
|
1552
|
-
else for (const element of clause.namedBindings.elements) bindings.push(element.name.text);
|
|
1553
|
-
if (bindings.length === 0) return "";
|
|
1554
|
-
return bindings.map((name) => `const ${name} = ${JSON.stringify(webPath)};`).join("\n");
|
|
1555
1558
|
}
|
|
1556
1559
|
if (isRelative) {
|
|
1557
1560
|
const resolvedPath = resolveFileExtension(path.resolve(path.dirname(file), importPath));
|
|
@@ -1584,35 +1587,37 @@ function processImportDeclaration(statement, sourceFile, file, client, outDir) {
|
|
|
1584
1587
|
const isRelative = importPath.startsWith(".");
|
|
1585
1588
|
const isAlias = importPath.startsWith("@/") || importPath.startsWith("~/");
|
|
1586
1589
|
const ext = path.extname(importPath).toLowerCase();
|
|
1587
|
-
if (IMAGE_VIDEO_FONT_EXTENSIONS.has(ext) || STYLESHEET_EXTENSIONS.has(ext))
|
|
1588
|
-
if (
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1590
|
+
if (IMAGE_VIDEO_FONT_EXTENSIONS.has(ext) || STYLESHEET_EXTENSIONS.has(ext)) {
|
|
1591
|
+
if (client) {
|
|
1592
|
+
if (isRelative) {
|
|
1593
|
+
const normalized = fileUrl(path.resolve(path.dirname(file), importPath));
|
|
1594
|
+
const fullText = statement.getFullText(sourceFile);
|
|
1595
|
+
const start = specifier.getStart(sourceFile) - statement.getFullStart();
|
|
1596
|
+
const end = specifier.getEnd() - statement.getFullStart();
|
|
1597
|
+
return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);
|
|
1598
|
+
}
|
|
1599
|
+
if (isAlias) {
|
|
1600
|
+
const projectRoot = findProjectRoot(file);
|
|
1601
|
+
const normalized = fileUrl(path.resolve(projectRoot, importPath.slice(2)));
|
|
1602
|
+
const fullText = statement.getFullText(sourceFile);
|
|
1603
|
+
const start = specifier.getStart(sourceFile) - statement.getFullStart();
|
|
1604
|
+
const end = specifier.getEnd() - statement.getFullStart();
|
|
1605
|
+
return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);
|
|
1606
|
+
}
|
|
1607
|
+
return statement.getFullText(sourceFile);
|
|
1608
|
+
} else {
|
|
1609
|
+
if (STYLESHEET_EXTENSIONS.has(ext)) return "";
|
|
1596
1610
|
const projectRoot = findProjectRoot(file);
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1611
|
+
let absolutePath = "";
|
|
1612
|
+
if (isAlias) absolutePath = path.resolve(projectRoot, importPath.slice(2));
|
|
1613
|
+
else if (isRelative) absolutePath = path.resolve(path.dirname(file), importPath);
|
|
1614
|
+
else absolutePath = importPath;
|
|
1615
|
+
let webPath = importPath;
|
|
1616
|
+
const relativeToRoot = path.relative(projectRoot, absolutePath);
|
|
1617
|
+
if (relativeToRoot === "" || relativeToRoot !== ".." && !relativeToRoot.startsWith(`..${path.sep}`) && !path.isAbsolute(relativeToRoot)) webPath = "/" + relativeToRoot.replace(/\\/g, "/");
|
|
1618
|
+
if (!statement.name) return "";
|
|
1619
|
+
return `const ${statement.name.text} = ${JSON.stringify(webPath)};`;
|
|
1602
1620
|
}
|
|
1603
|
-
return statement.getFullText(sourceFile);
|
|
1604
|
-
} else {
|
|
1605
|
-
if (STYLESHEET_EXTENSIONS.has(ext)) return "";
|
|
1606
|
-
const projectRoot = findProjectRoot(file);
|
|
1607
|
-
let absolutePath = "";
|
|
1608
|
-
if (isAlias) absolutePath = path.resolve(projectRoot, importPath.slice(2));
|
|
1609
|
-
else if (isRelative) absolutePath = path.resolve(path.dirname(file), importPath);
|
|
1610
|
-
else absolutePath = importPath;
|
|
1611
|
-
let webPath = importPath;
|
|
1612
|
-
const relativeToRoot = path.relative(projectRoot, absolutePath);
|
|
1613
|
-
if (relativeToRoot === "" || relativeToRoot !== ".." && !relativeToRoot.startsWith(`..${path.sep}`) && !path.isAbsolute(relativeToRoot)) webPath = "/" + relativeToRoot.replace(/\\/g, "/");
|
|
1614
|
-
if (!statement.name) return "";
|
|
1615
|
-
return `const ${statement.name.text} = ${JSON.stringify(webPath)};`;
|
|
1616
1621
|
}
|
|
1617
1622
|
if (isRelative) {
|
|
1618
1623
|
const resolvedPath = resolveFileExtension(path.resolve(path.dirname(file), importPath));
|
|
@@ -1667,12 +1672,14 @@ function analyzeScript(script, file, inlineHandlers = []) {
|
|
|
1667
1672
|
bindings.add(clause.name.text);
|
|
1668
1673
|
importedBindings.add(clause.name.text);
|
|
1669
1674
|
}
|
|
1670
|
-
if (clause.namedBindings)
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1675
|
+
if (clause.namedBindings) {
|
|
1676
|
+
if (ts.isNamespaceImport(clause.namedBindings)) {
|
|
1677
|
+
bindings.add(clause.namedBindings.name.text);
|
|
1678
|
+
importedBindings.add(clause.namedBindings.name.text);
|
|
1679
|
+
} else for (const element of clause.namedBindings.elements) {
|
|
1680
|
+
bindings.add(element.name.text);
|
|
1681
|
+
importedBindings.add(element.name.text);
|
|
1682
|
+
}
|
|
1676
1683
|
}
|
|
1677
1684
|
}
|
|
1678
1685
|
} else if (ts.isImportEqualsDeclaration(statement) && statement.name) {
|
|
@@ -1813,7 +1820,7 @@ function readPropertyName(name, sourceFile, file) {
|
|
|
1813
1820
|
throw new ResuxCompileError("Only simple property names are supported here.", locationFromTsNode(file, sourceFile, name));
|
|
1814
1821
|
}
|
|
1815
1822
|
function validateTemplateHandlers(events, analysis, file, fullSource, templateLocals = []) {
|
|
1816
|
-
const allowedHandlers = new Set([...analysis.handlerNames, ...templateLocals]);
|
|
1823
|
+
const allowedHandlers = /* @__PURE__ */ new Set([...analysis.handlerNames, ...templateLocals]);
|
|
1817
1824
|
for (const event of events) {
|
|
1818
1825
|
if (!allowedHandlers.has(event.handler)) throw new ResuxCompileError(`Handler "${event.handler}" must be a top-level function or arrow function.`, locationFromOffset(file, fullSource, 0));
|
|
1819
1826
|
const handlerNode = analysis.handlers.get(event.handler);
|
|
@@ -1824,12 +1831,12 @@ function validateTemplateHandlers(events, analysis, file, fullSource, templateLo
|
|
|
1824
1831
|
}
|
|
1825
1832
|
}
|
|
1826
1833
|
function findUnsupportedCapture(node, handlerName, analysis, templateLocals = []) {
|
|
1827
|
-
const locals = new Set([
|
|
1834
|
+
const locals = /* @__PURE__ */ new Set([
|
|
1828
1835
|
handlerName,
|
|
1829
1836
|
"event",
|
|
1830
1837
|
...templateLocals
|
|
1831
1838
|
]);
|
|
1832
|
-
const allowedTopLevel = new Set([
|
|
1839
|
+
const allowedTopLevel = /* @__PURE__ */ new Set([
|
|
1833
1840
|
...analysis.resumableBindings,
|
|
1834
1841
|
...analysis.handlerNames,
|
|
1835
1842
|
...analysis.importedBindings
|
|
@@ -2326,13 +2333,15 @@ function createRuntimeConfig(config) {
|
|
|
2326
2333
|
const runtimeConfig = config.runtimeConfig;
|
|
2327
2334
|
const packagesConfig = isPlainObject(config.packages) ? config.packages : null;
|
|
2328
2335
|
const videoConfig = isPlainObject(config.video) ? config.video : null;
|
|
2336
|
+
const routerConfig = isPlainObject(config.router) ? config.router : null;
|
|
2329
2337
|
const publicConfig = runtimeConfig?.public && typeof runtimeConfig.public === "object" && !Array.isArray(runtimeConfig.public) ? runtimeConfig.public : {};
|
|
2330
2338
|
const appRuntimeConfig = {
|
|
2331
2339
|
...runtimeConfig ?? {},
|
|
2332
2340
|
public: {
|
|
2333
2341
|
...publicConfig,
|
|
2334
2342
|
...packagesConfig ? { packages: packagesConfig } : {},
|
|
2335
|
-
...videoConfig ? { video: videoConfig } : {}
|
|
2343
|
+
...videoConfig ? { video: videoConfig } : {},
|
|
2344
|
+
...routerConfig ? { router: routerConfig } : {}
|
|
2336
2345
|
}
|
|
2337
2346
|
};
|
|
2338
2347
|
const halalConfig = config.halalAI;
|
|
@@ -2490,7 +2499,7 @@ function createSupportModuleAutoImportPrefix(file, source, autoImports) {
|
|
|
2490
2499
|
for (const name of entry.names) {
|
|
2491
2500
|
if (seen.has(name) || declared.has(name)) continue;
|
|
2492
2501
|
seen.add(name);
|
|
2493
|
-
if (!
|
|
2502
|
+
if (!new RegExp(`\\b${name}\\b`).test(source)) continue;
|
|
2494
2503
|
names.push(name);
|
|
2495
2504
|
}
|
|
2496
2505
|
if (names.length > 0) lines.push(`import { ${names.join(", ")} } from ${JSON.stringify(entry.from)};`);
|
|
@@ -2506,8 +2515,10 @@ function collectSupportModuleTopLevelBindings(file, source) {
|
|
|
2506
2515
|
const clause = statement.importClause;
|
|
2507
2516
|
if (!clause) continue;
|
|
2508
2517
|
if (clause.name) bindings.add(clause.name.text);
|
|
2509
|
-
if (clause.namedBindings)
|
|
2510
|
-
|
|
2518
|
+
if (clause.namedBindings) {
|
|
2519
|
+
if (ts.isNamespaceImport(clause.namedBindings)) bindings.add(clause.namedBindings.name.text);
|
|
2520
|
+
else for (const element of clause.namedBindings.elements) bindings.add(element.name.text);
|
|
2521
|
+
}
|
|
2511
2522
|
continue;
|
|
2512
2523
|
}
|
|
2513
2524
|
if (ts.isVariableStatement(statement)) {
|
|
@@ -2621,7 +2632,8 @@ function createModuleOptions(module, options) {
|
|
|
2621
2632
|
return options;
|
|
2622
2633
|
}
|
|
2623
2634
|
function resolveBuiltinModule(specifier) {
|
|
2624
|
-
|
|
2635
|
+
const normalized = specifier.startsWith("resux:") ? specifier.slice(6) : specifier;
|
|
2636
|
+
return builtinModules$1[normalized] ?? null;
|
|
2625
2637
|
}
|
|
2626
2638
|
const i18nBuiltinModule = { async setup(options, resux) {
|
|
2627
2639
|
const imported = await import("../i18n/index.js");
|
|
@@ -3307,7 +3319,7 @@ function resolveConfiguredPackageMode(packageName, config) {
|
|
|
3307
3319
|
async function analyzePackageUsage(appRoot, sources, runtimeConfig) {
|
|
3308
3320
|
const configuredPackages = readConfiguredPackages(runtimeConfig);
|
|
3309
3321
|
const map = /* @__PURE__ */ new Map();
|
|
3310
|
-
const ignoredPackages = new Set([
|
|
3322
|
+
const ignoredPackages = /* @__PURE__ */ new Set([
|
|
3311
3323
|
"resuxjs",
|
|
3312
3324
|
"vue",
|
|
3313
3325
|
"h3",
|
|
@@ -3534,7 +3546,6 @@ function resolveFileExtension(filePath) {
|
|
|
3534
3546
|
function fileUrl(file) {
|
|
3535
3547
|
return pathToFileURL(file).href;
|
|
3536
3548
|
}
|
|
3537
|
-
|
|
3538
|
-
//#endregion
|
|
3539
3549
|
export { ResuxCompileError, buildProject, compileVueFile, compileVueSource, createRouteManifest, fileUrl, resolveFileExtension };
|
|
3550
|
+
|
|
3540
3551
|
//# sourceMappingURL=index.js.map
|
package/dist/compiler/index.d.ts
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
import { BuildOptions, BuildResult, ClientEnhancementManifestEntry, CompileErrorLocation, CompiledComponent, CompiledMiddleware, CompiledPlugin, CompiledServerMiddleware, ResuxCompileError, RouteManifestRecord, RouteRuleConfig, ServerHandlerRecord, VueIslandRecord, createRouteManifest, fileUrl, resolveFileExtension } from "./implementation.js";
|
|
2
2
|
import { normalizeResuxDirectiveSyntax, normalizeResuxSfcSource } from "./directives.js";
|
|
3
|
-
|
|
4
|
-
//#region src/compiler/adapter.d.ts
|
|
5
|
-
interface ResuxCompileVueSourceOptions {
|
|
3
|
+
export interface ResuxCompileVueSourceOptions {
|
|
6
4
|
file: string;
|
|
7
5
|
id: string;
|
|
8
6
|
name: string;
|
|
9
7
|
/** Enables development-only compiler diagnostics. */
|
|
10
8
|
dev?: boolean;
|
|
11
9
|
}
|
|
12
|
-
declare function compileVueSource(source: string, options: ResuxCompileVueSourceOptions): CompiledComponent;
|
|
13
|
-
declare function compileVueFile(file: string, options: {
|
|
10
|
+
export declare function compileVueSource(source: string, options: ResuxCompileVueSourceOptions): CompiledComponent;
|
|
11
|
+
export declare function compileVueFile(file: string, options: {
|
|
14
12
|
id: string;
|
|
15
13
|
name?: string;
|
|
16
14
|
dev?: boolean;
|
|
17
15
|
}): Promise<CompiledComponent>;
|
|
18
|
-
declare function buildProject(appRoot: string, outDir?: string, options?: BuildOptions): Promise<BuildResult>;
|
|
19
|
-
|
|
20
|
-
export { BuildOptions, BuildResult, ClientEnhancementManifestEntry, CompileErrorLocation, CompiledComponent, CompiledMiddleware, CompiledPlugin, CompiledServerMiddleware, ResuxCompileError, ResuxCompileVueSourceOptions, RouteManifestRecord, RouteRuleConfig, ServerHandlerRecord, VueIslandRecord, buildProject, compileVueFile, compileVueSource, createRouteManifest, fileUrl, normalizeResuxDirectiveSyntax, normalizeResuxSfcSource, resolveFileExtension };
|
|
16
|
+
export declare function buildProject(appRoot: string, outDir?: string, options?: BuildOptions): Promise<BuildResult>;
|
|
17
|
+
export { BuildOptions, BuildResult, ClientEnhancementManifestEntry, CompileErrorLocation, CompiledComponent, CompiledMiddleware, CompiledPlugin, CompiledServerMiddleware, ResuxCompileError, RouteManifestRecord, RouteRuleConfig, ServerHandlerRecord, VueIslandRecord, createRouteManifest, fileUrl, normalizeResuxDirectiveSyntax, normalizeResuxSfcSource, resolveFileExtension };
|
|
21
18
|
//# sourceMappingURL=adapter.d.ts.map
|
package/dist/compiler/index.js
CHANGED
|
@@ -5,8 +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
|
-
|
|
9
|
-
//#region src/compiler/adapter.ts
|
|
8
|
+
// src/compiler/adapter.ts
|
|
10
9
|
function compileVueSource(source, options) {
|
|
11
10
|
const usesResuxDirectives = source.includes("rx-");
|
|
12
11
|
if (options.dev === true) emitResuxDevWarnings(source, options.file);
|
|
@@ -76,7 +75,6 @@ async function withResuxDirectiveFileReads(task, emittedDevWarnings) {
|
|
|
76
75
|
function pascalCase(value) {
|
|
77
76
|
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("");
|
|
78
77
|
}
|
|
79
|
-
|
|
80
|
-
//#endregion
|
|
81
78
|
export { ResuxCompileError, buildProject, compileVueFile, compileVueSource, createRouteManifest, fileUrl, normalizeResuxDirectiveSyntax, normalizeResuxSfcSource, resolveFileExtension };
|
|
79
|
+
|
|
82
80
|
//# sourceMappingURL=adapter.js.map
|