@atlaspack/core 2.12.1-dev.3398 → 2.12.1-dev.3401
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/package.json +16 -16
- package/src/AtlaspackConfig.schema.js +1 -1
- package/test/Atlaspack.test.js +22 -22
|
@@ -23,7 +23,7 @@ function validatePackageName(pkg, pluginType, key) {
|
|
|
23
23
|
(0, _assert().default)(typeof pkg === 'string', `"${key}" must be a string`);
|
|
24
24
|
|
|
25
25
|
// Probably all of these need to be removed
|
|
26
|
-
if (pkg.startsWith('@atlaspack')) {
|
|
26
|
+
if (pkg.startsWith('@atlaspack') || pkg.startsWith('@parcel')) {
|
|
27
27
|
(0, _assert().default)(pkg.replace(/^@atlaspack\//, '').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
|
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.3401+b483af77f",
|
|
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-dev.
|
|
24
|
-
"@atlaspack/diagnostic": "2.12.1-dev.
|
|
25
|
-
"@atlaspack/events": "2.12.1-dev.
|
|
26
|
-
"@atlaspack/feature-flags": "2.12.1-dev.
|
|
27
|
-
"@atlaspack/fs": "2.12.1-dev.
|
|
28
|
-
"@atlaspack/graph": "3.2.1-dev.
|
|
29
|
-
"@atlaspack/logger": "2.12.1-dev.
|
|
30
|
-
"@atlaspack/package-manager": "2.12.1-dev.
|
|
31
|
-
"@atlaspack/plugin": "2.12.1-dev.
|
|
32
|
-
"@atlaspack/profiler": "2.12.1-dev.
|
|
33
|
-
"@atlaspack/rust": "2.12.1-dev.
|
|
34
|
-
"@atlaspack/types": "2.12.1-dev.
|
|
35
|
-
"@atlaspack/utils": "2.12.1-dev.
|
|
36
|
-
"@atlaspack/workers": "2.12.1-dev.
|
|
23
|
+
"@atlaspack/cache": "2.12.1-dev.3401+b483af77f",
|
|
24
|
+
"@atlaspack/diagnostic": "2.12.1-dev.3401+b483af77f",
|
|
25
|
+
"@atlaspack/events": "2.12.1-dev.3401+b483af77f",
|
|
26
|
+
"@atlaspack/feature-flags": "2.12.1-dev.3401+b483af77f",
|
|
27
|
+
"@atlaspack/fs": "2.12.1-dev.3401+b483af77f",
|
|
28
|
+
"@atlaspack/graph": "3.2.1-dev.3401+b483af77f",
|
|
29
|
+
"@atlaspack/logger": "2.12.1-dev.3401+b483af77f",
|
|
30
|
+
"@atlaspack/package-manager": "2.12.1-dev.3401+b483af77f",
|
|
31
|
+
"@atlaspack/plugin": "2.12.1-dev.3401+b483af77f",
|
|
32
|
+
"@atlaspack/profiler": "2.12.1-dev.3401+b483af77f",
|
|
33
|
+
"@atlaspack/rust": "2.12.1-dev.3401+b483af77f",
|
|
34
|
+
"@atlaspack/types": "2.12.1-dev.3401+b483af77f",
|
|
35
|
+
"@atlaspack/utils": "2.12.1-dev.3401+b483af77f",
|
|
36
|
+
"@atlaspack/workers": "2.12.1-dev.3401+b483af77f",
|
|
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": "b483af77f02d1258c8dad156e097b94f83671d8e"
|
|
59
59
|
}
|
|
@@ -18,7 +18,7 @@ export function validatePackageName(
|
|
|
18
18
|
assert(typeof pkg === 'string', `"${key}" must be a string`);
|
|
19
19
|
|
|
20
20
|
// Probably all of these need to be removed
|
|
21
|
-
if (pkg.startsWith('@atlaspack')) {
|
|
21
|
+
if (pkg.startsWith('@atlaspack') || pkg.startsWith('@parcel')) {
|
|
22
22
|
assert(
|
|
23
23
|
pkg.replace(/^@atlaspack\//, '').startsWith(`${pluginType}-`),
|
|
24
24
|
`Official atlaspack ${pluginType} packages must be named according to "@atlaspack/${pluginType}-{name}"`,
|
package/test/Atlaspack.test.js
CHANGED
|
@@ -6,7 +6,7 @@ import WorkerFarm from '@atlaspack/workers';
|
|
|
6
6
|
import sinon from 'sinon';
|
|
7
7
|
import assert from 'assert';
|
|
8
8
|
import path from 'path';
|
|
9
|
-
import
|
|
9
|
+
import Atlaspack, {createWorkerFarm} from '../src/Atlaspack';
|
|
10
10
|
|
|
11
11
|
describe('Atlaspack', function () {
|
|
12
12
|
this.timeout(75000);
|
|
@@ -20,10 +20,10 @@ describe('Atlaspack', function () {
|
|
|
20
20
|
|
|
21
21
|
it('does not initialize when passed an ending farm', async () => {
|
|
22
22
|
workerFarm.ending = true;
|
|
23
|
-
let
|
|
23
|
+
let atlaspack = createAtlaspack({workerFarm});
|
|
24
24
|
|
|
25
25
|
// $FlowFixMe
|
|
26
|
-
await assert.rejects(() =>
|
|
26
|
+
await assert.rejects(() => atlaspack.run(), {
|
|
27
27
|
name: 'Error',
|
|
28
28
|
message: 'Supplied WorkerFarm is ending',
|
|
29
29
|
});
|
|
@@ -31,7 +31,7 @@ describe('Atlaspack', function () {
|
|
|
31
31
|
workerFarm.ending = false;
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
describe('
|
|
34
|
+
describe('atlaspack.end()', () => {
|
|
35
35
|
let endSpy;
|
|
36
36
|
beforeEach(() => {
|
|
37
37
|
endSpy = sinon.spy(WorkerFarm.prototype, 'end');
|
|
@@ -42,31 +42,31 @@ describe('Atlaspack', function () {
|
|
|
42
42
|
});
|
|
43
43
|
|
|
44
44
|
it('ends any WorkerFarm it creates', async () => {
|
|
45
|
-
let
|
|
46
|
-
await
|
|
45
|
+
let atlaspack = createAtlaspack();
|
|
46
|
+
await atlaspack.run();
|
|
47
47
|
assert.equal(endSpy.callCount, 1);
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
it('runs and constructs another farm for subsequent builds', async () => {
|
|
51
|
-
let
|
|
51
|
+
let atlaspack = createAtlaspack();
|
|
52
52
|
|
|
53
|
-
await
|
|
54
|
-
await
|
|
53
|
+
await atlaspack.run();
|
|
54
|
+
await atlaspack.run();
|
|
55
55
|
|
|
56
56
|
assert.equal(endSpy.callCount, 2);
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
it('does not end passed WorkerFarms', async () => {
|
|
60
|
-
let
|
|
61
|
-
await
|
|
60
|
+
let atlaspack = createAtlaspack({workerFarm});
|
|
61
|
+
await atlaspack.run();
|
|
62
62
|
assert.equal(endSpy.callCount, 0);
|
|
63
63
|
|
|
64
64
|
await workerFarm.end();
|
|
65
65
|
});
|
|
66
66
|
|
|
67
67
|
it('removes shared references it creates', async () => {
|
|
68
|
-
let
|
|
69
|
-
await
|
|
68
|
+
let atlaspack = createAtlaspack({workerFarm});
|
|
69
|
+
await atlaspack.run();
|
|
70
70
|
|
|
71
71
|
assert.equal(workerFarm.sharedReferences.size, 0);
|
|
72
72
|
assert.equal(workerFarm.sharedReferencesByValue.size, 0);
|
|
@@ -85,10 +85,10 @@ describe('AtlaspackAPI', function () {
|
|
|
85
85
|
|
|
86
86
|
afterEach(() => workerFarm.end());
|
|
87
87
|
|
|
88
|
-
describe('
|
|
88
|
+
describe('atlaspack.unstable_transform()', () => {
|
|
89
89
|
it('should transform simple file', async () => {
|
|
90
|
-
let
|
|
91
|
-
let res = await
|
|
90
|
+
let atlaspack = createAtlaspack({workerFarm});
|
|
91
|
+
let res = await atlaspack.unstable_transform({
|
|
92
92
|
filePath: path.join(__dirname, 'fixtures/atlaspack/index.js'),
|
|
93
93
|
});
|
|
94
94
|
let code = await res[0].getCode();
|
|
@@ -96,8 +96,8 @@ describe('AtlaspackAPI', function () {
|
|
|
96
96
|
});
|
|
97
97
|
|
|
98
98
|
it('should transform with standalone mode', async () => {
|
|
99
|
-
let
|
|
100
|
-
let res = await
|
|
99
|
+
let atlaspack = createAtlaspack({workerFarm});
|
|
100
|
+
let res = await atlaspack.unstable_transform({
|
|
101
101
|
filePath: path.join(__dirname, 'fixtures/atlaspack/other.js'),
|
|
102
102
|
query: 'standalone=true',
|
|
103
103
|
});
|
|
@@ -109,10 +109,10 @@ describe('AtlaspackAPI', function () {
|
|
|
109
109
|
});
|
|
110
110
|
});
|
|
111
111
|
|
|
112
|
-
describe('
|
|
112
|
+
describe('atlaspack.resolve()', () => {
|
|
113
113
|
it('should resolve dependencies', async () => {
|
|
114
|
-
let
|
|
115
|
-
let res = await
|
|
114
|
+
let atlaspack = createAtlaspack({workerFarm});
|
|
115
|
+
let res = await atlaspack.unstable_resolve({
|
|
116
116
|
specifier: './other',
|
|
117
117
|
specifierType: 'esm',
|
|
118
118
|
resolveFrom: path.join(__dirname, 'fixtures/atlaspack/index.js'),
|
|
@@ -129,7 +129,7 @@ describe('AtlaspackAPI', function () {
|
|
|
129
129
|
});
|
|
130
130
|
|
|
131
131
|
function createAtlaspack(opts?: InitialAtlaspackOptions) {
|
|
132
|
-
return new
|
|
132
|
+
return new Atlaspack({
|
|
133
133
|
entries: [path.join(__dirname, 'fixtures/atlaspack/index.js')],
|
|
134
134
|
logLevel: 'info',
|
|
135
135
|
defaultConfig: path.join(
|