@atlaspack/bundler-default 2.15.1 → 2.16.1
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 +26 -0
- package/lib/bundlerConfig.js +19 -4
- package/package.json +6 -6
- package/src/bundlerConfig.js +12 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @atlaspack/bundler-default
|
|
2
2
|
|
|
3
|
+
## 2.16.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 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)]:
|
|
8
|
+
- @atlaspack/feature-flags@2.15.1
|
|
9
|
+
- @atlaspack/rust@3.3.3
|
|
10
|
+
- @atlaspack/graph@3.4.6
|
|
11
|
+
- @atlaspack/utils@2.14.8
|
|
12
|
+
- @atlaspack/plugin@2.14.8
|
|
13
|
+
|
|
14
|
+
## 2.16.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- [#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.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [[`a1773d2`](https://github.com/atlassian-labs/atlaspack/commit/a1773d2a62d0ef7805ac7524621dcabcc1afe929), [`556d6ab`](https://github.com/atlassian-labs/atlaspack/commit/556d6ab8ede759fa7f37fcd3f4da336ef1c55e8f)]:
|
|
23
|
+
- @atlaspack/feature-flags@2.15.0
|
|
24
|
+
- @atlaspack/rust@3.3.2
|
|
25
|
+
- @atlaspack/graph@3.4.5
|
|
26
|
+
- @atlaspack/utils@2.14.7
|
|
27
|
+
- @atlaspack/plugin@2.14.7
|
|
28
|
+
|
|
3
29
|
## 2.15.1
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
package/lib/bundlerConfig.js
CHANGED
|
@@ -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
|
-
|
|
129
|
-
|
|
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 ||
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/bundler-default",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.16.1",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"publishConfig": {
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@atlaspack/diagnostic": "2.14.1",
|
|
20
|
-
"@atlaspack/feature-flags": "2.
|
|
21
|
-
"@atlaspack/graph": "3.4.
|
|
22
|
-
"@atlaspack/plugin": "2.14.
|
|
23
|
-
"@atlaspack/rust": "3.3.
|
|
24
|
-
"@atlaspack/utils": "2.14.
|
|
20
|
+
"@atlaspack/feature-flags": "2.15.1",
|
|
21
|
+
"@atlaspack/graph": "3.4.6",
|
|
22
|
+
"@atlaspack/plugin": "2.14.8",
|
|
23
|
+
"@atlaspack/rust": "3.3.3",
|
|
24
|
+
"@atlaspack/utils": "2.14.8",
|
|
25
25
|
"nullthrows": "^1.1.1"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/src/bundlerConfig.js
CHANGED
|
@@ -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
|
|
159
|
-
|
|
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 = {
|