@atlaspack/plugin 2.14.5-canary.137 → 2.14.5-canary.139
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/CHANGELOG.md +7 -0
- package/lib/PluginAPI.d.ts +43 -0
- package/lib/PluginAPI.js +0 -30
- package/package.json +8 -8
- package/src/PluginAPI.ts +96 -0
- package/tsconfig.json +4 -0
- package/src/PluginAPI.js +0 -118
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Transformer as TransformerOpts, Resolver as ResolverOpts, Bundler as BundlerOpts, Namer as NamerOpts, Runtime as RuntimeOpts, Packager as PackagerOpts, Optimizer as OptimizerOpts, Compressor as CompressorOpts, Reporter as ReporterOpts, Validator as ValidatorOpts } from '@atlaspack/types';
|
|
2
|
+
declare const CONFIG: unique symbol;
|
|
3
|
+
export declare class Transformer<T = unknown> {
|
|
4
|
+
[CONFIG]: TransformerOpts<T>;
|
|
5
|
+
constructor(opts: TransformerOpts<T>);
|
|
6
|
+
}
|
|
7
|
+
export declare class Resolver<T = unknown> {
|
|
8
|
+
[CONFIG]: ResolverOpts<T>;
|
|
9
|
+
constructor(opts: ResolverOpts<T>);
|
|
10
|
+
}
|
|
11
|
+
export declare class Bundler<T = unknown> {
|
|
12
|
+
[CONFIG]: BundlerOpts<T>;
|
|
13
|
+
constructor(opts: BundlerOpts<T>);
|
|
14
|
+
}
|
|
15
|
+
export declare class Namer<T = unknown> {
|
|
16
|
+
[CONFIG]: NamerOpts<T>;
|
|
17
|
+
constructor(opts: NamerOpts<T>);
|
|
18
|
+
}
|
|
19
|
+
export declare class Runtime<T = unknown> {
|
|
20
|
+
[CONFIG]: RuntimeOpts<T>;
|
|
21
|
+
constructor(opts: RuntimeOpts<T>);
|
|
22
|
+
}
|
|
23
|
+
export declare class Validator {
|
|
24
|
+
[CONFIG]: ValidatorOpts;
|
|
25
|
+
constructor(opts: ValidatorOpts);
|
|
26
|
+
}
|
|
27
|
+
export declare class Packager<T = unknown, U = unknown> {
|
|
28
|
+
[CONFIG]: PackagerOpts<T, U>;
|
|
29
|
+
constructor(opts: PackagerOpts<T, U>);
|
|
30
|
+
}
|
|
31
|
+
export declare class Optimizer<T = unknown, U = unknown> {
|
|
32
|
+
[CONFIG]: OptimizerOpts<T, U>;
|
|
33
|
+
constructor(opts: OptimizerOpts<T, U>);
|
|
34
|
+
}
|
|
35
|
+
export declare class Compressor {
|
|
36
|
+
[CONFIG]: CompressorOpts;
|
|
37
|
+
constructor(opts: CompressorOpts);
|
|
38
|
+
}
|
|
39
|
+
export declare class Reporter {
|
|
40
|
+
[CONFIG]: ReporterOpts;
|
|
41
|
+
constructor(opts: ReporterOpts);
|
|
42
|
+
}
|
|
43
|
+
export {};
|
package/lib/PluginAPI.js
CHANGED
|
@@ -8,91 +8,61 @@ exports.Validator = exports.Transformer = exports.Runtime = exports.Resolver = e
|
|
|
8
8
|
// parcel plugins.
|
|
9
9
|
const CONFIG = Symbol.for('parcel-plugin-config');
|
|
10
10
|
class Transformer {
|
|
11
|
-
// $FlowFixMe: Computed property keys not supported. [unsupported-syntax]
|
|
12
|
-
|
|
13
11
|
constructor(opts) {
|
|
14
|
-
// $FlowFixMe: because an index signature declaring the expected key / value type is missing in
|
|
15
12
|
this[CONFIG] = opts;
|
|
16
13
|
}
|
|
17
14
|
}
|
|
18
15
|
exports.Transformer = Transformer;
|
|
19
16
|
class Resolver {
|
|
20
|
-
// $FlowFixMe: Computed property keys not supported. [unsupported-syntax]
|
|
21
|
-
|
|
22
17
|
constructor(opts) {
|
|
23
|
-
// $FlowFixMe: because an index signature declaring the expected key / value type is missing in
|
|
24
18
|
this[CONFIG] = opts;
|
|
25
19
|
}
|
|
26
20
|
}
|
|
27
21
|
exports.Resolver = Resolver;
|
|
28
22
|
class Bundler {
|
|
29
|
-
// $FlowFixMe: Computed property keys not supported. [unsupported-syntax]
|
|
30
|
-
|
|
31
23
|
constructor(opts) {
|
|
32
|
-
// $FlowFixMe: because an index signature declaring the expected key / value type is missing in
|
|
33
24
|
this[CONFIG] = opts;
|
|
34
25
|
}
|
|
35
26
|
}
|
|
36
27
|
exports.Bundler = Bundler;
|
|
37
28
|
class Namer {
|
|
38
|
-
// $FlowFixMe: Computed property keys not supported. [unsupported-syntax]
|
|
39
|
-
|
|
40
29
|
constructor(opts) {
|
|
41
|
-
// $FlowFixMe: because an index signature declaring the expected key / value type is missing in
|
|
42
30
|
this[CONFIG] = opts;
|
|
43
31
|
}
|
|
44
32
|
}
|
|
45
33
|
exports.Namer = Namer;
|
|
46
34
|
class Runtime {
|
|
47
|
-
// $FlowFixMe: Computed property keys not supported. [unsupported-syntax]
|
|
48
|
-
|
|
49
35
|
constructor(opts) {
|
|
50
|
-
// $FlowFixMe: because an index signature declaring the expected key / value type is missing in
|
|
51
36
|
this[CONFIG] = opts;
|
|
52
37
|
}
|
|
53
38
|
}
|
|
54
39
|
exports.Runtime = Runtime;
|
|
55
40
|
class Validator {
|
|
56
|
-
// $FlowFixMe: Computed property keys not supported. [unsupported-syntax]
|
|
57
|
-
|
|
58
41
|
constructor(opts) {
|
|
59
|
-
// $FlowFixMe: because an index signature declaring the expected key / value type is missing in
|
|
60
42
|
this[CONFIG] = opts;
|
|
61
43
|
}
|
|
62
44
|
}
|
|
63
45
|
exports.Validator = Validator;
|
|
64
46
|
class Packager {
|
|
65
|
-
// $FlowFixMe: Computed property keys not supported. [unsupported-syntax]
|
|
66
|
-
|
|
67
47
|
constructor(opts) {
|
|
68
|
-
// $FlowFixMe: because an index signature declaring the expected key / value type is missing in
|
|
69
48
|
this[CONFIG] = opts;
|
|
70
49
|
}
|
|
71
50
|
}
|
|
72
51
|
exports.Packager = Packager;
|
|
73
52
|
class Optimizer {
|
|
74
|
-
// $FlowFixMe: Computed property keys not supported. [unsupported-syntax]
|
|
75
|
-
|
|
76
53
|
constructor(opts) {
|
|
77
|
-
// $FlowFixMe: because an index signature declaring the expected key / value type is missing in
|
|
78
54
|
this[CONFIG] = opts;
|
|
79
55
|
}
|
|
80
56
|
}
|
|
81
57
|
exports.Optimizer = Optimizer;
|
|
82
58
|
class Compressor {
|
|
83
|
-
// $FlowFixMe: Computed property keys not supported. [unsupported-syntax]
|
|
84
|
-
|
|
85
59
|
constructor(opts) {
|
|
86
|
-
// $FlowFixMe: because an index signature declaring the expected key / value type is missing in
|
|
87
60
|
this[CONFIG] = opts;
|
|
88
61
|
}
|
|
89
62
|
}
|
|
90
63
|
exports.Compressor = Compressor;
|
|
91
64
|
class Reporter {
|
|
92
|
-
// $FlowFixMe: Computed property keys not supported. [unsupported-syntax]
|
|
93
|
-
|
|
94
65
|
constructor(opts) {
|
|
95
|
-
// $FlowFixMe: because an index signature declaring the expected key / value type is missing in
|
|
96
66
|
this[CONFIG] = opts;
|
|
97
67
|
}
|
|
98
68
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/plugin",
|
|
3
|
-
"version": "2.14.5-canary.
|
|
3
|
+
"version": "2.14.5-canary.139+d2fd84977",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"publishConfig": {
|
|
@@ -10,17 +10,17 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://github.com/atlassian-labs/atlaspack.git"
|
|
12
12
|
},
|
|
13
|
-
"main": "lib/PluginAPI.js",
|
|
14
|
-
"source": "src/PluginAPI.
|
|
15
|
-
"types": "
|
|
13
|
+
"main": "./lib/PluginAPI.js",
|
|
14
|
+
"source": "./src/PluginAPI.ts",
|
|
15
|
+
"types": "./lib/PluginAPI.d.ts",
|
|
16
16
|
"engines": {
|
|
17
17
|
"node": ">= 16.0.0"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
|
-
"check-ts": "tsc --
|
|
20
|
+
"check-ts": "tsc --emitDeclarationOnly --rootDir src"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@atlaspack/types": "2.14.5-canary.
|
|
23
|
+
"@atlaspack/types": "2.14.5-canary.139+d2fd84977"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
26
|
-
}
|
|
25
|
+
"gitHead": "d2fd849770fe6305e9c694bd97b1bd905abd9d94"
|
|
26
|
+
}
|
package/src/PluginAPI.ts
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Transformer as TransformerOpts,
|
|
3
|
+
Resolver as ResolverOpts,
|
|
4
|
+
Bundler as BundlerOpts,
|
|
5
|
+
Namer as NamerOpts,
|
|
6
|
+
Runtime as RuntimeOpts,
|
|
7
|
+
Packager as PackagerOpts,
|
|
8
|
+
Optimizer as OptimizerOpts,
|
|
9
|
+
Compressor as CompressorOpts,
|
|
10
|
+
Reporter as ReporterOpts,
|
|
11
|
+
Validator as ValidatorOpts,
|
|
12
|
+
} from '@atlaspack/types';
|
|
13
|
+
|
|
14
|
+
// This uses the `parcel-plugin-config` symbol so it's backwards compatible with
|
|
15
|
+
// parcel plugins.
|
|
16
|
+
const CONFIG = Symbol.for('parcel-plugin-config');
|
|
17
|
+
|
|
18
|
+
export class Transformer<T = unknown> {
|
|
19
|
+
[CONFIG]: TransformerOpts<T>;
|
|
20
|
+
|
|
21
|
+
constructor(opts: TransformerOpts<T>) {
|
|
22
|
+
this[CONFIG] = opts;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export class Resolver<T = unknown> {
|
|
27
|
+
[CONFIG]: ResolverOpts<T>;
|
|
28
|
+
|
|
29
|
+
constructor(opts: ResolverOpts<T>) {
|
|
30
|
+
this[CONFIG] = opts;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export class Bundler<T = unknown> {
|
|
35
|
+
[CONFIG]: BundlerOpts<T>;
|
|
36
|
+
|
|
37
|
+
constructor(opts: BundlerOpts<T>) {
|
|
38
|
+
this[CONFIG] = opts;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export class Namer<T = unknown> {
|
|
43
|
+
[CONFIG]: NamerOpts<T>;
|
|
44
|
+
|
|
45
|
+
constructor(opts: NamerOpts<T>) {
|
|
46
|
+
this[CONFIG] = opts;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export class Runtime<T = unknown> {
|
|
51
|
+
[CONFIG]: RuntimeOpts<T>;
|
|
52
|
+
|
|
53
|
+
constructor(opts: RuntimeOpts<T>) {
|
|
54
|
+
this[CONFIG] = opts;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export class Validator {
|
|
59
|
+
[CONFIG]: ValidatorOpts;
|
|
60
|
+
|
|
61
|
+
constructor(opts: ValidatorOpts) {
|
|
62
|
+
this[CONFIG] = opts;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export class Packager<T = unknown, U = unknown> {
|
|
67
|
+
[CONFIG]: PackagerOpts<T, U>;
|
|
68
|
+
|
|
69
|
+
constructor(opts: PackagerOpts<T, U>) {
|
|
70
|
+
this[CONFIG] = opts;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export class Optimizer<T = unknown, U = unknown> {
|
|
75
|
+
[CONFIG]: OptimizerOpts<T, U>;
|
|
76
|
+
|
|
77
|
+
constructor(opts: OptimizerOpts<T, U>) {
|
|
78
|
+
this[CONFIG] = opts;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export class Compressor {
|
|
83
|
+
[CONFIG]: CompressorOpts;
|
|
84
|
+
|
|
85
|
+
constructor(opts: CompressorOpts) {
|
|
86
|
+
this[CONFIG] = opts;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export class Reporter {
|
|
91
|
+
[CONFIG]: ReporterOpts;
|
|
92
|
+
|
|
93
|
+
constructor(opts: ReporterOpts) {
|
|
94
|
+
this[CONFIG] = opts;
|
|
95
|
+
}
|
|
96
|
+
}
|
package/tsconfig.json
ADDED
package/src/PluginAPI.js
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
// @flow strict-local
|
|
2
|
-
|
|
3
|
-
import type {
|
|
4
|
-
Transformer as TransformerOpts,
|
|
5
|
-
Resolver as ResolverOpts,
|
|
6
|
-
Bundler as BundlerOpts,
|
|
7
|
-
Namer as NamerOpts,
|
|
8
|
-
Runtime as RuntimeOpts,
|
|
9
|
-
Packager as PackagerOpts,
|
|
10
|
-
Optimizer as OptimizerOpts,
|
|
11
|
-
Compressor as CompressorOpts,
|
|
12
|
-
Reporter as ReporterOpts,
|
|
13
|
-
Validator as ValidatorOpts,
|
|
14
|
-
} from '@atlaspack/types';
|
|
15
|
-
|
|
16
|
-
// This uses the `parcel-plugin-config` symbol so it's backwards compatible with
|
|
17
|
-
// parcel plugins.
|
|
18
|
-
const CONFIG = Symbol.for('parcel-plugin-config');
|
|
19
|
-
|
|
20
|
-
export class Transformer<T = mixed> {
|
|
21
|
-
// $FlowFixMe: Computed property keys not supported. [unsupported-syntax]
|
|
22
|
-
[CONFIG]: TransformerOpts<T>;
|
|
23
|
-
|
|
24
|
-
constructor(opts: TransformerOpts<T>) {
|
|
25
|
-
// $FlowFixMe: because an index signature declaring the expected key / value type is missing in
|
|
26
|
-
this[CONFIG] = opts;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export class Resolver<T = mixed> {
|
|
31
|
-
// $FlowFixMe: Computed property keys not supported. [unsupported-syntax]
|
|
32
|
-
[CONFIG]: ResolverOpts<T>;
|
|
33
|
-
|
|
34
|
-
constructor(opts: ResolverOpts<T>) {
|
|
35
|
-
// $FlowFixMe: because an index signature declaring the expected key / value type is missing in
|
|
36
|
-
this[CONFIG] = opts;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export class Bundler<T = mixed> {
|
|
41
|
-
// $FlowFixMe: Computed property keys not supported. [unsupported-syntax]
|
|
42
|
-
[CONFIG]: BundlerOpts<T>;
|
|
43
|
-
|
|
44
|
-
constructor(opts: BundlerOpts<T>) {
|
|
45
|
-
// $FlowFixMe: because an index signature declaring the expected key / value type is missing in
|
|
46
|
-
this[CONFIG] = opts;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export class Namer<T = mixed> {
|
|
51
|
-
// $FlowFixMe: Computed property keys not supported. [unsupported-syntax]
|
|
52
|
-
[CONFIG]: NamerOpts<T>;
|
|
53
|
-
|
|
54
|
-
constructor(opts: NamerOpts<T>) {
|
|
55
|
-
// $FlowFixMe: because an index signature declaring the expected key / value type is missing in
|
|
56
|
-
this[CONFIG] = opts;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export class Runtime<T = mixed> {
|
|
61
|
-
// $FlowFixMe: Computed property keys not supported. [unsupported-syntax]
|
|
62
|
-
[CONFIG]: RuntimeOpts<T>;
|
|
63
|
-
|
|
64
|
-
constructor(opts: RuntimeOpts<T>) {
|
|
65
|
-
// $FlowFixMe: because an index signature declaring the expected key / value type is missing in
|
|
66
|
-
this[CONFIG] = opts;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export class Validator {
|
|
71
|
-
// $FlowFixMe: Computed property keys not supported. [unsupported-syntax]
|
|
72
|
-
[CONFIG]: ValidatorOpts;
|
|
73
|
-
|
|
74
|
-
constructor(opts: ValidatorOpts) {
|
|
75
|
-
// $FlowFixMe: because an index signature declaring the expected key / value type is missing in
|
|
76
|
-
this[CONFIG] = opts;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export class Packager<T = mixed, U = mixed> {
|
|
81
|
-
// $FlowFixMe: Computed property keys not supported. [unsupported-syntax]
|
|
82
|
-
[CONFIG]: PackagerOpts<T, U>;
|
|
83
|
-
|
|
84
|
-
constructor(opts: PackagerOpts<T, U>) {
|
|
85
|
-
// $FlowFixMe: because an index signature declaring the expected key / value type is missing in
|
|
86
|
-
this[CONFIG] = opts;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export class Optimizer<T = mixed, U = mixed> {
|
|
91
|
-
// $FlowFixMe: Computed property keys not supported. [unsupported-syntax]
|
|
92
|
-
[CONFIG]: OptimizerOpts<T, U>;
|
|
93
|
-
|
|
94
|
-
constructor(opts: OptimizerOpts<T, U>) {
|
|
95
|
-
// $FlowFixMe: because an index signature declaring the expected key / value type is missing in
|
|
96
|
-
this[CONFIG] = opts;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export class Compressor {
|
|
101
|
-
// $FlowFixMe: Computed property keys not supported. [unsupported-syntax]
|
|
102
|
-
[CONFIG]: CompressorOpts;
|
|
103
|
-
|
|
104
|
-
constructor(opts: CompressorOpts) {
|
|
105
|
-
// $FlowFixMe: because an index signature declaring the expected key / value type is missing in
|
|
106
|
-
this[CONFIG] = opts;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export class Reporter {
|
|
111
|
-
// $FlowFixMe: Computed property keys not supported. [unsupported-syntax]
|
|
112
|
-
[CONFIG]: ReporterOpts;
|
|
113
|
-
|
|
114
|
-
constructor(opts: ReporterOpts) {
|
|
115
|
-
// $FlowFixMe: because an index signature declaring the expected key / value type is missing in
|
|
116
|
-
this[CONFIG] = opts;
|
|
117
|
-
}
|
|
118
|
-
}
|