@atlaspack/core 2.12.1-dev.3460 → 2.12.1-dev.3466
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/lib/CommittedAsset.js +11 -5
- package/lib/PackagerRunner.js +8 -2
- package/lib/RequestTracker.js +10 -4
- package/lib/UncommittedAsset.js +8 -2
- package/lib/assetUtils.js +8 -2
- package/lib/index.js +0 -43
- package/lib/registerCoreWithSerializer.js +11 -5
- package/lib/requests/AtlaspackConfigRequest.js +8 -2
- package/lib/requests/ConfigRequest.js +9 -4
- package/lib/requests/DevDepRequest.js +9 -3
- package/lib/requests/PathRequest.js +8 -2
- package/lib/worker.js +8 -2
- package/package.json +17 -16
- package/src/CommittedAsset.js +4 -2
- package/src/PackagerRunner.js +1 -1
- package/src/RequestTracker.js +1 -1
- package/src/UncommittedAsset.js +1 -1
- package/src/assetUtils.js +1 -1
- package/src/index.js +0 -10
- package/src/registerCoreWithSerializer.js +7 -4
- package/src/requests/AtlaspackConfigRequest.js +1 -1
- package/src/requests/ConfigRequest.js +1 -2
- package/src/requests/DevDepRequest.js +1 -1
- package/src/requests/PathRequest.js +1 -1
- package/src/worker.js +1 -1
- package/lib/buildCache.js +0 -18
- package/lib/serializer.js +0 -216
- package/lib/serializerCore.js +0 -16
- package/src/buildCache.js +0 -15
- package/src/serializer.js +0 -255
- package/src/serializerCore.js +0 -5
- package/test/serializer.test.js +0 -302
package/lib/CommittedAsset.js
CHANGED
|
@@ -11,9 +11,9 @@ function _stream() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
const data =
|
|
16
|
-
|
|
14
|
+
function _buildCache() {
|
|
15
|
+
const data = require("@atlaspack/build-cache");
|
|
16
|
+
_buildCache = function () {
|
|
17
17
|
return data;
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
@@ -25,8 +25,14 @@ function _utils() {
|
|
|
25
25
|
};
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
|
+
function _sourceMap() {
|
|
29
|
+
const data = _interopRequireDefault(require("@parcel/source-map"));
|
|
30
|
+
_sourceMap = function () {
|
|
31
|
+
return data;
|
|
32
|
+
};
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
28
35
|
var _assetUtils = require("./assetUtils");
|
|
29
|
-
var _serializer = require("./serializer");
|
|
30
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
37
|
class CommittedAsset {
|
|
32
38
|
constructor(value, options) {
|
|
@@ -122,7 +128,7 @@ class CommittedAsset {
|
|
|
122
128
|
return Promise.resolve(null);
|
|
123
129
|
}
|
|
124
130
|
if (this.ast == null) {
|
|
125
|
-
this.ast = this.options.cache.getBlob(this.value.astKey).then(serializedAst => (0,
|
|
131
|
+
this.ast = this.options.cache.getBlob(this.value.astKey).then(serializedAst => (0, _buildCache().deserializeRaw)(serializedAst));
|
|
126
132
|
}
|
|
127
133
|
return this.ast;
|
|
128
134
|
}
|
package/lib/PackagerRunner.js
CHANGED
|
@@ -76,7 +76,13 @@ var _projectPath = require("./projectPath");
|
|
|
76
76
|
var _InternalConfig = require("./InternalConfig");
|
|
77
77
|
var _ConfigRequest = require("./requests/ConfigRequest");
|
|
78
78
|
var _DevDepRequest = require("./requests/DevDepRequest");
|
|
79
|
-
|
|
79
|
+
function _buildCache() {
|
|
80
|
+
const data = require("@atlaspack/build-cache");
|
|
81
|
+
_buildCache = function () {
|
|
82
|
+
return data;
|
|
83
|
+
};
|
|
84
|
+
return data;
|
|
85
|
+
}
|
|
80
86
|
var _assetUtils = require("./assetUtils");
|
|
81
87
|
var _utils2 = require("./utils");
|
|
82
88
|
function _profiler() {
|
|
@@ -93,7 +99,7 @@ const BOUNDARY_LENGTH = _constants.HASH_REF_PREFIX.length + 32 - 1;
|
|
|
93
99
|
|
|
94
100
|
// Packager/optimizer configs are not bundle-specific, so we only need to
|
|
95
101
|
// load them once per build.
|
|
96
|
-
const pluginConfigs = (0, _buildCache.createBuildCache)();
|
|
102
|
+
const pluginConfigs = (0, _buildCache().createBuildCache)();
|
|
97
103
|
class PackagerRunner {
|
|
98
104
|
constructor({
|
|
99
105
|
config,
|
package/lib/RequestTracker.js
CHANGED
|
@@ -69,7 +69,13 @@ var _constants = require("./constants");
|
|
|
69
69
|
var _projectPath = require("./projectPath");
|
|
70
70
|
var _ReporterRunner = require("./ReporterRunner");
|
|
71
71
|
var _ConfigRequest = require("./requests/ConfigRequest");
|
|
72
|
-
|
|
72
|
+
function _buildCache() {
|
|
73
|
+
const data = require("@atlaspack/build-cache");
|
|
74
|
+
_buildCache = function () {
|
|
75
|
+
return data;
|
|
76
|
+
};
|
|
77
|
+
return data;
|
|
78
|
+
}
|
|
73
79
|
var _utils2 = require("./utils");
|
|
74
80
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
75
81
|
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); }
|
|
@@ -749,7 +755,7 @@ class RequestTracker {
|
|
|
749
755
|
} else if (node.resultCacheKey != null && ifMatch == null) {
|
|
750
756
|
let key = node.resultCacheKey;
|
|
751
757
|
(0, _assert().default)(this.options.cache.hasLargeBlob(key));
|
|
752
|
-
let cachedResult = (0,
|
|
758
|
+
let cachedResult = (0, _buildCache().deserialize)(await this.options.cache.getLargeBlob(key));
|
|
753
759
|
node.result = cachedResult;
|
|
754
760
|
return cachedResult;
|
|
755
761
|
}
|
|
@@ -927,7 +933,7 @@ class RequestTracker {
|
|
|
927
933
|
if (signal !== null && signal !== void 0 && signal.aborted) {
|
|
928
934
|
throw new Error('Serialization was aborted');
|
|
929
935
|
}
|
|
930
|
-
await this.options.cache.setLargeBlob(key, (0,
|
|
936
|
+
await this.options.cache.setLargeBlob(key, (0, _buildCache().serialize)(contents), signal ? {
|
|
931
937
|
signal: signal
|
|
932
938
|
} : undefined);
|
|
933
939
|
total += 1;
|
|
@@ -1046,7 +1052,7 @@ async function readAndDeserializeRequestGraph(cache, requestGraphKey, cacheKey)
|
|
|
1046
1052
|
const getAndDeserialize = async key => {
|
|
1047
1053
|
let buffer = await cache.getLargeBlob(key);
|
|
1048
1054
|
bufferLength += Buffer.byteLength(buffer);
|
|
1049
|
-
return (0,
|
|
1055
|
+
return (0, _buildCache().deserialize)(buffer);
|
|
1050
1056
|
};
|
|
1051
1057
|
let serializedRequestGraph = await getAndDeserialize(requestGraphKey);
|
|
1052
1058
|
let nodePromises = serializedRequestGraph.nodeCountsPerBlob.map(async (nodesCount, i) => {
|
package/lib/UncommittedAsset.js
CHANGED
|
@@ -39,7 +39,13 @@ function _rust() {
|
|
|
39
39
|
};
|
|
40
40
|
return data;
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
function _buildCache() {
|
|
43
|
+
const data = require("@atlaspack/build-cache");
|
|
44
|
+
_buildCache = function () {
|
|
45
|
+
return data;
|
|
46
|
+
};
|
|
47
|
+
return data;
|
|
48
|
+
}
|
|
43
49
|
var _Dependency = require("./Dependency");
|
|
44
50
|
var _Environment = require("./Environment");
|
|
45
51
|
var _constants = require("./constants");
|
|
@@ -88,7 +94,7 @@ class UncommittedAsset {
|
|
|
88
94
|
|
|
89
95
|
// Since we can only read from the stream once, compute the content length
|
|
90
96
|
// and hash while it's being written to the cache.
|
|
91
|
-
await Promise.all([contentKey != null && this.commitContent(contentKey).then(s => (size = s.size, outputHash = s.hash)), this.mapBuffer != null && mapKey != null && this.options.cache.setBlob(mapKey, this.mapBuffer), astKey != null && this.options.cache.setBlob(astKey, (0,
|
|
97
|
+
await Promise.all([contentKey != null && this.commitContent(contentKey).then(s => (size = s.size, outputHash = s.hash)), this.mapBuffer != null && mapKey != null && this.options.cache.setBlob(mapKey, this.mapBuffer), astKey != null && this.options.cache.setBlob(astKey, (0, _buildCache().serializeRaw)(this.ast))]);
|
|
92
98
|
this.value.contentKey = contentKey;
|
|
93
99
|
this.value.mapKey = mapKey;
|
|
94
100
|
this.value.astKey = astKey;
|
package/lib/assetUtils.js
CHANGED
|
@@ -42,7 +42,13 @@ function _utils() {
|
|
|
42
42
|
return data;
|
|
43
43
|
}
|
|
44
44
|
var _utils2 = require("./utils");
|
|
45
|
-
|
|
45
|
+
function _buildCache() {
|
|
46
|
+
const data = require("@atlaspack/build-cache");
|
|
47
|
+
_buildCache = function () {
|
|
48
|
+
return data;
|
|
49
|
+
};
|
|
50
|
+
return data;
|
|
51
|
+
}
|
|
46
52
|
var _projectPath = require("./projectPath");
|
|
47
53
|
function _rust() {
|
|
48
54
|
const data = require("@atlaspack/rust");
|
|
@@ -161,7 +167,7 @@ function getInvalidationId(invalidation) {
|
|
|
161
167
|
throw new Error('Unknown invalidation type: ' + invalidation.type);
|
|
162
168
|
}
|
|
163
169
|
}
|
|
164
|
-
const hashCache = (0, _buildCache.createBuildCache)();
|
|
170
|
+
const hashCache = (0, _buildCache().createBuildCache)();
|
|
165
171
|
async function getInvalidationHash(invalidations, options) {
|
|
166
172
|
if (invalidations.length === 0) {
|
|
167
173
|
return '';
|
package/lib/index.js
CHANGED
|
@@ -4,12 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
|
-
registerSerializableClass: true,
|
|
8
|
-
unregisterSerializableClass: true,
|
|
9
|
-
prepareForSerialization: true,
|
|
10
|
-
restoreDeserializedObject: true,
|
|
11
|
-
serialize: true,
|
|
12
|
-
deserialize: true,
|
|
13
7
|
Atlaspack: true,
|
|
14
8
|
Parcel: true,
|
|
15
9
|
BuildError: true,
|
|
@@ -59,43 +53,6 @@ Object.defineProperty(exports, "default", {
|
|
|
59
53
|
return _Atlaspack.default;
|
|
60
54
|
}
|
|
61
55
|
});
|
|
62
|
-
Object.defineProperty(exports, "deserialize", {
|
|
63
|
-
enumerable: true,
|
|
64
|
-
get: function () {
|
|
65
|
-
return _serializer.deserialize;
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
Object.defineProperty(exports, "prepareForSerialization", {
|
|
69
|
-
enumerable: true,
|
|
70
|
-
get: function () {
|
|
71
|
-
return _serializer.prepareForSerialization;
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
Object.defineProperty(exports, "registerSerializableClass", {
|
|
75
|
-
enumerable: true,
|
|
76
|
-
get: function () {
|
|
77
|
-
return _serializer.registerSerializableClass;
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
Object.defineProperty(exports, "restoreDeserializedObject", {
|
|
81
|
-
enumerable: true,
|
|
82
|
-
get: function () {
|
|
83
|
-
return _serializer.restoreDeserializedObject;
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
Object.defineProperty(exports, "serialize", {
|
|
87
|
-
enumerable: true,
|
|
88
|
-
get: function () {
|
|
89
|
-
return _serializer.serialize;
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
Object.defineProperty(exports, "unregisterSerializableClass", {
|
|
93
|
-
enumerable: true,
|
|
94
|
-
get: function () {
|
|
95
|
-
return _serializer.unregisterSerializableClass;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
var _serializer = require("./serializer");
|
|
99
56
|
var _Atlaspack = _interopRequireWildcard(require("./Atlaspack"));
|
|
100
57
|
var _atlaspackV = require("./atlaspack-v3");
|
|
101
58
|
Object.keys(_atlaspackV).forEach(function (key) {
|
|
@@ -4,6 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.registerCoreWithSerializer = registerCoreWithSerializer;
|
|
7
|
+
function _buildCache() {
|
|
8
|
+
const data = require("@atlaspack/build-cache");
|
|
9
|
+
_buildCache = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
7
14
|
function _graph() {
|
|
8
15
|
const data = require("@atlaspack/graph");
|
|
9
16
|
_graph = function () {
|
|
@@ -11,13 +18,12 @@ function _graph() {
|
|
|
11
18
|
};
|
|
12
19
|
return data;
|
|
13
20
|
}
|
|
14
|
-
var
|
|
21
|
+
var _package = _interopRequireDefault(require("../package.json"));
|
|
22
|
+
var _AtlaspackConfig = _interopRequireDefault(require("./AtlaspackConfig"));
|
|
15
23
|
var _AssetGraph = _interopRequireDefault(require("./AssetGraph"));
|
|
16
24
|
var _BundleGraph = _interopRequireDefault(require("./BundleGraph"));
|
|
17
|
-
var _AtlaspackConfig = _interopRequireDefault(require("./AtlaspackConfig"));
|
|
18
|
-
var _RequestTracker = require("./RequestTracker");
|
|
19
25
|
var _Config = _interopRequireDefault(require("./public/Config"));
|
|
20
|
-
var
|
|
26
|
+
var _RequestTracker = require("./RequestTracker");
|
|
21
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
28
|
let coreRegistered;
|
|
23
29
|
function registerCoreWithSerializer() {
|
|
@@ -39,7 +45,7 @@ function registerCoreWithSerializer() {
|
|
|
39
45
|
RequestGraph: _RequestTracker.RequestGraph
|
|
40
46
|
// $FlowFixMe[unclear-type]
|
|
41
47
|
})) {
|
|
42
|
-
(0,
|
|
48
|
+
(0, _buildCache().registerSerializableClass)(packageVersion + ':' + name, ctor);
|
|
43
49
|
}
|
|
44
50
|
coreRegistered = true;
|
|
45
51
|
}
|
|
@@ -56,7 +56,13 @@ function _assert() {
|
|
|
56
56
|
var _AtlaspackConfig = _interopRequireDefault(require("../AtlaspackConfig.schema"));
|
|
57
57
|
var _utils2 = require("../utils");
|
|
58
58
|
var _AtlaspackConfig2 = _interopRequireDefault(require("../AtlaspackConfig"));
|
|
59
|
-
|
|
59
|
+
function _buildCache() {
|
|
60
|
+
const data = require("@atlaspack/build-cache");
|
|
61
|
+
_buildCache = function () {
|
|
62
|
+
return data;
|
|
63
|
+
};
|
|
64
|
+
return data;
|
|
65
|
+
}
|
|
60
66
|
var _projectPath = require("../projectPath");
|
|
61
67
|
var _RequestTracker = require("../RequestTracker");
|
|
62
68
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -103,7 +109,7 @@ function createAtlaspackConfigRequest() {
|
|
|
103
109
|
input: null
|
|
104
110
|
};
|
|
105
111
|
}
|
|
106
|
-
const atlaspackConfigCache = (0, _buildCache.createBuildCache)();
|
|
112
|
+
const atlaspackConfigCache = (0, _buildCache().createBuildCache)();
|
|
107
113
|
function getCachedAtlaspackConfig(result, options) {
|
|
108
114
|
let {
|
|
109
115
|
config: processedConfig,
|
|
@@ -15,7 +15,13 @@ function _utils() {
|
|
|
15
15
|
};
|
|
16
16
|
return data;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
function _buildCache() {
|
|
19
|
+
const data = require("@atlaspack/build-cache");
|
|
20
|
+
_buildCache = function () {
|
|
21
|
+
return data;
|
|
22
|
+
};
|
|
23
|
+
return data;
|
|
24
|
+
}
|
|
19
25
|
function _logger() {
|
|
20
26
|
const data = require("@atlaspack/logger");
|
|
21
27
|
_logger = function () {
|
|
@@ -50,7 +56,6 @@ function _profiler() {
|
|
|
50
56
|
}
|
|
51
57
|
var _RequestTracker = require("../RequestTracker");
|
|
52
58
|
var _projectPath = require("../projectPath");
|
|
53
|
-
var _buildCache = require("../buildCache");
|
|
54
59
|
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); }
|
|
55
60
|
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; }
|
|
56
61
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -81,7 +86,7 @@ async function loadPluginConfig(loadedPlugin, config, options) {
|
|
|
81
86
|
});
|
|
82
87
|
}
|
|
83
88
|
}
|
|
84
|
-
const configKeyCache = (0, _buildCache.createBuildCache)();
|
|
89
|
+
const configKeyCache = (0, _buildCache().createBuildCache)();
|
|
85
90
|
async function getConfigKeyContentHash(filePath, configKey, options) {
|
|
86
91
|
let cacheKey = `${(0, _projectPath.fromProjectPathRelative)(filePath)}:${configKey}`;
|
|
87
92
|
let cachedValue = configKeyCache.get(cacheKey);
|
|
@@ -166,7 +171,7 @@ async function getConfigHash(config, pluginName, options) {
|
|
|
166
171
|
})), options));
|
|
167
172
|
} else if (config.result != null) {
|
|
168
173
|
try {
|
|
169
|
-
hash.writeBuffer((0,
|
|
174
|
+
hash.writeBuffer((0, _buildCache().serializeRaw)(config.result));
|
|
170
175
|
} catch (err) {
|
|
171
176
|
throw new (_diagnostic().default)({
|
|
172
177
|
diagnostic: {
|
|
@@ -16,7 +16,13 @@ function _nullthrows() {
|
|
|
16
16
|
return data;
|
|
17
17
|
}
|
|
18
18
|
var _assetUtils = require("../assetUtils");
|
|
19
|
-
|
|
19
|
+
function _buildCache() {
|
|
20
|
+
const data = require("@atlaspack/build-cache");
|
|
21
|
+
_buildCache = function () {
|
|
22
|
+
return data;
|
|
23
|
+
};
|
|
24
|
+
return data;
|
|
25
|
+
}
|
|
20
26
|
var _utils = require("../utils");
|
|
21
27
|
var _projectPath = require("../projectPath");
|
|
22
28
|
var _RequestTracker = require("../RequestTracker");
|
|
@@ -98,7 +104,7 @@ async function getDevDepRequests(api) {
|
|
|
98
104
|
|
|
99
105
|
// Tracks dev deps that have been invalidated during this build
|
|
100
106
|
// so we don't invalidate the require cache more than once.
|
|
101
|
-
const invalidatedDevDeps = (0, _buildCache.createBuildCache)();
|
|
107
|
+
const invalidatedDevDeps = (0, _buildCache().createBuildCache)();
|
|
102
108
|
function invalidateDevDeps(invalidDevDeps, options, config) {
|
|
103
109
|
for (let {
|
|
104
110
|
specifier,
|
|
@@ -142,7 +148,7 @@ async function runDevDepRequest(api, devDepRequest) {
|
|
|
142
148
|
|
|
143
149
|
// A cache of plugin dependency hashes that we've already sent to the main thread.
|
|
144
150
|
// Automatically cleared before each build.
|
|
145
|
-
const pluginCache = (0, _buildCache.createBuildCache)();
|
|
151
|
+
const pluginCache = (0, _buildCache().createBuildCache)();
|
|
146
152
|
function getWorkerDevDepRequests(devDepRequests) {
|
|
147
153
|
return devDepRequests.map(devDepRequest => {
|
|
148
154
|
// If we've already sent a matching transformer + hash to the main thread during this build,
|
|
@@ -48,7 +48,13 @@ var _AtlaspackConfigRequest = _interopRequireWildcard(require("./AtlaspackConfig
|
|
|
48
48
|
var _utils2 = require("../utils");
|
|
49
49
|
var _projectPath = require("../projectPath");
|
|
50
50
|
var _types = require("../types");
|
|
51
|
-
|
|
51
|
+
function _buildCache() {
|
|
52
|
+
const data = require("@atlaspack/build-cache");
|
|
53
|
+
_buildCache = function () {
|
|
54
|
+
return data;
|
|
55
|
+
};
|
|
56
|
+
return data;
|
|
57
|
+
}
|
|
52
58
|
var _InternalConfig = require("../InternalConfig");
|
|
53
59
|
var _ConfigRequest = require("./ConfigRequest");
|
|
54
60
|
var _DevDepRequest = require("./DevDepRequest");
|
|
@@ -126,7 +132,7 @@ async function run({
|
|
|
126
132
|
throw err;
|
|
127
133
|
}
|
|
128
134
|
}
|
|
129
|
-
const configCache = (0, _buildCache.createBuildCache)();
|
|
135
|
+
const configCache = (0, _buildCache().createBuildCache)();
|
|
130
136
|
class ResolverRunner {
|
|
131
137
|
constructor({
|
|
132
138
|
config,
|
package/lib/worker.js
CHANGED
|
@@ -37,7 +37,13 @@ var _PackagerRunner = _interopRequireDefault(require("./PackagerRunner"));
|
|
|
37
37
|
var _Validation = _interopRequireDefault(require("./Validation"));
|
|
38
38
|
var _AtlaspackConfig = _interopRequireDefault(require("./AtlaspackConfig"));
|
|
39
39
|
var _registerCoreWithSerializer = require("./registerCoreWithSerializer");
|
|
40
|
-
|
|
40
|
+
function _buildCache() {
|
|
41
|
+
const data = require("@atlaspack/build-cache");
|
|
42
|
+
_buildCache = function () {
|
|
43
|
+
return data;
|
|
44
|
+
};
|
|
45
|
+
return data;
|
|
46
|
+
}
|
|
41
47
|
function _sourceMap() {
|
|
42
48
|
const data = require("@parcel/source-map");
|
|
43
49
|
_sourceMap = function () {
|
|
@@ -105,7 +111,7 @@ async function loadConfig(cachePath, options) {
|
|
|
105
111
|
}
|
|
106
112
|
function clearConfigCache() {
|
|
107
113
|
_utils().loadConfig.clear();
|
|
108
|
-
(0, _buildCache.clearBuildCaches)();
|
|
114
|
+
(0, _buildCache().clearBuildCaches)();
|
|
109
115
|
}
|
|
110
116
|
async function runTransform(workerApi, opts) {
|
|
111
117
|
let {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/core",
|
|
3
|
-
"version": "2.12.1-dev.
|
|
3
|
+
"version": "2.12.1-dev.3466+9a12fb8bd",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -20,20 +20,21 @@
|
|
|
20
20
|
"check-ts": "tsc --noEmit index.d.ts"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@atlaspack/cache": "2.12.1-dev.
|
|
24
|
-
"@atlaspack/
|
|
25
|
-
"@atlaspack/
|
|
26
|
-
"@atlaspack/
|
|
27
|
-
"@atlaspack/
|
|
28
|
-
"@atlaspack/
|
|
29
|
-
"@atlaspack/
|
|
30
|
-
"@atlaspack/
|
|
31
|
-
"@atlaspack/
|
|
32
|
-
"@atlaspack/
|
|
33
|
-
"@atlaspack/
|
|
34
|
-
"@atlaspack/
|
|
35
|
-
"@atlaspack/
|
|
36
|
-
"@atlaspack/
|
|
23
|
+
"@atlaspack/build-cache": "2.12.1-dev.3466+9a12fb8bd",
|
|
24
|
+
"@atlaspack/cache": "2.12.1-dev.3466+9a12fb8bd",
|
|
25
|
+
"@atlaspack/diagnostic": "2.12.1-dev.3466+9a12fb8bd",
|
|
26
|
+
"@atlaspack/events": "2.12.1-dev.3466+9a12fb8bd",
|
|
27
|
+
"@atlaspack/feature-flags": "2.12.1-dev.3466+9a12fb8bd",
|
|
28
|
+
"@atlaspack/fs": "2.12.1-dev.3466+9a12fb8bd",
|
|
29
|
+
"@atlaspack/graph": "3.2.1-dev.3466+9a12fb8bd",
|
|
30
|
+
"@atlaspack/logger": "2.12.1-dev.3466+9a12fb8bd",
|
|
31
|
+
"@atlaspack/package-manager": "2.12.1-dev.3466+9a12fb8bd",
|
|
32
|
+
"@atlaspack/plugin": "2.12.1-dev.3466+9a12fb8bd",
|
|
33
|
+
"@atlaspack/profiler": "2.12.1-dev.3466+9a12fb8bd",
|
|
34
|
+
"@atlaspack/rust": "2.12.1-dev.3466+9a12fb8bd",
|
|
35
|
+
"@atlaspack/types": "2.12.1-dev.3466+9a12fb8bd",
|
|
36
|
+
"@atlaspack/utils": "2.12.1-dev.3466+9a12fb8bd",
|
|
37
|
+
"@atlaspack/workers": "2.12.1-dev.3466+9a12fb8bd",
|
|
37
38
|
"@mischnic/json-sourcemap": "^0.1.0",
|
|
38
39
|
"@parcel/source-map": "^2.1.1",
|
|
39
40
|
"base-x": "^3.0.8",
|
|
@@ -64,5 +65,5 @@
|
|
|
64
65
|
"browser": {
|
|
65
66
|
"./src/serializerCore.js": "./src/serializerCore.browser.js"
|
|
66
67
|
},
|
|
67
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "9a12fb8bd1b72e407ed043e20337dc60fbec9cbe"
|
|
68
69
|
}
|
package/src/CommittedAsset.js
CHANGED
|
@@ -4,10 +4,12 @@ import type {AST, Blob} from '@atlaspack/types';
|
|
|
4
4
|
import type {Asset, Dependency, AtlaspackOptions} from './types';
|
|
5
5
|
|
|
6
6
|
import {Readable} from 'stream';
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
import {deserializeRaw} from '@atlaspack/build-cache';
|
|
8
9
|
import {bufferStream, blobToStream, streamFromPromise} from '@atlaspack/utils';
|
|
10
|
+
import SourceMap from '@parcel/source-map';
|
|
11
|
+
|
|
9
12
|
import {generateFromAST} from './assetUtils';
|
|
10
|
-
import {deserializeRaw} from './serializer';
|
|
11
13
|
|
|
12
14
|
export default class CommittedAsset {
|
|
13
15
|
key: ?string;
|
package/src/PackagerRunner.js
CHANGED
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
createDevDependency,
|
|
58
58
|
getWorkerDevDepRequests,
|
|
59
59
|
} from './requests/DevDepRequest';
|
|
60
|
-
import {createBuildCache} from '
|
|
60
|
+
import {createBuildCache} from '@atlaspack/build-cache';
|
|
61
61
|
import {getInvalidationId, getInvalidationHash} from './assetUtils';
|
|
62
62
|
import {optionsProxy} from './utils';
|
|
63
63
|
import {invalidateDevDeps} from './requests/DevDepRequest';
|
package/src/RequestTracker.js
CHANGED
|
@@ -60,7 +60,7 @@ import type {AtlaspackConfigRequestResult} from './requests/AtlaspackConfigReque
|
|
|
60
60
|
import type {AtlaspackBuildRequestResult} from './requests/AtlaspackBuildRequest';
|
|
61
61
|
import type {EntryRequestResult} from './requests/EntryRequest';
|
|
62
62
|
import type {BundleGraphResult} from './requests/BundleGraphRequest';
|
|
63
|
-
import {deserialize, serialize} from '
|
|
63
|
+
import {deserialize, serialize} from '@atlaspack/build-cache';
|
|
64
64
|
import type {
|
|
65
65
|
AssetRequestResult,
|
|
66
66
|
AtlaspackOptions,
|
package/src/UncommittedAsset.js
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
SOURCEMAP_RE,
|
|
24
24
|
} from '@atlaspack/utils';
|
|
25
25
|
import {hashString, hashBuffer, Hash} from '@atlaspack/rust';
|
|
26
|
-
import {serializeRaw} from '
|
|
26
|
+
import {serializeRaw} from '@atlaspack/build-cache';
|
|
27
27
|
import {createDependency, mergeDependencies} from './Dependency';
|
|
28
28
|
import {mergeEnvironments} from './Environment';
|
|
29
29
|
import {ATLASPACK_VERSION} from './constants';
|
package/src/assetUtils.js
CHANGED
|
@@ -30,7 +30,7 @@ import {Asset as PublicAsset} from './public/Asset';
|
|
|
30
30
|
import PluginOptions from './public/PluginOptions';
|
|
31
31
|
import {blobToStream, hashFile} from '@atlaspack/utils';
|
|
32
32
|
import {hashFromOption, toInternalSourceLocation} from './utils';
|
|
33
|
-
import {createBuildCache} from '
|
|
33
|
+
import {createBuildCache} from '@atlaspack/build-cache';
|
|
34
34
|
import {
|
|
35
35
|
type ProjectPath,
|
|
36
36
|
fromProjectPath,
|
package/src/index.js
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
-
// Needs to be exported first because of circular imports
|
|
4
|
-
export {
|
|
5
|
-
registerSerializableClass,
|
|
6
|
-
unregisterSerializableClass,
|
|
7
|
-
prepareForSerialization,
|
|
8
|
-
restoreDeserializedObject,
|
|
9
|
-
serialize,
|
|
10
|
-
deserialize,
|
|
11
|
-
} from './serializer';
|
|
12
|
-
|
|
13
3
|
export {
|
|
14
4
|
default,
|
|
15
5
|
default as Atlaspack,
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
// @flow
|
|
2
|
+
|
|
3
|
+
import {registerSerializableClass} from '@atlaspack/build-cache';
|
|
2
4
|
import {Graph} from '@atlaspack/graph';
|
|
3
|
-
|
|
5
|
+
|
|
6
|
+
import packageJson from '../package.json';
|
|
7
|
+
|
|
8
|
+
import AtlaspackConfig from './AtlaspackConfig';
|
|
4
9
|
import AssetGraph from './AssetGraph';
|
|
5
10
|
import BundleGraph from './BundleGraph';
|
|
6
|
-
import AtlaspackConfig from './AtlaspackConfig';
|
|
7
|
-
import {RequestGraph} from './RequestTracker';
|
|
8
11
|
import Config from './public/Config';
|
|
9
|
-
import
|
|
12
|
+
import {RequestGraph} from './RequestTracker';
|
|
10
13
|
|
|
11
14
|
let coreRegistered;
|
|
12
15
|
export function registerCoreWithSerializer() {
|
|
@@ -36,7 +36,7 @@ import invariant from 'assert';
|
|
|
36
36
|
import AtlaspackConfigSchema from '../AtlaspackConfig.schema';
|
|
37
37
|
import {optionsProxy} from '../utils';
|
|
38
38
|
import AtlaspackConfig from '../AtlaspackConfig';
|
|
39
|
-
import {createBuildCache} from '
|
|
39
|
+
import {createBuildCache} from '@atlaspack/build-cache';
|
|
40
40
|
import {toProjectPath} from '../projectPath';
|
|
41
41
|
import {requestTypes} from '../RequestTracker';
|
|
42
42
|
|
|
@@ -18,7 +18,7 @@ import type {LoadedPlugin} from '../AtlaspackConfig';
|
|
|
18
18
|
import type {RequestResult, RunAPI} from '../RequestTracker';
|
|
19
19
|
import type {ProjectPath} from '../projectPath';
|
|
20
20
|
|
|
21
|
-
import {serializeRaw} from '
|
|
21
|
+
import {createBuildCache, serializeRaw} from '@atlaspack/build-cache';
|
|
22
22
|
import {PluginLogger} from '@atlaspack/logger';
|
|
23
23
|
import PluginOptions from '../public/PluginOptions';
|
|
24
24
|
import ThrowableDiagnostic, {errorToDiagnostic} from '@atlaspack/diagnostic';
|
|
@@ -29,7 +29,6 @@ import {hashString, Hash} from '@atlaspack/rust';
|
|
|
29
29
|
import {PluginTracer} from '@atlaspack/profiler';
|
|
30
30
|
import {requestTypes} from '../RequestTracker';
|
|
31
31
|
import {fromProjectPath, fromProjectPathRelative} from '../projectPath';
|
|
32
|
-
import {createBuildCache} from '../buildCache';
|
|
33
32
|
|
|
34
33
|
export type PluginWithLoadConfig = {
|
|
35
34
|
loadConfig?: ({|
|
|
@@ -15,7 +15,7 @@ import type {ProjectPath} from '../projectPath';
|
|
|
15
15
|
|
|
16
16
|
import nullthrows from 'nullthrows';
|
|
17
17
|
import {getInvalidationHash} from '../assetUtils';
|
|
18
|
-
import {createBuildCache} from '
|
|
18
|
+
import {createBuildCache} from '@atlaspack/build-cache';
|
|
19
19
|
import {invalidateOnFileCreateToInternal} from '../utils';
|
|
20
20
|
import {
|
|
21
21
|
fromProjectPath,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
toProjectPathUnsafe,
|
|
41
41
|
} from '../projectPath';
|
|
42
42
|
import {Priority} from '../types';
|
|
43
|
-
import {createBuildCache} from '
|
|
43
|
+
import {createBuildCache} from '@atlaspack/build-cache';
|
|
44
44
|
import type {LoadedPlugin} from '../AtlaspackConfig';
|
|
45
45
|
import {createConfig} from '../InternalConfig';
|
|
46
46
|
import {loadPluginConfig, runConfigRequest} from './ConfigRequest';
|
package/src/worker.js
CHANGED
|
@@ -22,7 +22,7 @@ import PackagerRunner, {type RunPackagerRunnerResult} from './PackagerRunner';
|
|
|
22
22
|
import Validation, {type ValidationOpts} from './Validation';
|
|
23
23
|
import AtlaspackConfig from './AtlaspackConfig';
|
|
24
24
|
import {registerCoreWithSerializer} from './registerCoreWithSerializer';
|
|
25
|
-
import {clearBuildCaches} from '
|
|
25
|
+
import {clearBuildCaches} from '@atlaspack/build-cache';
|
|
26
26
|
import {init as initSourcemaps} from '@parcel/source-map';
|
|
27
27
|
import {init as initRust} from '@atlaspack/rust';
|
|
28
28
|
import WorkerFarm from '@atlaspack/workers';
|
package/lib/buildCache.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.clearBuildCaches = clearBuildCaches;
|
|
7
|
-
exports.createBuildCache = createBuildCache;
|
|
8
|
-
const buildCaches = [];
|
|
9
|
-
function createBuildCache() {
|
|
10
|
-
let cache = new Map();
|
|
11
|
-
buildCaches.push(cache);
|
|
12
|
-
return cache;
|
|
13
|
-
}
|
|
14
|
-
function clearBuildCaches() {
|
|
15
|
-
for (let cache of buildCaches) {
|
|
16
|
-
cache.clear();
|
|
17
|
-
}
|
|
18
|
-
}
|