@ccslabs/xtend 0.1.0-rc.1
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/CHANGELOG.md +65 -0
- package/LICENSE +201 -0
- package/README.md +184 -0
- package/a11y/motion-contrast-policy.d.ts +32 -0
- package/a11y/motion-contrast-policy.js +261 -0
- package/a11y/runtime-a11y-contract.d.ts +44 -0
- package/a11y/runtime-a11y-contract.js +385 -0
- package/a11y/screenreader-signals.d.ts +32 -0
- package/a11y/screenreader-signals.js +372 -0
- package/api.d.ts +168 -0
- package/api.js +864 -0
- package/catalog/catalog-public-types.d.ts +66 -0
- package/catalog/component-catalog-coverage.d.ts +20 -0
- package/catalog/component-catalog-coverage.js +377 -0
- package/catalog/component-long-tail-migration.d.ts +18 -0
- package/catalog/component-long-tail-migration.js +305 -0
- package/catalog/component-regression-priority.d.ts +20 -0
- package/catalog/component-regression-priority.js +305 -0
- package/catalog/enterprise-component-flex-release-handoff.d.ts +32 -0
- package/catalog/enterprise-component-flex-release-handoff.js +437 -0
- package/catalog/enterprise-component-style-audit.d.ts +22 -0
- package/catalog/enterprise-component-style-audit.js +353 -0
- package/catalog/enterprise-form-control-theme-a11y.d.ts +19 -0
- package/catalog/enterprise-form-control-theme-a11y.js +220 -0
- package/catalog/enterprise-icon-control-audit.d.ts +21 -0
- package/catalog/enterprise-icon-control-audit.js +258 -0
- package/catalog/enterprise-layout-display-media-tokenization.d.ts +20 -0
- package/catalog/enterprise-layout-display-media-tokenization.js +237 -0
- package/catalog/enterprise-navigation-routing-state-hardening.d.ts +20 -0
- package/catalog/enterprise-navigation-routing-state-hardening.js +255 -0
- package/catalog/enterprise-overlay-mode-token-parity.d.ts +15 -0
- package/catalog/enterprise-overlay-mode-token-parity.js +178 -0
- package/catalog/enterprise-third-party-authoring-guide.d.ts +23 -0
- package/catalog/enterprise-third-party-authoring-guide.js +310 -0
- package/catalog/enterprise-visual-dom-snapshot-matrix.d.ts +31 -0
- package/catalog/enterprise-visual-dom-snapshot-matrix.js +357 -0
- package/catalog/epic10-existing-component-metadata.d.ts +25 -0
- package/catalog/epic10-existing-component-metadata.js +534 -0
- package/catalog/epic10-p0-component-wave.d.ts +28 -0
- package/catalog/epic10-p0-component-wave.js +688 -0
- package/catalog/epic10-platform-gates.d.ts +31 -0
- package/catalog/epic10-platform-gates.js +425 -0
- package/catalog/epic10-release-handoff.d.ts +30 -0
- package/catalog/epic10-release-handoff.js +195 -0
- package/catalog/epic11-enterprise-ux-handoff.d.ts +29 -0
- package/catalog/epic11-enterprise-ux-handoff.js +403 -0
- package/catalog/epic12-docs-adoption.d.ts +29 -0
- package/catalog/epic12-docs-adoption.js +183 -0
- package/catalog/epic12-rc0-gate-matrix.d.ts +36 -0
- package/catalog/epic12-rc0-gate-matrix.js +439 -0
- package/catalog/epic12-rc0-handoff.d.ts +30 -0
- package/catalog/epic12-rc0-handoff.js +385 -0
- package/catalog/epic13-conditional-network-evidence-ci.d.ts +35 -0
- package/catalog/epic13-conditional-network-evidence-ci.js +278 -0
- package/catalog/epic13-conditional-network-evidence.d.ts +34 -0
- package/catalog/epic13-conditional-network-evidence.js +280 -0
- package/catalog/epic13-docs-rmt-production-hardening.d.ts +39 -0
- package/catalog/epic13-docs-rmt-production-hardening.js +286 -0
- package/catalog/epic13-hydration-performance-closure.d.ts +33 -0
- package/catalog/epic13-hydration-performance-closure.js +234 -0
- package/catalog/epic13-known-residual-triage.d.ts +32 -0
- package/catalog/epic13-known-residual-triage.js +339 -0
- package/catalog/epic13-package-export-lock.d.ts +41 -0
- package/catalog/epic13-package-export-lock.js +604 -0
- package/catalog/epic13-prod-browser-csp-smoke.d.ts +35 -0
- package/catalog/epic13-prod-browser-csp-smoke.js +218 -0
- package/catalog/epic13-rc1-gate-matrix-ci-handoff.d.ts +36 -0
- package/catalog/epic13-rc1-gate-matrix-ci-handoff.js +418 -0
- package/catalog/epic13-rc1-migration-notes.d.ts +36 -0
- package/catalog/epic13-rc1-migration-notes.js +271 -0
- package/catalog/epic13-rc1-readiness.d.ts +33 -0
- package/catalog/epic13-rc1-readiness.js +487 -0
- package/catalog/epic13-release-owner-acceptance.d.ts +33 -0
- package/catalog/epic13-release-owner-acceptance.js +354 -0
- package/catalog/epic13-release-report-pack-dry-run-evidence.d.ts +36 -0
- package/catalog/epic13-release-report-pack-dry-run-evidence.js +253 -0
- package/catalog/epic13-rmt-production-readiness.d.ts +35 -0
- package/catalog/epic13-rmt-production-readiness.js +314 -0
- package/catalog/epic13-trusted-dom-boundary.d.ts +36 -0
- package/catalog/epic13-trusted-dom-boundary.js +230 -0
- package/catalog/epic13-visual-owner-artifact.d.ts +35 -0
- package/catalog/epic13-visual-owner-artifact.js +233 -0
- package/catalog/epic14-lsp-handoff.d.ts +28 -0
- package/catalog/epic14-lsp-handoff.js +312 -0
- package/catalog/epic14-rmt-tooling.d.ts +33 -0
- package/catalog/epic14-rmt-tooling.js +282 -0
- package/catalog/surface-manager-adapter-runtime.d.ts +37 -0
- package/catalog/surface-manager-adapter-runtime.js +203 -0
- package/catalog/surface-manager-browser-lab.d.ts +39 -0
- package/catalog/surface-manager-browser-lab.js +225 -0
- package/catalog/surface-manager-controller.d.ts +43 -0
- package/catalog/surface-manager-controller.js +290 -0
- package/catalog/surface-manager-layout-engines.d.ts +32 -0
- package/catalog/surface-manager-layout-engines.js +161 -0
- package/catalog/surface-manager-lazy-loading.d.ts +35 -0
- package/catalog/surface-manager-lazy-loading.js +173 -0
- package/catalog/surface-manager-materialization.d.ts +37 -0
- package/catalog/surface-manager-materialization.js +202 -0
- package/catalog/surface-manager-native-rmt-surfaces.d.ts +48 -0
- package/catalog/surface-manager-native-rmt-surfaces.js +325 -0
- package/catalog/surface-manager-overlay-bridge.d.ts +42 -0
- package/catalog/surface-manager-overlay-bridge.js +247 -0
- package/catalog/surface-manager-persistence.d.ts +37 -0
- package/catalog/surface-manager-persistence.js +178 -0
- package/catalog/surface-manager-quality-gates.d.ts +48 -0
- package/catalog/surface-manager-quality-gates.js +324 -0
- package/catalog/surface-manager-release-handoff.d.ts +47 -0
- package/catalog/surface-manager-release-handoff.js +274 -0
- package/catalog/surface-manager-remote-policy.d.ts +34 -0
- package/catalog/surface-manager-remote-policy.js +199 -0
- package/catalog/surface-manager-rmt-authoring.d.ts +44 -0
- package/catalog/surface-manager-rmt-authoring.js +368 -0
- package/catalog/surface-manager-route-lifecycle.d.ts +32 -0
- package/catalog/surface-manager-route-lifecycle.js +162 -0
- package/catalog/surface-manager-runtime-release-handoff.d.ts +36 -0
- package/catalog/surface-manager-runtime-release-handoff.js +245 -0
- package/catalog/surface-manager-side-panel-runtime.d.ts +46 -0
- package/catalog/surface-manager-side-panel-runtime.js +307 -0
- package/catalog/surface-manager-stack-policy.d.ts +32 -0
- package/catalog/surface-manager-stack-policy.js +169 -0
- package/catalog/surface-manager-window-runtime.d.ts +45 -0
- package/catalog/surface-manager-window-runtime.js +285 -0
- package/catalog/surface-manager-workbench-fixture.d.ts +50 -0
- package/catalog/surface-manager-workbench-fixture.js +315 -0
- package/catalog/type-exports-api.js +236 -0
- package/catalog/type-exports-builder.js +405 -0
- package/catalog/type-exports-catalog.js +394 -0
- package/catalog/type-exports-loader.js +266 -0
- package/catalog/type-exports-policy.js +461 -0
- package/catalog/type-exports-rmt.js +407 -0
- package/catalog/type-exports-vendor.js +365 -0
- package/catalog/type-exports.js +574 -0
- package/components/icon-packs/core.js +154 -0
- package/components/icon-packs/lucide.js +136 -0
- package/components/manifest.json +44 -0
- package/components/prism.d.ts +73 -0
- package/components/prism.js +300 -0
- package/components/turndown.d.ts +34 -0
- package/components/turndown.js +107 -0
- package/components/x-rmt-lifecycle-demo-build.d.ts +78 -0
- package/components/x-rmt-lifecycle-demo-build.js +1175 -0
- package/components/x-rmt-lifecycle-demo.d.ts +83 -0
- package/components/x-rmt-lifecycle-demo.js +1175 -0
- package/components/xalert.d.ts +42 -0
- package/components/xalert.js +538 -0
- package/components/xbutton.d.ts +127 -0
- package/components/xbutton.js +612 -0
- package/components/xcalendar.d.ts +39 -0
- package/components/xcalendar.js +338 -0
- package/components/xcards.d.ts +34 -0
- package/components/xcards.js +253 -0
- package/components/xcheckbox.d.ts +48 -0
- package/components/xcheckbox.js +448 -0
- package/components/xcode.d.ts +35 -0
- package/components/xcode.js +370 -0
- package/components/xdialog.d.ts +48 -0
- package/components/xdialog.js +763 -0
- package/components/xdrawer.d.ts +61 -0
- package/components/xdrawer.js +654 -0
- package/components/xfooter.d.ts +41 -0
- package/components/xfooter.js +351 -0
- package/components/xform.d.ts +43 -0
- package/components/xform.js +456 -0
- package/components/xheader.d.ts +68 -0
- package/components/xheader.js +1253 -0
- package/components/xhero.d.ts +42 -0
- package/components/xhero.js +475 -0
- package/components/xicon.d.ts +146 -0
- package/components/xicon.js +688 -0
- package/components/xinput.d.ts +37 -0
- package/components/xinput.js +444 -0
- package/components/xlightbox.d.ts +48 -0
- package/components/xlightbox.js +571 -0
- package/components/xlink.d.ts +63 -0
- package/components/xlink.js +565 -0
- package/components/xmasonry.d.ts +35 -0
- package/components/xmasonry.js +666 -0
- package/components/xmenu.d.ts +118 -0
- package/components/xmenu.js +1005 -0
- package/components/xmodal.d.ts +64 -0
- package/components/xmodal.js +831 -0
- package/components/xplayer.d.ts +57 -0
- package/components/xplayer.js +1748 -0
- package/components/xpopover.d.ts +54 -0
- package/components/xpopover.js +466 -0
- package/components/xprogress.d.ts +40 -0
- package/components/xprogress.js +345 -0
- package/components/xradio.d.ts +50 -0
- package/components/xradio.js +474 -0
- package/components/xrouter.d.ts +244 -0
- package/components/xrouter.js +1841 -0
- package/components/xsection.d.ts +34 -0
- package/components/xsection.js +253 -0
- package/components/xselect.d.ts +46 -0
- package/components/xselect.js +463 -0
- package/components/xsidepanel.d.ts +56 -0
- package/components/xsidepanel.js +728 -0
- package/components/xspinner.d.ts +38 -0
- package/components/xspinner.js +388 -0
- package/components/xstate.d.ts +137 -0
- package/components/xstate.js +493 -0
- package/components/xstatus.d.ts +41 -0
- package/components/xstatus.js +381 -0
- package/components/xsummary.d.ts +43 -0
- package/components/xsummary.js +293 -0
- package/components/xsurfacemanager-controller.d.ts +130 -0
- package/components/xsurfacemanager-controller.js +699 -0
- package/components/xsurfacemanager.d.ts +452 -0
- package/components/xsurfacemanager.js +3775 -0
- package/components/xsurfaceoverlay-bridge.d.ts +43 -0
- package/components/xsurfaceoverlay-bridge.js +238 -0
- package/components/xsurfacewindow.d.ts +50 -0
- package/components/xsurfacewindow.js +576 -0
- package/components/xtabs.d.ts +73 -0
- package/components/xtabs.js +611 -0
- package/components/xtend-public-types.d.ts +208 -0
- package/components/xtextarea.d.ts +46 -0
- package/components/xtextarea.js +451 -0
- package/components/xtheme.d.ts +253 -0
- package/components/xtheme.js +1438 -0
- package/components/xtoast.d.ts +39 -0
- package/components/xtoast.js +389 -0
- package/components/xtooltip.d.ts +53 -0
- package/components/xtooltip.js +432 -0
- package/components/xtype.d.ts +42 -0
- package/components/xtype.js +244 -0
- package/components/xutils.d.ts +164 -0
- package/components/xutils.js +496 -0
- package/components/xwriter.d.ts +67 -0
- package/components/xwriter.js +854 -0
- package/design-tokens/themes/enterprise-light.json +40 -0
- package/design-tokens/themes/xtend-signature.json +126 -0
- package/design-tokens/xtend-design-tokens.d.ts +95 -0
- package/design-tokens/xtend-design-tokens.js +395 -0
- package/design-tokens/xtheme-token-alias-layer.d.ts +84 -0
- package/design-tokens/xtheme-token-alias-layer.js +423 -0
- package/docs/.htaccess +51 -0
- package/docs/README.md +340 -0
- package/docs/XTend-ADR.md +221 -0
- package/docs/a11y-keyboard-smokes.md +62 -0
- package/docs/about.md +18 -0
- package/docs/api.md +157 -0
- package/docs/best-practices.md +76 -0
- package/docs/component-catalog-coverage.md +58 -0
- package/docs/component-lab.md +103 -0
- package/docs/component-long-tail-migration.md +41 -0
- package/docs/component-platform.md +159 -0
- package/docs/component-ux-app-authoring.md +130 -0
- package/docs/component-ux-authoring.md +96 -0
- package/docs/component-ux-gates.md +45 -0
- package/docs/components/x-rmt-lifecycle-demo-build.md +60 -0
- package/docs/components/xalert.md +81 -0
- package/docs/components/xbutton.md +103 -0
- package/docs/components/xcalendar.md +82 -0
- package/docs/components/xcards.md +128 -0
- package/docs/components/xcheckbox.md +102 -0
- package/docs/components/xcode.md +126 -0
- package/docs/components/xdialog.md +92 -0
- package/docs/components/xdrawer.md +84 -0
- package/docs/components/xfooter.md +126 -0
- package/docs/components/xform.md +128 -0
- package/docs/components/xheader.md +308 -0
- package/docs/components/xhero.md +142 -0
- package/docs/components/xicon.md +125 -0
- package/docs/components/xinput.md +129 -0
- package/docs/components/xlightbox.md +98 -0
- package/docs/components/xlink.md +109 -0
- package/docs/components/xmasonry.md +124 -0
- package/docs/components/xmenu.md +158 -0
- package/docs/components/xmodal.md +82 -0
- package/docs/components/xplayer.md +104 -0
- package/docs/components/xpopover.md +67 -0
- package/docs/components/xprogress.md +56 -0
- package/docs/components/xradio.md +103 -0
- package/docs/components/xrouter.md +260 -0
- package/docs/components/xsection.md +125 -0
- package/docs/components/xselect.md +105 -0
- package/docs/components/xsidepanel.md +30 -0
- package/docs/components/xspinner.md +102 -0
- package/docs/components/xstate.md +148 -0
- package/docs/components/xstatus.md +55 -0
- package/docs/components/xsummary.md +78 -0
- package/docs/components/xsurfacemanager.md +27 -0
- package/docs/components/xsurfacewindow.md +21 -0
- package/docs/components/xtabs.md +160 -0
- package/docs/components/xtextarea.md +98 -0
- package/docs/components/xtheme.md +167 -0
- package/docs/components/xtoast.md +62 -0
- package/docs/components/xtooltip.md +66 -0
- package/docs/components/xtype.md +82 -0
- package/docs/components/xutils.md +144 -0
- package/docs/components/xwriter.md +94 -0
- package/docs/components.md +117 -0
- package/docs/conditional-network-evidence-ci.md +38 -0
- package/docs/conditional-network-evidence.md +50 -0
- package/docs/core-migration-guide.md +110 -0
- package/docs/design-tokens.md +116 -0
- package/docs/docs-rmt-production-hardening.md +31 -0
- package/docs/enterprise-adoption.md +411 -0
- package/docs/enterprise-component-flex-release-handoff.md +129 -0
- package/docs/epic10-platform-gates.md +62 -0
- package/docs/epic10-release-handoff.md +81 -0
- package/docs/epic11-enterprise-ux-handoff.md +70 -0
- package/docs/epic12-rc0-handoff.md +61 -0
- package/docs/existing-component-metadata.md +67 -0
- package/docs/hydration-performance-closure.md +34 -0
- package/docs/hydration-policies.md +71 -0
- package/docs/index.php +1625 -0
- package/docs/known-residual-triage.md +22 -0
- package/docs/manifest-import-policy.md +79 -0
- package/docs/manifest.md +106 -0
- package/docs/menu.json +1190 -0
- package/docs/motion-contrast.md +67 -0
- package/docs/package-export-lock.md +44 -0
- package/docs/performance-measurements.md +106 -0
- package/docs/performance-regression.md +89 -0
- package/docs/performance.md +94 -0
- package/docs/previews/README.md +17 -0
- package/docs/prod-browser-csp-smokes.md +40 -0
- package/docs/public-component-types.md +79 -0
- package/docs/quick-start-guide.md +152 -0
- package/docs/rc0-adoption-guide.md +102 -0
- package/docs/rc0-gate-matrix.md +58 -0
- package/docs/rc1-gate-matrix-ci-handoff.md +56 -0
- package/docs/rc1-migration-notes.md +69 -0
- package/docs/rc1-readiness.md +46 -0
- package/docs/release-owner-acceptance.md +56 -0
- package/docs/release-report-pack-dry-run-evidence.md +39 -0
- package/docs/rmt-dsl-authoring-polish.md +122 -0
- package/docs/rmt-first-demo-app.md +77 -0
- package/docs/rmt-first-xtend-apps.md +105 -0
- package/docs/rmt-kernel-panic-recovery-incident-handoff.md +61 -0
- package/docs/rmt-kernel-security-hardening-migration.md +50 -0
- package/docs/rmt-kernel-trusted-output-authoring.md +69 -0
- package/docs/rmt-language-server.md +177 -0
- package/docs/rmt-lifecycle-demo.md +25 -0
- package/docs/rmt-linter.md +140 -0
- package/docs/rmt-production-readiness.md +63 -0
- package/docs/rmt-tooling-release-gates.md +77 -0
- package/docs/rmt-vnext-authoring.md +60 -0
- package/docs/rmt-vnext-cross-surface-events.md +68 -0
- package/docs/rmt-vnext-enterprise-mfe-handoff.md +70 -0
- package/docs/rmt-vnext-migration-notes.md +62 -0
- package/docs/rmt-vnext-release-handoff.md +69 -0
- package/docs/rmt-vnext-remote-surfaces.md +90 -0
- package/docs/rmt-vnext-surface-registry-enterprise.md +76 -0
- package/docs/screenreader-signals.md +56 -0
- package/docs/supply-chain-gates.md +100 -0
- package/docs/surface-manager-authoring-guide.md +94 -0
- package/docs/surface-manager-browser-lab.md +45 -0
- package/docs/surface-manager-component-lab.md +43 -0
- package/docs/surface-manager-controller.md +66 -0
- package/docs/surface-manager-layout-engines.md +32 -0
- package/docs/surface-manager-lazy-hydration.md +63 -0
- package/docs/surface-manager-migration-guide.md +94 -0
- package/docs/surface-manager-native-rmt-surfaces.md +38 -0
- package/docs/surface-manager-overlay-bridge.md +53 -0
- package/docs/surface-manager-persistence.md +30 -0
- package/docs/surface-manager-quality-gates.md +51 -0
- package/docs/surface-manager-release-handoff.md +68 -0
- package/docs/surface-manager-remote-policy.md +54 -0
- package/docs/surface-manager-rmt-authoring.md +86 -0
- package/docs/surface-manager-route-lifecycle.md +59 -0
- package/docs/surface-manager-runtime-release-handoff.md +69 -0
- package/docs/surface-manager-side-panel-runtime.md +36 -0
- package/docs/surface-manager-stack-policy.md +39 -0
- package/docs/surface-manager-window-runtime.md +47 -0
- package/docs/surface-manager-workbench-fixture.md +43 -0
- package/docs/third-party-design-authoring.md +406 -0
- package/docs/trusted-dom-boundary-browser-proof.md +32 -0
- package/docs/trusted-dom-sanitizing.md +110 -0
- package/docs/type-exports.md +61 -0
- package/docs/typescript-components.md +63 -0
- package/docs/utils/fabric-runtime.js +650 -0
- package/docs/utils/pageloader.js +2823 -0
- package/docs/utils/parsedown.php +298 -0
- package/docs/visual-browser-regression.md +83 -0
- package/docs/visual-owner-artifacts.md +46 -0
- package/docs/visual-snapshot-automation.md +87 -0
- package/docs/xtend-api-types.md +55 -0
- package/docs/xtend-builder-types.md +55 -0
- package/docs/xtend-catalog-types.md +44 -0
- package/docs/xtend-fabric-rmt-lane-mapping.md +143 -0
- package/docs/xtend-fabric.md +474 -0
- package/docs/xtend-loader-types.md +58 -0
- package/docs/xtend-loader.md +265 -0
- package/docs/xtend-policy-types.md +38 -0
- package/docs/xtend-rmt-types.md +39 -0
- package/docs/xtend-vendor-types.md +36 -0
- package/docs/xtendrmt-app-dsl.md +269 -0
- package/docs/xtendrmt-migration-guide.md +235 -0
- package/docs/xtendrmt-native-authoring.md +337 -0
- package/docs/xtendrmt-overview.md +89 -0
- package/docs/xtendrmt-parsedown-docs.rmt +956 -0
- package/docs/xtendrmt-parsedown-scheduling.md +301 -0
- package/docs/xtendrmt-runtime-bridge.md +155 -0
- package/fabric/hydration-policy.d.ts +27 -0
- package/fabric/hydration-policy.js +306 -0
- package/fabric/package.json +58 -0
- package/fabric/rmt-lane-mapping.d.ts +47 -0
- package/fabric/rmt-lane-mapping.js +504 -0
- package/fabric/xtend-fabric.d.ts +81 -0
- package/fabric/xtend-fabric.js +2669 -0
- package/fabric/xtend-policy-public-types.d.ts +135 -0
- package/package.json +8225 -0
- package/security/README.md +54 -0
- package/security/manifest-import-policy.d.ts +43 -0
- package/security/manifest-import-policy.js +260 -0
- package/security/supply-chain-gate-policy.d.ts +45 -0
- package/security/supply-chain-gate-policy.js +249 -0
- package/security/trusted-dom-policy.d.ts +36 -0
- package/security/trusted-dom-policy.js +316 -0
- package/tools/package.json +77 -0
- package/tools/rmt-editor/vscode/README.md +33 -0
- package/tools/rmt-editor/vscode/extension.d.ts +9 -0
- package/tools/rmt-editor/vscode/extension.js +55 -0
- package/tools/rmt-editor/vscode/language-configuration.json +28 -0
- package/tools/rmt-editor/vscode/package.json +83 -0
- package/tools/rmt-editor/vscode/snippets/rmt.code-snippets +243 -0
- package/tools/rmt-editor/vscode/syntaxes/rmt.tmLanguage.json +13 -0
- package/tools/rmt-editor/vscode/xtend-rmt-language-0.0.0-enterprise-readiness.vsix +0 -0
- package/tools/rmt-language/code-actions.d.ts +15 -0
- package/tools/rmt-language/code-actions.js +566 -0
- package/tools/rmt-language/completions.d.ts +22 -0
- package/tools/rmt-language/completions.js +475 -0
- package/tools/rmt-language/definitions.d.ts +13 -0
- package/tools/rmt-language/definitions.js +212 -0
- package/tools/rmt-language/diagnostics.d.ts +23 -0
- package/tools/rmt-language/diagnostics.js +486 -0
- package/tools/rmt-language/format-adapter.d.ts +16 -0
- package/tools/rmt-language/format-adapter.js +270 -0
- package/tools/rmt-language/hover.d.ts +12 -0
- package/tools/rmt-language/hover.js +326 -0
- package/tools/rmt-language/kernel-escalation.d.ts +122 -0
- package/tools/rmt-language/kernel-escalation.js +427 -0
- package/tools/rmt-language/kernel-panic-monitor.d.ts +176 -0
- package/tools/rmt-language/kernel-panic-monitor.js +674 -0
- package/tools/rmt-language/kernel-policy-parity.d.ts +142 -0
- package/tools/rmt-language/kernel-policy-parity.js +629 -0
- package/tools/rmt-language/kernel-recovery.d.ts +173 -0
- package/tools/rmt-language/kernel-recovery.js +666 -0
- package/tools/rmt-language/kernel-scheduler-failure.d.ts +136 -0
- package/tools/rmt-language/kernel-scheduler-failure.js +486 -0
- package/tools/rmt-language/kernel-security-regression.d.ts +154 -0
- package/tools/rmt-language/kernel-security-regression.js +465 -0
- package/tools/rmt-language/kernel-trust-authority.d.ts +120 -0
- package/tools/rmt-language/kernel-trust-authority.js +549 -0
- package/tools/rmt-language/parser.d.ts +14 -0
- package/tools/rmt-language/parser.js +111 -0
- package/tools/rmt-language/rmt-tooling-public-types.d.ts +179 -0
- package/tools/rmt-language/rules/boundary-policy.js +81 -0
- package/tools/rmt-language/rules/document-policy.js +65 -0
- package/tools/rmt-language/rules/index.js +29 -0
- package/tools/rmt-language/rules/route-policy.js +81 -0
- package/tools/rmt-language/rules/scheduler-policy.js +66 -0
- package/tools/rmt-language/rules/template-policy.js +130 -0
- package/tools/rmt-language/semantic-graph.d.ts +18 -0
- package/tools/rmt-language/semantic-graph.js +827 -0
- package/tools/rmt-language/snippets/README.md +17 -0
- package/tools/rmt-language/snippets/index.d.ts +17 -0
- package/tools/rmt-language/snippets/index.js +417 -0
- package/tools/rmt-language/snippets/rmt.code-snippets +243 -0
- package/tools/rmt-language/source-model.d.ts +14 -0
- package/tools/rmt-language/source-model.js +731 -0
- package/tools/rmt-language/symbols.d.ts +13 -0
- package/tools/rmt-language/symbols.js +183 -0
- package/tools/rmt-language/vnext-compatibility.d.ts +28 -0
- package/tools/rmt-language/vnext-compatibility.js +675 -0
- package/tools/rmt-language/vnext-compiler.d.ts +17 -0
- package/tools/rmt-language/vnext-compiler.js +716 -0
- package/tools/rmt-language/vnext-composition.d.ts +30 -0
- package/tools/rmt-language/vnext-composition.js +595 -0
- package/tools/rmt-language/vnext-conditions.d.ts +25 -0
- package/tools/rmt-language/vnext-conditions.js +474 -0
- package/tools/rmt-language/vnext-cross-surface-events.d.ts +30 -0
- package/tools/rmt-language/vnext-cross-surface-events.js +607 -0
- package/tools/rmt-language/vnext-degradation.d.ts +23 -0
- package/tools/rmt-language/vnext-degradation.js +428 -0
- package/tools/rmt-language/vnext-enterprise-fixtures.d.ts +28 -0
- package/tools/rmt-language/vnext-enterprise-fixtures.js +487 -0
- package/tools/rmt-language/vnext-enterprise-registry.d.ts +21 -0
- package/tools/rmt-language/vnext-enterprise-registry.js +495 -0
- package/tools/rmt-language/vnext-enterprise-release.d.ts +44 -0
- package/tools/rmt-language/vnext-enterprise-release.js +472 -0
- package/tools/rmt-language/vnext-event-governance.d.ts +29 -0
- package/tools/rmt-language/vnext-event-governance.js +488 -0
- package/tools/rmt-language/vnext-events.d.ts +44 -0
- package/tools/rmt-language/vnext-events.js +680 -0
- package/tools/rmt-language/vnext-import-resolver.d.ts +28 -0
- package/tools/rmt-language/vnext-import-resolver.js +642 -0
- package/tools/rmt-language/vnext-lifecycle.d.ts +22 -0
- package/tools/rmt-language/vnext-lifecycle.js +404 -0
- package/tools/rmt-language/vnext-parser.d.ts +21 -0
- package/tools/rmt-language/vnext-parser.js +1391 -0
- package/tools/rmt-language/vnext-regression.d.ts +25 -0
- package/tools/rmt-language/vnext-regression.js +394 -0
- package/tools/rmt-language/vnext-release.d.ts +29 -0
- package/tools/rmt-language/vnext-release.js +293 -0
- package/tools/rmt-language/vnext-remote-compatibility.d.ts +33 -0
- package/tools/rmt-language/vnext-remote-compatibility.js +892 -0
- package/tools/rmt-language/vnext-remote-compiler.d.ts +14 -0
- package/tools/rmt-language/vnext-remote-compiler.js +520 -0
- package/tools/rmt-language/vnext-remote-manifest.d.ts +33 -0
- package/tools/rmt-language/vnext-remote-manifest.js +538 -0
- package/tools/rmt-language/vnext-remote-security.d.ts +27 -0
- package/tools/rmt-language/vnext-remote-security.js +380 -0
- package/tools/rmt-language/vnext-remote-tooling.d.ts +25 -0
- package/tools/rmt-language/vnext-remote-tooling.js +805 -0
- package/tools/rmt-language/vnext-scheduler.d.ts +24 -0
- package/tools/rmt-language/vnext-scheduler.js +469 -0
- package/tools/rmt-language/vnext-security.d.ts +28 -0
- package/tools/rmt-language/vnext-security.js +597 -0
- package/tools/rmt-language/vnext-streaming.d.ts +28 -0
- package/tools/rmt-language/vnext-streaming.js +593 -0
- package/tools/rmt-language/vnext-surfaces.d.ts +24 -0
- package/tools/rmt-language/vnext-surfaces.js +406 -0
- package/tools/rmt-language/vnext-tooling.d.ts +25 -0
- package/tools/rmt-language/vnext-tooling.js +728 -0
- package/tools/rmt-language-server/protocol.d.ts +22 -0
- package/tools/rmt-language-server/protocol.js +352 -0
- package/tools/rmt-language-server/server.d.ts +15 -0
- package/tools/rmt-language-server/server.js +622 -0
- package/tools/rmt-linter/cli.d.ts +14 -0
- package/tools/rmt-linter/cli.js +450 -0
- package/tools/rmt-linter/reporter.d.ts +16 -0
- package/tools/rmt-linter/reporter.js +472 -0
- package/xtend-builder/README.md +83 -0
- package/xtend-builder/a11y/README.md +42 -0
- package/xtend-builder/a11y/component-a11y-profile.d.ts +14 -0
- package/xtend-builder/a11y/component-a11y-profile.js +314 -0
- package/xtend-builder/blueprints/README.md +105 -0
- package/xtend-builder/blueprints/component-blueprint.contract.d.ts +16 -0
- package/xtend-builder/blueprints/component-blueprint.contract.js +343 -0
- package/xtend-builder/builder-public-types.d.ts +234 -0
- package/xtend-builder/extensions/README.md +26 -0
- package/xtend-builder/extensions/component-extension-points.d.ts +11 -0
- package/xtend-builder/extensions/component-extension-points.js +277 -0
- package/xtend-builder/generators/README.md +149 -0
- package/xtend-builder/generators/component-files.d.ts +5 -0
- package/xtend-builder/generators/component-files.js +769 -0
- package/xtend-builder/generators/component-plan.d.ts +4 -0
- package/xtend-builder/generators/component-plan.js +104 -0
- package/xtend-builder/generators/registry.d.ts +6 -0
- package/xtend-builder/generators/registry.js +118 -0
- package/xtend-builder/generators/rmt-build.js +738 -0
- package/xtend-builder/generators/rmt-lifecycle-demo.js +922 -0
- package/xtend-builder/lib/cli.d.ts +9 -0
- package/xtend-builder/lib/cli.js +543 -0
- package/xtend-builder/lib/layout.d.ts +6 -0
- package/xtend-builder/lib/layout.js +153 -0
- package/xtend-builder/lib/package-resolver.js +25 -0
- package/xtend-builder/package.json +90 -0
- package/xtend-builder/performance/README.md +31 -0
- package/xtend-builder/performance/component-performance-profile.d.ts +11 -0
- package/xtend-builder/performance/component-performance-profile.js +347 -0
- package/xtend-builder/performance/component-ux-performance-contract.d.ts +27 -0
- package/xtend-builder/performance/component-ux-performance-contract.js +424 -0
- package/xtend-builder/preview/README.md +61 -0
- package/xtend-builder/preview/component-lab-ux-inspector.d.ts +20 -0
- package/xtend-builder/preview/component-lab-ux-inspector.js +448 -0
- package/xtend-builder/preview/component-lab.d.ts +14 -0
- package/xtend-builder/preview/component-lab.js +278 -0
- package/xtend-builder/preview/component-preview.d.ts +5 -0
- package/xtend-builder/preview/component-preview.js +160 -0
- package/xtend-builder/scaffold.config.d.ts +4 -0
- package/xtend-builder/scaffold.config.js +2056 -0
- package/xtend-builder/scaffold.d.ts +3 -0
- package/xtend-builder/scaffold.js +11 -0
- package/xtend-builder/templates/README.md +33 -0
- package/xtend-builder/templates/component/a11y.template.ts +11 -0
- package/xtend-builder/templates/component/component-suite.template.d.ts +2 -0
- package/xtend-builder/templates/component/component-suite.template.js +108 -0
- package/xtend-builder/templates/component/contract.template.ts +10 -0
- package/xtend-builder/templates/component/demo-plan.template.md +73 -0
- package/xtend-builder/templates/component/docs.template.md +301 -0
- package/xtend-builder/templates/component/fixture-data.template.ts +28 -0
- package/xtend-builder/templates/component/fixture.template.html +37 -0
- package/xtend-builder/templates/component/manifest-plan.template.json +22 -0
- package/xtend-builder/templates/component/performance.template.ts +13 -0
- package/xtend-builder/templates/component/rmt.template.ts +12 -0
- package/xtend-builder/templates/component/source.template.d.ts +2 -0
- package/xtend-builder/templates/component/source.template.js +137 -0
- package/xtend-builder/templates/component/source.template.ts +110 -0
- package/xtend-builder/templates/component/types.template.d.ts +423 -0
- package/xtend-builder/templates/loader.d.ts +4 -0
- package/xtend-builder/templates/loader.js +51 -0
- package/xtend-builder/templates/registry.d.ts +6 -0
- package/xtend-builder/templates/registry.js +119 -0
- package/xtend-builder/typing/README.md +130 -0
- package/xtend-builder/typing/component-contract-v2.d.ts +15 -0
- package/xtend-builder/typing/component-contract-v2.js +248 -0
- package/xtend-builder/typing/component-network-contract.d.ts +22 -0
- package/xtend-builder/typing/component-network-contract.js +478 -0
- package/xtend-builder/typing/component-shell-contract.d.ts +21 -0
- package/xtend-builder/typing/component-shell-contract.js +312 -0
- package/xtend-builder/typing/component-styling-contract.d.ts +22 -0
- package/xtend-builder/typing/component-styling-contract.js +301 -0
- package/xtend-builder/typing/component-types.d.ts +10 -0
- package/xtend-builder/typing/component-types.js +551 -0
- package/xtend-builder/typing/enterprise-component-flex-hardening-contract.d.ts +20 -0
- package/xtend-builder/typing/enterprise-component-flex-hardening-contract.js +332 -0
- package/xtend-builder/typing/feedback-status-ux-contract.d.ts +25 -0
- package/xtend-builder/typing/feedback-status-ux-contract.js +347 -0
- package/xtend-builder/typing/form-controls-ux-contract.d.ts +25 -0
- package/xtend-builder/typing/form-controls-ux-contract.js +357 -0
- package/xtend-builder/typing/layout-display-media-ux-contract.d.ts +25 -0
- package/xtend-builder/typing/layout-display-media-ux-contract.js +420 -0
- package/xtend-builder/typing/navigation-routing-ux-contract.d.ts +17 -0
- package/xtend-builder/typing/navigation-routing-ux-contract.js +297 -0
- package/xtend-builder/typing/overlay-interaction-ux-contract.d.ts +25 -0
- package/xtend-builder/typing/overlay-interaction-ux-contract.js +383 -0
- package/xtend-builder/typing/rmt-dsl-authoring-polish.d.ts +27 -0
- package/xtend-builder/typing/rmt-dsl-authoring-polish.js +419 -0
- package/xtend-builder/typing/rmt-shell-authoring-contract.d.ts +26 -0
- package/xtend-builder/typing/rmt-shell-authoring-contract.js +315 -0
- package/xtend-builder/utils/README.md +8 -0
- package/xtend-builder/utils/naming.d.ts +7 -0
- package/xtend-builder/utils/naming.js +36 -0
- package/xtend-builder/utils/validation.d.ts +5 -0
- package/xtend-builder/utils/validation.js +95 -0
- package/xtend-builder/wiring/README.md +46 -0
- package/xtend-builder/wiring/features.d.ts +5 -0
- package/xtend-builder/wiring/features.js +165 -0
- package/xtend-builder/wiring/hydration.d.ts +4 -0
- package/xtend-builder/wiring/hydration.js +44 -0
- package/xtend-builder/wiring/manifest.d.ts +5 -0
- package/xtend-builder/wiring/manifest.js +48 -0
- package/xtend-builder/workflows/README.md +47 -0
- package/xtend-builder/workflows/developer-workflow.d.ts +6 -0
- package/xtend-builder/workflows/developer-workflow.js +125 -0
- package/xtend-builder/writing/manifest-patcher.d.ts +49 -0
- package/xtend-builder/writing/manifest-patcher.js +391 -0
- package/xtend-builder/writing/write-plan.d.ts +148 -0
- package/xtend-builder/writing/write-plan.js +646 -0
- package/xtend-dev.d.ts +23 -0
- package/xtend-dev.js +4 -0
- package/xtend-loader.d.ts +201 -0
- package/xtend-loader.js +1704 -0
- package/xtend.css +402 -0
- package/xtendrmt/package.json +64 -0
- package/xtendrmt/rmt-core.d.ts +4452 -0
- package/xtendrmt/rmt-core.esm.js +25793 -0
- package/xtendrmt/rmt-first-demo-app.js +265 -0
- package/xtendrmt/rmt-first-demo-app.rmt +737 -0
- package/xtendrmt/rmt-lifecycle-demo.app.js +493 -0
- package/xtendrmt/rmt-lifecycle-demo.core.json +810 -0
- package/xtendrmt/rmt-lifecycle-demo.rmt +35 -0
- package/xtendrmt/rmt-lifecycle-demo.rmt-build.app.js +153 -0
- package/xtendrmt/rmt-lifecycle-demo.rmt-build.core.json +810 -0
- package/xtendrmt/rmt-lifecycle-demo.rmt-build.scaffold.json +202 -0
- package/xtendrmt/rmt-lifecycle-demo.scaffold.json +187 -0
- package/xtendrmt/rmt-manifest.json +548 -0
- package/xtendrmt/rmt-runtime.browser.js +26183 -0
- package/xtendrmt/rmt-runtime.esm.js +26214 -0
- package/xtendrmt/rmt-vnext-enterprise-mfe-demo.core.json +849 -0
- package/xtendrmt/rmt-vnext-enterprise-mfe-demo.rmt +50 -0
- package/xtendrmt/rmt-vnext-reference-demo.core.json +1069 -0
- package/xtendrmt/rmt-vnext-reference-demo.rmt +50 -0
- package/xtendrmt/rmt.schema.json +3145 -0
- package/xtendrmt/surface-workbench.js +316 -0
- package/xtendrmt/surface-workbench.rmt +762 -0
- package/xtendrmt/xtendrmt-bestcase-demo.core.json +1187 -0
- package/xtendrmt/xtendrmt-bestcase-demo.js +1728 -0
- package/xtendrmt/xtendrmt-bestcase-demo.rmt +57 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export * from './rmt-tooling-public-types';
|
|
2
|
+
import type { RmtToolingConstant, RmtToolingFactory, RmtToolingFunction } from './rmt-tooling-public-types';
|
|
3
|
+
|
|
4
|
+
export declare const COMPONENT_BINDING_CAPABILITY: RmtToolingConstant;
|
|
5
|
+
export declare const COMPONENT_SLOT_CAPABILITY: RmtToolingConstant;
|
|
6
|
+
export declare const COMPOSITION_COMPONENT_ADAPTER_MISSING_CODE: RmtToolingConstant;
|
|
7
|
+
export declare const COMPOSITION_COMPONENT_REF_MISSING_CODE: RmtToolingConstant;
|
|
8
|
+
export declare const COMPOSITION_COMPONENT_SLOT_UNSUPPORTED_CODE: RmtToolingConstant;
|
|
9
|
+
export declare const COMPOSITION_COMPONENT_UNKNOWN_CODE: RmtToolingConstant;
|
|
10
|
+
export declare const COMPOSITION_OPERATION_TARGET_UNSUPPORTED_CODE: RmtToolingConstant;
|
|
11
|
+
export declare const COMPOSITION_SLOT_DUPLICATE_CODE: RmtToolingConstant;
|
|
12
|
+
export declare const COMPOSITION_SLOT_OPERATION_REF_MISSING_CODE: RmtToolingConstant;
|
|
13
|
+
export declare const COMPOSITION_SLOT_OPERATION_SCOPE_MISMATCH_CODE: RmtToolingConstant;
|
|
14
|
+
export declare const COMPOSITION_SLOT_OWNER_MISSING_CODE: RmtToolingConstant;
|
|
15
|
+
export declare const createComponentAdapterStub: RmtToolingFactory;
|
|
16
|
+
export declare const createCompositionGraph: RmtToolingFactory;
|
|
17
|
+
export declare const createRmtVNextCompositionContract: RmtToolingFactory;
|
|
18
|
+
export declare const DEFAULT_COMPONENT_ADAPTER_ID: RmtToolingConstant;
|
|
19
|
+
export declare const normalizeComponentCatalog: RmtToolingFunction;
|
|
20
|
+
export declare const RMT_VNEXT_COMPONENT_ADAPTER_SCHEMA: RmtToolingConstant;
|
|
21
|
+
export declare const RMT_VNEXT_COMPONENT_BINDING_SCHEMA: RmtToolingConstant;
|
|
22
|
+
export declare const RMT_VNEXT_COMPONENT_CATALOG_SCHEMA: RmtToolingConstant;
|
|
23
|
+
export declare const RMT_VNEXT_COMPOSITION_MODULE_PATH: RmtToolingConstant;
|
|
24
|
+
export declare const RMT_VNEXT_COMPOSITION_PACKAGE_SCRIPT: RmtToolingConstant;
|
|
25
|
+
export declare const RMT_VNEXT_COMPOSITION_REPORT_SCHEMA: RmtToolingConstant;
|
|
26
|
+
export declare const RMT_VNEXT_COMPOSITION_SCHEMA: RmtToolingConstant;
|
|
27
|
+
export declare const RMT_VNEXT_COMPOSITION_SUITE_PATH: RmtToolingConstant;
|
|
28
|
+
export declare const RMT_VNEXT_COMPOSITION_WORKPACKAGE: RmtToolingConstant;
|
|
29
|
+
export declare const RMT_VNEXT_SLOT_BINDING_SCHEMA: RmtToolingConstant;
|
|
30
|
+
export declare const serializeCompositionGraph: RmtToolingFunction;
|
|
@@ -0,0 +1,595 @@
|
|
|
1
|
+
const {
|
|
2
|
+
RMT_VNEXT_CORE_SCHEMA
|
|
3
|
+
} = require('./vnext-compiler');
|
|
4
|
+
|
|
5
|
+
const RMT_VNEXT_COMPOSITION_SCHEMA = 'xtend.rmt.vnext-composition.v1';
|
|
6
|
+
const RMT_VNEXT_SLOT_BINDING_SCHEMA = 'xtend.rmt.vnext-slot-binding.v1';
|
|
7
|
+
const RMT_VNEXT_COMPONENT_BINDING_SCHEMA = 'xtend.rmt.vnext-component-binding.v1';
|
|
8
|
+
const RMT_VNEXT_COMPONENT_CATALOG_SCHEMA = 'xtend.rmt.vnext-component-catalog.v1';
|
|
9
|
+
const RMT_VNEXT_COMPONENT_ADAPTER_SCHEMA = 'xtend.rmt.vnext-component-adapter.v1';
|
|
10
|
+
const RMT_VNEXT_COMPOSITION_REPORT_SCHEMA = 'xtend.rmt.vnext-composition-report.v1';
|
|
11
|
+
const RMT_VNEXT_COMPOSITION_WORKPACKAGE = 'WP-E15-10';
|
|
12
|
+
const RMT_VNEXT_COMPOSITION_MODULE_PATH = 'tools/rmt-language/vnext-composition.js';
|
|
13
|
+
const RMT_VNEXT_COMPOSITION_SUITE_PATH = 'tests/rmt-language/rmt_vnext_composition_suite.js';
|
|
14
|
+
const RMT_VNEXT_COMPOSITION_PACKAGE_SCRIPT = 'npm run test:rmt-vnext-composition';
|
|
15
|
+
|
|
16
|
+
const COMPOSITION_SLOT_OWNER_MISSING_CODE = 'rmt.vnext.composition.slot.owner_missing';
|
|
17
|
+
const COMPOSITION_SLOT_OPERATION_REF_MISSING_CODE = 'rmt.vnext.composition.slot.operation_ref_missing';
|
|
18
|
+
const COMPOSITION_SLOT_OPERATION_SCOPE_MISMATCH_CODE = 'rmt.vnext.composition.slot.operation_scope_mismatch';
|
|
19
|
+
const COMPOSITION_SLOT_DUPLICATE_CODE = 'rmt.vnext.composition.slot.duplicate';
|
|
20
|
+
const COMPOSITION_COMPONENT_REF_MISSING_CODE = 'rmt.vnext.composition.component.ref_missing';
|
|
21
|
+
const COMPOSITION_COMPONENT_UNKNOWN_CODE = 'rmt.vnext.composition.component.unknown';
|
|
22
|
+
const COMPOSITION_COMPONENT_ADAPTER_MISSING_CODE = 'rmt.vnext.composition.component.adapter_missing';
|
|
23
|
+
const COMPOSITION_COMPONENT_SLOT_UNSUPPORTED_CODE = 'rmt.vnext.composition.component.slot_unsupported';
|
|
24
|
+
const COMPOSITION_OPERATION_TARGET_UNSUPPORTED_CODE = 'rmt.vnext.composition.operation.target_unsupported';
|
|
25
|
+
|
|
26
|
+
const COMPONENT_BINDING_CAPABILITY = 'component.binding';
|
|
27
|
+
const COMPONENT_SLOT_CAPABILITY = 'component.slot';
|
|
28
|
+
const DEFAULT_COMPONENT_ADAPTER_ID = 'xtend.component';
|
|
29
|
+
|
|
30
|
+
function cloneRange(range = {}) {
|
|
31
|
+
return {
|
|
32
|
+
start: {
|
|
33
|
+
line: range.start && Number.isInteger(range.start.line) ? range.start.line : 0,
|
|
34
|
+
character: range.start && Number.isInteger(range.start.character) ? range.start.character : 0
|
|
35
|
+
},
|
|
36
|
+
end: {
|
|
37
|
+
line: range.end && Number.isInteger(range.end.line) ? range.end.line : 0,
|
|
38
|
+
character: range.end && Number.isInteger(range.end.character) ? range.end.character : 0
|
|
39
|
+
},
|
|
40
|
+
startOffset: Number.isInteger(range.startOffset) ? range.startOffset : 0,
|
|
41
|
+
endOffset: Number.isInteger(range.endOffset) ? range.endOffset : 0
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function uniqueList(values = []) {
|
|
46
|
+
const result = [];
|
|
47
|
+
values.forEach((value) => {
|
|
48
|
+
if (value === null || value === undefined) return;
|
|
49
|
+
const normalized = String(value).trim();
|
|
50
|
+
if (normalized && !result.includes(normalized)) result.push(normalized);
|
|
51
|
+
});
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function findSourceEntry(coreDocument, sourceRef) {
|
|
56
|
+
const sourceMap = Array.isArray(coreDocument && coreDocument.sourceMap) ? coreDocument.sourceMap : [];
|
|
57
|
+
return sourceMap.find((entry) => entry && entry.id === sourceRef) || null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function createCompositionDiagnostic(coreDocument, subject, code, message, severity = 'error', metadata = {}) {
|
|
61
|
+
const sourceEntry = findSourceEntry(coreDocument, subject && subject.sourceRef);
|
|
62
|
+
return {
|
|
63
|
+
schema: 'xtend.rmt.linter.diagnostic.v1',
|
|
64
|
+
source: RMT_VNEXT_COMPOSITION_SCHEMA,
|
|
65
|
+
workpackage: RMT_VNEXT_COMPOSITION_WORKPACKAGE,
|
|
66
|
+
severity,
|
|
67
|
+
code,
|
|
68
|
+
message,
|
|
69
|
+
operationId: subject && (subject.operationId || subject.ownerOperation || subject.id && String(subject.id).startsWith('operation:') && subject.id) || null,
|
|
70
|
+
slotId: subject && (subject.slotId || subject.id && String(subject.id).startsWith('slot:') && subject.id) || null,
|
|
71
|
+
componentRef: subject && subject.componentRef || null,
|
|
72
|
+
corePointer: sourceEntry && sourceEntry.corePointer ? sourceEntry.corePointer : null,
|
|
73
|
+
sourceRef: subject && subject.sourceRef ? subject.sourceRef : null,
|
|
74
|
+
range: cloneRange(sourceEntry && sourceEntry.range),
|
|
75
|
+
metadata
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function createIndex(records = []) {
|
|
80
|
+
const index = new Map();
|
|
81
|
+
records.forEach((record) => {
|
|
82
|
+
if (record && record.id) index.set(record.id, record);
|
|
83
|
+
});
|
|
84
|
+
return index;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function normalizeSlotNames(value, explicit = false) {
|
|
88
|
+
if (Array.isArray(value)) {
|
|
89
|
+
return {
|
|
90
|
+
explicit: true,
|
|
91
|
+
names: uniqueList(value.map((item) => {
|
|
92
|
+
if (typeof item === 'string') return item;
|
|
93
|
+
if (item && typeof item === 'object') return item.name || item.slot || item.id;
|
|
94
|
+
return null;
|
|
95
|
+
}))
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (value && typeof value === 'object') {
|
|
100
|
+
return {
|
|
101
|
+
explicit: true,
|
|
102
|
+
names: uniqueList(Object.keys(value))
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
explicit,
|
|
108
|
+
names: []
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function normalizeComponentEntry(input, fallbackId) {
|
|
113
|
+
const source = input && typeof input === 'object' ? input : {};
|
|
114
|
+
const id = String(source.id || source.componentId || source.tag || fallbackId || '').trim();
|
|
115
|
+
if (!id) return null;
|
|
116
|
+
|
|
117
|
+
const publicApiSlots = source.publicApi && normalizeSlotNames(source.publicApi.slots, true);
|
|
118
|
+
const directSlots = Object.prototype.hasOwnProperty.call(source, 'slots')
|
|
119
|
+
? normalizeSlotNames(source.slots, true)
|
|
120
|
+
: null;
|
|
121
|
+
const rmtSlots = source.rmt && Object.prototype.hasOwnProperty.call(source.rmt, 'slots')
|
|
122
|
+
? normalizeSlotNames(source.rmt.slots, true)
|
|
123
|
+
: null;
|
|
124
|
+
const selectedSlots = directSlots || publicApiSlots || rmtSlots || normalizeSlotNames(null, false);
|
|
125
|
+
const aliases = uniqueList([]
|
|
126
|
+
.concat(source.aliases || [])
|
|
127
|
+
.concat(source.localAliases || [])
|
|
128
|
+
.concat(source.alias || []));
|
|
129
|
+
|
|
130
|
+
return {
|
|
131
|
+
id,
|
|
132
|
+
schema: source.schema || null,
|
|
133
|
+
tag: source.tag || id,
|
|
134
|
+
adapterId: source.adapterId || source.adapter || source.rmt && source.rmt.adapter || DEFAULT_COMPONENT_ADAPTER_ID,
|
|
135
|
+
aliases,
|
|
136
|
+
slots: selectedSlots.names,
|
|
137
|
+
slotsExplicit: selectedSlots.explicit,
|
|
138
|
+
contractRef: source.contractRef || source.schema || 'xtend.component.contract.v2',
|
|
139
|
+
source
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function normalizeComponentInput(components) {
|
|
144
|
+
if (Array.isArray(components)) return components;
|
|
145
|
+
if (components && Array.isArray(components.components)) return components.components;
|
|
146
|
+
if (!components || typeof components !== 'object') return [];
|
|
147
|
+
|
|
148
|
+
return Object.keys(components).map((key) => {
|
|
149
|
+
const value = components[key];
|
|
150
|
+
if (value && typeof value === 'object') {
|
|
151
|
+
return {
|
|
152
|
+
id: value.id || key,
|
|
153
|
+
...value
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
id: key,
|
|
158
|
+
tag: String(value || key)
|
|
159
|
+
};
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function normalizeComponentCatalog(components = []) {
|
|
164
|
+
const records = [];
|
|
165
|
+
const byId = new Map();
|
|
166
|
+
const byAlias = new Map();
|
|
167
|
+
|
|
168
|
+
normalizeComponentInput(components).forEach((entry, index) => {
|
|
169
|
+
const normalized = normalizeComponentEntry(entry, `component.${index}`);
|
|
170
|
+
if (!normalized) return;
|
|
171
|
+
|
|
172
|
+
records.push(normalized);
|
|
173
|
+
byId.set(normalized.id, normalized);
|
|
174
|
+
normalized.aliases.forEach((alias) => {
|
|
175
|
+
if (!byAlias.has(alias)) byAlias.set(alias, normalized.id);
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
return {
|
|
180
|
+
schema: RMT_VNEXT_COMPONENT_CATALOG_SCHEMA,
|
|
181
|
+
count: records.length,
|
|
182
|
+
ids: records.map((record) => record.id),
|
|
183
|
+
aliasCount: byAlias.size,
|
|
184
|
+
records,
|
|
185
|
+
byId,
|
|
186
|
+
byAlias
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function createComponentAdapterStub(input = {}) {
|
|
191
|
+
return {
|
|
192
|
+
schema: RMT_VNEXT_COMPONENT_ADAPTER_SCHEMA,
|
|
193
|
+
id: input.id || input.adapterId || DEFAULT_COMPONENT_ADAPTER_ID,
|
|
194
|
+
kind: input.kind || 'component_adapter',
|
|
195
|
+
capabilities: uniqueList(input.capabilities || input.providedCapabilities || [
|
|
196
|
+
COMPONENT_BINDING_CAPABILITY,
|
|
197
|
+
COMPONENT_SLOT_CAPABILITY
|
|
198
|
+
]),
|
|
199
|
+
kernelBoundary: input.kernelBoundary || 'no-rmt-kernel-import-of-host-runtime-types'
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function normalizeAdapterInput(adapters) {
|
|
204
|
+
if (Array.isArray(adapters)) return adapters;
|
|
205
|
+
if (adapters && Array.isArray(adapters.adapters)) return adapters.adapters;
|
|
206
|
+
if (!adapters || typeof adapters !== 'object') return [];
|
|
207
|
+
|
|
208
|
+
return Object.keys(adapters).map((key) => ({
|
|
209
|
+
id: key,
|
|
210
|
+
...(adapters[key] && typeof adapters[key] === 'object' ? adapters[key] : {})
|
|
211
|
+
}));
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function createAdapterCatalog(options = {}) {
|
|
215
|
+
const rawAdapters = Object.prototype.hasOwnProperty.call(options, 'adapters') && options.adapters !== undefined
|
|
216
|
+
? options.adapters
|
|
217
|
+
: [createComponentAdapterStub()];
|
|
218
|
+
const adapters = normalizeAdapterInput(rawAdapters).map((adapter) => createComponentAdapterStub(adapter));
|
|
219
|
+
const byId = createIndex(adapters);
|
|
220
|
+
|
|
221
|
+
return {
|
|
222
|
+
count: adapters.length,
|
|
223
|
+
ids: adapters.map((adapter) => adapter.id),
|
|
224
|
+
records: adapters,
|
|
225
|
+
byId
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function hasAdapterCapability(adapter, capability) {
|
|
230
|
+
const capabilities = Array.isArray(adapter && adapter.capabilities) ? adapter.capabilities : [];
|
|
231
|
+
return capabilities.includes(capability);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function hasSlotCapability(adapter, slotName) {
|
|
235
|
+
return hasAdapterCapability(adapter, COMPONENT_SLOT_CAPABILITY)
|
|
236
|
+
|| hasAdapterCapability(adapter, `${COMPONENT_SLOT_CAPABILITY}.${slotName}`);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function resolveComponentRef(componentRef, catalog) {
|
|
240
|
+
if (catalog.byId.has(componentRef)) {
|
|
241
|
+
return {
|
|
242
|
+
found: true,
|
|
243
|
+
alias: false,
|
|
244
|
+
component: catalog.byId.get(componentRef),
|
|
245
|
+
resolvedComponentId: componentRef
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (catalog.byAlias.has(componentRef)) {
|
|
250
|
+
const resolvedComponentId = catalog.byAlias.get(componentRef);
|
|
251
|
+
return {
|
|
252
|
+
found: true,
|
|
253
|
+
alias: true,
|
|
254
|
+
component: catalog.byId.get(resolvedComponentId),
|
|
255
|
+
resolvedComponentId
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
return {
|
|
260
|
+
found: false,
|
|
261
|
+
alias: false,
|
|
262
|
+
component: null,
|
|
263
|
+
resolvedComponentId: componentRef || null
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function copyScope(scope) {
|
|
268
|
+
return scope && typeof scope === 'object' ? { ...scope } : {};
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function scopesMatch(ownerScope = {}, childScope = {}) {
|
|
272
|
+
return (ownerScope.template || null) === (childScope.template || null)
|
|
273
|
+
&& (ownerScope.surface || null) === (childScope.surface || null)
|
|
274
|
+
&& (ownerScope.lane || null) === (childScope.lane || null);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
function createComponentBinding(coreDocument, operation, context) {
|
|
278
|
+
const diagnostics = [];
|
|
279
|
+
const target = operation && operation.target || {};
|
|
280
|
+
|
|
281
|
+
if (!target.ref) {
|
|
282
|
+
diagnostics.push(createCompositionDiagnostic(
|
|
283
|
+
coreDocument,
|
|
284
|
+
operation,
|
|
285
|
+
COMPOSITION_COMPONENT_REF_MISSING_CODE,
|
|
286
|
+
`Operation "${operation && operation.id || 'unknown'}" has no component reference target.`
|
|
287
|
+
));
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
if (target.kind && target.kind !== 'ref') {
|
|
291
|
+
diagnostics.push(createCompositionDiagnostic(
|
|
292
|
+
coreDocument,
|
|
293
|
+
operation,
|
|
294
|
+
COMPOSITION_OPERATION_TARGET_UNSUPPORTED_CODE,
|
|
295
|
+
`Operation "${operation && operation.id || 'unknown'}" target kind "${target.kind}" is not supported for component composition.`,
|
|
296
|
+
'error',
|
|
297
|
+
{ allowedKind: 'ref' }
|
|
298
|
+
));
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
const resolved = resolveComponentRef(target.ref, context.componentCatalog);
|
|
302
|
+
if (!resolved.found && context.requireKnownComponents) {
|
|
303
|
+
diagnostics.push(createCompositionDiagnostic(
|
|
304
|
+
coreDocument,
|
|
305
|
+
{
|
|
306
|
+
...operation,
|
|
307
|
+
componentRef: target.ref || null
|
|
308
|
+
},
|
|
309
|
+
COMPOSITION_COMPONENT_UNKNOWN_CODE,
|
|
310
|
+
`Component reference "${target.ref || 'unknown'}" is not present in the vNext component catalog.`,
|
|
311
|
+
'error',
|
|
312
|
+
{ knownComponents: context.componentCatalog.ids.slice() }
|
|
313
|
+
));
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const component = resolved.component;
|
|
317
|
+
const adapterId = component && component.adapterId || context.defaultAdapterId;
|
|
318
|
+
const adapter = context.adapterCatalog.byId.get(adapterId);
|
|
319
|
+
if (!adapter || !hasAdapterCapability(adapter, COMPONENT_BINDING_CAPABILITY)) {
|
|
320
|
+
diagnostics.push(createCompositionDiagnostic(
|
|
321
|
+
coreDocument,
|
|
322
|
+
{
|
|
323
|
+
...operation,
|
|
324
|
+
componentRef: target.ref || null
|
|
325
|
+
},
|
|
326
|
+
COMPOSITION_COMPONENT_ADAPTER_MISSING_CODE,
|
|
327
|
+
`Component "${resolved.resolvedComponentId || target.ref || 'unknown'}" has no adapter contract with "${COMPONENT_BINDING_CAPABILITY}".`,
|
|
328
|
+
'error',
|
|
329
|
+
{ adapterId, requiredCapability: COMPONENT_BINDING_CAPABILITY }
|
|
330
|
+
));
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
return {
|
|
334
|
+
schema: RMT_VNEXT_COMPONENT_BINDING_SCHEMA,
|
|
335
|
+
operationId: operation && operation.id || null,
|
|
336
|
+
operationKind: operation && operation.kind || null,
|
|
337
|
+
lifecycle: operation && operation.op || null,
|
|
338
|
+
componentRef: target.ref || null,
|
|
339
|
+
resolvedComponentId: resolved.resolvedComponentId,
|
|
340
|
+
alias: resolved.alias,
|
|
341
|
+
adapterId,
|
|
342
|
+
adapterContract: adapter ? {
|
|
343
|
+
schema: adapter.schema,
|
|
344
|
+
id: adapter.id,
|
|
345
|
+
capabilities: adapter.capabilities.slice()
|
|
346
|
+
} : null,
|
|
347
|
+
scope: copyScope(operation && operation.scope),
|
|
348
|
+
sourceRef: operation && operation.sourceRef || null,
|
|
349
|
+
status: diagnostics.some((diagnostic) => diagnostic.severity === 'error') ? 'blocked' : 'ready',
|
|
350
|
+
diagnostics
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
function createSlotBinding(coreDocument, slot, context) {
|
|
355
|
+
const diagnostics = [];
|
|
356
|
+
const operationRefs = Array.isArray(slot && slot.operationRefs) ? slot.operationRefs.slice() : [];
|
|
357
|
+
const ownerOperation = context.operationIndex.get(slot && slot.ownerOperation);
|
|
358
|
+
const ownerBinding = ownerOperation ? context.componentBindingsByOperation.get(ownerOperation.id) : null;
|
|
359
|
+
const ownerComponent = ownerBinding && ownerBinding.resolvedComponentId
|
|
360
|
+
? context.componentCatalog.byId.get(ownerBinding.resolvedComponentId)
|
|
361
|
+
: null;
|
|
362
|
+
const adapterId = ownerComponent && ownerComponent.adapterId || ownerBinding && ownerBinding.adapterId || context.defaultAdapterId;
|
|
363
|
+
const adapter = context.adapterCatalog.byId.get(adapterId);
|
|
364
|
+
const childComponentRefs = [];
|
|
365
|
+
|
|
366
|
+
if (!ownerOperation) {
|
|
367
|
+
diagnostics.push(createCompositionDiagnostic(
|
|
368
|
+
coreDocument,
|
|
369
|
+
slot,
|
|
370
|
+
COMPOSITION_SLOT_OWNER_MISSING_CODE,
|
|
371
|
+
`Slot "${slot && slot.id || 'unknown'}" references missing owner operation "${slot && slot.ownerOperation || 'unknown'}".`
|
|
372
|
+
));
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
operationRefs.forEach((operationRef) => {
|
|
376
|
+
const operation = context.operationIndex.get(operationRef);
|
|
377
|
+
if (!operation) {
|
|
378
|
+
diagnostics.push(createCompositionDiagnostic(
|
|
379
|
+
coreDocument,
|
|
380
|
+
slot,
|
|
381
|
+
COMPOSITION_SLOT_OPERATION_REF_MISSING_CODE,
|
|
382
|
+
`Slot "${slot && slot.id || 'unknown'}" references missing operation "${operationRef}".`,
|
|
383
|
+
'error',
|
|
384
|
+
{ operationRef }
|
|
385
|
+
));
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
const childBinding = context.componentBindingsByOperation.get(operation.id);
|
|
390
|
+
childComponentRefs.push(childBinding && childBinding.resolvedComponentId || operation.target && operation.target.ref || null);
|
|
391
|
+
|
|
392
|
+
if (ownerOperation && !scopesMatch(ownerOperation.scope, operation.scope)) {
|
|
393
|
+
diagnostics.push(createCompositionDiagnostic(
|
|
394
|
+
coreDocument,
|
|
395
|
+
slot,
|
|
396
|
+
COMPOSITION_SLOT_OPERATION_SCOPE_MISMATCH_CODE,
|
|
397
|
+
`Nested operation "${operation.id}" does not share the owner operation scope for slot "${slot.id}".`,
|
|
398
|
+
'error',
|
|
399
|
+
{
|
|
400
|
+
ownerScope: copyScope(ownerOperation.scope),
|
|
401
|
+
operationScope: copyScope(operation.scope)
|
|
402
|
+
}
|
|
403
|
+
));
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
if (ownerComponent && ownerComponent.slotsExplicit && !ownerComponent.slots.includes(slot.name)) {
|
|
408
|
+
diagnostics.push(createCompositionDiagnostic(
|
|
409
|
+
coreDocument,
|
|
410
|
+
slot,
|
|
411
|
+
COMPOSITION_COMPONENT_SLOT_UNSUPPORTED_CODE,
|
|
412
|
+
`Component "${ownerComponent.id}" does not declare slot "${slot.name || 'default'}".`,
|
|
413
|
+
'error',
|
|
414
|
+
{
|
|
415
|
+
componentId: ownerComponent.id,
|
|
416
|
+
slotName: slot.name || null,
|
|
417
|
+
supportedSlots: ownerComponent.slots.slice()
|
|
418
|
+
}
|
|
419
|
+
));
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if (!adapter || !hasSlotCapability(adapter, slot && slot.name || 'default')) {
|
|
423
|
+
diagnostics.push(createCompositionDiagnostic(
|
|
424
|
+
coreDocument,
|
|
425
|
+
slot,
|
|
426
|
+
COMPOSITION_COMPONENT_ADAPTER_MISSING_CODE,
|
|
427
|
+
`Slot "${slot && slot.name || 'default'}" has no adapter contract capability for slot binding.`,
|
|
428
|
+
'error',
|
|
429
|
+
{
|
|
430
|
+
adapterId,
|
|
431
|
+
requiredCapability: `${COMPONENT_SLOT_CAPABILITY} or ${COMPONENT_SLOT_CAPABILITY}.${slot && slot.name || 'default'}`
|
|
432
|
+
}
|
|
433
|
+
));
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
return {
|
|
437
|
+
schema: RMT_VNEXT_SLOT_BINDING_SCHEMA,
|
|
438
|
+
slotId: slot && slot.id || null,
|
|
439
|
+
name: slot && slot.name || null,
|
|
440
|
+
ownerOperation: slot && slot.ownerOperation || null,
|
|
441
|
+
ownerComponentRef: ownerBinding && ownerBinding.componentRef || ownerOperation && ownerOperation.target && ownerOperation.target.ref || null,
|
|
442
|
+
ownerComponentId: ownerBinding && ownerBinding.resolvedComponentId || null,
|
|
443
|
+
ownerAdapterId: adapterId,
|
|
444
|
+
operationRefs,
|
|
445
|
+
childComponentRefs: childComponentRefs.filter(Boolean),
|
|
446
|
+
nestedOperationCount: operationRefs.length,
|
|
447
|
+
scope: copyScope(ownerOperation && ownerOperation.scope),
|
|
448
|
+
bindingMode: 'orchestration',
|
|
449
|
+
markupMode: 'none',
|
|
450
|
+
sourceRef: slot && slot.sourceRef || null,
|
|
451
|
+
status: diagnostics.some((diagnostic) => diagnostic.severity === 'error') ? 'blocked' : 'ready',
|
|
452
|
+
diagnostics
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
function detectDuplicateSlots(coreDocument, slots) {
|
|
457
|
+
const diagnostics = [];
|
|
458
|
+
const seen = new Map();
|
|
459
|
+
|
|
460
|
+
slots.forEach((slot) => {
|
|
461
|
+
const key = `${slot && slot.ownerOperation || 'unknown'}:${slot && slot.name || 'default'}`;
|
|
462
|
+
if (seen.has(key)) {
|
|
463
|
+
diagnostics.push(createCompositionDiagnostic(
|
|
464
|
+
coreDocument,
|
|
465
|
+
slot,
|
|
466
|
+
COMPOSITION_SLOT_DUPLICATE_CODE,
|
|
467
|
+
`Slot "${slot && slot.name || 'default'}" is duplicated for owner operation "${slot && slot.ownerOperation || 'unknown'}".`,
|
|
468
|
+
'error',
|
|
469
|
+
{ firstSlotId: seen.get(key), duplicateKey: key }
|
|
470
|
+
));
|
|
471
|
+
} else if (slot && slot.id) {
|
|
472
|
+
seen.set(key, slot.id);
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
return diagnostics;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
function createCompositionGraph(coreDocument, options = {}) {
|
|
480
|
+
const operations = Array.isArray(coreDocument && coreDocument.operations) ? coreDocument.operations : [];
|
|
481
|
+
const slots = Array.isArray(coreDocument && coreDocument.slots) ? coreDocument.slots : [];
|
|
482
|
+
const componentCatalog = normalizeComponentCatalog(options.components || options.componentCatalog || []);
|
|
483
|
+
const adapterCatalog = createAdapterCatalog({
|
|
484
|
+
adapters: Object.prototype.hasOwnProperty.call(options, 'adapters')
|
|
485
|
+
? options.adapters
|
|
486
|
+
: options.componentAdapters
|
|
487
|
+
});
|
|
488
|
+
const context = {
|
|
489
|
+
componentCatalog,
|
|
490
|
+
adapterCatalog,
|
|
491
|
+
operationIndex: createIndex(operations),
|
|
492
|
+
requireKnownComponents: options.requireKnownComponents === true,
|
|
493
|
+
defaultAdapterId: options.defaultAdapterId || DEFAULT_COMPONENT_ADAPTER_ID,
|
|
494
|
+
componentBindingsByOperation: new Map()
|
|
495
|
+
};
|
|
496
|
+
const componentBindings = operations.map((operation) => createComponentBinding(coreDocument, operation, context));
|
|
497
|
+
componentBindings.forEach((binding) => {
|
|
498
|
+
if (binding.operationId) context.componentBindingsByOperation.set(binding.operationId, binding);
|
|
499
|
+
});
|
|
500
|
+
|
|
501
|
+
const slotBindings = slots.map((slot) => createSlotBinding(coreDocument, slot, context));
|
|
502
|
+
const duplicateSlotDiagnostics = detectDuplicateSlots(coreDocument, slots);
|
|
503
|
+
const diagnostics = componentBindings
|
|
504
|
+
.flatMap((binding) => binding.diagnostics)
|
|
505
|
+
.concat(slotBindings.flatMap((binding) => binding.diagnostics))
|
|
506
|
+
.concat(duplicateSlotDiagnostics);
|
|
507
|
+
const byComponent = {};
|
|
508
|
+
|
|
509
|
+
componentBindings.forEach((binding) => {
|
|
510
|
+
const componentId = binding.resolvedComponentId || binding.componentRef || 'unknown';
|
|
511
|
+
const list = byComponent[componentId] || (byComponent[componentId] = []);
|
|
512
|
+
list.push(binding.operationId);
|
|
513
|
+
});
|
|
514
|
+
|
|
515
|
+
const status = diagnostics.some((diagnostic) => diagnostic.severity === 'error') ? 'blocked' : 'ready';
|
|
516
|
+
|
|
517
|
+
return {
|
|
518
|
+
schema: RMT_VNEXT_COMPOSITION_SCHEMA,
|
|
519
|
+
coreSchema: coreDocument && coreDocument.schema ? coreDocument.schema : RMT_VNEXT_CORE_SCHEMA,
|
|
520
|
+
workpackage: RMT_VNEXT_COMPOSITION_WORKPACKAGE,
|
|
521
|
+
status,
|
|
522
|
+
ok: status !== 'blocked',
|
|
523
|
+
compositionId: options.compositionId || `composition:${coreDocument && coreDocument.manifest && coreDocument.manifest.documentId || 'rmt.vnext.document'}`,
|
|
524
|
+
mode: 'component-orchestration',
|
|
525
|
+
markupCoupled: false,
|
|
526
|
+
operationCount: operations.length,
|
|
527
|
+
slotCount: slotBindings.length,
|
|
528
|
+
componentBindingCount: componentBindings.length,
|
|
529
|
+
componentCatalog: {
|
|
530
|
+
schema: componentCatalog.schema,
|
|
531
|
+
count: componentCatalog.count,
|
|
532
|
+
ids: componentCatalog.ids.slice(),
|
|
533
|
+
aliasCount: componentCatalog.aliasCount
|
|
534
|
+
},
|
|
535
|
+
adapterCatalog: {
|
|
536
|
+
count: adapterCatalog.count,
|
|
537
|
+
ids: adapterCatalog.ids.slice()
|
|
538
|
+
},
|
|
539
|
+
byComponent,
|
|
540
|
+
slots: slotBindings,
|
|
541
|
+
componentBindings,
|
|
542
|
+
diagnostics
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
function serializeCompositionGraph(graph) {
|
|
547
|
+
return `${JSON.stringify(graph, null, 2)}\n`;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
function createRmtVNextCompositionContract(defaultOptions = {}) {
|
|
551
|
+
return Object.freeze({
|
|
552
|
+
schema: RMT_VNEXT_COMPOSITION_SCHEMA,
|
|
553
|
+
slotBindingSchema: RMT_VNEXT_SLOT_BINDING_SCHEMA,
|
|
554
|
+
componentBindingSchema: RMT_VNEXT_COMPONENT_BINDING_SCHEMA,
|
|
555
|
+
componentCatalogSchema: RMT_VNEXT_COMPONENT_CATALOG_SCHEMA,
|
|
556
|
+
componentAdapterSchema: RMT_VNEXT_COMPONENT_ADAPTER_SCHEMA,
|
|
557
|
+
coreSchema: RMT_VNEXT_CORE_SCHEMA,
|
|
558
|
+
workpackage: RMT_VNEXT_COMPOSITION_WORKPACKAGE,
|
|
559
|
+
createGraph: (coreDocument, options = {}) => createCompositionGraph(coreDocument, {
|
|
560
|
+
...defaultOptions,
|
|
561
|
+
...options
|
|
562
|
+
}),
|
|
563
|
+
serializeGraph: serializeCompositionGraph
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
module.exports = {
|
|
568
|
+
COMPONENT_BINDING_CAPABILITY,
|
|
569
|
+
COMPONENT_SLOT_CAPABILITY,
|
|
570
|
+
COMPOSITION_COMPONENT_ADAPTER_MISSING_CODE,
|
|
571
|
+
COMPOSITION_COMPONENT_REF_MISSING_CODE,
|
|
572
|
+
COMPOSITION_COMPONENT_SLOT_UNSUPPORTED_CODE,
|
|
573
|
+
COMPOSITION_COMPONENT_UNKNOWN_CODE,
|
|
574
|
+
COMPOSITION_OPERATION_TARGET_UNSUPPORTED_CODE,
|
|
575
|
+
COMPOSITION_SLOT_DUPLICATE_CODE,
|
|
576
|
+
COMPOSITION_SLOT_OPERATION_REF_MISSING_CODE,
|
|
577
|
+
COMPOSITION_SLOT_OPERATION_SCOPE_MISMATCH_CODE,
|
|
578
|
+
COMPOSITION_SLOT_OWNER_MISSING_CODE,
|
|
579
|
+
DEFAULT_COMPONENT_ADAPTER_ID,
|
|
580
|
+
RMT_VNEXT_COMPONENT_ADAPTER_SCHEMA,
|
|
581
|
+
RMT_VNEXT_COMPONENT_BINDING_SCHEMA,
|
|
582
|
+
RMT_VNEXT_COMPONENT_CATALOG_SCHEMA,
|
|
583
|
+
RMT_VNEXT_COMPOSITION_MODULE_PATH,
|
|
584
|
+
RMT_VNEXT_COMPOSITION_PACKAGE_SCRIPT,
|
|
585
|
+
RMT_VNEXT_COMPOSITION_REPORT_SCHEMA,
|
|
586
|
+
RMT_VNEXT_COMPOSITION_SCHEMA,
|
|
587
|
+
RMT_VNEXT_COMPOSITION_SUITE_PATH,
|
|
588
|
+
RMT_VNEXT_COMPOSITION_WORKPACKAGE,
|
|
589
|
+
RMT_VNEXT_SLOT_BINDING_SCHEMA,
|
|
590
|
+
createComponentAdapterStub,
|
|
591
|
+
createCompositionGraph,
|
|
592
|
+
createRmtVNextCompositionContract,
|
|
593
|
+
normalizeComponentCatalog,
|
|
594
|
+
serializeCompositionGraph
|
|
595
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export * from './rmt-tooling-public-types';
|
|
2
|
+
import type { RmtToolingConstant, RmtToolingFactory, RmtToolingFunction } from './rmt-tooling-public-types';
|
|
3
|
+
|
|
4
|
+
export declare const CONDITION_BINARY_OPERATORS: RmtToolingConstant;
|
|
5
|
+
export declare const CONDITION_EXPRESSION_KIND_UNSUPPORTED_CODE: RmtToolingConstant;
|
|
6
|
+
export declare const CONDITION_EXPRESSION_KINDS: RmtToolingConstant;
|
|
7
|
+
export declare const CONDITION_EXPRESSION_MISSING_CODE: RmtToolingConstant;
|
|
8
|
+
export declare const CONDITION_LOGICAL_OPERATORS: RmtToolingConstant;
|
|
9
|
+
export declare const CONDITION_OPERATOR_UNSUPPORTED_CODE: RmtToolingConstant;
|
|
10
|
+
export declare const CONDITION_PATH_UNKNOWN_CODE: RmtToolingConstant;
|
|
11
|
+
export declare const CONDITION_ROOT_TYPE_CODE: RmtToolingConstant;
|
|
12
|
+
export declare const CONDITION_TYPE_MISMATCH_CODE: RmtToolingConstant;
|
|
13
|
+
export declare const CONDITION_UNARY_OPERATORS: RmtToolingConstant;
|
|
14
|
+
export declare const createConditionContract: RmtToolingFactory;
|
|
15
|
+
export declare const createRmtVNextConditionContract: RmtToolingFactory;
|
|
16
|
+
export declare const DEFAULT_CONDITION_PATH_TYPES: RmtToolingConstant;
|
|
17
|
+
export declare const RMT_VNEXT_CONDITION_MODULE_PATH: RmtToolingConstant;
|
|
18
|
+
export declare const RMT_VNEXT_CONDITION_PACKAGE_SCRIPT: RmtToolingConstant;
|
|
19
|
+
export declare const RMT_VNEXT_CONDITION_RECORD_SCHEMA: RmtToolingConstant;
|
|
20
|
+
export declare const RMT_VNEXT_CONDITION_REPORT_SCHEMA: RmtToolingConstant;
|
|
21
|
+
export declare const RMT_VNEXT_CONDITION_SCHEMA: RmtToolingConstant;
|
|
22
|
+
export declare const RMT_VNEXT_CONDITION_SUITE_PATH: RmtToolingConstant;
|
|
23
|
+
export declare const RMT_VNEXT_CONDITION_WORKPACKAGE: RmtToolingConstant;
|
|
24
|
+
export declare const RMT_VNEXT_EXPRESSION_SCHEMA: RmtToolingConstant;
|
|
25
|
+
export declare const serializeConditionContract: RmtToolingFunction;
|