adnbn 0.10.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/locale/LocaleBuilder.js +2 -11
- package/dist/cli/builders/locale/LocaleBuilder.js.map +1 -1
- package/dist/cli/builders/locale/index.js +1 -1
- package/dist/cli/builders/locale/index.js.map +1 -1
- package/dist/cli/builders/manifest/ManifestBase.js +17 -7
- package/dist/cli/builders/manifest/ManifestBase.js.map +1 -1
- package/dist/cli/builders/manifest/ManifestV2.js +1 -1
- package/dist/cli/builders/manifest/ManifestV3.js +12 -5
- package/dist/cli/builders/manifest/ManifestV3.js.map +1 -1
- package/dist/cli/builders/manifest/utils/data-collection-permissions.d.ts +15 -0
- package/dist/cli/builders/manifest/utils/data-collection-permissions.js +26 -0
- package/dist/cli/builders/manifest/utils/data-collection-permissions.js.map +1 -0
- package/dist/cli/builders/manifest/utils/host-patterns.d.ts +1 -0
- package/dist/cli/builders/manifest/utils/host-patterns.js +40 -0
- package/dist/cli/builders/manifest/utils/host-patterns.js.map +1 -0
- package/dist/cli/builders/manifest/utils/index.d.ts +4 -0
- package/dist/cli/builders/manifest/utils/index.js +19 -0
- package/dist/cli/builders/manifest/utils/index.js.map +1 -0
- package/dist/cli/builders/manifest/utils/permissions.d.ts +14 -0
- package/dist/cli/builders/manifest/utils/permissions.js +34 -0
- package/dist/cli/builders/manifest/utils/permissions.js.map +1 -0
- package/dist/cli/builders/manifest/utils/web-accessible-resources.d.ts +2 -0
- package/dist/cli/builders/manifest/utils/web-accessible-resources.js +92 -0
- package/dist/cli/builders/manifest/utils/web-accessible-resources.js.map +1 -0
- 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 +12 -0
- package/dist/cli/bundler/layers.js.map +1 -0
- package/dist/cli/bundler/plugins/build-assets-map/BuildAssetsMapPlugin.d.ts +14 -0
- package/dist/cli/bundler/plugins/build-assets-map/BuildAssetsMapPlugin.js +524 -0
- package/dist/cli/bundler/plugins/build-assets-map/BuildAssetsMapPlugin.js.map +1 -0
- package/dist/cli/bundler/plugins/build-assets-map/index.d.ts +2 -0
- package/dist/cli/bundler/plugins/build-assets-map/index.js +5 -0
- package/dist/cli/bundler/plugins/build-assets-map/index.js.map +1 -0
- package/dist/cli/bundler/plugins/build-assets-map/usage.d.ts +9 -0
- package/dist/cli/bundler/plugins/build-assets-map/usage.js +31 -0
- package/dist/cli/bundler/plugins/build-assets-map/usage.js.map +1 -0
- package/dist/cli/bundler/plugins/chunk-loader/ChunkLoaderPlugin.d.ts +9 -0
- package/dist/cli/bundler/plugins/chunk-loader/ChunkLoaderPlugin.js +43 -0
- package/dist/cli/bundler/plugins/chunk-loader/ChunkLoaderPlugin.js.map +1 -0
- package/dist/cli/bundler/plugins/chunk-loader/index.d.ts +1 -0
- package/dist/cli/bundler/plugins/chunk-loader/index.js +5 -0
- package/dist/cli/bundler/plugins/chunk-loader/index.js.map +1 -0
- package/dist/cli/bundler/plugins/chunk-loader/templates/runtime.template.d.ts +2 -0
- package/dist/cli/bundler/plugins/chunk-loader/templates.d.ts +7 -0
- package/dist/cli/bundler/plugins/chunk-loader/templates.js +30 -0
- package/dist/cli/bundler/plugins/{EntrypointPlugin.d.ts → entrypoint/EntrypointPlugin.d.ts} +7 -2
- package/dist/cli/bundler/plugins/{EntrypointPlugin.js → entrypoint/EntrypointPlugin.js} +46 -26
- package/dist/cli/bundler/plugins/entrypoint/EntrypointPlugin.js.map +1 -0
- package/dist/cli/bundler/plugins/entrypoint/index.d.ts +1 -0
- package/dist/cli/bundler/plugins/entrypoint/index.js +7 -0
- package/dist/cli/bundler/plugins/entrypoint/index.js.map +1 -0
- package/dist/cli/bundler/plugins/{GenerateJsonPlugin.d.ts → generate-json/GenerateJsonPlugin.d.ts} +1 -0
- package/dist/cli/bundler/plugins/generate-json/GenerateJsonPlugin.js +73 -0
- package/dist/cli/bundler/plugins/generate-json/GenerateJsonPlugin.js.map +1 -0
- package/dist/cli/bundler/plugins/generate-json/index.d.ts +1 -0
- package/dist/cli/bundler/plugins/generate-json/index.js +5 -0
- package/dist/cli/bundler/plugins/generate-json/index.js.map +1 -0
- package/dist/cli/bundler/plugins/generate-module/GenerateModulePlugin.d.ts +23 -0
- package/dist/cli/bundler/plugins/generate-module/GenerateModulePlugin.js +88 -0
- package/dist/cli/bundler/plugins/generate-module/GenerateModulePlugin.js.map +1 -0
- package/dist/cli/bundler/plugins/generate-module/index.d.ts +1 -0
- package/dist/cli/bundler/plugins/generate-module/index.js +7 -0
- package/dist/cli/bundler/plugins/generate-module/index.js.map +1 -0
- package/dist/cli/bundler/plugins/index.d.ts +11 -5
- package/dist/cli/bundler/plugins/index.js +28 -10
- package/dist/cli/bundler/plugins/index.js.map +1 -1
- package/dist/cli/bundler/plugins/isolated-styles/IsolatedStylesPlugin.d.ts +21 -0
- package/dist/cli/bundler/plugins/isolated-styles/IsolatedStylesPlugin.js +174 -0
- package/dist/cli/bundler/plugins/isolated-styles/IsolatedStylesPlugin.js.map +1 -0
- package/dist/cli/bundler/plugins/isolated-styles/chunks.d.ts +3 -0
- package/dist/cli/bundler/plugins/isolated-styles/chunks.js +32 -0
- package/dist/cli/bundler/plugins/isolated-styles/chunks.js.map +1 -0
- package/dist/cli/bundler/plugins/isolated-styles/index.d.ts +1 -0
- package/dist/cli/bundler/plugins/isolated-styles/index.js +5 -0
- package/dist/cli/bundler/plugins/isolated-styles/index.js.map +1 -0
- package/dist/cli/bundler/plugins/isolated-styles/templates/css-loader.template.d.ts +1 -0
- package/dist/cli/bundler/plugins/isolated-styles/templates/runtime.template.d.ts +7 -0
- package/dist/cli/bundler/plugins/isolated-styles/templates.d.ts +18 -0
- package/dist/cli/bundler/plugins/isolated-styles/templates.js +174 -0
- package/dist/cli/bundler/plugins/manifest/ManifestPlugin.d.ts +10 -0
- package/dist/cli/bundler/plugins/manifest/ManifestPlugin.js +54 -0
- package/dist/cli/bundler/plugins/manifest/ManifestPlugin.js.map +1 -0
- package/dist/cli/bundler/plugins/manifest/index.d.ts +1 -0
- package/dist/cli/bundler/plugins/manifest/index.js +6 -0
- package/dist/cli/bundler/plugins/manifest/index.js.map +1 -0
- package/dist/cli/bundler/plugins/replace/ReplacePlugin.js.map +1 -0
- package/dist/cli/bundler/plugins/replace/index.d.ts +1 -0
- package/dist/cli/bundler/plugins/replace/index.js +5 -0
- package/dist/cli/bundler/plugins/replace/index.js.map +1 -0
- package/dist/cli/bundler/plugins/resource-access/ResourceAccessPlugin.d.ts +19 -0
- package/dist/cli/bundler/plugins/resource-access/ResourceAccessPlugin.js +20 -0
- package/dist/cli/bundler/plugins/resource-access/ResourceAccessPlugin.js.map +1 -0
- package/dist/cli/bundler/plugins/resource-access/index.d.ts +1 -0
- package/dist/cli/bundler/plugins/resource-access/index.js +5 -0
- package/dist/cli/bundler/plugins/resource-access/index.js.map +1 -0
- package/dist/cli/bundler/plugins/resource-access/utils.d.ts +8 -0
- package/dist/cli/bundler/plugins/resource-access/utils.js +42 -0
- package/dist/cli/bundler/plugins/resource-access/utils.js.map +1 -0
- package/dist/cli/bundler/plugins/types.d.ts +8 -0
- package/dist/cli/bundler/plugins/types.js +1 -0
- package/dist/cli/bundler/plugins/types.js.map +1 -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 +5 -0
- package/dist/cli/bundler/plugins/utils/index.js +14 -0
- package/dist/cli/bundler/plugins/utils/index.js.map +1 -0
- package/dist/cli/bundler/plugins/utils/manifest-hooks.d.ts +13 -0
- package/dist/cli/bundler/plugins/utils/manifest-hooks.js +17 -0
- package/dist/cli/bundler/plugins/utils/manifest-hooks.js.map +1 -0
- 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/plugins/utils/runtime-template.d.ts +1 -0
- package/dist/cli/bundler/plugins/utils/runtime-template.js +18 -0
- package/dist/cli/bundler/plugins/utils/runtime-template.js.map +1 -0
- package/dist/cli/bundler/plugins/utils/watch-compilation.d.ts +3 -0
- package/dist/cli/bundler/plugins/utils/watch-compilation.js +18 -0
- package/dist/cli/bundler/plugins/utils/watch-compilation.js.map +1 -0
- package/dist/cli/bundler/plugins/watch/WatchPlugin.js +16 -0
- package/dist/cli/bundler/plugins/watch/WatchPlugin.js.map +1 -0
- package/dist/cli/bundler/plugins/watch/index.d.ts +1 -0
- package/dist/cli/bundler/plugins/watch/index.js +5 -0
- package/dist/cli/bundler/plugins/watch/index.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/assets.js +162 -0
- package/dist/cli/bundler/utils/assets.js.map +1 -0
- package/dist/cli/bundler/utils/chunk-filename.d.ts +6 -0
- package/dist/cli/bundler/utils/chunk-filename.js +93 -0
- package/dist/cli/bundler/utils/chunk-filename.js.map +1 -0
- package/dist/cli/bundler/utils/index.d.ts +2 -1
- package/dist/cli/bundler/utils/index.js +2 -1
- package/dist/cli/bundler/utils/index.js.map +1 -1
- package/dist/cli/entrypoint/file/ExpressionFile.d.ts +4 -1
- package/dist/cli/entrypoint/file/ExpressionFile.js +11 -0
- package/dist/cli/entrypoint/file/ExpressionFile.js.map +1 -1
- package/dist/cli/entrypoint/file/OptionFile.d.ts +4 -2
- package/dist/cli/entrypoint/file/OptionFile.js +35 -31
- package/dist/cli/entrypoint/file/OptionFile.js.map +1 -1
- package/dist/cli/entrypoint/file/SourceFile.d.ts +18 -7
- package/dist/cli/entrypoint/file/SourceFile.js +260 -156
- package/dist/cli/entrypoint/file/SourceFile.js.map +1 -1
- package/dist/cli/entrypoint/file/index.d.ts +2 -0
- package/dist/cli/entrypoint/file/index.js +2 -0
- package/dist/cli/entrypoint/file/index.js.map +1 -1
- package/dist/cli/entrypoint/file/injectors/core.js +22 -1
- package/dist/cli/entrypoint/file/injectors/core.js.map +1 -1
- package/dist/cli/entrypoint/file/parsers/ExportParser.d.ts +14 -0
- package/dist/cli/entrypoint/file/parsers/ExportParser.js +71 -0
- package/dist/cli/entrypoint/file/parsers/ExportParser.js.map +1 -0
- package/dist/cli/entrypoint/file/parsers/NodeFinder.d.ts +2 -0
- package/dist/cli/entrypoint/file/parsers/NodeFinder.js +9 -0
- package/dist/cli/entrypoint/file/parsers/NodeFinder.js.map +1 -1
- package/dist/cli/entrypoint/file/parsers/ObjectParser.js +5 -1
- package/dist/cli/entrypoint/file/parsers/ObjectParser.js.map +1 -1
- package/dist/cli/entrypoint/file/parsers/index.d.ts +1 -0
- package/dist/cli/entrypoint/file/parsers/index.js +2 -0
- package/dist/cli/entrypoint/file/parsers/index.js.map +1 -1
- package/dist/cli/entrypoint/file/parsers/types.d.ts +16 -0
- package/dist/cli/entrypoint/file/parsers/types.js +13 -0
- package/dist/cli/entrypoint/file/parsers/types.js.map +1 -1
- package/dist/cli/entrypoint/file/resolvers/ImportResolver.d.ts +1 -0
- package/dist/cli/entrypoint/file/resolvers/ImportResolver.js +3 -0
- package/dist/cli/entrypoint/file/resolvers/ImportResolver.js.map +1 -1
- package/dist/cli/entrypoint/file/types.d.ts +26 -1
- package/dist/cli/entrypoint/finder/AbstractEntrypointFinder.js.map +1 -1
- package/dist/cli/entrypoint/finder/ContentFinder.d.ts +1 -1
- package/dist/cli/entrypoint/parser/AbstractParser.d.ts +3 -2
- package/dist/cli/entrypoint/parser/AbstractParser.js +6 -3
- package/dist/cli/entrypoint/parser/AbstractParser.js.map +1 -1
- package/dist/cli/entrypoint/parser/CommandParser.js +1 -1
- package/dist/cli/entrypoint/parser/CommandParser.js.map +1 -1
- package/dist/cli/entrypoint/parser/ContentParser.d.ts +7 -3
- package/dist/cli/entrypoint/parser/ContentParser.js +42 -6
- package/dist/cli/entrypoint/parser/ContentParser.js.map +1 -1
- package/dist/cli/entrypoint/parser/RelayParser.d.ts +21 -2
- package/dist/cli/entrypoint/parser/RelayParser.js +5 -1
- package/dist/cli/entrypoint/parser/RelayParser.js.map +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/asset.js +9 -4
- package/dist/cli/plugins/asset.js.map +1 -1
- package/dist/cli/plugins/background/index.js +1 -1
- package/dist/cli/plugins/background/index.js.map +1 -1
- package/dist/cli/plugins/content/Content.d.ts +2 -2
- package/dist/cli/plugins/content/Content.js +3 -2
- package/dist/cli/plugins/content/Content.js.map +1 -1
- package/dist/cli/plugins/content/ContentDriver.d.ts +1 -1
- package/dist/cli/plugins/content/ContentManager.d.ts +8 -5
- package/dist/cli/plugins/content/ContentManager.js +79 -28
- package/dist/cli/plugins/content/ContentManager.js.map +1 -1
- package/dist/cli/plugins/content/ContentName.d.ts +2 -2
- package/dist/cli/plugins/content/ContentName.js +8 -7
- package/dist/cli/plugins/content/ContentName.js.map +1 -1
- package/dist/cli/plugins/content/Relay.d.ts +2 -2
- package/dist/cli/plugins/content/Relay.js +3 -2
- package/dist/cli/plugins/content/Relay.js.map +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 +7 -0
- package/dist/cli/plugins/content/bundler.js +47 -0
- package/dist/cli/plugins/content/bundler.js.map +1 -0
- package/dist/cli/plugins/content/index.js +121 -62
- package/dist/cli/plugins/content/index.js.map +1 -1
- package/dist/cli/plugins/content/relay-module.d.ts +3 -0
- package/dist/cli/plugins/content/relay-module.js +11 -0
- package/dist/cli/plugins/content/relay-module.js.map +1 -0
- package/dist/cli/plugins/content/types.d.ts +2 -2
- package/dist/cli/plugins/content/utils.d.ts +3 -1
- package/dist/cli/plugins/content/utils.js +8 -1
- package/dist/cli/plugins/content/utils.js.map +1 -1
- package/dist/cli/plugins/icon/declaration/IconDeclaration.d.ts +1 -1
- package/dist/cli/plugins/icon/declaration/IconDeclaration.js +6 -6
- package/dist/cli/plugins/icon/declaration/IconDeclaration.js.map +1 -1
- package/dist/cli/plugins/icon/declaration/icon.d.ts +3 -5
- package/dist/cli/plugins/icon/icon-module.d.ts +2 -0
- package/dist/cli/plugins/icon/icon-module.js +11 -0
- package/dist/cli/plugins/icon/icon-module.js.map +1 -0
- package/dist/cli/plugins/icon/index.js +5 -3
- package/dist/cli/plugins/icon/index.js.map +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.d.ts +9 -2
- package/dist/cli/plugins/locale/Locale.js +37 -5
- package/dist/cli/plugins/locale/Locale.js.map +1 -1
- package/dist/cli/plugins/locale/declaration/locale.d.ts +1 -1
- package/dist/cli/plugins/locale/index.js +57 -22
- package/dist/cli/plugins/locale/index.js.map +1 -1
- package/dist/cli/plugins/locale/locale-module.d.ts +4 -0
- package/dist/cli/plugins/locale/locale-module.js +16 -0
- package/dist/cli/plugins/locale/locale-module.js.map +1 -0
- package/dist/cli/plugins/offscreen/Offscreen.d.ts +2 -3
- package/dist/cli/plugins/offscreen/Offscreen.js.map +1 -1
- package/dist/cli/plugins/offscreen/index.js +5 -4
- package/dist/cli/plugins/offscreen/index.js.map +1 -1
- package/dist/cli/plugins/offscreen/offscreen-module.d.ts +3 -0
- package/dist/cli/plugins/offscreen/offscreen-module.js +11 -0
- package/dist/cli/plugins/offscreen/offscreen-module.js.map +1 -0
- package/dist/cli/plugins/output/index.d.ts +2 -0
- package/dist/cli/plugins/output/index.js +60 -0
- 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/page/declaration/PageDeclaration.js +4 -4
- package/dist/cli/plugins/page/declaration/PageDeclaration.js.map +1 -1
- package/dist/cli/plugins/page/declaration/page.d.ts +3 -3
- package/dist/cli/plugins/page/index.js +14 -10
- package/dist/cli/plugins/page/index.js.map +1 -1
- package/dist/cli/plugins/page/page-module.d.ts +2 -0
- package/dist/cli/plugins/page/page-module.js +11 -0
- package/dist/cli/plugins/page/page-module.js.map +1 -0
- package/dist/cli/plugins/popup/Popup.d.ts +1 -1
- package/dist/cli/plugins/popup/Popup.js +2 -2
- package/dist/cli/plugins/popup/Popup.js.map +1 -1
- package/dist/cli/plugins/popup/declaration/PopupDeclaration.d.ts +1 -1
- package/dist/cli/plugins/popup/declaration/PopupDeclaration.js +6 -6
- package/dist/cli/plugins/popup/declaration/PopupDeclaration.js.map +1 -1
- package/dist/cli/plugins/popup/declaration/popup.d.ts +3 -3
- package/dist/cli/plugins/popup/index.js +6 -5
- package/dist/cli/plugins/popup/index.js.map +1 -1
- package/dist/cli/plugins/popup/popup-module.d.ts +3 -0
- package/dist/cli/plugins/popup/popup-module.js +11 -0
- package/dist/cli/plugins/popup/popup-module.js.map +1 -0
- package/dist/cli/plugins/sandbox/Sandbox.d.ts +1 -2
- package/dist/cli/plugins/sandbox/Sandbox.js.map +1 -1
- package/dist/cli/plugins/sandbox/index.js +5 -4
- package/dist/cli/plugins/sandbox/index.js.map +1 -1
- package/dist/cli/plugins/sandbox/sandbox-module.d.ts +3 -0
- package/dist/cli/plugins/sandbox/sandbox-module.js +11 -0
- package/dist/cli/plugins/sandbox/sandbox-module.js.map +1 -0
- package/dist/cli/plugins/sidebar/Sidebar.d.ts +1 -1
- package/dist/cli/plugins/sidebar/Sidebar.js +2 -2
- package/dist/cli/plugins/sidebar/Sidebar.js.map +1 -1
- package/dist/cli/plugins/sidebar/declaration/SidebarDeclaration.d.ts +1 -1
- package/dist/cli/plugins/sidebar/declaration/SidebarDeclaration.js +6 -6
- package/dist/cli/plugins/sidebar/declaration/SidebarDeclaration.js.map +1 -1
- package/dist/cli/plugins/sidebar/declaration/sidebar.d.ts +3 -3
- package/dist/cli/plugins/sidebar/index.js +6 -5
- package/dist/cli/plugins/sidebar/index.js.map +1 -1
- package/dist/cli/plugins/sidebar/sidebar-module.d.ts +3 -0
- package/dist/cli/plugins/sidebar/sidebar-module.js +11 -0
- package/dist/cli/plugins/sidebar/sidebar-module.js.map +1 -0
- package/dist/cli/plugins/style/index.d.ts +2 -1
- package/dist/cli/plugins/style/index.js +52 -25
- package/dist/cli/plugins/style/index.js.map +1 -1
- package/dist/cli/plugins/style/types.d.ts +5 -0
- package/dist/cli/plugins/style/types.js +1 -0
- package/dist/cli/plugins/style/types.js.map +1 -0
- package/dist/cli/raw.d.ts +4 -0
- package/dist/cli/resolvers/bundler.js +9 -7
- package/dist/cli/resolvers/bundler.js.map +1 -1
- package/dist/cli/resolvers/config.js +2 -1
- package/dist/cli/resolvers/config.js.map +1 -1
- package/dist/cli/virtual/index.d.ts +2 -2
- package/dist/cli/virtual/index.js +11 -8
- package/dist/cli/virtual/virtual.d.ts +14 -11
- 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 -12
- package/dist/entry/content/adapters/react/Node.js +9 -25
- 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 -10
- package/dist/entry/content/adapters/vanilla/Node.js +11 -34
- 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 +5 -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.d.ts +3 -0
- package/dist/entry/content/lifecycle/context/index.js +9 -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.d.ts +3 -0
- package/dist/entry/content/lifecycle/markers/index.js +9 -0
- package/dist/entry/content/lifecycle/markers/index.js.map +1 -0
- package/dist/entry/content/{core → lifecycle/nodes}/EventNode.d.ts +5 -2
- package/dist/entry/content/{core → lifecycle/nodes}/EventNode.js +14 -2
- package/dist/entry/content/lifecycle/nodes/EventNode.js.map +1 -0
- package/dist/entry/content/lifecycle/nodes/FrameNode.d.ts +29 -0
- 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 +4 -2
- package/dist/entry/content/{core → lifecycle/nodes}/MarkerNode.js +8 -2
- package/dist/entry/content/lifecycle/nodes/MarkerNode.js.map +1 -0
- package/dist/entry/content/{core → lifecycle/nodes}/MountNode.d.ts +4 -2
- package/dist/entry/content/{core → lifecycle/nodes}/MountNode.js +8 -2
- package/dist/entry/content/lifecycle/nodes/MountNode.js.map +1 -0
- package/dist/entry/content/{core → lifecycle/nodes}/Node.d.ts +3 -2
- package/dist/entry/content/{core → lifecycle/nodes}/Node.js +5 -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/lifecycle/nodes/index.d.ts +7 -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/lifecycle/nodes/isolated-styles.d.ts +2 -0
- package/dist/entry/content/lifecycle/nodes/isolated-styles.js +14 -0
- 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 +15 -11
- 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 +32 -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/locale/adapters/react/ReactLocale.d.ts +18 -0
- package/dist/locale/adapters/react/ReactLocale.js +41 -0
- package/dist/locale/adapters/react/ReactLocale.js.map +1 -0
- package/dist/locale/adapters/react/hooks/use-locale-attributes.d.ts +7 -0
- package/dist/locale/adapters/react/hooks/use-locale-attributes.js +30 -0
- package/dist/locale/adapters/react/hooks/use-locale-attributes.js.map +1 -0
- package/dist/locale/adapters/react/hooks/use-locale.d.ts +3 -0
- package/dist/locale/adapters/react/hooks/use-locale.js +17 -0
- package/dist/locale/adapters/react/hooks/use-locale.js.map +1 -0
- package/dist/locale/adapters/react/hooks/use-native-locale.d.ts +3 -0
- package/dist/locale/adapters/react/hooks/use-native-locale.js +10 -0
- package/dist/locale/adapters/react/hooks/use-native-locale.js.map +1 -0
- package/dist/locale/adapters/react/index.d.ts +4 -2
- package/dist/locale/adapters/react/index.js +6 -4
- package/dist/locale/adapters/react/index.js.map +1 -1
- package/dist/locale/adapters/react/types.d.ts +22 -0
- package/dist/locale/adapters/react/types.js +1 -0
- package/dist/locale/adapters/react/types.js.map +1 -0
- package/dist/locale/helpers.d.ts +4 -5
- package/dist/locale/helpers.js +1 -1
- package/dist/locale/helpers.js.map +1 -1
- package/dist/locale/index.d.ts +2 -1
- package/dist/locale/index.js +1 -0
- package/dist/locale/index.js.map +1 -1
- package/dist/locale/providers/AbstractLocale.d.ts +4 -4
- package/dist/locale/providers/AbstractLocale.js +13 -94
- package/dist/locale/providers/AbstractLocale.js.map +1 -1
- package/dist/locale/providers/CustomLocale.d.ts +3 -3
- package/dist/locale/providers/CustomLocale.js +6 -5
- package/dist/locale/providers/CustomLocale.js.map +1 -1
- package/dist/locale/providers/DynamicLocale.d.ts +18 -11
- package/dist/locale/providers/DynamicLocale.js +60 -47
- package/dist/locale/providers/DynamicLocale.js.map +1 -1
- package/dist/locale/providers/NativeLocale.d.ts +4 -7
- package/dist/locale/providers/NativeLocale.js +5 -14
- package/dist/locale/providers/NativeLocale.js.map +1 -1
- package/dist/locale/providers/ObservableLocale.d.ts +35 -0
- package/dist/locale/providers/ObservableLocale.js +179 -0
- package/dist/locale/providers/ObservableLocale.js.map +1 -0
- package/dist/locale/providers/index.d.ts +2 -1
- package/dist/locale/providers/index.js +3 -1
- package/dist/locale/providers/index.js.map +1 -1
- package/dist/locale/storage/LocaleStorage.d.ts +11 -0
- package/dist/locale/storage/LocaleStorage.js +40 -0
- package/dist/locale/storage/LocaleStorage.js.map +1 -0
- package/dist/locale/storage/index.d.ts +1 -0
- package/dist/locale/storage/index.js +5 -0
- package/dist/locale/storage/index.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.d.ts +4 -0
- package/dist/main/entrypoint.js +20 -0
- package/dist/main/entrypoint.js.map +1 -0
- package/dist/main/icon.d.ts +2 -3
- package/dist/main/icon.js +2 -1
- package/dist/main/icon.js.map +1 -1
- package/dist/main/index.d.ts +1 -0
- package/dist/main/index.js +1 -0
- package/dist/main/index.js.map +1 -1
- package/dist/main/offscreen.d.ts +2 -5
- package/dist/main/offscreen.js +5 -2
- package/dist/main/offscreen.js.map +1 -1
- package/dist/main/page.d.ts +2 -4
- package/dist/main/page.js +2 -1
- package/dist/main/page.js.map +1 -1
- package/dist/main/popup.d.ts +2 -5
- package/dist/main/popup.js +3 -3
- package/dist/main/popup.js.map +1 -1
- package/dist/main/relay.d.ts +3 -3
- package/dist/main/relay.js +2 -1
- package/dist/main/relay.js.map +1 -1
- package/dist/main/sandbox.d.ts +1 -4
- package/dist/main/sandbox.js +2 -1
- package/dist/main/sandbox.js.map +1 -1
- package/dist/main/service.d.ts +1 -2
- package/dist/main/service.js.map +1 -1
- package/dist/main/sidebar.d.ts +2 -5
- package/dist/main/sidebar.js +3 -3
- package/dist/main/sidebar.js.map +1 -1
- package/dist/message/index.d.ts +2 -4
- package/dist/message/index.js.map +1 -1
- package/dist/offscreen/index.d.ts +2 -6
- package/dist/offscreen/index.js.map +1 -1
- package/dist/relay/RelayPermission.js +1 -1
- package/dist/relay/index.d.ts +2 -5
- package/dist/relay/index.js.map +1 -1
- package/dist/sandbox/index.d.ts +1 -5
- package/dist/sandbox/index.js.map +1 -1
- package/dist/service/index.d.ts +2 -6
- package/dist/service/index.js.map +1 -1
- package/dist/shared/content/index.d.ts +1 -0
- package/dist/shared/content/index.js +6 -0
- package/dist/shared/content/index.js.map +1 -0
- package/dist/shared/content/isolation.d.ts +4 -0
- package/dist/shared/content/isolation.js +63 -0
- package/dist/shared/content/isolation.js.map +1 -0
- package/dist/shared/locale/index.d.ts +5 -0
- package/dist/shared/locale/index.js +21 -0
- package/dist/shared/locale/index.js.map +1 -0
- package/dist/shared/locale/keys.d.ts +5 -0
- package/dist/shared/locale/keys.js +33 -0
- package/dist/shared/locale/keys.js.map +1 -0
- package/dist/shared/locale/language.d.ts +4 -0
- package/dist/shared/locale/language.js +23 -0
- package/dist/shared/locale/language.js.map +1 -0
- package/dist/shared/locale/messages.d.ts +3 -0
- package/dist/shared/locale/messages.js +9 -0
- package/dist/shared/locale/messages.js.map +1 -0
- package/dist/shared/locale/plural.d.ts +2 -0
- package/dist/shared/locale/plural.js +81 -0
- package/dist/shared/locale/plural.js.map +1 -0
- package/dist/shared/locale/substitutions.d.ts +10 -0
- package/dist/shared/locale/substitutions.js +32 -0
- package/dist/shared/locale/substitutions.js.map +1 -0
- package/dist/types/background.d.ts +1 -1
- package/dist/types/background.js.map +1 -1
- package/dist/types/command.d.ts +1 -1
- package/dist/types/command.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} +119 -59
- package/dist/types/{content.js → content/common.js} +23 -2
- 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/entrypoint.d.ts +20 -0
- package/dist/types/entrypoint.js +4 -0
- package/dist/types/entrypoint.js.map +1 -1
- package/dist/types/icon.d.ts +8 -0
- package/dist/types/icon.js.map +1 -1
- package/dist/types/language.d.ts +57 -0
- package/dist/types/language.js +62 -0
- package/dist/types/language.js.map +1 -0
- package/dist/types/locale.d.ts +34 -63
- package/dist/types/locale.js +62 -119
- package/dist/types/locale.js.map +1 -1
- package/dist/types/manifest.d.ts +11 -8
- package/dist/types/manifest.js.map +1 -1
- package/dist/types/message.d.ts +7 -0
- package/dist/types/message.js.map +1 -1
- package/dist/types/offscreen.d.ts +14 -1
- package/dist/types/offscreen.js.map +1 -1
- package/dist/types/page.d.ts +8 -0
- package/dist/types/popup.d.ts +9 -0
- package/dist/types/relay.d.ts +15 -7
- package/dist/types/relay.js.map +1 -1
- package/dist/types/sandbox.d.ts +12 -0
- package/dist/types/sandbox.js.map +1 -1
- package/dist/types/service.d.ts +10 -1
- package/dist/types/service.js.map +1 -1
- package/dist/types/sidebar.d.ts +9 -0
- package/dist/types/sidebar.js.map +1 -1
- package/dist/types/transport.d.ts +4 -0
- package/dist/virtual/icon.d.ts +2 -0
- package/dist/virtual/icon.js +5 -0
- package/dist/virtual/icon.js.map +1 -0
- package/dist/virtual/locale.d.ts +7 -0
- package/dist/virtual/locale.js +13 -0
- package/dist/virtual/locale.js.map +1 -0
- package/dist/virtual/modules.d.ts +41 -0
- package/dist/virtual/offscreen.d.ts +3 -0
- package/dist/virtual/offscreen.js +5 -0
- package/dist/virtual/offscreen.js.map +1 -0
- package/dist/virtual/page.d.ts +2 -0
- package/dist/virtual/page.js +5 -0
- package/dist/virtual/page.js.map +1 -0
- package/dist/virtual/popup.d.ts +3 -0
- package/dist/virtual/popup.js +5 -0
- package/dist/virtual/popup.js.map +1 -0
- package/dist/virtual/relay.d.ts +3 -0
- package/dist/virtual/relay.js +5 -0
- package/dist/virtual/relay.js.map +1 -0
- package/dist/virtual/runtime.d.ts +8 -0
- package/dist/virtual/runtime.js +9 -0
- package/dist/virtual/runtime.js.map +1 -0
- package/dist/virtual/sandbox.d.ts +3 -0
- package/dist/virtual/sandbox.js +5 -0
- package/dist/virtual/sandbox.js.map +1 -0
- package/dist/virtual/sidebar.d.ts +3 -0
- package/dist/virtual/sidebar.js +5 -0
- package/dist/virtual/sidebar.js.map +1 -0
- package/package.json +53 -23
- package/scripts/clean-dist.js +7 -0
- package/scripts/copy-dts.js +11 -1
- 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 +15 -0
- package/dist/cli/builders/manifest/utils.d.ts +0 -32
- package/dist/cli/builders/manifest/utils.js +0 -209
- package/dist/cli/builders/manifest/utils.js.map +0 -1
- package/dist/cli/bundler/plugins/EntrypointPlugin.js.map +0 -1
- package/dist/cli/bundler/plugins/GenerateJsonPlugin.js +0 -40
- package/dist/cli/bundler/plugins/GenerateJsonPlugin.js.map +0 -1
- package/dist/cli/bundler/plugins/ManifestPlugin.d.ts +0 -10
- package/dist/cli/bundler/plugins/ManifestPlugin.js +0 -78
- package/dist/cli/bundler/plugins/ManifestPlugin.js.map +0 -1
- package/dist/cli/bundler/plugins/ReplacePlugin.js.map +0 -1
- package/dist/cli/bundler/plugins/WatchPlugin.js +0 -21
- package/dist/cli/bundler/plugins/WatchPlugin.js.map +0 -1
- package/dist/cli/bundler/utils/output.d.ts +0 -2
- package/dist/cli/bundler/utils/output.js +0 -15
- package/dist/cli/bundler/utils/output.js.map +0 -1
- package/dist/cli/entrypoint/finder/tests/fixtures/options/discovery/account.options.d.ts +0 -1
- package/dist/cli/entrypoint/finder/tests/fixtures/options/discovery/advanced.options/index.d.ts +0 -1
- package/dist/cli/plugins/output.d.ts +0 -2
- package/dist/cli/plugins/output.js +0 -32
- 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/AbstractMarker.js.map +0 -1
- package/dist/entry/content/core/AttributeMarker.js.map +0 -1
- package/dist/entry/content/core/Builder.d.ts +0 -27
- package/dist/entry/content/core/Builder.js +0 -124
- package/dist/entry/content/core/Builder.js.map +0 -1
- package/dist/entry/content/core/Context.js +0 -43
- package/dist/entry/content/core/Context.js.map +0 -1
- package/dist/entry/content/core/EventEmitter.js.map +0 -1
- package/dist/entry/content/core/EventNode.js.map +0 -1
- package/dist/entry/content/core/ManagedContext.d.ts +0 -5
- package/dist/entry/content/core/ManagedContext.js.map +0 -1
- package/dist/entry/content/core/MarkerNode.js.map +0 -1
- package/dist/entry/content/core/MountBuilder.d.ts +0 -10
- package/dist/entry/content/core/MountBuilder.js +0 -40
- package/dist/entry/content/core/MountBuilder.js.map +0 -1
- package/dist/entry/content/core/MountNode.js.map +0 -1
- package/dist/entry/content/core/Node.js.map +0 -1
- package/dist/entry/content/core/WeakMarker.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/locale/adapters/react/LocaleProvider.d.ts +0 -7
- package/dist/locale/adapters/react/LocaleProvider.js +0 -58
- package/dist/locale/adapters/react/LocaleProvider.js.map +0 -1
- package/dist/locale/adapters/react/context.d.ts +0 -14
- package/dist/locale/adapters/react/context.js +0 -25
- package/dist/locale/adapters/react/context.js.map +0 -1
- package/dist/locale/utils.d.ts +0 -11
- package/dist/locale/utils.js +0 -67
- package/dist/locale/utils.js.map +0 -1
- package/dist/types/content.js.map +0 -1
- /package/dist/cli/bundler/plugins/{ReplacePlugin.d.ts → replace/ReplacePlugin.d.ts} +0 -0
- /package/dist/cli/bundler/plugins/{ReplacePlugin.js → replace/ReplacePlugin.js} +0 -0
- /package/dist/cli/bundler/plugins/{WatchPlugin.d.ts → watch/WatchPlugin.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createManifestDependencies, default } from "./ManifestPlugin.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/manifest/index.ts"],"sourcesContent":["export {createManifestDependencies, default} from \"./ManifestPlugin\";\n"],"mappings":"AAAA,SAAQ,4BAA4B,WAAAA,gBAAc;","names":["default"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/replace/ReplacePlugin.ts"],"sourcesContent":["import {type Compiler} from \"@rspack/core\";\n\ninterface ReplaceOptions {\n values: Record<string, string>;\n}\n\nexport default class ReplacePlugin {\n constructor(private options: ReplaceOptions) {}\n\n apply(compiler: Compiler): void {\n compiler.hooks.emit.tap(\"ReplacePlugin\", compilation => {\n for (const filename in compilation.assets) {\n let content = compilation.assets[filename].source().toString();\n let hasChanges = false;\n\n for (const [search, replace] of Object.entries(this.options.values)) {\n if (content.includes(search)) {\n content = content.replace(new RegExp(search, \"g\"), replace);\n hasChanges = true;\n }\n }\n\n if (hasChanges) {\n const sourceMap = {\n version: 3,\n sources: [],\n names: [],\n mappings: \"\",\n file: filename,\n };\n\n compilation.assets[filename] = {\n source: () => content,\n size: () => content.length,\n buffer: () => Buffer.from(content),\n map: () => sourceMap,\n sourceAndMap: () => ({source: content, map: sourceMap}),\n updateHash: () => {},\n };\n }\n }\n });\n }\n}\n"],"mappings":"AAMA,MAAO,cAA4B;AAAA,EAC/B,YAAoB,SAAyB;AAAzB;AAAA,EAA0B;AAAA,EAA1B;AAAA,EAEpB,MAAM,UAA0B;AAC5B,aAAS,MAAM,KAAK,IAAI,iBAAiB,iBAAe;AACpD,iBAAW,YAAY,YAAY,QAAQ;AACvC,YAAI,UAAU,YAAY,OAAO,QAAQ,EAAE,OAAO,EAAE,SAAS;AAC7D,YAAI,aAAa;AAEjB,mBAAW,CAAC,QAAQ,OAAO,KAAK,OAAO,QAAQ,KAAK,QAAQ,MAAM,GAAG;AACjE,cAAI,QAAQ,SAAS,MAAM,GAAG;AAC1B,sBAAU,QAAQ,QAAQ,IAAI,OAAO,QAAQ,GAAG,GAAG,OAAO;AAC1D,yBAAa;AAAA,UACjB;AAAA,QACJ;AAEA,YAAI,YAAY;AACZ,gBAAM,YAAY;AAAA,YACd,SAAS;AAAA,YACT,SAAS,CAAC;AAAA,YACV,OAAO,CAAC;AAAA,YACR,UAAU;AAAA,YACV,MAAM;AAAA,UACV;AAEA,sBAAY,OAAO,QAAQ,IAAI;AAAA,YAC3B,QAAQ,MAAM;AAAA,YACd,MAAM,MAAM,QAAQ;AAAA,YACpB,QAAQ,MAAM,OAAO,KAAK,OAAO;AAAA,YACjC,KAAK,MAAM;AAAA,YACX,cAAc,OAAO,EAAC,QAAQ,SAAS,KAAK,UAAS;AAAA,YACrD,YAAY,MAAM;AAAA,YAAC;AAAA,UACvB;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ,CAAC;AAAA,EACL;AACJ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./ReplacePlugin.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/replace/index.ts"],"sourcesContent":["export {default} from \"./ReplacePlugin\";\n"],"mappings":"AAAA,SAAQ,WAAAA,gBAAc;","names":["default"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Compiler } from "@rspack/core";
|
|
2
|
+
export interface ResourceAccessPluginRequirement {
|
|
3
|
+
resource: string;
|
|
4
|
+
matches: readonly string[];
|
|
5
|
+
/** Identifies the caller in build diagnostics; it has no effect on access rules. */
|
|
6
|
+
issuer: string;
|
|
7
|
+
/** Optional caller-specific guidance when access is insufficient. */
|
|
8
|
+
hint?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ResourceAccessPluginOptions {
|
|
11
|
+
/** Resolvers run against the final manifest on every compilation, including watch rebuilds. */
|
|
12
|
+
requirements: readonly ResourceAccessPluginRequirement[] | (() => readonly ResourceAccessPluginRequirement[] | Promise<readonly ResourceAccessPluginRequirement[]>);
|
|
13
|
+
}
|
|
14
|
+
/** Validates requested access without granting permissions or modifying the manifest. */
|
|
15
|
+
export default class ResourceAccessPlugin {
|
|
16
|
+
private readonly options;
|
|
17
|
+
constructor(options: ResourceAccessPluginOptions);
|
|
18
|
+
apply(compiler: Compiler): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getManifestHooks } from "../utils/manifest-hooks.js";
|
|
2
|
+
import { validateResourceAccess } from "./utils.js";
|
|
3
|
+
class ResourceAccessPlugin {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
this.options = options;
|
|
6
|
+
}
|
|
7
|
+
options;
|
|
8
|
+
apply(compiler) {
|
|
9
|
+
compiler.hooks.compilation.tap("ResourceAccessPlugin", (compilation) => {
|
|
10
|
+
getManifestHooks(compilation).validate.tapPromise("ResourceAccessPlugin", async (manifest) => {
|
|
11
|
+
const requirements = typeof this.options.requirements === "function" ? await this.options.requirements() : this.options.requirements;
|
|
12
|
+
validateResourceAccess(requirements, manifest);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
ResourceAccessPlugin as default
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=ResourceAccessPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/resource-access/ResourceAccessPlugin.ts"],"sourcesContent":["import type {Compiler} from \"@rspack/core\";\n\nimport {getManifestHooks} from \"../utils/manifest-hooks\";\nimport {validateResourceAccess} from \"./utils\";\n\nexport interface ResourceAccessPluginRequirement {\n resource: string;\n matches: readonly string[];\n /** Identifies the caller in build diagnostics; it has no effect on access rules. */\n issuer: string;\n /** Optional caller-specific guidance when access is insufficient. */\n hint?: string;\n}\n\nexport interface ResourceAccessPluginOptions {\n /** Resolvers run against the final manifest on every compilation, including watch rebuilds. */\n requirements:\n | readonly ResourceAccessPluginRequirement[]\n | (() => readonly ResourceAccessPluginRequirement[] | Promise<readonly ResourceAccessPluginRequirement[]>);\n}\n\n/** Validates requested access without granting permissions or modifying the manifest. */\nexport default class ResourceAccessPlugin {\n public constructor(private readonly options: ResourceAccessPluginOptions) {}\n\n public apply(compiler: Compiler): void {\n compiler.hooks.compilation.tap(\"ResourceAccessPlugin\", compilation => {\n getManifestHooks(compilation).validate.tapPromise(\"ResourceAccessPlugin\", async manifest => {\n const requirements =\n typeof this.options.requirements === \"function\"\n ? await this.options.requirements()\n : this.options.requirements;\n\n validateResourceAccess(requirements, manifest);\n });\n });\n }\n}\n"],"mappings":"AAEA,SAAQ,wBAAuB;AAC/B,SAAQ,8BAA6B;AAmBrC,MAAO,qBAAmC;AAAA,EAC/B,YAA6B,SAAsC;AAAtC;AAAA,EAAuC;AAAA,EAAvC;AAAA,EAE7B,MAAM,UAA0B;AACnC,aAAS,MAAM,YAAY,IAAI,wBAAwB,iBAAe;AAClE,uBAAiB,WAAW,EAAE,SAAS,WAAW,wBAAwB,OAAM,aAAY;AACxF,cAAM,eACF,OAAO,KAAK,QAAQ,iBAAiB,aAC/B,MAAM,KAAK,QAAQ,aAAa,IAChC,KAAK,QAAQ;AAEvB,+BAAuB,cAAc,QAAQ;AAAA,MACjD,CAAC;AAAA,IACL,CAAC;AAAA,EACL;AACJ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, type ResourceAccessPluginOptions, type ResourceAccessPluginRequirement } from "./ResourceAccessPlugin.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/resource-access/index.ts"],"sourcesContent":["export {default, type ResourceAccessPluginOptions, type ResourceAccessPluginRequirement} from \"./ResourceAccessPlugin\";\n"],"mappings":"AAAA,SAAQ,WAAAA,gBAAsF;","names":["default"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ResourceAccessPluginRequirement } from "./ResourceAccessPlugin.js";
|
|
2
|
+
interface AccessManifest {
|
|
3
|
+
manifest_version: number;
|
|
4
|
+
web_accessible_resources?: unknown;
|
|
5
|
+
}
|
|
6
|
+
/** Proves origin-set containment; checking sample URLs cannot prove wildcard coverage. */
|
|
7
|
+
export declare const validateResourceAccess: (requirements: Iterable<ResourceAccessPluginRequirement>, manifest: AccessManifest) => void;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const resourceMatches = (pattern, filename) => new RegExp(
|
|
2
|
+
"^" + pattern.replace(/^\//, "").split("*").map((part) => part.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join(".*") + "$"
|
|
3
|
+
).test(filename);
|
|
4
|
+
const origins = (pattern) => {
|
|
5
|
+
if (pattern === "<all_urls>")
|
|
6
|
+
return ["http", "https", "file", "ftp", "ws", "wss"].map((scheme) => ({ scheme, host: "*" }));
|
|
7
|
+
const match = /^(\*|https?|file|ftp|wss?):\/\/([^/]*)(\/.*)$/.exec(pattern);
|
|
8
|
+
if (!match) throw new Error(`Cannot verify resource access for match pattern "${pattern}"`);
|
|
9
|
+
return (match[1] === "*" ? ["http", "https"] : [match[1]]).map((scheme) => ({ scheme, host: match[2].toLowerCase() }));
|
|
10
|
+
};
|
|
11
|
+
const coversHost = (allowed, requested) => {
|
|
12
|
+
if (allowed === "*" || allowed === requested) return true;
|
|
13
|
+
if (!allowed.startsWith("*.")) return false;
|
|
14
|
+
const suffix = allowed.slice(2);
|
|
15
|
+
const host = requested.startsWith("*.") ? requested.slice(2) : requested;
|
|
16
|
+
return host === suffix || host.endsWith("." + suffix);
|
|
17
|
+
};
|
|
18
|
+
const validateResourceAccess = (requirements, manifest) => {
|
|
19
|
+
const rules = Array.isArray(manifest.web_accessible_resources) ? manifest.web_accessible_resources : [];
|
|
20
|
+
for (const { resource, matches, issuer, hint } of requirements) {
|
|
21
|
+
const applicable = manifest.manifest_version === 2 ? rules.filter((rule) => typeof rule === "string" && resourceMatches(rule, resource)) : rules.filter(
|
|
22
|
+
(rule) => Array.isArray(rule == null ? void 0 : rule.resources) && rule.resources.some((pattern) => resourceMatches(pattern, resource))
|
|
23
|
+
);
|
|
24
|
+
const allowed = manifest.manifest_version === 2 ? [] : applicable.flatMap((rule) => (rule.matches ?? []).flatMap((pattern) => origins(pattern)));
|
|
25
|
+
const missing = manifest.manifest_version === 2 ? applicable.length ? [] : matches : matches.filter(
|
|
26
|
+
(pattern) => !origins(pattern).every(
|
|
27
|
+
(requested) => allowed.some(
|
|
28
|
+
(origin) => origin.scheme === requested.scheme && coversHost(origin.host, requested.host)
|
|
29
|
+
)
|
|
30
|
+
)
|
|
31
|
+
);
|
|
32
|
+
if (!applicable.length || missing.length) {
|
|
33
|
+
throw new Error(
|
|
34
|
+
`${issuer} cannot access resource "${resource}" for ${missing.join(", ") || "the requested matches"}; ${hint ?? "ensure web_accessible_resources covers the resource and requested matches"}`
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
validateResourceAccess
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/resource-access/utils.ts"],"sourcesContent":["import type {ResourceAccessPluginRequirement} from \"./ResourceAccessPlugin\";\n\ninterface AccessManifest {\n manifest_version: number;\n web_accessible_resources?: unknown;\n}\n\nconst resourceMatches = (pattern: string, filename: string): boolean =>\n new RegExp(\n \"^\" +\n pattern\n .replace(/^\\//, \"\")\n .split(\"*\")\n .map(part => part.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\"))\n .join(\".*\") +\n \"$\"\n ).test(filename);\n\nconst origins = (pattern: string): Array<{scheme: string; host: string}> => {\n if (pattern === \"<all_urls>\")\n return [\"http\", \"https\", \"file\", \"ftp\", \"ws\", \"wss\"].map(scheme => ({scheme, host: \"*\"}));\n const match = /^(\\*|https?|file|ftp|wss?):\\/\\/([^/]*)(\\/.*)$/.exec(pattern);\n if (!match) throw new Error(`Cannot verify resource access for match pattern \"${pattern}\"`);\n return (match[1] === \"*\" ? [\"http\", \"https\"] : [match[1]]).map(scheme => ({scheme, host: match[2].toLowerCase()}));\n};\n\nconst coversHost = (allowed: string, requested: string): boolean => {\n if (allowed === \"*\" || allowed === requested) return true;\n if (!allowed.startsWith(\"*.\")) return false;\n const suffix = allowed.slice(2);\n const host = requested.startsWith(\"*.\") ? requested.slice(2) : requested;\n return host === suffix || host.endsWith(\".\" + suffix);\n};\n\n/** Proves origin-set containment; checking sample URLs cannot prove wildcard coverage. */\nexport const validateResourceAccess = (\n requirements: Iterable<ResourceAccessPluginRequirement>,\n manifest: AccessManifest\n): void => {\n const rules = Array.isArray(manifest.web_accessible_resources) ? manifest.web_accessible_resources : [];\n for (const {resource, matches, issuer, hint} of requirements) {\n const applicable =\n manifest.manifest_version === 2\n ? rules.filter(rule => typeof rule === \"string\" && resourceMatches(rule, resource))\n : rules.filter(\n rule =>\n Array.isArray(rule?.resources) &&\n rule.resources.some((pattern: string) => resourceMatches(pattern, resource))\n );\n const allowed =\n manifest.manifest_version === 2\n ? []\n : applicable.flatMap(rule => (rule.matches ?? []).flatMap((pattern: string) => origins(pattern)));\n const missing =\n manifest.manifest_version === 2\n ? applicable.length\n ? []\n : matches\n : matches.filter(\n pattern =>\n !origins(pattern).every(requested =>\n allowed.some(\n origin =>\n origin.scheme === requested.scheme && coversHost(origin.host, requested.host)\n )\n )\n );\n if (!applicable.length || missing.length) {\n throw new Error(\n `${issuer} cannot access resource \"${resource}\" for ${missing.join(\", \") || \"the requested matches\"}; ${hint ?? \"ensure web_accessible_resources covers the resource and requested matches\"}`\n );\n }\n }\n};\n"],"mappings":"AAOA,MAAM,kBAAkB,CAAC,SAAiB,aACtC,IAAI;AAAA,EACA,MACI,QACK,QAAQ,OAAO,EAAE,EACjB,MAAM,GAAG,EACT,IAAI,UAAQ,KAAK,QAAQ,uBAAuB,MAAM,CAAC,EACvD,KAAK,IAAI,IACd;AACR,EAAE,KAAK,QAAQ;AAEnB,MAAM,UAAU,CAAC,YAA2D;AACxE,MAAI,YAAY;AACZ,WAAO,CAAC,QAAQ,SAAS,QAAQ,OAAO,MAAM,KAAK,EAAE,IAAI,aAAW,EAAC,QAAQ,MAAM,IAAG,EAAE;AAC5F,QAAM,QAAQ,gDAAgD,KAAK,OAAO;AAC1E,MAAI,CAAC,MAAO,OAAM,IAAI,MAAM,oDAAoD,OAAO,GAAG;AAC1F,UAAQ,MAAM,CAAC,MAAM,MAAM,CAAC,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,aAAW,EAAC,QAAQ,MAAM,MAAM,CAAC,EAAE,YAAY,EAAC,EAAE;AACrH;AAEA,MAAM,aAAa,CAAC,SAAiB,cAA+B;AAChE,MAAI,YAAY,OAAO,YAAY,UAAW,QAAO;AACrD,MAAI,CAAC,QAAQ,WAAW,IAAI,EAAG,QAAO;AACtC,QAAM,SAAS,QAAQ,MAAM,CAAC;AAC9B,QAAM,OAAO,UAAU,WAAW,IAAI,IAAI,UAAU,MAAM,CAAC,IAAI;AAC/D,SAAO,SAAS,UAAU,KAAK,SAAS,MAAM,MAAM;AACxD;AAGO,MAAM,yBAAyB,CAClC,cACA,aACO;AACP,QAAM,QAAQ,MAAM,QAAQ,SAAS,wBAAwB,IAAI,SAAS,2BAA2B,CAAC;AACtG,aAAW,EAAC,UAAU,SAAS,QAAQ,KAAI,KAAK,cAAc;AAC1D,UAAM,aACF,SAAS,qBAAqB,IACxB,MAAM,OAAO,UAAQ,OAAO,SAAS,YAAY,gBAAgB,MAAM,QAAQ,CAAC,IAChF,MAAM;AAAA,MACF,UACI,MAAM,QAAQ,6BAAM,SAAS,KAC7B,KAAK,UAAU,KAAK,CAAC,YAAoB,gBAAgB,SAAS,QAAQ,CAAC;AAAA,IACnF;AACV,UAAM,UACF,SAAS,qBAAqB,IACxB,CAAC,IACD,WAAW,QAAQ,WAAS,KAAK,WAAW,CAAC,GAAG,QAAQ,CAAC,YAAoB,QAAQ,OAAO,CAAC,CAAC;AACxG,UAAM,UACF,SAAS,qBAAqB,IACxB,WAAW,SACP,CAAC,IACD,UACJ,QAAQ;AAAA,MACJ,aACI,CAAC,QAAQ,OAAO,EAAE;AAAA,QAAM,eACpB,QAAQ;AAAA,UACJ,YACI,OAAO,WAAW,UAAU,UAAU,WAAW,OAAO,MAAM,UAAU,IAAI;AAAA,QACpF;AAAA,MACJ;AAAA,IACR;AACV,QAAI,CAAC,WAAW,UAAU,QAAQ,QAAQ;AACtC,YAAM,IAAI;AAAA,QACN,GAAG,MAAM,4BAA4B,QAAQ,SAAS,QAAQ,KAAK,IAAI,KAAK,uBAAuB,KAAK,QAAQ,2EAA2E;AAAA,MAC/L;AAAA,IACJ;AAAA,EACJ;AACJ;","names":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Identifies the property a plugin installs on each selected bundler runtime. */
|
|
2
|
+
export interface RuntimePropertyOptions {
|
|
3
|
+
readonly property: string;
|
|
4
|
+
}
|
|
5
|
+
/** Names a module export that reads one property of the calling bundler runtime. */
|
|
6
|
+
export interface RuntimeModuleReaderOptions extends RuntimePropertyOptions {
|
|
7
|
+
readonly export: string;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Compilation } from "@rspack/core";
|
|
2
|
+
import type { EntrypointAssetsMap } from "../../../../types/entrypoint.js";
|
|
3
|
+
export declare const setCompilationBuildAssets: (compilation: Compilation, assets: EntrypointAssetsMap) => void;
|
|
4
|
+
export declare const getCompilationBuildAssets: (compilation: Compilation) => EntrypointAssetsMap | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const compilationBuildAssets = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
const setCompilationBuildAssets = (compilation, assets) => {
|
|
3
|
+
compilationBuildAssets.set(compilation, assets);
|
|
4
|
+
};
|
|
5
|
+
const getCompilationBuildAssets = (compilation) => {
|
|
6
|
+
return compilationBuildAssets.get(compilation);
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
getCompilationBuildAssets,
|
|
10
|
+
setCompilationBuildAssets
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=compilation-assets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/utils/compilation-assets.ts"],"sourcesContent":["import type {Compilation} from \"@rspack/core\";\n\nimport type {EntrypointAssetsMap} from \"@typing/entrypoint\";\n\nconst compilationBuildAssets = new WeakMap<Compilation, EntrypointAssetsMap>();\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":"AAIA,MAAM,yBAAyB,oBAAI,QAA0C;AAEtE,MAAM,4BAA4B,CAAC,aAA0B,WAAsC;AACtG,yBAAuB,IAAI,aAAa,MAAM;AAClD;AAEO,MAAM,4BAA4B,CAAC,gBAA8D;AACpG,SAAO,uBAAuB,IAAI,WAAW;AACjD;","names":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { getManifestHooks, type ManifestHooks } from "./manifest-hooks.js";
|
|
2
|
+
export { renderRuntimeTemplate } from "./runtime-template.js";
|
|
3
|
+
export { watchCompilation } from "./watch-compilation.js";
|
|
4
|
+
export { createRuntimeModule } from "./runtime-module.js";
|
|
5
|
+
export { getCompilationBuildAssets, setCompilationBuildAssets } from "./compilation-assets.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getManifestHooks } from "./manifest-hooks.js";
|
|
2
|
+
import { renderRuntimeTemplate } from "./runtime-template.js";
|
|
3
|
+
import { watchCompilation } from "./watch-compilation.js";
|
|
4
|
+
import { createRuntimeModule } from "./runtime-module.js";
|
|
5
|
+
import { getCompilationBuildAssets, setCompilationBuildAssets } from "./compilation-assets.js";
|
|
6
|
+
export {
|
|
7
|
+
createRuntimeModule,
|
|
8
|
+
getCompilationBuildAssets,
|
|
9
|
+
getManifestHooks,
|
|
10
|
+
renderRuntimeTemplate,
|
|
11
|
+
setCompilationBuildAssets,
|
|
12
|
+
watchCompilation
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/utils/index.ts"],"sourcesContent":["export {getManifestHooks, type ManifestHooks} from \"./manifest-hooks\";\nexport {renderRuntimeTemplate} from \"./runtime-template\";\nexport {watchCompilation} from \"./watch-compilation\";\nexport {createRuntimeModule} from \"./runtime-module\";\nexport {getCompilationBuildAssets, setCompilationBuildAssets} from \"./compilation-assets\";\n"],"mappings":"AAAA,SAAQ,wBAA2C;AACnD,SAAQ,6BAA4B;AACpC,SAAQ,wBAAuB;AAC/B,SAAQ,2BAA0B;AAClC,SAAQ,2BAA2B,iCAAgC;","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Compilation } from "@rspack/core";
|
|
2
|
+
import { AsyncSeriesHook } from "@rspack/lite-tapable";
|
|
3
|
+
import type { ReadonlyDeep } from "type-fest";
|
|
4
|
+
import type { EntrypointAssetsMap } from "../../../../types/entrypoint.js";
|
|
5
|
+
import type { Manifest, ManifestDependencies } from "../../../../types/manifest.js";
|
|
6
|
+
export interface ManifestHooks {
|
|
7
|
+
/** Prepare manifest-only file lists after output names are final; do not alter the runtime assets map. */
|
|
8
|
+
prepareDependencies: AsyncSeriesHook<[ManifestDependencies, ReadonlyDeep<EntrypointAssetsMap>]>;
|
|
9
|
+
/** Validate the final merged manifest before serialization. This hook must not modify it. */
|
|
10
|
+
validate: AsyncSeriesHook<[ReadonlyDeep<Manifest>]>;
|
|
11
|
+
}
|
|
12
|
+
/** Share hooks within one compilation without retaining subscriptions across watch rebuilds. */
|
|
13
|
+
export declare const getManifestHooks: (compilation: Compilation) => ManifestHooks;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AsyncSeriesHook } from "@rspack/lite-tapable";
|
|
2
|
+
const compilationHooks = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
const getManifestHooks = (compilation) => {
|
|
4
|
+
let hooks = compilationHooks.get(compilation);
|
|
5
|
+
if (!hooks) {
|
|
6
|
+
hooks = {
|
|
7
|
+
prepareDependencies: new AsyncSeriesHook(["dependencies", "buildAssets"]),
|
|
8
|
+
validate: new AsyncSeriesHook(["manifest"])
|
|
9
|
+
};
|
|
10
|
+
compilationHooks.set(compilation, hooks);
|
|
11
|
+
}
|
|
12
|
+
return hooks;
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
getManifestHooks
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=manifest-hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/utils/manifest-hooks.ts"],"sourcesContent":["import type {Compilation} from \"@rspack/core\";\nimport {AsyncSeriesHook} from \"@rspack/lite-tapable\";\nimport type {ReadonlyDeep} from \"type-fest\";\n\nimport type {EntrypointAssetsMap} from \"@typing/entrypoint\";\nimport type {Manifest, ManifestDependencies} from \"@typing/manifest\";\n\nexport interface ManifestHooks {\n /** Prepare manifest-only file lists after output names are final; do not alter the runtime assets map. */\n prepareDependencies: AsyncSeriesHook<[ManifestDependencies, ReadonlyDeep<EntrypointAssetsMap>]>;\n /** Validate the final merged manifest before serialization. This hook must not modify it. */\n validate: AsyncSeriesHook<[ReadonlyDeep<Manifest>]>;\n}\n\nconst compilationHooks = new WeakMap<Compilation, ManifestHooks>();\n\n/** Share hooks within one compilation without retaining subscriptions across watch rebuilds. */\nexport const getManifestHooks = (compilation: Compilation): ManifestHooks => {\n let hooks = compilationHooks.get(compilation);\n\n if (!hooks) {\n hooks = {\n prepareDependencies: new AsyncSeriesHook([\"dependencies\", \"buildAssets\"]),\n validate: new AsyncSeriesHook([\"manifest\"]),\n };\n compilationHooks.set(compilation, hooks);\n }\n\n return hooks;\n};\n"],"mappings":"AACA,SAAQ,uBAAsB;AAa9B,MAAM,mBAAmB,oBAAI,QAAoC;AAG1D,MAAM,mBAAmB,CAAC,gBAA4C;AACzE,MAAI,QAAQ,iBAAiB,IAAI,WAAW;AAE5C,MAAI,CAAC,OAAO;AACR,YAAQ;AAAA,MACJ,qBAAqB,IAAI,gBAAgB,CAAC,gBAAgB,aAAa,CAAC;AAAA,MACxE,UAAU,IAAI,gBAAgB,CAAC,UAAU,CAAC;AAAA,IAC9C;AACA,qBAAiB,IAAI,aAAa,KAAK;AAAA,EAC3C;AAEA,SAAO;AACX;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RuntimeGlobals } from "@rspack/core";
|
|
2
|
+
const createRuntimeModule = (readers) => {
|
|
3
|
+
return readers.map(
|
|
4
|
+
({ export: name, property }) => `export const ${name} = () => ${RuntimeGlobals.require}[${JSON.stringify(property)}];
|
|
5
|
+
`
|
|
6
|
+
).join("");
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
createRuntimeModule
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=runtime-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/utils/runtime-module.ts"],"sourcesContent":["import {RuntimeGlobals} from \"@rspack/core\";\n\nimport type {RuntimeModuleReaderOptions} from \"../types\";\n\n/** Read the calling entrypoint's live runtime without initializing other features. */\nexport const createRuntimeModule = (readers: readonly RuntimeModuleReaderOptions[]): string => {\n return readers\n .map(\n ({export: name, property}) =>\n `export const ${name} = () => ${RuntimeGlobals.require}[${JSON.stringify(property)}];\\n`\n )\n .join(\"\");\n};\n"],"mappings":"AAAA,SAAQ,sBAAqB;AAKtB,MAAM,sBAAsB,CAAC,YAA2D;AAC3F,SAAO,QACF;AAAA,IACG,CAAC,EAAC,QAAQ,MAAM,SAAQ,MACpB,gBAAgB,IAAI,YAAY,eAAe,OAAO,IAAI,KAAK,UAAU,QAAQ,CAAC;AAAA;AAAA,EAC1F,EACC,KAAK,EAAE;AAChB;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const renderRuntimeTemplate: (template: string, values: Readonly<Record<string, string>>) => string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const PlaceholderPattern = /__ADNBN_[A-Z0-9_]+__/g;
|
|
2
|
+
const renderRuntimeTemplate = (template, values) => {
|
|
3
|
+
for (const placeholder of Object.keys(values)) {
|
|
4
|
+
if (!template.includes(placeholder)) {
|
|
5
|
+
throw new Error(`Runtime template placeholder "${placeholder}" is unavailable`);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return template.replace(PlaceholderPattern, (placeholder) => {
|
|
9
|
+
if (!Object.hasOwn(values, placeholder)) {
|
|
10
|
+
throw new Error(`Runtime template placeholder "${placeholder}" was not replaced`);
|
|
11
|
+
}
|
|
12
|
+
return values[placeholder];
|
|
13
|
+
}).trim();
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
renderRuntimeTemplate
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=runtime-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/utils/runtime-template.ts"],"sourcesContent":["const PlaceholderPattern = /__ADNBN_[A-Z0-9_]+__/g;\n\nexport const renderRuntimeTemplate = (template: string, values: Readonly<Record<string, string>>): string => {\n for (const placeholder of Object.keys(values)) {\n if (!template.includes(placeholder)) {\n throw new Error(`Runtime template placeholder \"${placeholder}\" is unavailable`);\n }\n }\n\n // Substitute once: inserted data is literal, not another template or a replacement pattern.\n return template\n .replace(PlaceholderPattern, placeholder => {\n if (!Object.hasOwn(values, placeholder)) {\n throw new Error(`Runtime template placeholder \"${placeholder}\" was not replaced`);\n }\n return values[placeholder];\n })\n .trim();\n};\n"],"mappings":"AAAA,MAAM,qBAAqB;AAEpB,MAAM,wBAAwB,CAAC,UAAkB,WAAqD;AACzG,aAAW,eAAe,OAAO,KAAK,MAAM,GAAG;AAC3C,QAAI,CAAC,SAAS,SAAS,WAAW,GAAG;AACjC,YAAM,IAAI,MAAM,iCAAiC,WAAW,kBAAkB;AAAA,IAClF;AAAA,EACJ;AAGA,SAAO,SACF,QAAQ,oBAAoB,iBAAe;AACxC,QAAI,CAAC,OAAO,OAAO,QAAQ,WAAW,GAAG;AACrC,YAAM,IAAI,MAAM,iCAAiC,WAAW,oBAAoB;AAAA,IACpF;AACA,WAAO,OAAO,WAAW;AAAA,EAC7B,CAAC,EACA,KAAK;AACd;","names":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const watchCompilation = (compiler, name, update) => {
|
|
2
|
+
let failure;
|
|
3
|
+
compiler.hooks.watchRun.tapPromise(name, async () => {
|
|
4
|
+
failure = void 0;
|
|
5
|
+
try {
|
|
6
|
+
await update();
|
|
7
|
+
} catch (error) {
|
|
8
|
+
failure = error instanceof Error ? error : new Error(String(error));
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
compiler.hooks.thisCompilation.tap(name, (compilation) => {
|
|
12
|
+
if (failure) compilation.errors.push(failure);
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
watchCompilation
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=watch-compilation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/utils/watch-compilation.ts"],"sourcesContent":["import type {Compiler} from \"@rspack/core\";\n\n/** Report failed updates as compilation errors so watch stays connected for the next edit. */\nexport const watchCompilation = (compiler: Compiler, name: string, update: () => Promise<void>): void => {\n let failure: Error | undefined;\n\n compiler.hooks.watchRun.tapPromise(name, async () => {\n failure = undefined;\n\n try {\n await update();\n } catch (error) {\n failure = error instanceof Error ? error : new Error(String(error));\n }\n });\n\n compiler.hooks.thisCompilation.tap(name, compilation => {\n if (failure) compilation.errors.push(failure);\n });\n};\n"],"mappings":"AAGO,MAAM,mBAAmB,CAAC,UAAoB,MAAc,WAAsC;AACrG,MAAI;AAEJ,WAAS,MAAM,SAAS,WAAW,MAAM,YAAY;AACjD,cAAU;AAEV,QAAI;AACA,YAAM,OAAO;AAAA,IACjB,SAAS,OAAO;AACZ,gBAAU,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,KAAK,CAAC;AAAA,IACtE;AAAA,EACJ,CAAC;AAED,WAAS,MAAM,gBAAgB,IAAI,MAAM,iBAAe;AACpD,QAAI,QAAS,aAAY,OAAO,KAAK,OAAO;AAAA,EAChD,CAAC;AACL;","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { watchCompilation } from "../utils/index.js";
|
|
2
|
+
class WatchPlugin {
|
|
3
|
+
constructor(callback) {
|
|
4
|
+
this.callback = callback;
|
|
5
|
+
}
|
|
6
|
+
callback;
|
|
7
|
+
apply(compiler) {
|
|
8
|
+
watchCompilation(compiler, "WatchPlugin", async () => {
|
|
9
|
+
await this.callback(compiler.modifiedFiles ?? /* @__PURE__ */ new Set());
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
WatchPlugin as default
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=WatchPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/watch/WatchPlugin.ts"],"sourcesContent":["import {Compiler} from \"@rspack/core\";\nimport {watchCompilation} from \"../utils\";\n\nexport type WatchPluginCallback = (files: ReadonlySet<string>) => Promise<void>;\n\nexport default class WatchPlugin {\n constructor(private readonly callback: WatchPluginCallback) {}\n\n public apply(compiler: Compiler): void {\n watchCompilation(compiler, \"WatchPlugin\", async () => {\n await this.callback(compiler.modifiedFiles ?? new Set());\n });\n }\n}\n"],"mappings":"AACA,SAAQ,wBAAuB;AAI/B,MAAO,YAA0B;AAAA,EAC7B,YAA6B,UAA+B;AAA/B;AAAA,EAAgC;AAAA,EAAhC;AAAA,EAEtB,MAAM,UAA0B;AACnC,qBAAiB,UAAU,eAAe,YAAY;AAClD,YAAM,KAAK,SAAS,SAAS,iBAAiB,oBAAI,IAAI,CAAC;AAAA,IAC3D,CAAC;AAAA,EACL;AACJ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, type WatchPluginCallback } from "./WatchPlugin.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/bundler/plugins/watch/index.ts"],"sourcesContent":["export {default, type WatchPluginCallback} from \"./WatchPlugin\";\n"],"mappings":"AAAA,SAAQ,WAAAA,gBAAwC;","names":["default"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import path from "path";
|
|
3
|
+
const appFilenameResolver = (app, filename, dirname) => {
|
|
4
|
+
app = _.kebabCase(app);
|
|
5
|
+
const resolve = (name) => {
|
|
6
|
+
name = name.replaceAll("[app]", app);
|
|
7
|
+
return dirname ? path.posix.join(dirname, name) : name;
|
|
8
|
+
};
|
|
9
|
+
if (!_.isFunction(filename)) {
|
|
10
|
+
return resolve(filename);
|
|
11
|
+
}
|
|
12
|
+
return (pathData, assetInfo) => {
|
|
13
|
+
return resolve(filename(pathData, assetInfo));
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
appFilenameResolver
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=app-filename.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/cli/bundler/utils/app-filename.ts"],"sourcesContent":["import type {Filename} from \"@rspack/core\";\nimport _ from \"lodash\";\nimport path from \"path\";\n\nexport const appFilenameResolver = (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"],"mappings":"AACA,OAAO,OAAO;AACd,OAAO,UAAU;AAEV,MAAM,sBAAsB,CAAC,KAAa,UAAoB,YAA+B;AAChG,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,UAAU,cAAsB;AACpC,WAAO,QAAQ,SAAS,UAAU,SAAS,CAAC;AAAA,EAChD;AACJ;","names":[]}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import postcss from "postcss";
|
|
3
|
+
import valueParser from "postcss-value-parser";
|
|
4
|
+
import { toPosix } from "./../../../cli/utils/path.js";
|
|
5
|
+
const addRelatedSourceMaps = (sourceMaps, related) => {
|
|
6
|
+
const sourceMap = related == null ? void 0 : related.sourceMap;
|
|
7
|
+
if (Array.isArray(sourceMap)) {
|
|
8
|
+
sourceMap.forEach((file) => sourceMaps.add(toPosix(file)));
|
|
9
|
+
} else if (sourceMap) {
|
|
10
|
+
sourceMaps.add(toPosix(sourceMap));
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const getRelatedSourceMaps = (compilation) => {
|
|
14
|
+
const sourceMaps = /* @__PURE__ */ new Set();
|
|
15
|
+
compilation.getAssets().forEach(({ info }) => addRelatedSourceMaps(sourceMaps, info.related));
|
|
16
|
+
return sourceMaps;
|
|
17
|
+
};
|
|
18
|
+
const isIgnoredAsset = (file, info, sourceMaps) => {
|
|
19
|
+
return Boolean(info.development || info.hotModuleReplacement || sourceMaps.has(file));
|
|
20
|
+
};
|
|
21
|
+
const classifyAsset = (file, info, fromModuleAssets) => {
|
|
22
|
+
if (info.assetType === "javascript") {
|
|
23
|
+
return "js";
|
|
24
|
+
}
|
|
25
|
+
if (info.assetType === "css" || info.assetType === "extract-css") {
|
|
26
|
+
return "css";
|
|
27
|
+
}
|
|
28
|
+
if (info.assetType || info.sourceFilename || fromModuleAssets) {
|
|
29
|
+
return "asset";
|
|
30
|
+
}
|
|
31
|
+
if (file.endsWith(".js") || file.endsWith(".mjs") || file.endsWith(".cjs")) {
|
|
32
|
+
return "js";
|
|
33
|
+
}
|
|
34
|
+
if (file.endsWith(".css")) {
|
|
35
|
+
return "css";
|
|
36
|
+
}
|
|
37
|
+
return "asset";
|
|
38
|
+
};
|
|
39
|
+
const getAssetKind = (compilation, file, sourceMaps, fromModuleAssets = false) => {
|
|
40
|
+
file = toPosix(file);
|
|
41
|
+
const asset = compilation.getAsset(file);
|
|
42
|
+
if (!asset || isIgnoredAsset(file, asset.info, sourceMaps)) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
return classifyAsset(file, asset.info, fromModuleAssets);
|
|
46
|
+
};
|
|
47
|
+
const getModuleAssetNames = (module) => {
|
|
48
|
+
var _a;
|
|
49
|
+
return Object.keys(((_a = module.buildInfo) == null ? void 0 : _a.assets) ?? {});
|
|
50
|
+
};
|
|
51
|
+
const collectResources = (compilation, chunks, sourceMaps) => {
|
|
52
|
+
var _a, _b;
|
|
53
|
+
const candidates = /* @__PURE__ */ new Map();
|
|
54
|
+
const cssFiles = /* @__PURE__ */ new Set();
|
|
55
|
+
const sourceFiles = /* @__PURE__ */ new Set();
|
|
56
|
+
for (const chunk of chunks) {
|
|
57
|
+
for (const file of [...chunk.files, ...chunk.auxiliaryFiles]) {
|
|
58
|
+
const normalized = toPosix(file);
|
|
59
|
+
candidates.set(normalized, candidates.get(normalized) ?? false);
|
|
60
|
+
if (getAssetKind(compilation, normalized, sourceMaps) === "css") {
|
|
61
|
+
cssFiles.add(normalized);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
for (const module of compilation.chunkGraph.getChunkModulesIterable(chunk)) {
|
|
65
|
+
for (const file of getModuleAssetNames(module)) {
|
|
66
|
+
candidates.set(toPosix(file), true);
|
|
67
|
+
}
|
|
68
|
+
if (module.type === "css/mini-extract") {
|
|
69
|
+
for (const dependency of ((_a = module.buildInfo) == null ? void 0 : _a.fileDependencies) ?? []) {
|
|
70
|
+
sourceFiles.add(path.resolve(dependency));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const resources = compilation.getAssets().filter(
|
|
76
|
+
(asset) => getAssetKind(compilation, asset.name, sourceMaps) === "asset" && (!asset.info.sourceFilename || sourceFiles.has(
|
|
77
|
+
path.resolve(compilation.compiler.context, asset.info.sourceFilename.split(/[?#]/)[0])
|
|
78
|
+
))
|
|
79
|
+
).map((asset) => asset.name).sort((left, right) => right.length - left.length);
|
|
80
|
+
for (const file of cssFiles) {
|
|
81
|
+
const css = (_b = compilation.getAsset(file)) == null ? void 0 : _b.source.source().toString();
|
|
82
|
+
if (!css) {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
postcss.parse(css, { from: file }).walkDecls((declaration) => {
|
|
86
|
+
valueParser(declaration.value).walk((node) => {
|
|
87
|
+
if (node.type !== "function" || node.value.toLowerCase() !== "url") {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const argument = node.nodes[0];
|
|
91
|
+
if (!argument || argument.type !== "string" && argument.type !== "word") {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
const url = argument.value.replace(
|
|
95
|
+
/\\([\da-f]{1,6}\s?|.)/gi,
|
|
96
|
+
(_match, escape) => /^[\da-f]{1,6}\s?$/i.test(escape) ? String.fromCodePoint(parseInt(escape.trim(), 16) || 65533) : escape
|
|
97
|
+
);
|
|
98
|
+
if (/^(?:data|blob):/i.test(url)) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
try {
|
|
102
|
+
const pathname = decodeURIComponent(new URL(url, `https://adnbn.invalid/${file}`).pathname);
|
|
103
|
+
const resource = resources.find((candidate) => pathname.endsWith(`/${candidate}`));
|
|
104
|
+
if (resource) {
|
|
105
|
+
candidates.set(resource, true);
|
|
106
|
+
}
|
|
107
|
+
} catch {
|
|
108
|
+
}
|
|
109
|
+
return false;
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
return Array.from(candidates).filter(([file, fromModuleAssets]) => {
|
|
114
|
+
return getAssetKind(compilation, file, sourceMaps, fromModuleAssets) === "asset";
|
|
115
|
+
}).map(([file]) => file).toSorted();
|
|
116
|
+
};
|
|
117
|
+
const collectCodeFiles = (compilation, files, sourceMaps) => {
|
|
118
|
+
const css = /* @__PURE__ */ new Set();
|
|
119
|
+
const js = /* @__PURE__ */ new Set();
|
|
120
|
+
for (const rawFile of files) {
|
|
121
|
+
const file = toPosix(rawFile);
|
|
122
|
+
const kind = getAssetKind(compilation, file, sourceMaps);
|
|
123
|
+
if (kind === "js") {
|
|
124
|
+
js.add(file);
|
|
125
|
+
} else if (kind === "css") {
|
|
126
|
+
css.add(file);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return { js: Array.from(js), css: Array.from(css) };
|
|
130
|
+
};
|
|
131
|
+
const collectAsyncCodeFiles = (compilation, chunks, sourceMaps, initialFiles) => {
|
|
132
|
+
const files = /* @__PURE__ */ new Set();
|
|
133
|
+
for (const chunk of chunks) {
|
|
134
|
+
for (const file of [...chunk.files, ...chunk.auxiliaryFiles]) {
|
|
135
|
+
const normalized = toPosix(file);
|
|
136
|
+
if (!initialFiles.has(normalized)) {
|
|
137
|
+
files.add(normalized);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return collectCodeFiles(compilation, files, sourceMaps);
|
|
142
|
+
};
|
|
143
|
+
const collectBuildAssets = (compilation) => {
|
|
144
|
+
const sourceMaps = getRelatedSourceMaps(compilation);
|
|
145
|
+
const assets = /* @__PURE__ */ Object.create(null);
|
|
146
|
+
const entrypoints = Array.from(compilation.entrypoints).toSorted(([left], [right]) => left.localeCompare(right));
|
|
147
|
+
for (const [name, entrypoint] of entrypoints) {
|
|
148
|
+
const initial = collectCodeFiles(compilation, entrypoint.getFiles(), sourceMaps);
|
|
149
|
+
const initialFiles = /* @__PURE__ */ new Set([...initial.js, ...initial.css]);
|
|
150
|
+
const entryChunk = entrypoint.getEntrypointChunk();
|
|
151
|
+
assets[name] = {
|
|
152
|
+
initial,
|
|
153
|
+
async: collectAsyncCodeFiles(compilation, entryChunk.getAllAsyncChunks(), sourceMaps, initialFiles),
|
|
154
|
+
assets: collectResources(compilation, entryChunk.getAllReferencedChunks(), sourceMaps)
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
return assets;
|
|
158
|
+
};
|
|
159
|
+
export {
|
|
160
|
+
collectBuildAssets
|
|
161
|
+
};
|
|
162
|
+
//# sourceMappingURL=assets.js.map
|