@atlaspack/core 2.25.2-dev-native-compiled-test-712d92d32.0 → 2.26.1-dev-yarn-8750a7d2e.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/CHANGELOG.md +32 -0
- package/dist/CommittedAsset.js +0 -3
- package/dist/UncommittedAsset.js +0 -9
- package/dist/atlaspack-v3/worker/compat/mutable-asset.js +0 -4
- package/dist/loadDotEnv.js +1 -0
- package/dist/public/Asset.js +0 -6
- package/dist/requests/AssetGraphRequestRust.js +1 -2
- package/dist/requests/AtlaspackConfigRequest.js +21 -7
- package/dist/requests/BundleGraphRequest.js +5 -1
- package/dist/requests/TargetRequest.js +1 -0
- package/dist/requests/asset-graph-diff.js +6 -4
- package/lib/CommittedAsset.js +0 -3
- package/lib/UncommittedAsset.js +0 -9
- package/lib/atlaspack-v3/worker/compat/mutable-asset.js +0 -4
- package/lib/loadDotEnv.js +2 -0
- package/lib/public/Asset.js +0 -6
- package/lib/requests/AssetGraphRequestRust.js +4 -2
- package/lib/requests/AtlaspackConfigRequest.js +27 -7
- package/lib/requests/BundleGraphRequest.js +5 -1
- package/lib/requests/TargetRequest.js +2 -1
- package/lib/requests/asset-graph-diff.js +4 -4
- package/lib/types/CommittedAsset.d.ts +0 -1
- package/lib/types/UncommittedAsset.d.ts +0 -2
- package/lib/types/atlaspack-v3/worker/compat/mutable-asset.d.ts +0 -2
- package/lib/types/public/Asset.d.ts +0 -2
- package/lib/types/types.d.ts +0 -1
- package/package.json +18 -18
- package/src/CommittedAsset.ts +0 -4
- package/src/UncommittedAsset.ts +0 -11
- package/src/atlaspack-v3/worker/compat/mutable-asset.ts +0 -6
- package/src/atlaspack-v3/worker/worker.ts +1 -1
- package/src/loadDotEnv.ts +1 -0
- package/src/public/Asset.ts +0 -8
- package/src/requests/AssetGraphRequestRust.ts +1 -2
- package/src/requests/AtlaspackConfigRequest.ts +24 -7
- package/src/requests/BundleGraphRequest.ts +5 -1
- package/src/requests/TargetRequest.ts +1 -0
- package/src/requests/asset-graph-diff.ts +11 -7
- package/src/types.ts +0 -1
- package/test/AtlaspackConfigRequest.test.ts +72 -0
- package/test/TargetRequest.test.ts +12 -0
- package/test/fixtures/config-with-reporters/.parcelrc +7 -0
- package/test/fixtures/custom-targets/package.json +6 -0
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @atlaspack/core
|
|
2
2
|
|
|
3
|
+
## 2.26.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#827](https://github.com/atlassian-labs/atlaspack/pull/827) [`ff8ac84`](https://github.com/atlassian-labs/atlaspack/commit/ff8ac84bd0be15caa7c7af21bf5b6e47b6d36438) Thanks [@OscarCookeAbbott](https://github.com/OscarCookeAbbott)! - Fix custom environment properties sometimes being ignored
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#817](https://github.com/atlassian-labs/atlaspack/pull/817) [`3da8e69`](https://github.com/atlassian-labs/atlaspack/commit/3da8e690605472d81c531366b65fa9844f8ca337) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Fix an issue when creating the BundleGraph and some Dependency.sourceAssetId values have diverged from the actual Asset.id values.
|
|
12
|
+
|
|
13
|
+
Fix behind flag `sourceAssetIdBundleGraphFix`
|
|
14
|
+
|
|
15
|
+
- [#810](https://github.com/atlassian-labs/atlaspack/pull/810) [`c372f3f`](https://github.com/atlassian-labs/atlaspack/commit/c372f3fd6fce8200d5cf47f41bc7895c6cbb5558) Thanks [@benjervis](https://github.com/benjervis)! - Add the `scope-hosting-stats` debug tool to report on the percentage of assets that were able to be scope hoisted during the build.
|
|
16
|
+
|
|
17
|
+
- [#831](https://github.com/atlassian-labs/atlaspack/pull/831) [`27fd73f`](https://github.com/atlassian-labs/atlaspack/commit/27fd73fa07d358653f1be6f2d15d72dc5d8fc2fd) Thanks [@benjervis](https://github.com/benjervis)! - Update some Rust internals to use Arcs instead of passing references. This won't make any difference in the immediate term, but is required setup for the next set of changes
|
|
18
|
+
|
|
19
|
+
- [#834](https://github.com/atlassian-labs/atlaspack/pull/834) [`3091fa3`](https://github.com/atlassian-labs/atlaspack/commit/3091fa36425ecffe3938e55247a035b08cda37a2) Thanks [@benjervis](https://github.com/benjervis)! - We no longer want to use `meta` fields internally in Atlaspack, so they have been removed from the Rust side of the codebase, and are mapped back to the legacy format on the JS side.
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [[`79a7e22`](https://github.com/atlassian-labs/atlaspack/commit/79a7e22ef119891a2f4180a9d3cc66b38dd52092), [`3da8e69`](https://github.com/atlassian-labs/atlaspack/commit/3da8e690605472d81c531366b65fa9844f8ca337), [`c372f3f`](https://github.com/atlassian-labs/atlaspack/commit/c372f3fd6fce8200d5cf47f41bc7895c6cbb5558), [`17dfea9`](https://github.com/atlassian-labs/atlaspack/commit/17dfea9e9f3169807808520df9c09ebf70dc8b10), [`f1070ec`](https://github.com/atlassian-labs/atlaspack/commit/f1070ec48e99b4ec111a03179c5ab5b74163fab1), [`27fd73f`](https://github.com/atlassian-labs/atlaspack/commit/27fd73fa07d358653f1be6f2d15d72dc5d8fc2fd), [`3091fa3`](https://github.com/atlassian-labs/atlaspack/commit/3091fa36425ecffe3938e55247a035b08cda37a2)]:
|
|
22
|
+
- @atlaspack/feature-flags@2.25.5
|
|
23
|
+
- @atlaspack/rust@3.8.3
|
|
24
|
+
- @atlaspack/utils@3.0.3
|
|
25
|
+
- @atlaspack/cache@3.2.30
|
|
26
|
+
- @atlaspack/fs@2.15.30
|
|
27
|
+
- @atlaspack/graph@3.5.24
|
|
28
|
+
- @atlaspack/package-manager@2.14.35
|
|
29
|
+
- @atlaspack/logger@2.14.27
|
|
30
|
+
- @atlaspack/plugin@2.14.35
|
|
31
|
+
- @atlaspack/profiler@2.14.32
|
|
32
|
+
- @atlaspack/types@2.15.25
|
|
33
|
+
- @atlaspack/workers@2.14.35
|
|
34
|
+
|
|
3
35
|
## 2.25.1
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
package/dist/CommittedAsset.js
CHANGED
package/dist/UncommittedAsset.js
CHANGED
|
@@ -311,14 +311,5 @@ class UncommittedAsset {
|
|
|
311
311
|
// @ts-expect-error TS2345
|
|
312
312
|
this.value.id = (0, assetUtils_1.createAssetIdFromOptions)(this.value);
|
|
313
313
|
}
|
|
314
|
-
setCompiledCssStyles(styles) {
|
|
315
|
-
if (styles.length > 0) {
|
|
316
|
-
console.log('setCompiledCssStyles', styles);
|
|
317
|
-
}
|
|
318
|
-
this.value.compiledCssStyles = styles;
|
|
319
|
-
}
|
|
320
|
-
getCompiledCssStyles() {
|
|
321
|
-
return this.value.compiledCssStyles;
|
|
322
|
-
}
|
|
323
314
|
}
|
|
324
315
|
exports.default = UncommittedAsset;
|
|
@@ -51,7 +51,6 @@ class MutableAsset {
|
|
|
51
51
|
this.symbols = new asset_symbols_1.MutableAssetSymbols(asset.symbols);
|
|
52
52
|
this.type = asset.type;
|
|
53
53
|
this.uniqueKey = asset.uniqueKey;
|
|
54
|
-
this.compiledCssStyles = asset.compiledCssStyles;
|
|
55
54
|
__classPrivateFieldSet(this, _MutableAsset_astDirty, false, "f");
|
|
56
55
|
__classPrivateFieldSet(this, _MutableAsset_contents, contents, "f");
|
|
57
56
|
__classPrivateFieldSet(this, _MutableAsset_inner, asset, "f");
|
|
@@ -148,9 +147,6 @@ class MutableAsset {
|
|
|
148
147
|
invalidateOnBuild() {
|
|
149
148
|
// TODO: Forward invalidations to Rust
|
|
150
149
|
}
|
|
151
|
-
setCompiledCssStyles(styles) {
|
|
152
|
-
this.compiledCssStyles = styles;
|
|
153
|
-
}
|
|
154
150
|
}
|
|
155
151
|
exports.MutableAsset = MutableAsset;
|
|
156
152
|
_MutableAsset_astDirty = new WeakMap(), _MutableAsset_ast = new WeakMap(), _MutableAsset_contents = new WeakMap(), _MutableAsset_inner = new WeakMap(), _MutableAsset_map = new WeakMap(), _MutableAsset_projectRoot = new WeakMap(), _MutableAsset_sourceMap = new WeakMap();
|
package/dist/loadDotEnv.js
CHANGED
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.default = loadEnv;
|
|
7
7
|
const utils_1 = require("@atlaspack/utils");
|
|
8
|
+
// @ts-expect-error TS7016
|
|
8
9
|
const dotenv_1 = __importDefault(require("dotenv"));
|
|
9
10
|
const dotenv_expand_1 = __importDefault(require("dotenv-expand"));
|
|
10
11
|
async function loadEnv(env, fs, filePath, projectRoot) {
|
package/dist/public/Asset.js
CHANGED
|
@@ -133,9 +133,6 @@ class BaseAsset {
|
|
|
133
133
|
getMapBuffer() {
|
|
134
134
|
return __classPrivateFieldGet(this, _BaseAsset_asset, "f").getMapBuffer();
|
|
135
135
|
}
|
|
136
|
-
getCompiledCssStyles() {
|
|
137
|
-
return __classPrivateFieldGet(this, _BaseAsset_asset, "f").getCompiledCssStyles();
|
|
138
|
-
}
|
|
139
136
|
}
|
|
140
137
|
class Asset extends BaseAsset {
|
|
141
138
|
constructor(asset) {
|
|
@@ -277,9 +274,6 @@ class MutableAsset extends BaseAsset {
|
|
|
277
274
|
});
|
|
278
275
|
__classPrivateFieldGet(this, _MutableAsset_asset, "f").updateId();
|
|
279
276
|
}
|
|
280
|
-
setCompiledCssStyles(styles) {
|
|
281
|
-
__classPrivateFieldGet(this, _MutableAsset_asset, "f").setCompiledCssStyles(styles);
|
|
282
|
-
}
|
|
283
277
|
}
|
|
284
278
|
exports.MutableAsset = MutableAsset;
|
|
285
279
|
_MutableAsset_asset = new WeakMap();
|
|
@@ -180,8 +180,7 @@ function getAssetGraph(serializedGraph) {
|
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
else if (node.type === 'dependency') {
|
|
183
|
-
let id = node.value
|
|
184
|
-
let dependency = node.value.dependency;
|
|
183
|
+
let { dependency, id } = node.value;
|
|
185
184
|
dependency.id = id;
|
|
186
185
|
dependency.env.id = (0, feature_flags_1.getFeatureFlag)('environmentDeduplication')
|
|
187
186
|
? // TODO: Rust can do this and avoid copying a significant amount of data over
|
|
@@ -141,13 +141,27 @@ async function resolveAtlaspackConfig(options) {
|
|
|
141
141
|
}
|
|
142
142
|
let { config, extendedFiles } = await parseAndProcessConfig(configPath, contents, options);
|
|
143
143
|
if (options.additionalReporters.length > 0) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
resolveFrom
|
|
148
|
-
})
|
|
149
|
-
|
|
150
|
-
|
|
144
|
+
if (options.featureFlags.deduplicateReporters) {
|
|
145
|
+
const reporterMap = new Map();
|
|
146
|
+
options.additionalReporters.forEach(({ packageName, resolveFrom }) => {
|
|
147
|
+
reporterMap.set(packageName, { packageName, resolveFrom });
|
|
148
|
+
});
|
|
149
|
+
config.reporters?.forEach((reporter) => {
|
|
150
|
+
if (!reporterMap.has(reporter.packageName)) {
|
|
151
|
+
reporterMap.set(reporter.packageName, reporter);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
config.reporters = Array.from(reporterMap.values());
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
config.reporters = [
|
|
158
|
+
...options.additionalReporters.map(({ packageName, resolveFrom }) => ({
|
|
159
|
+
packageName,
|
|
160
|
+
resolveFrom,
|
|
161
|
+
})),
|
|
162
|
+
...(config.reporters ?? []),
|
|
163
|
+
];
|
|
164
|
+
}
|
|
151
165
|
}
|
|
152
166
|
return { config, extendedFiles, usedDefault };
|
|
153
167
|
}
|
|
@@ -142,7 +142,11 @@ function createBundleGraphRequest(input) {
|
|
|
142
142
|
// force: true,
|
|
143
143
|
// },
|
|
144
144
|
// );
|
|
145
|
-
// require('./asset-graph-diff.
|
|
145
|
+
// require('./asset-graph-diff.ts')(
|
|
146
|
+
// jsAssetGraph,
|
|
147
|
+
// assetGraph,
|
|
148
|
+
// options.projectRoot,
|
|
149
|
+
// );
|
|
146
150
|
// }
|
|
147
151
|
measurement && measurement.end();
|
|
148
152
|
(0, utils_2.assertSignalNotAborted)(signal);
|
|
@@ -887,6 +887,7 @@ class TargetResolver {
|
|
|
887
887
|
: descriptor.optimize !== false),
|
|
888
888
|
shouldScopeHoist: shouldScopeHoist && descriptor.scopeHoist !== false,
|
|
889
889
|
sourceMap: normalizeSourceMap(this.options, descriptor.sourceMap),
|
|
890
|
+
customEnv: descriptor.env,
|
|
890
891
|
}),
|
|
891
892
|
loc: (0, utils_2.toInternalSourceLocation)(this.options.projectRoot, loc),
|
|
892
893
|
});
|
|
@@ -67,7 +67,7 @@ function compactDeep(obj, ignoredPatterns = [], currentPath = '$') {
|
|
|
67
67
|
return obj;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
function assetGraphDiff(jsAssetGraph, rustAssetGraph) {
|
|
70
|
+
function assetGraphDiff(jsAssetGraph, rustAssetGraph, projectRoot) {
|
|
71
71
|
const getNodes = (graph) => {
|
|
72
72
|
let nodes = {};
|
|
73
73
|
// @ts-expect-error implicit any
|
|
@@ -76,11 +76,13 @@ function assetGraphDiff(jsAssetGraph, rustAssetGraph) {
|
|
|
76
76
|
if (!node)
|
|
77
77
|
return;
|
|
78
78
|
if (node.type === 'dependency') {
|
|
79
|
-
let sourcePath = node.value.sourcePath
|
|
80
|
-
|
|
79
|
+
let sourcePath = node.value.sourcePath
|
|
80
|
+
? (0, projectPath_1.toProjectPath)(projectRoot, node.value.sourcePath)
|
|
81
|
+
: (0, projectPath_1.toProjectPath)(projectRoot, 'entry');
|
|
82
|
+
nodes[`dep:${sourcePath}:${node.value.specifier}`] = filterNode(node);
|
|
81
83
|
}
|
|
82
84
|
else if (node.type === 'asset') {
|
|
83
|
-
nodes[`asset:${(0, projectPath_1.
|
|
85
|
+
nodes[`asset:${(0, projectPath_1.toProjectPath)(projectRoot, node.value.filePath)}`] =
|
|
84
86
|
filterNode(node);
|
|
85
87
|
}
|
|
86
88
|
});
|
package/lib/CommittedAsset.js
CHANGED
package/lib/UncommittedAsset.js
CHANGED
|
@@ -365,14 +365,5 @@ class UncommittedAsset {
|
|
|
365
365
|
// @ts-expect-error TS2345
|
|
366
366
|
this.value.id = (0, _assetUtils.createAssetIdFromOptions)(this.value);
|
|
367
367
|
}
|
|
368
|
-
setCompiledCssStyles(styles) {
|
|
369
|
-
if (styles.length > 0) {
|
|
370
|
-
console.log('setCompiledCssStyles', styles);
|
|
371
|
-
}
|
|
372
|
-
this.value.compiledCssStyles = styles;
|
|
373
|
-
}
|
|
374
|
-
getCompiledCssStyles() {
|
|
375
|
-
return this.value.compiledCssStyles;
|
|
376
|
-
}
|
|
377
368
|
}
|
|
378
369
|
exports.default = UncommittedAsset;
|
|
@@ -59,7 +59,6 @@ class MutableAsset {
|
|
|
59
59
|
this.symbols = new _assetSymbols.MutableAssetSymbols(asset.symbols);
|
|
60
60
|
this.type = asset.type;
|
|
61
61
|
this.uniqueKey = asset.uniqueKey;
|
|
62
|
-
this.compiledCssStyles = asset.compiledCssStyles;
|
|
63
62
|
this.#astDirty = false;
|
|
64
63
|
this.#contents = contents;
|
|
65
64
|
this.#inner = asset;
|
|
@@ -166,8 +165,5 @@ class MutableAsset {
|
|
|
166
165
|
invalidateOnBuild() {
|
|
167
166
|
// TODO: Forward invalidations to Rust
|
|
168
167
|
}
|
|
169
|
-
setCompiledCssStyles(styles) {
|
|
170
|
-
this.compiledCssStyles = styles;
|
|
171
|
-
}
|
|
172
168
|
}
|
|
173
169
|
exports.MutableAsset = MutableAsset;
|
package/lib/loadDotEnv.js
CHANGED
|
@@ -26,6 +26,8 @@ function _dotenvExpand() {
|
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
+
// @ts-expect-error TS7016
|
|
30
|
+
|
|
29
31
|
async function loadEnv(env, fs, filePath, projectRoot) {
|
|
30
32
|
const NODE_ENV = env.NODE_ENV ?? 'development';
|
|
31
33
|
const dotenvFiles = ['.env',
|
package/lib/public/Asset.js
CHANGED
|
@@ -124,9 +124,6 @@ class BaseAsset {
|
|
|
124
124
|
getMapBuffer() {
|
|
125
125
|
return this.#asset.getMapBuffer();
|
|
126
126
|
}
|
|
127
|
-
getCompiledCssStyles() {
|
|
128
|
-
return this.#asset.getCompiledCssStyles();
|
|
129
|
-
}
|
|
130
127
|
}
|
|
131
128
|
class Asset extends BaseAsset {
|
|
132
129
|
// @ts-expect-error TS2564
|
|
@@ -268,8 +265,5 @@ class MutableAsset extends BaseAsset {
|
|
|
268
265
|
});
|
|
269
266
|
this.#asset.updateId();
|
|
270
267
|
}
|
|
271
|
-
setCompiledCssStyles(styles) {
|
|
272
|
-
this.#asset.setCompiledCssStyles(styles);
|
|
273
|
-
}
|
|
274
268
|
}
|
|
275
269
|
exports.MutableAsset = MutableAsset;
|
|
@@ -170,8 +170,10 @@ function getAssetGraph(serializedGraph) {
|
|
|
170
170
|
value: asset
|
|
171
171
|
});
|
|
172
172
|
} else if (node.type === 'dependency') {
|
|
173
|
-
let
|
|
174
|
-
|
|
173
|
+
let {
|
|
174
|
+
dependency,
|
|
175
|
+
id
|
|
176
|
+
} = node.value;
|
|
175
177
|
dependency.id = id;
|
|
176
178
|
dependency.env.id = (0, _featureFlags().getFeatureFlag)('environmentDeduplication') ?
|
|
177
179
|
// TODO: Rust can do this and avoid copying a significant amount of data over
|
|
@@ -161,13 +161,33 @@ async function resolveAtlaspackConfig(options) {
|
|
|
161
161
|
extendedFiles
|
|
162
162
|
} = await parseAndProcessConfig(configPath, contents, options);
|
|
163
163
|
if (options.additionalReporters.length > 0) {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
164
|
+
if (options.featureFlags.deduplicateReporters) {
|
|
165
|
+
var _config$reporters;
|
|
166
|
+
const reporterMap = new Map();
|
|
167
|
+
options.additionalReporters.forEach(({
|
|
168
|
+
packageName,
|
|
169
|
+
resolveFrom
|
|
170
|
+
}) => {
|
|
171
|
+
reporterMap.set(packageName, {
|
|
172
|
+
packageName,
|
|
173
|
+
resolveFrom
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
(_config$reporters = config.reporters) === null || _config$reporters === void 0 || _config$reporters.forEach(reporter => {
|
|
177
|
+
if (!reporterMap.has(reporter.packageName)) {
|
|
178
|
+
reporterMap.set(reporter.packageName, reporter);
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
config.reporters = Array.from(reporterMap.values());
|
|
182
|
+
} else {
|
|
183
|
+
config.reporters = [...options.additionalReporters.map(({
|
|
184
|
+
packageName,
|
|
185
|
+
resolveFrom
|
|
186
|
+
}) => ({
|
|
187
|
+
packageName,
|
|
188
|
+
resolveFrom
|
|
189
|
+
})), ...(config.reporters ?? [])];
|
|
190
|
+
}
|
|
171
191
|
}
|
|
172
192
|
return {
|
|
173
193
|
config,
|
|
@@ -178,7 +178,11 @@ function createBundleGraphRequest(input) {
|
|
|
178
178
|
// force: true,
|
|
179
179
|
// },
|
|
180
180
|
// );
|
|
181
|
-
// require('./asset-graph-diff.
|
|
181
|
+
// require('./asset-graph-diff.ts')(
|
|
182
|
+
// jsAssetGraph,
|
|
183
|
+
// assetGraph,
|
|
184
|
+
// options.projectRoot,
|
|
185
|
+
// );
|
|
182
186
|
// }
|
|
183
187
|
|
|
184
188
|
measurement && measurement.end();
|
|
@@ -830,7 +830,8 @@ class TargetResolver {
|
|
|
830
830
|
// Libraries are not optimized by default, users must explicitly configure this.
|
|
831
831
|
isLibrary ? descriptor.optimize === true : descriptor.optimize !== false),
|
|
832
832
|
shouldScopeHoist: shouldScopeHoist && descriptor.scopeHoist !== false,
|
|
833
|
-
sourceMap: normalizeSourceMap(this.options, descriptor.sourceMap)
|
|
833
|
+
sourceMap: normalizeSourceMap(this.options, descriptor.sourceMap),
|
|
834
|
+
customEnv: descriptor.env
|
|
834
835
|
}),
|
|
835
836
|
loc: (0, _utils2.toInternalSourceLocation)(this.options.projectRoot, loc)
|
|
836
837
|
});
|
|
@@ -77,7 +77,7 @@ function compactDeep(obj, ignoredPatterns = [], currentPath = '$') {
|
|
|
77
77
|
return obj;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
function assetGraphDiff(jsAssetGraph, rustAssetGraph) {
|
|
80
|
+
function assetGraphDiff(jsAssetGraph, rustAssetGraph, projectRoot) {
|
|
81
81
|
const getNodes = graph => {
|
|
82
82
|
let nodes = {};
|
|
83
83
|
|
|
@@ -86,10 +86,10 @@ function assetGraphDiff(jsAssetGraph, rustAssetGraph) {
|
|
|
86
86
|
let node = graph.getNode(nodeId) ?? null;
|
|
87
87
|
if (!node) return;
|
|
88
88
|
if (node.type === 'dependency') {
|
|
89
|
-
let sourcePath = node.value.sourcePath
|
|
90
|
-
nodes[`dep:${
|
|
89
|
+
let sourcePath = node.value.sourcePath ? (0, _projectPath.toProjectPath)(projectRoot, node.value.sourcePath) : (0, _projectPath.toProjectPath)(projectRoot, 'entry');
|
|
90
|
+
nodes[`dep:${sourcePath}:${node.value.specifier}`] = filterNode(node);
|
|
91
91
|
} else if (node.type === 'asset') {
|
|
92
|
-
nodes[`asset:${(0, _projectPath.
|
|
92
|
+
nodes[`asset:${(0, _projectPath.toProjectPath)(projectRoot, node.value.filePath)}`] = filterNode(node);
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
95
|
return nodes;
|
|
@@ -57,7 +57,5 @@ export default class UncommittedAsset {
|
|
|
57
57
|
getDependencies(): Array<Dependency>;
|
|
58
58
|
createChildAsset(result: TransformerResult, plugin: PackageName, configPath: ProjectPath, configKeyPath?: string): UncommittedAsset;
|
|
59
59
|
updateId(): void;
|
|
60
|
-
setCompiledCssStyles(styles: string[]): void;
|
|
61
|
-
getCompiledCssStyles(): ReadonlyArray<string> | undefined;
|
|
62
60
|
}
|
|
63
61
|
export {};
|
|
@@ -22,7 +22,6 @@ export declare class MutableAsset implements IMutableAsset {
|
|
|
22
22
|
symbols: MutableAssetSymbols;
|
|
23
23
|
type: string;
|
|
24
24
|
uniqueKey: string | null | undefined;
|
|
25
|
-
compiledCssStyles?: string[];
|
|
26
25
|
get astGenerator(): ASTGenerator | null | undefined;
|
|
27
26
|
set astGenerator(value?: ASTGenerator | null);
|
|
28
27
|
constructor(asset: InnerAsset, contents: Buffer, env: Environment, fs: FileSystem, map: string | null | undefined, projectRoot: string);
|
|
@@ -47,5 +46,4 @@ export declare class MutableAsset implements IMutableAsset {
|
|
|
47
46
|
invalidateOnEnvChange(invalidation: string): void;
|
|
48
47
|
invalidateOnStartup(): void;
|
|
49
48
|
invalidateOnBuild(): void;
|
|
50
|
-
setCompiledCssStyles(styles: string[]): void;
|
|
51
49
|
}
|
|
@@ -35,7 +35,6 @@ declare class BaseAsset {
|
|
|
35
35
|
getMap(): Promise<SourceMap | null | undefined>;
|
|
36
36
|
getAST(): Promise<AST | null | undefined>;
|
|
37
37
|
getMapBuffer(): Promise<Buffer | null | undefined>;
|
|
38
|
-
getCompiledCssStyles(): ReadonlyArray<string> | undefined;
|
|
39
38
|
}
|
|
40
39
|
export declare class Asset extends BaseAsset implements IAsset {
|
|
41
40
|
#private;
|
|
@@ -71,6 +70,5 @@ export declare class MutableAsset extends BaseAsset implements IMutableAsset {
|
|
|
71
70
|
setAST(ast: AST): void;
|
|
72
71
|
addURLDependency(url: string, opts: Partial<DependencyOptions>): string;
|
|
73
72
|
setEnvironment(env: EnvironmentOptions): void;
|
|
74
|
-
setCompiledCssStyles(styles: string[]): void;
|
|
75
73
|
}
|
|
76
74
|
export {};
|
package/lib/types/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.26.1-dev-yarn-8750a7d2e.0",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -22,21 +22,21 @@
|
|
|
22
22
|
"build:lib": "gulp build --gulpfile ../../../gulpfile.js --cwd ."
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@atlaspack/build-cache": "2.13.7-dev-
|
|
26
|
-
"@atlaspack/cache": "3.2.
|
|
27
|
-
"@atlaspack/diagnostic": "2.14.5-dev-
|
|
28
|
-
"@atlaspack/events": "2.14.5-dev-
|
|
29
|
-
"@atlaspack/feature-flags": "2.25.
|
|
30
|
-
"@atlaspack/fs": "2.15.
|
|
31
|
-
"@atlaspack/graph": "3.5.
|
|
32
|
-
"@atlaspack/logger": "2.14.
|
|
33
|
-
"@atlaspack/package-manager": "2.14.
|
|
34
|
-
"@atlaspack/plugin": "2.14.
|
|
35
|
-
"@atlaspack/profiler": "2.14.
|
|
36
|
-
"@atlaspack/rust": "3.8.
|
|
37
|
-
"@atlaspack/types": "2.15.
|
|
38
|
-
"@atlaspack/utils": "3.0.
|
|
39
|
-
"@atlaspack/workers": "2.14.
|
|
25
|
+
"@atlaspack/build-cache": "2.13.7-dev-yarn-8750a7d2e.0",
|
|
26
|
+
"@atlaspack/cache": "3.2.31-dev-yarn-8750a7d2e.0",
|
|
27
|
+
"@atlaspack/diagnostic": "2.14.5-dev-yarn-8750a7d2e.0",
|
|
28
|
+
"@atlaspack/events": "2.14.5-dev-yarn-8750a7d2e.0",
|
|
29
|
+
"@atlaspack/feature-flags": "2.25.6-dev-yarn-8750a7d2e.0",
|
|
30
|
+
"@atlaspack/fs": "2.15.31-dev-yarn-8750a7d2e.0",
|
|
31
|
+
"@atlaspack/graph": "3.5.25-dev-yarn-8750a7d2e.0",
|
|
32
|
+
"@atlaspack/logger": "2.14.28-dev-yarn-8750a7d2e.0",
|
|
33
|
+
"@atlaspack/package-manager": "2.14.36-dev-yarn-8750a7d2e.0",
|
|
34
|
+
"@atlaspack/plugin": "2.14.36-dev-yarn-8750a7d2e.0",
|
|
35
|
+
"@atlaspack/profiler": "2.14.33-dev-yarn-8750a7d2e.0",
|
|
36
|
+
"@atlaspack/rust": "3.8.4-dev-yarn-8750a7d2e.0",
|
|
37
|
+
"@atlaspack/types": "2.15.26-dev-yarn-8750a7d2e.0",
|
|
38
|
+
"@atlaspack/utils": "3.0.4-dev-yarn-8750a7d2e.0",
|
|
39
|
+
"@atlaspack/workers": "2.14.36-dev-yarn-8750a7d2e.0",
|
|
40
40
|
"@mischnic/json-sourcemap": "^0.1.0",
|
|
41
41
|
"@parcel/source-map": "^2.1.1",
|
|
42
42
|
"base-x": "^3.0.8",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"semver": "^7.5.2"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@atlaspack/babel-register": "2.14.5-dev-
|
|
53
|
+
"@atlaspack/babel-register": "2.14.5-dev-yarn-8750a7d2e.0",
|
|
54
54
|
"@types/node": ">= 18",
|
|
55
55
|
"graphviz": "^0.0.9",
|
|
56
56
|
"jest-diff": "*",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"./src/serializerCore.js": "./src/serializerCore.browser.js"
|
|
62
62
|
},
|
|
63
63
|
"type": "commonjs",
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "8750a7d2e6330244dd618c28a20d5a391080e4a3"
|
|
65
65
|
}
|
package/src/CommittedAsset.ts
CHANGED
|
@@ -162,8 +162,4 @@ export default class CommittedAsset {
|
|
|
162
162
|
getDependencies(): Array<Dependency> {
|
|
163
163
|
return Array.from(this.value.dependencies.values());
|
|
164
164
|
}
|
|
165
|
-
|
|
166
|
-
getCompiledCssStyles(): ReadonlyArray<string> | undefined {
|
|
167
|
-
return this.value.compiledCssStyles;
|
|
168
|
-
}
|
|
169
165
|
}
|
package/src/UncommittedAsset.ts
CHANGED
|
@@ -444,15 +444,4 @@ export default class UncommittedAsset {
|
|
|
444
444
|
// @ts-expect-error TS2345
|
|
445
445
|
this.value.id = createAssetIdFromOptions(this.value);
|
|
446
446
|
}
|
|
447
|
-
|
|
448
|
-
setCompiledCssStyles(styles: string[]): void {
|
|
449
|
-
if (styles.length > 0) {
|
|
450
|
-
console.log('setCompiledCssStyles', styles);
|
|
451
|
-
}
|
|
452
|
-
this.value.compiledCssStyles = styles;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
getCompiledCssStyles(): ReadonlyArray<string> | undefined {
|
|
456
|
-
return this.value.compiledCssStyles;
|
|
457
|
-
}
|
|
458
447
|
}
|
|
@@ -41,7 +41,6 @@ export class MutableAsset implements IMutableAsset {
|
|
|
41
41
|
symbols: MutableAssetSymbols;
|
|
42
42
|
type: string;
|
|
43
43
|
uniqueKey: string | null | undefined;
|
|
44
|
-
compiledCssStyles?: string[];
|
|
45
44
|
|
|
46
45
|
#astDirty: boolean;
|
|
47
46
|
#ast: AST | null | undefined;
|
|
@@ -83,7 +82,6 @@ export class MutableAsset implements IMutableAsset {
|
|
|
83
82
|
this.symbols = new MutableAssetSymbols(asset.symbols);
|
|
84
83
|
this.type = asset.type;
|
|
85
84
|
this.uniqueKey = asset.uniqueKey;
|
|
86
|
-
this.compiledCssStyles = asset.compiledCssStyles;
|
|
87
85
|
|
|
88
86
|
this.#astDirty = false;
|
|
89
87
|
this.#contents = contents;
|
|
@@ -208,8 +206,4 @@ export class MutableAsset implements IMutableAsset {
|
|
|
208
206
|
invalidateOnBuild(): void {
|
|
209
207
|
// TODO: Forward invalidations to Rust
|
|
210
208
|
}
|
|
211
|
-
|
|
212
|
-
setCompiledCssStyles(styles: string[]): void {
|
|
213
|
-
this.compiledCssStyles = styles;
|
|
214
|
-
}
|
|
215
209
|
}
|
package/src/loadDotEnv.ts
CHANGED
package/src/public/Asset.ts
CHANGED
|
@@ -190,10 +190,6 @@ class BaseAsset {
|
|
|
190
190
|
getMapBuffer(): Promise<Buffer | null | undefined> {
|
|
191
191
|
return this.#asset.getMapBuffer();
|
|
192
192
|
}
|
|
193
|
-
|
|
194
|
-
getCompiledCssStyles(): ReadonlyArray<string> | undefined {
|
|
195
|
-
return this.#asset.getCompiledCssStyles();
|
|
196
|
-
}
|
|
197
193
|
}
|
|
198
194
|
|
|
199
195
|
export class Asset extends BaseAsset implements IAsset {
|
|
@@ -373,8 +369,4 @@ export class MutableAsset extends BaseAsset implements IMutableAsset {
|
|
|
373
369
|
});
|
|
374
370
|
this.#asset.updateId();
|
|
375
371
|
}
|
|
376
|
-
|
|
377
|
-
setCompiledCssStyles(styles: string[]): void {
|
|
378
|
-
this.#asset.setCompiledCssStyles(styles);
|
|
379
|
-
}
|
|
380
372
|
}
|
|
@@ -193,8 +193,7 @@ export function getAssetGraph(serializedGraph: any): {
|
|
|
193
193
|
value: asset,
|
|
194
194
|
});
|
|
195
195
|
} else if (node.type === 'dependency') {
|
|
196
|
-
let id = node.value
|
|
197
|
-
let dependency = node.value.dependency;
|
|
196
|
+
let {dependency, id} = node.value;
|
|
198
197
|
|
|
199
198
|
dependency.id = id;
|
|
200
199
|
dependency.env.id = getFeatureFlag('environmentDeduplication')
|