@atlaspack/packager-webextension 2.14.5-canary.18 → 2.14.5-canary.181
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
CHANGED
|
@@ -1,5 +1,195 @@
|
|
|
1
1
|
# @atlaspack/packager-webextension
|
|
2
2
|
|
|
3
|
+
## 2.14.29
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @atlaspack/utils@2.19.1
|
|
9
|
+
- @atlaspack/plugin@2.14.29
|
|
10
|
+
|
|
11
|
+
## 2.14.28
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`f0349a6`](https://github.com/atlassian-labs/atlaspack/commit/f0349a6b9b04755088f121095ca6301a2ada3767)]:
|
|
16
|
+
- @atlaspack/utils@2.19.0
|
|
17
|
+
- @atlaspack/plugin@2.14.28
|
|
18
|
+
|
|
19
|
+
## 2.14.27
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies []:
|
|
24
|
+
- @atlaspack/utils@2.18.4
|
|
25
|
+
- @atlaspack/plugin@2.14.27
|
|
26
|
+
|
|
27
|
+
## 2.14.26
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- [#742](https://github.com/atlassian-labs/atlaspack/pull/742) [`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd) Thanks [@yamadapc](https://github.com/yamadapc)! - Internal changes and bug fixes to environmentDeduplication flag
|
|
32
|
+
|
|
33
|
+
- Updated dependencies [[`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd), [`889c65c`](https://github.com/atlassian-labs/atlaspack/commit/889c65cd25b811045e26a117e7404f694dde77a2)]:
|
|
34
|
+
- @atlaspack/plugin@2.14.26
|
|
35
|
+
- @atlaspack/utils@2.18.3
|
|
36
|
+
|
|
37
|
+
## 2.14.25
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Updated dependencies []:
|
|
42
|
+
- @atlaspack/utils@2.18.2
|
|
43
|
+
- @atlaspack/plugin@2.14.25
|
|
44
|
+
|
|
45
|
+
## 2.14.24
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- Updated dependencies []:
|
|
50
|
+
- @atlaspack/utils@2.18.1
|
|
51
|
+
- @atlaspack/plugin@2.14.24
|
|
52
|
+
|
|
53
|
+
## 2.14.23
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- Updated dependencies [[`23d561e`](https://github.com/atlassian-labs/atlaspack/commit/23d561e51e68b0c38fd1ff4e4fb173e5e7b01cf2)]:
|
|
58
|
+
- @atlaspack/utils@2.18.0
|
|
59
|
+
- @atlaspack/plugin@2.14.23
|
|
60
|
+
|
|
61
|
+
## 2.14.22
|
|
62
|
+
|
|
63
|
+
### Patch Changes
|
|
64
|
+
|
|
65
|
+
- [#720](https://github.com/atlassian-labs/atlaspack/pull/720) [`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94) Thanks [@alshdavid](https://github.com/alshdavid)! - Migrate to TypeScript
|
|
66
|
+
|
|
67
|
+
- Updated dependencies [[`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94)]:
|
|
68
|
+
- @atlaspack/plugin@2.14.22
|
|
69
|
+
- @atlaspack/utils@2.17.4
|
|
70
|
+
|
|
71
|
+
## 2.14.21
|
|
72
|
+
|
|
73
|
+
### Patch Changes
|
|
74
|
+
|
|
75
|
+
- Updated dependencies []:
|
|
76
|
+
- @atlaspack/utils@2.17.3
|
|
77
|
+
- @atlaspack/plugin@2.14.21
|
|
78
|
+
|
|
79
|
+
## 2.14.20
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- [#702](https://github.com/atlassian-labs/atlaspack/pull/702) [`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa) Thanks [@alshdavid](https://github.com/alshdavid)! - Fixes to Flow types
|
|
84
|
+
|
|
85
|
+
- Updated dependencies [[`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa)]:
|
|
86
|
+
- @atlaspack/plugin@2.14.20
|
|
87
|
+
- @atlaspack/utils@2.17.2
|
|
88
|
+
|
|
89
|
+
## 2.14.19
|
|
90
|
+
|
|
91
|
+
### Patch Changes
|
|
92
|
+
|
|
93
|
+
- Updated dependencies []:
|
|
94
|
+
- @atlaspack/utils@2.17.1
|
|
95
|
+
- @atlaspack/plugin@2.14.19
|
|
96
|
+
|
|
97
|
+
## 2.14.18
|
|
98
|
+
|
|
99
|
+
### Patch Changes
|
|
100
|
+
|
|
101
|
+
- Updated dependencies [[`dbb4072`](https://github.com/atlassian-labs/atlaspack/commit/dbb40721ebeb45990a14ba04e6b44e7f836fb32d), [`de23e0c`](https://github.com/atlassian-labs/atlaspack/commit/de23e0ce49d5504fe3947ac26640a3d951087da3), [`18a57cf`](https://github.com/atlassian-labs/atlaspack/commit/18a57cf8a4789b2de5ad8e2676f317a26cc91417), [`a5ed1b4`](https://github.com/atlassian-labs/atlaspack/commit/a5ed1b414498560f393ff491af4da25b6e8dde56)]:
|
|
102
|
+
- @atlaspack/utils@2.17.0
|
|
103
|
+
- @atlaspack/plugin@2.14.18
|
|
104
|
+
|
|
105
|
+
## 2.14.17
|
|
106
|
+
|
|
107
|
+
### Patch Changes
|
|
108
|
+
|
|
109
|
+
- Updated dependencies []:
|
|
110
|
+
- @atlaspack/utils@2.16.1
|
|
111
|
+
- @atlaspack/plugin@2.14.17
|
|
112
|
+
|
|
113
|
+
## 2.14.16
|
|
114
|
+
|
|
115
|
+
### Patch Changes
|
|
116
|
+
|
|
117
|
+
- Updated dependencies [[`30ee2cf`](https://github.com/atlassian-labs/atlaspack/commit/30ee2cfcd34cf2646ded0eda13fdb80a2a5de529)]:
|
|
118
|
+
- @atlaspack/utils@2.16.0
|
|
119
|
+
- @atlaspack/plugin@2.14.16
|
|
120
|
+
|
|
121
|
+
## 2.14.15
|
|
122
|
+
|
|
123
|
+
### Patch Changes
|
|
124
|
+
|
|
125
|
+
- Updated dependencies []:
|
|
126
|
+
- @atlaspack/utils@2.15.3
|
|
127
|
+
- @atlaspack/plugin@2.14.15
|
|
128
|
+
|
|
129
|
+
## 2.14.14
|
|
130
|
+
|
|
131
|
+
### Patch Changes
|
|
132
|
+
|
|
133
|
+
- Updated dependencies []:
|
|
134
|
+
- @atlaspack/utils@2.15.2
|
|
135
|
+
- @atlaspack/plugin@2.14.14
|
|
136
|
+
|
|
137
|
+
## 2.14.13
|
|
138
|
+
|
|
139
|
+
### Patch Changes
|
|
140
|
+
|
|
141
|
+
- Updated dependencies []:
|
|
142
|
+
- @atlaspack/utils@2.15.1
|
|
143
|
+
- @atlaspack/plugin@2.14.13
|
|
144
|
+
|
|
145
|
+
## 2.14.12
|
|
146
|
+
|
|
147
|
+
### Patch Changes
|
|
148
|
+
|
|
149
|
+
- Updated dependencies [[`e39c6cf`](https://github.com/atlassian-labs/atlaspack/commit/e39c6cf05f7e95ce5420dbcea66f401b1cbd397c)]:
|
|
150
|
+
- @atlaspack/utils@2.15.0
|
|
151
|
+
- @atlaspack/plugin@2.14.12
|
|
152
|
+
|
|
153
|
+
## 2.14.11
|
|
154
|
+
|
|
155
|
+
### Patch Changes
|
|
156
|
+
|
|
157
|
+
- Updated dependencies []:
|
|
158
|
+
- @atlaspack/utils@2.14.11
|
|
159
|
+
- @atlaspack/plugin@2.14.11
|
|
160
|
+
|
|
161
|
+
## 2.14.10
|
|
162
|
+
|
|
163
|
+
### Patch Changes
|
|
164
|
+
|
|
165
|
+
- Updated dependencies []:
|
|
166
|
+
- @atlaspack/plugin@2.14.10
|
|
167
|
+
- @atlaspack/utils@2.14.10
|
|
168
|
+
|
|
169
|
+
## 2.14.9
|
|
170
|
+
|
|
171
|
+
### Patch Changes
|
|
172
|
+
|
|
173
|
+
- Updated dependencies []:
|
|
174
|
+
- @atlaspack/utils@2.14.9
|
|
175
|
+
- @atlaspack/plugin@2.14.9
|
|
176
|
+
|
|
177
|
+
## 2.14.8
|
|
178
|
+
|
|
179
|
+
### Patch Changes
|
|
180
|
+
|
|
181
|
+
- Updated dependencies []:
|
|
182
|
+
- @atlaspack/utils@2.14.8
|
|
183
|
+
- @atlaspack/plugin@2.14.8
|
|
184
|
+
|
|
185
|
+
## 2.14.7
|
|
186
|
+
|
|
187
|
+
### Patch Changes
|
|
188
|
+
|
|
189
|
+
- Updated dependencies []:
|
|
190
|
+
- @atlaspack/utils@2.14.7
|
|
191
|
+
- @atlaspack/plugin@2.14.7
|
|
192
|
+
|
|
3
193
|
## 2.14.6
|
|
4
194
|
|
|
5
195
|
### Patch Changes
|
|
@@ -39,6 +39,7 @@ var _default = exports.default = new (_plugin().Packager)({
|
|
|
39
39
|
bundleGraph
|
|
40
40
|
}) {
|
|
41
41
|
var _manifest$background;
|
|
42
|
+
// @ts-expect-error TS2552
|
|
42
43
|
let assets = [];
|
|
43
44
|
bundle.traverseAssets(asset => {
|
|
44
45
|
assets.push(asset);
|
|
@@ -46,6 +47,8 @@ var _default = exports.default = new (_plugin().Packager)({
|
|
|
46
47
|
const manifestAssets = assets.filter(a => a.meta.webextEntry === true);
|
|
47
48
|
(0, _assert().default)(assets.length == 2 && manifestAssets.length == 1, 'Web extension bundles must contain exactly one manifest asset and one runtime asset');
|
|
48
49
|
const asset = manifestAssets[0];
|
|
50
|
+
|
|
51
|
+
// @ts-expect-error TS2304
|
|
49
52
|
const relPath = b => (0, _utils().relativeBundlePath)(bundle, b, {
|
|
50
53
|
leadingDotSlash: false
|
|
51
54
|
});
|
|
@@ -58,13 +61,28 @@ var _default = exports.default = new (_plugin().Packager)({
|
|
|
58
61
|
const deps = asset.getDependencies();
|
|
59
62
|
const war = [];
|
|
60
63
|
for (const contentScript of manifest.content_scripts || []) {
|
|
61
|
-
const srcBundles = deps.filter(
|
|
64
|
+
const srcBundles = deps.filter(
|
|
65
|
+
// @ts-expect-error TS7006
|
|
66
|
+
d => {
|
|
62
67
|
var _contentScript$js, _contentScript$css;
|
|
63
68
|
return ((_contentScript$js = contentScript.js) === null || _contentScript$js === void 0 ? void 0 : _contentScript$js.includes(d.id)) || ((_contentScript$css = contentScript.css) === null || _contentScript$css === void 0 ? void 0 : _contentScript$css.includes(d.id));
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
})
|
|
70
|
+
// @ts-expect-error TS7006
|
|
71
|
+
.map(d => (0, _nullthrows().default)(bundleGraph.getReferencedBundle(d, bundle)));
|
|
72
|
+
contentScript.css = [...new Set(srcBundles
|
|
73
|
+
// @ts-expect-error TS7006
|
|
74
|
+
.flatMap(b => bundleGraph.getReferencedBundles(b))
|
|
75
|
+
// @ts-expect-error TS7006
|
|
76
|
+
.filter(b => b.type == 'css').map(relPath).concat(contentScript.css || []))];
|
|
77
|
+
contentScript.js = [...new Set(srcBundles
|
|
78
|
+
// @ts-expect-error TS7006
|
|
79
|
+
.flatMap(b => bundleGraph.getReferencedBundles(b))
|
|
80
|
+
// @ts-expect-error TS7006
|
|
81
|
+
.filter(b => b.type == 'js').map(relPath).concat(contentScript.js || []))];
|
|
82
|
+
const resources = srcBundles
|
|
83
|
+
// @ts-expect-error TS7006
|
|
84
|
+
.flatMap(b => {
|
|
85
|
+
// @ts-expect-error TS2304
|
|
68
86
|
const children = [];
|
|
69
87
|
const siblings = bundleGraph.getReferencedBundles(b);
|
|
70
88
|
bundleGraph.traverseBundles(child => {
|
|
@@ -76,6 +94,7 @@ var _default = exports.default = new (_plugin().Packager)({
|
|
|
76
94
|
}).map(relPath);
|
|
77
95
|
if (resources.length > 0) {
|
|
78
96
|
war.push({
|
|
97
|
+
// @ts-expect-error TS7006
|
|
79
98
|
matches: contentScript.matches.map(match => {
|
|
80
99
|
if (/^(((http|ws)s?)|ftp|\*):\/\//.test(match)) {
|
|
81
100
|
let pathIndex = match.indexOf('/', match.indexOf('://') + 3);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/packager-webextension",
|
|
3
|
-
"version": "2.14.5-canary.
|
|
3
|
+
"version": "2.14.5-canary.181+0211c6986",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -9,16 +9,21 @@
|
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "https://github.com/atlassian-labs/atlaspack.git"
|
|
11
11
|
},
|
|
12
|
-
"main": "lib/WebExtensionPackager.js",
|
|
13
|
-
"source": "src/WebExtensionPackager.
|
|
12
|
+
"main": "./lib/WebExtensionPackager.js",
|
|
13
|
+
"source": "./src/WebExtensionPackager.ts",
|
|
14
|
+
"types": "./lib/types/WebExtensionPackager.d.ts",
|
|
14
15
|
"engines": {
|
|
15
16
|
"node": ">=16.0.0"
|
|
16
17
|
},
|
|
17
18
|
"dependencies": {
|
|
18
|
-
"@atlaspack/plugin": "2.14.5-canary.
|
|
19
|
-
"@atlaspack/utils": "2.14.5-canary.
|
|
19
|
+
"@atlaspack/plugin": "2.14.5-canary.181+0211c6986",
|
|
20
|
+
"@atlaspack/utils": "2.14.5-canary.181+0211c6986",
|
|
20
21
|
"nullthrows": "^1.1.1"
|
|
21
22
|
},
|
|
22
23
|
"type": "commonjs",
|
|
23
|
-
"
|
|
24
|
+
"scripts": {
|
|
25
|
+
"check-ts": "tsc --emitDeclarationOnly --rootDir src",
|
|
26
|
+
"build:lib": "gulp build --gulpfile ../../../gulpfile.js --cwd ."
|
|
27
|
+
},
|
|
28
|
+
"gitHead": "0211c698666b6e8282aff005d286b29ad00fd31f"
|
|
24
29
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
// @flow strict-local
|
|
2
|
-
|
|
3
1
|
import assert from 'assert';
|
|
4
2
|
import nullthrows from 'nullthrows';
|
|
5
3
|
import {Packager} from '@atlaspack/plugin';
|
|
6
4
|
import {replaceURLReferences, relativeBundlePath} from '@atlaspack/utils';
|
|
7
5
|
|
|
8
|
-
export default
|
|
6
|
+
export default new Packager({
|
|
9
7
|
async package({bundle, bundleGraph}) {
|
|
10
|
-
|
|
8
|
+
// @ts-expect-error TS2552
|
|
9
|
+
let assets: Array<Asset> = [];
|
|
11
10
|
bundle.traverseAssets((asset) => {
|
|
12
11
|
assets.push(asset);
|
|
13
12
|
});
|
|
@@ -19,7 +18,8 @@ export default (new Packager({
|
|
|
19
18
|
);
|
|
20
19
|
const asset = manifestAssets[0];
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
// @ts-expect-error TS2304
|
|
22
|
+
const relPath = (b: NamedBundle) =>
|
|
23
23
|
relativeBundlePath(bundle, b, {leadingDotSlash: false});
|
|
24
24
|
|
|
25
25
|
const manifest = JSON.parse(await asset.getCode());
|
|
@@ -31,20 +31,31 @@ export default (new Packager({
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
const deps = asset.getDependencies();
|
|
34
|
-
const war
|
|
34
|
+
const war: Array<
|
|
35
|
+
| any
|
|
36
|
+
| {
|
|
37
|
+
matches: never;
|
|
38
|
+
// @ts-expect-error TS2304
|
|
39
|
+
resources: Array<FilePath>;
|
|
40
|
+
}
|
|
41
|
+
> = [];
|
|
35
42
|
for (const contentScript of manifest.content_scripts || []) {
|
|
36
43
|
const srcBundles = deps
|
|
37
44
|
.filter(
|
|
45
|
+
// @ts-expect-error TS7006
|
|
38
46
|
(d) =>
|
|
39
47
|
contentScript.js?.includes(d.id) ||
|
|
40
48
|
contentScript.css?.includes(d.id),
|
|
41
49
|
)
|
|
50
|
+
// @ts-expect-error TS7006
|
|
42
51
|
.map((d) => nullthrows(bundleGraph.getReferencedBundle(d, bundle)));
|
|
43
52
|
|
|
44
53
|
contentScript.css = [
|
|
45
54
|
...new Set(
|
|
46
55
|
srcBundles
|
|
56
|
+
// @ts-expect-error TS7006
|
|
47
57
|
.flatMap((b) => bundleGraph.getReferencedBundles(b))
|
|
58
|
+
// @ts-expect-error TS7006
|
|
48
59
|
.filter((b) => b.type == 'css')
|
|
49
60
|
.map(relPath)
|
|
50
61
|
.concat(contentScript.css || []),
|
|
@@ -54,7 +65,9 @@ export default (new Packager({
|
|
|
54
65
|
contentScript.js = [
|
|
55
66
|
...new Set(
|
|
56
67
|
srcBundles
|
|
68
|
+
// @ts-expect-error TS7006
|
|
57
69
|
.flatMap((b) => bundleGraph.getReferencedBundles(b))
|
|
70
|
+
// @ts-expect-error TS7006
|
|
58
71
|
.filter((b) => b.type == 'js')
|
|
59
72
|
.map(relPath)
|
|
60
73
|
.concat(contentScript.js || []),
|
|
@@ -62,8 +75,10 @@ export default (new Packager({
|
|
|
62
75
|
];
|
|
63
76
|
|
|
64
77
|
const resources = srcBundles
|
|
78
|
+
// @ts-expect-error TS7006
|
|
65
79
|
.flatMap((b) => {
|
|
66
|
-
|
|
80
|
+
// @ts-expect-error TS2304
|
|
81
|
+
const children: Array<NamedBundle> = [];
|
|
67
82
|
const siblings = bundleGraph.getReferencedBundles(b);
|
|
68
83
|
bundleGraph.traverseBundles((child) => {
|
|
69
84
|
if (b !== child && !siblings.includes(child)) {
|
|
@@ -76,6 +91,7 @@ export default (new Packager({
|
|
|
76
91
|
|
|
77
92
|
if (resources.length > 0) {
|
|
78
93
|
war.push({
|
|
94
|
+
// @ts-expect-error TS7006
|
|
79
95
|
matches: contentScript.matches.map((match) => {
|
|
80
96
|
if (/^(((http|ws)s?)|ftp|\*):\/\//.test(match)) {
|
|
81
97
|
let pathIndex = match.indexOf('/', match.indexOf('://') + 3);
|
|
@@ -105,4 +121,4 @@ export default (new Packager({
|
|
|
105
121
|
});
|
|
106
122
|
return {contents};
|
|
107
123
|
},
|
|
108
|
-
})
|
|
124
|
+
}) as Packager<unknown, unknown>;
|
package/tsconfig.json
ADDED