@atlaspack/optimizer-swc 2.14.5-canary.16 → 2.14.5-canary.160

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,162 @@
1
1
  # @atlaspack/optimizer-swc
2
2
 
3
+ ## 2.14.25
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies []:
8
+ - @atlaspack/utils@2.18.2
9
+ - @atlaspack/plugin@2.14.25
10
+
11
+ ## 2.14.24
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies []:
16
+ - @atlaspack/utils@2.18.1
17
+ - @atlaspack/plugin@2.14.24
18
+
19
+ ## 2.14.23
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies [[`23d561e`](https://github.com/atlassian-labs/atlaspack/commit/23d561e51e68b0c38fd1ff4e4fb173e5e7b01cf2)]:
24
+ - @atlaspack/utils@2.18.0
25
+ - @atlaspack/plugin@2.14.23
26
+
27
+ ## 2.14.22
28
+
29
+ ### Patch Changes
30
+
31
+ - [#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
32
+
33
+ - Updated dependencies [[`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94)]:
34
+ - @atlaspack/diagnostic@2.14.2
35
+ - @atlaspack/plugin@2.14.22
36
+ - @atlaspack/utils@2.17.4
37
+
38
+ ## 2.14.21
39
+
40
+ ### Patch Changes
41
+
42
+ - Updated dependencies []:
43
+ - @atlaspack/utils@2.17.3
44
+ - @atlaspack/plugin@2.14.21
45
+
46
+ ## 2.14.20
47
+
48
+ ### Patch Changes
49
+
50
+ - [#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
51
+
52
+ - Updated dependencies [[`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa)]:
53
+ - @atlaspack/plugin@2.14.20
54
+ - @atlaspack/utils@2.17.2
55
+
56
+ ## 2.14.19
57
+
58
+ ### Patch Changes
59
+
60
+ - Updated dependencies []:
61
+ - @atlaspack/utils@2.17.1
62
+ - @atlaspack/plugin@2.14.19
63
+
64
+ ## 2.14.18
65
+
66
+ ### Patch Changes
67
+
68
+ - 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)]:
69
+ - @atlaspack/utils@2.17.0
70
+ - @atlaspack/plugin@2.14.18
71
+
72
+ ## 2.14.17
73
+
74
+ ### Patch Changes
75
+
76
+ - Updated dependencies []:
77
+ - @atlaspack/utils@2.16.1
78
+ - @atlaspack/plugin@2.14.17
79
+
80
+ ## 2.14.16
81
+
82
+ ### Patch Changes
83
+
84
+ - Updated dependencies [[`30ee2cf`](https://github.com/atlassian-labs/atlaspack/commit/30ee2cfcd34cf2646ded0eda13fdb80a2a5de529)]:
85
+ - @atlaspack/utils@2.16.0
86
+ - @atlaspack/plugin@2.14.16
87
+
88
+ ## 2.14.15
89
+
90
+ ### Patch Changes
91
+
92
+ - Updated dependencies []:
93
+ - @atlaspack/utils@2.15.3
94
+ - @atlaspack/plugin@2.14.15
95
+
96
+ ## 2.14.14
97
+
98
+ ### Patch Changes
99
+
100
+ - Updated dependencies []:
101
+ - @atlaspack/utils@2.15.2
102
+ - @atlaspack/plugin@2.14.14
103
+
104
+ ## 2.14.13
105
+
106
+ ### Patch Changes
107
+
108
+ - Updated dependencies []:
109
+ - @atlaspack/utils@2.15.1
110
+ - @atlaspack/plugin@2.14.13
111
+
112
+ ## 2.14.12
113
+
114
+ ### Patch Changes
115
+
116
+ - Updated dependencies [[`e39c6cf`](https://github.com/atlassian-labs/atlaspack/commit/e39c6cf05f7e95ce5420dbcea66f401b1cbd397c)]:
117
+ - @atlaspack/utils@2.15.0
118
+ - @atlaspack/plugin@2.14.12
119
+
120
+ ## 2.14.11
121
+
122
+ ### Patch Changes
123
+
124
+ - Updated dependencies []:
125
+ - @atlaspack/utils@2.14.11
126
+ - @atlaspack/plugin@2.14.11
127
+
128
+ ## 2.14.10
129
+
130
+ ### Patch Changes
131
+
132
+ - Updated dependencies []:
133
+ - @atlaspack/plugin@2.14.10
134
+ - @atlaspack/utils@2.14.10
135
+
136
+ ## 2.14.9
137
+
138
+ ### Patch Changes
139
+
140
+ - Updated dependencies []:
141
+ - @atlaspack/utils@2.14.9
142
+ - @atlaspack/plugin@2.14.9
143
+
144
+ ## 2.14.8
145
+
146
+ ### Patch Changes
147
+
148
+ - Updated dependencies []:
149
+ - @atlaspack/utils@2.14.8
150
+ - @atlaspack/plugin@2.14.8
151
+
152
+ ## 2.14.7
153
+
154
+ ### Patch Changes
155
+
156
+ - Updated dependencies []:
157
+ - @atlaspack/utils@2.14.7
158
+ - @atlaspack/plugin@2.14.7
159
+
3
160
  ## 2.14.6
4
161
 
5
162
  ### Patch Changes
@@ -87,6 +87,7 @@ var _default = exports.default = new (_plugin().Optimizer)({
87
87
  minify: {
88
88
  mangle: true,
89
89
  compress: true,
90
+ // @ts-expect-error TS2698
90
91
  ...userConfig,
91
92
  toplevel: bundle.env.outputFormat === 'esmodule' || bundle.env.outputFormat === 'commonjs',
92
93
  module: bundle.env.outputFormat === 'esmodule'
@@ -155,6 +156,7 @@ var _default = exports.default = new (_plugin().Optimizer)({
155
156
  sourceMap = new (_sourceMap().default)(options.projectRoot);
156
157
  sourceMap.addVLQMap(JSON.parse(resultMap));
157
158
  if (originalMap) {
159
+ // @ts-expect-error TS2345
158
160
  sourceMap.extends(originalMap);
159
161
  }
160
162
  let sourcemapReference = await getSourceMapReference(sourceMap);
@@ -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-swc",
3
- "version": "2.14.5-canary.16+4b2b575b9",
3
+ "version": "2.14.5-canary.160+4be63eda8",
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/SwcOptimizer.js",
13
- "source": "src/SwcOptimizer.js",
12
+ "main": "./lib/SwcOptimizer.js",
13
+ "source": "./src/SwcOptimizer.ts",
14
+ "types": "./lib/types/SwcOptimizer.d.ts",
14
15
  "engines": {
15
16
  "node": ">= 16.0.0"
16
17
  },
17
18
  "dependencies": {
18
- "@atlaspack/diagnostic": "2.14.1-canary.84+4b2b575b9",
19
- "@atlaspack/plugin": "2.14.5-canary.16+4b2b575b9",
20
- "@atlaspack/utils": "2.14.5-canary.16+4b2b575b9",
19
+ "@atlaspack/diagnostic": "2.14.1-canary.228+4be63eda8",
20
+ "@atlaspack/plugin": "2.14.5-canary.160+4be63eda8",
21
+ "@atlaspack/utils": "2.14.5-canary.160+4be63eda8",
21
22
  "@parcel/source-map": "^2.1.1",
22
23
  "@swc/core": "^1.10.0",
23
24
  "nullthrows": "^1.1.1"
24
25
  },
25
26
  "type": "commonjs",
26
- "gitHead": "4b2b575b98951f2dcf0c45ed8e94359b23b43815"
27
+ "scripts": {
28
+ "check-ts": "tsc --emitDeclarationOnly --rootDir src",
29
+ "build:lib": "gulp build --gulpfile ../../../gulpfile.js --cwd ."
30
+ },
31
+ "gitHead": "4be63eda8e561c18803bf04681fe1d61b7eaae93"
27
32
  }
@@ -1,5 +1,3 @@
1
- // @flow
2
-
3
1
  import nullthrows from 'nullthrows';
4
2
  import {transform} from '@swc/core';
5
3
  import {Optimizer} from '@atlaspack/plugin';
@@ -8,7 +6,7 @@ import SourceMap from '@parcel/source-map';
8
6
  import ThrowableDiagnostic, {escapeMarkdown} from '@atlaspack/diagnostic';
9
7
  import path from 'path';
10
8
 
11
- export default (new Optimizer({
9
+ export default new Optimizer({
12
10
  async loadConfig({config, options}) {
13
11
  let userConfig = await config.getConfigFrom(
14
12
  path.join(options.projectRoot, 'index'),
@@ -38,6 +36,7 @@ export default (new Optimizer({
38
36
  minify: {
39
37
  mangle: true,
40
38
  compress: true,
39
+ // @ts-expect-error TS2698
41
40
  ...userConfig,
42
41
  toplevel:
43
42
  bundle.env.outputFormat === 'esmodule' ||
@@ -50,7 +49,7 @@ export default (new Optimizer({
50
49
  configFile: false,
51
50
  swcrc: false,
52
51
  });
53
- } catch (err) {
52
+ } catch (err: any) {
54
53
  // SWC doesn't give us nice error objects, so we need to parse the message.
55
54
  let message = escapeMarkdown(
56
55
  (
@@ -115,6 +114,7 @@ export default (new Optimizer({
115
114
  sourceMap = new SourceMap(options.projectRoot);
116
115
  sourceMap.addVLQMap(JSON.parse(resultMap));
117
116
  if (originalMap) {
117
+ // @ts-expect-error TS2345
118
118
  sourceMap.extends(originalMap);
119
119
  }
120
120
  let sourcemapReference = await getSourceMapReference(sourceMap);
@@ -125,4 +125,4 @@ export default (new Optimizer({
125
125
 
126
126
  return {contents: minifiedContents, map: sourceMap};
127
127
  },
128
- }): Optimizer);
128
+ }) as Optimizer<unknown, unknown>;
package/tsconfig.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "include": ["src"]
4
+ }