@atlaspack/core 2.19.3-typescript-b27501580.0 → 2.19.3-typescript-5b4d3ad41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AssetGraph.d.ts +80 -0
- package/lib/Atlaspack.d.ts +52 -0
- package/lib/AtlaspackConfig.d.ts +65 -0
- package/lib/AtlaspackConfig.schema.d.ts +46 -0
- package/lib/BundleGraph.d.ts +181 -0
- package/lib/CommittedAsset.d.ts +23 -0
- package/lib/Dependency.d.ts +44 -0
- package/lib/Environment.d.ts +10 -0
- package/lib/EnvironmentManager.d.ts +37 -0
- package/lib/IdentifierRegistry.d.ts +6 -0
- package/lib/InternalConfig.d.ts +24 -0
- package/lib/PackagerRunner.d.ts +80 -0
- package/lib/ReporterRunner.d.ts +25 -0
- package/lib/RequestTracker.d.ts +385 -0
- package/lib/SymbolPropagation.d.ts +11 -0
- package/lib/TargetDescriptor.schema.d.ts +5 -0
- package/lib/Transformation.d.ts +72 -0
- package/lib/UncommittedAsset.d.ts +61 -0
- package/lib/Validation.d.ts +37 -0
- package/lib/applyRuntimes.d.ts +25 -0
- package/lib/assetUtils.d.ts +42 -0
- package/lib/atlaspack-v3/AtlaspackV3.d.ts +26 -0
- package/lib/atlaspack-v3/NapiWorkerPool.d.ts +12 -0
- package/lib/atlaspack-v3/fs.d.ts +12 -0
- package/lib/atlaspack-v3/index.d.ts +5 -0
- package/lib/atlaspack-v3/jsCallable.d.ts +1 -0
- package/lib/atlaspack-v3/worker/compat/asset-symbols.d.ts +51 -0
- package/lib/atlaspack-v3/worker/compat/bitflags.d.ts +15 -0
- package/lib/atlaspack-v3/worker/compat/dependency.d.ts +25 -0
- package/lib/atlaspack-v3/worker/compat/environment.d.ts +25 -0
- package/lib/atlaspack-v3/worker/compat/index.d.ts +9 -0
- package/lib/atlaspack-v3/worker/compat/mutable-asset.d.ts +49 -0
- package/lib/atlaspack-v3/worker/compat/plugin-config.d.ts +37 -0
- package/lib/atlaspack-v3/worker/compat/plugin-logger.d.ts +9 -0
- package/lib/atlaspack-v3/worker/compat/plugin-options.d.ts +22 -0
- package/lib/atlaspack-v3/worker/compat/plugin-tracer.d.ts +5 -0
- package/lib/atlaspack-v3/worker/compat/target.d.ts +11 -0
- package/lib/atlaspack-v3/worker/worker.d.ts +58 -0
- package/lib/constants.d.ts +13 -0
- package/lib/dumpGraphToGraphViz.d.ts +10 -0
- package/lib/index.d.ts +8 -0
- package/lib/loadAtlaspackPlugin.d.ts +8 -0
- package/lib/loadDotEnv.d.ts +3 -0
- package/lib/projectPath.d.ts +19 -0
- package/lib/public/Asset.d.ts +74 -0
- package/lib/public/Bundle.d.ts +45 -0
- package/lib/public/BundleGraph.d.ts +70 -0
- package/lib/public/BundleGroup.d.ts +12 -0
- package/lib/public/Config.d.ts +75 -0
- package/lib/public/Dependency.d.ts +32 -0
- package/lib/public/Environment.d.ts +32 -0
- package/lib/public/MutableBundleGraph.d.ts +26 -0
- package/lib/public/PluginOptions.d.ts +25 -0
- package/lib/public/Symbols.d.ts +81 -0
- package/lib/public/Target.d.ts +16 -0
- package/lib/registerCoreWithSerializer.d.ts +2 -0
- package/lib/requests/AssetGraphRequest.d.ts +74 -0
- package/lib/requests/AssetGraphRequestRust.d.ts +21 -0
- package/lib/requests/AssetRequest.d.ts +16 -0
- package/lib/requests/AtlaspackBuildRequest.d.ts +29 -0
- package/lib/requests/AtlaspackConfigRequest.d.ts +45 -0
- package/lib/requests/BundleGraphRequest.d.ts +28 -0
- package/lib/requests/ConfigRequest.d.ts +59 -0
- package/lib/requests/DevDepRequest.d.ts +30 -0
- package/lib/requests/EntryRequest.d.ts +36 -0
- package/lib/requests/PackageRequest.d.ts +27 -0
- package/lib/requests/PathRequest.d.ts +48 -0
- package/lib/requests/TargetRequest.d.ts +48 -0
- package/lib/requests/ValidationRequest.d.ts +20 -0
- package/lib/requests/WriteBundleRequest.d.ts +28 -0
- package/lib/requests/WriteBundlesRequest.d.ts +26 -0
- package/lib/requests/asset-graph-dot.d.ts +9 -0
- package/lib/resolveOptions.d.ts +3 -0
- package/lib/rustWorkerThreadDylibHack.d.ts +9 -0
- package/lib/serializerCore.browser.d.ts +3 -0
- package/lib/summarizeRequest.d.ts +10 -0
- package/lib/types.d.ts +490 -0
- package/lib/utils.d.ts +23 -0
- package/lib/worker.d.ts +44 -0
- package/package.json +18 -18
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { GraphVisitor } from '@atlaspack/types';
|
|
2
|
+
import type { ContentGraphOpts, ContentKey, NodeId, SerializedContentGraph } from '@atlaspack/graph';
|
|
3
|
+
import type { Asset, AssetGraphNode, AssetGroup, AssetGroupNode, AssetNode, Dependency, DependencyNode, Entry, EntryFileNode, EntrySpecifierNode, Environment, Target } from './types';
|
|
4
|
+
import { ContentGraph } from '@atlaspack/graph';
|
|
5
|
+
import { ProjectPath } from './projectPath';
|
|
6
|
+
type InitOpts = {
|
|
7
|
+
entries?: Array<ProjectPath>;
|
|
8
|
+
targets?: Array<Target>;
|
|
9
|
+
assetGroups?: Array<AssetGroup>;
|
|
10
|
+
};
|
|
11
|
+
type AssetGraphOpts = ContentGraphOpts<AssetGraphNode> & {
|
|
12
|
+
bundlingVersion?: number;
|
|
13
|
+
disableIncrementalBundling?: boolean;
|
|
14
|
+
hash?: string | null | undefined;
|
|
15
|
+
};
|
|
16
|
+
type SerializedAssetGraph = SerializedContentGraph<AssetGraphNode> & {
|
|
17
|
+
bundlingVersion: number;
|
|
18
|
+
disableIncrementalBundling: boolean;
|
|
19
|
+
hash?: string | null | undefined;
|
|
20
|
+
};
|
|
21
|
+
export declare function nodeFromDep(dep: Dependency): DependencyNode;
|
|
22
|
+
export declare function nodeFromAssetGroup(assetGroup: AssetGroup): AssetGroupNode;
|
|
23
|
+
export declare function nodeFromAsset(asset: Asset): AssetNode;
|
|
24
|
+
export declare function nodeFromEntrySpecifier(entry: ProjectPath): EntrySpecifierNode;
|
|
25
|
+
export declare function nodeFromEntryFile(entry: Entry): EntryFileNode;
|
|
26
|
+
export default class AssetGraph extends ContentGraph<AssetGraphNode> {
|
|
27
|
+
#private;
|
|
28
|
+
onNodeRemoved: ((nodeId: NodeId) => unknown) | null | undefined;
|
|
29
|
+
hash: string | null | undefined;
|
|
30
|
+
envCache: Map<string, Environment>;
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated
|
|
33
|
+
*/
|
|
34
|
+
safeToIncrementallyBundle: boolean;
|
|
35
|
+
undeferredDependencies: Set<Dependency>;
|
|
36
|
+
constructor(opts?: AssetGraphOpts | null);
|
|
37
|
+
static deserialize(opts: AssetGraphOpts): AssetGraph;
|
|
38
|
+
serialize(): SerializedAssetGraph;
|
|
39
|
+
/**
|
|
40
|
+
* Force incremental bundling to be disabled.
|
|
41
|
+
*/
|
|
42
|
+
setDisableIncrementalBundling(disable: boolean): void;
|
|
43
|
+
testing_getDisableIncrementalBundling(): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Make sure this asset graph is marked as needing a full bundling pass.
|
|
46
|
+
*/
|
|
47
|
+
setNeedsBundling(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Get the current bundling version.
|
|
50
|
+
*
|
|
51
|
+
* Each bundle pass should keep this version around. Whenever an asset graph has a new version,
|
|
52
|
+
* bundling should be re-run.
|
|
53
|
+
*/
|
|
54
|
+
getBundlingVersion(): number;
|
|
55
|
+
/**
|
|
56
|
+
* If the `bundlingVersion` has not changed since the last bundling pass,
|
|
57
|
+
* we can incrementally bundle, which will not require a full bundling pass
|
|
58
|
+
* but just update assets into the bundle graph output.
|
|
59
|
+
*/
|
|
60
|
+
canIncrementallyBundle(lastVersion: number): boolean;
|
|
61
|
+
normalizeEnvironment(input: Asset | Dependency | AssetGroup): void;
|
|
62
|
+
setRootConnections({ entries, assetGroups }: InitOpts): void;
|
|
63
|
+
addNode(node: AssetGraphNode): NodeId;
|
|
64
|
+
removeNode(nodeId: NodeId): void;
|
|
65
|
+
resolveEntry(entry: ProjectPath, resolved: Array<Entry>, correspondingRequest: ContentKey): void;
|
|
66
|
+
resolveTargets(entry: Entry, targets: Array<Target>, correspondingRequest: string): void;
|
|
67
|
+
resolveDependency(dependency: Dependency, assetGroup: AssetGroup | null | undefined, correspondingRequest: string): void;
|
|
68
|
+
shouldVisitChild(nodeId: NodeId, childNodeId: NodeId): boolean;
|
|
69
|
+
markParentsWithHasDeferred(nodeId: NodeId): void;
|
|
70
|
+
unmarkParentsWithHasDeferred(nodeId: NodeId): void;
|
|
71
|
+
shouldDeferDependency(dependency: Dependency, sideEffects: boolean | null | undefined, canDefer: boolean): boolean;
|
|
72
|
+
resolveAssetGroup(assetGroup: AssetGroup, assets: Array<Asset>, correspondingRequest: ContentKey): void;
|
|
73
|
+
resolveAsset(assetNode: AssetNode, dependentAssets: Array<Asset>): void;
|
|
74
|
+
getIncomingDependencies(asset: Asset): Array<Dependency>;
|
|
75
|
+
traverseAssets<TContext>(visit: GraphVisitor<Asset, TContext>, startNodeId?: NodeId | null): TContext | null | undefined;
|
|
76
|
+
getEntryAssetGroupNodes(): Array<AssetGroupNode>;
|
|
77
|
+
getEntryAssets(): Array<Asset>;
|
|
78
|
+
getHash(): string;
|
|
79
|
+
}
|
|
80
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Asset, AsyncSubscription, BuildEvent, BuildSuccessEvent, InitialAtlaspackOptions, AtlaspackTransformOptions, AtlaspackResolveOptions, AtlaspackResolveResult } from '@atlaspack/types';
|
|
2
|
+
import type { AtlaspackOptions } from './types';
|
|
3
|
+
import type { FarmOptions } from '@atlaspack/workers';
|
|
4
|
+
import type { Diagnostic } from '@atlaspack/diagnostic';
|
|
5
|
+
import ThrowableDiagnostic from '@atlaspack/diagnostic';
|
|
6
|
+
import WorkerFarm from '@atlaspack/workers';
|
|
7
|
+
import { AtlaspackV3 } from './atlaspack-v3';
|
|
8
|
+
import type { AssetGraphRequestResult } from './requests/AssetGraphRequest';
|
|
9
|
+
export declare const INTERNAL_TRANSFORM: symbol;
|
|
10
|
+
export declare const INTERNAL_RESOLVE: symbol;
|
|
11
|
+
export declare let WORKER_PATH: string;
|
|
12
|
+
export default class Atlaspack {
|
|
13
|
+
#private;
|
|
14
|
+
rustAtlaspack: AtlaspackV3 | null | undefined;
|
|
15
|
+
isProfiling: boolean;
|
|
16
|
+
constructor(options: InitialAtlaspackOptions);
|
|
17
|
+
_init(): Promise<void>;
|
|
18
|
+
run(): Promise<BuildSuccessEvent>;
|
|
19
|
+
_end(): Promise<void>;
|
|
20
|
+
writeRequestTrackerToCache(): Promise<void>;
|
|
21
|
+
_startNextBuild(): Promise<BuildEvent | null | undefined>;
|
|
22
|
+
watch(cb?: (err?: Error | null | undefined, buildEvent?: BuildEvent) => unknown): Promise<AsyncSubscription>;
|
|
23
|
+
_build({ signal, startTime, }?: {
|
|
24
|
+
signal?: AbortSignal;
|
|
25
|
+
startTime?: number;
|
|
26
|
+
}): Promise<BuildEvent>;
|
|
27
|
+
_getWatcherSubscription(): Promise<AsyncSubscription>;
|
|
28
|
+
_getResolvedAtlaspackOptions(): AtlaspackOptions;
|
|
29
|
+
startProfiling(): Promise<void>;
|
|
30
|
+
stopProfiling(): Promise<void>;
|
|
31
|
+
takeHeapSnapshot(): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Must be called between builds otherwise there is global state that will
|
|
34
|
+
* break things unexpectedly.
|
|
35
|
+
*/
|
|
36
|
+
clearBuildCaches(): Promise<void>;
|
|
37
|
+
unstable_invalidate(): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Build the asset graph
|
|
40
|
+
*/
|
|
41
|
+
unstable_buildAssetGraph(writeToCache?: boolean): Promise<AssetGraphRequestResult>;
|
|
42
|
+
/**
|
|
43
|
+
* Copy the cache to a new directory and compact it.
|
|
44
|
+
*/
|
|
45
|
+
unstable_compactCache(): Promise<void>;
|
|
46
|
+
unstable_transform(options: AtlaspackTransformOptions): Promise<Array<Asset>>;
|
|
47
|
+
unstable_resolve(request: AtlaspackResolveOptions): Promise<AtlaspackResolveResult | null | undefined>;
|
|
48
|
+
}
|
|
49
|
+
export declare class BuildError extends ThrowableDiagnostic {
|
|
50
|
+
constructor(diagnostic: Array<Diagnostic> | Diagnostic);
|
|
51
|
+
}
|
|
52
|
+
export declare function createWorkerFarm(options?: Partial<FarmOptions>): WorkerFarm;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Glob, Transformer, Resolver, Bundler, Namer, Runtime, PackageName, Optimizer, Compressor, Packager, Reporter, Semver, Validator, FilePath } from '@atlaspack/types';
|
|
2
|
+
import type { ProcessedAtlaspackConfig, AtlaspackPluginNode, PureAtlaspackConfigPipeline, ExtendableAtlaspackConfigPipeline, AtlaspackOptions } from './types';
|
|
3
|
+
import ThrowableDiagnostic from '@atlaspack/diagnostic';
|
|
4
|
+
import { ProjectPath } from './projectPath';
|
|
5
|
+
type GlobMap<T> = Partial<Record<Glob, T>>;
|
|
6
|
+
type SerializedAtlaspackConfig = {
|
|
7
|
+
$$raw: boolean;
|
|
8
|
+
config: ProcessedAtlaspackConfig;
|
|
9
|
+
options: AtlaspackOptions;
|
|
10
|
+
};
|
|
11
|
+
export type LoadedPlugin<T> = {
|
|
12
|
+
name: string;
|
|
13
|
+
version: Semver;
|
|
14
|
+
plugin: T;
|
|
15
|
+
resolveFrom: ProjectPath;
|
|
16
|
+
keyPath?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare class AtlaspackConfig {
|
|
19
|
+
options: AtlaspackOptions;
|
|
20
|
+
filePath: ProjectPath;
|
|
21
|
+
resolvers: PureAtlaspackConfigPipeline;
|
|
22
|
+
transformers: GlobMap<ExtendableAtlaspackConfigPipeline>;
|
|
23
|
+
bundler: AtlaspackPluginNode | null | undefined;
|
|
24
|
+
namers: PureAtlaspackConfigPipeline;
|
|
25
|
+
runtimes: PureAtlaspackConfigPipeline;
|
|
26
|
+
packagers: GlobMap<AtlaspackPluginNode>;
|
|
27
|
+
validators: GlobMap<ExtendableAtlaspackConfigPipeline>;
|
|
28
|
+
optimizers: GlobMap<ExtendableAtlaspackConfigPipeline>;
|
|
29
|
+
compressors: GlobMap<ExtendableAtlaspackConfigPipeline>;
|
|
30
|
+
reporters: PureAtlaspackConfigPipeline;
|
|
31
|
+
pluginCache: Map<PackageName, any>;
|
|
32
|
+
regexCache: Map<string, RegExp>;
|
|
33
|
+
constructor(config: ProcessedAtlaspackConfig, options: AtlaspackOptions);
|
|
34
|
+
static deserialize(serialized: SerializedAtlaspackConfig): AtlaspackConfig;
|
|
35
|
+
getConfig(): ProcessedAtlaspackConfig;
|
|
36
|
+
serialize(): SerializedAtlaspackConfig;
|
|
37
|
+
_loadPlugin<T>(node: AtlaspackPluginNode): Promise<{
|
|
38
|
+
plugin: T;
|
|
39
|
+
version: Semver;
|
|
40
|
+
resolveFrom: ProjectPath;
|
|
41
|
+
}>;
|
|
42
|
+
loadPlugin<T>(node: AtlaspackPluginNode): Promise<LoadedPlugin<T>>;
|
|
43
|
+
invalidatePlugin(packageName: PackageName): void;
|
|
44
|
+
loadPlugins<T>(plugins: PureAtlaspackConfigPipeline): Promise<Array<LoadedPlugin<T>>>;
|
|
45
|
+
getResolvers(): Promise<Array<LoadedPlugin<Resolver<unknown>>>>;
|
|
46
|
+
_getValidatorNodes(filePath: ProjectPath): ReadonlyArray<AtlaspackPluginNode>;
|
|
47
|
+
getValidatorNames(filePath: ProjectPath): Array<string>;
|
|
48
|
+
getValidators(filePath: ProjectPath): Promise<Array<LoadedPlugin<Validator>>>;
|
|
49
|
+
getNamedPipelines(): ReadonlyArray<string>;
|
|
50
|
+
getTransformers(filePath: ProjectPath, pipeline?: string | null, allowEmpty?: boolean): Promise<Array<LoadedPlugin<Transformer<unknown>>>>;
|
|
51
|
+
getBundler(): Promise<LoadedPlugin<Bundler<unknown>>>;
|
|
52
|
+
getNamers(): Promise<Array<LoadedPlugin<Namer<unknown>>>>;
|
|
53
|
+
getRuntimes(): Promise<Array<LoadedPlugin<Runtime<unknown>>>>;
|
|
54
|
+
getPackager(filePath: FilePath): Promise<LoadedPlugin<Packager<unknown, unknown>>>;
|
|
55
|
+
_getOptimizerNodes(filePath: FilePath, pipeline?: string | null): PureAtlaspackConfigPipeline;
|
|
56
|
+
getOptimizerNames(filePath: FilePath, pipeline?: string | null): Array<string>;
|
|
57
|
+
getOptimizers(filePath: FilePath, pipeline?: string | null): Promise<Array<LoadedPlugin<Optimizer<unknown, unknown>>>>;
|
|
58
|
+
getCompressors(filePath: FilePath): Promise<Array<LoadedPlugin<Compressor>>>;
|
|
59
|
+
getReporters(): Promise<Array<LoadedPlugin<Reporter>>>;
|
|
60
|
+
isGlobMatch(projectPath: ProjectPath, pattern: Glob, pipeline?: string | null): boolean;
|
|
61
|
+
matchGlobMap<T>(filePath: ProjectPath, globMap: Partial<Record<Glob, T>>): T | null | undefined;
|
|
62
|
+
matchGlobMapPipelines(filePath: ProjectPath, globMap: Partial<Record<Glob, ExtendableAtlaspackConfigPipeline>>, pipeline?: string | null): PureAtlaspackConfigPipeline;
|
|
63
|
+
missingPluginError(plugins: GlobMap<ExtendableAtlaspackConfigPipeline> | GlobMap<AtlaspackPluginNode> | PureAtlaspackConfigPipeline, message: string, key: string): Promise<ThrowableDiagnostic>;
|
|
64
|
+
}
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { PackageName } from '@atlaspack/types';
|
|
2
|
+
import type { SchemaEntity } from '@atlaspack/utils';
|
|
3
|
+
export declare function validatePackageName(pkg: PackageName | null | undefined, pluginType: string, key: string): void;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
type: string;
|
|
6
|
+
properties: {
|
|
7
|
+
$schema: {
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
extends: {
|
|
11
|
+
oneOf: ({
|
|
12
|
+
type: string;
|
|
13
|
+
__validate: (val: string) => void;
|
|
14
|
+
items?: undefined;
|
|
15
|
+
} | {
|
|
16
|
+
type: string;
|
|
17
|
+
items: {
|
|
18
|
+
type: string;
|
|
19
|
+
__validate: (val: string) => void;
|
|
20
|
+
};
|
|
21
|
+
__validate?: undefined;
|
|
22
|
+
})[];
|
|
23
|
+
};
|
|
24
|
+
bundler: {
|
|
25
|
+
type: string;
|
|
26
|
+
__validate: (arg1: string) => void;
|
|
27
|
+
};
|
|
28
|
+
resolvers: SchemaEntity;
|
|
29
|
+
transformers: SchemaEntity;
|
|
30
|
+
validators: SchemaEntity;
|
|
31
|
+
namers: SchemaEntity;
|
|
32
|
+
packagers: SchemaEntity;
|
|
33
|
+
optimizers: SchemaEntity;
|
|
34
|
+
compressors: SchemaEntity;
|
|
35
|
+
reporters: SchemaEntity;
|
|
36
|
+
runtimes: SchemaEntity;
|
|
37
|
+
filePath: {
|
|
38
|
+
type: string;
|
|
39
|
+
};
|
|
40
|
+
resolveFrom: {
|
|
41
|
+
type: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
additionalProperties: boolean;
|
|
45
|
+
};
|
|
46
|
+
export default _default;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import type { GraphVisitor, FilePath, TraversalActions, BundleBehavior as IBundleBehavior } from '@atlaspack/types';
|
|
2
|
+
import type { ContentGraphOpts, NodeId, SerializedContentGraph } from '@atlaspack/graph';
|
|
3
|
+
import type { Asset, AssetNode, Bundle, BundleGraphNode, BundleGroup, Dependency, DependencyNode, InternalSourceLocation, Target, Condition } from './types';
|
|
4
|
+
import type AssetGraph from './AssetGraph';
|
|
5
|
+
import type { ProjectPath } from './projectPath';
|
|
6
|
+
import { ContentGraph } from '@atlaspack/graph';
|
|
7
|
+
import type { EnvironmentRef } from './EnvironmentManager';
|
|
8
|
+
export declare const bundleGraphEdgeTypes: {
|
|
9
|
+
readonly null: 1;
|
|
10
|
+
readonly contains: 2;
|
|
11
|
+
readonly bundle: 3;
|
|
12
|
+
readonly references: 4;
|
|
13
|
+
readonly internal_async: 5;
|
|
14
|
+
readonly conditional: 5;
|
|
15
|
+
};
|
|
16
|
+
export type BundleGraphEdgeType = (typeof bundleGraphEdgeTypes)[keyof typeof bundleGraphEdgeTypes];
|
|
17
|
+
type InternalSymbolResolution = {
|
|
18
|
+
asset: Asset;
|
|
19
|
+
exportSymbol: string;
|
|
20
|
+
symbol: symbol | null | undefined | false;
|
|
21
|
+
loc: InternalSourceLocation | null | undefined;
|
|
22
|
+
};
|
|
23
|
+
type InternalExportSymbolResolution = InternalSymbolResolution & {
|
|
24
|
+
readonly exportAs: symbol | string;
|
|
25
|
+
};
|
|
26
|
+
type BundleGraphOpts = {
|
|
27
|
+
graph: ContentGraphOpts<BundleGraphNode, BundleGraphEdgeType>;
|
|
28
|
+
bundleContentHashes: Map<string, string>;
|
|
29
|
+
assetPublicIds: Set<string>;
|
|
30
|
+
publicIdByAssetId: Map<string, string>;
|
|
31
|
+
conditions: Map<string, Condition>;
|
|
32
|
+
};
|
|
33
|
+
type SerializedBundleGraph = {
|
|
34
|
+
$$raw: true;
|
|
35
|
+
graph: SerializedContentGraph<BundleGraphNode, BundleGraphEdgeType>;
|
|
36
|
+
bundleContentHashes: Map<string, string>;
|
|
37
|
+
assetPublicIds: Set<string>;
|
|
38
|
+
publicIdByAssetId: Map<string, string>;
|
|
39
|
+
conditions: Map<string, Condition>;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Stores assets, dependencies, bundle groups, bundles, and the relationships between them.
|
|
43
|
+
* The BundleGraph is passed to the bundler plugin wrapped in a MutableBundleGraph,
|
|
44
|
+
* and is passed to packagers and optimizers wrapped in the public BundleGraph object, both
|
|
45
|
+
* of which implement public api for this structure. This is the internal structure.
|
|
46
|
+
*/
|
|
47
|
+
export default class BundleGraph {
|
|
48
|
+
/** A set of all existing concise asset ids present in the BundleGraph */
|
|
49
|
+
_assetPublicIds: Set<string>;
|
|
50
|
+
/** Maps full asset ids (currently 32-character strings) to concise ids (minimum of 5 character strings) */
|
|
51
|
+
_publicIdByAssetId: Map<string, string>;
|
|
52
|
+
/**
|
|
53
|
+
* A cache of bundle hashes by bundle id.
|
|
54
|
+
*
|
|
55
|
+
* TODO: These hashes are being invalidated in mutative methods, but this._graph is not a private
|
|
56
|
+
* property so it is possible to reach in and mutate the graph without invalidating these hashes.
|
|
57
|
+
* It needs to be exposed in BundlerRunner for now based on how applying runtimes works and the
|
|
58
|
+
* BundlerRunner takes care of invalidating hashes when runtimes are applied, but this is not ideal.
|
|
59
|
+
*/
|
|
60
|
+
_bundleContentHashes: Map<string, string>;
|
|
61
|
+
_targetEntryRoots: Map<ProjectPath, FilePath>;
|
|
62
|
+
/** The internal core Graph structure */
|
|
63
|
+
_graph: ContentGraph<BundleGraphNode, BundleGraphEdgeType>;
|
|
64
|
+
_bundlePublicIds: Set<string>;
|
|
65
|
+
_conditions: Map<string, Condition>;
|
|
66
|
+
constructor({ graph, publicIdByAssetId, assetPublicIds, bundleContentHashes, conditions, }: {
|
|
67
|
+
graph: ContentGraph<BundleGraphNode, BundleGraphEdgeType>;
|
|
68
|
+
publicIdByAssetId: Map<string, string>;
|
|
69
|
+
assetPublicIds: Set<string>;
|
|
70
|
+
bundleContentHashes: Map<string, string>;
|
|
71
|
+
conditions: Map<string, Condition>;
|
|
72
|
+
});
|
|
73
|
+
/**
|
|
74
|
+
* Produce a BundleGraph from an AssetGraph by removing asset groups and retargeting dependencies
|
|
75
|
+
* based on the symbol data (resolving side-effect free reexports).
|
|
76
|
+
*/
|
|
77
|
+
static fromAssetGraph(assetGraph: AssetGraph, isProduction: boolean, publicIdByAssetId?: Map<string, string>, assetPublicIds?: Set<string>): BundleGraph;
|
|
78
|
+
serialize(): SerializedBundleGraph;
|
|
79
|
+
static deserialize(serialized: BundleGraphOpts): BundleGraph;
|
|
80
|
+
createBundle(opts: {
|
|
81
|
+
readonly entryAsset: Asset;
|
|
82
|
+
readonly target: Target;
|
|
83
|
+
readonly needsStableName?: boolean | null | undefined;
|
|
84
|
+
readonly bundleBehavior?: IBundleBehavior | null | undefined;
|
|
85
|
+
readonly shouldContentHash: boolean;
|
|
86
|
+
readonly env: EnvironmentRef;
|
|
87
|
+
} | {
|
|
88
|
+
readonly type: string;
|
|
89
|
+
readonly env: EnvironmentRef;
|
|
90
|
+
readonly uniqueKey: string;
|
|
91
|
+
readonly target: Target;
|
|
92
|
+
readonly needsStableName?: boolean | null | undefined;
|
|
93
|
+
readonly bundleBehavior?: IBundleBehavior | null | undefined;
|
|
94
|
+
readonly isSplittable?: boolean | null | undefined;
|
|
95
|
+
readonly pipeline?: string | null | undefined;
|
|
96
|
+
readonly shouldContentHash: boolean;
|
|
97
|
+
}): Bundle;
|
|
98
|
+
addAssetToBundle(asset: Asset, bundle: Bundle): void;
|
|
99
|
+
addAssetGraphToBundle(asset: Asset, bundle: Bundle, shouldSkipDependency?: (arg1: Dependency) => boolean): void;
|
|
100
|
+
markDependencyReferenceable(dependency: Dependency): void;
|
|
101
|
+
addEntryToBundle(asset: Asset, bundle: Bundle, shouldSkipDependency?: (arg1: Dependency) => boolean): void;
|
|
102
|
+
internalizeAsyncDependency(bundle: Bundle, dependency: Dependency): void;
|
|
103
|
+
isDependencySkipped(dependency: Dependency): boolean;
|
|
104
|
+
getParentBundlesOfBundleGroup(bundleGroup: BundleGroup): Array<Bundle>;
|
|
105
|
+
resolveAsyncDependency(dependency: Dependency, bundle?: Bundle | null): {
|
|
106
|
+
type: 'bundle_group';
|
|
107
|
+
value: BundleGroup;
|
|
108
|
+
} | {
|
|
109
|
+
type: 'asset';
|
|
110
|
+
value: Asset;
|
|
111
|
+
} | null | undefined;
|
|
112
|
+
getReferencedBundle(dependency: Dependency, fromBundle: Bundle): Bundle | null | undefined;
|
|
113
|
+
removeAssetGraphFromBundle(asset: Asset, bundle: Bundle): void;
|
|
114
|
+
/**
|
|
115
|
+
* Remove a bundle from the bundle graph. Remove its bundle group if it is
|
|
116
|
+
* the only bundle in the group.
|
|
117
|
+
*/
|
|
118
|
+
removeBundle(bundle: Bundle): Set<BundleGroup>;
|
|
119
|
+
removeBundleGroup(bundleGroup: BundleGroup): void;
|
|
120
|
+
_removeExternalDependency(bundle: Bundle, dependency: Dependency): void;
|
|
121
|
+
createAssetReference(dependency: Dependency, asset: Asset, bundle: Bundle): void;
|
|
122
|
+
createBundleReference(from: Bundle, to: Bundle): void;
|
|
123
|
+
createBundleConditionalReference(from: Bundle, to: Bundle): void;
|
|
124
|
+
getBundlesWithAsset(asset: Asset): Array<Bundle>;
|
|
125
|
+
getBundlesWithDependency(dependency: Dependency): Array<Bundle>;
|
|
126
|
+
getDependencyAssets(dependency: Dependency): Array<Asset>;
|
|
127
|
+
getResolvedAsset(dep: Dependency, bundle?: Bundle | null): Asset | null | undefined;
|
|
128
|
+
getDependencies(asset: Asset): Array<Dependency>;
|
|
129
|
+
traverseAssets<TContext>(bundle: Bundle, visit: GraphVisitor<Asset, TContext>, startAsset?: Asset): TContext | null | undefined;
|
|
130
|
+
isAssetReferenced(bundle: Bundle, asset: Asset): boolean;
|
|
131
|
+
hasParentBundleOfType(bundle: Bundle, type: string): boolean;
|
|
132
|
+
getParentBundles(bundle: Bundle): Array<Bundle>;
|
|
133
|
+
isAssetReachableFromBundle(asset: Asset, bundle: Bundle): boolean;
|
|
134
|
+
/**
|
|
135
|
+
* TODO: Document why this works like this & why visitor order matters
|
|
136
|
+
* on these use-cases.
|
|
137
|
+
*/
|
|
138
|
+
traverseBundle<TContext>(bundle: Bundle, visit: GraphVisitor<AssetNode | DependencyNode, TContext>, startAsset?: Asset): TContext | null | undefined;
|
|
139
|
+
traverse<TContext>(visit: GraphVisitor<AssetNode | DependencyNode, TContext>, start?: Asset): TContext | null | undefined;
|
|
140
|
+
getChildBundles(bundle: Bundle): Array<Bundle>;
|
|
141
|
+
traverseBundles<TContext>(visit: GraphVisitor<Bundle, TContext>, startBundle?: Bundle | null): TContext | null | undefined;
|
|
142
|
+
getBundles(opts?: {
|
|
143
|
+
includeInline: boolean;
|
|
144
|
+
}): Array<Bundle>;
|
|
145
|
+
getTotalSize(asset: Asset): number;
|
|
146
|
+
getReferencingBundles(bundle: Bundle): Array<Bundle>;
|
|
147
|
+
getBundleGroupsContainingBundle(bundle: Bundle): Array<BundleGroup>;
|
|
148
|
+
getDirectParentBundleGroups(bundle: Bundle): Array<BundleGroup>;
|
|
149
|
+
getBundlesInBundleGroup(bundleGroup: BundleGroup, opts?: {
|
|
150
|
+
includeInline: boolean;
|
|
151
|
+
}): Array<Bundle>;
|
|
152
|
+
getReferencedBundles(bundle: Bundle, opts?: {
|
|
153
|
+
recursive?: boolean;
|
|
154
|
+
includeInline?: boolean;
|
|
155
|
+
}): Array<Bundle>;
|
|
156
|
+
getIncomingDependencies(asset: Asset): Array<Dependency>;
|
|
157
|
+
getAssetWithDependency(dep: Dependency): Asset | null | undefined;
|
|
158
|
+
bundleHasAsset(bundle: Bundle, asset: Asset): boolean;
|
|
159
|
+
bundleHasDependency(bundle: Bundle, dependency: Dependency): boolean;
|
|
160
|
+
filteredTraverse<TValue, TContext>(bundleNodeId: NodeId, filter: (arg1: NodeId, arg2: TraversalActions) => TValue | null | undefined, visit: GraphVisitor<TValue, TContext>): TContext | null | undefined;
|
|
161
|
+
getSymbolResolution(asset: Asset, symbol: symbol, boundary?: Bundle | null): InternalSymbolResolution;
|
|
162
|
+
getAssetById(contentKey: string): Asset;
|
|
163
|
+
getAssetPublicId(asset: Asset): string;
|
|
164
|
+
getExportedSymbols(asset: Asset, boundary?: Bundle | null): Array<InternalExportSymbolResolution>;
|
|
165
|
+
getContentHash(bundle: Bundle): string;
|
|
166
|
+
getInlineBundles(bundle: Bundle): Array<Bundle>;
|
|
167
|
+
getHash(bundle: Bundle): string;
|
|
168
|
+
getBundleGraphHash(): string;
|
|
169
|
+
addBundleToBundleGroup(bundle: Bundle, bundleGroup: BundleGroup): void;
|
|
170
|
+
getUsedSymbolsAsset(asset: Asset): ReadonlySet<symbol> | null | undefined;
|
|
171
|
+
getUsedSymbolsDependency(dep: Dependency): ReadonlySet<symbol> | null | undefined;
|
|
172
|
+
merge(other: BundleGraph): void;
|
|
173
|
+
isEntryBundleGroup(bundleGroup: BundleGroup): boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Update the asset in a Bundle Graph and clear the associated Bundle hash.
|
|
176
|
+
*/
|
|
177
|
+
updateAsset(asset: AssetNode): void;
|
|
178
|
+
getEntryRoot(projectRoot: FilePath, target: Target): FilePath;
|
|
179
|
+
getReferencedConditionalBundles(bundle: Bundle): Array<Bundle>;
|
|
180
|
+
}
|
|
181
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Readable } from 'stream';
|
|
2
|
+
import type { AST, Blob } from '@atlaspack/types';
|
|
3
|
+
import SourceMap from '@parcel/source-map';
|
|
4
|
+
import type { Asset, Dependency, AtlaspackOptions } from './types';
|
|
5
|
+
export default class CommittedAsset {
|
|
6
|
+
key: string | null | undefined;
|
|
7
|
+
value: Asset;
|
|
8
|
+
options: AtlaspackOptions;
|
|
9
|
+
content: Promise<Buffer | string> | null | undefined;
|
|
10
|
+
mapBuffer: Promise<Buffer | null | undefined> | null | undefined;
|
|
11
|
+
map: Promise<SourceMap | null | undefined> | null | undefined;
|
|
12
|
+
ast: Promise<AST> | null | undefined;
|
|
13
|
+
code: string | null | undefined;
|
|
14
|
+
constructor(value: Asset, options: AtlaspackOptions);
|
|
15
|
+
getContent(): Blob | Promise<Buffer | string>;
|
|
16
|
+
getCode(): Promise<string>;
|
|
17
|
+
getBuffer(): Promise<Buffer>;
|
|
18
|
+
getStream(): Readable;
|
|
19
|
+
getMapBuffer(): Promise<Buffer | null | undefined>;
|
|
20
|
+
getMap(): Promise<SourceMap | null | undefined>;
|
|
21
|
+
getAST(): Promise<AST | null | undefined>;
|
|
22
|
+
getDependencies(): Array<Dependency>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { FilePath, Meta, DependencySpecifier, SourceLocation, BundleBehavior as IBundleBehavior, SemverRange } from '@atlaspack/types';
|
|
2
|
+
import type { Dependency, Target } from './types';
|
|
3
|
+
import { SpecifierType, Priority } from './types';
|
|
4
|
+
import type { EnvironmentRef } from './EnvironmentManager';
|
|
5
|
+
type DependencyOpts = {
|
|
6
|
+
id?: string;
|
|
7
|
+
sourcePath?: FilePath;
|
|
8
|
+
sourceAssetId?: string;
|
|
9
|
+
specifier: DependencySpecifier;
|
|
10
|
+
specifierType: keyof typeof SpecifierType;
|
|
11
|
+
priority?: keyof typeof Priority;
|
|
12
|
+
needsStableName?: boolean;
|
|
13
|
+
bundleBehavior?: IBundleBehavior | null | undefined;
|
|
14
|
+
isEntry?: boolean;
|
|
15
|
+
isOptional?: boolean;
|
|
16
|
+
loc?: SourceLocation;
|
|
17
|
+
env: EnvironmentRef;
|
|
18
|
+
packageConditions?: Array<string>;
|
|
19
|
+
meta?: Meta;
|
|
20
|
+
resolveFrom?: FilePath;
|
|
21
|
+
range?: SemverRange;
|
|
22
|
+
target?: Target;
|
|
23
|
+
symbols?: Map<symbol, {
|
|
24
|
+
local: symbol;
|
|
25
|
+
loc: SourceLocation | null | undefined;
|
|
26
|
+
isWeak: boolean;
|
|
27
|
+
meta?: Meta | null | undefined;
|
|
28
|
+
}> | null | undefined;
|
|
29
|
+
pipeline?: string | null | undefined;
|
|
30
|
+
};
|
|
31
|
+
export declare function createDependencyId({ sourceAssetId, specifier, env, target, pipeline, specifierType, bundleBehavior, priority, packageConditions, }: {
|
|
32
|
+
sourceAssetId?: string | undefined;
|
|
33
|
+
specifier: DependencySpecifier;
|
|
34
|
+
env: EnvironmentRef;
|
|
35
|
+
target?: Target | undefined;
|
|
36
|
+
pipeline?: string | null | undefined;
|
|
37
|
+
specifierType: keyof typeof SpecifierType;
|
|
38
|
+
bundleBehavior?: IBundleBehavior | null | undefined;
|
|
39
|
+
priority?: keyof typeof Priority | undefined;
|
|
40
|
+
packageConditions?: Array<string> | undefined;
|
|
41
|
+
}): string;
|
|
42
|
+
export declare function createDependency(projectRoot: FilePath, opts: DependencyOpts): Dependency;
|
|
43
|
+
export declare function mergeDependencies(a: Dependency, b: Dependency): void;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EnvironmentOptions, Environment as IEnvironment, FilePath } from '@atlaspack/types';
|
|
2
|
+
import type { Environment, InternalSourceLocation } from './types';
|
|
3
|
+
import type { EnvironmentRef } from './EnvironmentManager';
|
|
4
|
+
type EnvironmentOpts = EnvironmentOptions & {
|
|
5
|
+
loc?: InternalSourceLocation | null | undefined;
|
|
6
|
+
};
|
|
7
|
+
export declare function createEnvironment({ context, engines, includeNodeModules, outputFormat, sourceType, shouldOptimize, isLibrary, shouldScopeHoist, sourceMap, unstableSingleFileOutput, loc, }?: EnvironmentOpts): EnvironmentRef;
|
|
8
|
+
export declare function mergeEnvironments(projectRoot: FilePath, a: Environment, b?: EnvironmentOptions | IEnvironment | null): EnvironmentRef;
|
|
9
|
+
export declare function getEnvironmentHash(env: Environment): string;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* At the moment we're doing this change for `CoreEnvironment`,
|
|
3
|
+
* but the same change must be made for `TypesEnvironment` in @atlaspack/types.
|
|
4
|
+
*/
|
|
5
|
+
import type { Environment as CoreEnvironment } from './types';
|
|
6
|
+
import { Cache } from '@atlaspack/cache';
|
|
7
|
+
export type EnvironmentId = string;
|
|
8
|
+
/**
|
|
9
|
+
* When deduplication is cleaned-up this will always be a string.
|
|
10
|
+
*/
|
|
11
|
+
export type EnvironmentRef = EnvironmentId | CoreEnvironment;
|
|
12
|
+
/**
|
|
13
|
+
* Convert environment to a ref.
|
|
14
|
+
* This is what we should be using to store environments.
|
|
15
|
+
*/
|
|
16
|
+
export declare function toEnvironmentRef(env: CoreEnvironment): EnvironmentRef;
|
|
17
|
+
/**
|
|
18
|
+
* Convert environment to a string ID
|
|
19
|
+
*/
|
|
20
|
+
export declare function toEnvironmentId(
|
|
21
|
+
/**
|
|
22
|
+
* Redundant type during roll-out
|
|
23
|
+
*/
|
|
24
|
+
env: CoreEnvironment | EnvironmentRef): string;
|
|
25
|
+
export declare function fromEnvironmentId(id: EnvironmentRef): CoreEnvironment;
|
|
26
|
+
/**
|
|
27
|
+
* Writes all environments and their IDs to the cache
|
|
28
|
+
* @param {Cache} cache
|
|
29
|
+
* @returns {Promise<void>}
|
|
30
|
+
*/
|
|
31
|
+
export declare function writeEnvironmentsToCache(cache: Cache): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Loads all environments and their IDs from the cache
|
|
34
|
+
* @param {Cache} cache
|
|
35
|
+
* @returns {Promise<void>}
|
|
36
|
+
*/
|
|
37
|
+
export declare function loadEnvironmentsFromCache(cache: Cache): Promise<void>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { PackageName, ConfigResult } from '@atlaspack/types';
|
|
2
|
+
import type { Config, InternalFileCreateInvalidation, InternalDevDepOptions } from './types';
|
|
3
|
+
import type { ProjectPath } from './projectPath';
|
|
4
|
+
import type { EnvironmentRef } from './EnvironmentManager';
|
|
5
|
+
type ConfigOpts = {
|
|
6
|
+
plugin: PackageName;
|
|
7
|
+
searchPath: ProjectPath;
|
|
8
|
+
isSource?: boolean;
|
|
9
|
+
env?: EnvironmentRef;
|
|
10
|
+
result?: ConfigResult;
|
|
11
|
+
invalidateOnFileChange?: Set<ProjectPath>;
|
|
12
|
+
invalidateOnConfigKeyChange?: Array<{
|
|
13
|
+
filePath: ProjectPath;
|
|
14
|
+
configKey: string[];
|
|
15
|
+
}>;
|
|
16
|
+
invalidateOnFileCreate?: Array<InternalFileCreateInvalidation>;
|
|
17
|
+
invalidateOnEnvChange?: Set<string>;
|
|
18
|
+
invalidateOnOptionChange?: Set<string>;
|
|
19
|
+
devDeps?: Array<InternalDevDepOptions>;
|
|
20
|
+
invalidateOnStartup?: boolean;
|
|
21
|
+
invalidateOnBuild?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare function createConfig({ plugin, isSource, searchPath, env, result, invalidateOnFileChange, invalidateOnConfigKeyChange, invalidateOnFileCreate, invalidateOnEnvChange, invalidateOnOptionChange, devDeps, invalidateOnStartup, invalidateOnBuild, }: ConfigOpts): Config;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { Blob, FilePath, BundleResult, Async } from '@atlaspack/types';
|
|
2
|
+
import type SourceMap from '@parcel/source-map';
|
|
3
|
+
import type { Bundle as InternalBundle, Config, DevDepRequest, AtlaspackOptions, ReportFn, RequestInvalidation, DevDepRequestRef } from './types';
|
|
4
|
+
import type { AtlaspackConfig, LoadedPlugin } from './AtlaspackConfig';
|
|
5
|
+
import type InternalBundleGraph from './BundleGraph';
|
|
6
|
+
import type { ConfigRequest } from './requests/ConfigRequest';
|
|
7
|
+
import type { DevDepSpecifier } from './requests/DevDepRequest';
|
|
8
|
+
import { Readable } from 'stream';
|
|
9
|
+
import { NamedBundle } from './public/Bundle';
|
|
10
|
+
import PluginOptions from './public/PluginOptions';
|
|
11
|
+
import { PluginWithBundleConfig } from './requests/ConfigRequest';
|
|
12
|
+
type Opts = {
|
|
13
|
+
config: AtlaspackConfig;
|
|
14
|
+
options: AtlaspackOptions;
|
|
15
|
+
report: ReportFn;
|
|
16
|
+
previousDevDeps: Map<string, string>;
|
|
17
|
+
previousInvalidations: Array<RequestInvalidation>;
|
|
18
|
+
};
|
|
19
|
+
export type RunPackagerRunnerResult = {
|
|
20
|
+
bundleInfo: BundleInfo;
|
|
21
|
+
configRequests: Array<ConfigRequest>;
|
|
22
|
+
devDepRequests: Array<DevDepRequest | DevDepRequestRef>;
|
|
23
|
+
invalidations: Array<RequestInvalidation>;
|
|
24
|
+
};
|
|
25
|
+
export type BundleInfo = {
|
|
26
|
+
readonly type: string;
|
|
27
|
+
readonly size: number;
|
|
28
|
+
readonly hash: string;
|
|
29
|
+
readonly hashReferences: Array<string>;
|
|
30
|
+
readonly time?: number;
|
|
31
|
+
readonly cacheKeys: CacheKeyMap;
|
|
32
|
+
readonly isLargeBlob: boolean;
|
|
33
|
+
};
|
|
34
|
+
type CacheKeyMap = {
|
|
35
|
+
content: string;
|
|
36
|
+
map: string;
|
|
37
|
+
info: string;
|
|
38
|
+
};
|
|
39
|
+
export default class PackagerRunner {
|
|
40
|
+
config: AtlaspackConfig;
|
|
41
|
+
options: AtlaspackOptions;
|
|
42
|
+
pluginOptions: PluginOptions;
|
|
43
|
+
distDir: FilePath;
|
|
44
|
+
distExists: Set<FilePath>;
|
|
45
|
+
report: ReportFn;
|
|
46
|
+
previousDevDeps: Map<string, string>;
|
|
47
|
+
devDepRequests: Map<string, DevDepRequest | DevDepRequestRef>;
|
|
48
|
+
invalidations: Map<string, RequestInvalidation>;
|
|
49
|
+
previousInvalidations: Array<RequestInvalidation>;
|
|
50
|
+
constructor({ config, options, report, previousDevDeps, previousInvalidations, }: Opts);
|
|
51
|
+
run(bundleGraph: InternalBundleGraph, bundle: InternalBundle, invalidDevDeps: Array<DevDepSpecifier>): Promise<RunPackagerRunnerResult>;
|
|
52
|
+
loadConfigs(bundleGraph: InternalBundleGraph, bundle: InternalBundle): Promise<{
|
|
53
|
+
configs: Map<string, Config>;
|
|
54
|
+
bundleConfigs: Map<string, Config>;
|
|
55
|
+
}>;
|
|
56
|
+
loadConfig(bundleGraph: InternalBundleGraph, bundle: InternalBundle, configs: Map<string, Config>, bundleConfigs: Map<string, Config>): Promise<void>;
|
|
57
|
+
loadPluginConfig<T extends PluginWithBundleConfig>(bundleGraph: InternalBundleGraph, bundle: InternalBundle, plugin: LoadedPlugin<T>, configs: Map<string, Config>, bundleConfigs: Map<string, Config>): Promise<void>;
|
|
58
|
+
getBundleInfoFromCache(bundleGraph: InternalBundleGraph, bundle: InternalBundle, configs: Map<string, Config>, bundleConfigs: Map<string, Config>): Promise<Async<BundleInfo | null | undefined>>;
|
|
59
|
+
getBundleInfo(bundle: InternalBundle, bundleGraph: InternalBundleGraph, configs: Map<string, Config>, bundleConfigs: Map<string, Config>): Promise<BundleInfo>;
|
|
60
|
+
getBundleResult(bundle: InternalBundle, bundleGraph: InternalBundleGraph, configs: Map<string, Config>, bundleConfigs: Map<string, Config>): Promise<{
|
|
61
|
+
type: string;
|
|
62
|
+
contents: Blob;
|
|
63
|
+
map: string | null | undefined;
|
|
64
|
+
}>;
|
|
65
|
+
getSourceMapReference(bundle: NamedBundle, map?: SourceMap | null): Async<string | null | undefined>;
|
|
66
|
+
package(internalBundle: InternalBundle, bundleGraph: InternalBundleGraph, configs: Map<string, Config>, bundleConfigs: Map<string, Config>): Promise<BundleResult>;
|
|
67
|
+
optimize(internalBundle: InternalBundle, internalBundleGraph: InternalBundleGraph, type: string, contents: Blob, map: SourceMap | null | undefined, configs: Map<string, Config>, bundleConfigs: Map<string, Config>): Promise<BundleResult>;
|
|
68
|
+
generateSourceMap(bundle: InternalBundle, map: SourceMap): Promise<string>;
|
|
69
|
+
getCacheKey(bundle: InternalBundle, bundleGraph: InternalBundleGraph, configs: Map<string, Config>, bundleConfigs: Map<string, Config>, invalidations: Array<RequestInvalidation>): Promise<string>;
|
|
70
|
+
getDevDepHashes(bundle: InternalBundle): Promise<string>;
|
|
71
|
+
readFromCache(cacheKey: string): Promise<{
|
|
72
|
+
contents: Readable;
|
|
73
|
+
map: Readable | null | undefined;
|
|
74
|
+
} | null | undefined>;
|
|
75
|
+
writeToCache(cacheKeys: CacheKeyMap, type: string, contents: Blob, map?: string | null): Promise<BundleInfo>;
|
|
76
|
+
static getContentKey(cacheKey: string): string;
|
|
77
|
+
static getMapKey(cacheKey: string): string;
|
|
78
|
+
static getInfoKey(cacheKey: string): string;
|
|
79
|
+
}
|
|
80
|
+
export {};
|