@atlaspack/core 2.16.2-canary.48 → 2.16.2-canary.481
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1324 -0
- package/dist/AssetGraph.js +523 -0
- package/dist/Atlaspack.js +701 -0
- package/dist/AtlaspackConfig.js +324 -0
- package/dist/AtlaspackConfig.schema.js +117 -0
- package/dist/BundleGraph.js +1906 -0
- package/dist/CommittedAsset.js +142 -0
- package/dist/Dependency.js +125 -0
- package/dist/Environment.js +132 -0
- package/dist/EnvironmentManager.js +108 -0
- package/dist/IdentifierRegistry.js +38 -0
- package/dist/InternalConfig.js +37 -0
- package/dist/PackagerRunner.js +470 -0
- package/dist/ReporterRunner.js +151 -0
- package/dist/RequestTracker.js +1297 -0
- package/dist/SymbolPropagation.js +624 -0
- package/dist/TargetDescriptor.schema.js +146 -0
- package/dist/Transformation.js +514 -0
- package/dist/UncommittedAsset.js +310 -0
- package/dist/Validation.js +196 -0
- package/dist/applyRuntimes.js +384 -0
- package/dist/assetUtils.js +169 -0
- package/dist/atlaspack-v3/AtlaspackV3.js +83 -0
- package/dist/atlaspack-v3/NapiWorkerPool.js +114 -0
- package/dist/atlaspack-v3/fs.js +53 -0
- package/dist/atlaspack-v3/index.js +25 -0
- package/dist/atlaspack-v3/jsCallable.js +16 -0
- package/dist/atlaspack-v3/worker/compat/asset-symbols.js +190 -0
- package/dist/atlaspack-v3/worker/compat/bitflags.js +98 -0
- package/dist/atlaspack-v3/worker/compat/dependency.js +43 -0
- package/dist/atlaspack-v3/worker/compat/environment.js +57 -0
- package/dist/atlaspack-v3/worker/compat/index.js +24 -0
- package/dist/atlaspack-v3/worker/compat/mutable-asset.js +152 -0
- package/dist/atlaspack-v3/worker/compat/plugin-config.js +64 -0
- package/dist/atlaspack-v3/worker/compat/plugin-options.js +137 -0
- package/dist/atlaspack-v3/worker/compat/plugin-tracer.js +10 -0
- package/dist/atlaspack-v3/worker/compat/target.js +14 -0
- package/dist/atlaspack-v3/worker/side-effect-detector.js +243 -0
- package/dist/atlaspack-v3/worker/worker.js +398 -0
- package/dist/constants.js +17 -0
- package/dist/dumpGraphToGraphViz.js +281 -0
- package/dist/index.js +62 -0
- package/dist/loadAtlaspackPlugin.js +128 -0
- package/dist/loadDotEnv.js +41 -0
- package/dist/projectPath.js +83 -0
- package/dist/public/Asset.js +279 -0
- package/dist/public/Bundle.js +224 -0
- package/dist/public/BundleGraph.js +371 -0
- package/dist/public/BundleGroup.js +53 -0
- package/dist/public/Config.js +286 -0
- package/dist/public/Dependency.js +138 -0
- package/dist/public/Environment.js +278 -0
- package/dist/public/MutableBundleGraph.js +277 -0
- package/dist/public/PluginOptions.js +80 -0
- package/dist/public/Symbols.js +248 -0
- package/dist/public/Target.js +69 -0
- package/dist/registerCoreWithSerializer.js +38 -0
- package/dist/requests/AssetGraphRequest.js +430 -0
- package/dist/requests/AssetGraphRequestRust.js +471 -0
- package/dist/requests/AssetRequest.js +130 -0
- package/dist/requests/AtlaspackBuildRequest.js +98 -0
- package/dist/requests/AtlaspackConfigRequest.js +493 -0
- package/dist/requests/BundleGraphRequest.js +381 -0
- package/dist/requests/BundleGraphRequestRust.js +324 -0
- package/dist/requests/BundleGraphRequestUtils.js +262 -0
- package/dist/requests/ConfigRequest.js +246 -0
- package/dist/requests/DevDepRequest.js +204 -0
- package/dist/requests/EntryRequest.js +314 -0
- package/dist/requests/PackageRequest.js +89 -0
- package/dist/requests/PathRequest.js +349 -0
- package/dist/requests/TargetRequest.js +1316 -0
- package/dist/requests/ValidationRequest.js +49 -0
- package/dist/requests/WriteBundleRequest.js +522 -0
- package/dist/requests/WriteBundlesRequest.js +190 -0
- package/dist/requests/asset-graph-diff.js +128 -0
- package/dist/requests/asset-graph-dot.js +131 -0
- package/dist/resolveOptions.js +267 -0
- package/dist/rustWorkerThreadDylibHack.js +19 -0
- package/dist/serializerCore.browser.js +43 -0
- package/dist/summarizeRequest.js +39 -0
- package/dist/types.js +31 -0
- package/dist/utils.js +172 -0
- package/dist/worker.js +123 -0
- package/lib/AssetGraph.js +53 -15
- package/lib/Atlaspack.js +140 -56
- package/lib/AtlaspackConfig.js +17 -6
- package/lib/AtlaspackConfig.schema.js +16 -5
- package/lib/BundleGraph.js +390 -43
- package/lib/CommittedAsset.js +8 -2
- package/lib/Dependency.js +9 -3
- package/lib/Environment.js +16 -10
- package/lib/EnvironmentManager.js +143 -0
- package/lib/IdentifierRegistry.js +2 -4
- package/lib/InternalConfig.js +3 -2
- package/lib/PackagerRunner.js +46 -82
- package/lib/ReporterRunner.js +8 -12
- package/lib/RequestTracker.js +191 -152
- package/lib/SymbolPropagation.js +52 -29
- package/lib/TargetDescriptor.schema.js +10 -1
- package/lib/Transformation.js +68 -19
- package/lib/UncommittedAsset.js +17 -24
- package/lib/Validation.js +20 -5
- package/lib/applyRuntimes.js +98 -7
- package/lib/assetUtils.js +16 -6
- package/lib/atlaspack-v3/AtlaspackV3.js +58 -15
- package/lib/atlaspack-v3/NapiWorkerPool.js +63 -2
- package/lib/atlaspack-v3/fs.js +4 -1
- package/lib/atlaspack-v3/index.js +28 -1
- package/lib/atlaspack-v3/jsCallable.js +0 -2
- package/lib/atlaspack-v3/worker/compat/asset-symbols.js +7 -4
- package/lib/atlaspack-v3/worker/compat/bitflags.js +31 -25
- package/lib/atlaspack-v3/worker/compat/dependency.js +4 -1
- package/lib/atlaspack-v3/worker/compat/environment.js +10 -7
- package/lib/atlaspack-v3/worker/compat/index.js +0 -11
- package/lib/atlaspack-v3/worker/compat/mutable-asset.js +16 -11
- package/lib/atlaspack-v3/worker/compat/plugin-config.js +14 -35
- package/lib/atlaspack-v3/worker/compat/plugin-options.js +16 -2
- package/lib/atlaspack-v3/worker/compat/plugin-tracer.js +3 -0
- package/lib/atlaspack-v3/worker/compat/target.js +2 -0
- package/lib/atlaspack-v3/worker/index.js +3 -0
- package/lib/atlaspack-v3/worker/side-effect-detector.js +214 -0
- package/lib/atlaspack-v3/worker/worker.js +231 -79
- package/lib/constants.js +0 -1
- package/lib/dumpGraphToGraphViz.js +72 -17
- package/lib/index.js +46 -3
- package/lib/loadAtlaspackPlugin.js +2 -3
- package/lib/loadDotEnv.js +5 -2
- package/lib/projectPath.js +6 -1
- package/lib/public/Asset.js +22 -12
- package/lib/public/Bundle.js +16 -18
- package/lib/public/BundleGraph.js +27 -25
- package/lib/public/BundleGroup.js +5 -6
- package/lib/public/Config.js +118 -18
- package/lib/public/Dependency.js +9 -7
- package/lib/public/Environment.js +13 -8
- package/lib/public/MutableBundleGraph.js +56 -15
- package/lib/public/PluginOptions.js +2 -2
- package/lib/public/Symbols.js +12 -12
- package/lib/public/Target.js +8 -7
- package/lib/registerCoreWithSerializer.js +7 -4
- package/lib/requests/AssetGraphRequest.js +61 -40
- package/lib/requests/AssetGraphRequestRust.js +314 -82
- package/lib/requests/AssetRequest.js +24 -7
- package/lib/requests/AtlaspackBuildRequest.js +53 -7
- package/lib/requests/AtlaspackConfigRequest.js +29 -19
- package/lib/requests/BundleGraphRequest.js +61 -130
- package/lib/requests/BundleGraphRequestRust.js +381 -0
- package/lib/requests/BundleGraphRequestUtils.js +280 -0
- package/lib/requests/ConfigRequest.js +55 -7
- package/lib/requests/DevDepRequest.js +32 -6
- package/lib/requests/EntryRequest.js +4 -3
- package/lib/requests/PackageRequest.js +56 -12
- package/lib/requests/PathRequest.js +26 -6
- package/lib/requests/TargetRequest.js +129 -60
- package/lib/requests/ValidationRequest.js +6 -2
- package/lib/requests/WriteBundleRequest.js +329 -20
- package/lib/requests/WriteBundlesRequest.js +64 -10
- package/lib/requests/asset-graph-diff.js +13 -8
- package/lib/requests/asset-graph-dot.js +2 -8
- package/lib/resolveOptions.js +37 -14
- package/lib/rustWorkerThreadDylibHack.js +0 -1
- package/lib/serializerCore.browser.js +1 -2
- package/lib/summarizeRequest.js +1 -1
- package/lib/types/AssetGraph.d.ts +55 -0
- package/lib/types/Atlaspack.d.ts +52 -0
- package/lib/types/AtlaspackConfig.d.ts +65 -0
- package/lib/types/AtlaspackConfig.schema.d.ts +53 -0
- package/lib/types/BundleGraph.d.ts +232 -0
- package/lib/types/CommittedAsset.d.ts +23 -0
- package/lib/types/Dependency.d.ts +44 -0
- package/lib/types/Environment.d.ts +11 -0
- package/lib/types/EnvironmentManager.d.ts +37 -0
- package/lib/types/IdentifierRegistry.d.ts +6 -0
- package/lib/types/InternalConfig.d.ts +23 -0
- package/lib/types/PackagerRunner.d.ts +85 -0
- package/lib/types/ReporterRunner.d.ts +25 -0
- package/lib/types/RequestTracker.d.ts +385 -0
- package/lib/types/SymbolPropagation.d.ts +11 -0
- package/lib/types/TargetDescriptor.schema.d.ts +5 -0
- package/lib/types/Transformation.d.ts +72 -0
- package/lib/types/UncommittedAsset.d.ts +61 -0
- package/lib/types/Validation.d.ts +37 -0
- package/lib/types/applyRuntimes.d.ts +25 -0
- package/lib/types/assetUtils.d.ts +42 -0
- package/lib/types/atlaspack-v3/AtlaspackV3.d.ts +35 -0
- package/lib/types/atlaspack-v3/NapiWorkerPool.d.ts +13 -0
- package/lib/types/atlaspack-v3/fs.d.ts +13 -0
- package/lib/types/atlaspack-v3/index.d.ts +6 -0
- package/lib/types/atlaspack-v3/jsCallable.d.ts +1 -0
- package/lib/types/atlaspack-v3/worker/compat/asset-symbols.d.ts +51 -0
- package/lib/types/atlaspack-v3/worker/compat/bitflags.d.ts +14 -0
- package/lib/types/atlaspack-v3/worker/compat/dependency.d.ts +25 -0
- package/lib/types/atlaspack-v3/worker/compat/environment.d.ts +27 -0
- package/{src/atlaspack-v3/worker/compat/index.js → lib/types/atlaspack-v3/worker/compat/index.d.ts} +0 -2
- package/lib/types/atlaspack-v3/worker/compat/mutable-asset.d.ts +49 -0
- package/lib/types/atlaspack-v3/worker/compat/plugin-config.d.ts +29 -0
- package/lib/types/atlaspack-v3/worker/compat/plugin-options.d.ts +23 -0
- package/lib/types/atlaspack-v3/worker/compat/plugin-tracer.d.ts +5 -0
- package/lib/types/atlaspack-v3/worker/compat/target.d.ts +11 -0
- package/lib/types/atlaspack-v3/worker/side-effect-detector.d.ts +76 -0
- package/lib/types/atlaspack-v3/worker/worker.d.ts +81 -0
- package/lib/types/constants.d.ts +13 -0
- package/lib/types/dumpGraphToGraphViz.d.ts +10 -0
- package/lib/types/index.d.ts +8 -0
- package/lib/types/loadAtlaspackPlugin.d.ts +8 -0
- package/lib/types/loadDotEnv.d.ts +3 -0
- package/lib/types/projectPath.d.ts +19 -0
- package/lib/types/public/Asset.d.ts +74 -0
- package/lib/types/public/Bundle.d.ts +45 -0
- package/lib/types/public/BundleGraph.d.ts +72 -0
- package/lib/types/public/BundleGroup.d.ts +12 -0
- package/lib/types/public/Config.d.ts +75 -0
- package/lib/types/public/Dependency.d.ts +32 -0
- package/lib/types/public/Environment.d.ts +34 -0
- package/lib/types/public/MutableBundleGraph.d.ts +26 -0
- package/lib/types/public/PluginOptions.d.ts +25 -0
- package/lib/types/public/Symbols.d.ts +81 -0
- package/lib/types/public/Target.d.ts +16 -0
- package/lib/types/registerCoreWithSerializer.d.ts +2 -0
- package/lib/types/requests/AssetGraphRequest.d.ts +76 -0
- package/lib/types/requests/AssetGraphRequestRust.d.ts +21 -0
- package/lib/types/requests/AssetRequest.d.ts +16 -0
- package/lib/types/requests/AtlaspackBuildRequest.d.ts +33 -0
- package/lib/types/requests/AtlaspackConfigRequest.d.ts +45 -0
- package/lib/types/requests/BundleGraphRequest.d.ts +28 -0
- package/lib/types/requests/BundleGraphRequestRust.d.ts +34 -0
- package/lib/types/requests/BundleGraphRequestUtils.d.ts +38 -0
- package/lib/types/requests/ConfigRequest.d.ts +67 -0
- package/lib/types/requests/DevDepRequest.d.ts +30 -0
- package/lib/types/requests/EntryRequest.d.ts +36 -0
- package/lib/types/requests/PackageRequest.d.ts +27 -0
- package/lib/types/requests/PathRequest.d.ts +48 -0
- package/lib/types/requests/TargetRequest.d.ts +48 -0
- package/lib/types/requests/ValidationRequest.d.ts +20 -0
- package/lib/types/requests/WriteBundleRequest.d.ts +80 -0
- package/lib/types/requests/WriteBundlesRequest.d.ts +32 -0
- package/lib/types/requests/asset-graph-diff.d.ts +1 -0
- package/lib/types/requests/asset-graph-dot.d.ts +9 -0
- package/lib/types/resolveOptions.d.ts +3 -0
- package/lib/types/rustWorkerThreadDylibHack.d.ts +9 -0
- package/lib/types/serializerCore.browser.d.ts +3 -0
- package/lib/types/summarizeRequest.d.ts +10 -0
- package/lib/types/types.d.ts +496 -0
- package/lib/types/utils.d.ts +23 -0
- package/lib/types/worker.d.ts +44 -0
- package/lib/types.js +8 -1
- package/lib/utils.js +18 -3
- package/lib/worker.js +32 -15
- package/package.json +26 -36
- package/src/{AssetGraph.js → AssetGraph.ts} +87 -51
- package/src/{Atlaspack.js → Atlaspack.ts} +181 -72
- package/src/{AtlaspackConfig.schema.js → AtlaspackConfig.schema.ts} +25 -19
- package/src/{AtlaspackConfig.js → AtlaspackConfig.ts} +78 -54
- package/src/{BundleGraph.js → BundleGraph.ts} +575 -145
- package/src/{CommittedAsset.js → CommittedAsset.ts} +15 -13
- package/src/{Dependency.js → Dependency.ts} +59 -42
- package/src/{Environment.js → Environment.ts} +24 -15
- package/src/EnvironmentManager.ts +154 -0
- package/src/{IdentifierRegistry.js → IdentifierRegistry.ts} +1 -4
- package/src/{InternalConfig.js → InternalConfig.ts} +22 -23
- package/src/{PackagerRunner.js → PackagerRunner.ts} +114 -159
- package/src/{ReporterRunner.js → ReporterRunner.ts} +13 -18
- package/src/{RequestTracker.js → RequestTracker.ts} +444 -355
- package/src/{SymbolPropagation.js → SymbolPropagation.ts} +178 -61
- package/src/{TargetDescriptor.schema.js → TargetDescriptor.schema.ts} +10 -1
- package/src/{Transformation.js → Transformation.ts} +110 -65
- package/src/{UncommittedAsset.js → UncommittedAsset.ts} +45 -49
- package/src/{Validation.js → Validation.ts} +32 -17
- package/src/{applyRuntimes.js → applyRuntimes.ts} +135 -26
- package/src/{assetUtils.js → assetUtils.ts} +49 -36
- package/src/atlaspack-v3/AtlaspackV3.ts +183 -0
- package/src/atlaspack-v3/NapiWorkerPool.ts +129 -0
- package/src/atlaspack-v3/{fs.js → fs.ts} +8 -4
- package/src/atlaspack-v3/{index.js → index.ts} +3 -4
- package/src/atlaspack-v3/jsCallable.ts +14 -0
- package/src/atlaspack-v3/worker/compat/{asset-symbols.js → asset-symbols.ts} +40 -30
- package/src/atlaspack-v3/worker/compat/bitflags.ts +102 -0
- package/src/atlaspack-v3/worker/compat/{dependency.js → dependency.ts} +13 -13
- package/src/atlaspack-v3/worker/compat/{environment.js → environment.ts} +13 -9
- package/src/atlaspack-v3/worker/compat/index.ts +8 -0
- package/src/atlaspack-v3/worker/compat/{mutable-asset.js → mutable-asset.ts} +21 -20
- package/src/atlaspack-v3/worker/compat/{plugin-config.js → plugin-config.ts} +25 -56
- package/src/atlaspack-v3/worker/compat/{plugin-options.js → plugin-options.ts} +19 -5
- package/src/atlaspack-v3/worker/compat/{plugin-tracer.js → plugin-tracer.ts} +2 -2
- package/src/atlaspack-v3/worker/compat/{target.js → target.ts} +3 -4
- package/src/atlaspack-v3/worker/index.js +2 -1
- package/src/atlaspack-v3/worker/side-effect-detector.ts +298 -0
- package/src/atlaspack-v3/worker/worker.ts +548 -0
- package/src/{constants.js → constants.ts} +0 -3
- package/src/{dumpGraphToGraphViz.js → dumpGraphToGraphViz.ts} +73 -28
- package/src/index.ts +18 -0
- package/src/{loadAtlaspackPlugin.js → loadAtlaspackPlugin.ts} +8 -9
- package/src/{loadDotEnv.js → loadDotEnv.ts} +2 -2
- package/src/{projectPath.js → projectPath.ts} +20 -9
- package/src/public/{Asset.js → Asset.ts} +41 -28
- package/src/public/{Bundle.js → Bundle.ts} +28 -29
- package/src/public/{BundleGraph.js → BundleGraph.ts} +103 -68
- package/src/public/{BundleGroup.js → BundleGroup.ts} +7 -10
- package/src/public/{Config.js → Config.ts} +171 -33
- package/src/public/{Dependency.js → Dependency.ts} +20 -17
- package/src/public/{Environment.js → Environment.ts} +28 -17
- package/src/public/{MutableBundleGraph.js → MutableBundleGraph.ts} +55 -24
- package/src/public/{PluginOptions.js → PluginOptions.ts} +6 -6
- package/src/public/{Symbols.js → Symbols.ts} +75 -36
- package/src/public/{Target.js → Target.ts} +10 -8
- package/src/{registerCoreWithSerializer.js → registerCoreWithSerializer.ts} +9 -7
- package/src/requests/{AssetGraphRequest.js → AssetGraphRequest.ts} +117 -90
- package/src/requests/AssetGraphRequestRust.ts +557 -0
- package/src/requests/{AssetRequest.js → AssetRequest.ts} +24 -18
- package/src/requests/AtlaspackBuildRequest.ts +168 -0
- package/src/requests/{AtlaspackConfigRequest.js → AtlaspackConfigRequest.ts} +72 -58
- package/src/requests/{BundleGraphRequest.js → BundleGraphRequest.ts} +119 -199
- package/src/requests/BundleGraphRequestRust.ts +470 -0
- package/src/requests/BundleGraphRequestUtils.ts +323 -0
- package/src/requests/{ConfigRequest.js → ConfigRequest.ts} +110 -50
- package/src/requests/{DevDepRequest.js → DevDepRequest.ts} +60 -35
- package/src/requests/{EntryRequest.js → EntryRequest.ts} +36 -31
- package/src/requests/{PackageRequest.js → PackageRequest.ts} +52 -25
- package/src/requests/{PathRequest.js → PathRequest.ts} +47 -37
- package/src/requests/{TargetRequest.js → TargetRequest.ts} +265 -179
- package/src/requests/{ValidationRequest.js → ValidationRequest.ts} +18 -17
- package/src/requests/WriteBundleRequest.ts +734 -0
- package/src/requests/{WriteBundlesRequest.js → WriteBundlesRequest.ts} +134 -50
- package/src/requests/{asset-graph-diff.js → asset-graph-diff.ts} +25 -21
- package/src/requests/{asset-graph-dot.js → asset-graph-dot.ts} +8 -12
- package/src/{resolveOptions.js → resolveOptions.ts} +57 -27
- package/src/{rustWorkerThreadDylibHack.js → rustWorkerThreadDylibHack.ts} +1 -4
- package/src/{serializerCore.browser.js → serializerCore.browser.ts} +2 -3
- package/src/{summarizeRequest.js → summarizeRequest.ts} +17 -5
- package/src/types.ts +651 -0
- package/src/{utils.js → utils.ts} +52 -21
- package/src/{worker.js → worker.ts} +50 -42
- package/test/{AssetGraph.test.js → AssetGraph.test.ts} +5 -8
- package/test/{Atlaspack.test.js → Atlaspack.test.ts} +5 -10
- package/test/{AtlaspackConfig.test.js → AtlaspackConfig.test.ts} +0 -5
- package/test/{AtlaspackConfigRequest.test.js → AtlaspackConfigRequest.test.ts} +76 -16
- package/test/{BundleGraph.test.js → BundleGraph.test.ts} +8 -13
- package/test/{Dependency.test.js → Dependency.test.ts} +2 -3
- package/test/{EntryRequest.test.js → EntryRequest.test.ts} +1 -6
- package/test/Environment.test.ts +153 -0
- package/test/EnvironmentManager.test.ts +188 -0
- package/test/{IdentifierRegistry.test.js → IdentifierRegistry.test.ts} +2 -4
- package/test/{InternalAsset.test.js → InternalAsset.test.ts} +2 -7
- package/test/PackagerRunner.test.ts +0 -0
- package/test/{PublicAsset.test.js → PublicAsset.test.ts} +2 -7
- package/test/{PublicBundle.test.js → PublicBundle.test.ts} +1 -2
- package/test/{PublicDependency.test.js → PublicDependency.test.ts} +0 -2
- package/test/PublicEnvironment.test.ts +49 -0
- package/test/{PublicMutableBundleGraph.test.js → PublicMutableBundleGraph.test.ts} +6 -11
- package/test/{RequestTracker.test.js → RequestTracker.test.ts} +136 -58
- package/test/{SymbolPropagation.test.js → SymbolPropagation.test.ts} +124 -74
- package/test/{TargetRequest.test.js → TargetRequest.test.ts} +91 -92
- package/test/fixtures/config-with-reporters/.parcelrc +7 -0
- package/test/fixtures/custom-targets/package.json +6 -0
- package/test/public/Config.test.ts +104 -0
- package/test/requests/AssetGraphRequestRust.test.ts +443 -0
- package/test/requests/{ConfigRequest.test.js → ConfigRequest.test.ts} +202 -13
- package/test/requests/{DevDepRequest.test.js → DevDepRequest.test.ts} +0 -2
- package/test/requests/WriteBundleRequest.test.ts +602 -0
- package/test/{test-utils.js → test-utils.ts} +3 -4
- package/test/{utils.test.js → utils.test.ts} +1 -3
- package/tsconfig.json +60 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/index.d.ts +0 -30
- package/lib/atlaspack-v3/worker/compat/plugin-logger.js +0 -29
- package/src/atlaspack-v3/AtlaspackV3.js +0 -87
- package/src/atlaspack-v3/NapiWorkerPool.js +0 -53
- package/src/atlaspack-v3/jsCallable.js +0 -18
- package/src/atlaspack-v3/worker/compat/bitflags.js +0 -100
- package/src/atlaspack-v3/worker/compat/plugin-logger.js +0 -47
- package/src/atlaspack-v3/worker/worker.js +0 -369
- package/src/index.js +0 -13
- package/src/requests/AssetGraphRequestRust.js +0 -263
- package/src/requests/AtlaspackBuildRequest.js +0 -111
- package/src/requests/WriteBundleRequest.js +0 -369
- package/src/types.js +0 -600
- package/test/Environment.test.js +0 -119
- package/test/PackagerRunner.test.js +0 -27
- package/test/PublicEnvironment.test.js +0 -27
- package/test/requests/AssetGraphRequestRust.test.js +0 -411
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import * as napi from '@atlaspack/rust';
|
|
2
|
+
import type { JsCallable } from '@atlaspack/rust';
|
|
3
|
+
import { NodePackageManager } from '@atlaspack/package-manager';
|
|
4
|
+
import type { Transformer, FilePath, FileSystem } from '@atlaspack/types';
|
|
5
|
+
import type { FeatureFlags } from '@atlaspack/feature-flags';
|
|
6
|
+
export declare class AtlaspackWorker {
|
|
7
|
+
#private;
|
|
8
|
+
constructor();
|
|
9
|
+
clearState(): void;
|
|
10
|
+
loadPlugin: JsCallable<[LoadPluginOptions], Promise<undefined>>;
|
|
11
|
+
runResolverResolve: JsCallable<[
|
|
12
|
+
RunResolverResolveOptions
|
|
13
|
+
], Promise<RunResolverResolveResult>>;
|
|
14
|
+
runTransformerTransform: JsCallable<[
|
|
15
|
+
RunTransformerTransformOptions,
|
|
16
|
+
Buffer,
|
|
17
|
+
string | null | undefined
|
|
18
|
+
], Promise<RunTransformerTransformResult>>;
|
|
19
|
+
get options(): Options;
|
|
20
|
+
initializeTransformer(instance: Transformer<any>, specifier: string): Promise<{
|
|
21
|
+
conditions: import("@atlaspack/types-internal").TransformerConditions | undefined;
|
|
22
|
+
config: any;
|
|
23
|
+
env: {
|
|
24
|
+
[k: string]: string | undefined;
|
|
25
|
+
};
|
|
26
|
+
disableCache: boolean | undefined;
|
|
27
|
+
} | undefined>;
|
|
28
|
+
}
|
|
29
|
+
type LoadPluginOptions = {
|
|
30
|
+
kind: 'resolver' | 'transformer';
|
|
31
|
+
specifier: string;
|
|
32
|
+
resolveFrom: string;
|
|
33
|
+
options: RpcPluginOptions;
|
|
34
|
+
};
|
|
35
|
+
type RpcPluginOptions = {
|
|
36
|
+
projectRoot: string;
|
|
37
|
+
mode: string;
|
|
38
|
+
featureFlags: FeatureFlags;
|
|
39
|
+
};
|
|
40
|
+
type Options = RpcPluginOptions & {
|
|
41
|
+
inputFS: FileSystem;
|
|
42
|
+
outputFS: FileSystem;
|
|
43
|
+
packageManager: NodePackageManager;
|
|
44
|
+
shouldAutoInstall: boolean;
|
|
45
|
+
};
|
|
46
|
+
type RunResolverResolveOptions = {
|
|
47
|
+
key: string;
|
|
48
|
+
dependency: napi.Dependency;
|
|
49
|
+
specifier: FilePath;
|
|
50
|
+
pipeline: string | null | undefined;
|
|
51
|
+
};
|
|
52
|
+
type RunResolverResolveResult = {
|
|
53
|
+
invalidations: Array<any>;
|
|
54
|
+
resolution: {
|
|
55
|
+
type: 'unresolved';
|
|
56
|
+
} | {
|
|
57
|
+
type: 'excluded';
|
|
58
|
+
} | {
|
|
59
|
+
type: 'resolved';
|
|
60
|
+
canDefer: boolean;
|
|
61
|
+
filePath: string;
|
|
62
|
+
sideEffects: boolean;
|
|
63
|
+
code?: string;
|
|
64
|
+
meta?: unknown;
|
|
65
|
+
pipeline?: string;
|
|
66
|
+
priority?: number | null | undefined;
|
|
67
|
+
query?: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
type RunTransformerTransformOptions = {
|
|
71
|
+
key: string;
|
|
72
|
+
env: napi.Environment;
|
|
73
|
+
asset: napi.Asset;
|
|
74
|
+
};
|
|
75
|
+
type RunTransformerTransformResult = [
|
|
76
|
+
napi.RpcAssetResult,
|
|
77
|
+
Buffer,
|
|
78
|
+
string,
|
|
79
|
+
boolean
|
|
80
|
+
];
|
|
81
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const ATLASPACK_VERSION: string;
|
|
2
|
+
export declare const HASH_REF_PREFIX = "HASH_REF_";
|
|
3
|
+
export declare const HASH_REF_HASH_LEN = 16;
|
|
4
|
+
export declare const HASH_REF_REGEX: RegExp;
|
|
5
|
+
export declare const VALID = 0;
|
|
6
|
+
export declare const INITIAL_BUILD: number;
|
|
7
|
+
export declare const FILE_CREATE: number;
|
|
8
|
+
export declare const FILE_UPDATE: number;
|
|
9
|
+
export declare const FILE_DELETE: number;
|
|
10
|
+
export declare const ENV_CHANGE: number;
|
|
11
|
+
export declare const OPTION_CHANGE: number;
|
|
12
|
+
export declare const STARTUP: number;
|
|
13
|
+
export declare const ERROR: number;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Asset, BundleBehavior } from '@atlaspack/types';
|
|
2
|
+
import type { Graph } from '@atlaspack/graph';
|
|
3
|
+
import type { AssetGraphNode, BundleGraphNode } from './types';
|
|
4
|
+
import { bundleGraphEdgeTypes } from './BundleGraph';
|
|
5
|
+
import { requestGraphEdgeTypes } from './RequestTracker';
|
|
6
|
+
export default function dumpGraphToGraphViz(graph: Graph<AssetGraphNode> | Graph<{
|
|
7
|
+
assets: Set<Asset>;
|
|
8
|
+
sourceBundles: Set<number>;
|
|
9
|
+
bundleBehavior?: BundleBehavior | null | undefined;
|
|
10
|
+
}> | Graph<BundleGraphNode>, name: string, edgeTypes?: typeof bundleGraphEdgeTypes | typeof requestGraphEdgeTypes): Promise<void>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as EnvironmentManager from './EnvironmentManager';
|
|
2
|
+
export { default, default as Atlaspack, default as Parcel, BuildError, createWorkerFarm, INTERNAL_RESOLVE, INTERNAL_TRANSFORM, WORKER_PATH, } from './Atlaspack';
|
|
3
|
+
export { ATLASPACK_VERSION } from './constants';
|
|
4
|
+
export { default as resolveOptions } from './resolveOptions';
|
|
5
|
+
export { createEnvironment } from './Environment';
|
|
6
|
+
export { default as Environment } from './public/Environment';
|
|
7
|
+
export * from './atlaspack-v3';
|
|
8
|
+
export { EnvironmentManager };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FilePath, PackageName, Semver } from '@atlaspack/types';
|
|
2
|
+
import type { AtlaspackOptions } from './types';
|
|
3
|
+
import { ProjectPath } from './projectPath';
|
|
4
|
+
export default function loadPlugin<T>(pluginName: PackageName, configPath: FilePath, keyPath: string | null | undefined, options: AtlaspackOptions): Promise<{
|
|
5
|
+
plugin: T;
|
|
6
|
+
version: Semver;
|
|
7
|
+
resolveFrom: ProjectPath;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FilePath } from '@atlaspack/types';
|
|
2
|
+
/**
|
|
3
|
+
* A path that's relative to the project root.
|
|
4
|
+
*/
|
|
5
|
+
export type ProjectPath = string;
|
|
6
|
+
export declare const toProjectPath: ((projectRoot: FilePath, p: FilePath) => ProjectPath) & ((projectRoot: FilePath, p: FilePath | undefined) => ProjectPath | undefined) & ((projectRoot: FilePath, p?: FilePath | null | undefined) => ProjectPath | null | undefined);
|
|
7
|
+
export declare const fromProjectPath: ((projectRoot: FilePath, p: ProjectPath) => FilePath) & ((projectRoot: FilePath, p?: ProjectPath | null | undefined) => FilePath | null | undefined);
|
|
8
|
+
/**
|
|
9
|
+
* Returns a path relative to the project root. This should be used when computing cache keys
|
|
10
|
+
*/
|
|
11
|
+
export declare function fromProjectPathRelative(p: ProjectPath): FilePath;
|
|
12
|
+
/**
|
|
13
|
+
* This function should be avoided, it doesn't change the actual value.
|
|
14
|
+
*/
|
|
15
|
+
export declare function toProjectPathUnsafe(p: FilePath): ProjectPath;
|
|
16
|
+
/**
|
|
17
|
+
* Joins a project root with relative paths (similar to `path.join`)
|
|
18
|
+
*/
|
|
19
|
+
export declare function joinProjectPath(a: ProjectPath, ...b: Array<FilePath>): ProjectPath;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type SourceMap from '@atlaspack/source-map';
|
|
2
|
+
import type { Readable } from 'stream';
|
|
3
|
+
import type { FileSystem } from '@atlaspack/fs';
|
|
4
|
+
import type { Asset as IAsset, AST, ASTGenerator, Dependency as IDependency, DependencyOptions, Environment as IEnvironment, EnvironmentOptions, FileCreateInvalidation, FilePath, Meta, MutableAsset as IMutableAsset, Stats, MutableAssetSymbols as IMutableAssetSymbols, AssetSymbols as IAssetSymbols, BundleBehavior } from '@atlaspack/types';
|
|
5
|
+
import type { Asset as AssetValue, AtlaspackOptions } from '../types';
|
|
6
|
+
import UncommittedAsset from '../UncommittedAsset';
|
|
7
|
+
import CommittedAsset from '../CommittedAsset';
|
|
8
|
+
declare const inspect: unique symbol;
|
|
9
|
+
export declare function assetToAssetValue(asset: IAsset | IMutableAsset): AssetValue;
|
|
10
|
+
export declare function mutableAssetToUncommittedAsset(mutableAsset: IMutableAsset): UncommittedAsset;
|
|
11
|
+
export declare function assetFromValue(value: AssetValue, options: AtlaspackOptions): Asset;
|
|
12
|
+
declare class BaseAsset {
|
|
13
|
+
#private;
|
|
14
|
+
constructor(asset: CommittedAsset | UncommittedAsset);
|
|
15
|
+
[inspect](): string;
|
|
16
|
+
get id(): string;
|
|
17
|
+
get type(): string;
|
|
18
|
+
get env(): IEnvironment;
|
|
19
|
+
get fs(): FileSystem;
|
|
20
|
+
get filePath(): FilePath;
|
|
21
|
+
get query(): URLSearchParams;
|
|
22
|
+
get meta(): Meta;
|
|
23
|
+
get bundleBehavior(): BundleBehavior | null | undefined;
|
|
24
|
+
get isBundleSplittable(): boolean;
|
|
25
|
+
get isSource(): boolean;
|
|
26
|
+
get sideEffects(): boolean;
|
|
27
|
+
get symbols(): IAssetSymbols;
|
|
28
|
+
get uniqueKey(): string | null | undefined;
|
|
29
|
+
get astGenerator(): ASTGenerator | null | undefined;
|
|
30
|
+
get pipeline(): string | null | undefined;
|
|
31
|
+
getDependencies(): ReadonlyArray<IDependency>;
|
|
32
|
+
getCode(): Promise<string>;
|
|
33
|
+
getBuffer(): Promise<Buffer>;
|
|
34
|
+
getStream(): Readable;
|
|
35
|
+
getMap(): Promise<SourceMap | null | undefined>;
|
|
36
|
+
getAST(): Promise<AST | null | undefined>;
|
|
37
|
+
getMapBuffer(): Promise<Buffer | null | undefined>;
|
|
38
|
+
}
|
|
39
|
+
export declare class Asset extends BaseAsset implements IAsset {
|
|
40
|
+
#private;
|
|
41
|
+
constructor(asset: CommittedAsset | UncommittedAsset);
|
|
42
|
+
get env(): IEnvironment;
|
|
43
|
+
get stats(): Stats;
|
|
44
|
+
}
|
|
45
|
+
export declare class MutableAsset extends BaseAsset implements IMutableAsset {
|
|
46
|
+
#private;
|
|
47
|
+
constructor(asset: UncommittedAsset);
|
|
48
|
+
setMap(map?: SourceMap | null): void;
|
|
49
|
+
get type(): string;
|
|
50
|
+
set type(type: string): void;
|
|
51
|
+
get bundleBehavior(): BundleBehavior | null | undefined;
|
|
52
|
+
set bundleBehavior(bundleBehavior?: BundleBehavior | null): void;
|
|
53
|
+
get isBundleSplittable(): boolean;
|
|
54
|
+
set isBundleSplittable(isBundleSplittable: boolean): void;
|
|
55
|
+
get sideEffects(): boolean;
|
|
56
|
+
set sideEffects(sideEffects: boolean): void;
|
|
57
|
+
get uniqueKey(): string | null | undefined;
|
|
58
|
+
set uniqueKey(uniqueKey?: string | null): void;
|
|
59
|
+
get symbols(): IMutableAssetSymbols;
|
|
60
|
+
addDependency(dep: DependencyOptions): string;
|
|
61
|
+
invalidateOnFileChange(filePath: FilePath): void;
|
|
62
|
+
invalidateOnFileCreate(invalidation: FileCreateInvalidation): void;
|
|
63
|
+
invalidateOnEnvChange(env: string): void;
|
|
64
|
+
invalidateOnStartup(): void;
|
|
65
|
+
invalidateOnBuild(): void;
|
|
66
|
+
isASTDirty(): boolean;
|
|
67
|
+
setBuffer(buffer: Buffer): void;
|
|
68
|
+
setCode(code: string): void;
|
|
69
|
+
setStream(stream: Readable): void;
|
|
70
|
+
setAST(ast: AST): void;
|
|
71
|
+
addURLDependency(url: string, opts: Partial<DependencyOptions>): string;
|
|
72
|
+
setEnvironment(env: EnvironmentOptions): void;
|
|
73
|
+
}
|
|
74
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Bundle as InternalBundle, AtlaspackOptions, PackagedBundleInfo } from '../types';
|
|
2
|
+
import type { Asset as IAsset, Bundle as IBundle, BundleTraversable, Dependency as IDependency, Environment as IEnvironment, GraphVisitor, NamedBundle as INamedBundle, PackagedBundle as IPackagedBundle, Stats, Target as ITarget, BundleBehavior } from '@atlaspack/types';
|
|
3
|
+
import type BundleGraph from '../BundleGraph';
|
|
4
|
+
declare const inspect: unique symbol;
|
|
5
|
+
export declare function bundleToInternalBundle(bundle: IBundle): InternalBundle;
|
|
6
|
+
export declare function bundleToInternalBundleGraph(bundle: IBundle): BundleGraph;
|
|
7
|
+
export declare class Bundle implements IBundle {
|
|
8
|
+
#private;
|
|
9
|
+
[inspect](): string;
|
|
10
|
+
constructor(sentinel: unknown, bundle: InternalBundle, bundleGraph: BundleGraph, options: AtlaspackOptions);
|
|
11
|
+
static get(internalBundle: InternalBundle, bundleGraph: BundleGraph, options: AtlaspackOptions): Bundle;
|
|
12
|
+
get id(): string;
|
|
13
|
+
get hashReference(): string;
|
|
14
|
+
get type(): string;
|
|
15
|
+
get env(): IEnvironment;
|
|
16
|
+
get needsStableName(): boolean | null | undefined;
|
|
17
|
+
get bundleBehavior(): BundleBehavior | null | undefined;
|
|
18
|
+
get isSplittable(): boolean | null | undefined;
|
|
19
|
+
get manualSharedBundle(): string | null | undefined;
|
|
20
|
+
get target(): ITarget;
|
|
21
|
+
hasAsset(asset: IAsset): boolean;
|
|
22
|
+
hasDependency(dep: IDependency): boolean;
|
|
23
|
+
getEntryAssets(): Array<IAsset>;
|
|
24
|
+
getMainEntry(): IAsset | null | undefined;
|
|
25
|
+
traverse<TContext>(visit: GraphVisitor<BundleTraversable, TContext>): TContext | null | undefined;
|
|
26
|
+
traverseAssets<TContext>(visit: GraphVisitor<IAsset, TContext>, startAsset?: IAsset): TContext | null | undefined;
|
|
27
|
+
}
|
|
28
|
+
export declare class NamedBundle extends Bundle implements INamedBundle {
|
|
29
|
+
#private;
|
|
30
|
+
constructor(sentinel: unknown, bundle: InternalBundle, bundleGraph: BundleGraph, options: AtlaspackOptions);
|
|
31
|
+
static get(internalBundle: InternalBundle, bundleGraph: BundleGraph, options: AtlaspackOptions): NamedBundle;
|
|
32
|
+
get name(): string;
|
|
33
|
+
get displayName(): string;
|
|
34
|
+
get publicId(): string;
|
|
35
|
+
}
|
|
36
|
+
export declare class PackagedBundle extends NamedBundle implements IPackagedBundle {
|
|
37
|
+
#private;
|
|
38
|
+
constructor(sentinel: unknown, bundle: InternalBundle, bundleGraph: BundleGraph, options: AtlaspackOptions);
|
|
39
|
+
static get(internalBundle: InternalBundle, bundleGraph: BundleGraph, options: AtlaspackOptions): PackagedBundle;
|
|
40
|
+
static getWithInfo(internalBundle: InternalBundle, bundleGraph: BundleGraph, options: AtlaspackOptions, bundleInfo?: PackagedBundleInfo | null): PackagedBundle;
|
|
41
|
+
get filePath(): string;
|
|
42
|
+
get type(): string;
|
|
43
|
+
get stats(): Stats;
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Asset as IAsset, Bundle as IBundle, BundleGraph as IBundleGraph, BundleGraphTraversable, BundleGroup as IBundleGroup, Dependency as IDependency, ExportSymbolResolution, FilePath, GraphVisitor, NamedBundle, SymbolResolution, Symbol, Target } from '@atlaspack/types';
|
|
2
|
+
import type { Bundle as InternalBundle, AtlaspackOptions } from '../types';
|
|
3
|
+
import type InternalBundleGraph from '../BundleGraph';
|
|
4
|
+
import { Asset } from './Asset';
|
|
5
|
+
export declare function bundleGraphToInternalBundleGraph(bundleGraph: IBundleGraph<IBundle>): InternalBundleGraph;
|
|
6
|
+
type BundleFactory<TBundle extends IBundle> = (arg1: InternalBundle, arg2: InternalBundleGraph, arg3: AtlaspackOptions) => TBundle;
|
|
7
|
+
export default class BundleGraph<TBundle extends IBundle> implements IBundleGraph<TBundle> {
|
|
8
|
+
#private;
|
|
9
|
+
constructor(graph: InternalBundleGraph, createBundle: BundleFactory<TBundle>, options: AtlaspackOptions);
|
|
10
|
+
getAssetById(id: string): Asset;
|
|
11
|
+
getAssetPublicId(asset: IAsset): string;
|
|
12
|
+
isDependencySkipped(dep: IDependency): boolean;
|
|
13
|
+
getResolvedAsset(dep: IDependency, bundle?: IBundle | null): IAsset | null | undefined;
|
|
14
|
+
getIncomingDependencies(asset: IAsset): Array<IDependency>;
|
|
15
|
+
getAssetWithDependency(dep: IDependency): IAsset | null | undefined;
|
|
16
|
+
getBundleGroupsContainingBundle(bundle: IBundle): Array<IBundleGroup>;
|
|
17
|
+
getReferencedBundles(bundle: IBundle, opts?: {
|
|
18
|
+
recursive?: boolean;
|
|
19
|
+
includeInline?: boolean;
|
|
20
|
+
}): Array<TBundle>;
|
|
21
|
+
getReferencingBundles(bundle: IBundle): Array<TBundle>;
|
|
22
|
+
resolveAsyncDependency(dependency: IDependency, bundle?: IBundle | null): {
|
|
23
|
+
type: 'bundle_group';
|
|
24
|
+
value: IBundleGroup;
|
|
25
|
+
} | {
|
|
26
|
+
type: 'asset';
|
|
27
|
+
value: IAsset;
|
|
28
|
+
} | null | undefined;
|
|
29
|
+
getReferencedBundle(dependency: IDependency, bundle: IBundle): TBundle | null | undefined;
|
|
30
|
+
getDependencies(asset: IAsset): Array<IDependency>;
|
|
31
|
+
isAssetReachableFromBundle(asset: IAsset, bundle: IBundle): boolean;
|
|
32
|
+
isAssetReferenced(bundle: IBundle, asset: IAsset): boolean;
|
|
33
|
+
isAssetReferencedFastCheck(bundle: IBundle, asset: IAsset): boolean | null;
|
|
34
|
+
getReferencedAssets(bundle: IBundle): Set<IAsset>;
|
|
35
|
+
hasParentBundleOfType(bundle: IBundle, type: string): boolean;
|
|
36
|
+
getBundlesInBundleGroup(bundleGroup: IBundleGroup, opts?: {
|
|
37
|
+
includeInline: boolean;
|
|
38
|
+
}): Array<TBundle>;
|
|
39
|
+
getBundles(opts?: {
|
|
40
|
+
includeInline: boolean;
|
|
41
|
+
}): Array<TBundle>;
|
|
42
|
+
isEntryBundleGroup(bundleGroup: IBundleGroup): boolean;
|
|
43
|
+
getChildBundles(bundle: IBundle): Array<TBundle>;
|
|
44
|
+
getParentBundles(bundle: IBundle): Array<TBundle>;
|
|
45
|
+
getSymbolResolution(asset: IAsset, symbol: Symbol, boundary?: IBundle | null): SymbolResolution;
|
|
46
|
+
getExportedSymbols(asset: IAsset, boundary?: IBundle | null): Array<ExportSymbolResolution>;
|
|
47
|
+
traverse<TContext>(visit: GraphVisitor<BundleGraphTraversable, TContext>, start?: IAsset | null, opts?: {
|
|
48
|
+
skipUnusedDependencies?: boolean;
|
|
49
|
+
} | null): TContext | null | undefined;
|
|
50
|
+
traverseBundles<TContext>(visit: GraphVisitor<TBundle, TContext>, startBundle?: IBundle | null): TContext | null | undefined;
|
|
51
|
+
getBundlesWithAsset(asset: IAsset): Array<TBundle>;
|
|
52
|
+
getBundlesWithDependency(dependency: IDependency): Array<TBundle>;
|
|
53
|
+
getUsedSymbols(v: IAsset | IDependency): ReadonlySet<Symbol> | null | undefined;
|
|
54
|
+
getEntryRoot(target: Target): FilePath;
|
|
55
|
+
getConditionsForDependencies(deps: Array<IDependency>, bundle: NamedBundle): Set<{
|
|
56
|
+
publicId: string;
|
|
57
|
+
key: string;
|
|
58
|
+
ifTrueDependency: IDependency;
|
|
59
|
+
ifFalseDependency: IDependency;
|
|
60
|
+
ifTrueBundles: Array<TBundle>;
|
|
61
|
+
ifFalseBundles: Array<TBundle>;
|
|
62
|
+
ifTrueAssetId: string;
|
|
63
|
+
ifFalseAssetId: string;
|
|
64
|
+
}>;
|
|
65
|
+
getConditionalBundleMapping(): Map<string, Map<string, {
|
|
66
|
+
bundle: TBundle;
|
|
67
|
+
ifTrueBundles: Array<TBundle>;
|
|
68
|
+
ifFalseBundles: Array<TBundle>;
|
|
69
|
+
}>>;
|
|
70
|
+
getReferencedConditionalBundles(bundle: IBundle): Array<TBundle>;
|
|
71
|
+
}
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BundleGroup as IBundleGroup, Target as ITarget } from '@atlaspack/types';
|
|
2
|
+
import type { BundleGroup as InternalBundleGroup, AtlaspackOptions } from '../types';
|
|
3
|
+
export declare function bundleGroupToInternalBundleGroup(target: IBundleGroup): InternalBundleGroup;
|
|
4
|
+
declare const inspect: unique symbol;
|
|
5
|
+
export default class BundleGroup implements IBundleGroup {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(bundleGroup: InternalBundleGroup, options: AtlaspackOptions);
|
|
8
|
+
get target(): ITarget;
|
|
9
|
+
get entryAssetId(): string;
|
|
10
|
+
[inspect](): string;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { Config as IConfig, ConfigResult, FileCreateInvalidation, FilePath, PackageJSON, ConfigResultWithFilePath, DevDepOptions } from '@atlaspack/types';
|
|
2
|
+
import type { Config, AtlaspackOptions } from '../types';
|
|
3
|
+
import Environment from './Environment';
|
|
4
|
+
/**
|
|
5
|
+
* Implements read tracking over an object.
|
|
6
|
+
*
|
|
7
|
+
* Calling this function with a non-trivial object like a class instance will fail to work.
|
|
8
|
+
*
|
|
9
|
+
* We track reads to fields that resolve to:
|
|
10
|
+
*
|
|
11
|
+
* - primitive values
|
|
12
|
+
* - arrays
|
|
13
|
+
*
|
|
14
|
+
* That is, reading a nested field `a.b.c` will make a single call to `onRead` with the path
|
|
15
|
+
* `['a', 'b', 'c']`.
|
|
16
|
+
*
|
|
17
|
+
* In case the value is null or an array, we will track the read as well.
|
|
18
|
+
*
|
|
19
|
+
* Iterating over `Object.keys(obj.field)` will register a read for the `['field']` path.
|
|
20
|
+
* Other reads work normally.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
*
|
|
24
|
+
* const usedPaths = new Set();
|
|
25
|
+
* const onRead = (path) => {
|
|
26
|
+
* usedPaths.add(path);
|
|
27
|
+
* };
|
|
28
|
+
*
|
|
29
|
+
* const config = makeConfigProxy(onRead, {a: {b: {c: 'd'}}})
|
|
30
|
+
* console.log(config.a.b.c);
|
|
31
|
+
* console.log(Array.from(usedPaths));
|
|
32
|
+
* // We get a single read for the path
|
|
33
|
+
* // ['a', 'b', 'c']
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
export declare function makeConfigProxy<T>(onRead: (path: string[]) => void, config: T): T;
|
|
37
|
+
export default class PublicConfig implements IConfig {
|
|
38
|
+
#private;
|
|
39
|
+
constructor(config: Config, options: AtlaspackOptions);
|
|
40
|
+
get env(): Environment;
|
|
41
|
+
get searchPath(): FilePath;
|
|
42
|
+
get result(): ConfigResult;
|
|
43
|
+
get isSource(): boolean;
|
|
44
|
+
setResult(result: any): void;
|
|
45
|
+
setCacheKey(cacheKey: string): void;
|
|
46
|
+
invalidateOnFileChange(filePath: FilePath): void;
|
|
47
|
+
invalidateOnConfigKeyChange(filePath: FilePath, configKey: string[]): void;
|
|
48
|
+
addDevDependency(devDep: DevDepOptions): void;
|
|
49
|
+
invalidateOnFileCreate(invalidation: FileCreateInvalidation): void;
|
|
50
|
+
invalidateOnEnvChange(env: string): void;
|
|
51
|
+
invalidateOnStartup(): void;
|
|
52
|
+
invalidateOnBuild(): void;
|
|
53
|
+
getConfigFrom<T>(searchPath: FilePath, fileNames: Array<string>, options: {
|
|
54
|
+
/**
|
|
55
|
+
* @deprecated Use `configKey` instead.
|
|
56
|
+
*/
|
|
57
|
+
packageKey?: string;
|
|
58
|
+
parse?: boolean;
|
|
59
|
+
exclude?: boolean;
|
|
60
|
+
} | null | undefined | {
|
|
61
|
+
/**
|
|
62
|
+
* If specified, this function will return a proxy object that will track reads to
|
|
63
|
+
* config fields and only register invalidations for when those keys change.
|
|
64
|
+
*/
|
|
65
|
+
readTracking?: boolean;
|
|
66
|
+
} | null | undefined): Promise<ConfigResultWithFilePath<T> | null | undefined>;
|
|
67
|
+
getConfig<T>(filePaths: Array<FilePath>, options: {
|
|
68
|
+
packageKey?: string;
|
|
69
|
+
parse?: boolean;
|
|
70
|
+
exclude?: boolean;
|
|
71
|
+
} | null | undefined | {
|
|
72
|
+
readTracking?: boolean;
|
|
73
|
+
}): Promise<ConfigResultWithFilePath<T> | null | undefined>;
|
|
74
|
+
getPackage(): Promise<PackageJSON | null | undefined>;
|
|
75
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Dependency as IDependency, Environment as IEnvironment, FilePath, Meta, MutableDependencySymbols as IMutableDependencySymbols, SourceLocation, SpecifierType, DependencyPriority, BundleBehavior } from '@atlaspack/types';
|
|
2
|
+
import type { Dependency as InternalDependency, AtlaspackOptions } from '../types';
|
|
3
|
+
import Target from './Target';
|
|
4
|
+
declare const inspect: unique symbol;
|
|
5
|
+
export declare function dependencyToInternalDependency(dependency: IDependency): InternalDependency;
|
|
6
|
+
export declare function getPublicDependency(dep: InternalDependency, options: AtlaspackOptions): Dependency;
|
|
7
|
+
export default class Dependency implements IDependency {
|
|
8
|
+
#private;
|
|
9
|
+
constructor(dep: InternalDependency, options: AtlaspackOptions);
|
|
10
|
+
[inspect](): string;
|
|
11
|
+
get id(): string;
|
|
12
|
+
get specifier(): string;
|
|
13
|
+
get specifierType(): SpecifierType;
|
|
14
|
+
get priority(): DependencyPriority;
|
|
15
|
+
get needsStableName(): boolean;
|
|
16
|
+
get bundleBehavior(): BundleBehavior | null | undefined;
|
|
17
|
+
get isEntry(): boolean;
|
|
18
|
+
get isOptional(): boolean;
|
|
19
|
+
get loc(): SourceLocation | null | undefined;
|
|
20
|
+
get env(): IEnvironment;
|
|
21
|
+
get packageConditions(): Array<string> | null | undefined;
|
|
22
|
+
get meta(): Meta;
|
|
23
|
+
get symbols(): IMutableDependencySymbols;
|
|
24
|
+
get target(): Target | null | undefined;
|
|
25
|
+
get sourceAssetId(): string | null | undefined;
|
|
26
|
+
get sourcePath(): FilePath | null | undefined;
|
|
27
|
+
get sourceAssetType(): string | null | undefined;
|
|
28
|
+
get resolveFrom(): string | null | undefined;
|
|
29
|
+
get range(): string | null | undefined;
|
|
30
|
+
get pipeline(): string | null | undefined;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Environment as IEnvironment, EnvironmentContext, EnvironmentFeature, Engines, OutputFormat, PackageName, VersionMap, SourceLocation, SourceType, TargetSourceMapOptions, EnvMap } from '@atlaspack/types';
|
|
2
|
+
import type { Environment as InternalEnvironment, AtlaspackOptions } from '../types';
|
|
3
|
+
declare const inspect: unique symbol;
|
|
4
|
+
export declare const BROWSER_ENVS: Set<string>;
|
|
5
|
+
export declare const ISOLATED_ENVS: Set<string>;
|
|
6
|
+
export declare function environmentToInternalEnvironment(environment: IEnvironment): InternalEnvironment;
|
|
7
|
+
export default class Environment implements IEnvironment {
|
|
8
|
+
#private;
|
|
9
|
+
constructor(env: InternalEnvironment, options: AtlaspackOptions);
|
|
10
|
+
get id(): string;
|
|
11
|
+
get context(): EnvironmentContext;
|
|
12
|
+
get engines(): Engines;
|
|
13
|
+
get includeNodeModules(): boolean | Array<PackageName> | Partial<Record<PackageName, boolean>>;
|
|
14
|
+
get outputFormat(): OutputFormat;
|
|
15
|
+
get sourceType(): SourceType;
|
|
16
|
+
get isLibrary(): boolean;
|
|
17
|
+
get shouldOptimize(): boolean;
|
|
18
|
+
get shouldScopeHoist(): boolean;
|
|
19
|
+
get sourceMap(): TargetSourceMapOptions | null | undefined;
|
|
20
|
+
get loc(): SourceLocation | null | undefined;
|
|
21
|
+
get unstableSingleFileOutput(): boolean;
|
|
22
|
+
get customEnv(): EnvMap | null | undefined;
|
|
23
|
+
[inspect](): string;
|
|
24
|
+
isBrowser(): boolean;
|
|
25
|
+
isNode(): boolean;
|
|
26
|
+
isElectron(): boolean;
|
|
27
|
+
isIsolated(): boolean;
|
|
28
|
+
isWorker(): boolean;
|
|
29
|
+
isWorklet(): boolean;
|
|
30
|
+
isTesseract(): boolean;
|
|
31
|
+
matchesEngines(minVersions: VersionMap, defaultValue?: boolean): boolean;
|
|
32
|
+
supports(feature: EnvironmentFeature, defaultValue?: boolean): boolean;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Asset as IAsset, Bundle as IBundle, BundleGroup as IBundleGroup, CreateBundleOpts, Dependency as IDependency, MutableBundleGraph as IMutableBundleGraph, Target } from '@atlaspack/types';
|
|
2
|
+
import type { AtlaspackOptions } from '../types';
|
|
3
|
+
import BundleGraph from './BundleGraph';
|
|
4
|
+
import InternalBundleGraph from '../BundleGraph';
|
|
5
|
+
import { Bundle } from './Bundle';
|
|
6
|
+
export default class MutableBundleGraph extends BundleGraph<IBundle> implements IMutableBundleGraph {
|
|
7
|
+
#private;
|
|
8
|
+
constructor(graph: InternalBundleGraph, options: AtlaspackOptions);
|
|
9
|
+
addAssetToBundle(asset: IAsset, bundle: IBundle): void;
|
|
10
|
+
addAssetGraphToBundle(asset: IAsset, bundle: IBundle, shouldSkipDependency?: (arg1: IDependency) => boolean): void;
|
|
11
|
+
addEntryToBundle(asset: IAsset, bundle: IBundle, shouldSkipDependency?: (arg1: IDependency) => boolean): void;
|
|
12
|
+
createBundleGroup(dependency: IDependency, target: Target): IBundleGroup;
|
|
13
|
+
removeBundleGroup(bundleGroup: IBundleGroup): void;
|
|
14
|
+
internalizeAsyncDependency(bundle: IBundle, dependency: IDependency): void;
|
|
15
|
+
createBundle(opts: CreateBundleOpts): Bundle;
|
|
16
|
+
addBundleToBundleGroup(bundle: IBundle, bundleGroup: IBundleGroup): void;
|
|
17
|
+
createAssetReference(dependency: IDependency, asset: IAsset, bundle: IBundle): void;
|
|
18
|
+
createBundleReference(from: IBundle, to: IBundle): void;
|
|
19
|
+
createBundleConditionalReference(from: IBundle, to: IBundle): void;
|
|
20
|
+
getDependencyAssets(dependency: IDependency): Array<IAsset>;
|
|
21
|
+
getBundleGroupsContainingBundle(bundle: IBundle): Array<IBundleGroup>;
|
|
22
|
+
getParentBundlesOfBundleGroup(bundleGroup: IBundleGroup): Array<IBundle>;
|
|
23
|
+
getTotalSize(asset: IAsset): number;
|
|
24
|
+
isAssetReachableFromBundle(asset: IAsset, bundle: IBundle): boolean;
|
|
25
|
+
removeAssetGraphFromBundle(asset: IAsset, bundle: IBundle): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { BuildMode, EnvMap, FilePath, LogLevel, PluginOptions as IPluginOptions, ServerOptions, HMROptions, DetailedReportOptions } from '@atlaspack/types';
|
|
2
|
+
import type { FileSystem } from '@atlaspack/fs';
|
|
3
|
+
import type { PackageManager } from '@atlaspack/package-manager';
|
|
4
|
+
import type { AtlaspackOptions } from '../types';
|
|
5
|
+
import { FeatureFlags } from '@atlaspack/feature-flags';
|
|
6
|
+
export default class PluginOptions implements IPluginOptions {
|
|
7
|
+
#private;
|
|
8
|
+
constructor(options: AtlaspackOptions);
|
|
9
|
+
get instanceId(): string;
|
|
10
|
+
get mode(): BuildMode;
|
|
11
|
+
get env(): EnvMap;
|
|
12
|
+
get parcelVersion(): string;
|
|
13
|
+
get hmrOptions(): HMROptions | null | undefined;
|
|
14
|
+
get serveOptions(): ServerOptions | false;
|
|
15
|
+
get shouldBuildLazily(): boolean;
|
|
16
|
+
get shouldAutoInstall(): boolean;
|
|
17
|
+
get logLevel(): LogLevel;
|
|
18
|
+
get cacheDir(): FilePath;
|
|
19
|
+
get projectRoot(): FilePath;
|
|
20
|
+
get inputFS(): FileSystem;
|
|
21
|
+
get outputFS(): FileSystem;
|
|
22
|
+
get packageManager(): PackageManager;
|
|
23
|
+
get detailedReport(): DetailedReportOptions | null | undefined;
|
|
24
|
+
get featureFlags(): FeatureFlags;
|
|
25
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { Symbol as ISymbol, MutableAssetSymbols as IMutableAssetSymbols, AssetSymbols as IAssetSymbols, MutableDependencySymbols as IMutableDependencySymbols, SourceLocation, Meta } from '@atlaspack/types';
|
|
2
|
+
import type { Asset, Dependency, AtlaspackOptions } from '../types';
|
|
3
|
+
declare const inspect: unique symbol;
|
|
4
|
+
export declare class AssetSymbols implements IAssetSymbols {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(options: AtlaspackOptions, asset: Asset);
|
|
7
|
+
hasExportSymbol(exportSymbol: ISymbol): boolean;
|
|
8
|
+
hasLocalSymbol(local: ISymbol): boolean;
|
|
9
|
+
get(exportSymbol: ISymbol): {
|
|
10
|
+
local: ISymbol;
|
|
11
|
+
loc: SourceLocation | null | undefined;
|
|
12
|
+
meta?: Meta | null | undefined;
|
|
13
|
+
} | null | undefined;
|
|
14
|
+
get isCleared(): boolean;
|
|
15
|
+
exportSymbols(): Iterable<ISymbol>;
|
|
16
|
+
[Symbol.iterator](): {
|
|
17
|
+
readonly next: () => {
|
|
18
|
+
done: boolean;
|
|
19
|
+
};
|
|
20
|
+
} | MapIterator<[string, {
|
|
21
|
+
local: ISymbol;
|
|
22
|
+
loc: import("../types").InternalSourceLocation | null | undefined;
|
|
23
|
+
meta?: Meta | null | undefined;
|
|
24
|
+
}]>;
|
|
25
|
+
[inspect](): string;
|
|
26
|
+
}
|
|
27
|
+
export declare class MutableAssetSymbols implements IMutableAssetSymbols {
|
|
28
|
+
#private;
|
|
29
|
+
constructor(options: AtlaspackOptions, asset: Asset);
|
|
30
|
+
hasExportSymbol(exportSymbol: ISymbol): boolean;
|
|
31
|
+
hasLocalSymbol(local: ISymbol): boolean;
|
|
32
|
+
get(exportSymbol: ISymbol): {
|
|
33
|
+
local: ISymbol;
|
|
34
|
+
loc: SourceLocation | null | undefined;
|
|
35
|
+
meta?: Meta | null | undefined;
|
|
36
|
+
} | null | undefined;
|
|
37
|
+
get isCleared(): boolean;
|
|
38
|
+
exportSymbols(): Iterable<ISymbol>;
|
|
39
|
+
[Symbol.iterator](): {
|
|
40
|
+
readonly next: () => {
|
|
41
|
+
done: boolean;
|
|
42
|
+
};
|
|
43
|
+
} | MapIterator<[string, {
|
|
44
|
+
local: ISymbol;
|
|
45
|
+
loc: import("../types").InternalSourceLocation | null | undefined;
|
|
46
|
+
meta?: Meta | null | undefined;
|
|
47
|
+
}]>;
|
|
48
|
+
[inspect](): string;
|
|
49
|
+
ensure(): void;
|
|
50
|
+
set(exportSymbol: ISymbol, local: ISymbol, loc?: SourceLocation | null, meta?: Meta | null): void;
|
|
51
|
+
delete(exportSymbol: ISymbol): void;
|
|
52
|
+
}
|
|
53
|
+
export declare class MutableDependencySymbols implements IMutableDependencySymbols {
|
|
54
|
+
#private;
|
|
55
|
+
constructor(options: AtlaspackOptions, dep: Dependency);
|
|
56
|
+
hasExportSymbol(exportSymbol: ISymbol): boolean;
|
|
57
|
+
hasLocalSymbol(local: ISymbol): boolean;
|
|
58
|
+
get(exportSymbol: ISymbol): {
|
|
59
|
+
local: ISymbol;
|
|
60
|
+
loc: SourceLocation | null | undefined;
|
|
61
|
+
isWeak: boolean;
|
|
62
|
+
meta?: Meta | null | undefined;
|
|
63
|
+
} | null | undefined;
|
|
64
|
+
get isCleared(): boolean;
|
|
65
|
+
exportSymbols(): Iterable<ISymbol>;
|
|
66
|
+
[Symbol.iterator](): MapIterator<[string, {
|
|
67
|
+
local: ISymbol;
|
|
68
|
+
loc: import("../types").InternalSourceLocation | null | undefined;
|
|
69
|
+
isWeak: boolean;
|
|
70
|
+
meta?: Meta | null | undefined;
|
|
71
|
+
}]> | {
|
|
72
|
+
readonly next: () => {
|
|
73
|
+
done: boolean;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
[inspect](): string;
|
|
77
|
+
ensure(): void;
|
|
78
|
+
set(exportSymbol: ISymbol, local: ISymbol, loc?: SourceLocation | null, isWeak?: boolean | null): void;
|
|
79
|
+
delete(exportSymbol: ISymbol): void;
|
|
80
|
+
}
|
|
81
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FilePath, Target as ITarget, Environment as IEnvironment, SourceLocation } from '@atlaspack/types';
|
|
2
|
+
import type { Target as TargetValue, AtlaspackOptions } from '../types';
|
|
3
|
+
declare const inspect: unique symbol;
|
|
4
|
+
export declare function targetToInternalTarget(target: ITarget): TargetValue;
|
|
5
|
+
export default class Target implements ITarget {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(target: TargetValue, options: AtlaspackOptions);
|
|
8
|
+
get distEntry(): FilePath | null | undefined;
|
|
9
|
+
get distDir(): FilePath;
|
|
10
|
+
get env(): IEnvironment;
|
|
11
|
+
get name(): string;
|
|
12
|
+
get publicUrl(): string;
|
|
13
|
+
get loc(): SourceLocation | null | undefined;
|
|
14
|
+
[inspect](): string;
|
|
15
|
+
}
|
|
16
|
+
export {};
|