@atlaspack/optimizer-terser 2.14.5-canary.18 → 2.14.5-canary.180

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,197 @@
1
1
  # @atlaspack/optimizer-terser
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/diagnostic@2.14.3
35
+ - @atlaspack/plugin@2.14.26
36
+ - @atlaspack/utils@2.18.3
37
+
38
+ ## 2.14.25
39
+
40
+ ### Patch Changes
41
+
42
+ - Updated dependencies []:
43
+ - @atlaspack/utils@2.18.2
44
+ - @atlaspack/plugin@2.14.25
45
+
46
+ ## 2.14.24
47
+
48
+ ### Patch Changes
49
+
50
+ - Updated dependencies []:
51
+ - @atlaspack/utils@2.18.1
52
+ - @atlaspack/plugin@2.14.24
53
+
54
+ ## 2.14.23
55
+
56
+ ### Patch Changes
57
+
58
+ - Updated dependencies [[`23d561e`](https://github.com/atlassian-labs/atlaspack/commit/23d561e51e68b0c38fd1ff4e4fb173e5e7b01cf2)]:
59
+ - @atlaspack/utils@2.18.0
60
+ - @atlaspack/plugin@2.14.23
61
+
62
+ ## 2.14.22
63
+
64
+ ### Patch Changes
65
+
66
+ - [#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
67
+
68
+ - Updated dependencies [[`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94)]:
69
+ - @atlaspack/diagnostic@2.14.2
70
+ - @atlaspack/plugin@2.14.22
71
+ - @atlaspack/utils@2.17.4
72
+
73
+ ## 2.14.21
74
+
75
+ ### Patch Changes
76
+
77
+ - Updated dependencies []:
78
+ - @atlaspack/utils@2.17.3
79
+ - @atlaspack/plugin@2.14.21
80
+
81
+ ## 2.14.20
82
+
83
+ ### Patch Changes
84
+
85
+ - [#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
86
+
87
+ - Updated dependencies [[`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa)]:
88
+ - @atlaspack/plugin@2.14.20
89
+ - @atlaspack/utils@2.17.2
90
+
91
+ ## 2.14.19
92
+
93
+ ### Patch Changes
94
+
95
+ - Updated dependencies []:
96
+ - @atlaspack/utils@2.17.1
97
+ - @atlaspack/plugin@2.14.19
98
+
99
+ ## 2.14.18
100
+
101
+ ### Patch Changes
102
+
103
+ - 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)]:
104
+ - @atlaspack/utils@2.17.0
105
+ - @atlaspack/plugin@2.14.18
106
+
107
+ ## 2.14.17
108
+
109
+ ### Patch Changes
110
+
111
+ - Updated dependencies []:
112
+ - @atlaspack/utils@2.16.1
113
+ - @atlaspack/plugin@2.14.17
114
+
115
+ ## 2.14.16
116
+
117
+ ### Patch Changes
118
+
119
+ - Updated dependencies [[`30ee2cf`](https://github.com/atlassian-labs/atlaspack/commit/30ee2cfcd34cf2646ded0eda13fdb80a2a5de529)]:
120
+ - @atlaspack/utils@2.16.0
121
+ - @atlaspack/plugin@2.14.16
122
+
123
+ ## 2.14.15
124
+
125
+ ### Patch Changes
126
+
127
+ - Updated dependencies []:
128
+ - @atlaspack/utils@2.15.3
129
+ - @atlaspack/plugin@2.14.15
130
+
131
+ ## 2.14.14
132
+
133
+ ### Patch Changes
134
+
135
+ - Updated dependencies []:
136
+ - @atlaspack/utils@2.15.2
137
+ - @atlaspack/plugin@2.14.14
138
+
139
+ ## 2.14.13
140
+
141
+ ### Patch Changes
142
+
143
+ - Updated dependencies []:
144
+ - @atlaspack/utils@2.15.1
145
+ - @atlaspack/plugin@2.14.13
146
+
147
+ ## 2.14.12
148
+
149
+ ### Patch Changes
150
+
151
+ - Updated dependencies [[`e39c6cf`](https://github.com/atlassian-labs/atlaspack/commit/e39c6cf05f7e95ce5420dbcea66f401b1cbd397c)]:
152
+ - @atlaspack/utils@2.15.0
153
+ - @atlaspack/plugin@2.14.12
154
+
155
+ ## 2.14.11
156
+
157
+ ### Patch Changes
158
+
159
+ - Updated dependencies []:
160
+ - @atlaspack/utils@2.14.11
161
+ - @atlaspack/plugin@2.14.11
162
+
163
+ ## 2.14.10
164
+
165
+ ### Patch Changes
166
+
167
+ - Updated dependencies []:
168
+ - @atlaspack/plugin@2.14.10
169
+ - @atlaspack/utils@2.14.10
170
+
171
+ ## 2.14.9
172
+
173
+ ### Patch Changes
174
+
175
+ - Updated dependencies []:
176
+ - @atlaspack/utils@2.14.9
177
+ - @atlaspack/plugin@2.14.9
178
+
179
+ ## 2.14.8
180
+
181
+ ### Patch Changes
182
+
183
+ - Updated dependencies []:
184
+ - @atlaspack/utils@2.14.8
185
+ - @atlaspack/plugin@2.14.8
186
+
187
+ ## 2.14.7
188
+
189
+ ### Patch Changes
190
+
191
+ - Updated dependencies []:
192
+ - @atlaspack/utils@2.14.7
193
+ - @atlaspack/plugin@2.14.7
194
+
3
195
  ## 2.14.6
4
196
 
5
197
  ### Patch Changes
@@ -56,6 +56,7 @@ function _path() {
56
56
  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); }
57
57
  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; }
58
58
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
59
+ // @ts-expect-error TS2307
59
60
  var _default = exports.default = new (_plugin().Optimizer)({
60
61
  async loadConfig({
61
62
  config,
@@ -81,6 +82,7 @@ var _default = exports.default = new (_plugin().Optimizer)({
81
82
  let code = await (0, _utils().blobToString)(contents);
82
83
  let originalMap = map ? await map.stringify({}) : null;
83
84
  let config = {
85
+ // @ts-expect-error TS2698
84
86
  ...userConfig,
85
87
  sourceMap: bundle.env.sourceMap ? {
86
88
  filename: _path().default.relative(options.projectRoot, _path().default.join(bundle.target.distDir, bundle.name)),
@@ -94,7 +96,6 @@ var _default = exports.default = new (_plugin().Optimizer)({
94
96
  try {
95
97
  result = await (0, _terser().minify)(code, config);
96
98
  } catch (error) {
97
- // $FlowFixMe
98
99
  let {
99
100
  message,
100
101
  line,
@@ -102,6 +103,7 @@ var _default = exports.default = new (_plugin().Optimizer)({
102
103
  } = error;
103
104
  if (line != null && col != null) {
104
105
  message = (0, _diagnostic().escapeMarkdown)(message);
106
+ // @ts-expect-error TS2304
105
107
  let diagnostics = [];
106
108
  let mapping = map === null || map === void 0 ? void 0 : map.findClosestMapping(line, col);
107
109
  if (mapping && mapping.original && mapping.source) {
@@ -0,0 +1,3 @@
1
+ import { Optimizer } from '@atlaspack/plugin';
2
+ declare const _default: Optimizer<unknown, unknown>;
3
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/optimizer-terser",
3
- "version": "2.14.5-canary.18+556d6ab8e",
3
+ "version": "2.14.5-canary.180+58b9fb037",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -9,19 +9,24 @@
9
9
  "type": "git",
10
10
  "url": "https://github.com/atlassian-labs/atlaspack.git"
11
11
  },
12
- "main": "lib/TerserOptimizer.js",
13
- "source": "src/TerserOptimizer.js",
12
+ "main": "./lib/TerserOptimizer.js",
13
+ "source": "./src/TerserOptimizer.ts",
14
+ "types": "./lib/types/TerserOptimizer.d.ts",
14
15
  "engines": {
15
16
  "node": ">= 16.0.0"
16
17
  },
17
18
  "dependencies": {
18
- "@atlaspack/diagnostic": "2.14.1-canary.86+556d6ab8e",
19
- "@atlaspack/plugin": "2.14.5-canary.18+556d6ab8e",
20
- "@atlaspack/utils": "2.14.5-canary.18+556d6ab8e",
19
+ "@atlaspack/diagnostic": "2.14.1-canary.248+58b9fb037",
20
+ "@atlaspack/plugin": "2.14.5-canary.180+58b9fb037",
21
+ "@atlaspack/utils": "2.14.5-canary.180+58b9fb037",
21
22
  "@parcel/source-map": "^2.1.1",
22
23
  "nullthrows": "^1.1.1",
23
24
  "terser": "^5.2.0"
24
25
  },
25
26
  "type": "commonjs",
26
- "gitHead": "556d6ab8ede759fa7f37fcd3f4da336ef1c55e8f"
27
+ "scripts": {
28
+ "check-ts": "tsc --emitDeclarationOnly --rootDir src",
29
+ "build:lib": "gulp build --gulpfile ../../../gulpfile.js --cwd ."
30
+ },
31
+ "gitHead": "58b9fb037680a36a0b4af7890f2a03532095b88f"
27
32
  }
@@ -1,6 +1,5 @@
1
- // @flow
2
-
3
1
  import nullthrows from 'nullthrows';
2
+ // @ts-expect-error TS2307
4
3
  import {minify} from 'terser';
5
4
  import {Optimizer} from '@atlaspack/plugin';
6
5
  import {blobToString} from '@atlaspack/utils';
@@ -9,7 +8,7 @@ import ThrowableDiagnostic, {escapeMarkdown} from '@atlaspack/diagnostic';
9
8
 
10
9
  import path from 'path';
11
10
 
12
- export default (new Optimizer({
11
+ export default new Optimizer({
13
12
  async loadConfig({config, options}) {
14
13
  let userConfig = await config.getConfigFrom(
15
14
  path.join(options.projectRoot, 'index'),
@@ -34,6 +33,7 @@ export default (new Optimizer({
34
33
 
35
34
  let originalMap = map ? await map.stringify({}) : null;
36
35
  let config = {
36
+ // @ts-expect-error TS2698
37
37
  ...userConfig,
38
38
  sourceMap: bundle.env.sourceMap
39
39
  ? {
@@ -54,12 +54,12 @@ export default (new Optimizer({
54
54
  let result;
55
55
  try {
56
56
  result = await minify(code, config);
57
- } catch (error) {
58
- // $FlowFixMe
57
+ } catch (error: any) {
59
58
  let {message, line, col} = error;
60
59
  if (line != null && col != null) {
61
60
  message = escapeMarkdown(message);
62
- let diagnostics = [];
61
+ // @ts-expect-error TS2304
62
+ let diagnostics: Array<Diagnostic> = [];
63
63
  let mapping = map?.findClosestMapping(line, col);
64
64
  if (mapping && mapping.original && mapping.source) {
65
65
  let {source, original} = mapping;
@@ -118,4 +118,4 @@ export default (new Optimizer({
118
118
 
119
119
  return {contents: minifiedContents, map: sourceMap};
120
120
  },
121
- }): Optimizer);
121
+ }) as Optimizer<unknown, unknown>;
package/tsconfig.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "include": ["src"]
4
+ }