@atlaspack/transformer-react-refresh-wrap 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
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaspack/transformer-react-refresh-wrap
|
|
2
2
|
|
|
3
|
+
## 2.14.21
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`069de47`](https://github.com/atlassian-labs/atlaspack/commit/069de478e64fb5889f6f2ce023eb510782767fbd)]:
|
|
8
|
+
- @atlaspack/feature-flags@2.20.0
|
|
9
|
+
- @atlaspack/utils@2.17.3
|
|
10
|
+
- @atlaspack/plugin@2.14.21
|
|
11
|
+
|
|
3
12
|
## 2.14.20
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -26,8 +26,11 @@ function _featureFlags() {
|
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
+
// @ts-expect-error TS2304
|
|
29
30
|
function shouldExclude(asset, options) {
|
|
30
|
-
return !asset.isSource || !options.hmrOptions || !asset.env.isBrowser() || asset.env.isLibrary || asset.env.isWorker() || asset.env.isWorklet() || options.mode !== 'development' || !asset.getDependencies().find(
|
|
31
|
+
return !asset.isSource || !options.hmrOptions || !asset.env.isBrowser() || asset.env.isLibrary || asset.env.isWorker() || asset.env.isWorklet() || options.mode !== 'development' || !asset.getDependencies().find(
|
|
32
|
+
// @ts-expect-error TS7006
|
|
33
|
+
v => v.specifier === 'react' || v.specifier === 'react/jsx-runtime' || v.specifier === 'react/jsx-dev-runtime' || v.specifier === '@emotion/react' || v.specifier === '@emotion/react/jsx-runtime' || v.specifier === '@emotion/react/jsx-dev-runtime');
|
|
31
34
|
}
|
|
32
35
|
var _default = exports.default = new (_plugin().Transformer)({
|
|
33
36
|
async transform({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/transformer-react-refresh-wrap",
|
|
3
|
-
"version": "2.14.5-canary.
|
|
3
|
+
"version": "2.14.5-canary.139+d2fd84977",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -9,18 +9,22 @@
|
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "https://github.com/atlassian-labs/atlaspack.git"
|
|
11
11
|
},
|
|
12
|
-
"main": "lib/ReactRefreshWrapTransformer.js",
|
|
13
|
-
"source": "src/ReactRefreshWrapTransformer.
|
|
12
|
+
"main": "./lib/ReactRefreshWrapTransformer.js",
|
|
13
|
+
"source": "./src/ReactRefreshWrapTransformer.ts",
|
|
14
|
+
"types": "./lib/ReactRefreshWrapTransformer.d.ts",
|
|
14
15
|
"engines": {
|
|
15
16
|
"node": ">= 16.0.0"
|
|
16
17
|
},
|
|
17
18
|
"dependencies": {
|
|
18
|
-
"@atlaspack/feature-flags": "2.14.1-canary.
|
|
19
|
-
"@atlaspack/plugin": "2.14.5-canary.
|
|
20
|
-
"@atlaspack/utils": "2.14.5-canary.
|
|
19
|
+
"@atlaspack/feature-flags": "2.14.1-canary.207+d2fd84977",
|
|
20
|
+
"@atlaspack/plugin": "2.14.5-canary.139+d2fd84977",
|
|
21
|
+
"@atlaspack/utils": "2.14.5-canary.139+d2fd84977",
|
|
21
22
|
"react-error-overlay": "6.0.9",
|
|
22
23
|
"react-refresh": ">=0.9 <=0.16"
|
|
23
24
|
},
|
|
24
25
|
"type": "commonjs",
|
|
25
|
-
"
|
|
26
|
-
|
|
26
|
+
"scripts": {
|
|
27
|
+
"check-ts": "tsc --emitDeclarationOnly --rootDir src"
|
|
28
|
+
},
|
|
29
|
+
"gitHead": "d2fd849770fe6305e9c694bd97b1bd905abd9d94"
|
|
30
|
+
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
1
|
import path from 'path';
|
|
4
2
|
import {Transformer} from '@atlaspack/plugin';
|
|
5
3
|
import {getFeatureFlag} from '@atlaspack/feature-flags';
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
// @ts-expect-error TS2304
|
|
6
|
+
function shouldExclude(asset: MutableAsset, options: PluginOptions) {
|
|
8
7
|
return (
|
|
9
8
|
!asset.isSource ||
|
|
10
9
|
!options.hmrOptions ||
|
|
@@ -13,21 +12,20 @@ function shouldExclude(asset, options) {
|
|
|
13
12
|
asset.env.isWorker() ||
|
|
14
13
|
asset.env.isWorklet() ||
|
|
15
14
|
options.mode !== 'development' ||
|
|
16
|
-
!asset
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
)
|
|
15
|
+
!asset.getDependencies().find(
|
|
16
|
+
// @ts-expect-error TS7006
|
|
17
|
+
(v) =>
|
|
18
|
+
v.specifier === 'react' ||
|
|
19
|
+
v.specifier === 'react/jsx-runtime' ||
|
|
20
|
+
v.specifier === 'react/jsx-dev-runtime' ||
|
|
21
|
+
v.specifier === '@emotion/react' ||
|
|
22
|
+
v.specifier === '@emotion/react/jsx-runtime' ||
|
|
23
|
+
v.specifier === '@emotion/react/jsx-dev-runtime',
|
|
24
|
+
)
|
|
27
25
|
);
|
|
28
26
|
}
|
|
29
27
|
|
|
30
|
-
export default
|
|
28
|
+
export default new Transformer({
|
|
31
29
|
async transform({asset, options}) {
|
|
32
30
|
if (shouldExclude(asset, options)) {
|
|
33
31
|
return [asset];
|
|
@@ -74,4 +72,4 @@ ${code}
|
|
|
74
72
|
|
|
75
73
|
return [asset];
|
|
76
74
|
},
|
|
77
|
-
})
|
|
75
|
+
}) as Transformer<unknown>;
|
package/tsconfig.json
ADDED