@atlaspack/core 2.12.1-canary.3374 → 2.12.1-canary.3376
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/AtlaspackConfig.schema.js +1 -1
- package/lib/atlaspack-v3/AtlaspackV3.js +0 -8
- package/lib/atlaspack-v3/worker/worker.js +18 -1
- package/package.json +16 -16
- package/src/AtlaspackConfig.schema.js +1 -1
- package/src/atlaspack-v3/AtlaspackV3.js +0 -11
- package/src/atlaspack-v3/worker/worker.js +15 -2
- package/lib/atlaspack-v3/plugins/Resolver.js +0 -12
- package/lib/atlaspack-v3/plugins/index.js +0 -16
- package/src/atlaspack-v3/plugins/Resolver.js +0 -9
- package/src/atlaspack-v3/plugins/index.js +0 -3
|
@@ -24,7 +24,7 @@ function validatePackageName(pkg, pluginType, key) {
|
|
|
24
24
|
|
|
25
25
|
// Probably all of these need to be removed
|
|
26
26
|
if (pkg.startsWith('@atlaspack') || pkg.startsWith('@parcel')) {
|
|
27
|
-
(0, _assert().default)(pkg.replace(/^@atlaspack\//, '').startsWith(`${pluginType}-`), `Official atlaspack ${pluginType} packages must be named according to "@atlaspack/${pluginType}-{name}"`);
|
|
27
|
+
(0, _assert().default)(pkg.replace(/^@(atlaspack|parcel)\//, '').startsWith(`${pluginType}-`), `Official atlaspack ${pluginType} packages must be named according to "@atlaspack/${pluginType}-{name}"`);
|
|
28
28
|
} else if (pkg.startsWith('@')) {
|
|
29
29
|
// Disabling this validation to allow for migration to parcel
|
|
30
30
|
// let [scope, name] = pkg.split('/');
|
|
@@ -43,14 +43,6 @@ class AtlaspackV3 {
|
|
|
43
43
|
options
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
async build() {
|
|
47
|
-
const [workers, registerWorker] = this.#createWorkers();
|
|
48
|
-
let result = await this._internal.build({
|
|
49
|
-
registerWorker
|
|
50
|
-
});
|
|
51
|
-
for (const worker of workers) worker.terminate();
|
|
52
|
-
return result;
|
|
53
|
-
}
|
|
54
46
|
async buildAssetGraph() {
|
|
55
47
|
const [workers, registerWorker] = this.#createWorkers();
|
|
56
48
|
let result = await this._internal.buildAssetGraph({
|
|
@@ -18,13 +18,30 @@ function _worker_threads() {
|
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
|
+
function _module() {
|
|
22
|
+
const data = _interopRequireWildcard(require("module"));
|
|
23
|
+
_module = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
21
28
|
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); }
|
|
22
29
|
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; }
|
|
23
30
|
class AtlaspackWorker {
|
|
24
|
-
#
|
|
31
|
+
#transformers;
|
|
32
|
+
constructor() {
|
|
33
|
+
this.#transformers = new Map();
|
|
34
|
+
}
|
|
25
35
|
ping() {
|
|
26
36
|
// console.log('Hi');
|
|
27
37
|
}
|
|
38
|
+
async transformerRegister(resolve_from, specifier) {
|
|
39
|
+
let customRequire = _module().createRequire(resolve_from);
|
|
40
|
+
let resolvedPath = customRequire.resolve(specifier);
|
|
41
|
+
// $FlowFixMe
|
|
42
|
+
let transformer = await import(resolvedPath);
|
|
43
|
+
this.#transformers.set(`${resolve_from}:${specifier}`, transformer);
|
|
44
|
+
}
|
|
28
45
|
}
|
|
29
46
|
exports.AtlaspackWorker = AtlaspackWorker;
|
|
30
47
|
napi().registerWorker(_worker_threads().workerData.tx_worker, new AtlaspackWorker());
|
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.3376+1fce00015",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -20,20 +20,20 @@
|
|
|
20
20
|
"check-ts": "tsc --noEmit index.d.ts"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@atlaspack/cache": "2.12.1-canary.
|
|
24
|
-
"@atlaspack/diagnostic": "2.12.1-canary.
|
|
25
|
-
"@atlaspack/events": "2.12.1-canary.
|
|
26
|
-
"@atlaspack/feature-flags": "2.12.1-canary.
|
|
27
|
-
"@atlaspack/fs": "2.12.1-canary.
|
|
28
|
-
"@atlaspack/graph": "3.2.1-canary.
|
|
29
|
-
"@atlaspack/logger": "2.12.1-canary.
|
|
30
|
-
"@atlaspack/package-manager": "2.12.1-canary.
|
|
31
|
-
"@atlaspack/plugin": "2.12.1-canary.
|
|
32
|
-
"@atlaspack/profiler": "2.12.1-canary.
|
|
33
|
-
"@atlaspack/rust": "2.12.1-canary.
|
|
34
|
-
"@atlaspack/types": "2.12.1-canary.
|
|
35
|
-
"@atlaspack/utils": "2.12.1-canary.
|
|
36
|
-
"@atlaspack/workers": "2.12.1-canary.
|
|
23
|
+
"@atlaspack/cache": "2.12.1-canary.3376+1fce00015",
|
|
24
|
+
"@atlaspack/diagnostic": "2.12.1-canary.3376+1fce00015",
|
|
25
|
+
"@atlaspack/events": "2.12.1-canary.3376+1fce00015",
|
|
26
|
+
"@atlaspack/feature-flags": "2.12.1-canary.3376+1fce00015",
|
|
27
|
+
"@atlaspack/fs": "2.12.1-canary.3376+1fce00015",
|
|
28
|
+
"@atlaspack/graph": "3.2.1-canary.3376+1fce00015",
|
|
29
|
+
"@atlaspack/logger": "2.12.1-canary.3376+1fce00015",
|
|
30
|
+
"@atlaspack/package-manager": "2.12.1-canary.3376+1fce00015",
|
|
31
|
+
"@atlaspack/plugin": "2.12.1-canary.3376+1fce00015",
|
|
32
|
+
"@atlaspack/profiler": "2.12.1-canary.3376+1fce00015",
|
|
33
|
+
"@atlaspack/rust": "2.12.1-canary.3376+1fce00015",
|
|
34
|
+
"@atlaspack/types": "2.12.1-canary.3376+1fce00015",
|
|
35
|
+
"@atlaspack/utils": "2.12.1-canary.3376+1fce00015",
|
|
36
|
+
"@atlaspack/workers": "2.12.1-canary.3376+1fce00015",
|
|
37
37
|
"@mischnic/json-sourcemap": "^0.1.0",
|
|
38
38
|
"@parcel/source-map": "^2.1.1",
|
|
39
39
|
"base-x": "^3.0.8",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"browser": {
|
|
56
56
|
"./src/serializerCore.js": "./src/serializerCore.browser.js"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "1fce000155c511e503e91511f6bc77a7c402fa31"
|
|
59
59
|
}
|
|
@@ -20,7 +20,7 @@ export function validatePackageName(
|
|
|
20
20
|
// Probably all of these need to be removed
|
|
21
21
|
if (pkg.startsWith('@atlaspack') || pkg.startsWith('@parcel')) {
|
|
22
22
|
assert(
|
|
23
|
-
pkg.replace(/^@atlaspack\//, '').startsWith(`${pluginType}-`),
|
|
23
|
+
pkg.replace(/^@(atlaspack|parcel)\//, '').startsWith(`${pluginType}-`),
|
|
24
24
|
`Official atlaspack ${pluginType} packages must be named according to "@atlaspack/${pluginType}-{name}"`,
|
|
25
25
|
);
|
|
26
26
|
} else if (pkg.startsWith('@')) {
|
|
@@ -33,17 +33,6 @@ export class AtlaspackV3 {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
async build(): Promise<any> {
|
|
37
|
-
const [workers, registerWorker] = this.#createWorkers();
|
|
38
|
-
|
|
39
|
-
let result = await this._internal.build({
|
|
40
|
-
registerWorker,
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
for (const worker of workers) worker.terminate();
|
|
44
|
-
return result;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
36
|
async buildAssetGraph(): Promise<any> {
|
|
48
37
|
const [workers, registerWorker] = this.#createWorkers();
|
|
49
38
|
|
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
import * as napi from '@atlaspack/rust';
|
|
3
|
+
import type {Transformer} from '@atlaspack/types';
|
|
3
4
|
import {workerData} from 'worker_threads';
|
|
4
|
-
import
|
|
5
|
+
import * as module from 'module';
|
|
5
6
|
|
|
6
7
|
export class AtlaspackWorker {
|
|
7
|
-
#
|
|
8
|
+
#transformers: Map<string, Transformer<any>>;
|
|
9
|
+
|
|
10
|
+
constructor() {
|
|
11
|
+
this.#transformers = new Map();
|
|
12
|
+
}
|
|
8
13
|
|
|
9
14
|
ping() {
|
|
10
15
|
// console.log('Hi');
|
|
11
16
|
}
|
|
17
|
+
|
|
18
|
+
async transformerRegister(resolve_from: string, specifier: string) {
|
|
19
|
+
let customRequire = module.createRequire(resolve_from);
|
|
20
|
+
let resolvedPath = customRequire.resolve(specifier);
|
|
21
|
+
// $FlowFixMe
|
|
22
|
+
let transformer = await import(resolvedPath);
|
|
23
|
+
this.#transformers.set(`${resolve_from}:${specifier}`, transformer);
|
|
24
|
+
}
|
|
12
25
|
}
|
|
13
26
|
|
|
14
27
|
napi.registerWorker(workerData.tx_worker, new AtlaspackWorker());
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _Resolver = require("./Resolver");
|
|
7
|
-
Object.keys(_Resolver).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _Resolver[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _Resolver[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|