@atlaspack/core 2.16.2-canary.27 → 2.16.2-canary.270
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 +665 -0
- package/dist/AssetGraph.js +591 -0
- package/dist/Atlaspack.js +658 -0
- package/dist/AtlaspackConfig.js +324 -0
- package/dist/AtlaspackConfig.schema.js +108 -0
- package/dist/BundleGraph.js +1635 -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 +545 -0
- package/dist/ReporterRunner.js +151 -0
- package/dist/RequestTracker.js +1360 -0
- package/dist/SymbolPropagation.js +620 -0
- package/dist/TargetDescriptor.schema.js +143 -0
- package/dist/Transformation.js +490 -0
- package/dist/UncommittedAsset.js +315 -0
- package/dist/Validation.js +196 -0
- package/dist/applyRuntimes.js +305 -0
- package/dist/assetUtils.js +168 -0
- package/dist/atlaspack-v3/AtlaspackV3.js +70 -0
- package/dist/atlaspack-v3/NapiWorkerPool.js +57 -0
- package/dist/atlaspack-v3/fs.js +52 -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 +94 -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 +25 -0
- package/dist/atlaspack-v3/worker/compat/mutable-asset.js +152 -0
- package/dist/atlaspack-v3/worker/compat/plugin-config.js +76 -0
- package/dist/atlaspack-v3/worker/compat/plugin-logger.js +26 -0
- package/dist/atlaspack-v3/worker/compat/plugin-options.js +122 -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/worker.js +297 -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 +359 -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 +429 -0
- package/dist/requests/AssetGraphRequestRust.js +262 -0
- package/dist/requests/AssetRequest.js +130 -0
- package/dist/requests/AtlaspackBuildRequest.js +65 -0
- package/dist/requests/AtlaspackConfigRequest.js +493 -0
- package/dist/requests/BundleGraphRequest.js +445 -0
- package/dist/requests/ConfigRequest.js +222 -0
- package/dist/requests/DevDepRequest.js +204 -0
- package/dist/requests/EntryRequest.js +314 -0
- package/dist/requests/PackageRequest.js +62 -0
- package/dist/requests/PathRequest.js +349 -0
- package/dist/requests/TargetRequest.js +1311 -0
- package/dist/requests/ValidationRequest.js +49 -0
- package/dist/requests/WriteBundleRequest.js +254 -0
- package/dist/requests/WriteBundlesRequest.js +184 -0
- package/dist/requests/asset-graph-diff.js +128 -0
- package/dist/requests/asset-graph-dot.js +131 -0
- package/dist/resolveOptions.js +268 -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 +111 -14
- package/lib/Atlaspack.js +81 -37
- package/lib/AtlaspackConfig.js +15 -3
- package/lib/AtlaspackConfig.schema.js +7 -5
- package/lib/BundleGraph.js +90 -32
- package/lib/CommittedAsset.js +6 -0
- package/lib/Dependency.js +8 -2
- package/lib/Environment.js +15 -8
- package/lib/EnvironmentManager.js +143 -0
- package/lib/IdentifierRegistry.js +1 -3
- package/lib/InternalConfig.js +3 -2
- package/lib/PackagerRunner.js +90 -27
- package/lib/ReporterRunner.js +6 -9
- package/lib/RequestTracker.js +266 -156
- package/lib/SymbolPropagation.js +42 -18
- package/lib/TargetDescriptor.schema.js +7 -1
- package/lib/Transformation.js +26 -10
- package/lib/UncommittedAsset.js +30 -9
- package/lib/Validation.js +18 -2
- package/lib/applyRuntimes.js +9 -1
- package/lib/assetUtils.js +7 -4
- package/lib/atlaspack-v3/AtlaspackV3.js +32 -7
- package/lib/atlaspack-v3/NapiWorkerPool.js +3 -0
- package/lib/atlaspack-v3/fs.js +3 -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 +7 -6
- package/lib/atlaspack-v3/worker/compat/dependency.js +3 -0
- package/lib/atlaspack-v3/worker/compat/environment.js +10 -7
- package/lib/atlaspack-v3/worker/compat/mutable-asset.js +14 -9
- package/lib/atlaspack-v3/worker/compat/plugin-config.js +8 -10
- package/lib/atlaspack-v3/worker/compat/plugin-options.js +1 -0
- 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/worker.js +43 -7
- package/lib/constants.js +0 -1
- package/lib/dumpGraphToGraphViz.js +71 -16
- package/lib/index.js +45 -1
- package/lib/loadDotEnv.js +4 -1
- package/lib/projectPath.js +5 -0
- package/lib/public/Asset.js +21 -11
- package/lib/public/Bundle.js +15 -16
- package/lib/public/BundleGraph.js +10 -4
- package/lib/public/BundleGroup.js +4 -5
- package/lib/public/Config.js +118 -17
- package/lib/public/Dependency.js +8 -6
- package/lib/public/Environment.js +12 -7
- package/lib/public/MutableBundleGraph.js +54 -12
- package/lib/public/PluginOptions.js +2 -2
- package/lib/public/Symbols.js +11 -11
- package/lib/public/Target.js +7 -6
- package/lib/registerCoreWithSerializer.js +5 -3
- package/lib/requests/AssetGraphRequest.js +42 -5
- package/lib/requests/AssetGraphRequestRust.js +126 -62
- package/lib/requests/AssetRequest.js +23 -6
- package/lib/requests/AtlaspackBuildRequest.js +10 -4
- package/lib/requests/AtlaspackConfigRequest.js +27 -16
- package/lib/requests/BundleGraphRequest.js +34 -19
- package/lib/requests/ConfigRequest.js +28 -4
- package/lib/requests/DevDepRequest.js +31 -5
- package/lib/requests/EntryRequest.js +2 -0
- package/lib/requests/PackageRequest.js +2 -1
- package/lib/requests/PathRequest.js +24 -3
- package/lib/requests/TargetRequest.js +122 -57
- package/lib/requests/ValidationRequest.js +5 -1
- package/lib/requests/WriteBundleRequest.js +39 -11
- package/lib/requests/WriteBundlesRequest.js +51 -4
- package/lib/requests/asset-graph-diff.js +12 -7
- package/lib/requests/asset-graph-dot.js +1 -7
- package/lib/resolveOptions.js +36 -10
- package/lib/rustWorkerThreadDylibHack.js +0 -1
- package/lib/types/AssetGraph.d.ts +80 -0
- package/lib/types/Atlaspack.d.ts +52 -0
- package/lib/types/AtlaspackConfig.d.ts +65 -0
- package/lib/types/AtlaspackConfig.schema.d.ts +46 -0
- package/lib/types/BundleGraph.d.ts +182 -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 +24 -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 +26 -0
- package/lib/types/atlaspack-v3/NapiWorkerPool.d.ts +12 -0
- package/lib/types/atlaspack-v3/fs.d.ts +12 -0
- package/lib/types/atlaspack-v3/index.d.ts +5 -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 +15 -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 -1
- package/lib/types/atlaspack-v3/worker/compat/mutable-asset.d.ts +49 -0
- package/lib/types/atlaspack-v3/worker/compat/plugin-config.d.ts +37 -0
- package/lib/types/atlaspack-v3/worker/compat/plugin-logger.d.ts +9 -0
- package/lib/types/atlaspack-v3/worker/compat/plugin-options.d.ts +22 -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/worker.d.ts +60 -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 +70 -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 +74 -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/ConfigRequest.d.ts +59 -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 +28 -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 +493 -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 +17 -2
- package/lib/worker.js +29 -13
- package/package.json +24 -34
- package/src/{AssetGraph.js → AssetGraph.ts} +156 -52
- package/src/{Atlaspack.js → Atlaspack.ts} +114 -61
- package/src/{AtlaspackConfig.schema.js → AtlaspackConfig.schema.ts} +16 -19
- package/src/{AtlaspackConfig.js → AtlaspackConfig.ts} +78 -54
- package/src/{BundleGraph.js → BundleGraph.ts} +231 -140
- package/src/{CommittedAsset.js → CommittedAsset.ts} +14 -12
- 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} +178 -86
- package/src/{ReporterRunner.js → ReporterRunner.ts} +13 -18
- package/src/{RequestTracker.js → RequestTracker.ts} +572 -357
- package/src/{SymbolPropagation.js → SymbolPropagation.ts} +165 -57
- package/src/{TargetDescriptor.schema.js → TargetDescriptor.schema.ts} +7 -1
- package/src/{Transformation.js → Transformation.ts} +71 -62
- package/src/{UncommittedAsset.js → UncommittedAsset.ts} +57 -36
- package/src/{Validation.js → Validation.ts} +32 -17
- package/src/{applyRuntimes.js → applyRuntimes.ts} +35 -26
- package/src/{assetUtils.js → assetUtils.ts} +47 -35
- package/src/atlaspack-v3/AtlaspackV3.ts +122 -0
- package/src/atlaspack-v3/{NapiWorkerPool.js → NapiWorkerPool.ts} +10 -5
- package/src/atlaspack-v3/{fs.js → fs.ts} +3 -4
- package/src/atlaspack-v3/{index.js → index.ts} +2 -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.js → bitflags.ts} +9 -10
- package/src/atlaspack-v3/worker/compat/{dependency.js → dependency.ts} +12 -12
- package/src/atlaspack-v3/worker/compat/{environment.js → environment.ts} +13 -9
- package/src/atlaspack-v3/worker/compat/index.ts +9 -0
- package/src/atlaspack-v3/worker/compat/{mutable-asset.js → mutable-asset.ts} +20 -19
- package/src/atlaspack-v3/worker/compat/{plugin-config.js → plugin-config.ts} +27 -26
- package/src/atlaspack-v3/worker/compat/{plugin-logger.js → plugin-logger.ts} +0 -2
- package/src/atlaspack-v3/worker/compat/{plugin-options.js → plugin-options.ts} +4 -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/{worker.js → worker.ts} +102 -66
- 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} +40 -27
- package/src/public/{Bundle.js → Bundle.ts} +28 -29
- package/src/public/{BundleGraph.js → BundleGraph.ts} +81 -50
- 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} +84 -49
- package/src/requests/AssetGraphRequestRust.ts +352 -0
- package/src/requests/{AssetRequest.js → AssetRequest.ts} +24 -18
- package/src/requests/{AtlaspackBuildRequest.js → AtlaspackBuildRequest.ts} +46 -32
- package/src/requests/{AtlaspackConfigRequest.js → AtlaspackConfigRequest.ts} +72 -58
- package/src/requests/{BundleGraphRequest.js → BundleGraphRequest.ts} +71 -58
- package/src/requests/{ConfigRequest.js → ConfigRequest.ts} +71 -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} +20 -22
- package/src/requests/{PathRequest.js → PathRequest.ts} +47 -37
- package/src/requests/{TargetRequest.js → TargetRequest.ts} +260 -179
- package/src/requests/{ValidationRequest.js → ValidationRequest.ts} +18 -17
- package/src/requests/{WriteBundleRequest.js → WriteBundleRequest.ts} +77 -49
- package/src/requests/{WriteBundlesRequest.js → WriteBundlesRequest.ts} +109 -37
- 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} +56 -24
- 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 +647 -0
- package/src/{utils.js → utils.ts} +52 -21
- package/src/{worker.js → worker.ts} +49 -41
- package/test/{AssetGraph.test.js → AssetGraph.test.ts} +37 -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} +75 -15
- 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} +314 -59
- package/test/{SymbolPropagation.test.js → SymbolPropagation.test.ts} +124 -74
- package/test/{TargetRequest.test.js → TargetRequest.test.ts} +66 -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.js → AssetGraphRequestRust.test.ts} +164 -134
- package/test/requests/{ConfigRequest.test.js → ConfigRequest.test.ts} +202 -13
- package/test/requests/{DevDepRequest.test.js → DevDepRequest.test.ts} +0 -2
- package/test/{test-utils.js → test-utils.ts} +4 -11
- package/test/{utils.test.js → utils.test.ts} +1 -3
- package/tsconfig.json +57 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/index.d.ts +0 -30
- package/src/atlaspack-v3/AtlaspackV3.js +0 -87
- package/src/atlaspack-v3/jsCallable.js +0 -18
- package/src/index.js +0 -13
- package/src/requests/AssetGraphRequestRust.js +0 -263
- 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
|
@@ -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 {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { NodeId } from '@atlaspack/graph';
|
|
2
|
+
import type { Async } from '@atlaspack/types';
|
|
3
|
+
import type { SharedReference } from '@atlaspack/workers';
|
|
4
|
+
import type { Asset, AssetGroup, Dependency, Entry, AtlaspackOptions } from '../types';
|
|
5
|
+
import type { StaticRunOpts, RunAPI } from '../RequestTracker';
|
|
6
|
+
import type { Diagnostic } from '@atlaspack/diagnostic';
|
|
7
|
+
import { PromiseQueue } from '@atlaspack/utils';
|
|
8
|
+
import AssetGraph from '../AssetGraph';
|
|
9
|
+
import { ProjectPath } from '../projectPath';
|
|
10
|
+
import { requestTypes } from '../RequestTracker';
|
|
11
|
+
export type AssetGraphRequestInput = {
|
|
12
|
+
entries?: Array<ProjectPath>;
|
|
13
|
+
assetGroups?: Array<AssetGroup>;
|
|
14
|
+
optionsRef: SharedReference;
|
|
15
|
+
name: string;
|
|
16
|
+
shouldBuildLazily?: boolean;
|
|
17
|
+
lazyIncludes?: RegExp[];
|
|
18
|
+
lazyExcludes?: RegExp[];
|
|
19
|
+
requestedAssetIds?: Set<string>;
|
|
20
|
+
};
|
|
21
|
+
export type AssetGraphRequestResult = {
|
|
22
|
+
assetGraph: AssetGraph;
|
|
23
|
+
/** Assets added/modified since the last successful build. */
|
|
24
|
+
changedAssets: Map<string, Asset>;
|
|
25
|
+
/** Assets added/modified since the last symbol propagation invocation. */
|
|
26
|
+
changedAssetsPropagation: Set<string>;
|
|
27
|
+
assetGroupsWithRemovedParents: Set<NodeId> | null | undefined;
|
|
28
|
+
previousSymbolPropagationErrors: Map<NodeId, Array<Diagnostic>> | null | undefined;
|
|
29
|
+
assetRequests: Array<AssetGroup>;
|
|
30
|
+
};
|
|
31
|
+
type RunInput = {
|
|
32
|
+
input: AssetGraphRequestInput;
|
|
33
|
+
} & StaticRunOpts<AssetGraphRequestResult>;
|
|
34
|
+
type AssetGraphRequest = {
|
|
35
|
+
id: string;
|
|
36
|
+
readonly type: typeof requestTypes.asset_graph_request;
|
|
37
|
+
run: (arg1: RunInput) => Async<AssetGraphRequestResult>;
|
|
38
|
+
input: AssetGraphRequestInput;
|
|
39
|
+
};
|
|
40
|
+
export default function createAssetGraphRequest(requestInput: AssetGraphRequestInput): AssetGraphRequest;
|
|
41
|
+
export declare class AssetGraphBuilder {
|
|
42
|
+
assetGraph: AssetGraph;
|
|
43
|
+
assetRequests: Array<AssetGroup>;
|
|
44
|
+
queue: PromiseQueue<unknown>;
|
|
45
|
+
changedAssets: Map<string, Asset>;
|
|
46
|
+
changedAssetsPropagation: Set<string>;
|
|
47
|
+
prevChangedAssetsPropagation: Set<string> | null | undefined;
|
|
48
|
+
optionsRef: SharedReference;
|
|
49
|
+
options: AtlaspackOptions;
|
|
50
|
+
api: RunAPI<AssetGraphRequestResult>;
|
|
51
|
+
name: string;
|
|
52
|
+
cacheKey: string;
|
|
53
|
+
shouldBuildLazily: boolean;
|
|
54
|
+
lazyIncludes: RegExp[];
|
|
55
|
+
lazyExcludes: RegExp[];
|
|
56
|
+
requestedAssetIds: Set<string>;
|
|
57
|
+
isSingleChangeRebuild: boolean;
|
|
58
|
+
assetGroupsWithRemovedParents: Set<NodeId>;
|
|
59
|
+
previousSymbolPropagationErrors: Map<NodeId, Array<Diagnostic>>;
|
|
60
|
+
constructor({ input, api, options }: RunInput, prevResult?: AssetGraphRequestResult | null);
|
|
61
|
+
build(): Promise<AssetGraphRequestResult>;
|
|
62
|
+
shouldVisitChild(nodeId: NodeId, childNodeId: NodeId): boolean;
|
|
63
|
+
shouldSkipRequest(nodeId: NodeId): boolean;
|
|
64
|
+
queueCorrespondingRequest(nodeId: NodeId, errors: Array<Error>): Promise<null>;
|
|
65
|
+
runEntryRequest(input: ProjectPath): Promise<void>;
|
|
66
|
+
runTargetRequest(input: Entry): Promise<void>;
|
|
67
|
+
runPathRequest(input: Dependency): Promise<void>;
|
|
68
|
+
runAssetRequest(input: AssetGroup): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* Used for incremental bundling of modified assets
|
|
71
|
+
*/
|
|
72
|
+
_areDependenciesEqualForAssets(asset: Asset, otherAsset: Asset): boolean;
|
|
73
|
+
}
|
|
74
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Async } from '@atlaspack/types';
|
|
2
|
+
import AssetGraph from '../AssetGraph';
|
|
3
|
+
import type { AtlaspackV3 } from '../atlaspack-v3';
|
|
4
|
+
import { requestTypes, StaticRunOpts } from '../RequestTracker';
|
|
5
|
+
import type { Asset } from '../types';
|
|
6
|
+
import type { AssetGraphRequestInput, AssetGraphRequestResult } from './AssetGraphRequest';
|
|
7
|
+
type RunInput = {
|
|
8
|
+
input: AssetGraphRequestInput;
|
|
9
|
+
} & StaticRunOpts<AssetGraphRequestResult>;
|
|
10
|
+
type AssetGraphRequest = {
|
|
11
|
+
id: string;
|
|
12
|
+
readonly type: typeof requestTypes.asset_graph_request;
|
|
13
|
+
run: (arg1: RunInput) => Async<AssetGraphRequestResult>;
|
|
14
|
+
input: AssetGraphRequestInput;
|
|
15
|
+
};
|
|
16
|
+
export declare function createAssetGraphRequestRust(rustAtlaspack: AtlaspackV3): (input: AssetGraphRequestInput) => AssetGraphRequest;
|
|
17
|
+
export declare function getAssetGraph(serializedGraph: any, prevAssetGraph?: AssetGraph): {
|
|
18
|
+
assetGraph: AssetGraph;
|
|
19
|
+
changedAssets: Map<string, Asset>;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ContentKey } from '@atlaspack/graph';
|
|
2
|
+
import type { Async } from '@atlaspack/types';
|
|
3
|
+
import type { StaticRunOpts } from '../RequestTracker';
|
|
4
|
+
import type { AssetRequestInput, AssetRequestResult } from '../types';
|
|
5
|
+
import { requestTypes } from '../RequestTracker';
|
|
6
|
+
type RunInput<TResult> = {
|
|
7
|
+
input: AssetRequestInput;
|
|
8
|
+
} & StaticRunOpts<TResult>;
|
|
9
|
+
export type AssetRequest = {
|
|
10
|
+
id: ContentKey;
|
|
11
|
+
readonly type: typeof requestTypes.asset_request;
|
|
12
|
+
run: (arg1: RunInput<AssetRequestResult>) => Async<AssetRequestResult>;
|
|
13
|
+
input: AssetRequestInput;
|
|
14
|
+
};
|
|
15
|
+
export default function createAssetRequest(input: AssetRequestInput): AssetRequest;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ContentKey } from '@atlaspack/graph';
|
|
2
|
+
import type { Async } from '@atlaspack/types';
|
|
3
|
+
import type { SharedReference } from '@atlaspack/workers';
|
|
4
|
+
import type { StaticRunOpts } from '../RequestTracker';
|
|
5
|
+
import type { Asset, AssetGroup, PackagedBundleInfo } from '../types';
|
|
6
|
+
import type BundleGraph from '../BundleGraph';
|
|
7
|
+
import { requestTypes } from '../RequestTracker';
|
|
8
|
+
type AtlaspackBuildRequestInput = {
|
|
9
|
+
optionsRef: SharedReference;
|
|
10
|
+
requestedAssetIds: Set<string>;
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
};
|
|
13
|
+
export type AtlaspackBuildRequestResult = {
|
|
14
|
+
bundleGraph: BundleGraph;
|
|
15
|
+
bundleInfo: Map<string, PackagedBundleInfo>;
|
|
16
|
+
changedAssets: Map<string, Asset>;
|
|
17
|
+
assetRequests: Array<AssetGroup>;
|
|
18
|
+
scopeHoistingStats?: {
|
|
19
|
+
totalAssets: number;
|
|
20
|
+
wrappedAssets: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
type RunInput<TResult> = {
|
|
24
|
+
input: AtlaspackBuildRequestInput;
|
|
25
|
+
} & StaticRunOpts<TResult>;
|
|
26
|
+
export type AtlaspackBuildRequest = {
|
|
27
|
+
id: ContentKey;
|
|
28
|
+
readonly type: typeof requestTypes.atlaspack_build_request;
|
|
29
|
+
run: (arg1: RunInput<AtlaspackBuildRequestResult>) => Async<AtlaspackBuildRequestResult>;
|
|
30
|
+
input: AtlaspackBuildRequestInput;
|
|
31
|
+
};
|
|
32
|
+
export default function createAtlaspackBuildRequest(input: AtlaspackBuildRequestInput): AtlaspackBuildRequest;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Async, FilePath, RawAtlaspackConfig, ResolvedAtlaspackConfigFile } from '@atlaspack/types';
|
|
2
|
+
import type { FileSystem } from '@atlaspack/fs';
|
|
3
|
+
import type { StaticRunOpts } from '../RequestTracker';
|
|
4
|
+
import type { ExtendableAtlaspackConfigPipeline, AtlaspackOptions, ProcessedAtlaspackConfig } from '../types';
|
|
5
|
+
import { AtlaspackConfig } from '../AtlaspackConfig';
|
|
6
|
+
import { requestTypes } from '../RequestTracker';
|
|
7
|
+
type ConfigMap<K, V> = Partial<Record<K, V>>;
|
|
8
|
+
export type ConfigAndCachePath = {
|
|
9
|
+
config: ProcessedAtlaspackConfig;
|
|
10
|
+
cachePath: string;
|
|
11
|
+
};
|
|
12
|
+
type RunOpts<TResult> = {
|
|
13
|
+
input: null;
|
|
14
|
+
} & StaticRunOpts<TResult>;
|
|
15
|
+
export type AtlaspackConfigRequest = {
|
|
16
|
+
id: string;
|
|
17
|
+
type: typeof requestTypes.atlaspack_config_request;
|
|
18
|
+
input: null;
|
|
19
|
+
run: (arg1: RunOpts<AtlaspackConfigRequestResult>) => Async<AtlaspackConfigRequestResult>;
|
|
20
|
+
};
|
|
21
|
+
export type AtlaspackConfigRequestResult = ConfigAndCachePath;
|
|
22
|
+
type AtlaspackConfigChain = {
|
|
23
|
+
config: ProcessedAtlaspackConfig;
|
|
24
|
+
extendedFiles: Array<FilePath>;
|
|
25
|
+
};
|
|
26
|
+
export default function createAtlaspackConfigRequest(): AtlaspackConfigRequest;
|
|
27
|
+
export declare function getCachedAtlaspackConfig(result: ConfigAndCachePath, options: AtlaspackOptions): AtlaspackConfig;
|
|
28
|
+
export declare function loadAtlaspackConfig(options: AtlaspackOptions): Promise<AtlaspackConfigChain & {
|
|
29
|
+
usedDefault: boolean;
|
|
30
|
+
}>;
|
|
31
|
+
export declare function resolveAtlaspackConfig(options: AtlaspackOptions): Promise<(AtlaspackConfigChain & {
|
|
32
|
+
usedDefault: boolean;
|
|
33
|
+
}) | null | undefined>;
|
|
34
|
+
export declare function create(config: ResolvedAtlaspackConfigFile, options: AtlaspackOptions): Promise<AtlaspackConfigChain>;
|
|
35
|
+
export declare function parseAndProcessConfig(configPath: FilePath, contents: string, options: AtlaspackOptions): Promise<AtlaspackConfigChain>;
|
|
36
|
+
export declare function processConfig(configFile: ResolvedAtlaspackConfigFile, options: AtlaspackOptions): Promise<ProcessedAtlaspackConfig>;
|
|
37
|
+
export declare function processConfigChain(configFile: RawAtlaspackConfig | ResolvedAtlaspackConfigFile, filePath: FilePath, options: AtlaspackOptions): Promise<AtlaspackConfigChain>;
|
|
38
|
+
export declare function resolveExtends(ext: string, configPath: FilePath, extendsKey: string, options: AtlaspackOptions): Promise<FilePath>;
|
|
39
|
+
export declare function validateConfigFile(config: RawAtlaspackConfig | ResolvedAtlaspackConfigFile, relativePath: FilePath): void;
|
|
40
|
+
export declare function validateNotEmpty(config: RawAtlaspackConfig | ResolvedAtlaspackConfigFile, relativePath: FilePath): void;
|
|
41
|
+
export declare function mergeConfigs(base: ProcessedAtlaspackConfig, ext: ProcessedAtlaspackConfig): ProcessedAtlaspackConfig;
|
|
42
|
+
export declare function getResolveFrom(fs: FileSystem, projectRoot: FilePath): FilePath;
|
|
43
|
+
export declare function mergePipelines(base?: ExtendableAtlaspackConfigPipeline | null, ext?: ExtendableAtlaspackConfigPipeline | null): ExtendableAtlaspackConfigPipeline;
|
|
44
|
+
export declare function mergeMaps<K extends string, V>(base?: ConfigMap<K, V> | null, ext?: ConfigMap<K, V> | null, merger?: (a: V, b: V) => V): ConfigMap<K, V>;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Async } from '@atlaspack/types';
|
|
2
|
+
import type { SharedReference } from '@atlaspack/workers';
|
|
3
|
+
import type { StaticRunOpts } from '../RequestTracker';
|
|
4
|
+
import type { Asset, AssetGroup } from '../types';
|
|
5
|
+
import InternalBundleGraph from '../BundleGraph';
|
|
6
|
+
import { requestTypes } from '../RequestTracker';
|
|
7
|
+
type BundleGraphRequestInput = {
|
|
8
|
+
requestedAssetIds: Set<string>;
|
|
9
|
+
signal?: AbortSignal;
|
|
10
|
+
optionsRef: SharedReference;
|
|
11
|
+
};
|
|
12
|
+
type RunInput = {
|
|
13
|
+
input: BundleGraphRequestInput;
|
|
14
|
+
} & StaticRunOpts<BundleGraphResult>;
|
|
15
|
+
export type BundleGraphResult = {
|
|
16
|
+
bundleGraph: InternalBundleGraph;
|
|
17
|
+
assetGraphBundlingVersion: number;
|
|
18
|
+
changedAssets: Map<string, Asset>;
|
|
19
|
+
assetRequests: Array<AssetGroup>;
|
|
20
|
+
};
|
|
21
|
+
type BundleGraphRequest = {
|
|
22
|
+
id: string;
|
|
23
|
+
readonly type: typeof requestTypes.bundle_graph_request;
|
|
24
|
+
run: (arg1: RunInput) => Async<BundleGraphResult>;
|
|
25
|
+
input: BundleGraphRequestInput;
|
|
26
|
+
};
|
|
27
|
+
export default function createBundleGraphRequest(input: BundleGraphRequestInput): BundleGraphRequest;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Async, Config as IConfig, PluginOptions as IPluginOptions, PluginLogger as IPluginLogger, PluginTracer as IPluginTracer, NamedBundle as INamedBundle, BundleGraph as IBundleGraph } from '@atlaspack/types';
|
|
2
|
+
import type { Config, AtlaspackOptions, InternalFileCreateInvalidation } from '../types';
|
|
3
|
+
import type { LoadedPlugin } from '../AtlaspackConfig';
|
|
4
|
+
import type { RequestResult, RunAPI } from '../RequestTracker';
|
|
5
|
+
import type { ProjectPath } from '../projectPath';
|
|
6
|
+
export type PluginWithLoadConfig = {
|
|
7
|
+
loadConfig?: (arg1: {
|
|
8
|
+
config: IConfig;
|
|
9
|
+
options: IPluginOptions;
|
|
10
|
+
logger: IPluginLogger;
|
|
11
|
+
tracer: IPluginTracer;
|
|
12
|
+
}) => Async<unknown>;
|
|
13
|
+
};
|
|
14
|
+
export type PluginWithBundleConfig = {
|
|
15
|
+
loadConfig?: (arg1: {
|
|
16
|
+
config: IConfig;
|
|
17
|
+
options: IPluginOptions;
|
|
18
|
+
logger: IPluginLogger;
|
|
19
|
+
tracer: IPluginTracer;
|
|
20
|
+
}) => Async<unknown>;
|
|
21
|
+
loadBundleConfig?: (arg1: {
|
|
22
|
+
bundle: INamedBundle;
|
|
23
|
+
bundleGraph: IBundleGraph<INamedBundle>;
|
|
24
|
+
config: IConfig;
|
|
25
|
+
options: IPluginOptions;
|
|
26
|
+
logger: IPluginLogger;
|
|
27
|
+
tracer: IPluginTracer;
|
|
28
|
+
}) => Async<unknown>;
|
|
29
|
+
};
|
|
30
|
+
export type ConfigRequest = {
|
|
31
|
+
id: string;
|
|
32
|
+
invalidateOnFileChange: Set<ProjectPath>;
|
|
33
|
+
invalidateOnConfigKeyChange: Array<{
|
|
34
|
+
filePath: ProjectPath;
|
|
35
|
+
configKey: string[];
|
|
36
|
+
}>;
|
|
37
|
+
invalidateOnFileCreate: Array<InternalFileCreateInvalidation>;
|
|
38
|
+
invalidateOnEnvChange: Set<string>;
|
|
39
|
+
invalidateOnOptionChange: Set<string>;
|
|
40
|
+
invalidateOnStartup: boolean;
|
|
41
|
+
invalidateOnBuild: boolean;
|
|
42
|
+
};
|
|
43
|
+
export type ConfigRequestResult = undefined;
|
|
44
|
+
export declare function loadPluginConfig<T extends PluginWithLoadConfig>(loadedPlugin: LoadedPlugin<T>, config: Config, options: AtlaspackOptions): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Return value at a given key path within an object.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* const obj = { a: { b: { c: 'd' } } };
|
|
50
|
+
* getValueAtPath(obj, ['a', 'b', 'c']); // 'd'
|
|
51
|
+
* getValueAtPath(obj, ['a', 'b', 'd']); // undefined
|
|
52
|
+
* getValueAtPath(obj, ['a', 'b']); // { c: 'd' }
|
|
53
|
+
* getValueAtPath(obj, ['a', 'b', 'c', 'd']); // undefined
|
|
54
|
+
*/
|
|
55
|
+
export declare function getValueAtPath(obj: any, key: string[]): any;
|
|
56
|
+
export declare function getConfigKeyContentHash(filePath: ProjectPath, configKey: string[], options: AtlaspackOptions): Promise<Async<string>>;
|
|
57
|
+
export declare function runConfigRequest<TResult extends RequestResult>(api: RunAPI<TResult>, configRequest: ConfigRequest): Promise<void>;
|
|
58
|
+
export declare function getConfigHash(config: Config, pluginName: string, options: AtlaspackOptions): Promise<string>;
|
|
59
|
+
export declare function getConfigRequests(configs: Array<Config>): Array<ConfigRequest>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { DependencySpecifier, SemverRange } from '@atlaspack/types';
|
|
2
|
+
import type { AtlaspackConfig } from '../AtlaspackConfig';
|
|
3
|
+
import type { DevDepRequest, AtlaspackOptions, InternalDevDepOptions, DevDepRequestRef } from '../types';
|
|
4
|
+
import type { RequestResult, RunAPI } from '../RequestTracker';
|
|
5
|
+
import type { ProjectPath } from '../projectPath';
|
|
6
|
+
export declare function createDevDependency(opts: InternalDevDepOptions, requestDevDeps: Map<string, string>, options: AtlaspackOptions): Promise<DevDepRequest | DevDepRequestRef>;
|
|
7
|
+
export type DevDepSpecifier = {
|
|
8
|
+
specifier: DependencySpecifier;
|
|
9
|
+
resolveFrom: ProjectPath;
|
|
10
|
+
};
|
|
11
|
+
type DevDepRequests = {
|
|
12
|
+
devDeps: Map<string, string>;
|
|
13
|
+
invalidDevDeps: Array<DevDepSpecifier>;
|
|
14
|
+
};
|
|
15
|
+
export declare function getDevDepRequests<TResult extends RequestResult>(api: RunAPI<TResult>): Promise<DevDepRequests>;
|
|
16
|
+
export declare function invalidateDevDeps(invalidDevDeps: Array<DevDepSpecifier>, options: AtlaspackOptions, config: AtlaspackConfig): void;
|
|
17
|
+
export type DevDepRequestResult = {
|
|
18
|
+
specifier: DependencySpecifier;
|
|
19
|
+
resolveFrom: ProjectPath;
|
|
20
|
+
hash: string;
|
|
21
|
+
additionalInvalidations: undefined | Array<{
|
|
22
|
+
range?: SemverRange | null | undefined;
|
|
23
|
+
resolveFrom: ProjectPath;
|
|
24
|
+
specifier: DependencySpecifier;
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
export declare function resolveDevDepRequestRef(devDepRequestRef: DevDepRequest | DevDepRequestRef): DevDepRequest;
|
|
28
|
+
export declare function runDevDepRequest<TResult extends RequestResult>(api: RunAPI<TResult>, devDepRequestRef: DevDepRequest | DevDepRequestRef): Promise<void>;
|
|
29
|
+
export declare function getWorkerDevDepRequests(devDepRequests: Array<DevDepRequest | DevDepRequestRef>): Array<DevDepRequest | DevDepRequestRef>;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Async, FilePath, PackageJSON, Glob } from '@atlaspack/types';
|
|
2
|
+
import type { StaticRunOpts } from '../RequestTracker';
|
|
3
|
+
import type { Entry, InternalFile, AtlaspackOptions } from '../types';
|
|
4
|
+
import { Mapping } from '@mischnic/json-sourcemap';
|
|
5
|
+
import { requestTypes } from '../RequestTracker';
|
|
6
|
+
import { ProjectPath } from '../projectPath';
|
|
7
|
+
type RunOpts<TResult> = {
|
|
8
|
+
input: ProjectPath;
|
|
9
|
+
} & StaticRunOpts<TResult>;
|
|
10
|
+
export type EntryRequest = {
|
|
11
|
+
id: string;
|
|
12
|
+
readonly type: typeof requestTypes.entry_request;
|
|
13
|
+
run: (arg1: RunOpts<EntryRequestResult>) => Async<EntryRequestResult>;
|
|
14
|
+
input: ProjectPath;
|
|
15
|
+
};
|
|
16
|
+
export type EntryRequestResult = {
|
|
17
|
+
entries: Array<Entry>;
|
|
18
|
+
files: Array<InternalFile>;
|
|
19
|
+
globs: Array<Glob>;
|
|
20
|
+
};
|
|
21
|
+
export default function createEntryRequest(input: ProjectPath): EntryRequest;
|
|
22
|
+
export declare class EntryResolver {
|
|
23
|
+
options: AtlaspackOptions;
|
|
24
|
+
constructor(options: AtlaspackOptions);
|
|
25
|
+
resolveEntry(entry: FilePath): Promise<EntryRequestResult>;
|
|
26
|
+
readPackage(entry: FilePath): Promise<(PackageJSON & {
|
|
27
|
+
filePath: FilePath;
|
|
28
|
+
map: {
|
|
29
|
+
data: unknown;
|
|
30
|
+
pointers: {
|
|
31
|
+
[key: string]: Mapping;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
}) | null | undefined>;
|
|
35
|
+
}
|
|
36
|
+
export {};
|