adnbn 0.11.0 → 0.13.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 +3 -0
- package/dist/cli/builders/manifest/ManifestBase.js +1 -1
- package/dist/cli/bundler/index.d.ts +1 -0
- package/dist/cli/bundler/index.js +1 -0
- package/dist/cli/bundler/index.js.map +1 -1
- package/dist/cli/bundler/layers.d.ts +5 -0
- package/dist/cli/bundler/layers.js +11 -0
- package/dist/cli/bundler/layers.js.map +1 -0
- package/dist/cli/bundler/plugins/build-assets-map/BuildAssetsMapPlugin.js +44 -15
- package/dist/cli/bundler/plugins/build-assets-map/BuildAssetsMapPlugin.js.map +1 -1
- package/dist/cli/bundler/plugins/build-assets-map/index.d.ts +1 -2
- package/dist/cli/bundler/plugins/build-assets-map/index.js +0 -3
- package/dist/cli/bundler/plugins/build-assets-map/index.js.map +1 -1
- package/dist/cli/bundler/plugins/build-assets-map/normalize.d.ts +3 -0
- package/dist/cli/bundler/plugins/build-assets-map/normalize.js +24 -0
- package/dist/cli/bundler/plugins/build-assets-map/normalize.js.map +1 -0
- package/dist/cli/bundler/plugins/build-assets-map/templates/runtime.template.d.ts +2 -0
- package/dist/cli/bundler/plugins/build-assets-map/templates.d.ts +9 -0
- package/dist/cli/bundler/plugins/build-assets-map/templates.js +32 -0
- package/dist/cli/bundler/plugins/build-assets-map/usage.d.ts +3 -6
- package/dist/cli/bundler/plugins/build-assets-map/usage.js +6 -3
- package/dist/cli/bundler/plugins/build-assets-map/usage.js.map +1 -1
- package/dist/cli/bundler/plugins/entrypoint/EntrypointPlugin.js +11 -0
- package/dist/cli/bundler/plugins/entrypoint/EntrypointPlugin.js.map +1 -1
- package/dist/cli/bundler/plugins/index.d.ts +2 -2
- package/dist/cli/bundler/plugins/index.js +2 -6
- package/dist/cli/bundler/plugins/index.js.map +1 -1
- package/dist/cli/bundler/plugins/isolated-styles/IsolatedStylesPlugin.d.ts +1 -1
- package/dist/cli/bundler/plugins/isolated-styles/IsolatedStylesPlugin.js +38 -13
- package/dist/cli/bundler/plugins/isolated-styles/IsolatedStylesPlugin.js.map +1 -1
- package/dist/cli/bundler/plugins/isolated-styles/chunks.d.ts +7 -0
- package/dist/cli/bundler/plugins/isolated-styles/chunks.js +33 -0
- package/dist/cli/bundler/plugins/isolated-styles/chunks.js.map +1 -0
- package/dist/cli/bundler/plugins/isolated-styles/split-chunks.d.ts +4 -0
- package/dist/cli/bundler/plugins/isolated-styles/split-chunks.js +51 -0
- package/dist/cli/bundler/plugins/isolated-styles/split-chunks.js.map +1 -0
- package/dist/cli/bundler/plugins/isolated-styles/templates.js +36 -6
- package/dist/cli/bundler/plugins/manifest/ManifestPlugin.js +1 -2
- package/dist/cli/bundler/plugins/manifest/ManifestPlugin.js.map +1 -1
- package/dist/cli/bundler/plugins/types.d.ts +4 -0
- package/dist/cli/bundler/plugins/utils/compilation-assets.d.ts +4 -0
- package/dist/cli/bundler/plugins/utils/compilation-assets.js +12 -0
- package/dist/cli/bundler/plugins/utils/compilation-assets.js.map +1 -0
- package/dist/cli/bundler/plugins/utils/index.d.ts +2 -0
- package/dist/cli/bundler/plugins/utils/index.js +5 -0
- package/dist/cli/bundler/plugins/utils/index.js.map +1 -1
- package/dist/cli/bundler/plugins/utils/runtime-module.d.ts +3 -0
- package/dist/cli/bundler/plugins/utils/runtime-module.js +11 -0
- package/dist/cli/bundler/plugins/utils/runtime-module.js.map +1 -0
- package/dist/cli/bundler/utils/app-filename.d.ts +2 -0
- package/dist/cli/bundler/utils/app-filename.js +19 -0
- package/dist/cli/bundler/utils/app-filename.js.map +1 -0
- package/dist/cli/bundler/utils/assets.d.ts +3 -0
- package/dist/cli/bundler/utils/{output.js → assets.js} +22 -33
- package/dist/cli/bundler/utils/assets.js.map +1 -0
- package/dist/cli/bundler/utils/index.d.ts +2 -3
- package/dist/cli/bundler/utils/index.js +2 -3
- package/dist/cli/bundler/utils/index.js.map +1 -1
- package/dist/cli/entrypoint/file/injectors/core.js +1 -1
- package/dist/cli/entrypoint/finder/ContentFinder.d.ts +1 -1
- package/dist/cli/entrypoint/parser/ContentParser.d.ts +2 -2
- package/dist/cli/entrypoint/parser/ContentParser.js +6 -22
- package/dist/cli/entrypoint/parser/ContentParser.js.map +1 -1
- package/dist/cli/entrypoint/parser/RelayParser.js +1 -1
- package/dist/cli/entrypoint/parser/utils/content/default-render.d.ts +3 -0
- package/dist/cli/entrypoint/parser/utils/content/default-render.js +21 -0
- package/dist/cli/entrypoint/parser/utils/content/default-render.js.map +1 -0
- package/dist/cli/plugins/content/Content.d.ts +1 -1
- package/dist/cli/plugins/content/ContentDriver.d.ts +1 -1
- package/dist/cli/plugins/content/ContentManager.d.ts +1 -1
- package/dist/cli/plugins/content/ContentManager.js +1 -1
- package/dist/cli/plugins/content/ContentName.d.ts +1 -1
- package/dist/cli/plugins/content/ContentName.js +1 -1
- package/dist/cli/plugins/content/Relay.d.ts +1 -1
- package/dist/cli/plugins/content/RelayDriver.d.ts +1 -1
- package/dist/cli/plugins/content/RelayDriver.js +1 -1
- package/dist/cli/plugins/content/bundler.d.ts +1 -4
- package/dist/cli/plugins/content/bundler.js +5 -21
- package/dist/cli/plugins/content/bundler.js.map +1 -1
- package/dist/cli/plugins/content/index.js +4 -5
- package/dist/cli/plugins/content/index.js.map +1 -1
- package/dist/cli/plugins/content/types.d.ts +1 -1
- package/dist/cli/plugins/content/utils.d.ts +1 -1
- package/dist/cli/plugins/content/utils.js +1 -1
- package/dist/cli/plugins/index.d.ts +1 -1
- package/dist/cli/plugins/index.js +1 -1
- package/dist/cli/plugins/locale/Locale.js +5 -2
- package/dist/cli/plugins/locale/Locale.js.map +1 -1
- package/dist/cli/plugins/locale/index.js +2 -2
- package/dist/cli/plugins/locale/index.js.map +1 -1
- package/dist/cli/plugins/output/index.d.ts +2 -0
- package/dist/cli/plugins/{output.js → output/index.js} +11 -13
- package/dist/cli/plugins/output/index.js.map +1 -0
- package/dist/cli/plugins/output/runtime.d.ts +26 -0
- package/dist/cli/plugins/output/runtime.js +19 -0
- package/dist/cli/plugins/output/runtime.js.map +1 -0
- package/dist/cli/plugins/style/index.d.ts +1 -2
- package/dist/cli/plugins/style/index.js +19 -30
- package/dist/cli/plugins/style/index.js.map +1 -1
- package/dist/cli/resolvers/config.js +1 -2
- package/dist/cli/resolvers/config.js.map +1 -1
- package/dist/cli/virtual/index.js +4 -4
- package/dist/cli/virtual/virtual.d.ts +8 -3
- package/dist/content/index.d.ts +3 -0
- package/dist/content/index.js +8 -0
- package/dist/content/index.js.map +1 -0
- package/dist/entry/content/adapters/react/Builder.d.ts +7 -6
- package/dist/entry/content/adapters/react/Builder.js +12 -19
- package/dist/entry/content/adapters/react/Builder.js.map +1 -1
- package/dist/entry/content/adapters/react/Node.d.ts +6 -14
- package/dist/entry/content/adapters/react/Node.js +11 -35
- package/dist/entry/content/adapters/react/Node.js.map +1 -1
- package/dist/entry/content/adapters/react/definition.d.ts +2 -0
- package/dist/entry/content/adapters/react/definition.js +12 -0
- package/dist/entry/content/adapters/react/definition.js.map +1 -0
- package/dist/entry/content/adapters/react/index.d.ts +2 -1
- package/dist/entry/content/adapters/react/index.js +3 -1
- package/dist/entry/content/adapters/react/index.js.map +1 -1
- package/dist/entry/content/adapters/vanilla/Builder.d.ts +7 -5
- package/dist/entry/content/adapters/vanilla/Builder.js +17 -14
- package/dist/entry/content/adapters/vanilla/Builder.js.map +1 -1
- package/dist/entry/content/adapters/vanilla/Node.d.ts +5 -11
- package/dist/entry/content/adapters/vanilla/Node.js +11 -37
- package/dist/entry/content/adapters/vanilla/Node.js.map +1 -1
- package/dist/entry/content/adapters/vanilla/definition.d.ts +2 -0
- package/dist/entry/content/adapters/vanilla/definition.js +9 -0
- package/dist/entry/content/adapters/vanilla/definition.js.map +1 -0
- package/dist/entry/content/adapters/vanilla/index.d.ts +2 -1
- package/dist/entry/content/adapters/vanilla/index.js +3 -1
- package/dist/entry/content/adapters/vanilla/index.js.map +1 -1
- package/dist/entry/content/adapters/vanilla/utils.d.ts +1 -0
- package/dist/entry/content/adapters/vanilla/utils.js +7 -0
- package/dist/entry/content/adapters/vanilla/utils.js.map +1 -0
- package/dist/entry/content/index.d.ts +5 -1
- package/dist/entry/content/index.js +8 -1
- package/dist/entry/content/index.js.map +1 -1
- package/dist/entry/content/lifecycle/Builder.d.ts +32 -0
- package/dist/entry/content/lifecycle/Builder.js +254 -0
- package/dist/entry/content/lifecycle/Builder.js.map +1 -0
- package/dist/entry/content/lifecycle/IsolationSetup.d.ts +16 -0
- package/dist/entry/content/lifecycle/IsolationSetup.js +37 -0
- package/dist/entry/content/lifecycle/IsolationSetup.js.map +1 -0
- package/dist/entry/content/lifecycle/MountBuilder.d.ts +11 -0
- package/dist/entry/content/lifecycle/MountBuilder.js +73 -0
- package/dist/entry/content/lifecycle/MountBuilder.js.map +1 -0
- package/dist/entry/content/lifecycle/context/ContainerRegistry.d.ts +7 -0
- package/dist/entry/content/lifecycle/context/ContainerRegistry.js +45 -0
- package/dist/entry/content/lifecycle/context/ContainerRegistry.js.map +1 -0
- package/dist/entry/content/lifecycle/context/Context.d.ts +17 -0
- package/dist/entry/content/lifecycle/context/Context.js +88 -0
- package/dist/entry/content/lifecycle/context/Context.js.map +1 -0
- package/dist/entry/content/{core → lifecycle}/context/EventEmitter.d.ts +2 -2
- package/dist/entry/content/{core → lifecycle}/context/EventEmitter.js +3 -3
- package/dist/entry/content/lifecycle/context/EventEmitter.js.map +1 -0
- package/dist/entry/content/lifecycle/context/ManagedContext.d.ts +8 -0
- package/dist/entry/content/lifecycle/context/ManagedContext.js +19 -0
- package/dist/entry/content/lifecycle/context/ManagedContext.js.map +1 -0
- package/dist/entry/content/{core → lifecycle}/context/index.d.ts +1 -0
- package/dist/entry/content/lifecycle/context/index.js +11 -0
- package/dist/entry/content/lifecycle/context/index.js.map +1 -0
- package/dist/entry/content/{core → lifecycle}/markers/AbstractMarker.d.ts +2 -2
- package/dist/entry/content/{core → lifecycle}/markers/AbstractMarker.js +3 -3
- package/dist/entry/content/lifecycle/markers/AbstractMarker.js.map +1 -0
- package/dist/entry/content/{core → lifecycle}/markers/AttributeMarker.d.ts +2 -2
- package/dist/entry/content/{core → lifecycle}/markers/AttributeMarker.js +5 -3
- package/dist/entry/content/lifecycle/markers/AttributeMarker.js.map +1 -0
- package/dist/entry/content/{core → lifecycle}/markers/WeakMarker.d.ts +2 -2
- package/dist/entry/content/{core → lifecycle}/markers/WeakMarker.js +2 -2
- package/dist/entry/content/lifecycle/markers/WeakMarker.js.map +1 -0
- package/dist/entry/content/lifecycle/markers/index.js.map +1 -0
- package/dist/entry/content/lifecycle/nodes/EventNode.d.ts +15 -0
- package/dist/entry/content/lifecycle/nodes/EventNode.js +49 -0
- package/dist/entry/content/lifecycle/nodes/EventNode.js.map +1 -0
- package/dist/entry/content/lifecycle/nodes/FrameNode.d.ts +30 -0
- package/dist/entry/content/lifecycle/nodes/FrameNode.js +190 -0
- package/dist/entry/content/lifecycle/nodes/FrameNode.js.map +1 -0
- package/dist/entry/content/{core → lifecycle}/nodes/MarkerNode.d.ts +3 -2
- package/dist/entry/content/{core → lifecycle}/nodes/MarkerNode.js +5 -2
- package/dist/entry/content/lifecycle/nodes/MarkerNode.js.map +1 -0
- package/dist/entry/content/lifecycle/nodes/MountNode.d.ts +17 -0
- package/dist/entry/content/lifecycle/nodes/MountNode.js +80 -0
- package/dist/entry/content/lifecycle/nodes/MountNode.js.map +1 -0
- package/dist/entry/content/{core → lifecycle}/nodes/Node.d.ts +2 -2
- package/dist/entry/content/{core → lifecycle}/nodes/Node.js +2 -2
- package/dist/entry/content/lifecycle/nodes/Node.js.map +1 -0
- package/dist/entry/content/lifecycle/nodes/RenderNode.d.ts +28 -0
- package/dist/entry/content/lifecycle/nodes/RenderNode.js +140 -0
- package/dist/entry/content/lifecycle/nodes/RenderNode.js.map +1 -0
- package/dist/entry/content/lifecycle/nodes/ShadowNode.d.ts +22 -0
- package/dist/entry/content/lifecycle/nodes/ShadowNode.js +124 -0
- package/dist/entry/content/lifecycle/nodes/ShadowNode.js.map +1 -0
- package/dist/entry/content/{core → lifecycle}/nodes/index.d.ts +1 -0
- package/dist/entry/content/lifecycle/nodes/index.js +17 -0
- package/dist/entry/content/lifecycle/nodes/index.js.map +1 -0
- package/dist/entry/content/{core → lifecycle}/nodes/isolated-styles.d.ts +1 -1
- package/dist/entry/content/{core → lifecycle}/nodes/isolated-styles.js +2 -2
- package/dist/entry/content/lifecycle/nodes/isolated-styles.js.map +1 -0
- package/dist/entry/content/lifecycle/types.d.ts +28 -0
- package/dist/entry/content/resolvers/anchor.d.ts +2 -0
- package/dist/entry/content/{core/resolvers → resolvers}/anchor.js +2 -2
- package/dist/entry/content/resolvers/anchor.js.map +1 -0
- package/dist/entry/content/resolvers/container.d.ts +2 -0
- package/dist/entry/content/{core/resolvers → resolvers}/container.js +2 -2
- package/dist/entry/content/resolvers/container.js.map +1 -0
- package/dist/entry/content/resolvers/definition.d.ts +5 -0
- package/dist/entry/content/resolvers/definition.js +24 -0
- package/dist/entry/content/resolvers/definition.js.map +1 -0
- package/dist/entry/content/{core/resolvers → resolvers}/index.d.ts +1 -1
- package/dist/entry/content/{core/resolvers → resolvers}/index.js +1 -1
- package/dist/entry/content/resolvers/index.js.map +1 -0
- package/dist/entry/content/resolvers/mount.d.ts +2 -0
- package/dist/entry/content/{core/resolvers → resolvers}/mount.js +3 -3
- package/dist/entry/content/resolvers/mount.js.map +1 -0
- package/dist/entry/content/resolvers/target.d.ts +3 -0
- package/dist/entry/content/resolvers/target.js +34 -0
- package/dist/entry/content/resolvers/target.js.map +1 -0
- package/dist/entry/content/resolvers/watch.d.ts +6 -0
- package/dist/entry/content/resolvers/watch.js +81 -0
- package/dist/entry/content/resolvers/watch.js.map +1 -0
- package/dist/entry/relay/Builder.d.ts +8 -8
- package/dist/entry/relay/Builder.js +28 -19
- package/dist/entry/relay/Builder.js.map +1 -1
- package/dist/entry/relay/TransportBuilder.d.ts +3 -2
- package/dist/entry/relay/TransportBuilder.js +3 -3
- package/dist/entry/relay/TransportBuilder.js.map +1 -1
- package/dist/entry/relay/index.d.ts +5 -2
- package/dist/entry/relay/index.js +8 -2
- package/dist/entry/relay/index.js.map +1 -1
- package/dist/entry/relay/resolvers/definition.d.ts +4 -0
- package/dist/entry/relay/resolvers/definition.js +16 -0
- package/dist/entry/relay/resolvers/definition.js.map +1 -0
- package/dist/main/content.d.ts +4 -6
- package/dist/main/content.js +3 -16
- package/dist/main/content.js.map +1 -1
- package/dist/main/entrypoint.js +1 -1
- package/dist/main/entrypoint.js.map +1 -1
- package/dist/main/relay.d.ts +2 -1
- package/dist/main/relay.js.map +1 -1
- package/dist/relay/RelayPermission.js +1 -1
- package/dist/shared/content/isolation.d.ts +1 -1
- package/dist/shared/content/isolation.js +13 -20
- package/dist/shared/content/isolation.js.map +1 -1
- package/dist/shared/locale/index.d.ts +1 -1
- package/dist/shared/locale/index.js +3 -1
- package/dist/shared/locale/index.js.map +1 -1
- package/dist/shared/locale/messages.d.ts +4 -0
- package/dist/shared/locale/messages.js +12 -0
- package/dist/shared/locale/messages.js.map +1 -1
- package/dist/types/content/adapters/index.d.ts +2 -0
- package/dist/types/content/adapters/index.js +1 -0
- package/dist/types/content/adapters/index.js.map +1 -0
- package/dist/types/content/adapters/react.d.ts +4 -0
- package/dist/types/content/adapters/react.js +1 -0
- package/dist/types/content/adapters/react.js.map +1 -0
- package/dist/types/content/adapters/vanilla.d.ts +1 -0
- package/dist/types/content/adapters/vanilla.js +1 -0
- package/dist/types/content/adapters/vanilla.js.map +1 -0
- package/dist/types/content/boundary.d.ts +17 -0
- package/dist/types/content/boundary.js +1 -0
- package/dist/types/content/boundary.js.map +1 -0
- package/dist/types/{content.d.ts → content/common.d.ts} +32 -53
- package/dist/types/{content.js → content/common.js} +1 -1
- package/dist/types/content/common.js.map +1 -0
- package/dist/types/content/definition.d.ts +66 -0
- package/dist/types/content/definition.js +1 -0
- package/dist/types/content/definition.js.map +1 -0
- package/dist/types/content/index.d.ts +7 -0
- package/dist/types/content/index.js +2 -0
- package/dist/types/content/index.js.map +1 -0
- package/dist/types/content/prepare.d.ts +9 -0
- package/dist/types/content/prepare.js +1 -0
- package/dist/types/content/prepare.js.map +1 -0
- package/dist/types/content/render.d.ts +6 -0
- package/dist/types/content/render.js +1 -0
- package/dist/types/content/render.js.map +1 -0
- package/dist/types/content/target.d.ts +13 -0
- package/dist/types/content/target.js +1 -0
- package/dist/types/content/target.js.map +1 -0
- package/dist/types/locale.d.ts +3 -0
- package/dist/types/locale.js.map +1 -1
- package/dist/types/manifest.d.ts +1 -1
- package/dist/types/relay.d.ts +3 -4
- package/dist/types/relay.js.map +1 -1
- package/dist/virtual/modules.d.ts +4 -3
- package/dist/virtual/{entrypoint.d.ts → runtime.d.ts} +3 -0
- package/dist/virtual/runtime.js +9 -0
- package/dist/virtual/runtime.js.map +1 -0
- package/package.json +32 -25
- package/scripts/merge-coverage.mjs +12 -0
- package/scripts/pre-commit.mjs +22 -0
- package/scripts/test-inventory.mjs +38 -0
- package/scripts/test-run.mjs +25 -0
- package/types/client.d.ts +3 -3
- package/dist/cli/bundler/plugins/build-assets-map/entrypoint-module.d.ts +0 -13
- package/dist/cli/bundler/plugins/build-assets-map/entrypoint-module.js +0 -16
- package/dist/cli/bundler/plugins/build-assets-map/entrypoint-module.js.map +0 -1
- package/dist/cli/bundler/utils/layers.d.ts +0 -4
- package/dist/cli/bundler/utils/layers.js +0 -10
- package/dist/cli/bundler/utils/layers.js.map +0 -1
- package/dist/cli/bundler/utils/output.d.ts +0 -6
- package/dist/cli/bundler/utils/output.js.map +0 -1
- package/dist/cli/bundler/utils/styles.d.ts +0 -5
- package/dist/cli/bundler/utils/styles.js +0 -30
- package/dist/cli/bundler/utils/styles.js.map +0 -1
- package/dist/cli/plugins/output.d.ts +0 -2
- package/dist/cli/plugins/output.js.map +0 -1
- package/dist/cli/plugins/style/types.d.ts +0 -5
- package/dist/entry/content/adapters/react/resolvers/index.d.ts +0 -1
- package/dist/entry/content/adapters/react/resolvers/index.js +0 -2
- package/dist/entry/content/adapters/react/resolvers/index.js.map +0 -1
- package/dist/entry/content/adapters/react/resolvers/render.d.ts +0 -2
- package/dist/entry/content/adapters/react/resolvers/render.js +0 -11
- package/dist/entry/content/adapters/react/resolvers/render.js.map +0 -1
- package/dist/entry/content/core/Builder.d.ts +0 -26
- package/dist/entry/content/core/Builder.js +0 -128
- package/dist/entry/content/core/Builder.js.map +0 -1
- package/dist/entry/content/core/MountBuilder.d.ts +0 -10
- package/dist/entry/content/core/MountBuilder.js +0 -48
- package/dist/entry/content/core/MountBuilder.js.map +0 -1
- package/dist/entry/content/core/context/Context.d.ts +0 -12
- package/dist/entry/content/core/context/Context.js +0 -50
- package/dist/entry/content/core/context/Context.js.map +0 -1
- package/dist/entry/content/core/context/EventEmitter.js.map +0 -1
- package/dist/entry/content/core/context/ManagedContext.d.ts +0 -5
- package/dist/entry/content/core/context/ManagedContext.js +0 -12
- package/dist/entry/content/core/context/ManagedContext.js.map +0 -1
- package/dist/entry/content/core/context/index.js +0 -9
- package/dist/entry/content/core/context/index.js.map +0 -1
- package/dist/entry/content/core/markers/AbstractMarker.js.map +0 -1
- package/dist/entry/content/core/markers/AttributeMarker.js.map +0 -1
- package/dist/entry/content/core/markers/WeakMarker.js.map +0 -1
- package/dist/entry/content/core/markers/index.js.map +0 -1
- package/dist/entry/content/core/nodes/EventNode.d.ts +0 -11
- package/dist/entry/content/core/nodes/EventNode.js +0 -35
- package/dist/entry/content/core/nodes/EventNode.js.map +0 -1
- package/dist/entry/content/core/nodes/FrameNode.d.ts +0 -23
- package/dist/entry/content/core/nodes/FrameNode.js +0 -125
- package/dist/entry/content/core/nodes/FrameNode.js.map +0 -1
- package/dist/entry/content/core/nodes/MarkerNode.js.map +0 -1
- package/dist/entry/content/core/nodes/MountNode.d.ts +0 -12
- package/dist/entry/content/core/nodes/MountNode.js +0 -42
- package/dist/entry/content/core/nodes/MountNode.js.map +0 -1
- package/dist/entry/content/core/nodes/Node.js.map +0 -1
- package/dist/entry/content/core/nodes/ShadowNode.d.ts +0 -14
- package/dist/entry/content/core/nodes/ShadowNode.js +0 -67
- package/dist/entry/content/core/nodes/ShadowNode.js.map +0 -1
- package/dist/entry/content/core/nodes/index.js +0 -15
- package/dist/entry/content/core/nodes/index.js.map +0 -1
- package/dist/entry/content/core/nodes/isolated-styles.js.map +0 -1
- package/dist/entry/content/core/resolvers/anchor.d.ts +0 -2
- package/dist/entry/content/core/resolvers/anchor.js.map +0 -1
- package/dist/entry/content/core/resolvers/container.d.ts +0 -2
- package/dist/entry/content/core/resolvers/container.js.map +0 -1
- package/dist/entry/content/core/resolvers/definition.d.ts +0 -3
- package/dist/entry/content/core/resolvers/definition.js +0 -12
- package/dist/entry/content/core/resolvers/definition.js.map +0 -1
- package/dist/entry/content/core/resolvers/index.js.map +0 -1
- package/dist/entry/content/core/resolvers/mount.d.ts +0 -2
- package/dist/entry/content/core/resolvers/mount.js.map +0 -1
- package/dist/entry/content/core/resolvers/render.d.ts +0 -3
- package/dist/entry/content/core/resolvers/render.js +0 -18
- package/dist/entry/content/core/resolvers/render.js.map +0 -1
- package/dist/entry/content/core/resolvers/watch.d.ts +0 -4
- package/dist/entry/content/core/resolvers/watch.js +0 -62
- package/dist/entry/content/core/resolvers/watch.js.map +0 -1
- package/dist/entry/content/frame/Builder.d.ts +0 -7
- package/dist/entry/content/frame/Builder.js +0 -14
- package/dist/entry/content/frame/Builder.js.map +0 -1
- package/dist/entry/content/frame/index.d.ts +0 -4
- package/dist/entry/content/frame/index.js +0 -7
- package/dist/entry/content/frame/index.js.map +0 -1
- package/dist/types/content.js.map +0 -1
- package/dist/virtual/entrypoint.js +0 -7
- package/dist/virtual/entrypoint.js.map +0 -1
- /package/dist/entry/content/{core → lifecycle}/markers/index.d.ts +0 -0
- /package/dist/entry/content/{core → lifecycle}/markers/index.js +0 -0
- /package/dist/{cli/plugins/style → entry/content/lifecycle}/types.js +0 -0
- /package/dist/{cli/plugins/style → entry/content/lifecycle}/types.js.map +0 -0
package/README.md
CHANGED
|
@@ -17,6 +17,9 @@ the browser-specific build and manifest.
|
|
|
17
17
|
npm i -D adnbn
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
+
TypeScript projects require TypeScript **5.6.3 or newer** to check the published declarations and
|
|
21
|
+
their dependencies. Addon Bone's own TypeScript dependency does not replace your project's compiler.
|
|
22
|
+
|
|
20
23
|
## Get started
|
|
21
24
|
|
|
22
25
|
Create a project, then build it for production:
|
|
@@ -5,7 +5,7 @@ import { Browser } from "./../../../types/browser.js";
|
|
|
5
5
|
import { CommandExecuteActionName } from "./../../../types/command.js";
|
|
6
6
|
import { DefaultIconGroupName } from "./../../../types/icon.js";
|
|
7
7
|
import { SidebarAlternativeBrowsers } from "./../../../types/sidebar.js";
|
|
8
|
-
import { ContentScriptMatches } from "./../../../types/content.js";
|
|
8
|
+
import { ContentScriptMatches } from "./../../../types/content/index.js";
|
|
9
9
|
class ManifestError extends Error {
|
|
10
10
|
constructor(message) {
|
|
11
11
|
super("Manifest: " + message);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/bundler/index.ts"],"sourcesContent":["export * from \"./plugins\";\nexport * from \"./utils\";\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/bundler/index.ts"],"sourcesContent":["export * from \"./plugins\";\nexport * from \"./utils\";\nexport * from \"./layers\";\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ContentScriptWorld } from "../../types/content/index.js";
|
|
2
|
+
export declare const DefaultStylesLayer = "adnbn:css:default";
|
|
3
|
+
export declare const DocumentStylesLayer = "adnbn:css:document";
|
|
4
|
+
/** JavaScript identity depends on the execution world, never on CSS delivery. */
|
|
5
|
+
export declare const getContentLayer: (world: ContentScriptWorld) => string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const DefaultStylesLayer = "adnbn:css:default";
|
|
2
|
+
const DocumentStylesLayer = "adnbn:css:document";
|
|
3
|
+
const getContentLayer = (world) => {
|
|
4
|
+
return `adnbn:content:${world.toLowerCase()}`;
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
DefaultStylesLayer,
|
|
8
|
+
DocumentStylesLayer,
|
|
9
|
+
getContentLayer
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=layers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/bundler/layers.ts"],"sourcesContent":["import type {ContentScriptWorld} from \"@typing/content\";\n\n// CSS classification is independent of the importing JavaScript module's layer.\n// Default styles follow each entry's delivery policy; ?unisolated always targets the document.\nexport const DefaultStylesLayer = \"adnbn:css:default\";\nexport const DocumentStylesLayer = \"adnbn:css:document\";\n\n/** JavaScript identity depends on the execution world, never on CSS delivery. */\nexport const getContentLayer = (world: ContentScriptWorld): string => {\n return `adnbn:content:${world.toLowerCase()}`;\n};\n"],"mappings":"AAIO,MAAM,qBAAqB;AAC3B,MAAM,sBAAsB;AAG5B,MAAM,kBAAkB,CAAC,UAAsC;AAClE,SAAO,iBAAiB,MAAM,YAAY,CAAC;AAC/C;","names":[]}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Compilation, RuntimeGlobals, RuntimeModule, sources } from "@rspack/core";
|
|
2
2
|
import stringify from "json-stringify-deterministic";
|
|
3
3
|
import ts from "typescript";
|
|
4
|
-
import { collectBuildAssets
|
|
4
|
+
import { collectBuildAssets } from "./../../../../cli/bundler/utils/assets.js";
|
|
5
|
+
import { normalizeAssets, normalizeAssetsMap } from "./normalize.js";
|
|
6
|
+
import { renderBuildAssetsRuntime } from "./templates.js";
|
|
7
|
+
import { setCompilationBuildAssets } from "../utils/index.js";
|
|
5
8
|
import {
|
|
6
9
|
CssContentHashType,
|
|
7
10
|
JavaScriptContentHashType,
|
|
@@ -61,7 +64,9 @@ const chunkHasCss = (compilation, chunk) => {
|
|
|
61
64
|
});
|
|
62
65
|
};
|
|
63
66
|
const chunkHasJavaScript = (compilation, chunk) => {
|
|
64
|
-
if (chunk.hasRuntime())
|
|
67
|
+
if (chunk.hasRuntime()) {
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
65
70
|
return Array.from(compilation.chunkGraph.getChunkModulesIterable(chunk)).some((module) => {
|
|
66
71
|
return module.type.startsWith("javascript");
|
|
67
72
|
});
|
|
@@ -93,7 +98,7 @@ const getEntrypointRuntimeAssets = (compilation, name, cssFilename, cssChunkFile
|
|
|
93
98
|
return resolveChunkFilename(
|
|
94
99
|
compilation,
|
|
95
100
|
chunk,
|
|
96
|
-
chunk
|
|
101
|
+
chunk.canBeInitial() ? cssFilename : cssChunkFilename,
|
|
97
102
|
CssContentHashType
|
|
98
103
|
);
|
|
99
104
|
})
|
|
@@ -131,7 +136,7 @@ const entrypointRuntimeUsesFullHash = (compilation, name, cssFilename, cssChunkF
|
|
|
131
136
|
const css = chunkHasCss(compilation, chunk) && filenameRequiresFullHash(
|
|
132
137
|
compilation,
|
|
133
138
|
chunk,
|
|
134
|
-
chunk
|
|
139
|
+
chunk.canBeInitial() ? cssFilename : cssChunkFilename,
|
|
135
140
|
CssContentHashType
|
|
136
141
|
);
|
|
137
142
|
return js || css;
|
|
@@ -208,7 +213,9 @@ const collectRuntimeModuleFingerprints = (compilation) => {
|
|
|
208
213
|
};
|
|
209
214
|
const updateBuildAssetsChunkHashes = (compilation, options, runtimeModuleFingerprints, runtimes) => {
|
|
210
215
|
compilation.hooks.chunkHash.tap(PluginName, (chunk, hash) => {
|
|
211
|
-
if (!runtimes.has(chunk))
|
|
216
|
+
if (!runtimes.has(chunk)) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
212
219
|
const runtimeEntry = Array.from(compilation.entrypoints).find(([, entrypoint]) => {
|
|
213
220
|
return entrypoint.getRuntimeChunk() === chunk;
|
|
214
221
|
});
|
|
@@ -248,7 +255,7 @@ const updateBuildAssetsChunkHashes = (compilation, options, runtimeModuleFingerp
|
|
|
248
255
|
hash.update(`javascript-template:${template}`, "utf8");
|
|
249
256
|
}
|
|
250
257
|
if (chunkHasCss(compilation, referencedChunk)) {
|
|
251
|
-
const cssFilename = referencedChunk
|
|
258
|
+
const cssFilename = referencedChunk.canBeInitial() ? options.cssFilename : options.cssChunkFilename;
|
|
252
259
|
const template = resolveFilenameTemplate(
|
|
253
260
|
compilation,
|
|
254
261
|
referencedChunk,
|
|
@@ -296,7 +303,13 @@ class BuildAssetsRuntimeModule extends RuntimeModule {
|
|
|
296
303
|
generate() {
|
|
297
304
|
const runtime = RuntimeGlobals.require;
|
|
298
305
|
if (this.fullMap) {
|
|
299
|
-
return
|
|
306
|
+
return renderBuildAssetsRuntime({
|
|
307
|
+
require: runtime,
|
|
308
|
+
property: this.property,
|
|
309
|
+
value: FullMapPlaceholder,
|
|
310
|
+
envelope: FullMapEnvelopeKey,
|
|
311
|
+
full: true
|
|
312
|
+
});
|
|
300
313
|
}
|
|
301
314
|
const compilation = this.compilation;
|
|
302
315
|
if (!compilation) {
|
|
@@ -309,7 +322,13 @@ class BuildAssetsRuntimeModule extends RuntimeModule {
|
|
|
309
322
|
this.cssChunkFilename
|
|
310
323
|
);
|
|
311
324
|
const envelope = JSON.stringify({ [CurrentMapEnvelopeKey]: current });
|
|
312
|
-
return
|
|
325
|
+
return renderBuildAssetsRuntime({
|
|
326
|
+
require: runtime,
|
|
327
|
+
property: this.property,
|
|
328
|
+
value: envelope,
|
|
329
|
+
envelope: CurrentMapEnvelopeKey,
|
|
330
|
+
full: false
|
|
331
|
+
});
|
|
313
332
|
}
|
|
314
333
|
}
|
|
315
334
|
const replaceFullMapPlaceholder = (compilation, runtimeFiles, assets) => {
|
|
@@ -374,7 +393,7 @@ const validateEmbeddedMap = (compilation, fullMap, assets) => {
|
|
|
374
393
|
);
|
|
375
394
|
}
|
|
376
395
|
const embedded = extractEmbeddedMap(runtime.file, runtime.source);
|
|
377
|
-
if (stringify(embedded) !== stringify(assets)) {
|
|
396
|
+
if (stringify(normalizeAssetsMap(embedded)) !== stringify(assets)) {
|
|
378
397
|
throw new Error(
|
|
379
398
|
"Build assets changed after the runtime map was embedded; finalize entrypoint assets before processAssets begins"
|
|
380
399
|
);
|
|
@@ -389,7 +408,9 @@ const validateCurrentEntrypointMaps = (compilation, assets, fullMapEntrypoint, r
|
|
|
389
408
|
if (!entrypoint) {
|
|
390
409
|
throw new Error(`Build assets entrypoint "${name}" is unavailable`);
|
|
391
410
|
}
|
|
392
|
-
if (!runtimes.has(entrypoint.getRuntimeChunk()))
|
|
411
|
+
if (!runtimes.has(entrypoint.getRuntimeChunk())) {
|
|
412
|
+
continue;
|
|
413
|
+
}
|
|
393
414
|
const runtimeFiles = new Set(Array.from(entrypoint.getRuntimeChunk().files, toPosix));
|
|
394
415
|
const runtime = entrypointAssets.initial.js.filter((file) => runtimeFiles.has(file)).map((file) => {
|
|
395
416
|
var _a;
|
|
@@ -407,7 +428,7 @@ const validateCurrentEntrypointMaps = (compilation, assets, fullMapEntrypoint, r
|
|
|
407
428
|
initial: entrypointAssets.initial,
|
|
408
429
|
async: entrypointAssets.async
|
|
409
430
|
};
|
|
410
|
-
if (stringify(runtimeAssets) !== stringify(finalizedAssets)) {
|
|
431
|
+
if (stringify(normalizeAssets(runtimeAssets)) !== stringify(finalizedAssets)) {
|
|
411
432
|
throw new Error(
|
|
412
433
|
`Build assets changed after the runtime map for entrypoint "${name}" was embedded: ${JSON.stringify({ embedded: runtimeAssets, finalized: finalizedAssets })}`
|
|
413
434
|
);
|
|
@@ -449,9 +470,13 @@ class BuildAssetsMapPlugin {
|
|
|
449
470
|
const runtime = entrypoint.getRuntimeChunk();
|
|
450
471
|
const fullMap = name === this.options.fullMapEntrypoint;
|
|
451
472
|
const delivery = fullMap ? this.options.module.full : this.options.module.current;
|
|
452
|
-
if (!isUsed(runtime, delivery.export))
|
|
473
|
+
if (!isUsed(runtime, delivery.export)) {
|
|
474
|
+
continue;
|
|
475
|
+
}
|
|
453
476
|
validateEntrypointRuntime(compilation, name);
|
|
454
|
-
if (fullMap)
|
|
477
|
+
if (fullMap) {
|
|
478
|
+
validateFullMapEntrypoint(compilation, name);
|
|
479
|
+
}
|
|
455
480
|
selectedRuntimes.set(runtime, { name, fullMap, property: delivery.property });
|
|
456
481
|
}
|
|
457
482
|
}
|
|
@@ -460,7 +485,9 @@ class BuildAssetsMapPlugin {
|
|
|
460
485
|
filenamesValidated = true;
|
|
461
486
|
}
|
|
462
487
|
const selection = selectedRuntimes.get(chunk);
|
|
463
|
-
if (!selection || injectedRuntimes.has(chunk))
|
|
488
|
+
if (!selection || injectedRuntimes.has(chunk)) {
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
464
491
|
requirements.add(RuntimeGlobals.require);
|
|
465
492
|
injectedRuntimes.add(chunk);
|
|
466
493
|
compilation.addRuntimeModule(
|
|
@@ -510,7 +537,9 @@ class BuildAssetsMapPlugin {
|
|
|
510
537
|
{ name: `${PluginName}:finalValidation`, stage: FinalValidationStage },
|
|
511
538
|
(compilation) => {
|
|
512
539
|
const runtimes = runtimeSelections.get(compilation);
|
|
513
|
-
if (runtimes)
|
|
540
|
+
if (runtimes) {
|
|
541
|
+
finalizeBuildAssets(compilation, this.options, runtimes);
|
|
542
|
+
}
|
|
514
543
|
}
|
|
515
544
|
);
|
|
516
545
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/build-assets-map/BuildAssetsMapPlugin.ts"],"sourcesContent":["import {Chunk, Compilation, Compiler, Filename, RuntimeGlobals, RuntimeModule, sources} from \"@rspack/core\";\nimport stringify from \"json-stringify-deterministic\";\nimport ts from \"typescript\";\n\nimport {collectBuildAssets, setCompilationBuildAssets} from \"@cli/bundler/utils/output\";\nimport {\n CssContentHashType,\n JavaScriptContentHashType,\n resolveChunkFilename,\n resolveFilenameTemplate,\n filenameRequiresFullHash,\n} from \"@cli/bundler/utils/chunk-filename\";\nimport {toPosix} from \"@cli/utils/path\";\n\nimport type {EntrypointAssetsMap, EntrypointAssets} from \"@typing/entrypoint\";\n\nimport {trackModuleUsage, type BuildAssetsMapPluginModuleOptions} from \"./usage\";\n\nconst PluginName = \"BuildAssetsMapPlugin\";\n// Replaced with the full map once Rspack has resolved the output filenames.\nconst FullMapPlaceholder = \"__ADNBN_BUILD_ASSETS_FULL_MAP_PLACEHOLDER__\";\n// These JSON envelope keys let final validation locate each map after minification.\nconst FullMapEnvelopeKey = \"__adnbnBuildAssetsFullMap__\";\nconst CurrentMapEnvelopeKey = \"__adnbnBuildAssetsCurrentMap__\";\n// Hash-based output names are fixed when processAssets starts, so the asset graph is frozen here.\nconst EmbedStage = Number.NEGATIVE_INFINITY;\nconst FinalValidationStage = Infinity;\n\ninterface FullMapRuntime {\n readonly name: string;\n readonly runtime: Chunk;\n}\n\ninterface RuntimeSelection {\n readonly name: string;\n readonly fullMap: boolean;\n readonly property: string;\n}\n\nexport interface BuildAssetsMapPluginOptions {\n readonly module: BuildAssetsMapPluginModuleOptions;\n readonly buildHashSalt?: string;\n readonly cssChunkFilename: Filename;\n readonly cssFilename: Filename;\n readonly fullMapEntrypoint: string;\n}\n\ntype RuntimeModuleFingerprints = Map<Chunk, Map<string, string>>;\n\nconst validateAsyncChunkFilenames = (compilation: Compilation, cssChunkFilename: Filename): void => {\n const asyncChunks = new Set(\n Array.from(compilation.entrypoints.values()).flatMap(entrypoint => {\n return Array.from(entrypoint.getEntrypointChunk().getAllAsyncChunks());\n })\n );\n const validate = (\n filename: Filename,\n chunks: Iterable<Chunk>,\n contentHashType: string,\n assetType: \"CSS\" | \"JavaScript\",\n configName: \"cssFilename\" | \"jsFilename\"\n ): void => {\n if (typeof filename !== \"function\") {\n return;\n }\n\n const returnsFullHash = Array.from(chunks).some(chunk => {\n const template = resolveFilenameTemplate(compilation, chunk, filename, contentHashType);\n\n return /\\[(?:fullhash|hash)(?::\\d+)?\\]/i.test(template);\n });\n\n if (returnsFullHash) {\n const target = assetType === \"JavaScript\" ? \"async chunk URLs\" : \"async CSS chunk URLs\";\n\n throw new Error(\n `Rspack cannot generate ${target} when a filename callback returns [fullhash]; configure ${configName} as a string template instead`\n );\n }\n };\n\n if (compilation.outputOptions.chunkFilename) {\n validate(\n compilation.outputOptions.chunkFilename,\n asyncChunks,\n JavaScriptContentHashType,\n \"JavaScript\",\n \"jsFilename\"\n );\n }\n validate(\n cssChunkFilename,\n Array.from(asyncChunks).filter(chunk => chunkHasCss(compilation, chunk)),\n CssContentHashType,\n \"CSS\",\n \"cssFilename\"\n );\n};\n\nconst chunkHasCss = (compilation: Compilation, chunk: Chunk): boolean => {\n return Array.from(compilation.chunkGraph.getChunkModulesIterable(chunk)).some(module => {\n return module.type === CssContentHashType;\n });\n};\n\nconst chunkHasJavaScript = (compilation: Compilation, chunk: Chunk): boolean => {\n // splitChunks can move every user module out of an entry, but its bootstrap\n // still emits a JavaScript file and remains an initial dependency.\n if (chunk.hasRuntime()) return true;\n return Array.from(compilation.chunkGraph.getChunkModulesIterable(chunk)).some(module => {\n return module.type.startsWith(\"javascript\");\n });\n};\n\nconst getEntrypointRuntimeAssets = (\n compilation: Compilation,\n name: string,\n cssFilename: Filename,\n cssChunkFilename: Filename\n): EntrypointAssets => {\n const entrypoint = compilation.entrypoints.get(name);\n\n if (!entrypoint) {\n throw new Error(`Build assets entrypoint \"${name}\" is unavailable`);\n }\n\n const entryChunk = entrypoint.getEntrypointChunk();\n const initialChunks = Array.from(entrypoint.chunks);\n const asyncChunks = Array.from(entryChunk.getAllAsyncChunks());\n const jsFilename = compilation.outputOptions.filename;\n const jsChunkFilename = compilation.outputOptions.chunkFilename;\n\n if (!jsFilename || !jsChunkFilename) {\n throw new Error(\"Build assets require output.filename and output.chunkFilename\");\n }\n\n return {\n initial: {\n js: initialChunks\n .filter(chunk => chunkHasJavaScript(compilation, chunk))\n .map(chunk => {\n return resolveChunkFilename(\n compilation,\n chunk,\n chunk === entryChunk ? jsFilename : jsChunkFilename,\n JavaScriptContentHashType\n );\n }),\n css: initialChunks\n .filter(chunk => chunkHasCss(compilation, chunk))\n .map(chunk => {\n return resolveChunkFilename(\n compilation,\n chunk,\n chunk === entryChunk ? cssFilename : cssChunkFilename,\n CssContentHashType\n );\n }),\n },\n async: {\n js: asyncChunks\n .filter(chunk => chunkHasJavaScript(compilation, chunk))\n .map(chunk => {\n return resolveChunkFilename(compilation, chunk, jsChunkFilename, JavaScriptContentHashType);\n }),\n css: asyncChunks\n .filter(chunk => chunkHasCss(compilation, chunk))\n .map(chunk => {\n return resolveChunkFilename(compilation, chunk, cssChunkFilename, CssContentHashType);\n }),\n },\n };\n};\n\nconst entrypointRuntimeUsesFullHash = (\n compilation: Compilation,\n name: string,\n cssFilename: Filename,\n cssChunkFilename: Filename\n): boolean => {\n const entrypoint = compilation.entrypoints.get(name);\n\n if (!entrypoint) {\n return false;\n }\n\n const entryChunk = entrypoint.getEntrypointChunk();\n const initialChunks = Array.from(entrypoint.chunks);\n const asyncChunks = Array.from(entryChunk.getAllAsyncChunks());\n const jsFilename = compilation.outputOptions.filename;\n const jsChunkFilename = compilation.outputOptions.chunkFilename;\n\n if (!jsFilename || !jsChunkFilename) {\n return false;\n }\n\n return (\n initialChunks.some(chunk => {\n const js = filenameRequiresFullHash(\n compilation,\n chunk,\n chunk === entryChunk ? jsFilename : jsChunkFilename,\n JavaScriptContentHashType\n );\n const css =\n chunkHasCss(compilation, chunk) &&\n filenameRequiresFullHash(\n compilation,\n chunk,\n chunk === entryChunk ? cssFilename : cssChunkFilename,\n CssContentHashType\n );\n\n return js || css;\n }) ||\n asyncChunks.some(chunk => {\n const js = filenameRequiresFullHash(compilation, chunk, jsChunkFilename, JavaScriptContentHashType);\n const css =\n chunkHasCss(compilation, chunk) &&\n filenameRequiresFullHash(compilation, chunk, cssChunkFilename, CssContentHashType);\n\n return js || css;\n })\n );\n};\n\nconst getChunkKey = (chunk: Chunk): string => {\n return `${String(chunk.name ?? \"\")}:${String(chunk.id ?? \"\")}`;\n};\n\nconst getFullMapRuntime = (\n compilation: Compilation,\n name: string,\n runtimes: ReadonlySet<Chunk>\n): FullMapRuntime | undefined => {\n const entrypoint = compilation.entrypoints.get(name);\n\n if (!entrypoint || !runtimes.has(entrypoint.getRuntimeChunk())) {\n return;\n }\n\n return {name, runtime: entrypoint.getRuntimeChunk()};\n};\n\nconst getFullMapRuntimeFiles = (fullMap: FullMapRuntime, assets: EntrypointAssetsMap): readonly string[] => {\n const runtimeFiles = new Set(Array.from(fullMap.runtime.files, toPosix));\n\n return assets[fullMap.name].initial.js.filter(file => runtimeFiles.has(file));\n};\n\nconst validateEntrypointRuntime = (compilation: Compilation, name: string): void => {\n const entrypoint = compilation.entrypoints.get(name)!;\n if (entrypoint.getRuntimeChunk() !== entrypoint.getEntrypointChunk()) {\n throw new Error(\n `Build assets require a self-contained runtime for entrypoint \"${name}\"; disable optimization.runtimeChunk`\n );\n }\n};\n\nconst validateFullMapEntrypoint = (compilation: Compilation, name: string): void => {\n const entrypoint = compilation.entrypoints.get(name);\n\n if (!entrypoint) {\n return;\n }\n\n const entryChunk = entrypoint.getEntrypointChunk();\n const initialChunks = Array.from(entrypoint.chunks);\n const asyncChunks = Array.from(entryChunk.getAllAsyncChunks());\n\n if (initialChunks.length !== 1 || initialChunks[0] !== entryChunk || asyncChunks.length > 0) {\n throw new Error(\n `Full build-assets entrypoint \"${name}\" must be a single self-contained chunk; async chunks are not supported`\n );\n }\n};\n\nconst validateFullMapAssets = (assets: EntrypointAssetsMap, name: string): void => {\n const entrypoint = assets[name];\n\n if (!entrypoint) {\n return;\n }\n\n if (entrypoint.initial.js.length !== 1 || entrypoint.async.js.length > 0) {\n throw new Error(\n `Full build-assets entrypoint \"${name}\" must emit exactly one initial JavaScript file and no async JavaScript files`\n );\n }\n};\n\nconst serializeFilename = (filename: unknown): string => {\n return typeof filename === \"function\" ? filename.toString() : JSON.stringify(filename);\n};\n\nconst collectRuntimeModuleFingerprints = (compilation: Compilation): RuntimeModuleFingerprints => {\n const fingerprints: RuntimeModuleFingerprints = new Map();\n\n compilation.hooks.runtimeModule.tap(PluginName, (runtimeModule, chunk) => {\n if (runtimeModule.identifier().startsWith(\"webpack/runtime/build assets \")) {\n return;\n }\n\n let chunkFingerprints = fingerprints.get(chunk);\n\n if (!chunkFingerprints) {\n chunkFingerprints = new Map();\n fingerprints.set(chunk, chunkFingerprints);\n }\n\n chunkFingerprints.set(`${runtimeModule.stage}:${runtimeModule.identifier()}`, runtimeModule.generate());\n });\n\n return fingerprints;\n};\n\nconst updateBuildAssetsChunkHashes = (\n compilation: Compilation,\n options: Required<BuildAssetsMapPluginOptions>,\n runtimeModuleFingerprints: RuntimeModuleFingerprints,\n runtimes: ReadonlySet<Chunk>\n): void => {\n compilation.hooks.chunkHash.tap(PluginName, (chunk, hash) => {\n if (!runtimes.has(chunk)) return;\n const runtimeEntry = Array.from(compilation.entrypoints).find(([, entrypoint]) => {\n return entrypoint.getRuntimeChunk() === chunk;\n });\n\n if (!runtimeEntry) {\n return;\n }\n\n const [runtimeName] = runtimeEntry;\n const fullMap = runtimeName === options.fullMapEntrypoint;\n const entries = fullMap\n ? Array.from(compilation.entrypoints).toSorted(([left], [right]) => left.localeCompare(right))\n : [runtimeEntry];\n\n hash.update(`${PluginName}:runtime-map:${runtimeName}`, \"utf8\");\n hash.update(options.buildHashSalt, \"utf8\");\n hash.update(serializeFilename(compilation.outputOptions.filename), \"utf8\");\n hash.update(serializeFilename(compilation.outputOptions.chunkFilename), \"utf8\");\n hash.update(serializeFilename(options.cssFilename), \"utf8\");\n hash.update(serializeFilename(options.cssChunkFilename), \"utf8\");\n\n if (fullMap) {\n hash.update(serializeFilename(compilation.outputOptions.assetModuleFilename), \"utf8\");\n }\n\n for (const [entryName, entrypoint] of entries) {\n hash.update(entryName, \"utf8\");\n\n const entryChunk = entrypoint.getEntrypointChunk();\n const initialChunks = new Set(entrypoint.chunks);\n const chunks = Array.from(entryChunk.getAllReferencedChunks()).toSorted((left, right) =>\n getChunkKey(left).localeCompare(getChunkKey(right))\n );\n\n for (const referencedChunk of chunks) {\n const category = initialChunks.has(referencedChunk) ? \"initial\" : \"async\";\n\n hash.update(`${category}:${getChunkKey(referencedChunk)}`, \"utf8\");\n\n const jsFilename =\n referencedChunk === entryChunk\n ? compilation.outputOptions.filename\n : compilation.outputOptions.chunkFilename;\n\n if (jsFilename) {\n const template = resolveFilenameTemplate(\n compilation,\n referencedChunk,\n jsFilename,\n JavaScriptContentHashType\n );\n\n hash.update(`javascript-template:${template}`, \"utf8\");\n }\n\n if (chunkHasCss(compilation, referencedChunk)) {\n const cssFilename = referencedChunk === entryChunk ? options.cssFilename : options.cssChunkFilename;\n const template = resolveFilenameTemplate(\n compilation,\n referencedChunk,\n cssFilename,\n CssContentHashType\n );\n\n hash.update(`css-template:${template}`, \"utf8\");\n }\n\n const moduleHashes = Array.from(\n compilation.chunkGraph.getChunkModulesIterable(referencedChunk),\n module => {\n return compilation.chunkGraph.getModuleHash(module, new Set(referencedChunk.runtime)) ?? \"\";\n }\n ).toSorted();\n\n moduleHashes.forEach(moduleHash => hash.update(moduleHash, \"utf8\"));\n\n const runtimeFingerprints = runtimeModuleFingerprints.get(referencedChunk);\n\n if (runtimeFingerprints) {\n Array.from(runtimeFingerprints)\n .toSorted(([left], [right]) => left.localeCompare(right))\n .forEach(([identifier, source]) => {\n hash.update(`runtime-module:${identifier}`, \"utf8\");\n hash.update(source, \"utf8\");\n });\n }\n }\n }\n });\n};\n\nclass BuildAssetsRuntimeModule extends RuntimeModule {\n public constructor(\n private readonly fullMap: boolean,\n private readonly runtimeName: string,\n private readonly property: string,\n private readonly cssFilename: Filename,\n private readonly cssChunkFilename: Filename,\n fullHash: boolean\n ) {\n super(`build assets ${fullMap ? \"full\" : \"current\"} ${runtimeName}`, RuntimeModule.STAGE_TRIGGER);\n\n if (!fullMap) {\n this.dependentHash = true;\n this.fullHash = fullHash;\n }\n }\n\n public generate(): string {\n const runtime = RuntimeGlobals.require;\n\n if (this.fullMap) {\n return `${runtime}[${JSON.stringify(this.property)}] = JSON.parse(${JSON.stringify(FullMapPlaceholder)}).${FullMapEnvelopeKey};`;\n }\n\n const compilation = this.compilation;\n\n if (!compilation) {\n throw new Error(\"Build assets runtime is not attached to a compilation\");\n }\n\n const current = getEntrypointRuntimeAssets(\n compilation,\n this.runtimeName,\n this.cssFilename,\n this.cssChunkFilename\n );\n\n const envelope = JSON.stringify({[CurrentMapEnvelopeKey]: current});\n\n return `${runtime}[${JSON.stringify(this.property)}] = JSON.parse(${JSON.stringify(envelope)}).${CurrentMapEnvelopeKey};`;\n }\n}\n\nconst replaceFullMapPlaceholder = (\n compilation: Compilation,\n runtimeFiles: readonly string[],\n assets: EntrypointAssetsMap\n): void => {\n const placeholder = JSON.stringify(FullMapPlaceholder);\n const replacementValue = JSON.stringify(JSON.stringify({[FullMapEnvelopeKey]: assets}));\n let replacements = 0;\n\n for (const file of runtimeFiles) {\n const asset = compilation.getAsset(file);\n\n if (!asset) {\n continue;\n }\n\n const code = asset.source.source().toString();\n const start = code.indexOf(placeholder);\n\n if (start < 0) {\n continue;\n }\n\n if (code.indexOf(placeholder, start + placeholder.length) >= 0) {\n throw new Error(`Build assets placeholder occurs more than once in \"${file}\"`);\n }\n\n const source = new sources.ReplaceSource(asset.source);\n\n source.replace(start, start + placeholder.length - 1, replacementValue);\n compilation.updateAsset(file, source);\n replacements += 1;\n }\n\n if (replacements !== 1) {\n throw new Error(`Expected one full build-assets runtime, found ${replacements}`);\n }\n};\n\nconst extractEmbeddedEnvelope = <T>(file: string, source: string, key: string): T => {\n const sourceFile = ts.createSourceFile(file, source, ts.ScriptTarget.Latest, false, ts.ScriptKind.JS);\n const values: T[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isStringLiteralLike(node) && node.text.includes(key)) {\n try {\n const envelope = JSON.parse(node.text) as Record<string, T>;\n\n if (Object.prototype.hasOwnProperty.call(envelope, key)) {\n values.push(envelope[key]);\n }\n } catch {}\n }\n\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n if (values.length !== 1) {\n throw new Error(`Expected one embedded build assets value in \"${file}\", found ${values.length}`);\n }\n\n return values[0];\n};\n\nconst extractEmbeddedMap = (file: string, source: string): EntrypointAssetsMap => {\n return extractEmbeddedEnvelope<EntrypointAssetsMap>(file, source, FullMapEnvelopeKey);\n};\n\nconst validateEmbeddedMap = (compilation: Compilation, fullMap: FullMapRuntime, assets: EntrypointAssetsMap): void => {\n const runtimeFiles = getFullMapRuntimeFiles(fullMap, assets);\n const runtime = runtimeFiles\n .map(file => ({file, source: compilation.getAsset(file)?.source.source().toString() ?? \"\"}))\n .find(({source}) => source.length > 0);\n\n if (!runtime) {\n throw new Error(\n `Full build-assets runtime for entrypoint \"${fullMap.name}\" is unavailable after asset processing`\n );\n }\n\n const embedded = extractEmbeddedMap(runtime.file, runtime.source);\n\n if (stringify(embedded) !== stringify(assets)) {\n throw new Error(\n \"Build assets changed after the runtime map was embedded; finalize entrypoint assets before processAssets begins\"\n );\n }\n};\n\nconst validateCurrentEntrypointMaps = (\n compilation: Compilation,\n assets: EntrypointAssetsMap,\n fullMapEntrypoint: string,\n runtimes: ReadonlySet<Chunk>\n): void => {\n for (const [name, entrypointAssets] of Object.entries(assets)) {\n if (name === fullMapEntrypoint) {\n continue;\n }\n\n const entrypoint = compilation.entrypoints.get(name);\n\n if (!entrypoint) {\n throw new Error(`Build assets entrypoint \"${name}\" is unavailable`);\n }\n\n if (!runtimes.has(entrypoint.getRuntimeChunk())) continue;\n\n const runtimeFiles = new Set(Array.from(entrypoint.getRuntimeChunk().files, toPosix));\n const runtime = entrypointAssets.initial.js\n .filter(file => runtimeFiles.has(file))\n .map(file => ({file, source: compilation.getAsset(file)?.source.source().toString() ?? \"\"}))\n .find(({source}) => source.length > 0);\n\n if (!runtime) {\n throw new Error(`Runtime map for entrypoint \"${name}\" is unavailable after asset processing`);\n }\n\n const runtimeAssets = extractEmbeddedEnvelope<EntrypointAssets>(\n runtime.file,\n runtime.source,\n CurrentMapEnvelopeKey\n );\n const finalizedAssets: EntrypointAssets = {\n initial: entrypointAssets.initial,\n async: entrypointAssets.async,\n };\n\n if (stringify(runtimeAssets) !== stringify(finalizedAssets)) {\n throw new Error(\n `Build assets changed after the runtime map for entrypoint \"${name}\" was embedded: ${JSON.stringify({embedded: runtimeAssets, finalized: finalizedAssets})}`\n );\n }\n }\n};\n\nconst finalizeBuildAssets = (\n compilation: Compilation,\n options: Required<BuildAssetsMapPluginOptions>,\n runtimes: ReadonlySet<Chunk>\n): void => {\n const assets = collectBuildAssets(compilation);\n const fullMap = getFullMapRuntime(compilation, options.fullMapEntrypoint, runtimes);\n\n if (fullMap) {\n validateFullMapAssets(assets, options.fullMapEntrypoint);\n validateEmbeddedMap(compilation, fullMap, assets);\n }\n\n validateCurrentEntrypointMaps(compilation, assets, options.fullMapEntrypoint, runtimes);\n\n setCompilationBuildAssets(compilation, assets);\n};\n\nexport default class BuildAssetsMapPlugin {\n private readonly options: Required<BuildAssetsMapPluginOptions>;\n\n public constructor(options: BuildAssetsMapPluginOptions) {\n this.options = {\n ...options,\n buildHashSalt: options.buildHashSalt ?? \"\",\n };\n }\n\n public apply(compiler: Compiler): void {\n const runtimeSelections = new WeakMap<Compilation, ReadonlySet<Chunk>>();\n\n compiler.hooks.thisCompilation.tap({name: PluginName, stage: EmbedStage}, compilation => {\n const injectedRuntimes = new Set<Chunk>();\n runtimeSelections.set(compilation, injectedRuntimes);\n let filenamesValidated = false;\n let selectedRuntimes: Map<Chunk, RuntimeSelection> | undefined;\n const runtimeModuleFingerprints = collectRuntimeModuleFingerprints(compilation);\n const isUsed = trackModuleUsage(compiler, compilation, this.options.module);\n\n updateBuildAssetsChunkHashes(compilation, this.options, runtimeModuleFingerprints, injectedRuntimes);\n\n compilation.hooks.additionalTreeRuntimeRequirements.tap(PluginName, (chunk, requirements) => {\n if (!selectedRuntimes) {\n selectedRuntimes = new Map();\n // Select and validate in entrypoint order, independently of runtime hook order.\n for (const [name, entrypoint] of compilation.entrypoints) {\n const runtime = entrypoint.getRuntimeChunk();\n const fullMap = name === this.options.fullMapEntrypoint;\n const delivery = fullMap ? this.options.module.full : this.options.module.current;\n if (!isUsed(runtime, delivery.export)) continue;\n\n validateEntrypointRuntime(compilation, name);\n if (fullMap) validateFullMapEntrypoint(compilation, name);\n selectedRuntimes.set(runtime, {name, fullMap, property: delivery.property});\n }\n }\n\n if (!filenamesValidated) {\n validateAsyncChunkFilenames(compilation, this.options.cssChunkFilename);\n filenamesValidated = true;\n }\n\n const selection = selectedRuntimes.get(chunk);\n if (!selection || injectedRuntimes.has(chunk)) return;\n\n requirements.add(RuntimeGlobals.require);\n injectedRuntimes.add(chunk);\n compilation.addRuntimeModule(\n chunk,\n new BuildAssetsRuntimeModule(\n selection.fullMap,\n selection.name,\n selection.property,\n this.options.cssFilename,\n this.options.cssChunkFilename,\n entrypointRuntimeUsesFullHash(\n compilation,\n selection.name,\n this.options.cssFilename,\n this.options.cssChunkFilename\n )\n )\n );\n });\n\n compilation.hooks.processAssets.tap(\n {\n name: PluginName,\n stage: EmbedStage,\n },\n () => {\n const assets = collectBuildAssets(compilation);\n const fullMap = getFullMapRuntime(compilation, this.options.fullMapEntrypoint, injectedRuntimes);\n setCompilationBuildAssets(compilation, assets);\n\n if (fullMap) {\n validateFullMapAssets(assets, this.options.fullMapEntrypoint);\n replaceFullMapPlaceholder(compilation, getFullMapRuntimeFiles(fullMap, assets), assets);\n }\n }\n );\n\n compilation.hooks.processAssets.tap(\n {\n name: `${PluginName}:finalize`,\n stage: Compilation.PROCESS_ASSETS_STAGE_ANALYSE,\n },\n () => finalizeBuildAssets(compilation, this.options, injectedRuntimes)\n );\n });\n\n // Register after every afterPlugins callback, then run after ordinary emit taps but before files are written.\n compiler.hooks.afterPlugins.intercept({\n name: `${PluginName}:registerFinalValidation`,\n done: () => {\n compiler.hooks.emit.tap(\n {name: `${PluginName}:finalValidation`, stage: FinalValidationStage},\n compilation => {\n const runtimes = runtimeSelections.get(compilation);\n if (runtimes) finalizeBuildAssets(compilation, this.options, runtimes);\n }\n );\n },\n });\n }\n}\n"],"mappings":"AAAA,SAAe,aAAiC,gBAAgB,eAAe,eAAc;AAC7F,OAAO,eAAe;AACtB,OAAO,QAAQ;AAEf,SAAQ,oBAAoB,iCAAgC;AAC5D;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAQ,eAAc;AAItB,SAAQ,wBAA+D;AAEvE,MAAM,aAAa;AAEnB,MAAM,qBAAqB;AAE3B,MAAM,qBAAqB;AAC3B,MAAM,wBAAwB;AAE9B,MAAM,aAAa,OAAO;AAC1B,MAAM,uBAAuB;AAuB7B,MAAM,8BAA8B,CAAC,aAA0B,qBAAqC;AAChG,QAAM,cAAc,IAAI;AAAA,IACpB,MAAM,KAAK,YAAY,YAAY,OAAO,CAAC,EAAE,QAAQ,gBAAc;AAC/D,aAAO,MAAM,KAAK,WAAW,mBAAmB,EAAE,kBAAkB,CAAC;AAAA,IACzE,CAAC;AAAA,EACL;AACA,QAAM,WAAW,CACb,UACA,QACA,iBACA,WACA,eACO;AACP,QAAI,OAAO,aAAa,YAAY;AAChC;AAAA,IACJ;AAEA,UAAM,kBAAkB,MAAM,KAAK,MAAM,EAAE,KAAK,WAAS;AACrD,YAAM,WAAW,wBAAwB,aAAa,OAAO,UAAU,eAAe;AAEtF,aAAO,kCAAkC,KAAK,QAAQ;AAAA,IAC1D,CAAC;AAED,QAAI,iBAAiB;AACjB,YAAM,SAAS,cAAc,eAAe,qBAAqB;AAEjE,YAAM,IAAI;AAAA,QACN,0BAA0B,MAAM,2DAA2D,UAAU;AAAA,MACzG;AAAA,IACJ;AAAA,EACJ;AAEA,MAAI,YAAY,cAAc,eAAe;AACzC;AAAA,MACI,YAAY,cAAc;AAAA,MAC1B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAC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,CAAC;AAGD,aAAS,MAAM,aAAa,UAAU;AAAA,MAClC,MAAM,GAAG,UAAU;AAAA,MACnB,MAAM,MAAM;AACR,iBAAS,MAAM,KAAK;AAAA,UAChB,EAAC,MAAM,GAAG,UAAU,oBAAoB,OAAO,qBAAoB;AAAA,UACnE,iBAAe;AACX,kBAAM,WAAW,kBAAkB,IAAI,WAAW;AAClD,gBAAI,SAAU,qBAAoB,aAAa,KAAK,SAAS,QAAQ;AAAA,UACzE;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ,CAAC;AAAA,EACL;AACJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/build-assets-map/BuildAssetsMapPlugin.ts"],"sourcesContent":["import {Chunk, Compilation, Compiler, Filename, RuntimeGlobals, RuntimeModule, sources} from \"@rspack/core\";\nimport stringify from \"json-stringify-deterministic\";\nimport ts from \"typescript\";\n\nimport {collectBuildAssets} from \"@cli/bundler/utils/assets\";\nimport {normalizeAssets, normalizeAssetsMap} from \"./normalize\";\nimport {renderBuildAssetsRuntime} from \"./templates\";\nimport {setCompilationBuildAssets} from \"../utils\";\n\nimport {\n CssContentHashType,\n JavaScriptContentHashType,\n resolveChunkFilename,\n resolveFilenameTemplate,\n filenameRequiresFullHash,\n} from \"@cli/bundler/utils/chunk-filename\";\n\nimport {toPosix} from \"@cli/utils/path\";\n\nimport type {EntrypointAssetsMap, EntrypointAssets} from \"@typing/entrypoint\";\n\nimport {trackModuleUsage, type BuildAssetsMapPluginModuleOptions} from \"./usage\";\n\nconst PluginName = \"BuildAssetsMapPlugin\";\n// Replaced with the full map once Rspack has resolved the output filenames.\nconst FullMapPlaceholder = \"__ADNBN_BUILD_ASSETS_FULL_MAP_PLACEHOLDER__\";\n// These JSON envelope keys let final validation locate each map after minification.\nconst FullMapEnvelopeKey = \"__adnbnBuildAssetsFullMap__\";\nconst CurrentMapEnvelopeKey = \"__adnbnBuildAssetsCurrentMap__\";\n// Hash-based output names are fixed when processAssets starts, so the asset graph is frozen here.\nconst EmbedStage = Number.NEGATIVE_INFINITY;\nconst FinalValidationStage = Infinity;\n\ninterface FullMapRuntime {\n readonly name: string;\n readonly runtime: Chunk;\n}\n\ninterface RuntimeSelection {\n readonly name: string;\n readonly fullMap: boolean;\n readonly property: string;\n}\n\nexport interface BuildAssetsMapPluginOptions {\n readonly module: BuildAssetsMapPluginModuleOptions;\n readonly buildHashSalt?: string;\n readonly cssChunkFilename: Filename;\n readonly cssFilename: Filename;\n readonly fullMapEntrypoint: string;\n}\n\ntype RuntimeModuleFingerprints = Map<Chunk, Map<string, string>>;\n\nconst validateAsyncChunkFilenames = (compilation: Compilation, cssChunkFilename: Filename): void => {\n const asyncChunks = new Set(\n Array.from(compilation.entrypoints.values()).flatMap(entrypoint => {\n return Array.from(entrypoint.getEntrypointChunk().getAllAsyncChunks());\n })\n );\n\n const validate = (\n filename: Filename,\n chunks: Iterable<Chunk>,\n contentHashType: string,\n assetType: \"CSS\" | \"JavaScript\",\n configName: \"cssFilename\" | \"jsFilename\"\n ): void => {\n if (typeof filename !== \"function\") {\n return;\n }\n\n const returnsFullHash = Array.from(chunks).some(chunk => {\n const template = resolveFilenameTemplate(compilation, chunk, filename, contentHashType);\n\n return /\\[(?:fullhash|hash)(?::\\d+)?\\]/i.test(template);\n });\n\n if (returnsFullHash) {\n const target = assetType === \"JavaScript\" ? \"async chunk URLs\" : \"async CSS chunk URLs\";\n\n throw new Error(\n `Rspack cannot generate ${target} when a filename callback returns [fullhash]; configure ${configName} as a string template instead`\n );\n }\n };\n\n if (compilation.outputOptions.chunkFilename) {\n validate(\n compilation.outputOptions.chunkFilename,\n asyncChunks,\n JavaScriptContentHashType,\n \"JavaScript\",\n \"jsFilename\"\n );\n }\n\n validate(\n cssChunkFilename,\n Array.from(asyncChunks).filter(chunk => chunkHasCss(compilation, chunk)),\n CssContentHashType,\n \"CSS\",\n \"cssFilename\"\n );\n};\n\nconst chunkHasCss = (compilation: Compilation, chunk: Chunk): boolean => {\n return Array.from(compilation.chunkGraph.getChunkModulesIterable(chunk)).some(module => {\n return module.type === CssContentHashType;\n });\n};\n\nconst chunkHasJavaScript = (compilation: Compilation, chunk: Chunk): boolean => {\n // splitChunks can move every user module out of an entry, but its bootstrap\n // still emits a JavaScript file and remains an initial dependency.\n if (chunk.hasRuntime()) {\n return true;\n }\n\n return Array.from(compilation.chunkGraph.getChunkModulesIterable(chunk)).some(module => {\n return module.type.startsWith(\"javascript\");\n });\n};\n\nconst getEntrypointRuntimeAssets = (\n compilation: Compilation,\n name: string,\n cssFilename: Filename,\n cssChunkFilename: Filename\n): EntrypointAssets => {\n const entrypoint = compilation.entrypoints.get(name);\n\n if (!entrypoint) {\n throw new Error(`Build assets entrypoint \"${name}\" is unavailable`);\n }\n\n const entryChunk = entrypoint.getEntrypointChunk();\n const initialChunks = Array.from(entrypoint.chunks);\n const asyncChunks = Array.from(entryChunk.getAllAsyncChunks());\n const jsFilename = compilation.outputOptions.filename;\n const jsChunkFilename = compilation.outputOptions.chunkFilename;\n\n if (!jsFilename || !jsChunkFilename) {\n throw new Error(\"Build assets require output.filename and output.chunkFilename\");\n }\n\n return {\n initial: {\n js: initialChunks\n .filter(chunk => chunkHasJavaScript(compilation, chunk))\n .map(chunk => {\n return resolveChunkFilename(\n compilation,\n chunk,\n chunk === entryChunk ? jsFilename : jsChunkFilename,\n JavaScriptContentHashType\n );\n }),\n css: initialChunks\n .filter(chunk => chunkHasCss(compilation, chunk))\n .map(chunk => {\n return resolveChunkFilename(\n compilation,\n chunk,\n chunk.canBeInitial() ? cssFilename : cssChunkFilename,\n CssContentHashType\n );\n }),\n },\n async: {\n js: asyncChunks\n .filter(chunk => chunkHasJavaScript(compilation, chunk))\n .map(chunk => {\n return resolveChunkFilename(compilation, chunk, jsChunkFilename, JavaScriptContentHashType);\n }),\n css: asyncChunks\n .filter(chunk => chunkHasCss(compilation, chunk))\n .map(chunk => {\n return resolveChunkFilename(compilation, chunk, cssChunkFilename, CssContentHashType);\n }),\n },\n };\n};\n\nconst entrypointRuntimeUsesFullHash = (\n compilation: Compilation,\n name: string,\n cssFilename: Filename,\n cssChunkFilename: Filename\n): boolean => {\n const entrypoint = compilation.entrypoints.get(name);\n\n if (!entrypoint) {\n return false;\n }\n\n const entryChunk = entrypoint.getEntrypointChunk();\n const initialChunks = Array.from(entrypoint.chunks);\n const asyncChunks = Array.from(entryChunk.getAllAsyncChunks());\n const jsFilename = compilation.outputOptions.filename;\n const jsChunkFilename = compilation.outputOptions.chunkFilename;\n\n if (!jsFilename || !jsChunkFilename) {\n return false;\n }\n\n return (\n initialChunks.some(chunk => {\n const js = filenameRequiresFullHash(\n compilation,\n chunk,\n chunk === entryChunk ? jsFilename : jsChunkFilename,\n JavaScriptContentHashType\n );\n\n const css =\n chunkHasCss(compilation, chunk) &&\n filenameRequiresFullHash(\n compilation,\n chunk,\n chunk.canBeInitial() ? cssFilename : cssChunkFilename,\n CssContentHashType\n );\n\n return js || css;\n }) ||\n asyncChunks.some(chunk => {\n const js = filenameRequiresFullHash(compilation, chunk, jsChunkFilename, JavaScriptContentHashType);\n\n const css =\n chunkHasCss(compilation, chunk) &&\n filenameRequiresFullHash(compilation, chunk, cssChunkFilename, CssContentHashType);\n\n return js || css;\n })\n );\n};\n\nconst getChunkKey = (chunk: Chunk): string => {\n return `${String(chunk.name ?? \"\")}:${String(chunk.id ?? \"\")}`;\n};\n\nconst getFullMapRuntime = (\n compilation: Compilation,\n name: string,\n runtimes: ReadonlySet<Chunk>\n): FullMapRuntime | undefined => {\n const entrypoint = compilation.entrypoints.get(name);\n\n if (!entrypoint || !runtimes.has(entrypoint.getRuntimeChunk())) {\n return;\n }\n\n return {name, runtime: entrypoint.getRuntimeChunk()};\n};\n\nconst getFullMapRuntimeFiles = (fullMap: FullMapRuntime, assets: EntrypointAssetsMap): readonly string[] => {\n const runtimeFiles = new Set(Array.from(fullMap.runtime.files, toPosix));\n\n return assets[fullMap.name].initial.js.filter(file => runtimeFiles.has(file));\n};\n\nconst validateEntrypointRuntime = (compilation: Compilation, name: string): void => {\n const entrypoint = compilation.entrypoints.get(name)!;\n\n if (entrypoint.getRuntimeChunk() !== entrypoint.getEntrypointChunk()) {\n throw new Error(\n `Build assets require a self-contained runtime for entrypoint \"${name}\"; disable optimization.runtimeChunk`\n );\n }\n};\n\nconst validateFullMapEntrypoint = (compilation: Compilation, name: string): void => {\n const entrypoint = compilation.entrypoints.get(name);\n\n if (!entrypoint) {\n return;\n }\n\n const entryChunk = entrypoint.getEntrypointChunk();\n const initialChunks = Array.from(entrypoint.chunks);\n const asyncChunks = Array.from(entryChunk.getAllAsyncChunks());\n\n if (initialChunks.length !== 1 || initialChunks[0] !== entryChunk || asyncChunks.length > 0) {\n throw new Error(\n `Full build-assets entrypoint \"${name}\" must be a single self-contained chunk; async chunks are not supported`\n );\n }\n};\n\nconst validateFullMapAssets = (assets: EntrypointAssetsMap, name: string): void => {\n const entrypoint = assets[name];\n\n if (!entrypoint) {\n return;\n }\n\n if (entrypoint.initial.js.length !== 1 || entrypoint.async.js.length > 0) {\n throw new Error(\n `Full build-assets entrypoint \"${name}\" must emit exactly one initial JavaScript file and no async JavaScript files`\n );\n }\n};\n\nconst serializeFilename = (filename: unknown): string => {\n return typeof filename === \"function\" ? filename.toString() : JSON.stringify(filename);\n};\n\nconst collectRuntimeModuleFingerprints = (compilation: Compilation): RuntimeModuleFingerprints => {\n const fingerprints: RuntimeModuleFingerprints = new Map();\n\n compilation.hooks.runtimeModule.tap(PluginName, (runtimeModule, chunk) => {\n if (runtimeModule.identifier().startsWith(\"webpack/runtime/build assets \")) {\n return;\n }\n\n let chunkFingerprints = fingerprints.get(chunk);\n\n if (!chunkFingerprints) {\n chunkFingerprints = new Map();\n fingerprints.set(chunk, chunkFingerprints);\n }\n\n chunkFingerprints.set(`${runtimeModule.stage}:${runtimeModule.identifier()}`, runtimeModule.generate());\n });\n\n return fingerprints;\n};\n\nconst updateBuildAssetsChunkHashes = (\n compilation: Compilation,\n options: Required<BuildAssetsMapPluginOptions>,\n runtimeModuleFingerprints: RuntimeModuleFingerprints,\n runtimes: ReadonlySet<Chunk>\n): void => {\n compilation.hooks.chunkHash.tap(PluginName, (chunk, hash) => {\n if (!runtimes.has(chunk)) {\n return;\n }\n\n const runtimeEntry = Array.from(compilation.entrypoints).find(([, entrypoint]) => {\n return entrypoint.getRuntimeChunk() === chunk;\n });\n\n if (!runtimeEntry) {\n return;\n }\n\n const [runtimeName] = runtimeEntry;\n const fullMap = runtimeName === options.fullMapEntrypoint;\n\n const entries = fullMap\n ? Array.from(compilation.entrypoints).toSorted(([left], [right]) => left.localeCompare(right))\n : [runtimeEntry];\n\n hash.update(`${PluginName}:runtime-map:${runtimeName}`, \"utf8\");\n hash.update(options.buildHashSalt, \"utf8\");\n hash.update(serializeFilename(compilation.outputOptions.filename), \"utf8\");\n hash.update(serializeFilename(compilation.outputOptions.chunkFilename), \"utf8\");\n hash.update(serializeFilename(options.cssFilename), \"utf8\");\n hash.update(serializeFilename(options.cssChunkFilename), \"utf8\");\n\n if (fullMap) {\n hash.update(serializeFilename(compilation.outputOptions.assetModuleFilename), \"utf8\");\n }\n\n for (const [entryName, entrypoint] of entries) {\n hash.update(entryName, \"utf8\");\n\n const entryChunk = entrypoint.getEntrypointChunk();\n const initialChunks = new Set(entrypoint.chunks);\n\n const chunks = Array.from(entryChunk.getAllReferencedChunks()).toSorted((left, right) =>\n getChunkKey(left).localeCompare(getChunkKey(right))\n );\n\n for (const referencedChunk of chunks) {\n const category = initialChunks.has(referencedChunk) ? \"initial\" : \"async\";\n\n hash.update(`${category}:${getChunkKey(referencedChunk)}`, \"utf8\");\n\n const jsFilename =\n referencedChunk === entryChunk\n ? compilation.outputOptions.filename\n : compilation.outputOptions.chunkFilename;\n\n if (jsFilename) {\n const template = resolveFilenameTemplate(\n compilation,\n referencedChunk,\n jsFilename,\n JavaScriptContentHashType\n );\n\n hash.update(`javascript-template:${template}`, \"utf8\");\n }\n\n if (chunkHasCss(compilation, referencedChunk)) {\n const cssFilename = referencedChunk.canBeInitial() ? options.cssFilename : options.cssChunkFilename;\n\n const template = resolveFilenameTemplate(\n compilation,\n referencedChunk,\n cssFilename,\n CssContentHashType\n );\n\n hash.update(`css-template:${template}`, \"utf8\");\n }\n\n const moduleHashes = Array.from(\n compilation.chunkGraph.getChunkModulesIterable(referencedChunk),\n module => {\n return compilation.chunkGraph.getModuleHash(module, new Set(referencedChunk.runtime)) ?? \"\";\n }\n ).toSorted();\n\n moduleHashes.forEach(moduleHash => hash.update(moduleHash, \"utf8\"));\n\n const runtimeFingerprints = runtimeModuleFingerprints.get(referencedChunk);\n\n if (runtimeFingerprints) {\n Array.from(runtimeFingerprints)\n .toSorted(([left], [right]) => left.localeCompare(right))\n .forEach(([identifier, source]) => {\n hash.update(`runtime-module:${identifier}`, \"utf8\");\n hash.update(source, \"utf8\");\n });\n }\n }\n }\n });\n};\n\nclass BuildAssetsRuntimeModule extends RuntimeModule {\n public constructor(\n private readonly fullMap: boolean,\n private readonly runtimeName: string,\n private readonly property: string,\n private readonly cssFilename: Filename,\n private readonly cssChunkFilename: Filename,\n fullHash: boolean\n ) {\n super(`build assets ${fullMap ? \"full\" : \"current\"} ${runtimeName}`, RuntimeModule.STAGE_TRIGGER);\n\n if (!fullMap) {\n this.dependentHash = true;\n this.fullHash = fullHash;\n }\n }\n\n public generate(): string {\n const runtime = RuntimeGlobals.require;\n\n if (this.fullMap) {\n return renderBuildAssetsRuntime({\n require: runtime,\n property: this.property,\n value: FullMapPlaceholder,\n envelope: FullMapEnvelopeKey,\n full: true,\n });\n }\n\n const compilation = this.compilation;\n\n if (!compilation) {\n throw new Error(\"Build assets runtime is not attached to a compilation\");\n }\n\n const current = getEntrypointRuntimeAssets(\n compilation,\n this.runtimeName,\n this.cssFilename,\n this.cssChunkFilename\n );\n\n const envelope = JSON.stringify({[CurrentMapEnvelopeKey]: current});\n\n return renderBuildAssetsRuntime({\n require: runtime,\n property: this.property,\n value: envelope,\n envelope: CurrentMapEnvelopeKey,\n full: false,\n });\n }\n}\n\nconst replaceFullMapPlaceholder = (\n compilation: Compilation,\n runtimeFiles: readonly string[],\n assets: EntrypointAssetsMap\n): void => {\n const placeholder = JSON.stringify(FullMapPlaceholder);\n const replacementValue = JSON.stringify(JSON.stringify({[FullMapEnvelopeKey]: assets}));\n let replacements = 0;\n\n for (const file of runtimeFiles) {\n const asset = compilation.getAsset(file);\n\n if (!asset) {\n continue;\n }\n\n const code = asset.source.source().toString();\n const start = code.indexOf(placeholder);\n\n if (start < 0) {\n continue;\n }\n\n if (code.indexOf(placeholder, start + placeholder.length) >= 0) {\n throw new Error(`Build assets placeholder occurs more than once in \"${file}\"`);\n }\n\n const source = new sources.ReplaceSource(asset.source);\n\n source.replace(start, start + placeholder.length - 1, replacementValue);\n compilation.updateAsset(file, source);\n replacements += 1;\n }\n\n if (replacements !== 1) {\n throw new Error(`Expected one full build-assets runtime, found ${replacements}`);\n }\n};\n\nconst extractEmbeddedEnvelope = <T>(file: string, source: string, key: string): T => {\n const sourceFile = ts.createSourceFile(file, source, ts.ScriptTarget.Latest, false, ts.ScriptKind.JS);\n const values: T[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isStringLiteralLike(node) && node.text.includes(key)) {\n try {\n const envelope = JSON.parse(node.text) as Record<string, T>;\n\n if (Object.prototype.hasOwnProperty.call(envelope, key)) {\n values.push(envelope[key]);\n }\n } catch {}\n }\n\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n if (values.length !== 1) {\n throw new Error(`Expected one embedded build assets value in \"${file}\", found ${values.length}`);\n }\n\n return values[0];\n};\n\nconst extractEmbeddedMap = (file: string, source: string): EntrypointAssetsMap => {\n return extractEmbeddedEnvelope<EntrypointAssetsMap>(file, source, FullMapEnvelopeKey);\n};\n\nconst validateEmbeddedMap = (compilation: Compilation, fullMap: FullMapRuntime, assets: EntrypointAssetsMap): void => {\n const runtimeFiles = getFullMapRuntimeFiles(fullMap, assets);\n\n const runtime = runtimeFiles\n .map(file => ({file, source: compilation.getAsset(file)?.source.source().toString() ?? \"\"}))\n .find(({source}) => source.length > 0);\n\n if (!runtime) {\n throw new Error(\n `Full build-assets runtime for entrypoint \"${fullMap.name}\" is unavailable after asset processing`\n );\n }\n\n const embedded = extractEmbeddedMap(runtime.file, runtime.source);\n\n if (stringify(normalizeAssetsMap(embedded)) !== stringify(assets)) {\n throw new Error(\n \"Build assets changed after the runtime map was embedded; finalize entrypoint assets before processAssets begins\"\n );\n }\n};\n\nconst validateCurrentEntrypointMaps = (\n compilation: Compilation,\n assets: EntrypointAssetsMap,\n fullMapEntrypoint: string,\n runtimes: ReadonlySet<Chunk>\n): void => {\n for (const [name, entrypointAssets] of Object.entries(assets)) {\n if (name === fullMapEntrypoint) {\n continue;\n }\n\n const entrypoint = compilation.entrypoints.get(name);\n\n if (!entrypoint) {\n throw new Error(`Build assets entrypoint \"${name}\" is unavailable`);\n }\n\n if (!runtimes.has(entrypoint.getRuntimeChunk())) {\n continue;\n }\n\n const runtimeFiles = new Set(Array.from(entrypoint.getRuntimeChunk().files, toPosix));\n\n const runtime = entrypointAssets.initial.js\n .filter(file => runtimeFiles.has(file))\n .map(file => ({file, source: compilation.getAsset(file)?.source.source().toString() ?? \"\"}))\n .find(({source}) => source.length > 0);\n\n if (!runtime) {\n throw new Error(`Runtime map for entrypoint \"${name}\" is unavailable after asset processing`);\n }\n\n const runtimeAssets = extractEmbeddedEnvelope<EntrypointAssets>(\n runtime.file,\n runtime.source,\n CurrentMapEnvelopeKey\n );\n\n const finalizedAssets: EntrypointAssets = {\n initial: entrypointAssets.initial,\n async: entrypointAssets.async,\n };\n\n if (stringify(normalizeAssets(runtimeAssets)) !== stringify(finalizedAssets)) {\n throw new Error(\n `Build assets changed after the runtime map for entrypoint \"${name}\" was embedded: ${JSON.stringify({embedded: runtimeAssets, finalized: finalizedAssets})}`\n );\n }\n }\n};\n\nconst finalizeBuildAssets = (\n compilation: Compilation,\n options: Required<BuildAssetsMapPluginOptions>,\n runtimes: ReadonlySet<Chunk>\n): void => {\n const assets = collectBuildAssets(compilation);\n const fullMap = getFullMapRuntime(compilation, options.fullMapEntrypoint, runtimes);\n\n if (fullMap) {\n validateFullMapAssets(assets, options.fullMapEntrypoint);\n validateEmbeddedMap(compilation, fullMap, assets);\n }\n\n validateCurrentEntrypointMaps(compilation, assets, options.fullMapEntrypoint, runtimes);\n\n setCompilationBuildAssets(compilation, assets);\n};\n\nexport default class BuildAssetsMapPlugin {\n private readonly options: Required<BuildAssetsMapPluginOptions>;\n\n public constructor(options: BuildAssetsMapPluginOptions) {\n this.options = {\n ...options,\n buildHashSalt: options.buildHashSalt ?? \"\",\n };\n }\n\n public apply(compiler: Compiler): void {\n const runtimeSelections = new WeakMap<Compilation, ReadonlySet<Chunk>>();\n\n compiler.hooks.thisCompilation.tap({name: PluginName, stage: EmbedStage}, compilation => {\n const injectedRuntimes = new Set<Chunk>();\n runtimeSelections.set(compilation, injectedRuntimes);\n let filenamesValidated = false;\n let selectedRuntimes: Map<Chunk, RuntimeSelection> | undefined;\n const runtimeModuleFingerprints = collectRuntimeModuleFingerprints(compilation);\n const isUsed = trackModuleUsage(compiler, compilation, this.options.module);\n\n updateBuildAssetsChunkHashes(compilation, this.options, runtimeModuleFingerprints, injectedRuntimes);\n\n compilation.hooks.additionalTreeRuntimeRequirements.tap(PluginName, (chunk, requirements) => {\n if (!selectedRuntimes) {\n selectedRuntimes = new Map();\n // Select and validate in entrypoint order, independently of runtime hook order.\n for (const [name, entrypoint] of compilation.entrypoints) {\n const runtime = entrypoint.getRuntimeChunk();\n const fullMap = name === this.options.fullMapEntrypoint;\n const delivery = fullMap ? this.options.module.full : this.options.module.current;\n\n if (!isUsed(runtime, delivery.export)) {\n continue;\n }\n\n validateEntrypointRuntime(compilation, name);\n\n if (fullMap) {\n validateFullMapEntrypoint(compilation, name);\n }\n\n selectedRuntimes.set(runtime, {name, fullMap, property: delivery.property});\n }\n }\n\n if (!filenamesValidated) {\n validateAsyncChunkFilenames(compilation, this.options.cssChunkFilename);\n filenamesValidated = true;\n }\n\n const selection = selectedRuntimes.get(chunk);\n\n if (!selection || injectedRuntimes.has(chunk)) {\n return;\n }\n\n requirements.add(RuntimeGlobals.require);\n injectedRuntimes.add(chunk);\n\n compilation.addRuntimeModule(\n chunk,\n new BuildAssetsRuntimeModule(\n selection.fullMap,\n selection.name,\n selection.property,\n this.options.cssFilename,\n this.options.cssChunkFilename,\n entrypointRuntimeUsesFullHash(\n compilation,\n selection.name,\n this.options.cssFilename,\n this.options.cssChunkFilename\n )\n )\n );\n });\n\n compilation.hooks.processAssets.tap(\n {\n name: PluginName,\n stage: EmbedStage,\n },\n () => {\n const assets = collectBuildAssets(compilation);\n const fullMap = getFullMapRuntime(compilation, this.options.fullMapEntrypoint, injectedRuntimes);\n setCompilationBuildAssets(compilation, assets);\n\n if (fullMap) {\n validateFullMapAssets(assets, this.options.fullMapEntrypoint);\n replaceFullMapPlaceholder(compilation, getFullMapRuntimeFiles(fullMap, assets), assets);\n }\n }\n );\n\n compilation.hooks.processAssets.tap(\n {\n name: `${PluginName}:finalize`,\n stage: Compilation.PROCESS_ASSETS_STAGE_ANALYSE,\n },\n () => finalizeBuildAssets(compilation, this.options, injectedRuntimes)\n );\n });\n\n // Register after every afterPlugins callback, then run after ordinary emit taps but before files are written.\n compiler.hooks.afterPlugins.intercept({\n name: `${PluginName}:registerFinalValidation`,\n done: () => {\n compiler.hooks.emit.tap(\n {name: `${PluginName}:finalValidation`, stage: FinalValidationStage},\n compilation => {\n const runtimes = runtimeSelections.get(compilation);\n\n if (runtimes) {\n finalizeBuildAssets(compilation, this.options, runtimes);\n }\n }\n );\n },\n });\n }\n}\n"],"mappings":"AAAA,SAAe,aAAiC,gBAAgB,eAAe,eAAc;AAC7F,OAAO,eAAe;AACtB,OAAO,QAAQ;AAEf,SAAQ,0BAAyB;AACjC,SAAQ,iBAAiB,0BAAyB;AAClD,SAAQ,gCAA+B;AACvC,SAAQ,iCAAgC;AAExC;AA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;AAAA,MAClC,MAAM,GAAG,UAAU;AAAA,MACnB,MAAM,MAAM;AACR,iBAAS,MAAM,KAAK;AAAA,UAChB,EAAC,MAAM,GAAG,UAAU,oBAAoB,OAAO,qBAAoB;AAAA,UACnE,iBAAe;AACX,kBAAM,WAAW,kBAAkB,IAAI,WAAW;AAElD,gBAAI,UAAU;AACV,kCAAoB,aAAa,KAAK,SAAS,QAAQ;AAAA,YAC3D;AAAA,UACJ;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ,CAAC;AAAA,EACL;AACJ;","names":[]}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export { default, type BuildAssetsMapPluginOptions } from "./BuildAssetsMapPlugin.js";
|
|
2
|
-
export {
|
|
3
|
-
export type { BuildAssetsMapPluginModuleOptions, BuildAssetsMapPluginExportOptions } from "./usage.js";
|
|
2
|
+
export type { BuildAssetsMapPluginModuleOptions } from "./usage.js";
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { default as default2 } from "./BuildAssetsMapPlugin.js";
|
|
2
|
-
import { createEntrypointModule, EntrypointAssetsModule } from "./entrypoint-module.js";
|
|
3
2
|
export {
|
|
4
|
-
EntrypointAssetsModule,
|
|
5
|
-
createEntrypointModule,
|
|
6
3
|
default2 as default
|
|
7
4
|
};
|
|
8
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/build-assets-map/index.ts"],"sourcesContent":["export {default, type BuildAssetsMapPluginOptions} from \"./BuildAssetsMapPlugin\";\nexport
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/build-assets-map/index.ts"],"sourcesContent":["export {default, type BuildAssetsMapPluginOptions} from \"./BuildAssetsMapPlugin\";\nexport type {BuildAssetsMapPluginModuleOptions} from \"./usage\";\n"],"mappings":"AAAA,SAAQ,WAAAA,gBAAgD;","names":["default"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { EntrypointAssets, EntrypointAssetsMap } from "../../../../types/entrypoint.js";
|
|
2
|
+
export declare const normalizeAssets: <T extends EntrypointAssets>(assets: T) => T;
|
|
3
|
+
export declare const normalizeAssetsMap: (assets: EntrypointAssetsMap) => EntrypointAssetsMap;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const normalizeAssets = (assets) => {
|
|
2
|
+
const initial = {
|
|
3
|
+
js: [...new Set(assets.initial.js)],
|
|
4
|
+
css: [...new Set(assets.initial.css)]
|
|
5
|
+
};
|
|
6
|
+
const initialFiles = /* @__PURE__ */ new Set([...initial.js, ...initial.css]);
|
|
7
|
+
const async = {
|
|
8
|
+
js: [...new Set(assets.async.js)].filter((file) => !initialFiles.has(file)),
|
|
9
|
+
css: [...new Set(assets.async.css)].filter((file) => !initialFiles.has(file))
|
|
10
|
+
};
|
|
11
|
+
return {
|
|
12
|
+
...assets,
|
|
13
|
+
initial,
|
|
14
|
+
async
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
const normalizeAssetsMap = (assets) => {
|
|
18
|
+
return Object.fromEntries(Object.entries(assets).map(([name, entry]) => [name, normalizeAssets(entry)]));
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
normalizeAssets,
|
|
22
|
+
normalizeAssetsMap
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=normalize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/build-assets-map/normalize.ts"],"sourcesContent":["import type {EntrypointAssets, EntrypointAssetsMap} from \"@typing/entrypoint\";\n\n// realContentHash may merge different chunk filenames into one emitted file.\nexport const normalizeAssets = <T extends EntrypointAssets>(assets: T): T => {\n const initial = {\n js: [...new Set(assets.initial.js)],\n css: [...new Set(assets.initial.css)],\n };\n\n const initialFiles = new Set([...initial.js, ...initial.css]);\n\n const async = {\n js: [...new Set(assets.async.js)].filter(file => !initialFiles.has(file)),\n css: [...new Set(assets.async.css)].filter(file => !initialFiles.has(file)),\n };\n\n return {\n ...assets,\n initial,\n async,\n };\n};\n\nexport const normalizeAssetsMap = (assets: EntrypointAssetsMap): EntrypointAssetsMap => {\n return Object.fromEntries(Object.entries(assets).map(([name, entry]) => [name, normalizeAssets(entry)]));\n};\n"],"mappings":"AAGO,MAAM,kBAAkB,CAA6B,WAAiB;AACzE,QAAM,UAAU;AAAA,IACZ,IAAI,CAAC,GAAG,IAAI,IAAI,OAAO,QAAQ,EAAE,CAAC;AAAA,IAClC,KAAK,CAAC,GAAG,IAAI,IAAI,OAAO,QAAQ,GAAG,CAAC;AAAA,EACxC;AAEA,QAAM,eAAe,oBAAI,IAAI,CAAC,GAAG,QAAQ,IAAI,GAAG,QAAQ,GAAG,CAAC;AAE5D,QAAM,QAAQ;AAAA,IACV,IAAI,CAAC,GAAG,IAAI,IAAI,OAAO,MAAM,EAAE,CAAC,EAAE,OAAO,UAAQ,CAAC,aAAa,IAAI,IAAI,CAAC;AAAA,IACxE,KAAK,CAAC,GAAG,IAAI,IAAI,OAAO,MAAM,GAAG,CAAC,EAAE,OAAO,UAAQ,CAAC,aAAa,IAAI,IAAI,CAAC;AAAA,EAC9E;AAEA,SAAO;AAAA,IACH,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EACJ;AACJ;AAEO,MAAM,qBAAqB,CAAC,WAAqD;AACpF,SAAO,OAAO,YAAY,OAAO,QAAQ,MAAM,EAAE,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,gBAAgB,KAAK,CAAC,CAAC,CAAC;AAC3G;","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RuntimePropertyOptions } from "../types.js";
|
|
2
|
+
interface BuildAssetsRuntimeTemplateOptions extends RuntimePropertyOptions {
|
|
3
|
+
readonly require: string;
|
|
4
|
+
readonly value: string;
|
|
5
|
+
readonly envelope: string;
|
|
6
|
+
readonly full: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const renderBuildAssetsRuntime: (options: BuildAssetsRuntimeTemplateOptions) => string;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// raw-loader:/home/runner/work/addon-bone/addon-bone/src/cli/bundler/plugins/build-assets-map/templates/runtime.template.js?raw
|
|
2
|
+
var runtime_template_default = "var assets = JSON.parse(__ADNBN_VALUE__)[__ADNBN_ENVELOPE__];\nvar entries = __ADNBN_FULL_MAP__ ? Object.keys(assets).map(name => assets[name]) : [assets];\n\n// realContentHash can merge multiple chunk filenames into one emitted file.\n// Normalize after those substitutions, preserving the dependency order.\nentries.forEach(entry => {\n entry.initial.js = Array.from(new Set(entry.initial.js));\n entry.initial.css = Array.from(new Set(entry.initial.css));\n var initial = new Set(entry.initial.js.concat(entry.initial.css));\n entry.async.js = Array.from(new Set(entry.async.js)).filter(file => !initial.has(file));\n entry.async.css = Array.from(new Set(entry.async.css)).filter(file => !initial.has(file));\n});\n\n__ADNBN_REQUIRE__[__ADNBN_PROPERTY__] = assets;\n";
|
|
3
|
+
|
|
4
|
+
// src/cli/bundler/plugins/utils/runtime-template.ts
|
|
5
|
+
var PlaceholderPattern = /__ADNBN_[A-Z0-9_]+__/g;
|
|
6
|
+
var renderRuntimeTemplate = (template, values) => {
|
|
7
|
+
for (const placeholder of Object.keys(values)) {
|
|
8
|
+
if (!template.includes(placeholder)) {
|
|
9
|
+
throw new Error(`Runtime template placeholder "${placeholder}" is unavailable`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return template.replace(PlaceholderPattern, (placeholder) => {
|
|
13
|
+
if (!Object.hasOwn(values, placeholder)) {
|
|
14
|
+
throw new Error(`Runtime template placeholder "${placeholder}" was not replaced`);
|
|
15
|
+
}
|
|
16
|
+
return values[placeholder];
|
|
17
|
+
}).trim();
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// src/cli/bundler/plugins/build-assets-map/templates.ts
|
|
21
|
+
var renderBuildAssetsRuntime = (options) => {
|
|
22
|
+
return renderRuntimeTemplate(runtime_template_default, {
|
|
23
|
+
__ADNBN_REQUIRE__: options.require,
|
|
24
|
+
__ADNBN_PROPERTY__: JSON.stringify(options.property),
|
|
25
|
+
__ADNBN_VALUE__: JSON.stringify(options.value),
|
|
26
|
+
__ADNBN_ENVELOPE__: JSON.stringify(options.envelope),
|
|
27
|
+
__ADNBN_FULL_MAP__: JSON.stringify(options.full)
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
renderBuildAssetsRuntime
|
|
32
|
+
};
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import type { Chunk, Compilation, Compiler } from "@rspack/core";
|
|
2
|
-
import type {
|
|
3
|
-
export interface BuildAssetsMapPluginExportOptions extends RuntimePropertyOptions {
|
|
4
|
-
readonly export: string;
|
|
5
|
-
}
|
|
2
|
+
import type { RuntimeModuleReaderOptions } from "../types.js";
|
|
6
3
|
export interface BuildAssetsMapPluginModuleOptions {
|
|
7
4
|
readonly request: string;
|
|
8
|
-
readonly current:
|
|
9
|
-
readonly full:
|
|
5
|
+
readonly current: RuntimeModuleReaderOptions;
|
|
6
|
+
readonly full: RuntimeModuleReaderOptions;
|
|
10
7
|
}
|
|
11
8
|
/** Retain every layer's module before concatenation, then inspect export use per runtime. */
|
|
12
9
|
export declare const trackModuleUsage: (compiler: Compiler, compilation: Compilation, options: BuildAssetsMapPluginModuleOptions) => ((chunk: Chunk, name: string) => boolean);
|
|
@@ -5,10 +5,13 @@ const trackModuleUsage = (compiler, compilation, options) => {
|
|
|
5
5
|
const resolver = compiler.resolverFactory.get("normal", { dependencyType: "esm" });
|
|
6
6
|
resource = await new Promise((resolve, reject) => {
|
|
7
7
|
resolver.resolve({}, compiler.context, options.request, {}, (error, result) => {
|
|
8
|
-
if (error)
|
|
9
|
-
|
|
8
|
+
if (error) {
|
|
9
|
+
reject(error);
|
|
10
|
+
} else if (typeof result !== "string") {
|
|
10
11
|
reject(new Error(`Unable to resolve assets module "${options.request}"`));
|
|
11
|
-
else
|
|
12
|
+
} else {
|
|
13
|
+
resolve(result);
|
|
14
|
+
}
|
|
12
15
|
});
|
|
13
16
|
});
|
|
14
17
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/build-assets-map/usage.ts"],"sourcesContent":["import type {Chunk, Compilation, Compiler, NormalModule} from \"@rspack/core\";\n\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/build-assets-map/usage.ts"],"sourcesContent":["import type {Chunk, Compilation, Compiler, NormalModule} from \"@rspack/core\";\n\nimport type {RuntimeModuleReaderOptions} from \"../types\";\n\nexport interface BuildAssetsMapPluginModuleOptions {\n readonly request: string;\n readonly current: RuntimeModuleReaderOptions;\n readonly full: RuntimeModuleReaderOptions;\n}\n\n/** Retain every layer's module before concatenation, then inspect export use per runtime. */\nexport const trackModuleUsage = (\n compiler: Compiler,\n compilation: Compilation,\n options: BuildAssetsMapPluginModuleOptions\n): ((chunk: Chunk, name: string) => boolean) => {\n let resource: string | undefined;\n let modules: NormalModule[] = [];\n\n compilation.hooks.finishModules.tapPromise(\"BuildAssetsMapPlugin:resolve\", async () => {\n const resolver = compiler.resolverFactory.get(\"normal\", {dependencyType: \"esm\"});\n\n resource = await new Promise<string>((resolve, reject) => {\n resolver.resolve({}, compiler.context, options.request, {}, (error, result) => {\n if (error) {\n reject(error);\n } else if (typeof result !== \"string\") {\n reject(new Error(`Unable to resolve assets module \"${options.request}\"`));\n } else {\n resolve(result);\n }\n });\n });\n });\n\n compilation.hooks.afterOptimizeModules.tap(\"BuildAssetsMapPlugin:usage\", candidates => {\n modules = Array.from(candidates).filter(\n module => (module as NormalModule).resource === resource\n ) as NormalModule[];\n });\n\n return (chunk, name) => {\n const runtime = new Set(chunk.runtime);\n\n return modules.some(module => compilation.moduleGraph.getExportsInfo(module).getUsed(name, runtime) !== 0);\n };\n};\n"],"mappings":"AAWO,MAAM,mBAAmB,CAC5B,UACA,aACA,YAC4C;AAC5C,MAAI;AACJ,MAAI,UAA0B,CAAC;AAE/B,cAAY,MAAM,cAAc,WAAW,gCAAgC,YAAY;AACnF,UAAM,WAAW,SAAS,gBAAgB,IAAI,UAAU,EAAC,gBAAgB,MAAK,CAAC;AAE/E,eAAW,MAAM,IAAI,QAAgB,CAAC,SAAS,WAAW;AACtD,eAAS,QAAQ,CAAC,GAAG,SAAS,SAAS,QAAQ,SAAS,CAAC,GAAG,CAAC,OAAO,WAAW;AAC3E,YAAI,OAAO;AACP,iBAAO,KAAK;AAAA,QAChB,WAAW,OAAO,WAAW,UAAU;AACnC,iBAAO,IAAI,MAAM,oCAAoC,QAAQ,OAAO,GAAG,CAAC;AAAA,QAC5E,OAAO;AACH,kBAAQ,MAAM;AAAA,QAClB;AAAA,MACJ,CAAC;AAAA,IACL,CAAC;AAAA,EACL,CAAC;AAED,cAAY,MAAM,qBAAqB,IAAI,8BAA8B,gBAAc;AACnF,cAAU,MAAM,KAAK,UAAU,EAAE;AAAA,MAC7B,YAAW,OAAwB,aAAa;AAAA,IACpD;AAAA,EACJ,CAAC;AAED,SAAO,CAAC,OAAO,SAAS;AACpB,UAAM,UAAU,IAAI,IAAI,MAAM,OAAO;AAErC,WAAO,QAAQ,KAAK,YAAU,YAAY,YAAY,eAAe,MAAM,EAAE,QAAQ,MAAM,OAAO,MAAM,CAAC;AAAA,EAC7G;AACJ;","names":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _ from "lodash";
|
|
2
2
|
import path from "path";
|
|
3
|
+
import { DynamicEntryPlugin } from "@rspack/core";
|
|
3
4
|
import { RspackVirtualModulePlugin as VirtualModulesPlugin } from "rspack-plugin-virtual-module";
|
|
4
5
|
class EntrypointPlugin {
|
|
5
6
|
constructor(entries = /* @__PURE__ */ new Map()) {
|
|
@@ -55,6 +56,16 @@ class EntrypointPlugin {
|
|
|
55
56
|
this.hookEntryOption(entry);
|
|
56
57
|
});
|
|
57
58
|
if (this.update) {
|
|
59
|
+
compiler.hooks.afterEnvironment.tap(this.pluginName, () => {
|
|
60
|
+
compiler.hooks.entryOption.tap(`${this.pluginName}:watch`, (context, entry) => {
|
|
61
|
+
compiler.options.entry = entry;
|
|
62
|
+
new DynamicEntryPlugin(context, async () => {
|
|
63
|
+
const entry2 = compiler.options.entry;
|
|
64
|
+
return typeof entry2 === "function" ? entry2() : entry2;
|
|
65
|
+
}).apply(compiler);
|
|
66
|
+
return true;
|
|
67
|
+
});
|
|
68
|
+
});
|
|
58
69
|
compiler.hooks.watchRun.tapAsync(this.pluginName, (compiler2, callback) => {
|
|
59
70
|
this.hookWatchRun(compiler2).then(() => callback()).catch(callback);
|
|
60
71
|
});
|