@atlaspack/bundler-default 3.1.3-typescript-b27501580.0 → 3.1.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.
@@ -0,0 +1,18 @@
1
+ import { Bundler } from '@atlaspack/plugin';
2
+ /**
3
+ *
4
+ * The Bundler works by creating an IdealGraph, which contains a BundleGraph that models bundles
5
+ * connected to other bundles by what references them, and thus models BundleGroups.
6
+ *
7
+ * First, we enter `bundle({bundleGraph, config})`. Here, "bundleGraph" is actually just the
8
+ * assetGraph turned into a type `MutableBundleGraph`, which will then be mutated in decorate,
9
+ * and turned into what we expect the bundleGraph to be as per the old (default) bundler structure
10
+ * & what the rest of Atlaspack expects a BundleGraph to be.
11
+ *
12
+ * `bundle({bundleGraph, config})` First gets a Mapping of target to entries, In most cases there is
13
+ * only one target, and one or more entries. (Targets are pertinent in monorepos or projects where you
14
+ * will have two or more distDirs, or output folders.) Then calls create IdealGraph and Decorate per target.
15
+ *
16
+ */
17
+ declare const _default: Bundler<unknown>;
18
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import type { Asset, Dependency, MutableBundleGraph } from '@atlaspack/types';
2
+ export declare function addJSMonolithBundle(bundleGraph: MutableBundleGraph, entryAsset: Asset, entryDep: Dependency): void;
@@ -0,0 +1,9 @@
1
+ import type { NodeId } from '@atlaspack/graph';
2
+ import type { IdealBundleGraph } from './idealGraph';
3
+ export type MergeGroup = {
4
+ overlapThreshold?: number;
5
+ maxBundleSize?: number;
6
+ sourceBundles?: Array<NodeId>;
7
+ minBundlesInGroup?: number;
8
+ };
9
+ export declare function findMergeCandidates(bundleGraph: IdealBundleGraph, bundles: Array<NodeId>, config: Array<MergeGroup>): Array<Array<NodeId>>;
@@ -0,0 +1,27 @@
1
+ import type { Config, PluginOptions, PluginLogger } from '@atlaspack/types';
2
+ type Glob = string;
3
+ type ManualSharedBundles = Array<{
4
+ name: string;
5
+ assets: Array<Glob>;
6
+ types?: Array<string>;
7
+ root?: string;
8
+ split?: number;
9
+ }>;
10
+ export type MergeCandidates = Array<{
11
+ overlapThreshold?: number;
12
+ maxBundleSize?: number;
13
+ sourceBundles?: Array<string>;
14
+ minBundlesInGroup?: number;
15
+ }>;
16
+ export type ResolvedBundlerConfig = {
17
+ minBundles: number;
18
+ minBundleSize: number;
19
+ maxParallelRequests: number;
20
+ projectRoot: string;
21
+ disableSharedBundles: boolean;
22
+ manualSharedBundles: ManualSharedBundles;
23
+ loadConditionalBundlesInParallel?: boolean;
24
+ sharedBundleMerge?: MergeCandidates;
25
+ };
26
+ export declare function loadBundlerConfig(config: Config, options: PluginOptions, logger: PluginLogger): Promise<ResolvedBundlerConfig>;
27
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { MutableBundleGraph } from '@atlaspack/types';
2
+ import type { IdealGraph } from './idealGraph';
3
+ export declare function decorateLegacyGraph(idealGraph: IdealGraph, bundleGraph: MutableBundleGraph): void;
@@ -0,0 +1,39 @@
1
+ import { BitSet, ContentGraph, Graph, NodeId } from '@atlaspack/graph';
2
+ import type { Asset, BundleBehavior, Dependency, Environment, MutableBundleGraph, Target, PluginLogger } from '@atlaspack/types';
3
+ import { DefaultMap } from '@atlaspack/utils';
4
+ import type { ResolvedBundlerConfig } from './bundlerConfig';
5
+ export type Bundle = {
6
+ uniqueKey: string | null | undefined;
7
+ assets: Set<Asset>;
8
+ internalizedAssets?: BitSet;
9
+ bundleBehavior?: BundleBehavior | null | undefined;
10
+ needsStableName: boolean;
11
+ mainEntryAsset: Asset | null | undefined;
12
+ size: number;
13
+ sourceBundles: Set<NodeId>;
14
+ target: Target;
15
+ env: Environment;
16
+ type: string;
17
+ manualSharedBundle: string | null | undefined;
18
+ };
19
+ export type DependencyBundleGraph = ContentGraph<{
20
+ value: Bundle;
21
+ type: 'bundle';
22
+ } | {
23
+ value: Dependency;
24
+ type: 'dependency';
25
+ }, number>;
26
+ export declare const idealBundleGraphEdges: Readonly<{
27
+ default: 1;
28
+ conditional: 2;
29
+ }>;
30
+ export type IdealBundleGraph = Graph<Bundle | 'root', (typeof idealBundleGraphEdges)[keyof typeof idealBundleGraphEdges]>;
31
+ export type IdealGraph = {
32
+ assetReference: DefaultMap<Asset, Array<[Dependency, Bundle]>>;
33
+ assets: Array<Asset>;
34
+ bundleGraph: IdealBundleGraph;
35
+ bundleGroupBundleIds: Set<NodeId>;
36
+ dependencyBundleGraph: DependencyBundleGraph;
37
+ manualAssetToBundle: Map<Asset, NodeId>;
38
+ };
39
+ export declare function createIdealGraph(assetGraph: MutableBundleGraph, config: ResolvedBundlerConfig, entries: Map<Asset, Dependency>, logger: PluginLogger): IdealGraph;
@@ -0,0 +1,2 @@
1
+ export declare function clearCaches(): void;
2
+ export declare function memoize<Args extends Array<unknown>, Return>(fn: (...args: Args) => Return): (...args: Args) => Return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/bundler-default",
3
- "version": "3.1.3-typescript-b27501580.0",
3
+ "version": "3.1.3-typescript-5b4d3ad41.0",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "type": "commonjs",
6
6
  "publishConfig": {
@@ -17,17 +17,17 @@
17
17
  "node": ">= 16.0.0"
18
18
  },
