@atlaspack/bundler-default 2.14.5-dev.14 → 2.14.5-dev.55

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 CHANGED
@@ -1,5 +1,53 @@
1
1
  # @atlaspack/bundler-default
2
2
 
3
+ ## 2.16.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`124b7ff`](https://github.com/atlassian-labs/atlaspack/commit/124b7fff44f71aac9fbad289a9a9509b3dfc9aaa), [`e052521`](https://github.com/atlassian-labs/atlaspack/commit/e0525210850ed1606146eb86991049cf567c5dec), [`15c6d70`](https://github.com/atlassian-labs/atlaspack/commit/15c6d7000bd89da876bc590aa75b17a619a41896), [`e4d966c`](https://github.com/atlassian-labs/atlaspack/commit/e4d966c3c9c4292c5013372ae65b10d19d4bacc6), [`209692f`](https://github.com/atlassian-labs/atlaspack/commit/209692ffb11eae103a0d65c5e1118a5aa1625818), [`42a775d`](https://github.com/atlassian-labs/atlaspack/commit/42a775de8eec638ad188f3271964170d8c04d84b), [`29c2f10`](https://github.com/atlassian-labs/atlaspack/commit/29c2f106de9679adfb5afa04e1910471dc65a427), [`f4da1e1`](https://github.com/atlassian-labs/atlaspack/commit/f4da1e120e73eeb5e8b8927f05e88f04d6148c7b), [`1ef91fc`](https://github.com/atlassian-labs/atlaspack/commit/1ef91fcc863fdd2831511937083dbbc1263b3d9d)]:
8
+ - @atlaspack/rust@3.3.4
9
+ - @atlaspack/feature-flags@2.16.0
10
+ - @atlaspack/utils@2.14.9
11
+ - @atlaspack/graph@3.4.7
12
+ - @atlaspack/plugin@2.14.9
13
+
14
+ ## 2.16.1
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [[`30f6017`](https://github.com/atlassian-labs/atlaspack/commit/30f60175ba4d272c5fc193973c63bc298584775b), [`1ab0a27`](https://github.com/atlassian-labs/atlaspack/commit/1ab0a275aeca40350415e2b03e7440d1dddc6228), [`b8a4ae8`](https://github.com/atlassian-labs/atlaspack/commit/b8a4ae8f83dc0a83d8b145c5f729936ce52080a3)]:
19
+ - @atlaspack/feature-flags@2.15.1
20
+ - @atlaspack/rust@3.3.3
21
+ - @atlaspack/graph@3.4.6
22
+ - @atlaspack/utils@2.14.8
23
+ - @atlaspack/plugin@2.14.8
24
+
25
+ ## 2.16.0
26
+
27
+ ### Minor Changes
28
+
29
+ - [#547](https://github.com/atlassian-labs/atlaspack/pull/547) [`a1773d2`](https://github.com/atlassian-labs/atlaspack/commit/a1773d2a62d0ef7805ac7524621dcabcc1afe929) Thanks [@benjervis](https://github.com/benjervis)! - Add a feature flag for resolving the configuration for `@atlaspack/bundler-default` from CWD, rather than exclusively from the project root.
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies [[`a1773d2`](https://github.com/atlassian-labs/atlaspack/commit/a1773d2a62d0ef7805ac7524621dcabcc1afe929), [`556d6ab`](https://github.com/atlassian-labs/atlaspack/commit/556d6ab8ede759fa7f37fcd3f4da336ef1c55e8f)]:
34
+ - @atlaspack/feature-flags@2.15.0
35
+ - @atlaspack/rust@3.3.2
36
+ - @atlaspack/graph@3.4.5
37
+ - @atlaspack/utils@2.14.7
38
+ - @atlaspack/plugin@2.14.7
39
+
40
+ ## 2.15.1
41
+
42
+ ### Patch Changes
43
+
44
+ - Updated dependencies [[`e0f5337`](https://github.com/atlassian-labs/atlaspack/commit/e0f533757bd1019dbd108a04952c87da15286e09)]:
45
+ - @atlaspack/feature-flags@2.14.4
46
+ - @atlaspack/rust@3.3.1
47
+ - @atlaspack/graph@3.4.4
48
+ - @atlaspack/utils@2.14.6
49
+ - @atlaspack/plugin@2.14.6
50
+
3
51
  ## 2.15.0
4
52
 
5
53
  ### Minor Changes
@@ -11,6 +11,13 @@ function _diagnostic() {
11
11
  };
12
12
  return data;
13
13
  }
14
+ function _featureFlags() {
15
+ const data = require("@atlaspack/feature-flags");
16
+ _featureFlags = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
14
21
  function _utils() {
15
22
  const data = require("@atlaspack/utils");
16
23
  _utils = function () {
@@ -125,9 +132,17 @@ const CONFIG_SCHEMA = {
125
132
  additionalProperties: false
126
133
  };
127
134
  async function loadBundlerConfig(config, options, logger) {
128
- let conf = await config.getConfig([], {
129
- packageKey: '@atlaspack/bundler-default'
130
- });
135
+ var _conf;
136
+ let conf;
137
+ if ((0, _featureFlags().getFeatureFlag)('resolveBundlerConfigFromCwd')) {
138
+ conf = await config.getConfigFrom(`${process.cwd()}/index`, [], {
139
+ packageKey: '@atlaspack/bundler-default'
140
+ });
141
+ } else {
142
+ conf = await config.getConfig([], {
143
+ packageKey: '@atlaspack/bundler-default'
144
+ });
145
+ }
131
146
  if (!conf) {
132
147
  const modDefault = {
133
148
  ...HTTP_OPTIONS['2'],
@@ -135,7 +150,7 @@ async function loadBundlerConfig(config, options, logger) {
135
150
  };
136
151
  return modDefault;
137
152
  }
138
- (0, _assert().default)((conf === null || conf === void 0 ? void 0 : conf.contents) != null);
153
+ (0, _assert().default)(((_conf = conf) === null || _conf === void 0 ? void 0 : _conf.contents) != null);
139
154
  let modeConfig = resolveModeConfig(conf.contents, options.mode);
140
155
 
141
156
  // minBundles will be ignored if shared bundles are disabled
package/lib/idealGraph.js CHANGED
@@ -108,15 +108,7 @@ function createIdealGraph(assetGraph, config, entries, logger) {
108
108
  }
109
109
  let assets = [];
110
110
  let assetToIndex = new Map();
111
- //Manual is a map of the user-given name to the bundle node Id that corresponds to ALL the assets that match any glob in that user-specified array
112
- let manualSharedMap = new Map();
113
- // May need a map to be able to look up NON- bundle root assets which need special case instructions
114
- // Use this when placing assets into bundles, to avoid duplication
115
- let manualAssetToBundle = new Map();
116
- let {
117
- manualAssetToConfig,
118
- constantModuleToMSB
119
- } = function makeManualAssetToConfigLookup() {
111
+ function makeManualAssetToConfigLookup() {
120
112
  let manualAssetToConfig = new Map();
121
113
  let constantModuleToMSB = new (_utils().DefaultMap)(() => []);
122
114
  if (config.manualSharedBundles.length === 0) {
@@ -182,7 +174,17 @@ function createIdealGraph(assetGraph, config, entries, logger) {
182
174
  manualAssetToConfig,
183
175
  constantModuleToMSB
184
176
  };
185
- }();
177
+ }
178
+
179
+ //Manual is a map of the user-given name to the bundle node Id that corresponds to ALL the assets that match any glob in that user-specified array
180
+ let manualSharedMap = new Map();
181
+ // May need a map to be able to look up NON- bundle root assets which need special case instructions
182
+ // Use this when placing assets into bundles, to avoid duplication
183
+ let manualAssetToBundle = new Map();
184
+ let {
185
+ manualAssetToConfig,
186
+ constantModuleToMSB
187
+ } = makeManualAssetToConfigLookup();
186
188
  let manualBundleToInternalizedAsset = new (_utils().DefaultMap)(() => []);
187
189
 
188
190
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/bundler-default",
3
- "version": "2.14.5-dev.14+8c369e38c",
3
+ "version": "2.14.5-dev.55+5a11f33c5",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "type": "commonjs",
6
6
  "publishConfig": {
@@ -16,13 +16,13 @@
16
16
  "node": ">= 16.0.0"
17
17
  },
18
18
  "dependencies": {
19
- "@atlaspack/diagnostic": "2.14.1-dev.82+8c369e38c",
20
- "@atlaspack/feature-flags": "2.14.1-dev.82+8c369e38c",
21
- "@atlaspack/graph": "3.4.1-dev.82+8c369e38c",
22
- "@atlaspack/plugin": "2.14.5-dev.14+8c369e38c",
23
- "@atlaspack/rust": "3.2.1-dev.14+8c369e38c",
24
- "@atlaspack/utils": "2.14.5-dev.14+8c369e38c",
19
+ "@atlaspack/diagnostic": "2.14.1-dev.123+5a11f33c5",
20
+ "@atlaspack/feature-flags": "2.14.1-dev.123+5a11f33c5",
21
+ "@atlaspack/graph": "3.4.1-dev.123+5a11f33c5",
22
+ "@atlaspack/plugin": "2.14.5-dev.55+5a11f33c5",
23
+ "@atlaspack/rust": "3.2.1-dev.55+5a11f33c5",
24
+ "@atlaspack/utils": "2.14.5-dev.55+5a11f33c5",
25
25
  "nullthrows": "^1.1.1"
26
26
  },
27
- "gitHead": "8c369e38ccd428409811114aebd6044c27f90705"
27
+ "gitHead": "5a11f33c51ff74d1cf8d4b72cfa0fda833aa980a"
28
28
  }
@@ -7,6 +7,7 @@ import type {
7
7
  BuildMode,
8
8
  PluginLogger,
9
9
  } from '@atlaspack/types';
10
+ import {getFeatureFlag} from '@atlaspack/feature-flags';
10
11
  import {type SchemaEntity, validateSchema} from '@atlaspack/utils';
11
12
  import invariant from 'assert';
12
13
 
@@ -155,9 +156,17 @@ export async function loadBundlerConfig(
155
156
  options: PluginOptions,
156
157
  logger: PluginLogger,
157
158
  ): Promise<ResolvedBundlerConfig> {
158
- let conf = await config.getConfig<BundlerConfig>([], {
159
- packageKey: '@atlaspack/bundler-default',
160
- });
159
+ let conf;
160
+
161
+ if (getFeatureFlag('resolveBundlerConfigFromCwd')) {
162
+ conf = await config.getConfigFrom(`${process.cwd()}/index`, [], {
163
+ packageKey: '@atlaspack/bundler-default',
164
+ });
165
+ } else {
166
+ conf = await config.getConfig<BundlerConfig>([], {
167
+ packageKey: '@atlaspack/bundler-default',
168
+ });
169
+ }
161
170
 
162
171
  if (!conf) {
163
172
  const modDefault = {