@atlaspack/core 2.12.1-canary.3520 → 2.12.1-canary.3522
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.
|
@@ -24,9 +24,7 @@ class AtlaspackV3 {
|
|
|
24
24
|
options.logLevel = options.logLevel || 'error';
|
|
25
25
|
options.defaultTargetOptions = options.defaultTargetOptions || {};
|
|
26
26
|
// $FlowFixMe "engines" are readonly
|
|
27
|
-
options.defaultTargetOptions.engines = options.defaultTargetOptions.engines || {
|
|
28
|
-
browsers: []
|
|
29
|
-
};
|
|
27
|
+
options.defaultTargetOptions.engines = options.defaultTargetOptions.engines || {};
|
|
30
28
|
this._internal = _rust().AtlaspackNapi.create({
|
|
31
29
|
fs,
|
|
32
30
|
nodeWorkers,
|
|
@@ -30,6 +30,13 @@ var _constants = require("../constants");
|
|
|
30
30
|
var _projectPath = require("../projectPath");
|
|
31
31
|
var _RequestTracker = require("../RequestTracker");
|
|
32
32
|
var _SymbolPropagation = require("../SymbolPropagation");
|
|
33
|
+
function _sourceMap() {
|
|
34
|
+
const data = _interopRequireDefault(require("@parcel/source-map"));
|
|
35
|
+
_sourceMap = function () {
|
|
36
|
+
return data;
|
|
37
|
+
};
|
|
38
|
+
return data;
|
|
39
|
+
}
|
|
33
40
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
34
41
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
35
42
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -169,8 +176,10 @@ function getAssetGraph(serializedGraph, options) {
|
|
|
169
176
|
};
|
|
170
177
|
if (asset.map) {
|
|
171
178
|
let mapKey = (0, _rust().hashString)(`${_constants.ATLASPACK_VERSION}:map:${asset.id}`);
|
|
179
|
+
let sourceMap = new (_sourceMap().default)(options.projectRoot);
|
|
180
|
+
sourceMap.addVLQMap(JSON.parse(asset.map));
|
|
172
181
|
asset.mapKey = mapKey;
|
|
173
|
-
options.cache.setBlob(mapKey,
|
|
182
|
+
options.cache.setBlob(mapKey, sourceMap.toBuffer());
|
|
174
183
|
delete asset.map;
|
|
175
184
|
}
|
|
176
185
|
cachedAssets.set(id, asset.code);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/core",
|
|
3
|
-
"version": "2.12.1-canary.
|
|
3
|
+
"version": "2.12.1-canary.3522+56e3e234a",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -20,21 +20,21 @@
|
|
|
20
20
|
"check-ts": "tsc --noEmit index.d.ts"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@atlaspack/build-cache": "2.12.1-canary.
|
|
24
|
-
"@atlaspack/cache": "2.12.1-canary.
|
|
25
|
-
"@atlaspack/diagnostic": "2.12.1-canary.
|
|
26
|
-
"@atlaspack/events": "2.12.1-canary.
|
|
27
|
-
"@atlaspack/feature-flags": "2.12.1-canary.
|
|
28
|
-
"@atlaspack/fs": "2.12.1-canary.
|
|
29
|
-
"@atlaspack/graph": "3.2.1-canary.
|
|
30
|
-
"@atlaspack/logger": "2.12.1-canary.
|
|
31
|
-
"@atlaspack/package-manager": "2.12.1-canary.
|
|
32
|
-
"@atlaspack/plugin": "2.12.1-canary.
|
|
33
|
-
"@atlaspack/profiler": "2.12.1-canary.
|
|
34
|
-
"@atlaspack/rust": "2.12.1-canary.
|
|
35
|
-
"@atlaspack/types": "2.12.1-canary.
|
|
36
|
-
"@atlaspack/utils": "2.12.1-canary.
|
|
37
|
-
"@atlaspack/workers": "2.12.1-canary.
|
|
23
|
+
"@atlaspack/build-cache": "2.12.1-canary.3522+56e3e234a",
|
|
24
|
+
"@atlaspack/cache": "2.12.1-canary.3522+56e3e234a",
|
|
25
|
+
"@atlaspack/diagnostic": "2.12.1-canary.3522+56e3e234a",
|
|
26
|
+
"@atlaspack/events": "2.12.1-canary.3522+56e3e234a",
|
|
27
|
+
"@atlaspack/feature-flags": "2.12.1-canary.3522+56e3e234a",
|
|
28
|
+
"@atlaspack/fs": "2.12.1-canary.3522+56e3e234a",
|
|
29
|
+
"@atlaspack/graph": "3.2.1-canary.3522+56e3e234a",
|
|
30
|
+
"@atlaspack/logger": "2.12.1-canary.3522+56e3e234a",
|
|
31
|
+
"@atlaspack/package-manager": "2.12.1-canary.3522+56e3e234a",
|
|
32
|
+
"@atlaspack/plugin": "2.12.1-canary.3522+56e3e234a",
|
|
33
|
+
"@atlaspack/profiler": "2.12.1-canary.3522+56e3e234a",
|
|
34
|
+
"@atlaspack/rust": "2.12.1-canary.3522+56e3e234a",
|
|
35
|
+
"@atlaspack/types": "2.12.1-canary.3522+56e3e234a",
|
|
36
|
+
"@atlaspack/utils": "2.12.1-canary.3522+56e3e234a",
|
|
37
|
+
"@atlaspack/workers": "2.12.1-canary.3522+56e3e234a",
|
|
38
38
|
"@mischnic/json-sourcemap": "^0.1.0",
|
|
39
39
|
"@parcel/source-map": "^2.1.1",
|
|
40
40
|
"base-x": "^3.0.8",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"browser": {
|
|
67
67
|
"./src/serializerCore.js": "./src/serializerCore.browser.js"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "56e3e234a88ec4681a542477d38e3a7e1f300844"
|
|
70
70
|
}
|
|
@@ -33,10 +33,8 @@ export class AtlaspackV3 {
|
|
|
33
33
|
options.logLevel = options.logLevel || 'error';
|
|
34
34
|
options.defaultTargetOptions = options.defaultTargetOptions || {};
|
|
35
35
|
// $FlowFixMe "engines" are readonly
|
|
36
|
-
options.defaultTargetOptions.engines =
|
|
37
|
-
.engines || {
|
|
38
|
-
browsers: [],
|
|
39
|
-
};
|
|
36
|
+
options.defaultTargetOptions.engines =
|
|
37
|
+
options.defaultTargetOptions.engines || {};
|
|
40
38
|
|
|
41
39
|
this._internal = AtlaspackNapi.create(
|
|
42
40
|
{
|
|
@@ -18,6 +18,7 @@ import type {
|
|
|
18
18
|
AssetGraphRequestInput,
|
|
19
19
|
AssetGraphRequestResult,
|
|
20
20
|
} from './AssetGraphRequest';
|
|
21
|
+
import SourceMap from '@parcel/source-map';
|
|
21
22
|
|
|
22
23
|
type RunInput = {|
|
|
23
24
|
input: AssetGraphRequestInput,
|
|
@@ -197,9 +198,11 @@ function getAssetGraph(serializedGraph, options) {
|
|
|
197
198
|
|
|
198
199
|
if (asset.map) {
|
|
199
200
|
let mapKey = hashString(`${ATLASPACK_VERSION}:map:${asset.id}`);
|
|
201
|
+
let sourceMap = new SourceMap(options.projectRoot);
|
|
202
|
+
sourceMap.addVLQMap(JSON.parse(asset.map));
|
|
200
203
|
|
|
201
204
|
asset.mapKey = mapKey;
|
|
202
|
-
options.cache.setBlob(mapKey,
|
|
205
|
+
options.cache.setBlob(mapKey, sourceMap.toBuffer());
|
|
203
206
|
delete asset.map;
|
|
204
207
|
}
|
|
205
208
|
|