@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,716 @@
|
|
|
1
|
+
const {
|
|
2
|
+
RMT_FILE_FALLBACK_CODE,
|
|
3
|
+
RMT_VNEXT_PARSER_SCHEMA,
|
|
4
|
+
RMT_VNEXT_PARSER_WORKPACKAGE,
|
|
5
|
+
parseRmtVNextSource
|
|
6
|
+
} = require('./vnext-parser');
|
|
7
|
+
|
|
8
|
+
const RMT_VNEXT_CORE_SCHEMA = 'xtend.rmt.core-format.vnext.v1';
|
|
9
|
+
const RMT_VNEXT_COMPILER_SCHEMA = 'xtend.rmt.vnext-compiler.v1';
|
|
10
|
+
const RMT_VNEXT_COMPILER_REPORT_SCHEMA = 'xtend.rmt.vnext-compiler-report.v1';
|
|
11
|
+
const RMT_VNEXT_COMPILER_WORKPACKAGE = 'WP-E15-05';
|
|
12
|
+
const RMT_VNEXT_COMPILER_MODULE_PATH = 'tools/rmt-language/vnext-compiler.js';
|
|
13
|
+
const RMT_VNEXT_COMPILER_SUITE_PATH = 'tests/rmt-language/rmt_vnext_compiler_suite.js';
|
|
14
|
+
const RMT_VNEXT_COMPILER_PACKAGE_SCRIPT = 'npm run test:rmt-vnext-compiler';
|
|
15
|
+
const RMT_VNEXT_COMPILER_DIAGNOSTIC_CODE = 'rmt.vnext.compiler.diagnostic';
|
|
16
|
+
|
|
17
|
+
function normalizeIdSegment(value, fallback = 'unnamed') {
|
|
18
|
+
const normalized = String(value || fallback)
|
|
19
|
+
.trim()
|
|
20
|
+
.replace(/[^A-Za-z0-9._-]+/g, '_')
|
|
21
|
+
.replace(/^_+|_+$/g, '')
|
|
22
|
+
.toLowerCase();
|
|
23
|
+
|
|
24
|
+
return normalized || fallback;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function namespaceFromDocumentId(documentId) {
|
|
28
|
+
return String(documentId || 'rmt').split('.')[0] || 'rmt';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function cloneRange(range = {}) {
|
|
32
|
+
return {
|
|
33
|
+
start: {
|
|
34
|
+
line: range.start && Number.isInteger(range.start.line) ? range.start.line : 0,
|
|
35
|
+
character: range.start && Number.isInteger(range.start.character) ? range.start.character : 0
|
|
36
|
+
},
|
|
37
|
+
end: {
|
|
38
|
+
line: range.end && Number.isInteger(range.end.line) ? range.end.line : 0,
|
|
39
|
+
character: range.end && Number.isInteger(range.end.character) ? range.end.character : 0
|
|
40
|
+
},
|
|
41
|
+
startOffset: Number.isInteger(range.startOffset) ? range.startOffset : 0,
|
|
42
|
+
endOffset: Number.isInteger(range.endOffset) ? range.endOffset : 0
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function createCoreDocument(manifest = {}) {
|
|
47
|
+
return {
|
|
48
|
+
schema: RMT_VNEXT_CORE_SCHEMA,
|
|
49
|
+
kind: 'rmt_document',
|
|
50
|
+
version: '2.0-vnext',
|
|
51
|
+
manifest: {
|
|
52
|
+
documentId: manifest.documentId || 'rmt.vnext.document',
|
|
53
|
+
namespace: manifest.namespace || namespaceFromDocumentId(manifest.documentId),
|
|
54
|
+
sourceSyntax: 'rmt-vnext',
|
|
55
|
+
contracts: [
|
|
56
|
+
'xtend.rmt.vnext.grammar.v1',
|
|
57
|
+
RMT_VNEXT_CORE_SCHEMA
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
imports: [],
|
|
61
|
+
templates: [],
|
|
62
|
+
surfaces: [],
|
|
63
|
+
remoteSurfaces: [],
|
|
64
|
+
lanes: [],
|
|
65
|
+
operations: [],
|
|
66
|
+
slots: [],
|
|
67
|
+
events: [],
|
|
68
|
+
dataSources: [],
|
|
69
|
+
securityPolicies: [],
|
|
70
|
+
sourceMap: []
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function findFirstNamedDeclaration(ast) {
|
|
75
|
+
if (!ast || !Array.isArray(ast.body)) return null;
|
|
76
|
+
|
|
77
|
+
const template = ast.body.find((node) => node && node.type === 'RmtTemplateDeclaration' && node.name);
|
|
78
|
+
if (template) return template.name;
|
|
79
|
+
|
|
80
|
+
const surface = ast.body.find((node) => node && node.type === 'RmtSurfaceDeclaration' && node.name);
|
|
81
|
+
if (surface) return surface.name;
|
|
82
|
+
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function makeSourceRef(coreId) {
|
|
87
|
+
return `src:${coreId}`;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function addSourceMap(core, node, nodeType, corePointer, sourceRef) {
|
|
91
|
+
core.sourceMap.push({
|
|
92
|
+
id: sourceRef,
|
|
93
|
+
nodeType,
|
|
94
|
+
corePointer,
|
|
95
|
+
astPointer: node && node.astPointer ? node.astPointer : null,
|
|
96
|
+
range: cloneRange(node && node.range)
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function addRecord(core, domain, record, node, nodeType) {
|
|
101
|
+
const index = core[domain].length;
|
|
102
|
+
const corePointer = `/${domain}/${index}`;
|
|
103
|
+
const sourceRef = makeSourceRef(record.id);
|
|
104
|
+
const nextRecord = {
|
|
105
|
+
...record,
|
|
106
|
+
sourceRef
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
core[domain].push(nextRecord);
|
|
110
|
+
addSourceMap(core, node, nodeType, corePointer, sourceRef);
|
|
111
|
+
|
|
112
|
+
return nextRecord;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function compileExpression(node) {
|
|
116
|
+
if (!node) return null;
|
|
117
|
+
|
|
118
|
+
if (node.kind === 'literal') {
|
|
119
|
+
return {
|
|
120
|
+
kind: 'literal',
|
|
121
|
+
value: node.value
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (node.kind === 'path') {
|
|
126
|
+
return {
|
|
127
|
+
kind: 'path',
|
|
128
|
+
path: Array.isArray(node.path) ? node.path.slice() : String(node.value || '').split('.').filter(Boolean)
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (node.kind === 'unary') {
|
|
133
|
+
return {
|
|
134
|
+
kind: 'unary',
|
|
135
|
+
op: node.op,
|
|
136
|
+
argument: compileExpression(node.argument)
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (node.kind === 'binary' || node.kind === 'logical') {
|
|
141
|
+
return {
|
|
142
|
+
kind: node.kind,
|
|
143
|
+
op: node.op,
|
|
144
|
+
left: compileExpression(node.left),
|
|
145
|
+
right: compileExpression(node.right)
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (node.kind === 'group') {
|
|
150
|
+
return {
|
|
151
|
+
kind: 'group',
|
|
152
|
+
expression: compileExpression(node.expression)
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return {
|
|
157
|
+
kind: 'missing'
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function isTemplateNode(node) {
|
|
162
|
+
return node && node.type === 'RmtTemplateDeclaration';
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function isSurfaceNode(node) {
|
|
166
|
+
return node && node.type === 'RmtSurfaceDeclaration';
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function isRemoteSurfaceNode(node) {
|
|
170
|
+
return node && node.type === 'RmtRemoteSurfaceDeclaration';
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function isImportNode(node) {
|
|
174
|
+
return node && node.type === 'RmtImportDeclaration';
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function isLaneNode(node) {
|
|
178
|
+
return node && node.type === 'RmtLaneDeclaration';
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function isOperationNode(node) {
|
|
182
|
+
return node && (node.type === 'RmtLifecycleStatement' || node.type === 'RmtStreamStatement');
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function firstBodyNode(node, type) {
|
|
186
|
+
return (Array.isArray(node && node.body) ? node.body : []).find((child) => child && child.type === type) || null;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function bodyNodes(node, type) {
|
|
190
|
+
return (Array.isArray(node && node.body) ? node.body : []).filter((child) => child && child.type === type);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function inferRemoteCapabilities(exposes, emits, consumes) {
|
|
194
|
+
const capabilities = [];
|
|
195
|
+
if (exposes.length > 0) capabilities.push('surface.mount');
|
|
196
|
+
if (emits.length > 0) capabilities.push('event.emit');
|
|
197
|
+
if (consumes.length > 0) capabilities.push('event.consume');
|
|
198
|
+
return Array.from(new Set(capabilities)).map((id) => ({
|
|
199
|
+
id,
|
|
200
|
+
mode: 'required'
|
|
201
|
+
}));
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function compileRemoteShellTarget(target) {
|
|
205
|
+
if (!target) return null;
|
|
206
|
+
return {
|
|
207
|
+
type: target.type || null,
|
|
208
|
+
ref: target.ref || target.type || null
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function eventVersionFromName(eventName) {
|
|
213
|
+
const match = String(eventName || '').match(/\.v(\d+)$/);
|
|
214
|
+
return match ? `v${match[1]}` : '';
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
class VNextCompiler {
|
|
218
|
+
constructor(ast, options = {}) {
|
|
219
|
+
this.ast = ast;
|
|
220
|
+
const documentId = options.documentId || findFirstNamedDeclaration(ast) || 'rmt.vnext.document';
|
|
221
|
+
this.core = createCoreDocument({
|
|
222
|
+
documentId,
|
|
223
|
+
namespace: options.namespace || namespaceFromDocumentId(documentId)
|
|
224
|
+
});
|
|
225
|
+
this.diagnostics = [];
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
compile() {
|
|
229
|
+
const body = Array.isArray(this.ast && this.ast.body) ? this.ast.body : [];
|
|
230
|
+
|
|
231
|
+
body.forEach((node) => {
|
|
232
|
+
if (isImportNode(node)) {
|
|
233
|
+
this.compileImport(node);
|
|
234
|
+
} else if (isTemplateNode(node)) {
|
|
235
|
+
this.compileTemplate(node);
|
|
236
|
+
} else if (isRemoteSurfaceNode(node)) {
|
|
237
|
+
this.compileRemoteSurface(node);
|
|
238
|
+
} else if (isSurfaceNode(node)) {
|
|
239
|
+
this.compileSurface(node, null);
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
return this.core;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
compileImport(node) {
|
|
247
|
+
const id = `import:${this.core.imports.length}`;
|
|
248
|
+
return addRecord(this.core, 'imports', {
|
|
249
|
+
id,
|
|
250
|
+
path: node.path,
|
|
251
|
+
mode: node.mode || (node.path && node.path.includes('*') ? 'static_glob' : 'static_file')
|
|
252
|
+
}, node, 'RmtImportDeclaration');
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
compileTemplate(node) {
|
|
256
|
+
const name = node.name || `template.${this.core.templates.length}`;
|
|
257
|
+
const normalizedName = normalizeIdSegment(name);
|
|
258
|
+
const templateId = `template:${normalizedName}`;
|
|
259
|
+
const surfaceRefs = [];
|
|
260
|
+
const templateRecord = addRecord(this.core, 'templates', {
|
|
261
|
+
id: templateId,
|
|
262
|
+
name,
|
|
263
|
+
mode: 'orchestration',
|
|
264
|
+
surfaceRefs
|
|
265
|
+
}, node, 'RmtTemplateDeclaration');
|
|
266
|
+
|
|
267
|
+
(Array.isArray(node.body) ? node.body : []).forEach((child) => {
|
|
268
|
+
if (isImportNode(child)) {
|
|
269
|
+
this.compileImport(child);
|
|
270
|
+
} else if (isSurfaceNode(child)) {
|
|
271
|
+
const surface = this.compileSurface(child, {
|
|
272
|
+
templateName: name,
|
|
273
|
+
templateId,
|
|
274
|
+
templatePath: normalizedName
|
|
275
|
+
});
|
|
276
|
+
if (surface) surfaceRefs.push(surface.id);
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
templateRecord.surfaceRefs = surfaceRefs;
|
|
281
|
+
return templateRecord;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
compileSurface(node, templateContext) {
|
|
285
|
+
const name = node.name || `surface.${this.core.surfaces.length}`;
|
|
286
|
+
const surfaceSegment = normalizeIdSegment(name);
|
|
287
|
+
const scopePath = templateContext ? `${templateContext.templatePath}/${surfaceSegment}` : surfaceSegment;
|
|
288
|
+
const surfaceId = templateContext ? `surface:${scopePath}` : `surface:${surfaceSegment}`;
|
|
289
|
+
const laneRefs = [];
|
|
290
|
+
const record = {
|
|
291
|
+
id: surfaceId,
|
|
292
|
+
name,
|
|
293
|
+
kind: name === 'root' ? 'root' : 'named_surface',
|
|
294
|
+
laneRefs
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
if (templateContext) {
|
|
298
|
+
record.scope = {
|
|
299
|
+
template: templateContext.templateId
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
const surfaceRecord = addRecord(this.core, 'surfaces', record, node, 'RmtSurfaceDeclaration');
|
|
304
|
+
|
|
305
|
+
(Array.isArray(node.body) ? node.body : []).forEach((child) => {
|
|
306
|
+
if (!isLaneNode(child)) return;
|
|
307
|
+
const lane = this.compileLane(child, {
|
|
308
|
+
...templateContext,
|
|
309
|
+
surfaceName: name,
|
|
310
|
+
surfaceId,
|
|
311
|
+
surfacePath: scopePath
|
|
312
|
+
});
|
|
313
|
+
if (lane) laneRefs.push(lane.id);
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
surfaceRecord.laneRefs = laneRefs;
|
|
317
|
+
return surfaceRecord;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
compileRemoteSurface(node) {
|
|
321
|
+
const name = node.name || `remote.surface.${this.core.remoteSurfaces.length}`;
|
|
322
|
+
const surfaceSegment = normalizeIdSegment(name);
|
|
323
|
+
const remoteSurfaceId = `remoteSurface:${surfaceSegment}`;
|
|
324
|
+
const ownerNode = firstBodyNode(node, 'RmtRemoteOwnerClause');
|
|
325
|
+
const versionNode = firstBodyNode(node, 'RmtRemoteVersionClause');
|
|
326
|
+
const originNode = firstBodyNode(node, 'RmtRemoteOriginClause');
|
|
327
|
+
const integrityNode = firstBodyNode(node, 'RmtRemoteIntegrityClause');
|
|
328
|
+
const trustNode = firstBodyNode(node, 'RmtRemoteTrustBoundaryClause');
|
|
329
|
+
const fallbackNode = firstBodyNode(node, 'RmtRemoteFallbackClause');
|
|
330
|
+
const exposeNodes = bodyNodes(node, 'RmtRemoteExposeClause');
|
|
331
|
+
const eventNodes = bodyNodes(node, 'RmtRemoteEventClause');
|
|
332
|
+
const emits = eventNodes.filter((event) => event.kind === 'emits').map((event) => this.compileRemoteEvent(event, 'outbound'));
|
|
333
|
+
const consumes = eventNodes.filter((event) => event.kind === 'consumes').map((event) => this.compileRemoteEvent(event, 'inbound'));
|
|
334
|
+
const capabilities = inferRemoteCapabilities(exposeNodes, emits, consumes);
|
|
335
|
+
const capabilityIds = capabilities.map((capability) => capability.id);
|
|
336
|
+
const record = {
|
|
337
|
+
id: remoteSurfaceId,
|
|
338
|
+
manifestId: `remoteManifest:${surfaceSegment}`,
|
|
339
|
+
name,
|
|
340
|
+
kind: 'remote_surface',
|
|
341
|
+
remote: {
|
|
342
|
+
id: node.remoteId || null,
|
|
343
|
+
origin: originNode && originNode.value || null,
|
|
344
|
+
versionRange: versionNode && versionNode.value || null,
|
|
345
|
+
integrity: {
|
|
346
|
+
algorithm: integrityNode && integrityNode.algorithm || null,
|
|
347
|
+
digest: integrityNode && integrityNode.digest || null
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
owner: {
|
|
351
|
+
kind: ownerNode && ownerNode.kind || 'team',
|
|
352
|
+
id: ownerNode && ownerNode.id || null
|
|
353
|
+
},
|
|
354
|
+
security: {
|
|
355
|
+
trustBoundary: trustNode && trustNode.boundary || null,
|
|
356
|
+
capabilityMode: 'deny-by-default',
|
|
357
|
+
sandboxRequired: true,
|
|
358
|
+
cspRequired: true
|
|
359
|
+
},
|
|
360
|
+
exposes: exposeNodes.map((expose) => ({
|
|
361
|
+
lane: expose.lane || null,
|
|
362
|
+
target: compileRemoteShellTarget(expose.target),
|
|
363
|
+
mode: 'mount'
|
|
364
|
+
})),
|
|
365
|
+
events: {
|
|
366
|
+
emits,
|
|
367
|
+
consumes
|
|
368
|
+
},
|
|
369
|
+
capabilities,
|
|
370
|
+
adapterBoundary: {
|
|
371
|
+
adapterId: 'xtend.remote-surface.host',
|
|
372
|
+
capabilities: capabilityIds,
|
|
373
|
+
hostOwned: true,
|
|
374
|
+
runtimeLoader: false
|
|
375
|
+
},
|
|
376
|
+
fallback: {
|
|
377
|
+
kind: fallbackNode && fallbackNode.kind || 'surface',
|
|
378
|
+
ref: fallbackNode && fallbackNode.ref || null
|
|
379
|
+
},
|
|
380
|
+
runtime: {
|
|
381
|
+
kernelRemoteExecution: false,
|
|
382
|
+
hostAdapterRequired: true,
|
|
383
|
+
networkRequiredByKernel: false
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
const remoteRecord = addRecord(this.core, 'remoteSurfaces', record, node, 'RmtRemoteSurfaceDeclaration');
|
|
388
|
+
this.addRemoteChildSourceMaps(node, remoteRecord);
|
|
389
|
+
return remoteRecord;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
compileRemoteEvent(node, fallbackDirection) {
|
|
393
|
+
const ownerNode = firstBodyNode(node, 'RmtRemoteOwnerClause');
|
|
394
|
+
const directionNode = firstBodyNode(node, 'RmtRemoteEventDirectionClause');
|
|
395
|
+
const laneNode = firstBodyNode(node, 'RmtRemoteEventLaneClause');
|
|
396
|
+
const fromNode = firstBodyNode(node, 'RmtRemoteEventFromClause');
|
|
397
|
+
const payloadNode = firstBodyNode(node, 'RmtRemoteEventPayloadClause');
|
|
398
|
+
const lane = laneNode && laneNode.lane || null;
|
|
399
|
+
const scopes = [];
|
|
400
|
+
|
|
401
|
+
if (lane) scopes.push(`lane:${lane}`);
|
|
402
|
+
if (fromNode && fromNode.source && fromNode.source.ref) {
|
|
403
|
+
scopes.push(fromNode.source.ref);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
return {
|
|
407
|
+
event: node.event || null,
|
|
408
|
+
owner: {
|
|
409
|
+
kind: ownerNode && ownerNode.kind || 'team',
|
|
410
|
+
id: ownerNode && ownerNode.id || null
|
|
411
|
+
},
|
|
412
|
+
direction: directionNode && directionNode.direction || fallbackDirection,
|
|
413
|
+
version: eventVersionFromName(node.event),
|
|
414
|
+
lane,
|
|
415
|
+
from: compileRemoteShellTarget(fromNode && fromNode.source),
|
|
416
|
+
payload: {
|
|
417
|
+
schema: payloadNode && payloadNode.value || null,
|
|
418
|
+
shape: null
|
|
419
|
+
},
|
|
420
|
+
scopes
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
addRemoteChildSourceMaps(node, record) {
|
|
425
|
+
const remoteIndex = this.core.remoteSurfaces.indexOf(record);
|
|
426
|
+
const pointerBase = `/remoteSurfaces/${remoteIndex}`;
|
|
427
|
+
const children = Array.isArray(node.body) ? node.body : [];
|
|
428
|
+
children.forEach((child, index) => {
|
|
429
|
+
const childSourceRef = makeSourceRef(`${record.id}/${index}`);
|
|
430
|
+
addSourceMap(this.core, child, child.type, `${pointerBase}/body/${index}`, childSourceRef);
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
compileLane(node, scope) {
|
|
435
|
+
const name = node.name || `lane.${this.core.lanes.length}`;
|
|
436
|
+
const laneSegment = normalizeIdSegment(name);
|
|
437
|
+
const lanePath = `${scope.surfacePath}/${laneSegment}`;
|
|
438
|
+
const laneId = `lane:${lanePath}`;
|
|
439
|
+
const operationRefs = [];
|
|
440
|
+
const record = {
|
|
441
|
+
id: laneId,
|
|
442
|
+
name,
|
|
443
|
+
scope: {
|
|
444
|
+
surface: scope.surfaceId
|
|
445
|
+
},
|
|
446
|
+
operationRefs
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
if (scope.templateId) {
|
|
450
|
+
record.scope.template = scope.templateId;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
if (node.weight !== null && node.weight !== undefined) {
|
|
454
|
+
record.weight = node.weight;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
const laneRecord = addRecord(this.core, 'lanes', record, node, 'RmtLaneDeclaration');
|
|
458
|
+
|
|
459
|
+
(Array.isArray(node.body) ? node.body : []).forEach((child, index) => {
|
|
460
|
+
if (!isOperationNode(child)) return;
|
|
461
|
+
const operation = this.compileOperation(child, {
|
|
462
|
+
...scope,
|
|
463
|
+
laneName: name,
|
|
464
|
+
laneId,
|
|
465
|
+
lanePath,
|
|
466
|
+
operationPath: `${lanePath}/${index}`
|
|
467
|
+
});
|
|
468
|
+
if (operation) operationRefs.push(operation.id);
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
laneRecord.operationRefs = operationRefs;
|
|
472
|
+
return laneRecord;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
compileOperation(node, context) {
|
|
476
|
+
const operationId = `operation:${context.operationPath}`;
|
|
477
|
+
const kind = node.type === 'RmtStreamStatement' ? 'stream' : 'lifecycle';
|
|
478
|
+
const record = {
|
|
479
|
+
id: operationId,
|
|
480
|
+
kind,
|
|
481
|
+
op: kind === 'stream' ? 'stream' : node.op,
|
|
482
|
+
target: {
|
|
483
|
+
kind: 'ref',
|
|
484
|
+
ref: node.target && node.target.value
|
|
485
|
+
},
|
|
486
|
+
scope: {
|
|
487
|
+
surface: context.surfaceId,
|
|
488
|
+
lane: context.laneId
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
if (context.templateId) {
|
|
493
|
+
record.scope.template = context.templateId;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
if (node.source) {
|
|
497
|
+
const dataSource = this.compileDataSource(node.source, operationId, context.operationPath);
|
|
498
|
+
record.source = {
|
|
499
|
+
ref: dataSource.id,
|
|
500
|
+
kind: dataSource.kind,
|
|
501
|
+
id: dataSource.target
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
if (node.condition) {
|
|
506
|
+
record.condition = this.compileCondition(node.condition, operationId, context.operationPath);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
const operationRecord = addRecord(this.core, 'operations', record, node, node.type);
|
|
510
|
+
const policyRefs = this.compilePolicyBlock(node.policy, operationRecord.id, context);
|
|
511
|
+
|
|
512
|
+
if (policyRefs.length > 0) {
|
|
513
|
+
operationRecord.policyRefs = policyRefs;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
return operationRecord;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
compileDataSource(node, ownerOperation, ownerPath) {
|
|
520
|
+
const id = `dataSource:${ownerPath}`;
|
|
521
|
+
return addRecord(this.core, 'dataSources', {
|
|
522
|
+
id,
|
|
523
|
+
kind: node.kind,
|
|
524
|
+
target: node.target,
|
|
525
|
+
ownerOperation
|
|
526
|
+
}, node, 'RmtSourceClause');
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
compileCondition(node, ownerOperation, ownerPath) {
|
|
530
|
+
const sourceRef = makeSourceRef(`condition:${ownerPath}`);
|
|
531
|
+
const pointer = `/operations/${this.core.operations.length}/condition`;
|
|
532
|
+
const condition = {
|
|
533
|
+
kind: 'condition',
|
|
534
|
+
expression: compileExpression(node.expression),
|
|
535
|
+
sourceRef
|
|
536
|
+
};
|
|
537
|
+
|
|
538
|
+
addSourceMap(this.core, node, 'RmtConditionClause', pointer, sourceRef);
|
|
539
|
+
|
|
540
|
+
return condition;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
compilePolicyBlock(policy, ownerOperation, context) {
|
|
544
|
+
if (!policy || !Array.isArray(policy.body)) return [];
|
|
545
|
+
|
|
546
|
+
const refs = [];
|
|
547
|
+
policy.body.forEach((item, index) => {
|
|
548
|
+
if (item.type === 'RmtSlotDeclaration') {
|
|
549
|
+
refs.push(this.compileSlot(item, ownerOperation, context).id);
|
|
550
|
+
} else if (item.type === 'RmtEventBinding') {
|
|
551
|
+
refs.push(this.compileEvent(item, ownerOperation, context.operationPath).id);
|
|
552
|
+
} else if (item.type === 'RmtTrustBoundaryPolicy' || item.type === 'RmtSanitizePolicy') {
|
|
553
|
+
refs.push(this.compileSecurityPolicy(item, ownerOperation, context.operationPath, index).id);
|
|
554
|
+
}
|
|
555
|
+
});
|
|
556
|
+
return refs;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
compileSlot(node, ownerOperation, context) {
|
|
560
|
+
const slotSegment = normalizeIdSegment(node.name || `slot.${this.core.slots.length}`);
|
|
561
|
+
const slotPath = `${context.operationPath}/${slotSegment}`;
|
|
562
|
+
const slotId = `slot:${slotPath}`;
|
|
563
|
+
const operationRefs = [];
|
|
564
|
+
const slotRecord = addRecord(this.core, 'slots', {
|
|
565
|
+
id: slotId,
|
|
566
|
+
name: node.name,
|
|
567
|
+
ownerOperation,
|
|
568
|
+
operationRefs
|
|
569
|
+
}, node, 'RmtSlotDeclaration');
|
|
570
|
+
|
|
571
|
+
(Array.isArray(node.body) ? node.body : []).forEach((child, index) => {
|
|
572
|
+
if (!isOperationNode(child)) return;
|
|
573
|
+
const operation = this.compileOperation(child, {
|
|
574
|
+
...context,
|
|
575
|
+
operationPath: `${slotPath}/${index}`
|
|
576
|
+
});
|
|
577
|
+
if (operation) operationRefs.push(operation.id);
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
slotRecord.operationRefs = operationRefs;
|
|
581
|
+
return slotRecord;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
compileEvent(node, ownerOperation, ownerPath) {
|
|
585
|
+
const eventSegment = normalizeIdSegment(node.event || `event.${this.core.events.length}`);
|
|
586
|
+
const id = `event:${ownerPath}/${eventSegment}`;
|
|
587
|
+
const record = {
|
|
588
|
+
id,
|
|
589
|
+
event: node.event,
|
|
590
|
+
action: node.action,
|
|
591
|
+
ownerOperation,
|
|
592
|
+
condition: null
|
|
593
|
+
};
|
|
594
|
+
|
|
595
|
+
if (node.condition) {
|
|
596
|
+
record.condition = {
|
|
597
|
+
kind: 'condition',
|
|
598
|
+
expression: compileExpression(node.condition.expression),
|
|
599
|
+
sourceRef: makeSourceRef(`condition:${ownerPath}/event/${eventSegment}`)
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
return addRecord(this.core, 'events', record, node, 'RmtEventBinding');
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
compileSecurityPolicy(node, ownerOperation, ownerPath, policyIndex) {
|
|
607
|
+
if (node.type === 'RmtTrustBoundaryPolicy') {
|
|
608
|
+
return addRecord(this.core, 'securityPolicies', {
|
|
609
|
+
id: `security:${ownerPath}/trustBoundary/${policyIndex}`,
|
|
610
|
+
kind: 'trust_boundary',
|
|
611
|
+
boundary: node.boundary,
|
|
612
|
+
ownerOperation
|
|
613
|
+
}, node, 'RmtTrustBoundaryPolicy');
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
return addRecord(this.core, 'securityPolicies', {
|
|
617
|
+
id: `security:${ownerPath}/sanitize/${policyIndex}`,
|
|
618
|
+
kind: 'sanitize',
|
|
619
|
+
format: node.format,
|
|
620
|
+
ownerOperation
|
|
621
|
+
}, node, 'RmtSanitizePolicy');
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
function compileRmtVNextAst(ast, options = {}) {
|
|
626
|
+
const compiler = new VNextCompiler(ast, options);
|
|
627
|
+
return compiler.compile();
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
function coreDocumentForSerialization(coreDocument) {
|
|
631
|
+
const serializable = {
|
|
632
|
+
...coreDocument
|
|
633
|
+
};
|
|
634
|
+
|
|
635
|
+
if (Array.isArray(serializable.remoteSurfaces) && serializable.remoteSurfaces.length === 0) {
|
|
636
|
+
delete serializable.remoteSurfaces;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
return serializable;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
function serializeRmtVNextCore(coreDocument) {
|
|
643
|
+
return `${JSON.stringify(coreDocumentForSerialization(coreDocument), null, 2)}\n`;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
function compileRmtVNextSource(input = {}, options = {}) {
|
|
647
|
+
const parserResult = parseRmtVNextSource(input, options);
|
|
648
|
+
|
|
649
|
+
if (!parserResult.ok) {
|
|
650
|
+
return {
|
|
651
|
+
schema: RMT_VNEXT_COMPILER_SCHEMA,
|
|
652
|
+
workpackage: RMT_VNEXT_COMPILER_WORKPACKAGE,
|
|
653
|
+
ok: false,
|
|
654
|
+
phase: parserResult.phase || 'syntax',
|
|
655
|
+
status: parserResult.status || 'syntax_error',
|
|
656
|
+
parserResult,
|
|
657
|
+
coreDocument: null,
|
|
658
|
+
coreJson: null,
|
|
659
|
+
diagnostics: parserResult.diagnostics,
|
|
660
|
+
compilerDiagnostics: []
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
const coreDocument = compileRmtVNextAst(parserResult.ast, options);
|
|
665
|
+
const coreJson = serializeRmtVNextCore(coreDocument);
|
|
666
|
+
const diagnostics = parserResult.diagnostics.slice();
|
|
667
|
+
|
|
668
|
+
return {
|
|
669
|
+
schema: RMT_VNEXT_COMPILER_SCHEMA,
|
|
670
|
+
workpackage: RMT_VNEXT_COMPILER_WORKPACKAGE,
|
|
671
|
+
ok: diagnostics.filter((diagnostic) => diagnostic.severity === 'error').length === 0,
|
|
672
|
+
phase: 'compile',
|
|
673
|
+
status: 'compiled',
|
|
674
|
+
parserResult,
|
|
675
|
+
coreDocument,
|
|
676
|
+
coreJson,
|
|
677
|
+
diagnostics,
|
|
678
|
+
compilerDiagnostics: []
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
function createRmtVNextCompiler(defaultOptions = {}) {
|
|
683
|
+
function compileSource(input = {}, options = {}) {
|
|
684
|
+
return compileRmtVNextSource(input, {
|
|
685
|
+
...defaultOptions,
|
|
686
|
+
...options
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
return Object.freeze({
|
|
691
|
+
schema: RMT_VNEXT_COMPILER_SCHEMA,
|
|
692
|
+
coreSchema: RMT_VNEXT_CORE_SCHEMA,
|
|
693
|
+
parserSchema: RMT_VNEXT_PARSER_SCHEMA,
|
|
694
|
+
workpackage: RMT_VNEXT_COMPILER_WORKPACKAGE,
|
|
695
|
+
compileSource,
|
|
696
|
+
compileAst: (ast, options = {}) => compileRmtVNextAst(ast, { ...defaultOptions, ...options }),
|
|
697
|
+
serializeCore: serializeRmtVNextCore
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
module.exports = {
|
|
702
|
+
RMT_FILE_FALLBACK_CODE,
|
|
703
|
+
RMT_VNEXT_COMPILER_DIAGNOSTIC_CODE,
|
|
704
|
+
RMT_VNEXT_COMPILER_MODULE_PATH,
|
|
705
|
+
RMT_VNEXT_COMPILER_PACKAGE_SCRIPT,
|
|
706
|
+
RMT_VNEXT_COMPILER_REPORT_SCHEMA,
|
|
707
|
+
RMT_VNEXT_COMPILER_SCHEMA,
|
|
708
|
+
RMT_VNEXT_COMPILER_SUITE_PATH,
|
|
709
|
+
RMT_VNEXT_COMPILER_WORKPACKAGE,
|
|
710
|
+
RMT_VNEXT_CORE_SCHEMA,
|
|
711
|
+
RMT_VNEXT_PARSER_WORKPACKAGE,
|
|
712
|
+
compileRmtVNextAst,
|
|
713
|
+
compileRmtVNextSource,
|
|
714
|
+
createRmtVNextCompiler,
|
|
715
|
+
serializeRmtVNextCore
|
|
716
|
+
};
|