adnbn 0.11.0 → 0.12.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/{utils/layers.d.ts → layers.d.ts} +2 -1
- package/dist/cli/bundler/{utils/layers.js → layers.js} +2 -0
- package/dist/cli/bundler/layers.js.map +1 -0
- package/dist/cli/bundler/plugins/build-assets-map/BuildAssetsMapPlugin.js +2 -1
- 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/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/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.js +1 -1
- package/dist/cli/bundler/plugins/isolated-styles/IsolatedStylesPlugin.js.map +1 -1
- package/dist/cli/bundler/plugins/isolated-styles/chunks.d.ts +3 -0
- package/dist/cli/bundler/{utils/styles.js → plugins/isolated-styles/chunks.js} +8 -6
- package/dist/cli/bundler/plugins/isolated-styles/chunks.js.map +1 -0
- 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 -1
- package/dist/cli/plugins/content/bundler.js +1 -1
- package/dist/cli/plugins/content/index.js +2 -2
- 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/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.js +1 -1
- package/dist/cli/plugins/style/index.js.map +1 -1
- package/dist/cli/resolvers/config.js +1 -1
- 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 +5 -6
- package/dist/entry/content/adapters/react/Builder.js +8 -21
- 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 +9 -33
- package/dist/entry/content/adapters/react/Node.js.map +1 -1
- 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/react/resolvers/definition.d.ts +2 -0
- package/dist/entry/content/adapters/react/resolvers/definition.js +12 -0
- package/dist/entry/content/adapters/react/resolvers/definition.js.map +1 -0
- package/dist/entry/content/adapters/react/resolvers/render.d.ts +2 -2
- package/dist/entry/content/adapters/react/resolvers/render.js +4 -6
- package/dist/entry/content/adapters/react/resolvers/render.js.map +1 -1
- package/dist/entry/content/adapters/vanilla/Builder.d.ts +5 -5
- package/dist/entry/content/adapters/vanilla/Builder.js +9 -15
- 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/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/resolvers/definition.d.ts +2 -0
- package/dist/entry/content/adapters/vanilla/resolvers/definition.js +9 -0
- package/dist/entry/content/adapters/vanilla/resolvers/definition.js.map +1 -0
- package/dist/entry/content/adapters/vanilla/resolvers/render.d.ts +3 -0
- package/dist/entry/content/adapters/vanilla/resolvers/render.js +15 -0
- package/dist/entry/content/adapters/vanilla/resolvers/render.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 +26 -0
- package/dist/entry/content/lifecycle/Builder.js +212 -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 +8 -0
- package/dist/entry/content/lifecycle/MountBuilder.js +57 -0
- package/dist/entry/content/lifecycle/MountBuilder.js.map +1 -0
- package/dist/entry/content/{core → lifecycle}/context/Context.d.ts +4 -2
- package/dist/entry/content/lifecycle/context/Context.js +73 -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 +5 -0
- package/dist/entry/content/{core → lifecycle}/context/ManagedContext.js +2 -2
- package/dist/entry/content/lifecycle/context/ManagedContext.js.map +1 -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 +2 -2
- 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/{core → lifecycle}/nodes/EventNode.d.ts +4 -2
- package/dist/entry/content/{core → lifecycle}/nodes/EventNode.js +11 -2
- package/dist/entry/content/lifecycle/nodes/EventNode.js.map +1 -0
- package/dist/entry/content/{core → lifecycle}/nodes/FrameNode.d.ts +11 -5
- package/dist/entry/content/lifecycle/nodes/FrameNode.js +187 -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/{core → lifecycle}/nodes/MountNode.d.ts +3 -2
- package/dist/entry/content/{core → lifecycle}/nodes/MountNode.js +5 -2
- 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 +19 -0
- package/dist/entry/content/lifecycle/nodes/RenderNode.js +75 -0
- package/dist/entry/content/lifecycle/nodes/RenderNode.js.map +1 -0
- package/dist/entry/content/lifecycle/nodes/ShadowNode.d.ts +21 -0
- package/dist/entry/content/lifecycle/nodes/ShadowNode.js +121 -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/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/{core/resolvers → resolvers}/watch.js +14 -10
- 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/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} +24 -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 +61 -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/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 -23
- 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/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.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.map +0 -1
- package/dist/cli/plugins/output.d.ts +0 -2
- package/dist/cli/plugins/output.js.map +0 -1
- 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/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.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.map +0 -1
- 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.js.map +0 -1
- 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.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.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}/context/index.d.ts +0 -0
- /package/dist/entry/content/{core → lifecycle}/context/index.js +0 -0
- /package/dist/entry/content/{core → lifecycle}/markers/index.d.ts +0 -0
- /package/dist/entry/content/{core → lifecycle}/markers/index.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/types/content/index.ts"],"sourcesContent":["export * from \"./common\";\n\nexport type * from \"./definition\";\nexport type * from \"./render\";\n\nexport type * from \"./adapters\";\nexport type * from \"./prepare\";\nexport type * from \"./boundary\";\nexport type * from \"./target\";\n"],"mappings":"AAAA,cAAc;","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Awaiter } from "../helpers.js";
|
|
2
|
+
import type { ContentScriptEntrypointOptions } from "./common.js";
|
|
3
|
+
/** Per-anchor input available before a container or render target exists. */
|
|
4
|
+
export interface ContentScriptPrepareProps extends ContentScriptEntrypointOptions {
|
|
5
|
+
anchor: Element;
|
|
6
|
+
}
|
|
7
|
+
/** False tracks the anchor without creating UI. Other results become render props.data. */
|
|
8
|
+
export type ContentScriptPrepareResult<Data> = Data | false;
|
|
9
|
+
export type ContentScriptPrepareHandler<Data = unknown> = (props: ContentScriptPrepareProps) => Awaiter<ContentScriptPrepareResult<Data>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=prepare.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ContentScriptIsolation, ContentScriptProps } from "./common.js";
|
|
2
|
+
import type { ContentScriptVanillaRenderValue, ContentScriptReactRenderValue } from "./adapters/index.js";
|
|
3
|
+
/** All supported render values; the entrypoint's filename selects the runtime adapter. */
|
|
4
|
+
export type ContentScriptRenderValue<Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> = ContentScriptVanillaRenderValue | ContentScriptReactRenderValue<Data, Isolation>;
|
|
5
|
+
/** Synchronous rendering into prepared DOM. Await data and decide whether to render in prepare. */
|
|
6
|
+
export type ContentScriptRenderHandler<Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> = (props: ContentScriptProps<Data, Isolation>) => ContentScriptRenderValue<Data, Isolation>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ContentScriptContainerOptions, ContentScriptContainerTag, ContentScriptIsolation } from "./common.js";
|
|
2
|
+
import type { ContentScriptBoundaryProps } from "./boundary.js";
|
|
3
|
+
export type ContentScriptTargetTag = ContentScriptContainerTag;
|
|
4
|
+
export type ContentScriptTargetOptions = ContentScriptContainerOptions;
|
|
5
|
+
/** Available after isolation exists, before the target is created or rendering starts. */
|
|
6
|
+
export interface ContentScriptTargetProps<Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> extends ContentScriptBoundaryProps<Data, Isolation> {
|
|
7
|
+
/** Create elements in this document, including for an iframe's child document. */
|
|
8
|
+
document: Document;
|
|
9
|
+
}
|
|
10
|
+
export type ContentScriptTargetFactory<Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> = (props: ContentScriptTargetProps<Data, Isolation>) => Element | ContentScriptTargetTag | ContentScriptTargetOptions;
|
|
11
|
+
export type ContentScriptTarget<Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> = ContentScriptTargetTag | ContentScriptTargetOptions | ContentScriptTargetFactory<Data, Isolation>;
|
|
12
|
+
/** Synchronous DOM creation; asynchronous work belongs in prepare. */
|
|
13
|
+
export type ContentScriptTargetCreator<Data = unknown> = (props: ContentScriptTargetProps<Data>) => Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/types/manifest.d.ts
CHANGED
package/dist/types/relay.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EntrypointOptions } from "./entrypoint.js";
|
|
2
|
-
import { ContentScriptConfig, ContentScriptContext,
|
|
2
|
+
import { ContentScriptConfig, ContentScriptContext, ContentScriptDefinitionBase, ContentScriptRenderDefinition, ContentScriptEntrypointOptions, ContentScriptIsolation } from "./content/index.js";
|
|
3
3
|
import { TransportConfig, TransportDefinition, TransportType, type TransportProxyTarget, type TransportTarget } from "./transport.js";
|
|
4
4
|
import { Awaiter } from "./helpers.js";
|
|
5
5
|
import type { MessageError } from "./message.js";
|
|
@@ -147,10 +147,9 @@ export type RelayOptions = RelayConfig & EntrypointOptions;
|
|
|
147
147
|
export type RelayOptionsMap = Map<string, RelayOptions>;
|
|
148
148
|
export type RelayEntrypointOptions = Partial<RelayOptions> & Pick<ContentScriptEntrypointOptions, "isolation">;
|
|
149
149
|
export type RelayMainHandler<T extends TransportType> = (relay: T, context: ContentScriptContext, options: RelayEntrypointOptions) => Awaiter<void>;
|
|
150
|
-
type
|
|
151
|
-
export type RelayDefinition<T extends TransportType> = Omit<TransportDefinition<RelayOptions, T>, "main"> & RelayContentDefinition & Partial<RelayOptions> & {
|
|
150
|
+
export type RelayDefinition<T extends TransportType, Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> = Omit<TransportDefinition<RelayOptions, T>, "main"> & Omit<ContentScriptDefinitionBase<Data>, "main" | "allFrames"> & ContentScriptRenderDefinition<Data, Isolation> & Partial<RelayOptions> & {
|
|
152
151
|
main?: RelayMainHandler<T>;
|
|
153
152
|
};
|
|
154
153
|
/** Internal, merged runtime input. The public definition retains its discriminated union. */
|
|
155
|
-
export type RelayUnresolvedDefinition<T extends TransportType
|
|
154
|
+
export type RelayUnresolvedDefinition<T extends TransportType, Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> = Partial<Omit<RelayDefinition<T, Data, Isolation>, never>>;
|
|
156
155
|
export {};
|
package/dist/types/relay.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/relay.ts"],"sourcesContent":["import {EntrypointOptions} from \"@typing/entrypoint\";\nimport {\n ContentScriptConfig,\n ContentScriptContext,\n
|
|
1
|
+
{"version":3,"sources":["../../src/types/relay.ts"],"sourcesContent":["import {EntrypointOptions} from \"@typing/entrypoint\";\n\nimport {\n ContentScriptConfig,\n ContentScriptContext,\n ContentScriptDefinitionBase,\n ContentScriptRenderDefinition,\n ContentScriptEntrypointOptions,\n ContentScriptIsolation,\n} from \"@typing/content\";\n\nimport {\n TransportConfig,\n TransportDefinition,\n TransportType,\n type TransportProxyTarget,\n type TransportTarget,\n} from \"@typing/transport\";\n\nimport {Awaiter} from \"@typing/helpers\";\nimport type {MessageError} from \"@typing/message\";\n\nexport const RelayGlobalKey = \"adnbnRelay\";\n\nexport enum RelayMethod {\n Scripting = \"scripting\",\n Messaging = \"messaging\",\n}\n\nexport enum RelayAllFrames {\n /**\n * Executes the method in every frame reached by the selected transport and returns one outcome:\n * Scripting prefers a fulfilled result, while Messaging returns the first response.\n *\n * Warning: mutating methods can execute in multiple frames even though only one outcome is returned.\n */\n Any = \"any\",\n\n /** Executes the method in every discovered frame and returns an outcome for each frame. */\n All = \"all\",\n}\n\nexport enum RelayFrameErrorKind {\n Remote = \"remote\",\n Execution = \"execution\",\n Delivery = \"delivery\",\n Timeout = \"timeout\",\n TargetGone = \"target-gone\",\n Unobservable = \"unobservable\",\n}\n\n/**\n * Empty because relay names and contracts belong to the consuming application.\n * Generated `.adnbn/relay.d.ts` declarations populate it by augmenting `adnbn/relay`.\n */\nexport interface RelayRegistry {}\n\nexport type RelayName = Extract<keyof RelayRegistry, string>;\n\nexport type RelayNonEmptyReadonlyArray<T> = readonly [T, ...T[]];\n\nexport interface RelayExecutionOptions {\n /** Maximum execution time per addressed Messaging frame or for the Inject Script operation. */\n timeoutMs?: number;\n}\n\ninterface RelayTargetBase extends RelayExecutionOptions {\n tabId: number;\n}\n\nexport interface RelayTopFrameOptions extends RelayTargetBase {\n allFrames?: false;\n frameId?: never;\n frameIds?: never;\n documentId?: never;\n documentIds?: never;\n}\n\nexport interface RelayFrameOptions extends RelayTargetBase {\n frameId: number;\n allFrames?: never;\n frameIds?: never;\n documentId?: never;\n documentIds?: never;\n}\n\nexport interface RelayFramesOptions extends RelayTargetBase {\n frameIds: RelayNonEmptyReadonlyArray<number>;\n allFrames?: never;\n frameId?: never;\n documentId?: never;\n documentIds?: never;\n}\n\nexport interface RelayDocumentOptions extends RelayTargetBase {\n documentId: string;\n allFrames?: never;\n frameId?: never;\n frameIds?: never;\n documentIds?: never;\n}\n\nexport interface RelayDocumentsOptions extends RelayTargetBase {\n documentIds: RelayNonEmptyReadonlyArray<string>;\n allFrames?: never;\n frameId?: never;\n frameIds?: never;\n documentId?: never;\n}\n\n/**\n * Broadcasts the call to all frames without requiring an exhaustive frame list and returns one outcome.\n * `true` is an alias for `RelayAllFrames.Any`.\n *\n * Warning: mutating methods can execute in multiple frames even though only one outcome is returned.\n */\nexport interface RelayAnyFramesOptions extends RelayTargetBase {\n allFrames: true | RelayAllFrames.Any;\n frameId?: never;\n frameIds?: never;\n documentId?: never;\n documentIds?: never;\n}\n\nexport interface RelayEveryFrameOptions extends RelayTargetBase {\n allFrames: RelayAllFrames.All;\n frameId?: never;\n frameIds?: never;\n documentId?: never;\n documentIds?: never;\n}\n\nexport type RelayAllFramesOptions = RelayAnyFramesOptions | RelayEveryFrameOptions;\n\nexport type RelayScalarOptions = RelayTopFrameOptions | RelayFrameOptions | RelayDocumentOptions;\n\nexport type RelayBatchOptions = RelayFramesOptions | RelayDocumentsOptions | RelayAllFramesOptions;\n\nexport type RelayCallOptions = RelayScalarOptions | RelayBatchOptions;\n\nexport type RelayAddressTarget =\n | {\n tabId: number;\n frameId: number;\n documentId?: string;\n allFrames?: never;\n }\n | {\n tabId: number;\n frameId?: never;\n documentId: string;\n allFrames?: never;\n };\n\nexport type RelayOperationTarget = {\n tabId: number;\n allFrames: RelayAllFrames;\n frameId?: never;\n documentId?: never;\n};\n\nexport type RelayResultTarget = RelayAddressTarget | RelayOperationTarget;\n\nexport interface RelayFrameError extends MessageError {\n kind: RelayFrameErrorKind;\n}\n\nexport type RelayFrameResult<T> =\n | {\n target: RelayResultTarget;\n status: \"fulfilled\";\n result: T;\n }\n | {\n target: RelayResultTarget;\n status: \"rejected\";\n error: RelayFrameError;\n };\n\nexport type RelayFramesResult<T> = readonly RelayFrameResult<T>[];\n\nexport type RelayBatchRpcProxy<T> = {\n [K in keyof T]: T[K] extends (...args: any[]) => any\n ? (...args: Parameters<T[K]>) => Promise<RelayFramesResult<Awaited<ReturnType<T[K]>>>>\n : T[K] extends object\n ? RelayBatchRpcProxyObject<T[K]>\n : () => Promise<RelayFramesResult<Awaited<T[K]>>>;\n};\n\nexport type RelayBatchRpcProxyObject<T> = (() => Promise<RelayFramesResult<Awaited<T>>>) & RelayBatchRpcProxy<T>;\n\nexport type RelayTarget<N extends keyof RelayRegistry> = TransportTarget<RelayRegistry, N>;\n\nexport type RelayProxyTarget<N extends keyof RelayRegistry> = TransportProxyTarget<RelayRegistry, N>;\n\nexport type RelayBatchProxyTarget<N extends keyof RelayRegistry> = RelayBatchRpcProxy<RelayRegistry[N]>;\n\nexport interface RelayConfig extends TransportConfig, Omit<ContentScriptConfig, \"allFrames\"> {\n allFrames?: boolean | RelayAllFrames;\n method?: RelayMethod;\n}\n\nexport type RelayOptions = RelayConfig & EntrypointOptions;\n\nexport type RelayOptionsMap = Map<string, RelayOptions>;\n\nexport type RelayEntrypointOptions = Partial<RelayOptions> & Pick<ContentScriptEntrypointOptions, \"isolation\">;\n\nexport type RelayMainHandler<T extends TransportType> = (\n relay: T,\n context: ContentScriptContext,\n options: RelayEntrypointOptions\n) => Awaiter<void>;\n\nexport type RelayDefinition<\n T extends TransportType,\n Data = unknown,\n Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`,\n> = Omit<TransportDefinition<RelayOptions, T>, \"main\"> &\n Omit<ContentScriptDefinitionBase<Data>, \"main\" | \"allFrames\"> &\n ContentScriptRenderDefinition<Data, Isolation> &\n Partial<RelayOptions> & {\n main?: RelayMainHandler<T>;\n };\n\n/** Internal, merged runtime input. The public definition retains its discriminated union. */\nexport type RelayUnresolvedDefinition<\n T extends TransportType,\n Data = unknown,\n Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`,\n> = Partial<Omit<RelayDefinition<T, Data, Isolation>, never>>;\n"],"mappings":"AAsBO,MAAM,iBAAiB;AAEvB,IAAK,cAAL,kBAAKA,iBAAL;AACH,EAAAA,aAAA,eAAY;AACZ,EAAAA,aAAA,eAAY;AAFJ,SAAAA;AAAA,GAAA;AAKL,IAAK,iBAAL,kBAAKC,oBAAL;AAOH,EAAAA,gBAAA,SAAM;AAGN,EAAAA,gBAAA,SAAM;AAVE,SAAAA;AAAA,GAAA;AAaL,IAAK,sBAAL,kBAAKC,yBAAL;AACH,EAAAA,qBAAA,YAAS;AACT,EAAAA,qBAAA,eAAY;AACZ,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,aAAU;AACV,EAAAA,qBAAA,gBAAa;AACb,EAAAA,qBAAA,kBAAe;AANP,SAAAA;AAAA,GAAA;","names":["RelayMethod","RelayAllFrames","RelayFrameErrorKind"]}
|
|
@@ -10,9 +10,10 @@ declare module "#adnbn/page" {
|
|
|
10
10
|
export const aliases: typeof import("./page.js").aliases;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
declare module "#adnbn/
|
|
14
|
-
export const readAssets: typeof import("./
|
|
15
|
-
export const readAssetsMap: typeof import("./
|
|
13
|
+
declare module "#adnbn/runtime" {
|
|
14
|
+
export const readAssets: typeof import("./runtime.js").readAssets;
|
|
15
|
+
export const readAssetsMap: typeof import("./runtime.js").readAssetsMap;
|
|
16
|
+
export const readContentStyles: typeof import("./runtime.js").readContentStyles;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
declare module "#adnbn/relay" {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { EntrypointAssets, EntrypointAssetsMap } from "../types/entrypoint.js";
|
|
2
|
+
import type { ContentScriptStylesRuntime } from "../types/content/index.js";
|
|
2
3
|
/** Package fallback; extension builds provide access to their own bundler runtime. */
|
|
3
4
|
export declare const readAssets: () => EntrypointAssets | undefined;
|
|
4
5
|
/** Package fallback; the complete map is supplied only by a consuming background runtime. */
|
|
5
6
|
export declare const readAssetsMap: () => EntrypointAssetsMap | undefined;
|
|
7
|
+
/** Package fallback; isolated content builds supply their own styles runtime. */
|
|
8
|
+
export declare const readContentStyles: () => ContentScriptStylesRuntime | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/virtual/runtime.ts"],"sourcesContent":["import type {EntrypointAssets, EntrypointAssetsMap} from \"@typing/entrypoint\";\nimport type {ContentScriptStylesRuntime} from \"@typing/content\";\n\n/** Package fallback; extension builds provide access to their own bundler runtime. */\nexport const readAssets = (): EntrypointAssets | undefined => undefined;\n\n/** Package fallback; the complete map is supplied only by a consuming background runtime. */\nexport const readAssetsMap = (): EntrypointAssetsMap | undefined => undefined;\n\n/** Package fallback; isolated content builds supply their own styles runtime. */\nexport const readContentStyles = (): ContentScriptStylesRuntime | undefined => undefined;\n"],"mappings":"AAIO,MAAM,aAAa,MAAoC;AAGvD,MAAM,gBAAgB,MAAuC;AAG7D,MAAM,oBAAoB,MAA8C;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adnbn",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.12.0",
|
|
5
5
|
"description": "Addon Bone - Cross-browser web extension framework with shared code base",
|
|
6
6
|
"homepage": "https://addonbone.com",
|
|
7
7
|
"author": "Anjey Tsibylskij (https://github.com/atldays)",
|
|
@@ -55,10 +55,6 @@
|
|
|
55
55
|
"types": "./dist/entry/*/index.d.ts",
|
|
56
56
|
"default": "./dist/entry/*/index.js"
|
|
57
57
|
},
|
|
58
|
-
"./entry/content/frame": {
|
|
59
|
-
"types": "./dist/entry/content/frame/index.d.ts",
|
|
60
|
-
"default": "./dist/entry/content/frame/index.js"
|
|
61
|
-
},
|
|
62
58
|
"./entry/content/*": {
|
|
63
59
|
"types": "./dist/entry/content/adapters/*/index.d.ts",
|
|
64
60
|
"default": "./dist/entry/content/adapters/*/index.js"
|
|
@@ -67,6 +63,10 @@
|
|
|
67
63
|
"types": "./dist/entry/view/adapters/*/index.d.ts",
|
|
68
64
|
"default": "./dist/entry/view/adapters/*/index.js"
|
|
69
65
|
},
|
|
66
|
+
"./content": {
|
|
67
|
+
"types": "./dist/content/index.d.ts",
|
|
68
|
+
"default": "./dist/content/index.js"
|
|
69
|
+
},
|
|
70
70
|
"./locale": {
|
|
71
71
|
"types": "./dist/locale/index.d.ts",
|
|
72
72
|
"default": "./dist/locale/index.js"
|
|
@@ -116,26 +116,32 @@
|
|
|
116
116
|
"format": "prettier --write .",
|
|
117
117
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
118
118
|
"prepare:integration": "npm run build && tsx tests/integration/prepare.ts",
|
|
119
|
-
"typecheck:integration": "npm run
|
|
120
|
-
"test:integration": "npm run test --
|
|
121
|
-
"test:integration:build": "npm run test
|
|
119
|
+
"typecheck:integration": "npm run build && tsx tests/integration/typecheck.ts --prepare",
|
|
120
|
+
"test:integration": "npm run build && node scripts/test-run.mjs --selectProjects build types chrome firefox",
|
|
121
|
+
"test:integration:build": "npm run test:build --",
|
|
122
122
|
"check:node-version": "node ./scripts/check-node-version.js",
|
|
123
|
-
"test": "npm run build &&
|
|
124
|
-
"test:ci": "npm run test -- --ci --
|
|
125
|
-
"test:ci:non-browser": "npm run test -- --ci --
|
|
126
|
-
"test:watch": "
|
|
127
|
-
"test:offscreen": "
|
|
128
|
-
"test:chrome": "npm run
|
|
129
|
-
"test:firefox": "npm run test --
|
|
130
|
-
"test:message": "
|
|
131
|
-
"test:service": "
|
|
132
|
-
"test:relay": "
|
|
133
|
-
"test:locale": "
|
|
134
|
-
"test:manifest": "
|
|
135
|
-
"test:entrypoint": "
|
|
136
|
-
"test:plugins": "
|
|
123
|
+
"test": "npm run build && node scripts/test-run.mjs",
|
|
124
|
+
"test:ci": "npm run test -- --ci --coverage",
|
|
125
|
+
"test:ci:non-browser": "npm run test -- --ci --coverage --selectProjects unit-node unit-dom build types",
|
|
126
|
+
"test:watch": "node scripts/test-run.mjs --selectProjects unit-node unit-dom --watch",
|
|
127
|
+
"test:offscreen": "node scripts/test-run.mjs --testPathPatterns=Offscreen",
|
|
128
|
+
"test:chrome": "npm run build && node scripts/test-run.mjs --selectProjects chrome",
|
|
129
|
+
"test:firefox": "npm run build && node scripts/test-run.mjs --selectProjects firefox",
|
|
130
|
+
"test:message": "node scripts/test-run.mjs --testPathPatterns=src/message",
|
|
131
|
+
"test:service": "node scripts/test-run.mjs --testPathPatterns=Service",
|
|
132
|
+
"test:relay": "npm run test -- --testPathPatterns=Relay",
|
|
133
|
+
"test:locale": "npm run test -- --testPathPatterns=Locale",
|
|
134
|
+
"test:manifest": "node scripts/test-run.mjs --testPathPatterns=src/cli/builders/manifest",
|
|
135
|
+
"test:entrypoint": "node scripts/test-run.mjs --testPathPatterns=src/cli/entrypoint",
|
|
136
|
+
"test:plugins": "npm run test -- --testPathPatterns=src/cli/plugins",
|
|
137
137
|
"release": "release-it",
|
|
138
|
-
"release:preview": "release-it --no-github.release --no-npm.publish --no-git.tag --ci"
|
|
138
|
+
"release:preview": "release-it --no-github.release --no-npm.publish --no-git.tag --ci",
|
|
139
|
+
"test:unit": "node scripts/test-run.mjs --selectProjects unit-node unit-dom --verbose=false",
|
|
140
|
+
"test:build": "npm run build && node scripts/test-run.mjs --selectProjects build",
|
|
141
|
+
"test:types": "npm run typecheck:integration && node scripts/test-run.mjs --selectProjects types",
|
|
142
|
+
"test:inventory": "node scripts/test-inventory.mjs",
|
|
143
|
+
"test:pre-push": "tsx tests/pre-push.ts",
|
|
144
|
+
"test:run": "node scripts/test-run.mjs"
|
|
139
145
|
},
|
|
140
146
|
"dependencies": {
|
|
141
147
|
"@addon-core/browser": "^0.7.2",
|
|
@@ -203,6 +209,9 @@
|
|
|
203
209
|
"glob": "^13.0.1",
|
|
204
210
|
"globby": "^14.1.0",
|
|
205
211
|
"husky": "^9.1.7",
|
|
212
|
+
"istanbul-lib-coverage": "^3.2.2",
|
|
213
|
+
"istanbul-lib-report": "^3.0.1",
|
|
214
|
+
"istanbul-reports": "^3.2.0",
|
|
206
215
|
"jest": "^30.2.0",
|
|
207
216
|
"jest-environment-jsdom": "^30.0.0",
|
|
208
217
|
"jest-webextension-mock": "^4.0.0",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {readFile} from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import coverage from "istanbul-lib-coverage";
|
|
4
|
+
import report from "istanbul-lib-report";
|
|
5
|
+
import reports from "istanbul-reports";
|
|
6
|
+
|
|
7
|
+
const files = process.argv.slice(2);
|
|
8
|
+
if (files.length < 2) throw new Error("Pass the unit and build coverage-final.json files");
|
|
9
|
+
const map = coverage.createCoverageMap({});
|
|
10
|
+
for (const file of files) map.merge(JSON.parse(await readFile(file, "utf8")));
|
|
11
|
+
const context = report.createContext({dir: path.resolve("coverage/merged"), coverageMap: map});
|
|
12
|
+
for (const format of ["json", "lcov", "text-summary"]) reports.create(format).execute(context);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {execFileSync} from "node:child_process";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import * as prettier from "prettier";
|
|
4
|
+
|
|
5
|
+
const root = path.resolve(import.meta.dirname, "..");
|
|
6
|
+
const git = args => execFileSync("git", args, {cwd: root, encoding: "utf8"});
|
|
7
|
+
const changed = git(["diff", "--cached", "--name-only", "--diff-filter=ACMR", "-z"]).split("\0").filter(Boolean);
|
|
8
|
+
const unformatted = [];
|
|
9
|
+
|
|
10
|
+
for (const file of changed) {
|
|
11
|
+
const filepath = path.join(root, file);
|
|
12
|
+
const info = await prettier.getFileInfo(filepath, {ignorePath: path.join(root, ".prettierignore")});
|
|
13
|
+
if (info.ignored || !info.inferredParser) continue;
|
|
14
|
+
// Check the staged contents; never rewrite unstaged work or silently stage it.
|
|
15
|
+
const contents = git(["show", `:${file}`]);
|
|
16
|
+
if (!(await prettier.check(contents, {...(await prettier.resolveConfig(filepath)), filepath})))
|
|
17
|
+
unformatted.push(file);
|
|
18
|
+
}
|
|
19
|
+
if (unformatted.length) {
|
|
20
|
+
console.error(`Format and stage these files before committing:\n${unformatted.join("\n")}`);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import {execFile} from "node:child_process";
|
|
3
|
+
import {existsSync} from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import {promisify} from "node:util";
|
|
6
|
+
|
|
7
|
+
const execute = promisify(execFile);
|
|
8
|
+
const root = path.resolve(import.meta.dirname, "..");
|
|
9
|
+
const jest = path.join(root, "scripts/test-run.mjs");
|
|
10
|
+
const options = {cwd: root, maxBuffer: 10 * 1024 * 1024};
|
|
11
|
+
const {stdout: configuration} = await execute(process.execPath, [jest, "--showConfig"], options);
|
|
12
|
+
const projects = JSON.parse(configuration).configs.map(config => config.displayName.name);
|
|
13
|
+
const {stdout: tracked} = await execute(
|
|
14
|
+
"git",
|
|
15
|
+
["ls-files", "--cached", "--others", "--exclude-standard", "-z"],
|
|
16
|
+
options
|
|
17
|
+
);
|
|
18
|
+
const expected = new Set(
|
|
19
|
+
tracked.split("\0").filter(file => file.endsWith(".test.ts") && existsSync(path.join(root, file)))
|
|
20
|
+
);
|
|
21
|
+
const owners = new Map();
|
|
22
|
+
|
|
23
|
+
for (const project of projects) {
|
|
24
|
+
const {stdout} = await execute(
|
|
25
|
+
process.execPath,
|
|
26
|
+
[jest, "--selectProjects", project, "--listTests", "--json", "--runInBand"],
|
|
27
|
+
options
|
|
28
|
+
);
|
|
29
|
+
const files = JSON.parse(stdout);
|
|
30
|
+
console.info(`${project}: ${files.length} files`);
|
|
31
|
+
for (const filename of files) {
|
|
32
|
+
const file = path.relative(root, filename).split(path.sep).join("/");
|
|
33
|
+
assert(!owners.has(file), `${file} belongs to both ${owners.get(file)} and ${project}`);
|
|
34
|
+
owners.set(file, project);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
assert.deepEqual(new Set(owners.keys()), expected, "Every test file must belong to exactly one Jest project");
|
|
38
|
+
console.info(`${expected.size} test files, each in exactly one project`);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {spawn} from "node:child_process";
|
|
2
|
+
import {constants} from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
|
|
5
|
+
const root = path.resolve(import.meta.dirname, "..");
|
|
6
|
+
// Keep the workaround scoped to the environment where this project reproduces nodejs/node#62393.
|
|
7
|
+
const flags = process.platform === "darwin" && process.arch === "arm64" ? ["--no-sparkplug"] : [];
|
|
8
|
+
const child = spawn(
|
|
9
|
+
process.execPath,
|
|
10
|
+
[...flags, path.join(root, "node_modules/jest/bin/jest.js"), ...process.argv.slice(2)],
|
|
11
|
+
{stdio: "inherit"}
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
const forward = signal => child.kill(signal);
|
|
15
|
+
const signals = ["SIGINT", "SIGTERM", "SIGHUP"];
|
|
16
|
+
for (const signal of signals) process.on(signal, forward);
|
|
17
|
+
child.once("error", error => {
|
|
18
|
+
console.error(error);
|
|
19
|
+
process.exitCode = 1;
|
|
20
|
+
});
|
|
21
|
+
child.once("close", (code, signal) => {
|
|
22
|
+
for (const signal of signals) process.off(signal, forward);
|
|
23
|
+
if (signal) console.error(`Jest terminated with ${signal}`);
|
|
24
|
+
process.exitCode = code ?? (signal ? 128 + constants.signals[signal] : 1);
|
|
25
|
+
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const EntrypointAssetsModule: {
|
|
2
|
-
request: string;
|
|
3
|
-
current: {
|
|
4
|
-
export: string;
|
|
5
|
-
property: string;
|
|
6
|
-
};
|
|
7
|
-
full: {
|
|
8
|
-
export: string;
|
|
9
|
-
property: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
/** Readers keep runtime data live without capturing a snapshot during module evaluation. */
|
|
13
|
-
export declare const createEntrypointModule: () => string;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { RuntimeGlobals } from "@rspack/core";
|
|
2
|
-
import { EntrypointAssetsMapRuntimeProperty, EntrypointAssetsRuntimeProperty } from "./../../../../types/entrypoint.js";
|
|
3
|
-
const EntrypointAssetsModule = {
|
|
4
|
-
request: "#adnbn/entrypoint",
|
|
5
|
-
current: { export: "readAssets", property: EntrypointAssetsRuntimeProperty },
|
|
6
|
-
full: { export: "readAssetsMap", property: EntrypointAssetsMapRuntimeProperty }
|
|
7
|
-
};
|
|
8
|
-
const createEntrypointModule = () => [EntrypointAssetsModule.current, EntrypointAssetsModule.full].map(
|
|
9
|
-
({ export: name, property }) => `export const ${name} = () => ${RuntimeGlobals.require}[${JSON.stringify(property)}];
|
|
10
|
-
`
|
|
11
|
-
).join("");
|
|
12
|
-
export {
|
|
13
|
-
EntrypointAssetsModule,
|
|
14
|
-
createEntrypointModule
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=entrypoint-module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/build-assets-map/entrypoint-module.ts"],"sourcesContent":["import {RuntimeGlobals} from \"@rspack/core\";\n\nimport {EntrypointAssetsMapRuntimeProperty, EntrypointAssetsRuntimeProperty} from \"@typing/entrypoint\";\n\nimport type {BuildAssetsMapPluginModuleOptions} from \"./usage\";\n\nexport const EntrypointAssetsModule = {\n request: \"#adnbn/entrypoint\",\n current: {export: \"readAssets\", property: EntrypointAssetsRuntimeProperty},\n full: {export: \"readAssetsMap\", property: EntrypointAssetsMapRuntimeProperty},\n} satisfies BuildAssetsMapPluginModuleOptions;\n\n/** Readers keep runtime data live without capturing a snapshot during module evaluation. */\nexport const createEntrypointModule = (): string =>\n [EntrypointAssetsModule.current, EntrypointAssetsModule.full]\n .map(\n ({export: name, property}) =>\n `export const ${name} = () => ${RuntimeGlobals.require}[${JSON.stringify(property)}];\\n`\n )\n .join(\"\");\n"],"mappings":"AAAA,SAAQ,sBAAqB;AAE7B,SAAQ,oCAAoC,uCAAsC;AAI3E,MAAM,yBAAyB;AAAA,EAClC,SAAS;AAAA,EACT,SAAS,EAAC,QAAQ,cAAc,UAAU,gCAA+B;AAAA,EACzE,MAAM,EAAC,QAAQ,iBAAiB,UAAU,mCAAkC;AAChF;AAGO,MAAM,yBAAyB,MAClC,CAAC,uBAAuB,SAAS,uBAAuB,IAAI,EACvD;AAAA,EACG,CAAC,EAAC,QAAQ,MAAM,SAAQ,MACpB,gBAAgB,IAAI,YAAY,eAAe,OAAO,IAAI,KAAK,UAAU,QAAQ,CAAC;AAAA;AAC1F,EACC,KAAK,EAAE;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/bundler/utils/layers.ts"],"sourcesContent":["import type {ContentScriptWorld} from \"@typing/content\";\n\nconst ContentLayerPrefix = \"adnbn:content:\";\n\n/** Shared build identity for content and Relay modules, independent of their UI isolation. */\nexport const getContentLayer = (world: ContentScriptWorld): string => {\n return `${ContentLayerPrefix}${world.toLowerCase()}`;\n};\n\nexport const isContentLayer = (layer: string): boolean => layer.startsWith(ContentLayerPrefix);\n"],"mappings":"AAEA,MAAM,qBAAqB;AAGpB,MAAM,kBAAkB,CAAC,UAAsC;AAClE,SAAO,GAAG,kBAAkB,GAAG,MAAM,YAAY,CAAC;AACtD;AAEO,MAAM,iBAAiB,CAAC,UAA2B,MAAM,WAAW,kBAAkB;","names":[]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Compilation, Filename } from "@rspack/core";
|
|
2
|
-
import type { EntrypointAssetsMap } from "../../../types/entrypoint.js";
|
|
3
|
-
export declare const appFilenameResolver: (app: string, filename: Filename, dirname?: string) => Filename;
|
|
4
|
-
export declare const collectBuildAssets: (compilation: Compilation) => EntrypointAssetsMap;
|
|
5
|
-
export declare const setCompilationBuildAssets: (compilation: Compilation, assets: EntrypointAssetsMap) => void;
|
|
6
|
-
export declare const getCompilationBuildAssets: (compilation: Compilation) => EntrypointAssetsMap | undefined;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/bundler/utils/output.ts"],"sourcesContent":["import type {AssetInfo, Chunk, Compilation, Filename, Module} from \"@rspack/core\";\nimport _ from \"lodash\";\nimport path from \"path\";\nimport postcss from \"postcss\";\nimport valueParser from \"postcss-value-parser\";\n\nimport {toPosix} from \"@cli/utils/path\";\n\nimport type {EntrypointAssetsMap, EntrypointAssetsMapEntry, EntrypointAssetsFiles} from \"@typing/entrypoint\";\n\ntype AssetKind = \"asset\" | \"css\" | \"js\";\n\nconst compilationBuildAssets = new WeakMap<Compilation, EntrypointAssetsMap>();\n\n// prettier-ignore\nexport const appFilenameResolver =\n (app: string, filename: Filename, dirname?: string): Filename => {\n app = _.kebabCase(app);\n\n const resolve = (name: string): string => {\n name = name.replaceAll(\"[app]\", app);\n\n return dirname ? path.posix.join(dirname, name) : name;\n };\n\n if (!_.isFunction(filename)) {\n return resolve(filename);\n }\n\n return (pathData, assetInfo): string => {\n return resolve(filename(pathData, assetInfo));\n };\n };\n\nconst addRelatedSourceMaps = (sourceMaps: Set<string>, related: AssetInfo[\"related\"]): void => {\n const sourceMap = related?.sourceMap;\n\n if (Array.isArray(sourceMap)) {\n sourceMap.forEach(file => sourceMaps.add(toPosix(file)));\n } else if (sourceMap) {\n sourceMaps.add(toPosix(sourceMap));\n }\n};\n\nconst getRelatedSourceMaps = (compilation: Compilation): ReadonlySet<string> => {\n const sourceMaps = new Set<string>();\n\n compilation.getAssets().forEach(({info}) => addRelatedSourceMaps(sourceMaps, info.related));\n\n return sourceMaps;\n};\n\nconst isIgnoredAsset = (file: string, info: AssetInfo, sourceMaps: ReadonlySet<string>): boolean => {\n return Boolean(info.development || info.hotModuleReplacement || sourceMaps.has(file));\n};\n\nconst classifyAsset = (file: string, info: AssetInfo, fromModuleAssets: boolean): AssetKind => {\n if (info.assetType === \"javascript\") {\n return \"js\";\n }\n\n if (info.assetType === \"css\" || info.assetType === \"extract-css\") {\n return \"css\";\n }\n\n if (info.assetType || info.sourceFilename || fromModuleAssets) {\n return \"asset\";\n }\n\n if (file.endsWith(\".js\") || file.endsWith(\".mjs\") || file.endsWith(\".cjs\")) {\n return \"js\";\n }\n\n if (file.endsWith(\".css\")) {\n return \"css\";\n }\n\n return \"asset\";\n};\n\nconst getAssetKind = (\n compilation: Compilation,\n file: string,\n sourceMaps: ReadonlySet<string>,\n fromModuleAssets = false\n): AssetKind | undefined => {\n file = toPosix(file);\n\n const asset = compilation.getAsset(file);\n\n if (!asset || isIgnoredAsset(file, asset.info, sourceMaps)) {\n return;\n }\n\n return classifyAsset(file, asset.info, fromModuleAssets);\n};\n\nconst getModuleAssetNames = (module: Module): readonly string[] => {\n return Object.keys(module.buildInfo?.assets ?? {});\n};\n\nconst collectResources = (\n compilation: Compilation,\n chunks: Iterable<Chunk>,\n sourceMaps: ReadonlySet<string>\n): readonly string[] => {\n const candidates = new Map<string, boolean>();\n const cssFiles = new Set<string>();\n const sourceFiles = new Set<string>();\n\n for (const chunk of chunks) {\n for (const file of [...chunk.files, ...chunk.auxiliaryFiles]) {\n const normalized = toPosix(file);\n\n candidates.set(normalized, candidates.get(normalized) ?? false);\n if (getAssetKind(compilation, normalized, sourceMaps) === \"css\") cssFiles.add(normalized);\n }\n\n for (const module of compilation.chunkGraph.getChunkModulesIterable(chunk)) {\n for (const file of getModuleAssetNames(module)) {\n candidates.set(toPosix(file), true);\n }\n if (module.type === \"css/mini-extract\") {\n for (const dependency of module.buildInfo?.fileDependencies ?? [])\n sourceFiles.add(path.resolve(dependency));\n }\n }\n }\n\n // CssExtract executes url() asset modules during the build. They are not\n // runtime chunk modules, so follow the emitted CSS references as well.\n // This only reads assets; it never rewrites CSS or its filenames.\n const resources = compilation\n .getAssets()\n .filter(\n asset =>\n getAssetKind(compilation, asset.name, sourceMaps) === \"asset\" &&\n (!asset.info.sourceFilename ||\n sourceFiles.has(\n path.resolve(compilation.compiler.context, asset.info.sourceFilename.split(/[?#]/)[0])\n ))\n )\n .map(asset => asset.name)\n .sort((left, right) => right.length - left.length);\n for (const file of cssFiles) {\n const css = compilation.getAsset(file)?.source.source().toString();\n if (!css) continue;\n postcss.parse(css, {from: file}).walkDecls(declaration => {\n valueParser(declaration.value).walk(node => {\n if (node.type !== \"function\" || node.value.toLowerCase() !== \"url\") return;\n const argument = node.nodes[0];\n if (!argument || (argument.type !== \"string\" && argument.type !== \"word\")) return false;\n const url = argument.value.replace(/\\\\([\\da-f]{1,6}\\s?|.)/gi, (_match, escape: string) =>\n /^[\\da-f]{1,6}\\s?$/i.test(escape)\n ? String.fromCodePoint(parseInt(escape.trim(), 16) || 0xfffd)\n : escape\n );\n if (/^(?:data|blob):/i.test(url)) return false;\n try {\n const pathname = decodeURIComponent(new URL(url, `https://adnbn.invalid/${file}`).pathname);\n const resource = resources.find(candidate => pathname.endsWith(`/${candidate}`));\n if (resource) candidates.set(resource, true);\n } catch {\n // External or malformed URLs do not name an emitted build resource.\n }\n return false;\n });\n });\n }\n\n return Array.from(candidates)\n .filter(([file, fromModuleAssets]) => {\n return getAssetKind(compilation, file, sourceMaps, fromModuleAssets) === \"asset\";\n })\n .map(([file]) => file)\n .toSorted();\n};\n\nconst collectCodeFiles = (\n compilation: Compilation,\n files: Iterable<string>,\n sourceMaps: ReadonlySet<string>\n): EntrypointAssetsFiles => {\n const css = new Set<string>();\n const js = new Set<string>();\n\n for (const rawFile of files) {\n const file = toPosix(rawFile);\n const kind = getAssetKind(compilation, file, sourceMaps);\n\n if (kind === \"js\") {\n js.add(file);\n } else if (kind === \"css\") {\n css.add(file);\n }\n }\n\n return {js: Array.from(js), css: Array.from(css)};\n};\n\nconst collectAsyncCodeFiles = (\n compilation: Compilation,\n chunks: Iterable<Chunk>,\n sourceMaps: ReadonlySet<string>,\n initialFiles: ReadonlySet<string>\n): EntrypointAssetsFiles => {\n const files = new Set<string>();\n\n for (const chunk of chunks) {\n for (const file of [...chunk.files, ...chunk.auxiliaryFiles]) {\n const normalized = toPosix(file);\n\n if (!initialFiles.has(normalized)) {\n files.add(normalized);\n }\n }\n }\n\n return collectCodeFiles(compilation, files, sourceMaps);\n};\n\nexport const collectBuildAssets = (compilation: Compilation): EntrypointAssetsMap => {\n const sourceMaps = getRelatedSourceMaps(compilation);\n const assets = Object.create(null) as Record<string, EntrypointAssetsMapEntry>;\n\n const entrypoints = Array.from(compilation.entrypoints).toSorted(([left], [right]) => left.localeCompare(right));\n\n for (const [name, entrypoint] of entrypoints) {\n const initial = collectCodeFiles(compilation, entrypoint.getFiles(), sourceMaps);\n const initialFiles = new Set([...initial.js, ...initial.css]);\n const entryChunk = entrypoint.getEntrypointChunk();\n\n assets[name] = {\n initial,\n async: collectAsyncCodeFiles(compilation, entryChunk.getAllAsyncChunks(), sourceMaps, initialFiles),\n assets: collectResources(compilation, entryChunk.getAllReferencedChunks(), sourceMaps),\n };\n }\n\n return assets;\n};\n\nexport const setCompilationBuildAssets = (compilation: Compilation, assets: EntrypointAssetsMap): void => {\n compilationBuildAssets.set(compilation, assets);\n};\n\nexport const getCompilationBuildAssets = (compilation: Compilation): EntrypointAssetsMap | undefined => {\n return compilationBuildAssets.get(compilation);\n};\n"],"mappings":"AACA,OAAO,OAAO;AACd,OAAO,UAAU;AACjB,OAAO,aAAa;AACpB,OAAO,iBAAiB;AAExB,SAAQ,eAAc;AAMtB,MAAM,yBAAyB,oBAAI,QAA0C;AAGtE,MAAM,sBACT,CAAC,KAAa,UAAoB,YAA+B;AAC7D,QAAM,EAAE,UAAU,GAAG;AAErB,QAAM,UAAU,CAAC,SAAyB;AACtC,WAAO,KAAK,WAAW,SAAS,GAAG;AAEnC,WAAO,UAAU,KAAK,MAAM,KAAK,SAAS,IAAI,IAAI;AAAA,EACtD;AAEA,MAAI,CAAC,EAAE,WAAW,QAAQ,GAAG;AACzB,WAAO,QAAQ,QAAQ;AAAA,EAC3B;AAEA,SAAO,CAAC,UAA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GAAG,UAAU;AAAA,IACzF;AAAA,EACJ;AAEA,SAAO;AACX;AAEO,MAAM,4BAA4B,CAAC,aAA0B,WAAsC;AACtG,yBAAuB,IAAI,aAAa,MAAM;AAClD;AAEO,MAAM,4BAA4B,CAAC,gBAA8D;AACpG,SAAO,uBAAuB,IAAI,WAAW;AACjD;","names":[]}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Chunk, Compilation, Module } from "@rspack/core";
|
|
2
|
-
export declare const IsolatedStylesLayer = "adnbn:css:isolation";
|
|
3
|
-
export declare const isIsolatedStylesModule: (module: Module) => boolean;
|
|
4
|
-
export declare const isIsolatedStylesChunk: (compilation: Compilation, chunk: Chunk) => boolean;
|
|
5
|
-
export declare const getIsolatedStylesFiles: (compilation: Compilation) => ReadonlySet<string>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/bundler/utils/styles.ts"],"sourcesContent":["import type {Chunk, Compilation, Module} from \"@rspack/core\";\n\n// This is a bundler layer, not a CSS @layer. A distinct css-loader identity is\n// also required: CssExtract deduplicates dependencies by their loader request.\nexport const IsolatedStylesLayer = \"adnbn:css:isolation\";\n\nexport const isIsolatedStylesModule = (module: Module): boolean =>\n module.type === \"css/mini-extract\" && module.layer === IsolatedStylesLayer;\n\nexport const isIsolatedStylesChunk = (compilation: Compilation, chunk: Chunk): boolean => {\n const modules = [...compilation.chunkGraph.getChunkModulesIterable(chunk)].filter(\n module => module.type === \"css/mini-extract\"\n );\n const isolated = modules.some(isIsolatedStylesModule);\n if (isolated && !modules.every(isIsolatedStylesModule)) {\n throw new Error(\n `CSS chunk \"${chunk.name ?? chunk.id}\" mixes document and ?isolation styles. Preserve the adnbnIsolatedStyles CSS cache group in your bundler configuration.`\n );\n }\n return isolated;\n};\n\nexport const getIsolatedStylesFiles = (compilation: Compilation): ReadonlySet<string> => {\n const files = new Set<string>();\n for (const chunk of compilation.chunks) {\n if (isIsolatedStylesChunk(compilation, chunk)) {\n for (const file of chunk.files) if (file.endsWith(\".css\")) files.add(file);\n }\n }\n return files;\n};\n"],"mappings":"AAIO,MAAM,sBAAsB;AAE5B,MAAM,yBAAyB,CAAC,WACnC,OAAO,SAAS,sBAAsB,OAAO,UAAU;AAEpD,MAAM,wBAAwB,CAAC,aAA0B,UAA0B;AACtF,QAAM,UAAU,CAAC,GAAG,YAAY,WAAW,wBAAwB,KAAK,CAAC,EAAE;AAAA,IACvE,YAAU,OAAO,SAAS;AAAA,EAC9B;AACA,QAAM,WAAW,QAAQ,KAAK,sBAAsB;AACpD,MAAI,YAAY,CAAC,QAAQ,MAAM,sBAAsB,GAAG;AACpD,UAAM,IAAI;AAAA,MACN,cAAc,MAAM,QAAQ,MAAM,EAAE;AAAA,IACxC;AAAA,EACJ;AACA,SAAO;AACX;AAEO,MAAM,yBAAyB,CAAC,gBAAkD;AACrF,QAAM,QAAQ,oBAAI,IAAY;AAC9B,aAAW,SAAS,YAAY,QAAQ;AACpC,QAAI,sBAAsB,aAAa,KAAK,GAAG;AAC3C,iBAAW,QAAQ,MAAM,MAAO,KAAI,KAAK,SAAS,MAAM,EAAG,OAAM,IAAI,IAAI;AAAA,IAC7E;AAAA,EACJ;AACA,SAAO;AACX;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/plugins/output.ts"],"sourcesContent":["import _ from \"lodash\";\nimport {Configuration as RspackConfig} from \"@rspack/core\";\n\nimport {definePlugin} from \"@main/plugin\";\n\nimport {\n appFilenameResolver,\n BuildAssetsMapPlugin,\n GenerateModulePlugin,\n createEntrypointModule,\n EntrypointAssetsModule,\n} from \"@cli/bundler\";\nimport {getOutputPath, getResolvePath} from \"@cli/resolvers/path\";\n\nimport {Command} from \"@typing/app\";\nimport {BackgroundEntryName} from \"@typing/background\";\n\nconst serializeFilename = (filename: unknown): string => {\n return typeof filename === \"function\" ? filename.toString() : String(filename ?? \"\");\n};\n\nexport default definePlugin(() => {\n return {\n name: \"adnbn:output\",\n bundler: ({config}) => {\n const {app, assetsDir, assetsFilename, cssDir, cssFilename, jsDir, jsFilename} = config;\n\n const kebabApp = _.kebabCase(app);\n const camelApp = _.camelCase(app);\n\n const filename = appFilenameResolver(app, jsFilename, jsDir);\n const cssOutputFilename = appFilenameResolver(app, cssFilename, cssDir);\n const buildHashSalt = JSON.stringify({\n app,\n assetsDir,\n assetsFilename: serializeFilename(assetsFilename),\n cssDir,\n cssFilename: serializeFilename(cssFilename),\n jsDir,\n jsFilename: serializeFilename(jsFilename),\n });\n\n return {\n output: {\n path: getResolvePath(getOutputPath(config)),\n filename,\n chunkFilename: filename,\n hashSalt: kebabApp,\n hotUpdateGlobal: camelApp + \"HotUpdate\",\n chunkLoadingGlobal: camelApp + \"ChunkLoading\",\n uniqueName: kebabApp,\n clean: config.command === Command.Build,\n },\n plugins: [\n new GenerateModulePlugin({[EntrypointAssetsModule.request]: createEntrypointModule()}),\n new BuildAssetsMapPlugin({\n module: EntrypointAssetsModule,\n buildHashSalt,\n cssChunkFilename: cssOutputFilename,\n cssFilename: cssOutputFilename,\n fullMapEntrypoint: BackgroundEntryName,\n }),\n ],\n } satisfies RspackConfig;\n },\n };\n});\n"],"mappings":"AAAA,OAAO,OAAO;AAGd,SAAQ,oBAAmB;AAE3B;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAQ,eAAe,sBAAqB;AAE5C,SAAQ,eAAc;AACtB,SAAQ,2BAA0B;AAElC,MAAM,oBAAoB,CAAC,aAA8B;AACrD,SAAO,OAAO,aAAa,aAAa,SAAS,SAAS,IAAI,OAAO,YAAY,EAAE;AACvF;AAEA,IAAO,iBAAQ,aAAa,MAAM;AAC9B,SAAO;AAAA,IACH,MAAM;AAAA,IACN,SAAS,CAAC,EAAC,OAAM,MAAM;AACnB,YAAM,EAAC,KAAK,WAAW,gBAAgB,QAAQ,aAAa,OAAO,WAAU,IAAI;AAEjF,YAAM,WAAW,EAAE,UAAU,GAAG;AAChC,YAAM,WAAW,EAAE,UAAU,GAAG;AAEhC,YAAM,WAAW,oBAAoB,KAAK,YAAY,KAAK;AAC3D,YAAM,oBAAoB,oBAAoB,KAAK,aAAa,MAAM;AACtE,YAAM,gBAAgB,KAAK,UAAU;AAAA,QACjC;AAAA,QACA;AAAA,QACA,gBAAgB,kBAAkB,cAAc;AAAA,QAChD;AAAA,QACA,aAAa,kBAAkB,WAAW;AAAA,QAC1C;AAAA,QACA,YAAY,kBAAkB,UAAU;AAAA,MAC5C,CAAC;AAED,aAAO;AAAA,QACH,QAAQ;AAAA,UACJ,MAAM,eAAe,cAAc,MAAM,CAAC;AAAA,UAC1C;AAAA,UACA,eAAe;AAAA,UACf,UAAU;AAAA,UACV,iBAAiB,WAAW;AAAA,UAC5B,oBAAoB,WAAW;AAAA,UAC/B,YAAY;AAAA,UACZ,OAAO,OAAO,YAAY,QAAQ;AAAA,QACtC;AAAA,QACA,SAAS;AAAA,UACL,IAAI,qBAAqB,EAAC,CAAC,uBAAuB,OAAO,GAAG,uBAAuB,EAAC,CAAC;AAAA,UACrF,IAAI,qBAAqB;AAAA,YACrB,QAAQ;AAAA,YACR;AAAA,YACA,kBAAkB;AAAA,YAClB,aAAa;AAAA,YACb,mBAAmB;AAAA,UACvB,CAAC;AAAA,QACL;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACJ,CAAC;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./render.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/entry/content/adapters/react/resolvers/index.ts"],"sourcesContent":["export * from \"./render\";\n"],"mappings":"AAAA,cAAc;","names":[]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import Builder from "../../core/Builder.js";
|
|
2
|
-
import { ManagedContext, EventEmitter } from "./context/index.js";
|
|
3
|
-
import { ContentScriptAnchor, ContentScriptAnchorGetter, ContentScriptBuilder, ContentScriptContainerCreator, ContentScriptContainerFactory, ContentScriptContainerOptions, ContentScriptContainerTag, ContentScriptContext, ContentScriptDefinition, ContentScriptMarkerContract, ContentScriptMarkerGetter, ContentScriptMarkerResolver, ContentScriptMarkerType, ContentScriptMountFunction, ContentScriptNode, ContentScriptRenderHandler, ContentScriptRenderValue, ContentScriptResolvedDefinition, ContentScriptWatchStrategy } from "../../../types/content.js";
|
|
4
|
-
import { Awaiter } from "../../../types/helpers.js";
|
|
5
|
-
export default abstract class extends Builder implements ContentScriptBuilder {
|
|
6
|
-
private readonly lock;
|
|
7
|
-
protected readonly definition: ContentScriptResolvedDefinition;
|
|
8
|
-
protected readonly emitter: EventEmitter;
|
|
9
|
-
protected readonly context: ManagedContext;
|
|
10
|
-
protected marker: ContentScriptMarkerContract;
|
|
11
|
-
protected unwatch?: () => void;
|
|
12
|
-
protected abstract createNode(anchor: Element): Promise<ContentScriptNode>;
|
|
13
|
-
protected abstract cleanupNode(anchor: Element): Awaiter<void>;
|
|
14
|
-
protected constructor(definition: ContentScriptDefinition);
|
|
15
|
-
protected resolveMarker(marker: ContentScriptMarkerType | ContentScriptMarkerGetter): ContentScriptMarkerResolver;
|
|
16
|
-
protected resolveAnchor(anchor?: ContentScriptAnchor | ContentScriptAnchorGetter): ContentScriptAnchorGetter;
|
|
17
|
-
protected resolveMount(mount?: ContentScriptMountFunction): ContentScriptMountFunction;
|
|
18
|
-
protected resolveContainer(container?: ContentScriptContainerTag | ContentScriptContainerOptions | ContentScriptContainerFactory): ContentScriptContainerCreator;
|
|
19
|
-
protected resolveRender(render?: ContentScriptRenderValue | ContentScriptRenderHandler): ContentScriptRenderHandler | undefined;
|
|
20
|
-
protected resolveWatch(watch?: true | ContentScriptWatchStrategy): ContentScriptWatchStrategy;
|
|
21
|
-
getContext(): ContentScriptContext;
|
|
22
|
-
build(): Promise<void>;
|
|
23
|
-
destroy(): Promise<void>;
|
|
24
|
-
protected processing(): Promise<void>;
|
|
25
|
-
protected processAnchor(anchor: Element): Promise<void>;
|
|
26
|
-
}
|