@atlaspack/core 2.25.2-dev-9dac9ed3a.0 → 2.25.2-dev-swc-4fc8a99f4.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/dist/Atlaspack.js +1 -1
- package/dist/CommittedAsset.js +1 -1
- package/dist/Transformation.js +2 -3
- package/dist/UncommittedAsset.js +3 -3
- package/dist/assetUtils.js +1 -2
- package/dist/atlaspack-v3/worker/compat/mutable-asset.js +1 -1
- package/dist/requests/BundleGraphRequest.js +5 -1
- package/dist/requests/asset-graph-diff.js +6 -5
- package/dist/worker.js +1 -1
- package/lib/Atlaspack.js +1 -1
- package/lib/CommittedAsset.js +1 -1
- package/lib/Transformation.js +4 -9
- package/lib/UncommittedAsset.js +3 -3
- package/lib/assetUtils.js +1 -8
- package/lib/atlaspack-v3/worker/compat/mutable-asset.js +1 -1
- package/lib/requests/BundleGraphRequest.js +5 -1
- package/lib/requests/asset-graph-diff.js +4 -4
- package/lib/types/CommittedAsset.d.ts +1 -1
- package/lib/types/PackagerRunner.d.ts +1 -1
- package/lib/types/UncommittedAsset.d.ts +1 -1
- package/lib/types/atlaspack-v3/worker/compat/mutable-asset.d.ts +1 -1
- package/lib/types/public/Asset.d.ts +1 -1
- package/lib/worker.js +1 -1
- package/package.json +19 -19
- package/src/Atlaspack.ts +1 -1
- package/src/CommittedAsset.ts +1 -1
- package/src/PackagerRunner.ts +1 -1
- package/src/Transformation.ts +2 -3
- package/src/UncommittedAsset.ts +3 -3
- package/src/assetUtils.ts +1 -2
- package/src/atlaspack-v3/worker/compat/mutable-asset.ts +1 -1
- package/src/public/Asset.ts +1 -1
- package/src/requests/BundleGraphRequest.ts +5 -1
- package/src/requests/asset-graph-diff.ts +10 -7
- package/src/worker.ts +1 -1
- package/tsconfig.json +0 -3
- package/tsconfig.tsbuildinfo +1 -1
package/dist/Atlaspack.js
CHANGED
|
@@ -76,7 +76,7 @@ const PathRequest_1 = __importDefault(require("./requests/PathRequest"));
|
|
|
76
76
|
const Environment_1 = require("./Environment");
|
|
77
77
|
const Dependency_1 = require("./Dependency");
|
|
78
78
|
const events_2 = require("@atlaspack/events");
|
|
79
|
-
const source_map_1 = require("@
|
|
79
|
+
const source_map_1 = require("@parcel/source-map");
|
|
80
80
|
const cache_1 = require("@atlaspack/cache");
|
|
81
81
|
const rust_1 = require("@atlaspack/rust");
|
|
82
82
|
const projectPath_1 = require("./projectPath");
|
package/dist/CommittedAsset.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const stream_1 = require("stream");
|
|
7
7
|
const build_cache_1 = require("@atlaspack/build-cache");
|
|
8
8
|
const utils_1 = require("@atlaspack/utils");
|
|
9
|
-
const source_map_1 = __importDefault(require("@
|
|
9
|
+
const source_map_1 = __importDefault(require("@parcel/source-map"));
|
|
10
10
|
const assetUtils_1 = require("./assetUtils");
|
|
11
11
|
class CommittedAsset {
|
|
12
12
|
constructor(value, options) {
|
package/dist/Transformation.js
CHANGED
|
@@ -58,7 +58,6 @@ const projectPath_1 = require("./projectPath");
|
|
|
58
58
|
const utils_3 = require("./utils");
|
|
59
59
|
const assert_1 = __importDefault(require("assert"));
|
|
60
60
|
const profiler_1 = require("@atlaspack/profiler");
|
|
61
|
-
const source_map_1 = __importDefault(require("@atlaspack/source-map"));
|
|
62
61
|
const feature_flags_1 = require("@atlaspack/feature-flags");
|
|
63
62
|
class Transformation {
|
|
64
63
|
constructor({ request, options, config, workerApi }) {
|
|
@@ -317,7 +316,7 @@ class Transformation {
|
|
|
317
316
|
if (asset.isASTDirty && asset.generate) {
|
|
318
317
|
let output = await asset.generate();
|
|
319
318
|
asset.content = output.content;
|
|
320
|
-
asset.mapBuffer =
|
|
319
|
+
asset.mapBuffer = output.map?.toBuffer();
|
|
321
320
|
}
|
|
322
321
|
asset.clearAST();
|
|
323
322
|
}));
|
|
@@ -416,7 +415,7 @@ class Transformation {
|
|
|
416
415
|
asset.generate) {
|
|
417
416
|
let output = await asset.generate();
|
|
418
417
|
asset.content = output.content;
|
|
419
|
-
asset.mapBuffer =
|
|
418
|
+
asset.mapBuffer = output.map?.toBuffer();
|
|
420
419
|
}
|
|
421
420
|
// Load config for the transformer.
|
|
422
421
|
let config = preloadedConfig;
|
package/dist/UncommittedAsset.js
CHANGED
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const assert_1 = __importDefault(require("assert"));
|
|
7
7
|
const stream_1 = require("stream");
|
|
8
|
-
const source_map_1 = __importDefault(require("@
|
|
8
|
+
const source_map_1 = __importDefault(require("@parcel/source-map"));
|
|
9
9
|
const build_cache_1 = require("@atlaspack/build-cache");
|
|
10
10
|
const utils_1 = require("@atlaspack/utils");
|
|
11
11
|
const rust_1 = require("@atlaspack/rust");
|
|
@@ -163,7 +163,7 @@ class UncommittedAsset {
|
|
|
163
163
|
});
|
|
164
164
|
if (map) {
|
|
165
165
|
this.map = map;
|
|
166
|
-
this.mapBuffer =
|
|
166
|
+
this.mapBuffer = map.toBuffer();
|
|
167
167
|
this.setCode(code.replace(utils_1.SOURCEMAP_RE, ''));
|
|
168
168
|
}
|
|
169
169
|
return this.map;
|
|
@@ -295,7 +295,7 @@ class UncommittedAsset {
|
|
|
295
295
|
content,
|
|
296
296
|
ast: result.ast,
|
|
297
297
|
isASTDirty: result.ast === this.ast ? this.isASTDirty : true,
|
|
298
|
-
mapBuffer:
|
|
298
|
+
mapBuffer: result.map ? result.map.toBuffer() : null,
|
|
299
299
|
code: this.code,
|
|
300
300
|
invalidations: this.invalidations,
|
|
301
301
|
});
|
package/dist/assetUtils.js
CHANGED
|
@@ -23,7 +23,6 @@ const types_1 = require("./types");
|
|
|
23
23
|
const profiler_1 = require("@atlaspack/profiler");
|
|
24
24
|
const IdentifierRegistry_1 = require("./IdentifierRegistry");
|
|
25
25
|
const EnvironmentManager_1 = require("./EnvironmentManager");
|
|
26
|
-
const source_map_1 = __importDefault(require("@atlaspack/source-map"));
|
|
27
26
|
function createAssetIdFromOptions(options) {
|
|
28
27
|
const data = {
|
|
29
28
|
environmentId: (0, EnvironmentManager_1.toEnvironmentId)(options.env),
|
|
@@ -103,7 +102,7 @@ async function _generateFromAST(asset) {
|
|
|
103
102
|
logger: new logger_1.PluginLogger({ origin: pluginName }),
|
|
104
103
|
tracer: new profiler_1.PluginTracer({ origin: pluginName, category: 'asset-generate' }),
|
|
105
104
|
});
|
|
106
|
-
let mapBuffer =
|
|
105
|
+
let mapBuffer = map?.toBuffer();
|
|
107
106
|
// Store the results in the cache so we can avoid generating again next time
|
|
108
107
|
await Promise.all([
|
|
109
108
|
asset.options.cache.setStream((0, nullthrows_1.default)(asset.value.contentKey), (0, utils_1.blobToStream)(content)),
|
|
@@ -16,7 +16,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
var _MutableAsset_astDirty, _MutableAsset_ast, _MutableAsset_contents, _MutableAsset_inner, _MutableAsset_map, _MutableAsset_projectRoot, _MutableAsset_sourceMap;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.MutableAsset = void 0;
|
|
19
|
-
const source_map_1 = __importDefault(require("@
|
|
19
|
+
const source_map_1 = __importDefault(require("@parcel/source-map"));
|
|
20
20
|
const stream_1 = require("stream");
|
|
21
21
|
const bitflags_1 = require("./bitflags");
|
|
22
22
|
const asset_symbols_1 = require("./asset-symbols");
|
|
@@ -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);
|
|
@@ -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,12 +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)(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.
|
|
84
|
-
filterNode(node);
|
|
85
|
+
nodes[`asset:${(0, projectPath_1.toProjectPath)(node.value.filePath)}`] = filterNode(node);
|
|
85
86
|
}
|
|
86
87
|
});
|
|
87
88
|
return nodes;
|
package/dist/worker.js
CHANGED
|
@@ -21,7 +21,7 @@ const Validation_1 = __importDefault(require("./Validation"));
|
|
|
21
21
|
const AtlaspackConfig_1 = require("./AtlaspackConfig");
|
|
22
22
|
const registerCoreWithSerializer_1 = require("./registerCoreWithSerializer");
|
|
23
23
|
const build_cache_1 = require("@atlaspack/build-cache");
|
|
24
|
-
const source_map_1 = require("@
|
|
24
|
+
const source_map_1 = require("@parcel/source-map");
|
|
25
25
|
// @ts-expect-error TS2305
|
|
26
26
|
const rust_1 = require("@atlaspack/rust");
|
|
27
27
|
const workers_1 = __importDefault(require("@atlaspack/workers"));
|
package/lib/Atlaspack.js
CHANGED
|
@@ -80,7 +80,7 @@ var _PathRequest = _interopRequireDefault(require("./requests/PathRequest"));
|
|
|
80
80
|
var _Environment = require("./Environment");
|
|
81
81
|
var _Dependency = require("./Dependency");
|
|
82
82
|
function _sourceMap() {
|
|
83
|
-
const data = require("@
|
|
83
|
+
const data = require("@parcel/source-map");
|
|
84
84
|
_sourceMap = function () {
|
|
85
85
|
return data;
|
|
86
86
|
};
|
package/lib/CommittedAsset.js
CHANGED
|
@@ -26,7 +26,7 @@ function _utils() {
|
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
28
|
function _sourceMap() {
|
|
29
|
-
const data = _interopRequireDefault(require("@
|
|
29
|
+
const data = _interopRequireDefault(require("@parcel/source-map"));
|
|
30
30
|
_sourceMap = function () {
|
|
31
31
|
return data;
|
|
32
32
|
};
|
package/lib/Transformation.js
CHANGED
|
@@ -72,13 +72,6 @@ function _profiler() {
|
|
|
72
72
|
};
|
|
73
73
|
return data;
|
|
74
74
|
}
|
|
75
|
-
function _sourceMap() {
|
|
76
|
-
const data = _interopRequireDefault(require("@atlaspack/source-map"));
|
|
77
|
-
_sourceMap = function () {
|
|
78
|
-
return data;
|
|
79
|
-
};
|
|
80
|
-
return data;
|
|
81
|
-
}
|
|
82
75
|
function _featureFlags() {
|
|
83
76
|
const data = require("@atlaspack/feature-flags");
|
|
84
77
|
_featureFlags = function () {
|
|
@@ -350,9 +343,10 @@ class Transformation {
|
|
|
350
343
|
// generate all assets in a large bundle during packaging.
|
|
351
344
|
await Promise.all(resultingAssets.filter(asset => asset.ast != null && !(this.options.mode === 'production' && asset.value.type === 'css' && asset.value.symbols)).map(async asset => {
|
|
352
345
|
if (asset.isASTDirty && asset.generate) {
|
|
346
|
+
var _output$map;
|
|
353
347
|
let output = await asset.generate();
|
|
354
348
|
asset.content = output.content;
|
|
355
|
-
asset.mapBuffer =
|
|
349
|
+
asset.mapBuffer = (_output$map = output.map) === null || _output$map === void 0 ? void 0 : _output$map.toBuffer();
|
|
356
350
|
}
|
|
357
351
|
asset.clearAST();
|
|
358
352
|
}));
|
|
@@ -459,9 +453,10 @@ class Transformation {
|
|
|
459
453
|
logger,
|
|
460
454
|
tracer
|
|
461
455
|
})) && asset.generate) {
|
|
456
|
+
var _output$map2;
|
|
462
457
|
let output = await asset.generate();
|
|
463
458
|
asset.content = output.content;
|
|
464
|
-
asset.mapBuffer =
|
|
459
|
+
asset.mapBuffer = (_output$map2 = output.map) === null || _output$map2 === void 0 ? void 0 : _output$map2.toBuffer();
|
|
465
460
|
}
|
|
466
461
|
|
|
467
462
|
// Load config for the transformer.
|
package/lib/UncommittedAsset.js
CHANGED
|
@@ -19,7 +19,7 @@ function _stream() {
|
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
21
|
function _sourceMap() {
|
|
22
|
-
const data = _interopRequireDefault(require("@
|
|
22
|
+
const data = _interopRequireDefault(require("@parcel/source-map"));
|
|
23
23
|
_sourceMap = function () {
|
|
24
24
|
return data;
|
|
25
25
|
};
|
|
@@ -218,7 +218,7 @@ class UncommittedAsset {
|
|
|
218
218
|
});
|
|
219
219
|
if (map) {
|
|
220
220
|
this.map = map;
|
|
221
|
-
this.mapBuffer =
|
|
221
|
+
this.mapBuffer = map.toBuffer();
|
|
222
222
|
this.setCode(code.replace(_utils().SOURCEMAP_RE, ''));
|
|
223
223
|
}
|
|
224
224
|
return this.map;
|
|
@@ -349,7 +349,7 @@ class UncommittedAsset {
|
|
|
349
349
|
content,
|
|
350
350
|
ast: result.ast,
|
|
351
351
|
isASTDirty: result.ast === this.ast ? this.isASTDirty : true,
|
|
352
|
-
mapBuffer:
|
|
352
|
+
mapBuffer: result.map ? result.map.toBuffer() : null,
|
|
353
353
|
code: this.code,
|
|
354
354
|
invalidations: this.invalidations
|
|
355
355
|
});
|
package/lib/assetUtils.js
CHANGED
|
@@ -65,13 +65,6 @@ function _profiler() {
|
|
|
65
65
|
}
|
|
66
66
|
var _IdentifierRegistry = require("./IdentifierRegistry");
|
|
67
67
|
var _EnvironmentManager = require("./EnvironmentManager");
|
|
68
|
-
function _sourceMap() {
|
|
69
|
-
const data = _interopRequireDefault(require("@atlaspack/source-map"));
|
|
70
|
-
_sourceMap = function () {
|
|
71
|
-
return data;
|
|
72
|
-
};
|
|
73
|
-
return data;
|
|
74
|
-
}
|
|
75
68
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
76
69
|
function createAssetIdFromOptions(options) {
|
|
77
70
|
const data = {
|
|
@@ -157,7 +150,7 @@ async function _generateFromAST(asset) {
|
|
|
157
150
|
category: 'asset-generate'
|
|
158
151
|
})
|
|
159
152
|
});
|
|
160
|
-
let mapBuffer =
|
|
153
|
+
let mapBuffer = map === null || map === void 0 ? void 0 : map.toBuffer();
|
|
161
154
|
// Store the results in the cache so we can avoid generating again next time
|
|
162
155
|
await Promise.all([asset.options.cache.setStream((0, _nullthrows().default)(asset.value.contentKey), (0, _utils().blobToStream)(content)), mapBuffer != null && asset.options.cache.setBlob((0, _nullthrows().default)(asset.value.mapKey), mapBuffer)]);
|
|
163
156
|
return {
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.MutableAsset = void 0;
|
|
7
7
|
function _sourceMap() {
|
|
8
|
-
const data = _interopRequireDefault(require("@
|
|
8
|
+
const data = _interopRequireDefault(require("@parcel/source-map"));
|
|
9
9
|
_sourceMap = function () {
|
|
10
10
|
return data;
|
|
11
11
|
};
|
|
@@ -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();
|
|
@@ -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)(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)(node.value.filePath)}`] = filterNode(node);
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
95
|
return nodes;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Readable } from 'stream';
|
|
2
2
|
import type { AST, Blob } from '@atlaspack/types';
|
|
3
|
-
import SourceMap from '@
|
|
3
|
+
import SourceMap from '@parcel/source-map';
|
|
4
4
|
import type { Asset, Dependency, AtlaspackOptions } from './types';
|
|
5
5
|
export default class CommittedAsset {
|
|
6
6
|
key: string | null | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Blob, FilePath, BundleResult, Async } from '@atlaspack/types';
|
|
2
|
-
import type SourceMap from '@
|
|
2
|
+
import type SourceMap from '@parcel/source-map';
|
|
3
3
|
import type { Bundle as InternalBundle, Config, DevDepRequest, AtlaspackOptions, ReportFn, RequestInvalidation, DevDepRequestRef } from './types';
|
|
4
4
|
import type { AtlaspackConfig, LoadedPlugin } from './AtlaspackConfig';
|
|
5
5
|
import type InternalBundleGraph from './BundleGraph';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AST, Blob, DependencyOptions, FileCreateInvalidation, GenerateOutput, PackageName, TransformerResult } from '@atlaspack/types';
|
|
2
2
|
import type { Asset, Dependency, AtlaspackOptions, Invalidations } from './types';
|
|
3
3
|
import { Readable } from 'stream';
|
|
4
|
-
import SourceMap from '@
|
|
4
|
+
import SourceMap from '@parcel/source-map';
|
|
5
5
|
import { ProjectPath } from './projectPath';
|
|
6
6
|
type UncommittedAssetOptions = {
|
|
7
7
|
value: Asset;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import SourceMap from '@
|
|
1
|
+
import SourceMap from '@parcel/source-map';
|
|
2
2
|
import * as napi from '@atlaspack/rust';
|
|
3
3
|
import { Readable } from 'stream';
|
|
4
4
|
import type { MutableAsset as IMutableAsset, Stats, FileSystem, FilePath, Environment, Meta, BundleBehavior, ASTGenerator, AST, Dependency, DependencyOptions, FileCreateInvalidation, EnvironmentOptions } from '@atlaspack/types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type SourceMap from '@
|
|
1
|
+
import type SourceMap from '@parcel/source-map';
|
|
2
2
|
import type { Readable } from 'stream';
|
|
3
3
|
import type { FileSystem } from '@atlaspack/fs';
|
|
4
4
|
import type { Asset as IAsset, AST, ASTGenerator, Dependency as IDependency, DependencyOptions, Environment as IEnvironment, EnvironmentOptions, FileCreateInvalidation, FilePath, Meta, MutableAsset as IMutableAsset, Stats, MutableAssetSymbols as IMutableAssetSymbols, AssetSymbols as IAssetSymbols, BundleBehavior } from '@atlaspack/types';
|
package/lib/worker.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/core",
|
|
3
|
-
"version": "2.25.2-dev-
|
|
3
|
+
"version": "2.25.2-dev-swc-4fc8a99f4.0",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -22,23 +22,23 @@
|
|
|
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.30-dev-
|
|
27
|
-
"@atlaspack/diagnostic": "2.14.5-dev-
|
|
28
|
-
"@atlaspack/events": "2.14.5-dev-
|
|
29
|
-
"@atlaspack/feature-flags": "2.25.5-dev-
|
|
30
|
-
"@atlaspack/fs": "2.15.30-dev-
|
|
31
|
-
"@atlaspack/graph": "3.5.24-dev-
|
|
32
|
-
"@atlaspack/logger": "2.14.27-dev-
|
|
33
|
-
"@atlaspack/package-manager": "2.14.35-dev-
|
|
34
|
-
"@atlaspack/plugin": "2.14.35-dev-
|
|
35
|
-
"@atlaspack/profiler": "2.14.32-dev-
|
|
36
|
-
"@atlaspack/rust": "3.8.3-dev-
|
|
37
|
-
"@atlaspack/
|
|
38
|
-
"@atlaspack/
|
|
39
|
-
"@atlaspack/
|
|
40
|
-
"@atlaspack/workers": "2.14.35-dev-9dac9ed3a.0",
|
|
25
|
+
"@atlaspack/build-cache": "2.13.7-dev-swc-4fc8a99f4.0",
|
|
26
|
+
"@atlaspack/cache": "3.2.30-dev-swc-4fc8a99f4.0",
|
|
27
|
+
"@atlaspack/diagnostic": "2.14.5-dev-swc-4fc8a99f4.0",
|
|
28
|
+
"@atlaspack/events": "2.14.5-dev-swc-4fc8a99f4.0",
|
|
29
|
+
"@atlaspack/feature-flags": "2.25.5-dev-swc-4fc8a99f4.0",
|
|
30
|
+
"@atlaspack/fs": "2.15.30-dev-swc-4fc8a99f4.0",
|
|
31
|
+
"@atlaspack/graph": "3.5.24-dev-swc-4fc8a99f4.0",
|
|
32
|
+
"@atlaspack/logger": "2.14.27-dev-swc-4fc8a99f4.0",
|
|
33
|
+
"@atlaspack/package-manager": "2.14.35-dev-swc-4fc8a99f4.0",
|
|
34
|
+
"@atlaspack/plugin": "2.14.35-dev-swc-4fc8a99f4.0",
|
|
35
|
+
"@atlaspack/profiler": "2.14.32-dev-swc-4fc8a99f4.0",
|
|
36
|
+
"@atlaspack/rust": "3.8.3-dev-swc-4fc8a99f4.0",
|
|
37
|
+
"@atlaspack/types": "2.15.25-dev-swc-4fc8a99f4.0",
|
|
38
|
+
"@atlaspack/utils": "3.0.3-dev-swc-4fc8a99f4.0",
|
|
39
|
+
"@atlaspack/workers": "2.14.35-dev-swc-4fc8a99f4.0",
|
|
41
40
|
"@mischnic/json-sourcemap": "^0.1.0",
|
|
41
|
+
"@parcel/source-map": "^2.1.1",
|
|
42
42
|
"base-x": "^3.0.8",
|
|
43
43
|
"browserslist": "^4.6.6",
|
|
44
44
|
"clone": "^2.1.1",
|
|
@@ -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-swc-4fc8a99f4.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": "4fc8a99f4944cddf9c65ed0cb547cba40a83488c"
|
|
65
65
|
}
|
package/src/Atlaspack.ts
CHANGED
|
@@ -43,7 +43,7 @@ import createPathRequest from './requests/PathRequest';
|
|
|
43
43
|
import {createEnvironment} from './Environment';
|
|
44
44
|
import {createDependency} from './Dependency';
|
|
45
45
|
import {Disposable} from '@atlaspack/events';
|
|
46
|
-
import {init as initSourcemaps} from '@
|
|
46
|
+
import {init as initSourcemaps} from '@parcel/source-map';
|
|
47
47
|
import {LMDBLiteCache} from '@atlaspack/cache';
|
|
48
48
|
import {
|
|
49
49
|
// @ts-expect-error TS2305
|
package/src/CommittedAsset.ts
CHANGED
|
@@ -3,7 +3,7 @@ import {Readable} from 'stream';
|
|
|
3
3
|
import {deserializeRaw} from '@atlaspack/build-cache';
|
|
4
4
|
import type {AST, Blob} from '@atlaspack/types';
|
|
5
5
|
import {bufferStream, blobToStream, streamFromPromise} from '@atlaspack/utils';
|
|
6
|
-
import SourceMap from '@
|
|
6
|
+
import SourceMap from '@parcel/source-map';
|
|
7
7
|
|
|
8
8
|
import {generateFromAST} from './assetUtils';
|
|
9
9
|
import type {Asset, Dependency, AtlaspackOptions} from './types';
|
package/src/PackagerRunner.ts
CHANGED
package/src/Transformation.ts
CHANGED
|
@@ -69,7 +69,6 @@ import {
|
|
|
69
69
|
import {invalidateOnFileCreateToInternal, createInvalidations} from './utils';
|
|
70
70
|
import invariant from 'assert';
|
|
71
71
|
import {tracer, PluginTracer} from '@atlaspack/profiler';
|
|
72
|
-
import SourceMap from '@atlaspack/source-map';
|
|
73
72
|
import {getFeatureFlag} from '@atlaspack/feature-flags';
|
|
74
73
|
|
|
75
74
|
type GenerateFunc = (input: UncommittedAsset) => Promise<GenerateOutput>;
|
|
@@ -461,7 +460,7 @@ export default class Transformation {
|
|
|
461
460
|
if (asset.isASTDirty && asset.generate) {
|
|
462
461
|
let output = await asset.generate();
|
|
463
462
|
asset.content = output.content;
|
|
464
|
-
asset.mapBuffer =
|
|
463
|
+
asset.mapBuffer = output.map?.toBuffer();
|
|
465
464
|
}
|
|
466
465
|
|
|
467
466
|
asset.clearAST();
|
|
@@ -635,7 +634,7 @@ export default class Transformation {
|
|
|
635
634
|
) {
|
|
636
635
|
let output = await asset.generate();
|
|
637
636
|
asset.content = output.content;
|
|
638
|
-
asset.mapBuffer =
|
|
637
|
+
asset.mapBuffer = output.map?.toBuffer();
|
|
639
638
|
}
|
|
640
639
|
|
|
641
640
|
// Load config for the transformer.
|
package/src/UncommittedAsset.ts
CHANGED
|
@@ -11,7 +11,7 @@ import type {Asset, Dependency, AtlaspackOptions, Invalidations} from './types';
|
|
|
11
11
|
|
|
12
12
|
import invariant from 'assert';
|
|
13
13
|
import {Readable} from 'stream';
|
|
14
|
-
import SourceMap from '@
|
|
14
|
+
import SourceMap from '@parcel/source-map';
|
|
15
15
|
import {serializeRaw} from '@atlaspack/build-cache';
|
|
16
16
|
import {
|
|
17
17
|
blobToStream,
|
|
@@ -249,7 +249,7 @@ export default class UncommittedAsset {
|
|
|
249
249
|
|
|
250
250
|
if (map) {
|
|
251
251
|
this.map = map;
|
|
252
|
-
this.mapBuffer =
|
|
252
|
+
this.mapBuffer = map.toBuffer();
|
|
253
253
|
this.setCode(code.replace(SOURCEMAP_RE, ''));
|
|
254
254
|
}
|
|
255
255
|
|
|
@@ -425,7 +425,7 @@ export default class UncommittedAsset {
|
|
|
425
425
|
content,
|
|
426
426
|
ast: result.ast,
|
|
427
427
|
isASTDirty: result.ast === this.ast ? this.isASTDirty : true,
|
|
428
|
-
mapBuffer:
|
|
428
|
+
mapBuffer: result.map ? result.map.toBuffer() : null,
|
|
429
429
|
code: this.code,
|
|
430
430
|
invalidations: this.invalidations,
|
|
431
431
|
});
|
package/src/assetUtils.ts
CHANGED
|
@@ -39,7 +39,6 @@ import {PluginTracer} from '@atlaspack/profiler';
|
|
|
39
39
|
import {identifierRegistry} from './IdentifierRegistry';
|
|
40
40
|
import type {EnvironmentRef} from './EnvironmentManager';
|
|
41
41
|
import {toEnvironmentId} from './EnvironmentManager';
|
|
42
|
-
import SourceMap from '@atlaspack/source-map';
|
|
43
42
|
|
|
44
43
|
export type AssetOptions = {
|
|
45
44
|
id?: string;
|
|
@@ -181,7 +180,7 @@ async function _generateFromAST(asset: CommittedAsset | UncommittedAsset) {
|
|
|
181
180
|
tracer: new PluginTracer({origin: pluginName, category: 'asset-generate'}),
|
|
182
181
|
});
|
|
183
182
|
|
|
184
|
-
let mapBuffer =
|
|
183
|
+
let mapBuffer = map?.toBuffer();
|
|
185
184
|
// Store the results in the cache so we can avoid generating again next time
|
|
186
185
|
await Promise.all([
|
|
187
186
|
asset.options.cache.setStream(
|
package/src/public/Asset.ts
CHANGED
|
@@ -192,7 +192,11 @@ export default function createBundleGraphRequest(
|
|
|
192
192
|
// force: true,
|
|
193
193
|
// },
|
|
194
194
|
// );
|
|
195
|
-
// require('./asset-graph-diff.
|
|
195
|
+
// require('./asset-graph-diff.ts')(
|
|
196
|
+
// jsAssetGraph,
|
|
197
|
+
// assetGraph,
|
|
198
|
+
// options.projectRoot,
|
|
199
|
+
// );
|
|
196
200
|
// }
|
|
197
201
|
|
|
198
202
|
measurement && measurement.end();
|
|
@@ -71,7 +71,11 @@ function compactDeep(
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
function assetGraphDiff(
|
|
74
|
+
function assetGraphDiff(
|
|
75
|
+
jsAssetGraph: AssetGraph,
|
|
76
|
+
rustAssetGraph: AssetGraph,
|
|
77
|
+
projectRoot: string,
|
|
78
|
+
) {
|
|
75
79
|
const getNodes = (graph: any) => {
|
|
76
80
|
let nodes: Record<string, any> = {};
|
|
77
81
|
|
|
@@ -81,13 +85,12 @@ function assetGraphDiff(jsAssetGraph: AssetGraph, rustAssetGraph: AssetGraph) {
|
|
|
81
85
|
if (!node) return;
|
|
82
86
|
|
|
83
87
|
if (node.type === 'dependency') {
|
|
84
|
-
let sourcePath = node.value.sourcePath
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
] = filterNode(node);
|
|
88
|
+
let sourcePath = node.value.sourcePath
|
|
89
|
+
? toProjectPath(node.value.sourcePath)
|
|
90
|
+
: toProjectPath(projectRoot, 'entry');
|
|
91
|
+
nodes[`dep:${sourcePath}:${node.value.specifier}`] = filterNode(node);
|
|
88
92
|
} else if (node.type === 'asset') {
|
|
89
|
-
nodes[`asset:${
|
|
90
|
-
filterNode(node);
|
|
93
|
+
nodes[`asset:${toProjectPath(node.value.filePath)}`] = filterNode(node);
|
|
91
94
|
}
|
|
92
95
|
});
|
|
93
96
|
|
package/src/worker.ts
CHANGED
|
@@ -21,7 +21,7 @@ import Validation, {ValidationOpts} from './Validation';
|
|
|
21
21
|
import {AtlaspackConfig} from './AtlaspackConfig';
|
|
22
22
|
import {registerCoreWithSerializer} from './registerCoreWithSerializer';
|
|
23
23
|
import {clearBuildCaches} from '@atlaspack/build-cache';
|
|
24
|
-
import {init as initSourcemaps} from '@
|
|
24
|
+
import {init as initSourcemaps} from '@parcel/source-map';
|
|
25
25
|
// @ts-expect-error TS2305
|
|
26
26
|
import {init as initRust} from '@atlaspack/rust';
|
|
27
27
|
import WorkerFarm from '@atlaspack/workers';
|