@atlaspack/core 2.14.1-dev.51 → 2.14.1-dev.55
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/isSuperPackage.js +8 -2
- package/lib/loadAtlaspackPlugin.js +2 -1
- package/package.json +17 -17
- package/src/isSuperPackage.js +12 -2
- package/src/loadAtlaspackPlugin.js +2 -1
package/lib/isSuperPackage.js
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
let fs = require('fs');
|
|
4
|
-
let path = require('path');
|
|
5
4
|
let {
|
|
6
5
|
findAncestorFile
|
|
7
6
|
} = require('@atlaspack/rust');
|
|
8
7
|
let dirname = /*#__ATLASPACK_IGNORE__*/__dirname;
|
|
9
|
-
|
|
8
|
+
function isSuperPackage() {
|
|
10
9
|
if (!dirname) {
|
|
11
10
|
return false;
|
|
12
11
|
}
|
|
13
12
|
let packageJson = JSON.parse(fs.readFileSync(findAncestorFile(['package.json'], dirname, '/')));
|
|
14
13
|
return packageJson.name === '@atlaspack/super';
|
|
14
|
+
}
|
|
15
|
+
let result;
|
|
16
|
+
module.exports.isSuperPackage = () => {
|
|
17
|
+
if (result == null) {
|
|
18
|
+
result = isSuperPackage();
|
|
19
|
+
}
|
|
20
|
+
return result;
|
|
15
21
|
};
|
|
@@ -43,7 +43,8 @@ const CONFIG = Symbol.for('parcel-plugin-config');
|
|
|
43
43
|
async function loadPlugin(pluginName, configPath, keyPath, options) {
|
|
44
44
|
if (_internalPlugins.default && _internalPlugins.default[pluginName]) {
|
|
45
45
|
let plugin = _internalPlugins.default[pluginName]();
|
|
46
|
-
plugin = plugin.default
|
|
46
|
+
plugin = plugin.default || plugin;
|
|
47
|
+
plugin = plugin[CONFIG];
|
|
47
48
|
if (!plugin) {
|
|
48
49
|
throw new Error(`Plugin ${pluginName} is not a valid Atlaspack plugin, should export an instance of a Atlaspack plugin ex. "export default new Reporter({ ... })".`);
|
|
49
50
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/core",
|
|
3
|
-
"version": "2.14.1-dev.
|
|
3
|
+
"version": "2.14.1-dev.55+f298b7f5c",
|
|
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.3-dev.
|
|
24
|
-
"@atlaspack/cache": "2.13.3-dev.
|
|
25
|
-
"@atlaspack/diagnostic": "2.14.1-dev.
|
|
26
|
-
"@atlaspack/events": "2.14.1-dev.
|
|
27
|
-
"@atlaspack/feature-flags": "2.14.1-dev.
|
|
28
|
-
"@atlaspack/fs": "2.14.1-dev.
|
|
29
|
-
"@atlaspack/graph": "3.4.1-dev.
|
|
30
|
-
"@atlaspack/logger": "2.14.1-dev.
|
|
31
|
-
"@atlaspack/package-manager": "2.14.1-dev.
|
|
32
|
-
"@atlaspack/plugin": "2.14.1-dev.
|
|
33
|
-
"@atlaspack/profiler": "2.14.1-dev.
|
|
34
|
-
"@atlaspack/rust": "3.0.1-dev.
|
|
35
|
-
"@atlaspack/types": "2.14.1-dev.
|
|
36
|
-
"@atlaspack/utils": "2.14.1-dev.
|
|
37
|
-
"@atlaspack/workers": "2.14.1-dev.
|
|
23
|
+
"@atlaspack/build-cache": "2.13.3-dev.55+f298b7f5c",
|
|
24
|
+
"@atlaspack/cache": "2.13.3-dev.55+f298b7f5c",
|
|
25
|
+
"@atlaspack/diagnostic": "2.14.1-dev.55+f298b7f5c",
|
|
26
|
+
"@atlaspack/events": "2.14.1-dev.55+f298b7f5c",
|
|
27
|
+
"@atlaspack/feature-flags": "2.14.1-dev.55+f298b7f5c",
|
|
28
|
+
"@atlaspack/fs": "2.14.1-dev.55+f298b7f5c",
|
|
29
|
+
"@atlaspack/graph": "3.4.1-dev.55+f298b7f5c",
|
|
30
|
+
"@atlaspack/logger": "2.14.1-dev.55+f298b7f5c",
|
|
31
|
+
"@atlaspack/package-manager": "2.14.1-dev.55+f298b7f5c",
|
|
32
|
+
"@atlaspack/plugin": "2.14.1-dev.55+f298b7f5c",
|
|
33
|
+
"@atlaspack/profiler": "2.14.1-dev.55+f298b7f5c",
|
|
34
|
+
"@atlaspack/rust": "3.0.1-dev.55+f298b7f5c",
|
|
35
|
+
"@atlaspack/types": "2.14.1-dev.55+f298b7f5c",
|
|
36
|
+
"@atlaspack/utils": "2.14.1-dev.55+f298b7f5c",
|
|
37
|
+
"@atlaspack/workers": "2.14.1-dev.55+f298b7f5c",
|
|
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": "f298b7f5cac438d5150790475bde0cb959b3f6a5"
|
|
71
71
|
}
|
package/src/isSuperPackage.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
let fs = require('fs');
|
|
2
|
-
let path = require('path');
|
|
3
2
|
let {findAncestorFile} = require('@atlaspack/rust');
|
|
3
|
+
|
|
4
4
|
let dirname = /*#__ATLASPACK_IGNORE__*/ __dirname;
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
function isSuperPackage() {
|
|
7
7
|
if (!dirname) {
|
|
8
8
|
return false;
|
|
9
9
|
}
|
|
@@ -13,4 +13,14 @@ module.exports.isSuperPackage = () => {
|
|
|
13
13
|
);
|
|
14
14
|
|
|
15
15
|
return packageJson.name === '@atlaspack/super';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let result;
|
|
19
|
+
|
|
20
|
+
module.exports.isSuperPackage = () => {
|
|
21
|
+
if (result == null) {
|
|
22
|
+
result = isSuperPackage();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return result;
|
|
16
26
|
};
|
|
@@ -32,7 +32,8 @@ export default async function loadPlugin<T>(
|
|
|
32
32
|
|}> {
|
|
33
33
|
if (atlaspackInternalPlugins && atlaspackInternalPlugins[pluginName]) {
|
|
34
34
|
let plugin = atlaspackInternalPlugins[pluginName]();
|
|
35
|
-
plugin = plugin.default
|
|
35
|
+
plugin = plugin.default || plugin;
|
|
36
|
+
plugin = plugin[CONFIG];
|
|
36
37
|
if (!plugin) {
|
|
37
38
|
throw new Error(
|
|
38
39
|
`Plugin ${pluginName} is not a valid Atlaspack plugin, should export an instance of a Atlaspack plugin ex. "export default new Reporter({ ... })".`,
|