@atlaspack/core 2.13.2-canary.3699 → 2.13.2-canary.3704
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/Atlaspack.js +1 -1
- package/lib/atlaspack-v3/AtlaspackV3.js +13 -4
- package/package.json +17 -17
- package/src/Atlaspack.js +1 -1
- package/src/atlaspack-v3/AtlaspackV3.js +25 -9
package/lib/Atlaspack.js
CHANGED
|
@@ -205,7 +205,7 @@ class Atlaspack {
|
|
|
205
205
|
// $FlowFixMe
|
|
206
206
|
const version = require('../package.json').version;
|
|
207
207
|
await lmdb.put('current_session_version', Buffer.from(version));
|
|
208
|
-
rustAtlaspack =
|
|
208
|
+
rustAtlaspack = await _atlaspackV.AtlaspackV3.create({
|
|
209
209
|
...options,
|
|
210
210
|
corePath: _path().default.join(__dirname, '..'),
|
|
211
211
|
threads: process.env.NODE_ENV === 'test' ? 2 : undefined,
|
|
@@ -21,7 +21,10 @@ function _diagnostic() {
|
|
|
21
21
|
}
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
class AtlaspackV3 {
|
|
24
|
-
constructor({
|
|
24
|
+
constructor(atlaspack_napi) {
|
|
25
|
+
this._atlaspack_napi = atlaspack_napi;
|
|
26
|
+
}
|
|
27
|
+
static async create({
|
|
25
28
|
fs,
|
|
26
29
|
packageManager,
|
|
27
30
|
threads,
|
|
@@ -33,16 +36,22 @@ class AtlaspackV3 {
|
|
|
33
36
|
options.defaultTargetOptions = options.defaultTargetOptions || {};
|
|
34
37
|
// $FlowFixMe "engines" are readonly
|
|
35
38
|
options.defaultTargetOptions.engines = options.defaultTargetOptions.engines || {};
|
|
36
|
-
|
|
39
|
+
const [internal, error] = await (0, _rust().atlaspackNapiCreate)({
|
|
37
40
|
fs,
|
|
38
41
|
packageManager,
|
|
39
42
|
threads,
|
|
40
43
|
options,
|
|
41
44
|
napiWorkerPool
|
|
42
45
|
}, lmdb);
|
|
46
|
+
if (error !== null) {
|
|
47
|
+
throw new (_diagnostic().default)({
|
|
48
|
+
diagnostic: error
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return new AtlaspackV3(internal);
|
|
43
52
|
}
|
|
44
53
|
async buildAssetGraph() {
|
|
45
|
-
let [graph, error] = await this.
|
|
54
|
+
let [graph, error] = await (0, _rust().atlaspackNapiBuildAssetGraph)(this._atlaspack_napi);
|
|
46
55
|
if (error !== null) {
|
|
47
56
|
throw new (_diagnostic().default)({
|
|
48
57
|
diagnostic: error
|
|
@@ -51,7 +60,7 @@ class AtlaspackV3 {
|
|
|
51
60
|
return graph;
|
|
52
61
|
}
|
|
53
62
|
respondToFsEvents(events) {
|
|
54
|
-
return this.
|
|
63
|
+
return (0, _rust().atlaspackNapiRespondToFsEvents)(this._atlaspack_napi, events);
|
|
55
64
|
}
|
|
56
65
|
}
|
|
57
66
|
exports.AtlaspackV3 = AtlaspackV3;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/core",
|
|
3
|
-
"version": "2.13.2-canary.
|
|
3
|
+
"version": "2.13.2-canary.3704+44de3f238",
|
|
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.13.2-canary.
|
|
24
|
-
"@atlaspack/cache": "2.13.2-canary.
|
|
25
|
-
"@atlaspack/diagnostic": "2.13.2-canary.
|
|
26
|
-
"@atlaspack/events": "2.13.2-canary.
|
|
27
|
-
"@atlaspack/feature-flags": "2.13.2-canary.
|
|
28
|
-
"@atlaspack/fs": "2.13.2-canary.
|
|
29
|
-
"@atlaspack/graph": "3.3.2-canary.
|
|
30
|
-
"@atlaspack/logger": "2.13.2-canary.
|
|
31
|
-
"@atlaspack/package-manager": "2.13.2-canary.
|
|
32
|
-
"@atlaspack/plugin": "2.13.2-canary.
|
|
33
|
-
"@atlaspack/profiler": "2.13.2-canary.
|
|
34
|
-
"@atlaspack/rust": "2.13.2-canary.
|
|
35
|
-
"@atlaspack/types": "2.13.2-canary.
|
|
36
|
-
"@atlaspack/utils": "2.13.2-canary.
|
|
37
|
-
"@atlaspack/workers": "2.13.2-canary.
|
|
23
|
+
"@atlaspack/build-cache": "2.13.2-canary.3704+44de3f238",
|
|
24
|
+
"@atlaspack/cache": "2.13.2-canary.3704+44de3f238",
|
|
25
|
+
"@atlaspack/diagnostic": "2.13.2-canary.3704+44de3f238",
|
|
26
|
+
"@atlaspack/events": "2.13.2-canary.3704+44de3f238",
|
|
27
|
+
"@atlaspack/feature-flags": "2.13.2-canary.3704+44de3f238",
|
|
28
|
+
"@atlaspack/fs": "2.13.2-canary.3704+44de3f238",
|
|
29
|
+
"@atlaspack/graph": "3.3.2-canary.3704+44de3f238",
|
|
30
|
+
"@atlaspack/logger": "2.13.2-canary.3704+44de3f238",
|
|
31
|
+
"@atlaspack/package-manager": "2.13.2-canary.3704+44de3f238",
|
|
32
|
+
"@atlaspack/plugin": "2.13.2-canary.3704+44de3f238",
|
|
33
|
+
"@atlaspack/profiler": "2.13.2-canary.3704+44de3f238",
|
|
34
|
+
"@atlaspack/rust": "2.13.2-canary.3704+44de3f238",
|
|
35
|
+
"@atlaspack/types": "2.13.2-canary.3704+44de3f238",
|
|
36
|
+
"@atlaspack/utils": "2.13.2-canary.3704+44de3f238",
|
|
37
|
+
"@atlaspack/workers": "2.13.2-canary.3704+44de3f238",
|
|
38
38
|
"@mischnic/json-sourcemap": "^0.1.0",
|
|
39
39
|
"@parcel/source-map": "^2.1.1",
|
|
40
40
|
"base-x": "^3.0.8",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"./src/serializerCore.js": "./src/serializerCore.browser.js"
|
|
68
68
|
},
|
|
69
69
|
"type": "commonjs",
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "44de3f2387eb8e9e6e2941b662f4ab42d615723e"
|
|
71
71
|
}
|
package/src/Atlaspack.js
CHANGED
|
@@ -162,7 +162,7 @@ export default class Atlaspack {
|
|
|
162
162
|
const version = require('../package.json').version;
|
|
163
163
|
await lmdb.put('current_session_version', Buffer.from(version));
|
|
164
164
|
|
|
165
|
-
rustAtlaspack =
|
|
165
|
+
rustAtlaspack = await AtlaspackV3.create({
|
|
166
166
|
...options,
|
|
167
167
|
corePath: path.join(__dirname, '..'),
|
|
168
168
|
threads: process.env.NODE_ENV === 'test' ? 2 : undefined,
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
-
|
|
4
|
+
atlaspackNapiCreate,
|
|
5
|
+
atlaspackNapiBuildAssetGraph,
|
|
6
|
+
atlaspackNapiRespondToFsEvents,
|
|
7
|
+
type AtlaspackNapi,
|
|
5
8
|
type Lmdb,
|
|
6
9
|
type AtlaspackNapiOptions,
|
|
7
10
|
} from '@atlaspack/rust';
|
|
@@ -24,24 +27,27 @@ export type AtlaspackV3Options = {|
|
|
|
24
27
|
|};
|
|
25
28
|
|
|
26
29
|
export class AtlaspackV3 {
|
|
27
|
-
|
|
28
|
-
_workerIds: any[];
|
|
30
|
+
_atlaspack_napi: AtlaspackNapi;
|
|
29
31
|
|
|
30
|
-
constructor({
|
|
32
|
+
constructor(atlaspack_napi: AtlaspackNapi) {
|
|
33
|
+
this._atlaspack_napi = atlaspack_napi;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static async create({
|
|
31
37
|
fs,
|
|
32
38
|
packageManager,
|
|
33
39
|
threads,
|
|
34
40
|
lmdb,
|
|
35
41
|
napiWorkerPool = new NapiWorkerPool(),
|
|
36
42
|
...options
|
|
37
|
-
}: AtlaspackV3Options) {
|
|
43
|
+
}: AtlaspackV3Options): Promise<AtlaspackV3> {
|
|
38
44
|
options.logLevel = options.logLevel || 'error';
|
|
39
45
|
options.defaultTargetOptions = options.defaultTargetOptions || {};
|
|
40
46
|
// $FlowFixMe "engines" are readonly
|
|
41
47
|
options.defaultTargetOptions.engines =
|
|
42
48
|
options.defaultTargetOptions.engines || {};
|
|
43
49
|
|
|
44
|
-
|
|
50
|
+
const [internal, error] = await atlaspackNapiCreate(
|
|
45
51
|
{
|
|
46
52
|
fs,
|
|
47
53
|
packageManager,
|
|
@@ -51,10 +57,20 @@ export class AtlaspackV3 {
|
|
|
51
57
|
},
|
|
52
58
|
lmdb,
|
|
53
59
|
);
|
|
60
|
+
|
|
61
|
+
if (error !== null) {
|
|
62
|
+
throw new ThrowableDiagnostic({
|
|
63
|
+
diagnostic: error,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return new AtlaspackV3(internal);
|
|
54
68
|
}
|
|
55
69
|
|
|
56
70
|
async buildAssetGraph(): Promise<any> {
|
|
57
|
-
let [graph, error] = await
|
|
71
|
+
let [graph, error] = await atlaspackNapiBuildAssetGraph(
|
|
72
|
+
this._atlaspack_napi,
|
|
73
|
+
);
|
|
58
74
|
|
|
59
75
|
if (error !== null) {
|
|
60
76
|
throw new ThrowableDiagnostic({
|
|
@@ -65,7 +81,7 @@ export class AtlaspackV3 {
|
|
|
65
81
|
return graph;
|
|
66
82
|
}
|
|
67
83
|
|
|
68
|
-
respondToFsEvents(events: Array<Event>):
|
|
69
|
-
return this.
|
|
84
|
+
respondToFsEvents(events: Array<Event>): boolean {
|
|
85
|
+
return atlaspackNapiRespondToFsEvents(this._atlaspack_napi, events);
|
|
70
86
|
}
|
|
71
87
|
}
|