19
19
  "dependencies": {
20
- "@atlaspack/diagnostic": "2.14.2-typescript-b27501580.0",
21
- "@atlaspack/feature-flags": "2.19.3-typescript-b27501580.0",
22
- "@atlaspack/graph": "3.5.10-typescript-b27501580.0",
23
- "@atlaspack/plugin": "2.14.21-typescript-b27501580.0",
24
- "@atlaspack/rust": "3.4.2-typescript-b27501580.0",
25
- "@atlaspack/utils": "2.17.3-typescript-b27501580.0",
20
+ "@atlaspack/diagnostic": "2.14.2-typescript-5b4d3ad41.0",
21
+ "@atlaspack/feature-flags": "2.19.3-typescript-5b4d3ad41.0",
22
+ "@atlaspack/graph": "3.5.10-typescript-5b4d3ad41.0",
23
+ "@atlaspack/plugin": "2.14.21-typescript-5b4d3ad41.0",
24
+ "@atlaspack/rust": "3.4.2-typescript-5b4d3ad41.0",
25
+ "@atlaspack/utils": "2.17.3-typescript-5b4d3ad41.0",
26
26
  "many-keys-map": "^1.0.3",
27
27
  "nullthrows": "^1.1.1"
28
28
  },
29
29
  "scripts": {
30
30
  "check-ts": "tsc --emitDeclarationOnly --rootDir src"
31
31
  },
32
- "gitHead": "b275015805a058452afb6fb48c078ecd4de925f2"
32
+ "gitHead": "5b4d3ad41ffa002b989ba77271bb3010a1f05b2a"
33
33
  }