@flanksource/page-runtime 0.0.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +495 -0
- package/dist/build/README.md +96 -0
- package/{spikes/lib → dist/build}/cjs-export-names.mjs +4 -2
- package/dist/build/dependencies.mjs +279 -0
- package/dist/build/dependencies.mjs.map +1 -0
- package/dist/build/dependency-cache-Zg-FGasE.mjs +2130 -0
- package/dist/build/dependency-cache-Zg-FGasE.mjs.map +1 -0
- package/dist/build/index.mjs +42 -0
- package/dist/build/index.mjs.map +1 -0
- package/{builder-package.json → dist/build/package.json} +1 -1
- package/dist/build/types/activity-schema.d.ts +62 -0
- package/dist/build/types/build/barrels.d.ts +70 -0
- package/dist/build/types/build/base.d.ts +2 -0
- package/dist/build/types/build/browser-runtime-exports.d.ts +19 -0
- package/dist/build/types/build/check-fragment.d.ts +5 -0
- package/dist/build/types/build/commonjs-exports.d.ts +5 -0
- package/dist/build/types/build/convert-commonjs.d.ts +12 -0
- package/dist/build/types/build/dependencies.d.ts +6 -0
- package/dist/build/types/build/dependency-barrel-index.d.ts +5 -0
- package/dist/build/types/build/dependency-barrels.d.ts +7 -0
- package/dist/build/types/build/dependency-cache.d.ts +7 -0
- package/dist/build/types/build/dependency-optional.d.ts +4 -0
- package/dist/build/types/build/dependency-plugin.d.ts +8 -0
- package/dist/build/types/build/dependency-runtime.d.ts +20 -0
- package/dist/build/types/build/dependency-workers.d.ts +8 -0
- package/dist/build/types/build/errors.d.ts +9 -0
- package/dist/build/types/build/fragment.d.ts +13 -0
- package/dist/build/types/build/index.d.ts +7 -0
- package/dist/build/types/build/library-runtime.d.ts +21 -0
- package/dist/build/types/build/module-utils.d.ts +3 -0
- package/dist/build/types/build/recipe-dependencies.d.ts +2 -0
- package/dist/build/types/build/runtime-entries.d.ts +4 -0
- package/dist/build/types/build/runtime-layer.d.ts +17 -0
- package/dist/build/types/build/trace.d.ts +140 -0
- package/dist/build/types/design-schema.d.ts +98 -0
- package/dist/build/types/host/agent-source.d.ts +2 -0
- package/dist/build/types/host/agent-validation.d.ts +3 -0
- package/dist/build/types/host/design-validation.d.ts +2 -0
- package/dist/build/types/host/message-values.d.ts +8 -0
- package/dist/build/types/host/review/validation.d.ts +5 -0
- package/dist/build/types/host/validation.d.ts +6 -0
- package/dist/build/types/link/page-sources.d.ts +31 -0
- package/dist/build/types/link/types.d.ts +62 -0
- package/dist/build/types/link/validation.d.ts +9 -0
- package/dist/build/types/markers.d.ts +10 -0
- package/dist/build/types/review-schema.d.ts +60 -0
- package/dist/build/types/schema.d.ts +319 -0
- package/dist/build/types/sw/barrels.d.ts +9 -0
- package/dist/build/types/sw/compiler-plugins.d.ts +6 -0
- package/dist/build/types/sw/composition.d.ts +8 -0
- package/dist/build/types/sw/module-transform.d.ts +68 -0
- package/dist/build/types/sw/profile.d.ts +7 -0
- package/dist/build/types/sw/source-provider.d.ts +7 -0
- package/dist/build/types/sw/versions.d.ts +10 -0
- package/dist/node/catalog.mjs +1 -0
- package/dist/node/chunks/publication-RchcQvxD.mjs +229 -0
- package/dist/node/chunks/publication-RchcQvxD.mjs.map +1 -0
- package/dist/node/chunks/schema-CaRTfg2x.mjs +12 -0
- package/dist/node/chunks/schema-CaRTfg2x.mjs.map +1 -0
- package/dist/node/dev.mjs +410 -0
- package/dist/node/dev.mjs.map +1 -0
- package/dist/node/publication/cli.mjs +13 -0
- package/dist/node/publication/cli.mjs.map +1 -0
- package/dist/node/publication.mjs +1 -0
- package/dist/node/schema.mjs +1 -0
- package/dist/node/styles.mjs +49 -0
- package/dist/node/styles.mjs.map +1 -0
- package/dist/static/boot.js +40938 -0
- package/dist/static/boot.js.map +1 -0
- package/dist/static/bootstrap.html +1 -0
- package/dist/static/devtools-hook.js +118 -0
- package/dist/static/document-bundle.js +1 -0
- package/dist/static/document.js +2621 -0
- package/dist/static/editing.js +37 -0
- package/dist/static/export-compiler.js +81521 -0
- package/dist/static/export-compiler.js.map +1 -0
- package/dist/static/page-agent.js +17193 -0
- package/dist/static/page-agent.js.map +1 -0
- package/dist/static/sw.js +86112 -0
- package/dist/static/sw.js.map +1 -0
- package/package.json +46 -13
- package/scripts/build-node.ts +26 -0
- package/scripts/build-static.ts +15 -4
- package/scripts/build.ts +1 -0
- package/scripts/react-externals.ts +18 -0
- package/scripts/release-version.ts +2 -1
- package/src/activity-schema.ts +3 -2
- package/src/build/README.md +3 -1
- package/src/build/browser-runtime-exports.ts +52 -0
- package/src/build/dependencies.ts +3 -1
- package/src/build/dependency-barrel-index.ts +48 -0
- package/src/build/dependency-barrels.ts +26 -5
- package/src/build/dependency-cache.ts +1 -1
- package/src/build/dependency-optional.ts +15 -0
- package/src/build/dependency-plugin.ts +2 -2
- package/src/build/dependency-runtime.ts +48 -13
- package/src/build/dependency-workers.ts +41 -0
- package/src/build/library-runtime.ts +6 -3
- package/src/build/runtime-layer.ts +99 -0
- package/src/build/trace.ts +12 -10
- package/src/dev/README.md +30 -0
- package/src/dev/index.ts +4 -1
- package/src/dev/runtime-origin.ts +63 -0
- package/src/editing.ts +1 -1
- package/src/form/entry-source.ts +68 -0
- package/src/form/form-page.ts +63 -0
- package/src/form/index.ts +2 -0
- package/src/form/source-update.ts +17 -0
- package/src/frame/activity.ts +4 -2
- package/src/frame/agent/README.md +1 -1
- package/src/frame/agent/agent.browser.ts +1 -1
- package/src/frame/agent/frame-layout.ts +54 -0
- package/src/frame/agent/index.ts +11 -8
- package/src/frame/agent/overlay.ts +19 -6
- package/src/frame/agent/owner.ts +6 -3
- package/src/frame/agent/review.ts +3 -2
- package/src/frame/agent.ts +1 -0
- package/src/frame/boot-styles.ts +3 -3
- package/src/frame/boot.ts +98 -34
- package/src/frame/bridge.ts +4 -4
- package/src/frame/document-assets.ts +76 -0
- package/src/frame/document-entry.ts +68 -0
- package/src/frame/document-modules.ts +113 -0
- package/src/frame/document-mount.ts +32 -0
- package/src/frame/export-page.ts +6 -4
- package/src/frame/export.ts +5 -6
- package/src/frame/index.ts +2 -1
- package/src/frame/mount-page.ts +36 -0
- package/src/frame/render-job.ts +101 -0
- package/src/frame/runtime.browser.ts +20 -1
- package/src/frame/tailwind/load.ts +16 -7
- package/src/frame/tailwind/recipe.ts +4 -9
- package/src/frame/tailwind/runtime.ts +4 -4
- package/src/frame/tailwind/stylesheets.ts +12 -7
- package/src/frame/tailwind/testing/client.ts +8 -7
- package/src/frame/tailwind/testing/server.ts +1 -1
- package/src/frame/testing/boot-layout.ts +3 -0
- package/src/frame/testing/host.ts +18 -0
- package/src/frame/testing/server.ts +18 -3
- package/src/host/BuildLog.tsx +2 -1
- package/src/host/DEBUG_CONSOLE.md +13 -0
- package/src/host/PageForm.tsx +63 -0
- package/src/host/PageFrame.tsx +14 -6
- package/src/host/RuntimeActivity.tsx +3 -1
- package/src/host/RuntimeDebugPanel.tsx +18 -0
- package/src/host/activity-state.ts +1 -1
- package/src/host/bridge.ts +2 -1
- package/src/host/debug-runtime.tsx +17 -0
- package/src/host/design-validation.ts +1 -1
- package/src/host/index.ts +1 -0
- package/src/host/link/transport.ts +2 -1
- package/src/host/review/index.ts +6 -5
- package/src/host/runtime-diagnostics.ts +41 -0
- package/src/host/validation.ts +40 -3
- package/src/link/testing/server.ts +10 -7
- package/src/link/testing/worker.ts +1 -1
- package/src/schema.ts +32 -6
- package/src/styles.ts +40 -0
- package/src/sw/compile.ts +1 -1
- package/src/sw/compiler.ts +14 -7
- package/src/sw/converted.browser.ts +1 -1
- package/src/sw/errors.ts +15 -2
- package/{spikes/esm-sh → src/sw/esm-sh-fixtures}/browser-server.ts +5 -5
- package/{spikes/esm-sh → src/sw/esm-sh-fixtures}/fixtures.ts +2 -2
- package/src/sw/link-compiler.ts +12 -4
- package/src/sw/link-route.ts +1 -1
- package/src/sw/markers.ts +1 -1
- package/src/sw/module-transform.ts +14 -2
- package/src/sw/profile.ts +3 -1
- package/src/sw/resolver.ts +8 -4
- package/src/sw/router.ts +52 -12
- package/src/sw/runtime-exports.ts +39 -0
- package/src/sw/source-provider.ts +20 -0
- package/src/sw/versions.ts +11 -4
- package/src/sw/worker.ts +5 -1
- package/.vitest/gavel-reporter-3e3dfb64eda19344.mjs +0 -59
- package/.vitest/vitest-report-root-1793958008919344000.json +0 -1
- package/.vitest/vitest-report-root-1793958052786561000.json +0 -1
- package/.vitest/vitest-report-root-1793958143511414000.json +0 -1
- package/.vitest/vitest-report-root-1793958185908019000.json +0 -1
- package/.vitest/vitest-report-root-1793958252687550000.json +0 -1
- package/.vitest/vitest-report-root-1793958260385388000.json +0 -1
- package/.vitest/vitest-report-root-1793958312358683000.json +0 -1
- package/.vitest/vitest-report-root-1793958386118791000.json +0 -1
- package/.vitest/vitest-report-root-1793958388712140000.json +0 -1
- package/.vitest/vitest-report-root-1793958429135603000.json +0 -1
- package/.vitest/vitest-report-root-1793958433387809000.json +0 -1
- package/.vitest/vitest-report-root-1793958517322792000.json +0 -1
- package/.vitest/vitest-report-root-1793958542332252000.json +0 -1
- package/.vitest/vitest-report-root-1793958617698698000.json +0 -1
- package/.vitest/vitest-report-root-1793958676587753000.json +0 -1
- package/.vitest/vitest-report-root-1793958707827469000.json +0 -1
- package/.vitest/vitest-report-root-1793958729745028000.json +0 -1
- package/.vitest/vitest-report-root-1793958736696408000.json +0 -1
- package/.vitest/vitest-report-root-1793958740449993000.json +0 -1
- package/.vitest/vitest-report-root-1793958841510921000.json +0 -1
- package/.vitest/vitest-report-root-1793958847664582000.json +0 -1
- package/.vitest/vitest-report-root-1793958900327643000.json +0 -1
- package/.vitest/vitest-report-root-1793958950822823000.json +0 -1
- package/.vitest/vitest-report-root-1793959013655262000.json +0 -1
- package/.vitest/vitest-report-root-1793959017905881000.json +0 -1
- package/.vitest/vitest-report-root-1793959093169044000.json +0 -1
- package/.vitest/vitest-report-root-1793959093978087000.json +0 -1
- package/.vitest/vitest-report-root-1793959101111925000.json +0 -1
- package/.vitest/vitest-report-root-1793959145317906000.json +0 -1
- package/.vitest/vitest-report-root-1793959190760607000.json +0 -1
- package/.vitest/vitest-report-root-1793959249695805000.json +0 -1
- package/.vitest/vitest-report-root-1793959323191511000.json +0 -1
- package/.vitest/vitest-report-root-1793959453311564000.json +0 -1
- package/.vitest/vitest-report-root-1793959495806182000.json +0 -1
- package/.vitest/vitest-report-root-1793959499945435000.json +0 -1
- package/.vitest/vitest-report-root-1793959546773807000.json +0 -1
- package/.vitest/vitest-report-root-1793959583335593000.json +0 -1
- package/.vitest/vitest-report-root-1793959621479504000.json +0 -1
- package/.vitest/vitest-report-root-1793959651002360000.json +0 -1
- package/.vitest/vitest-report-root-1793959655646061000.json +0 -1
- package/.vitest/vitest-report-root-1793959741176826000.json +0 -1
- package/.vitest/vitest-report-root-1793959744743733000.json +0 -1
- package/.vitest/vitest-report-root-1793959833244182000.json +0 -1
- package/.vitest/vitest-report-root-1793959882131751000.json +0 -1
- package/.vitest/vitest-report-root-1793959887033254000.json +0 -1
- package/.vitest/vitest-report-root-1793960000631977000.json +0 -1
- package/.vitest/vitest-report-root-1793960011938504000.json +0 -1
- package/.vitest/vitest-report-root-1793961370018852000.json +0 -1
- package/.vitest/vitest-report-root-1793961745370827000.json +0 -1
- package/.vitest/vitest-report-root-1793961764143180000.json +0 -1
- package/.vitest/vitest-report-root-1793961835963066000.json +0 -1
- package/.vitest/vitest-report-root-1793961890729922000.json +0 -1
- package/.vitest/vitest-report-root-1793961968680074000.json +0 -1
- package/.vitest/vitest-report-root-1793962066862337000.json +0 -1
- package/.vitest/vitest-report-root-1793962087917497000.json +0 -1
- package/.vitest/vitest-report-root-1793962157254386000.json +0 -1
- package/.vitest/vitest-report-root-1793962171214865000.json +0 -1
- package/.vitest/vitest-report-root-1793962183290533000.json +0 -1
- package/.vitest/vitest-report-root-1793962184809932000.json +0 -1
- package/.vitest/vitest-report-root-1793962197715204000.json +0 -1
- package/.vitest/vitest-report-root-1793962244650717000.json +0 -1
- package/.vitest/vitest-report-root-1793962259802273000.json +0 -1
- package/.vitest/vitest-report-root-1793962278799745000.json +0 -1
- package/.vitest/vitest-report-root-1793962304412974000.json +0 -1
- package/.vitest/vitest-report-root-1793962328411454000.json +0 -1
- package/.vitest/vitest-report-root-1793962355747869000.json +0 -1
- package/.vitest/vitest-report-root-1793962381401572000.json +0 -1
- package/.vitest/vitest-report-root-1793962393326735000.json +0 -1
- package/.vitest/vitest-report-root-1793962393329206000.json +0 -1
- package/.vitest/vitest-report-root-1793962437796768000.json +0 -1
- package/.vitest/vitest-report-root-1793962444190384000.json +0 -1
- package/.vitest/vitest-report-root-1793962445347541000.json +0 -1
- package/.vitest/vitest-report-root-1793962473691143000.json +0 -1
- package/.vitest/vitest-report-root-1793962474291457000.json +0 -1
- package/.vitest/vitest-report-root-1793962499680468000.json +0 -1
- package/.vitest/vitest-report-root-1793962504410483000.json +0 -1
- package/.vitest/vitest-report-root-1793962516850524000.json +0 -1
- package/.vitest/vitest-report-root-1793962536736273000.json +0 -1
- package/.vitest/vitest-report-root-1793962551181783000.json +0 -1
- package/.vitest/vitest-report-root-1793962553575620000.json +0 -1
- package/.vitest/vitest-report-root-1793962555169730000.json +0 -1
- package/.vitest/vitest-report-root-1793962572639765000.json +0 -1
- package/.vitest/vitest-report-root-1793962597102952000.json +0 -1
- package/.vitest/vitest-report-root-1793962637156669000.json +0 -1
- package/.vitest/vitest-report-root-1793962653530027000.json +0 -1
- package/.vitest/vitest-report-root-1793962665824334000.json +0 -1
- package/.vitest/vitest-report-root-1793962682161714000.json +0 -1
- package/.vitest/vitest-report-root-1793962719526168000.json +0 -1
- package/.vitest/vitest-report-root-1793962723853934000.json +0 -1
- package/.vitest/vitest-report-root-1793962741927728000.json +0 -1
- package/.vitest/vitest-report-root-1793962794308371000.json +0 -1
- package/.vitest/vitest-report-root-1793962796334481000.json +0 -1
- package/.vitest/vitest-report-root-1793962798075169000.json +0 -1
- package/.vitest/vitest-report-root-1793962836466676000.json +0 -1
- package/.vitest/vitest-report-root-1793962846507317000.json +0 -1
- package/.vitest/vitest-report-root-1793962876266701000.json +0 -1
- package/.vitest/vitest-report-root-1793962922031308000.json +0 -1
- package/.vitest/vitest-report-root-1793962932957166000.json +0 -1
- package/.vitest/vitest-report-root-1793962946930725000.json +0 -1
- package/.vitest/vitest-report-root-1793963027896350000.json +0 -1
- package/.vitest/vitest-report-root-1793963036618707000.json +0 -1
- package/.vitest/vitest-report-root-1793963067365318000.json +0 -1
- package/.vitest/vitest-report-root-1793963077597641000.json +0 -1
- package/.vitest/vitest-report-root-1793963126365651000.json +0 -1
- package/.vitest/vitest-report-root-1793963208744553000.json +0 -1
- package/.vitest/vitest-report-root-1793963232806450000.json +0 -1
- package/.vitest/vitest-report-root-1793963325077422000.json +0 -1
- package/.vitest/vitest-report-root-1793963392172877000.json +0 -1
- package/.vitest/vitest-report-root-1793963398218324000.json +0 -1
- package/.vitest/vitest-report-root-1793963410749092000.json +0 -1
- package/.vitest/vitest-report-root-1793963437279580000.json +0 -1
- package/.vitest/vitest-report-root-1793963450096193000.json +0 -1
- package/.vitest/vitest-report-root-1793963478908641000.json +0 -1
- package/.vitest/vitest-report-root-1793963507838465000.json +0 -1
- package/.vitest/vitest-report-root-1793963528668174000.json +0 -1
- package/.vitest/vitest-report-root-1793963601860390000.json +0 -1
- package/.vitest/vitest-report-root-1793963611633446000.json +0 -1
- package/.vitest/vitest-report-root-1793963624713406000.json +0 -1
- package/.vitest/vitest-report-root-1793963680656685000.json +0 -1
- package/.vitest/vitest-report-root-1793963705231851000.json +0 -1
- package/.vitest/vitest-report-root-1793963708929500000.json +0 -1
- package/.vitest/vitest-report-root-1793963710267844000.json +0 -1
- package/.vitest/vitest-report-root-1793963713999248000.json +0 -1
- package/.vitest/vitest-report-root-1793963786513455000.json +0 -1
- package/.vitest/vitest-report-root-1793963792518765000.json +0 -1
- package/.vitest/vitest-report-root-1793963804089549000.json +0 -1
- package/.vitest/vitest-report-root-1793963840412921000.json +0 -1
- package/.vitest/vitest-report-root-1793963880361176000.json +0 -1
- package/.vitest/vitest-report-root-1793963935121106000.json +0 -1
- package/.vitest/vitest-report-root-1793963937290698000.json +0 -1
- package/.vitest/vitest-report-root-1793963977050773000.json +0 -1
- package/.vitest/vitest-report-root-1793963981229158000.json +0 -1
- package/.vitest/vitest-report-root-1793963989422080000.json +0 -1
- package/.vitest/vitest-report-root-1793964025924629000.json +0 -1
- package/.vitest/vitest-report-root-1793964027983705000.json +0 -1
- package/.vitest/vitest-report-root-1793964059969386000.json +0 -1
- package/.vitest/vitest-report-root-1793964071524069000.json +0 -1
- package/.vitest/vitest-report-root-1793964076285860000.json +0 -1
- package/.vitest/vitest-report-root-1793964077988100000.json +0 -1
- package/.vitest/vitest-report-root-1793964093289042000.json +0 -1
- package/.vitest/vitest-report-root-1793964102899356000.json +0 -1
- package/.vitest/vitest-report-root-1793964128089691000.json +0 -1
- package/.vitest/vitest-report-root-1793964129495156000.json +0 -1
- package/.vitest/vitest-report-root-1793964182849665000.json +0 -1
- package/.vitest/vitest-report-root-1793964223959893000.json +0 -1
- package/.vitest/vitest-report-root-1793964253351716000.json +0 -1
- package/.vitest/vitest-report-root-1793964290220122000.json +0 -1
- package/.vitest/vitest-report-root-1793964318037006000.json +0 -1
- package/.vitest/vitest-report-root-1793964334676691000.json +0 -1
- package/.vitest/vitest-report-root-1793964378520677000.json +0 -1
- package/.vitest/vitest-report-root-1793964383748994000.json +0 -1
- package/.vitest/vitest-report-root-1793964394042303000.json +0 -1
- package/.vitest/vitest-report-root-1793964466521881000.json +0 -1
- package/.vitest/vitest-report-root-1793964470478175000.json +0 -1
- package/.vitest/vitest-report-root-1793964484499019000.json +0 -1
- package/.vitest/vitest-report-root-1793964527645213000.json +0 -1
- package/.vitest/vitest-report-root-1793964608875865000.json +0 -1
- package/.vitest/vitest-report-root-1793964623608336000.json +0 -1
- package/.vitest/vitest-report-root-1793964629870846000.json +0 -1
- package/.vitest/vitest-report-root-1793964674515564000.json +0 -1
- package/.vitest/vitest-report-root-1793964706923651000.json +0 -1
- package/.vitest/vitest-report-root-1793964712832942000.json +0 -1
- package/.vitest/vitest-report-root-1793964714824633000.json +0 -1
- package/.vitest/vitest-report-root-1793964755433952000.json +0 -1
- package/.vitest/vitest-report-root-1793964783157670000.json +0 -1
- package/.vitest/vitest-report-root-1793964818963246000.json +0 -1
- package/.vitest/vitest-report-root-1793964843818548000.json +0 -1
- package/.vitest/vitest-report-root-1793964929824204000.json +0 -1
- package/.vitest/vitest-report-root-1793964973060713000.json +0 -1
- package/.vitest/vitest-report-root-1793964983122482000.json +0 -1
- package/.vitest/vitest-report-root-1793965107264567000.json +0 -1
- package/.vitest/vitest-report-root-1793965258759177000.json +0 -1
- package/.vitest/vitest-report-root-1793965277212091000.json +0 -1
- package/.vitest/vitest-report-root-1793965420648188000.json +0 -1
- package/.vitest/vitest-report-root-1793965611688414000.json +0 -1
- package/.vitest/vitest-report-root-1793965753407694000.json +0 -1
- package/.vitest/vitest-report-root-1793965766104309000.json +0 -1
- package/.vitest/vitest-report-root-1793965766823098000.json +0 -1
- package/.vitest/vitest-report-root-1793965806066109000.json +0 -1
- package/.vitest/vitest-report-root-1793965824697182000.json +0 -1
- package/.vitest/vitest-report-root-1793965904374564000.json +0 -1
- package/.vitest/vitest-report-root-1793965920838340000.json +0 -1
- package/.vitest/vitest-report-root-1793965932520617000.json +0 -1
- package/.vitest/vitest-report-root-1793965971574656000.json +0 -1
- package/.vitest/vitest-report-root-1793966049815024000.json +0 -1
- package/.vitest/vitest-report-root-1793966057888034000.json +0 -1
- package/.vitest/vitest-report-root-1793966066838868000.json +0 -1
- package/.vitest/vitest-report-root-1793966160347764000.json +0 -1
- package/.vitest/vitest-report-root-1793966196305985000.json +0 -1
- package/.vitest/vitest-report-root-1793966221538043000.json +0 -1
- package/.vitest/vitest-report-root-1793966251519918000.json +0 -1
- package/.vitest/vitest-report-root-1793966447000588000.json +0 -1
- package/.vitest/vitest-report-root-1793966463178249000.json +0 -1
- package/.vitest/vitest-report-root-1793966486995648000.json +0 -1
- package/.vitest/vitest-report-root-1793966726756953000.json +0 -1
- package/.vitest/vitest-report-root-1793966763656807000.json +0 -1
- package/.vitest/vitest-report-root-1793966979409799000.json +0 -1
- package/.vitest/vitest-report-root-1793967385250149000.json +0 -1
- package/.vitest/vitest-report-root-1793967617080163000.json +0 -1
- package/.vitest/vitest-report-root-1793967649428508000.json +0 -1
- package/.vitest/vitest-report-root-1793967773689520000.json +0 -1
- package/.vitest/vitest-report-root-1793968743743508000.json +0 -1
- package/.vitest/vitest-report-root-1793968846470407000.json +0 -1
- package/.vitest/vitest-report-root-1793968880878391000.json +0 -1
- package/.vitest/vitest-report-root-1793969027713529000.json +0 -1
- package/.vitest/vitest-report-root-1793969041841266000.json +0 -1
- package/.vitest/vitest-report-root-1793969142007468000.json +0 -1
- package/.vitest/vitest-report-root-1793969164867379000.json +0 -1
- package/.vitest/vitest-report-root-1793969193145858000.json +0 -1
- package/.vitest/vitest-report-root-1793969246818533000.json +0 -1
- package/.vitest/vitest-report-root-1793969270845486000.json +0 -1
- package/.vitest/vitest-report-root-1793969272514219000.json +0 -1
- package/.vitest/vitest-report-root-1793969302476105000.json +0 -1
- package/.vitest/vitest-report-root-1793969401697799000.json +0 -1
- package/.vitest/vitest-report-root-1793969433222630000.json +0 -1
- package/.vitest/vitest-report-root-1793969453350714000.json +0 -1
- package/.vitest/vitest-report-root-1793969567187400000.json +0 -1
- package/.vitest/vitest-report-root-1793969602230024000.json +0 -1
- package/.vitest/vitest-report-root-1793969633261063000.json +0 -1
- package/.vitest/vitest-report-root-1793969673876404000.json +0 -1
- package/.vitest/vitest-report-root-1793969702287010000.json +0 -1
- package/.vitest/vitest-report-root-1793969745828386000.json +0 -1
- package/.vitest/vitest-report-root-1793969893687205000.json +0 -1
- package/.vitest/vitest-report-root-1793969949642120000.json +0 -1
- package/.vitest/vitest-report-root-1793969981399076000.json +0 -1
- package/.vitest/vitest-report-root-1793970027152713000.json +0 -1
- package/.vitest/vitest-report-root-1793970030585158000.json +0 -1
- package/.vitest/vitest-report-root-1793970160195767000.json +0 -1
- package/.vitest/vitest-report-root-1793970215752422000.json +0 -1
- package/.vitest/vitest-report-root-1793970217114968000.json +0 -1
- package/.vitest/vitest-report-root-1793970329879319000.json +0 -1
- package/.vitest/vitest-report-root-1793970590586994000.json +0 -1
- package/.vitest/vitest-report-root-1793970625359990000.json +0 -1
- package/.vitest/vitest-report-root-1793970672590269000.json +0 -1
- package/.vitest/vitest-report-root-1793970796789022000.json +0 -1
- package/.vitest/vitest-report-root-1793970825710990000.json +0 -1
- package/.vitest/vitest-report-root-1793970884000509000.json +0 -1
- package/.vitest/vitest-report-root-1793970900444617000.json +0 -1
- package/.vitest/vitest-report-root-1793972186024681000.json +0 -1
- package/.vitest/vitest-report-root-1793972227757396000.json +0 -1
- package/.vitest/vitest-report-root-1793972736341600000.json +0 -1
- package/.vitest/vitest-report-root-1793972769249562000.json +0 -1
- package/.vitest/vitest-report-root-1793972859435283000.json +0 -1
- package/.vitest/vitest-report-root-1793972915169294000.json +0 -1
- package/.vitest/vitest-report-root-1793973081515450000.json +0 -1
- package/.vitest/vitest-report-root-1793973111336773000.json +0 -1
- package/.vitest/vitest-report-root-1793973253986969000.json +0 -1
- package/.vitest/vitest-report-root-1793973561283775000.json +0 -1
- package/.vitest/vitest-report-root-1793973593320977000.json +0 -1
- package/.vitest/vitest-report-root-1793973648302867000.json +0 -1
- package/.vitest/vitest-report-root-1793973819657242000.json +0 -1
- package/.vitest/vitest-report-root-1793973952727311000.json +0 -1
- package/.vitest/vitest-report-root-1793974334455876000.json +0 -1
- package/.vitest/vitest-report-root-1793974437074196000.json +0 -1
- package/.vitest/vitest-report-root-1793974437553146000.json +0 -1
- package/.vitest/vitest-report-root-1793974461818626000.json +0 -1
- package/.vitest/vitest-report-root-1793974515255198000.json +0 -1
- package/.vitest/vitest-report-root-1793974516267191000.json +0 -1
- package/.vitest/vitest-report-root-1793974621202824000.json +0 -1
- package/.vitest/vitest-report-root-1793974718450330000.json +0 -1
- package/.vitest/vitest-report-root-1793974834942373000.json +0 -1
- package/.vitest/vitest-report-root-1793974921367314000.json +0 -1
- package/.vitest/vitest-report-root-1793975019367156000.json +0 -1
- package/.vitest/vitest-report-root-1793975048166096000.json +0 -1
- package/.vitest/vitest-report-root-1793975133024339000.json +0 -1
- package/.vitest/vitest-report-root-1793975159711704000.json +0 -1
- package/.vitest/vitest-report-root-1793975517481736000.json +0 -1
- package/.vitest/vitest-report-root-1793975680008825000.json +0 -1
- package/.vitest/vitest-report-root-1793976067648494000.json +0 -1
- package/.vitest/vitest-report-root-1793976314122479000.json +0 -1
- package/.vitest/vitest-report-root-1793976513022402000.json +0 -1
- package/.vitest/vitest-report-root-1793976540410805000.json +0 -1
- package/.vitest/vitest-report-root-1793976555103273000.json +0 -1
- package/.vitest/vitest-report-root-1793976702974407000.json +0 -1
- package/.vitest/vitest-report-root-1793976721093108000.json +0 -1
- package/.vitest/vitest-report-root-1793976955473681000.json +0 -1
- package/.vitest/vitest-report-root-1793977049628483000.json +0 -1
- package/.vitest/vitest-report-root-1793977098467804000.json +0 -1
- package/.vitest/vitest-report-root-1793977132144900000.json +0 -1
- package/.vitest/vitest-report-root-1793977279648191000.json +0 -1
- package/.vitest/vitest-report-root-1793977365312127000.json +0 -1
- package/.vitest/vitest-report-root-1793978227796817000.json +0 -1
- package/.vitest/vitest-report-root-1793978255189735000.json +0 -1
- package/.vitest/vitest-report-root-1793978306509070000.json +0 -1
- package/.vitest/vitest-report-root-1793978418301216000.json +0 -1
- package/.vitest/vitest-report-root-1793978445072573000.json +0 -1
- package/.vitest/vitest-report-root-1793978546605517000.json +0 -1
- package/.vitest/vitest-report-root-1793978576060950000.json +0 -1
- package/.vitest/vitest-report-root-1793978590261408000.json +0 -1
- package/.vitest/vitest-report-root-1793978674733179000.json +0 -1
- package/.vitest/vitest-report-root-1793978718588785000.json +0 -1
- package/.vitest/vitest-report-root-1793978725363453000.json +0 -1
- package/.vitest/vitest-report-root-1793978729967285000.json +0 -1
- package/.vitest/vitest-report-root-1793978755641607000.json +0 -1
- package/.vitest/vitest-report-root-1793978782769802000.json +0 -1
- package/.vitest/vitest-report-root-1793978784870947000.json +0 -1
- package/.vitest/vitest-report-root-1793978806927335000.json +0 -1
- package/.vitest/vitest-report-root-1793978822508324000.json +0 -1
- package/.vitest/vitest-report-root-1793978836339794000.json +0 -1
- package/.vitest/vitest-report-root-1793978837947352000.json +0 -1
- package/.vitest/vitest-report-root-1793978891548295000.json +0 -1
- package/.vitest/vitest-report-root-1793978946172947000.json +0 -1
- package/.vitest/vitest-report-root-1793978947109807000.json +0 -1
- package/.vitest/vitest-report-root-1793979034208662000.json +0 -1
- package/.vitest/vitest-report-root-1793979070583608000.json +0 -1
- package/.vitest/vitest-report-root-1793979081187144000.json +0 -1
- package/.vitest/vitest-report-root-1793979085428673000.json +0 -1
- package/.vitest/vitest-report-root-1793979155097858000.json +0 -1
- package/.vitest/vitest-report-root-1793979233508873000.json +0 -1
- package/.vitest/vitest-report-root-1793979268653273000.json +0 -1
- package/.vitest/vitest-report-root-1793979341978843000.json +0 -1
- package/.vitest/vitest-report-root-1793979345344877000.json +0 -1
- package/.vitest/vitest-report-root-1793979389390374000.json +0 -1
- package/.vitest/vitest-report-root-1793979400063493000.json +0 -1
- package/.vitest/vitest-report-root-1793979432448725000.json +0 -1
- package/.vitest/vitest-report-root-1793979459139430000.json +0 -1
- package/.vitest/vitest-report-root-1793979480341961000.json +0 -1
- package/.vitest/vitest-report-root-1793979510130869000.json +0 -1
- package/.vitest/vitest-report-root-1793979524763924000.json +0 -1
- package/.vitest/vitest-report-root-1793979571563010000.json +0 -1
- package/.vitest/vitest-report-root-1793979627916920000.json +0 -1
- package/.vitest/vitest-report-root-1793979726395379000.json +0 -1
- package/.vitest/vitest-report-root-1793979752029533000.json +0 -1
- package/.vitest/vitest-report-root-1793979753365744000.json +0 -1
- package/.vitest/vitest-report-root-1793979759386206000.json +0 -1
- package/.vitest/vitest-report-root-1793979787819109000.json +0 -1
- package/.vitest/vitest-report-root-1793979827615051000.json +0 -1
- package/.vitest/vitest-report-root-1793979927737393000.json +0 -1
- package/.vitest/vitest-report-root-1793979929836169000.json +0 -1
- package/.vitest/vitest-report-root-1793979955780781000.json +0 -1
- package/.vitest/vitest-report-root-1793980200569636000.json +0 -1
- package/.vitest/vitest-report-root-1793980206045213000.json +0 -1
- package/.vitest/vitest-report-root-1793980285772027000.json +0 -1
- package/.vitest/vitest-report-root-1793980459229828000.json +0 -1
- package/.vitest/vitest-report-root-1793980460545874000.json +0 -1
- package/.vitest/vitest-report-root-1793980554484341000.json +0 -1
- package/.vitest/vitest-report-root-1793980674494388000.json +0 -1
- package/.vitest/vitest-report-root-1793980683752195000.json +0 -1
- package/.vitest/vitest-report-root-1793980947108651000.json +0 -1
- package/.vitest/vitest-report-root-1793981129616629000.json +0 -1
- package/.vitest/vitest-report-root-1793981196611441000.json +0 -1
- package/.vitest/vitest-report-root-1793981226583545000.json +0 -1
- package/.vitest/vitest-report-root-1793981294259721000.json +0 -1
- package/.vitest/vitest-report-root-1793981353393048000.json +0 -1
- package/.vitest/vitest-report-root-1793981424585368000.json +0 -1
- package/.vitest/vitest-report-root-1793981513266687000.json +0 -1
- package/.vitest/vitest-report-root-1793981526418218000.json +0 -1
- package/.vitest/vitest-report-root-1793981540069877000.json +0 -1
- package/.vitest/vitest-report-root-1793981761193625000.json +0 -1
- package/.vitest/vitest-report-root-1793981868520992000.json +0 -1
- package/.vitest/vitest-report-root-1793982048467772000.json +0 -1
- package/.vitest/vitest-report-root-1793982119518020000.json +0 -1
- package/.vitest/vitest-report-root-1793982243473651000.json +0 -1
- package/.vitest/vitest-report-root-1793982406880629000.json +0 -1
- package/.vitest/vitest-report-root-1793982433563632000.json +0 -1
- package/.vitest/vitest-report-root-1793982496753204000.json +0 -1
- package/.vitest/vitest-report-root-1793982500153311000.json +0 -1
- package/.vitest/vitest-report-root-1793982542086095000.json +0 -1
- package/.vitest/vitest-report-root-1793982659482988000.json +0 -1
- package/.vitest/vitest-report-root-1793983799132716000.json +0 -1
- package/.vitest/vitest-report-root-1793983822721833000.json +0 -1
- package/.vitest/vitest-report-root-1793984998618484000.json +0 -1
- package/.vitest/vitest-report-root-1793985050475750000.json +0 -1
- package/.vitest/vitest-report-root-1793985095516077000.json +0 -1
- package/.vitest/vitest-report-root-1793985130729074000.json +0 -1
- package/.vitest/vitest-report-root-1793985177150997000.json +0 -1
- package/.vitest/vitest-report-root-1793985267658626000.json +0 -1
- package/.vitest/vitest-report-root-1793985412705211000.json +0 -1
- package/.vitest/vitest-report-root-1793985433752853000.json +0 -1
- package/.vitest/vitest-report-root-1794087938302852000.json +0 -1
- package/.vitest/vitest-report-root-1794087978339022000.json +0 -1
- package/.vitest/vitest-report-root-1794088095283811000.json +0 -1
- package/.vitest/vitest-report-root-1794088129997065000.json +0 -1
- package/.vitest/vitest-report-root-1794088147336556000.json +0 -1
- package/.vitest/vitest-report-root-1794088173414593000.json +0 -1
- package/.vitest/vitest-report-root-1794088221289657000.json +0 -1
- package/.vitest/vitest-report-root-1794088250766611000.json +0 -1
- package/.vitest/vitest-report-root-1794088365553234000.json +0 -1
- package/.vitest/vitest-report-root-1794088395202655000.json +0 -1
- package/.vitest/vitest-report-root-1794090028732187000.json +0 -1
- package/.vitest/vitest-report-root-1794090054787283000.json +0 -1
- package/.vitest/vitest-report-root-1794090153955794000.json +0 -1
- package/.vitest/vitest-report-root-1794090161850160000.json +0 -1
- package/.vitest/vitest-report-root-1794091755693314000.json +0 -1
- package/.vitest/vitest-report-root-1794091765029349000.json +0 -1
- package/.vitest/vitest-report-root-1794091975649927000.json +0 -1
- package/.vitest/vitest-report-root-1794091994027950000.json +0 -1
- package/.vitest/vitest-report-root-1794092005178771000.json +0 -1
- package/.vitest/vitest-report-root-1794113295302382000.json +0 -1
- package/.vitest/vitest-report-root-1794114156337032000.json +0 -1
- package/.vitest/vitest-report-root-1794114198454137000.json +0 -1
- package/.vitest/vitest-report-root-1794114254064413000.json +0 -1
- package/.vitest/vitest-report-root-1794114280107510000.json +0 -1
- package/.vitest/vitest-report-root-1794114495199837000.json +0 -1
- package/.vitest/vitest-report-root-1794114646604233000.json +0 -1
- package/.vitest/vitest-report-root-1794114666311689000.json +0 -1
- package/.vitest/vitest-report-root-1794114974303438000.json +0 -1
- package/.vitest/vitest-report-root-1794115037361450000.json +0 -1
- package/.vitest/vitest-report-root-1794115097838937000.json +0 -1
- package/.vitest/vitest-report-root-1794115604669388000.json +0 -1
- package/.vitest/vitest-report-root-1794115633814500000.json +0 -1
- package/.vitest/vitest-report-root-1794115648756242000.json +0 -1
- package/.vitest/vitest-report-root-1794115873440741000.json +0 -1
- package/.vitest/vitest-report-root-1794115952930230000.json +0 -1
- package/.vitest/vitest-report-root-1794115963344701000.json +0 -1
- package/.vitest/vitest-report-root-1794116196067450000.json +0 -1
- package/.vitest/vitest-report-root-1794116254301280000.json +0 -1
- package/.vitest/vitest-report-root-1794116259342966000.json +0 -1
- package/.vitest/vitest-report-root-1794118178787879000.json +0 -1
- package/.vitest/vitest-report-root-1794137087891409000.json +0 -1
- package/.vitest/vitest-report-root-1794137100301214000.json +0 -1
- package/.vitest/vitest-report-root-1794137107377813000.json +0 -1
- package/.vitest/vitest-report-root-1794137171230704000.json +0 -1
- package/.vitest/vitest-report-root-1794137317761465000.json +0 -1
- package/.vitest/vitest-report-root-1794137320282368000.json +0 -1
- package/PACKAGE_PUBLICATIONS.md +0 -26
- package/scripts/local-workspaces.test.ts +0 -31
- package/scripts/release-version-cli.test.ts +0 -40
- package/scripts/release-version.test.ts +0 -29
- package/spikes/README.md +0 -70
- package/spikes/barrel-rewriting/README.md +0 -97
- package/spikes/barrel-rewriting/measure.ts +0 -134
- package/spikes/barrel-rewriting/readme.ts +0 -174
- package/spikes/barrel-rewriting/results.json +0 -3440
- package/spikes/barrel-rewriting/run.ts +0 -330
- package/spikes/barrel-rewriting/setup.ts +0 -90
- package/spikes/barrel-rewriting/sw.ts +0 -148
- package/spikes/barrel-rewriting/tenant.ts +0 -91
- package/spikes/barrel-rewriting/worker-config.ts +0 -33
- package/spikes/closure-fragments/README.md +0 -157
- package/spikes/closure-fragments/results.json +0 -959
- package/spikes/closure-fragments/run.ts +0 -298
- package/spikes/compiler/README.md +0 -177
- package/spikes/compiler/compile.test.ts +0 -78
- package/spikes/compiler/compile.ts +0 -82
- package/spikes/compiler/facet-redact.d.ts +0 -5
- package/spikes/compiler/markers.ts +0 -88
- package/spikes/compiler/pages.ts +0 -43
- package/spikes/compiler/readme.ts +0 -116
- package/spikes/compiler/reference.ts +0 -81
- package/spikes/compiler/render.ts +0 -113
- package/spikes/compiler/results.json +0 -3310
- package/spikes/compiler/run.ts +0 -250
- package/spikes/compiler/sucrase-parser.d.ts +0 -8
- package/spikes/compiler/sw.ts +0 -62
- package/spikes/diagram-readiness/README.md +0 -134
- package/spikes/diagram-readiness/analysis.test.ts +0 -52
- package/spikes/diagram-readiness/analysis.ts +0 -35
- package/spikes/diagram-readiness/browser.ts +0 -209
- package/spikes/diagram-readiness/readme.ts +0 -65
- package/spikes/diagram-readiness/results.json +0 -30289
- package/spikes/diagram-readiness/run.ts +0 -103
- package/spikes/diagram-readiness/server.ts +0 -53
- package/spikes/esm-sh/README.md +0 -27
- package/spikes/frame-commenting/README.md +0 -183
- package/spikes/frame-commenting/agent.ts +0 -110
- package/spikes/frame-commenting/hook.ts +0 -1
- package/spikes/frame-commenting/host.ts +0 -66
- package/spikes/frame-commenting/measure.ts +0 -180
- package/spikes/frame-commenting/model.test.ts +0 -27
- package/spikes/frame-commenting/model.ts +0 -40
- package/spikes/frame-commenting/readme.ts +0 -61
- package/spikes/frame-commenting/results.json +0 -5320
- package/spikes/frame-commenting/run.ts +0 -73
- package/spikes/frame-commenting/setup.ts +0 -125
- package/spikes/lib/barrels.test.ts +0 -107
- package/spikes/lib/barrels.ts +0 -309
- package/spikes/lib/content-types.ts +0 -28
- package/spikes/lib/convert-commonjs.ts +0 -168
- package/spikes/lib/fragment.ts +0 -108
- package/spikes/lib/library-set.ts +0 -194
- package/spikes/lib/module-transform.test.ts +0 -133
- package/spikes/lib/module-transform.ts +0 -351
- package/spikes/lib/origin.ts +0 -140
- package/spikes/lib/pages.ts +0 -290
- package/spikes/lib/report.ts +0 -23
- package/spikes/lib/runtime-server.ts +0 -282
- package/spikes/lib/static-server.ts +0 -82
- package/spikes/lib/trace.ts +0 -384
- package/spikes/local-folder-link/README.md +0 -85
- package/spikes/local-folder-link/checkout.ts +0 -132
- package/spikes/local-folder-link/documents.ts +0 -36
- package/spikes/local-folder-link/readme.ts +0 -42
- package/spikes/local-folder-link/results.json +0 -12815
- package/spikes/local-folder-link/rewrite.test.ts +0 -27
- package/spikes/local-folder-link/rewrite.ts +0 -38
- package/spikes/local-folder-link/run.ts +0 -123
- package/spikes/local-folder-link/server.ts +0 -100
- package/spikes/local-folder-link/sw.ts +0 -97
- package/spikes/origin-isolation/README.md +0 -426
- package/spikes/origin-isolation/browsers.ts +0 -43
- package/spikes/origin-isolation/helper.ts +0 -6
- package/spikes/origin-isolation/host.ts +0 -25
- package/spikes/origin-isolation/measure.ts +0 -118
- package/spikes/origin-isolation/model.test.ts +0 -45
- package/spikes/origin-isolation/model.ts +0 -49
- package/spikes/origin-isolation/proxy.ts +0 -35
- package/spikes/origin-isolation/readme.ts +0 -83
- package/spikes/origin-isolation/results.json +0 -3242
- package/spikes/origin-isolation/run.ts +0 -35
- package/spikes/origin-isolation/server.ts +0 -108
- package/spikes/origin-isolation/sw.ts +0 -28
- package/spikes/origin-isolation/tenant.ts +0 -165
- package/spikes/react-runtime-set/README.md +0 -48
- package/spikes/react-runtime-set/convert.ts +0 -118
- package/spikes/react-runtime-set/export-names.mjs +0 -8
- package/spikes/react-runtime-set/page/page.js +0 -46
- package/spikes/react-runtime-set/results.json +0 -84
- package/spikes/react-runtime-set/run.ts +0 -255
- package/spikes/run.ts +0 -15
- package/spikes/sw-tenant-frame/README.md +0 -95
- package/spikes/sw-tenant-frame/results.json +0 -1348
- package/spikes/sw-tenant-frame/run.ts +0 -373
- package/spikes/sw-tenant-frame/site/frame.html +0 -113
- package/spikes/sw-tenant-frame/site/host.html +0 -25
- package/spikes/sw-tenant-frame/site/sw.js +0 -10
- package/spikes/tailwind-parity/README.md +0 -78
- package/spikes/tailwind-parity/compare.test.ts +0 -70
- package/spikes/tailwind-parity/compare.ts +0 -91
- package/spikes/tailwind-parity/facet-font-scale.d.ts +0 -6
- package/spikes/tailwind-parity/facet-styles.ts +0 -77
- package/spikes/tailwind-parity/results.json +0 -885
- package/spikes/tailwind-parity/run.ts +0 -385
- package/spikes/tailwind-parity/runtime-tailwind.ts +0 -82
- package/src/activity.test.ts +0 -57
- package/src/build/barrels.test.ts +0 -107
- package/src/build/dependency-runtime.test.ts +0 -121
- package/src/build/library-runtime.test.ts +0 -343
- package/src/dev/cli.test.ts +0 -12
- package/src/dev/packages.test.ts +0 -175
- package/src/editing.test.tsx +0 -31
- package/src/frame/activity.test.ts +0 -27
- package/src/frame/agent/overlay.test.ts +0 -42
- package/src/frame/agent/owner.test.ts +0 -78
- package/src/frame/agent/vocabulary.test.ts +0 -36
- package/src/frame/boot-bundle.test.ts +0 -20
- package/src/frame/boot-styles.test.ts +0 -102
- package/src/frame/boot.test.ts +0 -108
- package/src/frame/export-compiler.test.ts +0 -23
- package/src/frame/export.test.ts +0 -17
- package/src/frame/tailwind/cache.test.ts +0 -53
- package/src/frame/tailwind/load.test.ts +0 -74
- package/src/frame/tailwind/runtime-cache.test.ts +0 -97
- package/src/frame/tailwind/store.test.ts +0 -104
- package/src/frame/tailwind/tailwind.test.ts +0 -119
- package/src/host/BuildLog.test.tsx +0 -40
- package/src/host/PageFrame.test.tsx +0 -39
- package/src/host/activity-state.test.ts +0 -37
- package/src/host/agent-source.test.ts +0 -9
- package/src/host/agent-validation.test.ts +0 -40
- package/src/host/bridge-request.test.ts +0 -87
- package/src/host/bridge.test.ts +0 -34
- package/src/host/build-log.test.ts +0 -47
- package/src/host/clear-cache.test.ts +0 -75
- package/src/host/design-validation.test.ts +0 -38
- package/src/host/link/transport.test.ts +0 -10
- package/src/host/origin.test.ts +0 -10
- package/src/host/review/remote.test.ts +0 -21
- package/src/host/review/source.test.ts +0 -19
- package/src/host/review/validation.test.ts +0 -34
- package/src/host/runtime-integration.test.ts +0 -29
- package/src/host/source-path.test.ts +0 -14
- package/src/host/vocabulary-validation.test.ts +0 -60
- package/src/link/build.test.ts +0 -25
- package/src/link/commonjs.test.ts +0 -34
- package/src/link/overrides.test.ts +0 -103
- package/src/link/page-sources.test.ts +0 -52
- package/src/publication/publication.test.ts +0 -89
- package/src/storage/db.test.ts +0 -52
- package/src/sw/activity-router.test.ts +0 -53
- package/src/sw/candidates.test.ts +0 -9
- package/src/sw/compile.test.ts +0 -152
- package/src/sw/compiler.test.ts +0 -51
- package/src/sw/composition.test.ts +0 -51
- package/src/sw/converted-resolver.test.ts +0 -129
- package/src/sw/converted-router.test.ts +0 -91
- package/src/sw/converted.test.ts +0 -31
- package/src/sw/errors.test.ts +0 -8
- package/src/sw/link-activity.test.ts +0 -126
- package/src/sw/link-cache.test.ts +0 -15
- package/src/sw/link-markdown.test.ts +0 -52
- package/src/sw/link-route.test.ts +0 -150
- package/src/sw/link-source.test.ts +0 -31
- package/src/sw/markers.test.ts +0 -33
- package/src/sw/module-transform.test.ts +0 -131
- package/src/sw/package-generation.test.ts +0 -33
- package/src/sw/page-clients.test.ts +0 -37
- package/src/sw/profile.test.ts +0 -21
- package/src/sw/resolver.test.ts +0 -183
- package/src/sw/router-cache.test.ts +0 -78
- package/src/sw/runtime-module.test.ts +0 -61
- package/src/sw/source-hash.test.ts +0 -7
- package/src/sw/storage.test.ts +0 -108
- package/tsconfig.json +0 -10
- package/vitest.browser.config.ts +0 -4
- package/vitest.config.ts +0 -9
- /package/{spikes/esm-sh → src/sw/esm-sh-fixtures}/browser-client.ts +0 -0
- /package/{spikes/esm-sh → src/sw/esm-sh-fixtures}/fixtures/copy-to-clipboard-entry.headers +0 -0
- /package/{spikes/esm-sh → src/sw/esm-sh-fixtures}/fixtures/copy-to-clipboard-entry.mjs.txt +0 -0
- /package/{spikes/esm-sh → src/sw/esm-sh-fixtures}/fixtures/copy-to-clipboard-module.headers +0 -0
- /package/{spikes/esm-sh → src/sw/esm-sh-fixtures}/fixtures/copy-to-clipboard-module.mjs.txt +0 -0
- /package/{spikes/esm-sh → src/sw/esm-sh-fixtures}/fixtures/react-copy-to-clipboard-entry.headers +0 -0
- /package/{spikes/esm-sh → src/sw/esm-sh-fixtures}/fixtures/react-copy-to-clipboard-entry.mjs.txt +0 -0
- /package/{spikes/esm-sh → src/sw/esm-sh-fixtures}/fixtures/react-copy-to-clipboard-module.headers +0 -0
- /package/{spikes/esm-sh → src/sw/esm-sh-fixtures}/fixtures/react-copy-to-clipboard-module.mjs.txt +0 -0
- /package/{spikes/esm-sh → src/sw/esm-sh-fixtures}/fixtures/toggle-selection-entry.headers +0 -0
- /package/{spikes/esm-sh → src/sw/esm-sh-fixtures}/fixtures/toggle-selection-entry.mjs.txt +0 -0
- /package/{spikes/esm-sh → src/sw/esm-sh-fixtures}/fixtures/toggle-selection-module.headers +0 -0
- /package/{spikes/esm-sh → src/sw/esm-sh-fixtures}/fixtures/toggle-selection-module.mjs.txt +0 -0
- /package/{spikes/esm-sh → src/sw/esm-sh-fixtures}/redact.ts +0 -0
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
import { dirname, join } from "node:path";
|
|
2
|
-
import { fileURLToPath } from "node:url";
|
|
3
|
-
import { chromium } from "@playwright/test";
|
|
4
|
-
import type { Served } from "../lib/static-server.ts";
|
|
5
|
-
import { FLAVORS, type Flavor } from "../lib/convert-commonjs.ts";
|
|
6
|
-
import type { ImportMap } from "../lib/fragment.ts";
|
|
7
|
-
import { BASE_PACKAGES, buildLibrarySet, FACET_ALIASES, packageVersion, type BuiltFragment } from "../lib/library-set.ts";
|
|
8
|
-
import { entryModule, EXCLUDED_PAGES, loadPage, pageDocument, PAGES, type PageRun } from "../lib/pages.ts";
|
|
9
|
-
import { markdownTable, writeSpikeOutput, type SpikeResults, type Verdict } from "../lib/report.ts";
|
|
10
|
-
import { RuntimeServer } from "../lib/runtime-server.ts";
|
|
11
|
-
|
|
12
|
-
const SPIKE = "closure-fragments";
|
|
13
|
-
const MIN_PAGES = 20;
|
|
14
|
-
|
|
15
|
-
const here = dirname(fileURLToPath(import.meta.url));
|
|
16
|
-
|
|
17
|
-
function unique<T>(values: T[]): T[] {
|
|
18
|
-
return [...new Set(values)];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function documents(map: ImportMap): Map<string, Served> {
|
|
22
|
-
const served = new Map<string, Served>();
|
|
23
|
-
for (const page of PAGES) {
|
|
24
|
-
const entry = `<script type="module" src="/entry/${page.id}.js"></script>`;
|
|
25
|
-
served.set(`/p/${page.id}`, { type: "text/html; charset=utf-8", body: pageDocument({ title: page.id, map, entry }) });
|
|
26
|
-
served.set(`/entry/${page.id}.js`, { type: "text/javascript; charset=utf-8", body: entryModule(page) });
|
|
27
|
-
}
|
|
28
|
-
return served;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export async function run(args: string[]): Promise<void> {
|
|
32
|
-
if (args.length > 0) throw new Error(`${SPIKE} takes no arguments, got: ${args.join(" ")}`);
|
|
33
|
-
const set = await buildLibrarySet({ outDir: join(here, "out"), pages: PAGES, log: (message) => console.log(`${SPIKE}: ${message}`) });
|
|
34
|
-
const { built, clicky, facet, maps, remapped, staticUnmapped } = set;
|
|
35
|
-
const browser = await chromium.launch({ channel: "chrome" });
|
|
36
|
-
const runs: PageRun[] = [];
|
|
37
|
-
let chrome: string;
|
|
38
|
-
try {
|
|
39
|
-
chrome = browser.version();
|
|
40
|
-
for (const flavor of FLAVORS) {
|
|
41
|
-
const server = new RuntimeServer({
|
|
42
|
-
flavor,
|
|
43
|
-
files: set.files,
|
|
44
|
-
integrity: set.integrity,
|
|
45
|
-
packages: set.packages,
|
|
46
|
-
remapped,
|
|
47
|
-
pageRoots: set.pageRoots,
|
|
48
|
-
documents: documents(maps[flavor]),
|
|
49
|
-
publicDir: set.publicDir,
|
|
50
|
-
});
|
|
51
|
-
await server.start();
|
|
52
|
-
try {
|
|
53
|
-
for (const page of PAGES) {
|
|
54
|
-
const result = await loadPage(browser, server, page, flavor);
|
|
55
|
-
runs.push(result);
|
|
56
|
-
const status = result.mounted && result.errors.length === 0 ? "ok" : `FAILED ${result.errors.slice(0, 2).join(" | ").slice(0, 200)}`;
|
|
57
|
-
console.log(`${SPIKE}: ${flavor} ${page.id} ${result.ms} ms, ${result.requests} requests — ${status}`);
|
|
58
|
-
}
|
|
59
|
-
} finally {
|
|
60
|
-
await server.close();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
} finally {
|
|
64
|
-
await browser.close();
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const buildFailures = set.failures;
|
|
68
|
-
const rendered = PAGES.filter((page) =>
|
|
69
|
-
runs.filter((item) => item.page === page.id).every((item) => item.mounted && item.errors.length === 0 && item.elements > 0),
|
|
70
|
-
);
|
|
71
|
-
const metrics = {
|
|
72
|
-
pages: unique(runs.map((item) => item.page)).length,
|
|
73
|
-
pagesRendered: rendered.length,
|
|
74
|
-
unmappedImports: unique(runs.flatMap((item) => item.unresolved)).length,
|
|
75
|
-
unconvertedCommonJs: unique([...runs.flatMap((item) => item.rawCommonJs), ...runs.flatMap((item) => item.commonJsErrors.map((name) => `${item.page}: ${name}`))]).length,
|
|
76
|
-
filesWithoutIntegrity: unique(runs.flatMap((item) => item.untraced)).length,
|
|
77
|
-
integrityMismatches: unique(runs.flatMap((item) => item.mismatched)).length,
|
|
78
|
-
missingFiles: unique(runs.flatMap((item) => item.missing)).length,
|
|
79
|
-
missingExports: unique(runs.flatMap((item) => item.missingExports)).length,
|
|
80
|
-
staticUnmapped: unique(staticUnmapped.map((item) => item.specifier)).length,
|
|
81
|
-
reactInstances: Math.max(...runs.map((item) => item.reactInstances)),
|
|
82
|
-
renderers: Math.max(...runs.map((item) => item.renderers)),
|
|
83
|
-
untracedDynamicImports: built.reduce((sum, { tracer }) => sum + tracer.untraced.length, 0),
|
|
84
|
-
canonicalRewrites: built.reduce((sum, { tracer }) => sum + [...tracer.canonicalRewrites.values()].reduce((a, b) => a + b, 0), 0),
|
|
85
|
-
urlRemaps: remapped.size,
|
|
86
|
-
externalReferences: built.reduce((sum, { tracer }) => sum + tracer.external.length, 0),
|
|
87
|
-
importMapKilobytes: Object.fromEntries(FLAVORS.map((flavor) => [flavor, Math.round(Buffer.byteLength(JSON.stringify(maps[flavor])) / 1024)])),
|
|
88
|
-
buildFailures: buildFailures.map((failure) => `${failure.name}: ${failure.detail}`),
|
|
89
|
-
};
|
|
90
|
-
const criteria = goCriteria(metrics);
|
|
91
|
-
const verdict: Verdict = criteria.every((criterion) => criterion.met) ? "go" : "no-go";
|
|
92
|
-
const results: SpikeResults = {
|
|
93
|
-
spike: SPIKE,
|
|
94
|
-
verdict,
|
|
95
|
-
metrics,
|
|
96
|
-
environment: {
|
|
97
|
-
node: process.version,
|
|
98
|
-
chrome,
|
|
99
|
-
rolldown: packageVersion("rolldown"),
|
|
100
|
-
"clicky-ui": clicky.version,
|
|
101
|
-
facet: facet.version,
|
|
102
|
-
react: packageVersion("react"),
|
|
103
|
-
},
|
|
104
|
-
runs: [
|
|
105
|
-
...built.map(({ tracer, fragment, traceMs, conversion, bytes }) => ({
|
|
106
|
-
fragment: fragment.name,
|
|
107
|
-
packages: tracer.packages.size,
|
|
108
|
-
files: tracer.files.size,
|
|
109
|
-
commonJs: [...tracer.commonJs.keys()].sort(),
|
|
110
|
-
scopes: Object.keys(fragment.scopes).length,
|
|
111
|
-
topLevel: Object.keys(fragment.imports).length,
|
|
112
|
-
inherits: fragment.inherits.length,
|
|
113
|
-
bytes,
|
|
114
|
-
traceMs,
|
|
115
|
-
conversion,
|
|
116
|
-
untracedDynamicImports: tracer.untraced,
|
|
117
|
-
})),
|
|
118
|
-
...runs,
|
|
119
|
-
{ staticUnmapped },
|
|
120
|
-
],
|
|
121
|
-
};
|
|
122
|
-
await writeSpikeOutput(here, results, readme(results, built, runs, staticUnmapped, set.additional));
|
|
123
|
-
console.log(`${SPIKE}: verdict ${verdict} — ${JSON.stringify({ ...metrics, buildFailures: metrics.buildFailures.length })}`);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
type Criterion = { criterion: string; source: "TODO" | "harness"; measured: string; met: boolean };
|
|
127
|
-
|
|
128
|
-
/** The TODO's go criteria, plus the harness's own gates that a closure cannot pass without. */
|
|
129
|
-
function goCriteria(metrics: {
|
|
130
|
-
pages: number;
|
|
131
|
-
pagesRendered: number;
|
|
132
|
-
unmappedImports: number;
|
|
133
|
-
unconvertedCommonJs: number;
|
|
134
|
-
filesWithoutIntegrity: number;
|
|
135
|
-
integrityMismatches: number;
|
|
136
|
-
missingFiles: number;
|
|
137
|
-
reactInstances: number;
|
|
138
|
-
buildFailures: string[];
|
|
139
|
-
}): Criterion[] {
|
|
140
|
-
return [
|
|
141
|
-
{ criterion: `pages >= ${MIN_PAGES}`, source: "TODO", measured: String(metrics.pages), met: metrics.pages >= MIN_PAGES },
|
|
142
|
-
{ criterion: "unmappedImports == 0", source: "TODO", measured: String(metrics.unmappedImports), met: metrics.unmappedImports === 0 },
|
|
143
|
-
{ criterion: "unconvertedCommonJs == 0", source: "TODO", measured: String(metrics.unconvertedCommonJs), met: metrics.unconvertedCommonJs === 0 },
|
|
144
|
-
{ criterion: "filesWithoutIntegrity == 0", source: "TODO", measured: String(metrics.filesWithoutIntegrity), met: metrics.filesWithoutIntegrity === 0 },
|
|
145
|
-
{ criterion: "every page renders in both flavors", source: "harness", measured: `${metrics.pagesRendered} of ${metrics.pages}`, met: metrics.pagesRendered === metrics.pages },
|
|
146
|
-
{ criterion: "no integrity mismatch", source: "harness", measured: String(metrics.integrityMismatches), met: metrics.integrityMismatches === 0 },
|
|
147
|
-
{ criterion: "no missing file", source: "harness", measured: String(metrics.missingFiles), met: metrics.missingFiles === 0 },
|
|
148
|
-
{ criterion: "one React instance", source: "harness", measured: String(metrics.reactInstances), met: metrics.reactInstances === 1 },
|
|
149
|
-
{ criterion: "no build-time failure", source: "harness", measured: String(metrics.buildFailures.length), met: metrics.buildFailures.length === 0 },
|
|
150
|
-
];
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
function readme(
|
|
154
|
-
results: SpikeResults,
|
|
155
|
-
built: BuiltFragment[],
|
|
156
|
-
runs: PageRun[],
|
|
157
|
-
staticUnmapped: Array<{ flavor: Flavor; specifier: string; importer: string }>,
|
|
158
|
-
additional: string[],
|
|
159
|
-
): string {
|
|
160
|
-
const env = results.environment;
|
|
161
|
-
const metrics = results.metrics as Parameters<typeof goCriteria>[0] & Record<string, unknown>;
|
|
162
|
-
const criteriaRows = goCriteria(metrics).map((item) => [item.criterion, item.source, item.measured, item.met ? "yes" : "no"]);
|
|
163
|
-
const external = built.flatMap(({ tracer }) => tracer.external);
|
|
164
|
-
const fragmentRows = built.map(({ tracer, fragment, traceMs, conversion, bytes }) => [
|
|
165
|
-
fragment.name,
|
|
166
|
-
tracer.packages.size,
|
|
167
|
-
tracer.files.size,
|
|
168
|
-
tracer.commonJs.size,
|
|
169
|
-
Object.keys(fragment.scopes).length,
|
|
170
|
-
Object.keys(fragment.imports).length,
|
|
171
|
-
fragment.inherits.length,
|
|
172
|
-
Math.round(bytes / 1024),
|
|
173
|
-
traceMs,
|
|
174
|
-
conversion.map((item) => `${item.ms}`).join(" / ") || "—",
|
|
175
|
-
]);
|
|
176
|
-
const pageRows = runs.map((item) => [
|
|
177
|
-
item.page,
|
|
178
|
-
item.flavor,
|
|
179
|
-
item.mounted ? "yes" : "no",
|
|
180
|
-
item.elements,
|
|
181
|
-
item.ms,
|
|
182
|
-
item.requests,
|
|
183
|
-
item.kilobytes,
|
|
184
|
-
item.errors.length > 0 ? item.errors.join("; ").replace(/\|/g, "/").replace(/\s+/g, " ").slice(0, 140) : "—",
|
|
185
|
-
]);
|
|
186
|
-
const consoleErrors = unique(runs.flatMap((item) => item.consoleErrors.map((text) => `${text.replace(/\|/g, "/")} — ${item.page}`)));
|
|
187
|
-
const converted = unique(built.flatMap(({ tracer }) => [...tracer.commonJs.values()].map((entry) => `${entry.pkg.name}@${entry.pkg.version}`))).sort();
|
|
188
|
-
const rewrites = built.flatMap(({ tracer }) => [...tracer.canonicalRewrites]).sort(([, a], [, b]) => b - a);
|
|
189
|
-
const remaps = built.flatMap(({ fragment }) => Object.keys(fragment.remaps));
|
|
190
|
-
const untraced = built.flatMap(({ tracer }) => tracer.untraced);
|
|
191
|
-
const measurementRows = Object.entries(metrics)
|
|
192
|
-
.filter(([key]) => key !== "buildFailures")
|
|
193
|
-
.map(([key, value]) => [key, typeof value === "object" ? JSON.stringify(value) : String(value)]);
|
|
194
|
-
const verdict = results.verdict;
|
|
195
|
-
return [
|
|
196
|
-
"# Spike: closure fragments",
|
|
197
|
-
"",
|
|
198
|
-
"Can each library publish its dependency closure as an import-map fragment that maps every bare import, converts every CommonJS-only package and carries integrity for every traced file?",
|
|
199
|
-
"",
|
|
200
|
-
"## Method",
|
|
201
|
-
"",
|
|
202
|
-
`- A prototype of the build tool (\`spikes/lib/trace.ts\`, \`convert-commonjs.ts\`, \`fragment.ts\`) traced each library's \`exports\` through its installed closure. It resolved imports with oxc-resolver (browser, import, module and default conditions), read imports from the oxc parser's module record, and mapped each package version's bare imports in that version's own scope.`,
|
|
203
|
-
`- It converted CommonJS-only entries with rolldown ${env["rolldown"]} into the library's \`runtime/\`: one build per flavor, CommonJS dependencies bundled in, ESM packages and the base set left external. It hashed every traced and converted file with SHA-384.`,
|
|
204
|
-
`- clicky-ui ${env["clicky-ui"]} (this checkout's dist) provides the base set (${BASE_PACKAGES.join(", ")}) at the top level. facet ${env["facet"]} (published) inherits the base set and clicky-ui and adds its page aliases (${Object.keys(FACET_ALIASES).join(", ")}).`,
|
|
205
|
-
`- Page imports neither library maps (${additional.map((item) => `\`${item}\``).join(", ")}) became a third fragment of additional packages, resolved from facet's installed closure in place of the registry.`,
|
|
206
|
-
`- The three fragments were composed into one import map per flavor. ${unique(runs.map((item) => item.page)).length} pages (12 clicky-ui kitchen-sink data demos, 8 facet example templates) loaded in Chrome ${env["chrome"]}, each in a fresh context, through a server standing in for the service worker. It served exact-version package URLs checked against the integrity map, defined \`process.env.NODE_ENV\`, served CSS and JSON imports as modules, and compiled page TSX with oxc.`,
|
|
207
|
-
"- Every bare import of every traced file was also resolved statically through the composed map, as the library CI check will do.",
|
|
208
|
-
...EXCLUDED_PAGES.map(({ page, reason }) => `- Left out: ${page}, which ${reason}`),
|
|
209
|
-
"",
|
|
210
|
-
"## Fragments",
|
|
211
|
-
"",
|
|
212
|
-
markdownTable(["Fragment", "Packages", "Files", "CommonJS entries", "Scopes", "Top-level", "Inherited", "KB", "Trace ms", "Convert ms (dev / prod)"], fragmentRows),
|
|
213
|
-
"",
|
|
214
|
-
`CommonJS-only packages converted: ${converted.length > 0 ? converted.map((item) => `\`${item}\``).join(", ") : "none"}.`,
|
|
215
|
-
"",
|
|
216
|
-
`Relative imports without a file name, rewritten to canonical URLs at serve time: ${rewrites.length > 0 ? rewrites.map(([name, count]) => `${name} (${count})`).join(", ") : "none"}.`,
|
|
217
|
-
"",
|
|
218
|
-
`CommonJS files imported by a relative path, remapped by URL to their conversion: ${remaps.length > 0 ? remaps.map((item) => `\`${item}\``).join(", ") : "none"}.`,
|
|
219
|
-
"",
|
|
220
|
-
"## Measurements",
|
|
221
|
-
"",
|
|
222
|
-
markdownTable(["Metric", "Value"], measurementRows),
|
|
223
|
-
"",
|
|
224
|
-
"## Page loads",
|
|
225
|
-
"",
|
|
226
|
-
markdownTable(["Page", "Flavor", "Mounted", "Elements", "ms", "Requests", "KB", "Errors"], pageRows),
|
|
227
|
-
"",
|
|
228
|
-
"Console errors the pages logged (not counted as page errors):",
|
|
229
|
-
"",
|
|
230
|
-
...(consoleErrors.length > 0 ? consoleErrors.map((item) => `- ${item}`) : ["None."]),
|
|
231
|
-
"",
|
|
232
|
-
"## Build-time failures",
|
|
233
|
-
"",
|
|
234
|
-
...(metrics.buildFailures.length > 0 ? metrics.buildFailures.map((item) => `- ${item.replace(/\|/g, "/")}`) : ["None."]),
|
|
235
|
-
"",
|
|
236
|
-
"## External references",
|
|
237
|
-
"",
|
|
238
|
-
"Resources on other origins that traced files load. They are not part of any closure, so the frame's CSP and the service worker's egress allowlist must permit them, or the library must ship them.",
|
|
239
|
-
"",
|
|
240
|
-
...(external.length > 0 ? external.map((item) => `- ${item.url} loads ${item.reference}`) : ["None."]),
|
|
241
|
-
"",
|
|
242
|
-
"## Statically unmapped imports",
|
|
243
|
-
"",
|
|
244
|
-
...(staticUnmapped.length > 0
|
|
245
|
-
? unique(staticUnmapped.map((item) => `- \`${item.specifier}\` from ${item.importer} (${item.flavor})`)).slice(0, 40)
|
|
246
|
-
: ["None."]),
|
|
247
|
-
"",
|
|
248
|
-
"## Untraced dynamic imports",
|
|
249
|
-
"",
|
|
250
|
-
untraced.length > 0
|
|
251
|
-
? `${untraced.length} dynamic imports take a computed specifier, so no static trace can follow them. Examples:`
|
|
252
|
-
: "None.",
|
|
253
|
-
...untraced.slice(0, 12).map((item) => `- ${item.url}: \`${item.expression.replace(/`/g, "'")}\``),
|
|
254
|
-
"",
|
|
255
|
-
"## Environment",
|
|
256
|
-
"",
|
|
257
|
-
markdownTable(["Component", "Version"], Object.entries(env)),
|
|
258
|
-
"",
|
|
259
|
-
"## Go criteria",
|
|
260
|
-
"",
|
|
261
|
-
markdownTable(["Criterion", "From", "Measured", "Met"], criteriaRows),
|
|
262
|
-
"",
|
|
263
|
-
`Verdict: ${verdict}`,
|
|
264
|
-
"",
|
|
265
|
-
"## Plan impact",
|
|
266
|
-
"",
|
|
267
|
-
...planImpact(results, runs, rewrites, remaps, external).map((item) => `- ${item}`),
|
|
268
|
-
].join("\n");
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
function planImpact(
|
|
272
|
-
results: SpikeResults,
|
|
273
|
-
runs: PageRun[],
|
|
274
|
-
rewrites: Array<[string, number]>,
|
|
275
|
-
remaps: string[],
|
|
276
|
-
external: Array<{ url: string; reference: string }>,
|
|
277
|
-
): string[] {
|
|
278
|
-
const metrics = results.metrics as { canonicalRewrites: number; importMapKilobytes: Record<string, number>; pages: number };
|
|
279
|
-
if (results.verdict === "no-go") {
|
|
280
|
-
const failing = runs.filter((item) => !item.mounted || item.errors.length > 0).map((item) => `${item.page} (${item.flavor})`);
|
|
281
|
-
return [`Decision 2 needs revisiting before P1: library-published fragments did not load every page. Failing loads: ${unique(failing).join(", ") || "none"}; see the measurements for the failed criteria.`];
|
|
282
|
-
}
|
|
283
|
-
const requests = runs.map((item) => item.requests);
|
|
284
|
-
return [
|
|
285
|
-
`Decision 2 stands: fragments the libraries publish covered every bare import of ${metrics.pages} pages in both flavors, with one React, and P1's build tool can follow this prototype.`,
|
|
286
|
-
`The service worker's canonical-URL rewrite must cover published package files, not only page code: ${metrics.canonicalRewrites} relative imports in ${rewrites.length} packages name no file (${rewrites
|
|
287
|
-
.slice(0, 3)
|
|
288
|
-
.map(([name]) => name)
|
|
289
|
-
.join(", ")} lead). The fragment's integrity map is also the file listing that the rewrite resolves against, so the rewrite needs no extra requests.`,
|
|
290
|
-
`Fragments carry URL remaps for ESM wrappers that import their own CommonJS build by a relative path (${remaps.join(", ") || "none here"}). Import maps remap URLs as well as bare specifiers, so no source rewrite is needed.`,
|
|
291
|
-
`A cold page load requested ${Math.min(...requests)}–${Math.max(...requests)} modules unbundled; the barrel-rewriting spike measures how far rewriting library entry barrels cuts that.`,
|
|
292
|
-
`The composed import map is about ${metrics.importMapKilobytes["production"]} KB per flavor and is inlined in each frame document, while the integrity map stays in the service worker.`,
|
|
293
|
-
...external.map(
|
|
294
|
-
(item) =>
|
|
295
|
-
`${item.url} loads ${new URL(item.reference).origin}. The deployment profile must allow that origin in the frame's CSP and the egress allowlist, or the library must ship the resource (P3 page styles, P7 isolation).`,
|
|
296
|
-
),
|
|
297
|
-
];
|
|
298
|
-
}
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
# Spike: compiler
|
|
2
|
-
|
|
3
|
-
Inside a service worker, do Sucrase and the MDX compiler compile page sources to the same rendered output as the current build? Do host elements carry `data-source="file:line:col"` in the development flavor? Does each module compile in under 20 ms?
|
|
4
|
-
|
|
5
|
-
## Method
|
|
6
|
-
|
|
7
|
-
- **Pages:** every facet example template (TSX and MDX, from the facet checkout) and every clicky-ui kitchen-sink demo exporting a component named after its file: 107 pages, of which 101 were compared (below).
|
|
8
|
-
- **Reference (the current build):** each page's modules compiled by the transform its build runs, loaded from that build's install: facet templates through Vite 6.4.3's esbuild transform with `jsx: "automatic"` (facet's CLI build, @vitejs/plugin-react 4) and MDX through @mdx-js/mdx 3.1.1 with facet's remark and rehype plugins (@mdx-js/rollup); kitchen-sink demos through Vite 8.3.5's oxc transform with `jsx.runtime: "automatic"` (@vitejs/plugin-react 6). `process.env.NODE_ENV` is defined as both builds define it.
|
|
9
|
-
- **Candidate:** a service worker (bundled to 964 KB) controls the page and compiles every page module request itself: Sucrase 3.35.1 for TS, TSX and JSX (automatic runtime, `disableESTransforms`), @mdx-js/mdx 3.1.1 with facet's plugins for MDX. The worker reads sources unchanged from the origin.
|
|
10
|
-
- Every page rendered in Chrome 156.0.8078.80 through the same runtime set (clicky-ui 0.3.57, facet 0.1.74), with time and `Math.random` fixed: the reference in production, the candidate in production and in development. The compared output is `#root`'s HTML after the page settled. When the candidate's HTML differed, the reference rendered again; a page whose reference renders differ from each other is unstable and left out.
|
|
11
|
-
- **Source markers:** the development render's `data-source` values were checked against the sources: a TS/TSX/JSX marker must point at a host tag's `<`, an MDX marker inside its file. A page is missing markers when it has host tags but rendered none, or rendered one that points nowhere.
|
|
12
|
-
- **Timings:** the worker timed each module's compile and reported it in a response header; every page module of both candidate renders counts, each in a fresh worker.
|
|
13
|
-
|
|
14
|
-
## Findings for the plan
|
|
15
|
-
|
|
16
|
-
- **Sucrase's development output has no column.** Its `jsxDEV` source argument is `{fileName, lineNumber}`, so a `jsx-dev-runtime` shim can only write `file:line`. The compiler instead writes `data-source="<path>:<line>:<column>"` into each host JSX tag (lowercase name, not a member expression) before Sucrase runs, finding the tags with Sucrase's own tokenizer (`sucrase/dist/parser`, an internal module: Sucrase has no exports map). This replaces the plan's shim for TS, TSX and JSX.
|
|
17
|
-
- **MDX needs no Sucrase pass.** MDX compiles straight to JavaScript, and its development output passes `{fileName, lineNumber, columnNumber}` from the `.mdx` source, so the plan's shim works there: the worker maps MDX modules' `react/jsx-dev-runtime` to it. Running Sucrase after MDX, as the plan describes, would replace those positions with the positions of MDX's generated JSX.
|
|
18
|
-
|
|
19
|
-
## Pages
|
|
20
|
-
|
|
21
|
-
| Page | Result | Elements | Markers | Host tags in sources | Modules | Max compile ms |
|
|
22
|
-
| --- | --- | --- | --- | --- | --- | --- |
|
|
23
|
-
| facet/DocumentFrontMatter | same | 98 | 25 | 25 | 2 | 5.7 |
|
|
24
|
-
| facet/kitchen-sink/BadgeExamples | same | 371 | 67 | 67 | 6 | 8.8 |
|
|
25
|
-
| facet/kitchen-sink/BleedTest | same | 79 | 67 | 8 | 2 | 4.0 |
|
|
26
|
-
| facet/kitchen-sink/CompactTableExample | same | 159 | 18 | 18 | 4 | 3.9 |
|
|
27
|
-
| facet/kitchen-sink/DataFlowDiagram | same | 48 | 1 | 1 | 2 | 3.0 |
|
|
28
|
-
| facet/kitchen-sink/FindingsReport | same | 101 | 36 | 20 | 2 | 16.0 |
|
|
29
|
-
| facet/kitchen-sink/FlanksourceFooter | same | 28 | 0 | 0 | 2 | 1.7 |
|
|
30
|
-
| facet/kitchen-sink/FlanksourceHeader | same | 32 | 0 | 0 | 2 | 2.2 |
|
|
31
|
-
| facet/kitchen-sink/HeaderDefault | same | 151 | 3 | 3 | 8 | 3.9 |
|
|
32
|
-
| facet/kitchen-sink/HeaderMinimal | same | 120 | 3 | 3 | 8 | 3.9 |
|
|
33
|
-
| facet/kitchen-sink/HeaderNone | same | 110 | 3 | 3 | 6 | 5.7 |
|
|
34
|
-
| facet/kitchen-sink/HeaderSolid | same | 231 | 5 | 5 | 8 | 5.6 |
|
|
35
|
-
| facet/kitchen-sink/ListTableExample | same | 734 | 31 | 19 | 4 | 5.5 |
|
|
36
|
-
| facet/kitchen-sink/LogoGridTableExample | same | 542 | 10 | 10 | 4 | 5.5 |
|
|
37
|
-
| facet/kitchen-sink/MdxReport | same | 166 | 33 | 1 | 2 | 21.0 |
|
|
38
|
-
| facet/kitchen-sink/MetricExamples | same | 314 | 21 | 21 | 6 | 5.6 |
|
|
39
|
-
| facet/kitchen-sink/MultiPageTable | same | 5327 | 10 | 1 | 6 | 3.4 |
|
|
40
|
-
| facet/kitchen-sink/PageSizeTest | same | 135 | 96 | 10 | 2 | 4.5 |
|
|
41
|
-
| facet/kitchen-sink/SecurityChecksTableExample | same | 390 | 10 | 10 | 4 | 3.4 |
|
|
42
|
-
| facet/kitchen-sink/SpecificationTableExample | same | 106 | 10 | 10 | 4 | 3.3 |
|
|
43
|
-
| facet/kitchen-sink/StatCardExamples | same | 291 | 30 | 30 | 6 | 6.6 |
|
|
44
|
-
| facet/kitchen-sink/TableExamples | same | 1355 | 20 | 2 | 6 | 4.6 |
|
|
45
|
-
| facet/kitchen-sink/TypographyTest | same | 640 | 300 | 124 | 8 | 11.0 |
|
|
46
|
-
| facet/office/Contents | same | 374 | 323 | 47 | 2 | 4.2 |
|
|
47
|
-
| facet/office/LiveDiagram | same | 30 | 3 | 3 | 2 | 2.6 |
|
|
48
|
-
| facet/office/Report | same | 166 | 147 | 30 | 2 | 3.7 |
|
|
49
|
-
| facet/page-sizes/Canvas | same | 14 | 4 | 4 | 2 | 1.7 |
|
|
50
|
-
| facet/quickstart/MyDatasheet | same | 81 | 14 | 14 | 2 | 2.8 |
|
|
51
|
-
| clicky-ui/AccordionListDemo | same | 129 | 18 | 24 | 4 | 5.7 |
|
|
52
|
-
| clicky-ui/AnsiHtmlDemo | same | 25 | 9 | 9 | 4 | 1.8 |
|
|
53
|
-
| clicky-ui/AppShellDemo | same | 252 | 57 | 20 | 4 | 7.8 |
|
|
54
|
-
| clicky-ui/AppShellRpcWorkbenchDemo | same | 374 | 9 | 10 | 2 | 9.5 |
|
|
55
|
-
| clicky-ui/AppSidebarDemo | same | 88 | 16 | 19 | 4 | 4.8 |
|
|
56
|
-
| clicky-ui/BadgeDemo | same | 210 | 35 | 18 | 4 | 6.7 |
|
|
57
|
-
| clicky-ui/ButtonDemo | same | 29 | 11 | 8 | 4 | 1.8 |
|
|
58
|
-
| clicky-ui/CacheBrowserDemo | same | 120 | 6 | 9 | 4 | 5.3 |
|
|
59
|
-
| clicky-ui/CalloutDemo | same | 258 | 8 | 11 | 4 | 2.7 |
|
|
60
|
-
| clicky-ui/CellsDemo | same | 79 | 19 | 10 | 4 | 3.0 |
|
|
61
|
-
| clicky-ui/ClickyDemo | same | 486 | 15 | 18 | 4 | 8.2 |
|
|
62
|
-
| clicky-ui/ClickyNativeDemo | same | 177 | 18 | 11 | 4 | 5.8 |
|
|
63
|
-
| clicky-ui/CodeBlocksDemo | same | 776 | 73 | 15 | 4 | 5.6 |
|
|
64
|
-
| clicky-ui/CommandFormDemo | same | 121 | 11 | 15 | 4 | 5.5 |
|
|
65
|
-
| clicky-ui/CommentsDemo | same | 208 | 24 | 17 | 4 | 8.0 |
|
|
66
|
-
| clicky-ui/ConnectionLoggingPolicyDemo | same | 312 | 4 | 4 | 2 | 5.3 |
|
|
67
|
-
| clicky-ui/DataTableDemo | same | 1228 | 18 | 23 | 4 | 9.7 |
|
|
68
|
-
| clicky-ui/DensityComparisonDemo | same | 492 | 63 | 18 | 4 | 5.7 |
|
|
69
|
-
| clicky-ui/DiagnosticsDemo | same | 211 | 8 | 11 | 4 | 3.8 |
|
|
70
|
-
| clicky-ui/DropdownMenuDemo | same | 37 | 19 | 12 | 4 | 4.0 |
|
|
71
|
-
| clicky-ui/EndpointSelectorDemo | same | 92 | 7 | 10 | 4 | 3.7 |
|
|
72
|
-
| clicky-ui/EntityExplorerDemo | same | 125 | 10 | 13 | 4 | 6.5 |
|
|
73
|
-
| clicky-ui/ErrorWrapperDemo | same | 56 | 1 | 1 | 2 | 2.7 |
|
|
74
|
-
| clicky-ui/FilterBarDemo | same | 45 | 11 | 13 | 4 | 6.4 |
|
|
75
|
-
| clicky-ui/FilterPillDemo | same | 66 | 11 | 8 | 4 | 4.2 |
|
|
76
|
-
| clicky-ui/FormFieldsDemo | same | 103 | 12 | 9 | 4 | 3.8 |
|
|
77
|
-
| clicky-ui/GavelStylingComparisonDemo | same | 159 | 101 | 45 | 4 | 9.6 |
|
|
78
|
-
| clicky-ui/GeneratedIconsDemo | same | 9056 | 4746 | 31 | 4 | 6.2 |
|
|
79
|
-
| clicky-ui/HarPanelDemo | same | 169 | 6 | 9 | 4 | 4.1 |
|
|
80
|
-
| clicky-ui/HierarchicalLookupDemo | same | 37 | 7 | 10 | 4 | 3.5 |
|
|
81
|
-
| clicky-ui/HoverCardDemo | same | 11 | 9 | 14 | 4 | 2.2 |
|
|
82
|
-
| clicky-ui/IconDemo | same | 30 | 30 | 12 | 4 | 1.9 |
|
|
83
|
-
| clicky-ui/JSONPathFieldDemo | same | 16 | 9 | 9 | 2 | 6.6 |
|
|
84
|
-
| clicky-ui/JsonSchemaFormAnnotationsDemo | same | 521 | 6 | 9 | 4 | 1.7 |
|
|
85
|
-
| clicky-ui/JsonViewDemo | same | 132 | 7 | 10 | 4 | 2.0 |
|
|
86
|
-
| clicky-ui/LogViewerDemo | same | 10 | 5 | 8 | 4 | 1.8 |
|
|
87
|
-
| clicky-ui/LogsTableDemo | same | 4081 | 6 | 9 | 4 | 5.8 |
|
|
88
|
-
| clicky-ui/MarkdownDemo | same | 519 | 69 | 12 | 4 | 2.2 |
|
|
89
|
-
| clicky-ui/MarkdownEditorDemo | same | 381 | 5 | 8 | 4 | 2.0 |
|
|
90
|
-
| clicky-ui/ModalDemo | same | 9 | 7 | 11 | 4 | 3.2 |
|
|
91
|
-
| clicky-ui/MultiGaugeBarDemo | same | 1447 | 87 | 34 | 12 | 4.1 |
|
|
92
|
-
| clicky-ui/MultiGaugeJvmTable | same | 852 | 53 | 26 | 8 | 7.3 |
|
|
93
|
-
| clicky-ui/MultiGaugeWorkloadTable | same | 409 | 31 | 11 | 6 | 4.4 |
|
|
94
|
-
| clicky-ui/OperationDialogsDemo | same | 26 | 14 | 8 | 4 | 7.0 |
|
|
95
|
-
| clicky-ui/PanelDemo | same | 42 | 18 | 19 | 4 | 2.6 |
|
|
96
|
-
| clicky-ui/ProfilesDemo | same | 181 | 6 | 10 | 4 | 6.7 |
|
|
97
|
-
| clicky-ui/ProgressBarDemo | same | 19 | 10 | 13 | 4 | 2.4 |
|
|
98
|
-
| clicky-ui/ProgressBarsDemo | same | 166 | 19 | 13 | 4 | 3.2 |
|
|
99
|
-
| clicky-ui/PropertiesDemo | same | 858 | 20 | 23 | 4 | 7.6 |
|
|
100
|
-
| clicky-ui/QueryBrowserDemo | same | 62 | 5 | 8 | 4 | 7.1 |
|
|
101
|
-
| clicky-ui/SearchInputDemo | same | 24 | 13 | 10 | 4 | 2.1 |
|
|
102
|
-
| clicky-ui/SectionDemo | same | 56 | 12 | 17 | 4 | 2.8 |
|
|
103
|
-
| clicky-ui/SegmentedControlDemo | same | 47 | 15 | 9 | 4 | 3.2 |
|
|
104
|
-
| clicky-ui/ServerTimingBadgeDemo | same | 19 | 11 | 8 | 4 | 2.3 |
|
|
105
|
-
| clicky-ui/SessionInspectorDemo | same | 458 | 11 | 14 | 4 | 2.1 |
|
|
106
|
-
| clicky-ui/SessionViewerDemo | same | 401 | 13 | 10 | 4 | 3.7 |
|
|
107
|
-
| clicky-ui/SignedDeltaBarDemo | same | 60 | 20 | 15 | 4 | 3.4 |
|
|
108
|
-
| clicky-ui/SortableHeaderDemo | same | 34 | 28 | 17 | 4 | 4.0 |
|
|
109
|
-
| clicky-ui/SplitPaneDemo | same | 16 | 12 | 15 | 4 | 1.7 |
|
|
110
|
-
| clicky-ui/StackTraceDemo | same | 423 | 36 | 16 | 4 | 6.5 |
|
|
111
|
-
| clicky-ui/SwitchersDemo | same | 19 | 11 | 8 | 4 | 2.1 |
|
|
112
|
-
| clicky-ui/SymbolBadgeDemo | same | 110 | 23 | 8 | 4 | 2.4 |
|
|
113
|
-
| clicky-ui/TabButtonDemo | same | 97 | 19 | 13 | 4 | 3.6 |
|
|
114
|
-
| clicky-ui/TabsDemo | same | 45 | 11 | 14 | 4 | 2.8 |
|
|
115
|
-
| clicky-ui/TimeRangeDemo | same | 38 | 12 | 9 | 4 | 4.2 |
|
|
116
|
-
| clicky-ui/TimelineDemo | same | 70 | 10 | 11 | 4 | 3.1 |
|
|
117
|
-
| clicky-ui/TimeseriesDemo | same | 333 | 20 | 14 | 4 | 6.2 |
|
|
118
|
-
| clicky-ui/ToastDemo | same | 16 | 11 | 8 | 4 | 2.7 |
|
|
119
|
-
| clicky-ui/TourDemo | same | 24 | 22 | 25 | 4 | 4.4 |
|
|
120
|
-
| clicky-ui/TraceLogsDemo | same | 830 | 19 | 20 | 4 | 6.8 |
|
|
121
|
-
| clicky-ui/TreeDemo | same | 164 | 32 | 13 | 4 | 9.2 |
|
|
122
|
-
| clicky-ui/TreeGroupHeaderDemo | same | 30 | 12 | 12 | 4 | 3.6 |
|
|
123
|
-
| clicky-ui/WorkloadPanelDemo | same | 206 | 1 | 1 | 4 | 3.1 |
|
|
124
|
-
|
|
125
|
-
Not compared, because the reference build of the page did not render through the runtime set:
|
|
126
|
-
|
|
127
|
-
- facet/kitchen-sink/UberKitchenSink: Uncaught SyntaxError: The requested module 'react-icons/si' does not provide an export named 'SiOpenai' / The requested modu
|
|
128
|
-
- clicky-ui/AvatarDemo: failed to load http://127.0.0.1:51259/entry/clicky-ui/AvatarDemo.js
|
|
129
|
-
- clicky-ui/FacetDiagramStyleDemo: Uncaught SyntaxError: The requested module '@flanksource/facet' does not provide an export named 'BOX_STYLES' / The requested m
|
|
130
|
-
- clicky-ui/MultiGaugeJvmMemory: Cannot read properties of undefined (reading 'pod')
|
|
131
|
-
- clicky-ui/MultiGaugeResourceCell: Cannot read properties of undefined (reading 'average')
|
|
132
|
-
- clicky-ui/OtelTracesDemo: failed to load http://127.0.0.1:51259/entry/clicky-ui/OtelTracesDemo.js
|
|
133
|
-
|
|
134
|
-
## Differences
|
|
135
|
-
|
|
136
|
-
No compared page's rendered DOM differs from the reference.
|
|
137
|
-
## Development DOM
|
|
138
|
-
|
|
139
|
-
### clicky-ui/ErrorWrapperDemo
|
|
140
|
-
|
|
141
|
-
The demo throws on purpose, and clicky-ui's ErrorWrapper renders the caught error's component stack. React's development build fills that stack with component names and module URLs (`at BrokenWorkspace`, `at ErrorWrapper (http://…/ErrorWrapper.js:12:20)`); the production build does not. The compiler is not involved.
|
|
142
|
-
|
|
143
|
-
```text
|
|
144
|
-
development: at BrokenWorkspace at ErrorWrapper (http://127.0.0.1:51260/npm/@flanksource/clicky-ui@0.3.57/dist/components/ErrorWrapper.js:12:20) at div at ErrorW
|
|
145
|
-
production: at BrokenWorkspace at ErrorWrapper (http://127.0.0.1:51259/npm/@flanksource/clicky-ui@0.3.57/dist/components/ErrorWrapper.js:12:20) at div at ErrorW
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
## Timings
|
|
149
|
-
|
|
150
|
-
412 module compiles: p50 1.7 ms, p95 6.6 ms, max 21 ms; MDX p95 21 ms. 7433 markers rendered across the compared pages; 1 pages' development DOM, markers removed, differs from their production DOM.
|
|
151
|
-
|
|
152
|
-
## Go criteria
|
|
153
|
-
|
|
154
|
-
| Criterion | Measured | Met |
|
|
155
|
-
| --- | --- | --- |
|
|
156
|
-
| pages >= 50 | 101 | yes |
|
|
157
|
-
| renderDiffs == 0 | 0 | yes |
|
|
158
|
-
| pagesMissingMarkers == 0 | 0 | yes |
|
|
159
|
-
| p95ModuleMs <= 20 | 6.6 | yes |
|
|
160
|
-
|
|
161
|
-
Verdict: go
|
|
162
|
-
|
|
163
|
-
## Environment
|
|
164
|
-
|
|
165
|
-
| Component | Version |
|
|
166
|
-
| --- | --- |
|
|
167
|
-
| node | v24.15.0 |
|
|
168
|
-
| chrome | 156.0.8078.80 |
|
|
169
|
-
| sucrase | 3.35.1 |
|
|
170
|
-
| @mdx-js/mdx (worker) | 3.1.1 |
|
|
171
|
-
| es-module-lexer | 3.0.4 |
|
|
172
|
-
| vite (facet) | 6.4.3 |
|
|
173
|
-
| vite (kitchen-sink) | 8.3.5 |
|
|
174
|
-
| @mdx-js/mdx (facet) | 3.1.1 |
|
|
175
|
-
| facet | 0.1.74 |
|
|
176
|
-
| clicky-ui | 0.3.57 |
|
|
177
|
-
| worker bundle KB | 964 |
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { compile } from "@mdx-js/mdx";
|
|
2
|
-
import rehypeRaw from "rehype-raw";
|
|
3
|
-
import remarkFrontmatter from "remark-frontmatter";
|
|
4
|
-
import remarkGfm from "remark-gfm";
|
|
5
|
-
import { remarkAlert } from "remark-github-blockquote-alert";
|
|
6
|
-
import { describe, expect, it } from "vitest";
|
|
7
|
-
import { compileMdx, compileScript, DEV_SHIM_URL, type MdxPlugins } from "./compile.ts";
|
|
8
|
-
import { checkMarkers, insertSourceMarkers } from "./markers.ts";
|
|
9
|
-
|
|
10
|
-
const PATH = "kitchen-sink/Card.tsx";
|
|
11
|
-
const CARD = [
|
|
12
|
-
'import type { ReactNode } from "react";',
|
|
13
|
-
'import { Badge } from "@flanksource/facet";',
|
|
14
|
-
"export function Card({ title }: { title: ReactNode }) {",
|
|
15
|
-
' return <section className="card">',
|
|
16
|
-
" <h2>{title}</h2>",
|
|
17
|
-
" <Badge label={String(title)} /><motion.div /><>{null}</>",
|
|
18
|
-
" </section>;",
|
|
19
|
-
"}",
|
|
20
|
-
].join("\n");
|
|
21
|
-
|
|
22
|
-
// The redact plugin is facet's; with no regions in the document it leaves the tree alone.
|
|
23
|
-
const PLUGINS: MdxPlugins = { remarkFrontmatter, remarkGfm, remarkAlert, facetRedact: () => () => undefined, rehypeRaw };
|
|
24
|
-
|
|
25
|
-
describe("insertSourceMarkers", () => {
|
|
26
|
-
it("marks host tags at their `<` and leaves components, member tags and fragments alone", () => {
|
|
27
|
-
const { sites } = insertSourceMarkers(CARD, PATH, true);
|
|
28
|
-
expect(sites).toEqual([
|
|
29
|
-
{ line: 4, column: 10, tag: "section" },
|
|
30
|
-
{ line: 5, column: 5, tag: "h2" },
|
|
31
|
-
]);
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
describe("compileScript", () => {
|
|
36
|
-
it("compiles production TSX to the automatic runtime, dropping type-only imports", () => {
|
|
37
|
-
const code = compileScript({ path: PATH, extension: ".tsx", code: CARD, flavor: "production" });
|
|
38
|
-
expect({ runtime: code.includes('from "react/jsx-runtime"'), typeImport: code.includes("ReactNode"), marker: code.includes("data-source") }).toEqual({
|
|
39
|
-
runtime: true,
|
|
40
|
-
typeImport: false,
|
|
41
|
-
marker: false,
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it("writes each host tag's position into the development output", () => {
|
|
46
|
-
const code = compileScript({ path: PATH, extension: ".tsx", code: CARD, flavor: "development" });
|
|
47
|
-
const markers = [...code.matchAll(/'data-source': "([^"]+)"/g)].map((match) => match[1]);
|
|
48
|
-
expect(markers).toEqual([`${PATH}:4:10`, `${PATH}:5:5`]);
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
describe("checkMarkers", () => {
|
|
53
|
-
it("accepts markers at host tags and rejects positions without one", () => {
|
|
54
|
-
const sources = new Map([[PATH, CARD]]);
|
|
55
|
-
expect(checkMarkers([`${PATH}:4:10`, `${PATH}:6:5`, "other.tsx:1:1"], sources)).toEqual({
|
|
56
|
-
valid: 1,
|
|
57
|
-
invalid: [`${PATH}:6:5: no host tag starts there`, "other.tsx:1:1: not a known <path>:<line>:<column>"],
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
describe("compileMdx", () => {
|
|
63
|
-
const MDX = ["# Report", "", "| a | b |", "| - | - |", "| 1 | 2 |", ""].join("\n");
|
|
64
|
-
|
|
65
|
-
it("routes the development output's jsxDEV calls through the marker shim, with columns", async () => {
|
|
66
|
-
const code = await compileMdx({ path: "kitchen-sink/Report.mdx", extension: ".mdx", code: MDX, flavor: "development" }, compile, PLUGINS);
|
|
67
|
-
expect({ shim: code.includes(`"${DEV_SHIM_URL}"`), columns: code.includes("columnNumber: 1"), runtime: code.includes('"react/jsx-dev-runtime"') }).toEqual({
|
|
68
|
-
shim: true,
|
|
69
|
-
columns: true,
|
|
70
|
-
runtime: false,
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it("renders GFM tables with facet's plugins", async () => {
|
|
75
|
-
const code = await compileMdx({ path: "kitchen-sink/Report.mdx", extension: ".mdx", code: MDX, flavor: "production" }, compile, PLUGINS);
|
|
76
|
-
expect(code.includes("_components.table")).toBe(true);
|
|
77
|
-
});
|
|
78
|
-
});
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { init, parse as lex } from "es-module-lexer";
|
|
2
|
-
import { transform, type Transform } from "sucrase";
|
|
3
|
-
import type { Flavor } from "../lib/convert-commonjs.ts";
|
|
4
|
-
import { defineNodeEnv } from "../lib/module-transform.ts";
|
|
5
|
-
import { insertSourceMarkers } from "./markers.ts";
|
|
6
|
-
|
|
7
|
-
// The service worker's page compiler: Sucrase for TS, TSX and JSX; the MDX compiler for MDX. Both run in the worker
|
|
8
|
-
// and in Node unchanged.
|
|
9
|
-
|
|
10
|
-
/** Where page modules import the development JSX runtime from: a shim that marks host elements. */
|
|
11
|
-
export const DEV_SHIM_URL = "/compiler/jsx-dev-runtime.js";
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Adds `data-source` to host elements from jsxDEV's source argument. MDX's development output passes a full
|
|
15
|
-
* `{fileName, lineNumber, columnNumber}`; TS, TSX and JSX modules already carry the attribute (see markers.ts).
|
|
16
|
-
*/
|
|
17
|
-
export const DEV_SHIM = [
|
|
18
|
-
'import { jsxDEV as base } from "react/jsx-dev-runtime";',
|
|
19
|
-
'export { Fragment } from "react/jsx-dev-runtime";',
|
|
20
|
-
"export function jsxDEV(type, props, key, isStatic, source, self) {",
|
|
21
|
-
' if (typeof type === "string" && source && source.columnNumber !== undefined && !(props && "data-source" in props)) {',
|
|
22
|
-
' props = { ...props, "data-source": `${source.fileName}:${source.lineNumber}:${source.columnNumber}` };',
|
|
23
|
-
" }",
|
|
24
|
-
" return base(type, props, key, isStatic, source, self);",
|
|
25
|
-
"}",
|
|
26
|
-
"",
|
|
27
|
-
].join("\n");
|
|
28
|
-
|
|
29
|
-
/** facet's MDX plugins in its build's order, given the plugin functions (the reference and the worker load their own copies). */
|
|
30
|
-
export type MdxPlugins = { remarkFrontmatter: unknown; remarkGfm: unknown; remarkAlert: unknown; facetRedact: unknown; rehypeRaw: unknown };
|
|
31
|
-
|
|
32
|
-
export function mdxOptions(plugins: MdxPlugins): { remarkPlugins: unknown[]; rehypePlugins: unknown[] } {
|
|
33
|
-
return {
|
|
34
|
-
remarkPlugins: [plugins.remarkFrontmatter, plugins.remarkGfm, [plugins.remarkAlert, { tagName: "blockquote" }], [plugins.facetRedact, { allow: {} }]],
|
|
35
|
-
rehypePlugins: [[plugins.rehypeRaw, { passThrough: ["mdxFlowExpression", "mdxJsxFlowElement", "mdxJsxTextElement", "mdxTextExpression", "mdxjsEsm"] }]],
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export type MdxCompile = (file: { value: string; path: string }, options: Record<string, unknown>) => Promise<{ toString(): string }>;
|
|
40
|
-
|
|
41
|
-
export type PageSourceInput = { path: string; extension: string; code: string; flavor: Flavor };
|
|
42
|
-
|
|
43
|
-
/** Compiles one TS, TSX or JSX module with Sucrase; the development flavor writes source markers first. */
|
|
44
|
-
export function compileScript({ path, extension, code, flavor }: PageSourceInput): string {
|
|
45
|
-
const typescript = extension === ".ts" || extension === ".tsx";
|
|
46
|
-
const jsx = extension !== ".ts";
|
|
47
|
-
const marked = flavor === "development" && jsx ? insertSourceMarkers(code, path, typescript).code : code;
|
|
48
|
-
const transforms: Transform[] = [...(typescript ? (["typescript"] as const) : []), ...(jsx ? (["jsx"] as const) : [])];
|
|
49
|
-
const { code: compiled } = transform(marked, {
|
|
50
|
-
transforms,
|
|
51
|
-
jsxRuntime: "automatic",
|
|
52
|
-
production: flavor === "production",
|
|
53
|
-
filePath: path,
|
|
54
|
-
disableESTransforms: true,
|
|
55
|
-
});
|
|
56
|
-
return defineNodeEnv(compiled, flavor).code;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/** Points a module's `react/jsx-dev-runtime` imports at the marker shim. */
|
|
60
|
-
export async function useDevShim(code: string): Promise<string> {
|
|
61
|
-
await init();
|
|
62
|
-
const [imports] = lex(code);
|
|
63
|
-
let rewritten = code;
|
|
64
|
-
for (const item of [...imports].reverse()) {
|
|
65
|
-
if (item.specifier === "react/jsx-dev-runtime") rewritten = `${rewritten.slice(0, item.start)}${DEV_SHIM_URL}${rewritten.slice(item.end)}`;
|
|
66
|
-
}
|
|
67
|
-
return rewritten;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/** Compiles an MDX page with facet's plugins; the development flavor's jsxDEV calls go through the marker shim. */
|
|
71
|
-
export async function compileMdx({ path, code, flavor }: PageSourceInput, compile: MdxCompile, plugins: MdxPlugins): Promise<string> {
|
|
72
|
-
const output = await compile({ value: code, path }, { ...mdxOptions(plugins), development: flavor === "development" });
|
|
73
|
-
const compiled = defineNodeEnv(String(output), flavor).code;
|
|
74
|
-
return flavor === "development" ? useDevShim(compiled) : compiled;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/** The compiler's entry: TS, TSX, JSX and MDX page sources to ESM. */
|
|
78
|
-
export async function compileSource(input: PageSourceInput, mdx: { compile: MdxCompile; plugins: MdxPlugins }): Promise<string> {
|
|
79
|
-
if (input.extension === ".mdx") return compileMdx(input, mdx.compile, mdx.plugins);
|
|
80
|
-
if ([".ts", ".tsx", ".jsx"].includes(input.extension)) return compileScript(input);
|
|
81
|
-
throw new Error(`${input.path}: the compiler takes .ts, .tsx, .jsx and .mdx sources, not ${input.extension}`);
|
|
82
|
-
}
|