@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
package/src/types.js
DELETED
|
@@ -1,600 +0,0 @@
|
|
|
1
|
-
// @flow strict-local
|
|
2
|
-
|
|
3
|
-
import type {ContentKey} from '@atlaspack/graph';
|
|
4
|
-
import type {
|
|
5
|
-
ASTGenerator,
|
|
6
|
-
BuildMode,
|
|
7
|
-
Engines,
|
|
8
|
-
EnvironmentContext,
|
|
9
|
-
EnvMap,
|
|
10
|
-
FilePath,
|
|
11
|
-
Glob,
|
|
12
|
-
LogLevel,
|
|
13
|
-
Meta,
|
|
14
|
-
DependencySpecifier,
|
|
15
|
-
PackageName,
|
|
16
|
-
ReporterEvent,
|
|
17
|
-
SemverRange,
|
|
18
|
-
ServerOptions,
|
|
19
|
-
SourceType,
|
|
20
|
-
Stats,
|
|
21
|
-
Symbol,
|
|
22
|
-
TargetSourceMapOptions,
|
|
23
|
-
ConfigResult,
|
|
24
|
-
OutputFormat,
|
|
25
|
-
TargetDescriptor,
|
|
26
|
-
HMROptions,
|
|
27
|
-
DetailedReportOptions,
|
|
28
|
-
} from '@atlaspack/types';
|
|
29
|
-
import type {SharedReference} from '@atlaspack/workers';
|
|
30
|
-
import type {FileSystem} from '@atlaspack/fs';
|
|
31
|
-
import type {Cache} from '@atlaspack/cache';
|
|
32
|
-
import type {PackageManager} from '@atlaspack/package-manager';
|
|
33
|
-
import type {ProjectPath} from './projectPath';
|
|
34
|
-
import type {Event} from '@parcel/watcher';
|
|
35
|
-
import type {FeatureFlags} from '@atlaspack/feature-flags';
|
|
36
|
-
import type {BackendType} from '@parcel/watcher';
|
|
37
|
-
|
|
38
|
-
export type AtlaspackPluginNode = {|
|
|
39
|
-
packageName: PackageName,
|
|
40
|
-
resolveFrom: ProjectPath,
|
|
41
|
-
keyPath?: string,
|
|
42
|
-
|};
|
|
43
|
-
export type ParcelPluginNode = AtlaspackPluginNode;
|
|
44
|
-
|
|
45
|
-
export type PureAtlaspackConfigPipeline = $ReadOnlyArray<AtlaspackPluginNode>;
|
|
46
|
-
export type ExtendableAtlaspackConfigPipeline = $ReadOnlyArray<
|
|
47
|
-
AtlaspackPluginNode | '...',
|
|
48
|
-
>;
|
|
49
|
-
|
|
50
|
-
export type ProcessedAtlaspackConfig = {|
|
|
51
|
-
resolvers?: PureAtlaspackConfigPipeline,
|
|
52
|
-
transformers?: {[Glob]: ExtendableAtlaspackConfigPipeline, ...},
|
|
53
|
-
bundler: ?ParcelPluginNode,
|
|
54
|
-
namers?: PureAtlaspackConfigPipeline,
|
|
55
|
-
runtimes?: PureAtlaspackConfigPipeline,
|
|
56
|
-
packagers?: {[Glob]: ParcelPluginNode, ...},
|
|
57
|
-
optimizers?: {[Glob]: ExtendableAtlaspackConfigPipeline, ...},
|
|
58
|
-
compressors?: {[Glob]: ExtendableAtlaspackConfigPipeline, ...},
|
|
59
|
-
reporters?: PureAtlaspackConfigPipeline,
|
|
60
|
-
validators?: {[Glob]: ExtendableAtlaspackConfigPipeline, ...},
|
|
61
|
-
filePath: ProjectPath,
|
|
62
|
-
resolveFrom?: ProjectPath,
|
|
63
|
-
|};
|
|
64
|
-
|
|
65
|
-
export type Environment = {|
|
|
66
|
-
id: string,
|
|
67
|
-
context: EnvironmentContext,
|
|
68
|
-
engines: Engines,
|
|
69
|
-
includeNodeModules:
|
|
70
|
-
| boolean
|
|
71
|
-
| Array<PackageName>
|
|
72
|
-
| {[PackageName]: boolean, ...},
|
|
73
|
-
outputFormat: OutputFormat,
|
|
74
|
-
sourceType: SourceType,
|
|
75
|
-
isLibrary: boolean,
|
|
76
|
-
shouldOptimize: boolean,
|
|
77
|
-
shouldScopeHoist: boolean,
|
|
78
|
-
sourceMap: ?TargetSourceMapOptions,
|
|
79
|
-
loc: ?InternalSourceLocation,
|
|
80
|
-
unstableSingleFileOutput: boolean,
|
|
81
|
-
|};
|
|
82
|
-
|
|
83
|
-
export type InternalSourceLocation = {|
|
|
84
|
-
+filePath: ProjectPath,
|
|
85
|
-
/** inclusive */
|
|
86
|
-
+start: {|
|
|
87
|
-
+line: number,
|
|
88
|
-
+column: number,
|
|
89
|
-
|},
|
|
90
|
-
/** exclusive */
|
|
91
|
-
+end: {|
|
|
92
|
-
+line: number,
|
|
93
|
-
+column: number,
|
|
94
|
-
|},
|
|
95
|
-
|};
|
|
96
|
-
|
|
97
|
-
export type Target = {|
|
|
98
|
-
distEntry?: ?FilePath,
|
|
99
|
-
distDir: ProjectPath,
|
|
100
|
-
env: Environment,
|
|
101
|
-
name: string,
|
|
102
|
-
publicUrl: string,
|
|
103
|
-
loc?: ?InternalSourceLocation,
|
|
104
|
-
pipeline?: string,
|
|
105
|
-
source?: FilePath | Array<FilePath>,
|
|
106
|
-
|};
|
|
107
|
-
|
|
108
|
-
export const SpecifierType = {
|
|
109
|
-
esm: 0,
|
|
110
|
-
commonjs: 1,
|
|
111
|
-
url: 2,
|
|
112
|
-
custom: 3,
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
export const Priority = {
|
|
116
|
-
sync: 0,
|
|
117
|
-
parallel: 1,
|
|
118
|
-
lazy: 2,
|
|
119
|
-
conditional: 3,
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
// Must match package_json.rs in node-resolver-rs.
|
|
123
|
-
export const ExportsCondition = {
|
|
124
|
-
import: 1 << 0,
|
|
125
|
-
require: 1 << 1,
|
|
126
|
-
module: 1 << 2,
|
|
127
|
-
style: 1 << 12,
|
|
128
|
-
sass: 1 << 13,
|
|
129
|
-
less: 1 << 14,
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
export type Dependency = {|
|
|
133
|
-
id: string,
|
|
134
|
-
specifier: DependencySpecifier,
|
|
135
|
-
specifierType: $Values<typeof SpecifierType>,
|
|
136
|
-
priority: $Values<typeof Priority>,
|
|
137
|
-
needsStableName: boolean,
|
|
138
|
-
bundleBehavior: ?$Values<typeof BundleBehavior>,
|
|
139
|
-
isEntry: boolean,
|
|
140
|
-
isOptional: boolean,
|
|
141
|
-
loc: ?InternalSourceLocation,
|
|
142
|
-
env: Environment,
|
|
143
|
-
packageConditions?: number,
|
|
144
|
-
customPackageConditions?: Array<string>,
|
|
145
|
-
meta: Meta,
|
|
146
|
-
resolverMeta?: ?Meta,
|
|
147
|
-
target: ?Target,
|
|
148
|
-
sourceAssetId: ?string,
|
|
149
|
-
sourcePath: ?ProjectPath,
|
|
150
|
-
sourceAssetType?: ?string,
|
|
151
|
-
resolveFrom: ?ProjectPath,
|
|
152
|
-
range: ?SemverRange,
|
|
153
|
-
symbols: ?Map<
|
|
154
|
-
Symbol,
|
|
155
|
-
{|
|
|
156
|
-
local: Symbol,
|
|
157
|
-
loc: ?InternalSourceLocation,
|
|
158
|
-
isWeak: boolean,
|
|
159
|
-
meta?: ?Meta,
|
|
160
|
-
|},
|
|
161
|
-
>,
|
|
162
|
-
pipeline?: ?string,
|
|
163
|
-
|};
|
|
164
|
-
|
|
165
|
-
export const BundleBehavior = {
|
|
166
|
-
inline: 0,
|
|
167
|
-
isolated: 1,
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
export const BundleBehaviorNames: Array<$Keys<typeof BundleBehavior>> =
|
|
171
|
-
Object.keys(BundleBehavior);
|
|
172
|
-
|
|
173
|
-
export type Asset = {|
|
|
174
|
-
id: ContentKey,
|
|
175
|
-
committed: boolean,
|
|
176
|
-
filePath: ProjectPath,
|
|
177
|
-
query: ?string,
|
|
178
|
-
type: string,
|
|
179
|
-
dependencies: Map<string, Dependency>,
|
|
180
|
-
bundleBehavior: ?$Values<typeof BundleBehavior>,
|
|
181
|
-
isBundleSplittable: boolean,
|
|
182
|
-
isSource: boolean,
|
|
183
|
-
env: Environment,
|
|
184
|
-
meta: Meta,
|
|
185
|
-
stats: Stats,
|
|
186
|
-
contentKey: ?string,
|
|
187
|
-
mapKey: ?string,
|
|
188
|
-
outputHash: ?string,
|
|
189
|
-
pipeline: ?string,
|
|
190
|
-
astKey: ?string,
|
|
191
|
-
astGenerator: ?ASTGenerator,
|
|
192
|
-
symbols: ?Map<
|
|
193
|
-
Symbol,
|
|
194
|
-
{|local: Symbol, loc: ?InternalSourceLocation, meta?: ?Meta|},
|
|
195
|
-
>,
|
|
196
|
-
sideEffects: boolean,
|
|
197
|
-
uniqueKey: ?string,
|
|
198
|
-
configPath?: ProjectPath,
|
|
199
|
-
plugin: ?PackageName,
|
|
200
|
-
configKeyPath?: string,
|
|
201
|
-
isLargeBlob?: boolean,
|
|
202
|
-
|};
|
|
203
|
-
|
|
204
|
-
export type InternalGlob = ProjectPath;
|
|
205
|
-
|
|
206
|
-
export type InternalFile = {|
|
|
207
|
-
+filePath: ProjectPath,
|
|
208
|
-
+hash?: string,
|
|
209
|
-
|};
|
|
210
|
-
|
|
211
|
-
export type FileInvalidation = {|
|
|
212
|
-
type: 'file',
|
|
213
|
-
filePath: ProjectPath,
|
|
214
|
-
|};
|
|
215
|
-
|
|
216
|
-
export type EnvInvalidation = {|
|
|
217
|
-
type: 'env',
|
|
218
|
-
key: string,
|
|
219
|
-
|};
|
|
220
|
-
|
|
221
|
-
export type OptionInvalidation = {|
|
|
222
|
-
type: 'option',
|
|
223
|
-
key: string,
|
|
224
|
-
|};
|
|
225
|
-
|
|
226
|
-
export type RequestInvalidation =
|
|
227
|
-
| FileInvalidation
|
|
228
|
-
| EnvInvalidation
|
|
229
|
-
| OptionInvalidation;
|
|
230
|
-
|
|
231
|
-
export type InternalFileInvalidation = {|
|
|
232
|
-
filePath: ProjectPath,
|
|
233
|
-
|};
|
|
234
|
-
|
|
235
|
-
export type InternalGlobInvalidation = {|
|
|
236
|
-
glob: InternalGlob,
|
|
237
|
-
|};
|
|
238
|
-
|
|
239
|
-
export type InternalFileAboveInvalidation = {|
|
|
240
|
-
fileName: string,
|
|
241
|
-
aboveFilePath: ProjectPath,
|
|
242
|
-
|};
|
|
243
|
-
|
|
244
|
-
export type InternalFileCreateInvalidation =
|
|
245
|
-
| InternalFileInvalidation
|
|
246
|
-
| InternalGlobInvalidation
|
|
247
|
-
| InternalFileAboveInvalidation;
|
|
248
|
-
|
|
249
|
-
export type Invalidations = {|
|
|
250
|
-
invalidateOnFileChange: Set<ProjectPath>,
|
|
251
|
-
invalidateOnFileCreate: Array<InternalFileCreateInvalidation>,
|
|
252
|
-
invalidateOnEnvChange: Set<string>,
|
|
253
|
-
invalidateOnOptionChange: Set<string>,
|
|
254
|
-
invalidateOnStartup: boolean,
|
|
255
|
-
invalidateOnBuild: boolean,
|
|
256
|
-
|};
|
|
257
|
-
|
|
258
|
-
export type DevDepRequestRef = {|
|
|
259
|
-
type: 'ref',
|
|
260
|
-
specifier: DependencySpecifier,
|
|
261
|
-
resolveFrom: ProjectPath,
|
|
262
|
-
hash: string,
|
|
263
|
-
|};
|
|
264
|
-
|
|
265
|
-
export type DevDepRequest = {|
|
|
266
|
-
specifier: DependencySpecifier,
|
|
267
|
-
resolveFrom: ProjectPath,
|
|
268
|
-
hash: string,
|
|
269
|
-
invalidateOnFileCreate: Array<InternalFileCreateInvalidation>,
|
|
270
|
-
invalidateOnFileChange: Set<ProjectPath>,
|
|
271
|
-
invalidateOnStartup: boolean,
|
|
272
|
-
additionalInvalidations?: Array<{|
|
|
273
|
-
specifier: DependencySpecifier,
|
|
274
|
-
resolveFrom: ProjectPath,
|
|
275
|
-
range?: ?SemverRange,
|
|
276
|
-
|}>,
|
|
277
|
-
|};
|
|
278
|
-
|
|
279
|
-
declare type GlobPattern = string;
|
|
280
|
-
|
|
281
|
-
export type AtlaspackOptions = {|
|
|
282
|
-
entries: Array<ProjectPath>,
|
|
283
|
-
config?: DependencySpecifier,
|
|
284
|
-
defaultConfig?: DependencySpecifier,
|
|
285
|
-
env: EnvMap,
|
|
286
|
-
parcelVersion: string,
|
|
287
|
-
targets: ?(Array<string> | {+[string]: TargetDescriptor, ...}),
|
|
288
|
-
shouldDisableCache: boolean,
|
|
289
|
-
cacheDir: FilePath,
|
|
290
|
-
watchDir: FilePath,
|
|
291
|
-
watchIgnore?: Array<FilePath | GlobPattern>,
|
|
292
|
-
watchBackend?: BackendType,
|
|
293
|
-
mode: BuildMode,
|
|
294
|
-
hmrOptions: ?HMROptions,
|
|
295
|
-
shouldContentHash: boolean,
|
|
296
|
-
serveOptions: ServerOptions | false,
|
|
297
|
-
shouldBuildLazily: boolean,
|
|
298
|
-
lazyIncludes: RegExp[],
|
|
299
|
-
lazyExcludes: RegExp[],
|
|
300
|
-
shouldBundleIncrementally: boolean,
|
|
301
|
-
shouldAutoInstall: boolean,
|
|
302
|
-
logLevel: LogLevel,
|
|
303
|
-
projectRoot: FilePath,
|
|
304
|
-
shouldProfile: boolean,
|
|
305
|
-
shouldTrace: boolean,
|
|
306
|
-
shouldPatchConsole: boolean,
|
|
307
|
-
detailedReport?: ?DetailedReportOptions,
|
|
308
|
-
unstableFileInvalidations?: Array<Event>,
|
|
309
|
-
|
|
310
|
-
inputFS: FileSystem,
|
|
311
|
-
outputFS: FileSystem,
|
|
312
|
-
cache: Cache,
|
|
313
|
-
packageManager: PackageManager,
|
|
314
|
-
additionalReporters: Array<{|
|
|
315
|
-
packageName: DependencySpecifier,
|
|
316
|
-
resolveFrom: ProjectPath,
|
|
317
|
-
|}>,
|
|
318
|
-
|
|
319
|
-
instanceId: string,
|
|
320
|
-
|
|
321
|
-
+defaultTargetOptions: {|
|
|
322
|
-
+shouldOptimize: boolean,
|
|
323
|
-
+shouldScopeHoist?: boolean,
|
|
324
|
-
+sourceMaps: boolean,
|
|
325
|
-
+publicUrl: string,
|
|
326
|
-
+distDir?: ProjectPath,
|
|
327
|
-
+engines?: Engines,
|
|
328
|
-
+outputFormat?: OutputFormat,
|
|
329
|
-
+isLibrary?: boolean,
|
|
330
|
-
|},
|
|
331
|
-
|
|
332
|
-
+featureFlags: FeatureFlags,
|
|
333
|
-
|};
|
|
334
|
-
export type ParcelOptions = AtlaspackOptions;
|
|
335
|
-
|
|
336
|
-
export type AssetNode = {|
|
|
337
|
-
id: ContentKey,
|
|
338
|
-
+type: 'asset',
|
|
339
|
-
value: Asset,
|
|
340
|
-
usedSymbols: Set<Symbol>,
|
|
341
|
-
hasDeferred?: boolean,
|
|
342
|
-
usedSymbolsDownDirty: boolean,
|
|
343
|
-
usedSymbolsUpDirty: boolean,
|
|
344
|
-
requested?: boolean,
|
|
345
|
-
|};
|
|
346
|
-
|
|
347
|
-
export type DependencyNode = {|
|
|
348
|
-
id: ContentKey,
|
|
349
|
-
type: 'dependency',
|
|
350
|
-
value: Dependency,
|
|
351
|
-
complete?: boolean,
|
|
352
|
-
correspondingRequest?: string,
|
|
353
|
-
deferred: boolean,
|
|
354
|
-
/** dependency was deferred (= no used symbols (in immediate parents) & side-effect free) */
|
|
355
|
-
hasDeferred?: boolean,
|
|
356
|
-
usedSymbolsDown: Set<Symbol>,
|
|
357
|
-
/**
|
|
358
|
-
* a requested symbol -> either
|
|
359
|
-
* - if ambiguous (e.g. dependency to asset group with both CSS modules and JS asset): undefined
|
|
360
|
-
* - if external: null
|
|
361
|
-
* - the asset it resolved to, and the potentially renamed export name
|
|
362
|
-
*/
|
|
363
|
-
usedSymbolsUp: Map<
|
|
364
|
-
Symbol,
|
|
365
|
-
{|asset: ContentKey, symbol: ?Symbol|} | void | null,
|
|
366
|
-
>,
|
|
367
|
-
/*
|
|
368
|
-
* For the "down" pass, the resolutionAsset needs to be updated.
|
|
369
|
-
* This is set when the AssetGraphBuilder adds/removes/updates nodes.
|
|
370
|
-
*/
|
|
371
|
-
usedSymbolsDownDirty: boolean,
|
|
372
|
-
/**
|
|
373
|
-
* In the down pass, `usedSymbolsDown` changed. This needs to be propagated to the resolutionAsset
|
|
374
|
-
* in the up pass.
|
|
375
|
-
*/
|
|
376
|
-
usedSymbolsUpDirtyDown: boolean,
|
|
377
|
-
/**
|
|
378
|
-
* In the up pass, `usedSymbolsUp` changed. This needs to be propagated to the sourceAsset in the
|
|
379
|
-
* up pass.
|
|
380
|
-
*/
|
|
381
|
-
usedSymbolsUpDirtyUp: boolean,
|
|
382
|
-
/** dependency was excluded (= no used symbols (globally) & side-effect free) */
|
|
383
|
-
excluded: boolean,
|
|
384
|
-
|};
|
|
385
|
-
|
|
386
|
-
export type RootNode = {|id: ContentKey, +type: 'root', value: string | null|};
|
|
387
|
-
|
|
388
|
-
export type AssetRequestInput = {|
|
|
389
|
-
name?: string, // AssetGraph name, needed so that different graphs can isolated requests since the results are not stored
|
|
390
|
-
filePath: ProjectPath,
|
|
391
|
-
env: Environment,
|
|
392
|
-
isSource?: boolean,
|
|
393
|
-
canDefer?: boolean,
|
|
394
|
-
sideEffects?: boolean,
|
|
395
|
-
code?: string,
|
|
396
|
-
pipeline?: ?string,
|
|
397
|
-
optionsRef: SharedReference,
|
|
398
|
-
isURL?: boolean,
|
|
399
|
-
query?: ?string,
|
|
400
|
-
isSingleChangeRebuild?: boolean,
|
|
401
|
-
|};
|
|
402
|
-
|
|
403
|
-
export type AssetRequestResult = Array<Asset>;
|
|
404
|
-
// Asset group nodes are essentially used as placeholders for the results of an asset request
|
|
405
|
-
export type AssetGroup = $Rest<
|
|
406
|
-
AssetRequestInput,
|
|
407
|
-
{|optionsRef: SharedReference|},
|
|
408
|
-
>;
|
|
409
|
-
export type AssetGroupNode = {|
|
|
410
|
-
id: ContentKey,
|
|
411
|
-
+type: 'asset_group',
|
|
412
|
-
value: AssetGroup,
|
|
413
|
-
correspondingRequest?: string,
|
|
414
|
-
/** this node was deferred (= no used symbols (in immediate parents) & side-effect free) */
|
|
415
|
-
deferred?: boolean,
|
|
416
|
-
hasDeferred?: boolean,
|
|
417
|
-
usedSymbolsDownDirty: boolean,
|
|
418
|
-
|};
|
|
419
|
-
|
|
420
|
-
export type TransformationRequest = {|
|
|
421
|
-
...AssetGroup,
|
|
422
|
-
invalidateReason: number,
|
|
423
|
-
devDeps: Map<PackageName, string>,
|
|
424
|
-
invalidDevDeps: Array<{|
|
|
425
|
-
specifier: DependencySpecifier,
|
|
426
|
-
resolveFrom: ProjectPath,
|
|
427
|
-
|}>,
|
|
428
|
-
|};
|
|
429
|
-
|
|
430
|
-
export type DepPathRequestNode = {|
|
|
431
|
-
id: ContentKey,
|
|
432
|
-
+type: 'dep_path_request',
|
|
433
|
-
value: Dependency,
|
|
434
|
-
|};
|
|
435
|
-
|
|
436
|
-
export type AssetRequestNode = {|
|
|
437
|
-
id: ContentKey,
|
|
438
|
-
+type: 'asset_request',
|
|
439
|
-
value: AssetRequestInput,
|
|
440
|
-
|};
|
|
441
|
-
|
|
442
|
-
export type EntrySpecifierNode = {|
|
|
443
|
-
id: ContentKey,
|
|
444
|
-
+type: 'entry_specifier',
|
|
445
|
-
value: ProjectPath,
|
|
446
|
-
correspondingRequest?: string,
|
|
447
|
-
|};
|
|
448
|
-
|
|
449
|
-
export type Entry = {|
|
|
450
|
-
filePath: ProjectPath,
|
|
451
|
-
packagePath: ProjectPath,
|
|
452
|
-
target?: string,
|
|
453
|
-
loc?: ?InternalSourceLocation,
|
|
454
|
-
|};
|
|
455
|
-
|
|
456
|
-
export type EntryFileNode = {|
|
|
457
|
-
id: ContentKey,
|
|
458
|
-
+type: 'entry_file',
|
|
459
|
-
value: Entry,
|
|
460
|
-
correspondingRequest?: string,
|
|
461
|
-
|};
|
|
462
|
-
|
|
463
|
-
export type AssetGraphNode =
|
|
464
|
-
| AssetGroupNode
|
|
465
|
-
| AssetNode
|
|
466
|
-
| DependencyNode
|
|
467
|
-
| EntrySpecifierNode
|
|
468
|
-
| EntryFileNode
|
|
469
|
-
| RootNode;
|
|
470
|
-
|
|
471
|
-
export type BundleGraphNode =
|
|
472
|
-
| AssetNode
|
|
473
|
-
| DependencyNode
|
|
474
|
-
| EntrySpecifierNode
|
|
475
|
-
| EntryFileNode
|
|
476
|
-
| RootNode
|
|
477
|
-
| BundleGroupNode
|
|
478
|
-
| BundleNode;
|
|
479
|
-
|
|
480
|
-
export type InternalDevDepOptions = {|
|
|
481
|
-
specifier: DependencySpecifier,
|
|
482
|
-
resolveFrom: ProjectPath,
|
|
483
|
-
range?: ?SemverRange,
|
|
484
|
-
additionalInvalidations?: Array<{|
|
|
485
|
-
specifier: DependencySpecifier,
|
|
486
|
-
resolveFrom: ProjectPath,
|
|
487
|
-
range?: ?SemverRange,
|
|
488
|
-
|}>,
|
|
489
|
-
|};
|
|
490
|
-
|
|
491
|
-
export type Config = {|
|
|
492
|
-
id: string,
|
|
493
|
-
isSource: boolean,
|
|
494
|
-
searchPath: ProjectPath,
|
|
495
|
-
env: Environment,
|
|
496
|
-
cacheKey: ?string,
|
|
497
|
-
result: ConfigResult,
|
|
498
|
-
invalidateOnFileChange: Set<ProjectPath>,
|
|
499
|
-
invalidateOnConfigKeyChange: Array<{|
|
|
500
|
-
filePath: ProjectPath,
|
|
501
|
-
configKey: string,
|
|
502
|
-
|}>,
|
|
503
|
-
invalidateOnFileCreate: Array<InternalFileCreateInvalidation>,
|
|
504
|
-
invalidateOnEnvChange: Set<string>,
|
|
505
|
-
invalidateOnOptionChange: Set<string>,
|
|
506
|
-
devDeps: Array<InternalDevDepOptions>,
|
|
507
|
-
invalidateOnStartup: boolean,
|
|
508
|
-
invalidateOnBuild: boolean,
|
|
509
|
-
|};
|
|
510
|
-
|
|
511
|
-
export type EntryRequest = {|
|
|
512
|
-
specifier: DependencySpecifier,
|
|
513
|
-
result?: ProjectPath,
|
|
514
|
-
|};
|
|
515
|
-
|
|
516
|
-
export type EntryRequestNode = {|
|
|
517
|
-
id: ContentKey,
|
|
518
|
-
+type: 'entry_request',
|
|
519
|
-
value: string,
|
|
520
|
-
|};
|
|
521
|
-
|
|
522
|
-
export type TargetRequestNode = {|
|
|
523
|
-
id: ContentKey,
|
|
524
|
-
+type: 'target_request',
|
|
525
|
-
value: ProjectPath,
|
|
526
|
-
|};
|
|
527
|
-
|
|
528
|
-
export type CacheEntry = {|
|
|
529
|
-
filePath: ProjectPath,
|
|
530
|
-
env: Environment,
|
|
531
|
-
hash: string,
|
|
532
|
-
assets: Array<Asset>,
|
|
533
|
-
// Initial assets, pre-post processing
|
|
534
|
-
initialAssets: ?Array<Asset>,
|
|
535
|
-
|};
|
|
536
|
-
|
|
537
|
-
export type Bundle = {|
|
|
538
|
-
id: ContentKey,
|
|
539
|
-
publicId: ?string,
|
|
540
|
-
hashReference: string,
|
|
541
|
-
type: string,
|
|
542
|
-
env: Environment,
|
|
543
|
-
entryAssetIds: Array<ContentKey>,
|
|
544
|
-
mainEntryId: ?ContentKey,
|
|
545
|
-
needsStableName: ?boolean,
|
|
546
|
-
bundleBehavior: ?$Values<typeof BundleBehavior>,
|
|
547
|
-
isSplittable: ?boolean,
|
|
548
|
-
isPlaceholder?: boolean,
|
|
549
|
-
target: Target,
|
|
550
|
-
name: ?string,
|
|
551
|
-
displayName: ?string,
|
|
552
|
-
pipeline: ?string,
|
|
553
|
-
manualSharedBundle?: ?string,
|
|
554
|
-
conditions?: Map<string, string>,
|
|
555
|
-
|};
|
|
556
|
-
|
|
557
|
-
export type BundleNode = {|
|
|
558
|
-
id: ContentKey,
|
|
559
|
-
+type: 'bundle',
|
|
560
|
-
value: Bundle,
|
|
561
|
-
|};
|
|
562
|
-
|
|
563
|
-
export type BundleGroup = {|
|
|
564
|
-
target: Target,
|
|
565
|
-
entryAssetId: string,
|
|
566
|
-
|};
|
|
567
|
-
|
|
568
|
-
export type BundleGroupNode = {|
|
|
569
|
-
id: ContentKey,
|
|
570
|
-
+type: 'bundle_group',
|
|
571
|
-
value: BundleGroup,
|
|
572
|
-
|};
|
|
573
|
-
|
|
574
|
-
export type PackagedBundleInfo = {|
|
|
575
|
-
filePath: ProjectPath,
|
|
576
|
-
type: string,
|
|
577
|
-
stats: Stats,
|
|
578
|
-
|};
|
|
579
|
-
|
|
580
|
-
export type TransformationOpts = {|
|
|
581
|
-
request: AssetGroup,
|
|
582
|
-
optionsRef: SharedReference,
|
|
583
|
-
configCachePath: string,
|
|
584
|
-
|};
|
|
585
|
-
|
|
586
|
-
export type ValidationOpts = {|
|
|
587
|
-
requests: AssetGroup[],
|
|
588
|
-
optionsRef: SharedReference,
|
|
589
|
-
configCachePath: string,
|
|
590
|
-
|};
|
|
591
|
-
|
|
592
|
-
export type ReportFn = (event: ReporterEvent) => void | Promise<void>;
|
|
593
|
-
|
|
594
|
-
export type Condition = {|
|
|
595
|
-
publicId: string,
|
|
596
|
-
assets: Set<Asset>,
|
|
597
|
-
key: string,
|
|
598
|
-
ifTrueDependency: Dependency,
|
|
599
|
-
ifFalseDependency: Dependency,
|
|
600
|
-
|};
|
package/test/Environment.test.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
// @flow strict-local
|
|
2
|
-
|
|
3
|
-
import assert from 'assert';
|
|
4
|
-
// $FlowFixMe
|
|
5
|
-
import expect from 'expect';
|
|
6
|
-
import {createEnvironment} from '../src/Environment';
|
|
7
|
-
import {initializeMonitoring} from '../../rust';
|
|
8
|
-
|
|
9
|
-
describe('Environment', () => {
|
|
10
|
-
it('assigns a default environment with nothing passed', () => {
|
|
11
|
-
assert.deepEqual(createEnvironment(), {
|
|
12
|
-
id: 'd821e85f6b50315e',
|
|
13
|
-
context: 'browser',
|
|
14
|
-
engines: {
|
|
15
|
-
browsers: ['> 0.25%'],
|
|
16
|
-
},
|
|
17
|
-
includeNodeModules: true,
|
|
18
|
-
outputFormat: 'global',
|
|
19
|
-
isLibrary: false,
|
|
20
|
-
shouldOptimize: false,
|
|
21
|
-
shouldScopeHoist: false,
|
|
22
|
-
sourceMap: undefined,
|
|
23
|
-
loc: undefined,
|
|
24
|
-
sourceType: 'module',
|
|
25
|
-
unstableSingleFileOutput: false,
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it('assigns a node context if a node engine is given', () => {
|
|
30
|
-
assert.deepEqual(createEnvironment({engines: {node: '>= 10.0.0'}}), {
|
|
31
|
-
id: '2320af923a717577',
|
|
32
|
-
context: 'node',
|
|
33
|
-
engines: {
|
|
34
|
-
node: '>= 10.0.0',
|
|
35
|
-
},
|
|
36
|
-
includeNodeModules: false,
|
|
37
|
-
outputFormat: 'commonjs',
|
|
38
|
-
isLibrary: false,
|
|
39
|
-
shouldOptimize: false,
|
|
40
|
-
shouldScopeHoist: false,
|
|
41
|
-
sourceMap: undefined,
|
|
42
|
-
loc: undefined,
|
|
43
|
-
sourceType: 'module',
|
|
44
|
-
unstableSingleFileOutput: false,
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it('assigns a browser context if browser engines are given', () => {
|
|
49
|
-
assert.deepEqual(
|
|
50
|
-
createEnvironment({engines: {browsers: ['last 1 version']}}),
|
|
51
|
-
{
|
|
52
|
-
id: '75603271034eff15',
|
|
53
|
-
context: 'browser',
|
|
54
|
-
engines: {
|
|
55
|
-
browsers: ['last 1 version'],
|
|
56
|
-
},
|
|
57
|
-
includeNodeModules: true,
|
|
58
|
-
outputFormat: 'global',
|
|
59
|
-
isLibrary: false,
|
|
60
|
-
shouldOptimize: false,
|
|
61
|
-
shouldScopeHoist: false,
|
|
62
|
-
sourceMap: undefined,
|
|
63
|
-
loc: undefined,
|
|
64
|
-
sourceType: 'module',
|
|
65
|
-
unstableSingleFileOutput: false,
|
|
66
|
-
},
|
|
67
|
-
);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it('assigns default engines for node', () => {
|
|
71
|
-
assert.deepEqual(createEnvironment({context: 'node'}), {
|
|
72
|
-
id: 'e45cc12216f7857d',
|
|
73
|
-
context: 'node',
|
|
74
|
-
engines: {
|
|
75
|
-
node: '>= 8.0.0',
|
|
76
|
-
},
|
|
77
|
-
includeNodeModules: false,
|
|
78
|
-
outputFormat: 'commonjs',
|
|
79
|
-
isLibrary: false,
|
|
80
|
-
shouldOptimize: false,
|
|
81
|
-
shouldScopeHoist: false,
|
|
82
|
-
sourceMap: undefined,
|
|
83
|
-
loc: undefined,
|
|
84
|
-
sourceType: 'module',
|
|
85
|
-
unstableSingleFileOutput: false,
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
it('assigns default engines for browsers', () => {
|
|
90
|
-
assert.deepEqual(createEnvironment({context: 'browser'}), {
|
|
91
|
-
id: 'd821e85f6b50315e',
|
|
92
|
-
context: 'browser',
|
|
93
|
-
engines: {
|
|
94
|
-
browsers: ['> 0.25%'],
|
|
95
|
-
},
|
|
96
|
-
includeNodeModules: true,
|
|
97
|
-
outputFormat: 'global',
|
|
98
|
-
isLibrary: false,
|
|
99
|
-
shouldOptimize: false,
|
|
100
|
-
shouldScopeHoist: false,
|
|
101
|
-
sourceMap: undefined,
|
|
102
|
-
loc: undefined,
|
|
103
|
-
sourceType: 'module',
|
|
104
|
-
unstableSingleFileOutput: false,
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
describe('createEnvironment', function () {
|
|
110
|
-
it('returns a stable hash', () => {
|
|
111
|
-
try {
|
|
112
|
-
initializeMonitoring();
|
|
113
|
-
} catch (_err) {
|
|
114
|
-
/* ignore */
|
|
115
|
-
}
|
|
116
|
-
const environment = createEnvironment({});
|
|
117
|
-
expect(environment.id).toEqual('d821e85f6b50315e');
|
|
118
|
-
});
|
|
119
|
-
});
|