@digest/jest-babel 4.1.6 → 4.2.1
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/package.json +7 -6
- package/dist/babelPrep.d.ts +0 -1
- package/dist/babelPrep.js +0 -67
- package/dist/index.js +0 -3
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@digest/jest-babel",
|
|
3
3
|
"title": "Jest Babel Digest",
|
|
4
4
|
"license": "LGPL-3.0-or-later",
|
|
5
|
-
"version": "4.1
|
|
5
|
+
"version": "4.2.1",
|
|
6
6
|
"description": "Digested Jest Babel configurations",
|
|
7
7
|
"author": "wallzero @wallzeroblog (http://wallzero.com)",
|
|
8
8
|
"contributors": [
|
|
@@ -33,13 +33,14 @@
|
|
|
33
33
|
"build": "tsc",
|
|
34
34
|
"lint": "run-p lint:es",
|
|
35
35
|
"lint:es": "eslint 'src/**/*.[jt]s?(x)' --ignore-pattern 'src/**/*.(d.ts|json)'",
|
|
36
|
-
"clean": "rimraf node_modules dist package-lock.json npm-debug.log"
|
|
36
|
+
"clean": "rimraf node_modules dist package-lock.json npm-debug.log",
|
|
37
|
+
"set:version": "npm version --allow-same-version --no-commit-hooks --no-git-tag-version --no-workspaces-update $(npm --silent view $(node -p \"require('./package.json').name\") version)"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
40
|
"@babel/plugin-transform-modules-commonjs": "^7.21.2",
|
|
40
|
-
"@digest/babel": "^4.
|
|
41
|
-
"@digest/jest": "^4.
|
|
42
|
-
"@digest/scripts": "^4.
|
|
41
|
+
"@digest/babel": "^4.0.0",
|
|
42
|
+
"@digest/jest": "^4.0.0",
|
|
43
|
+
"@digest/scripts": "^4.0.0",
|
|
43
44
|
"babel-jest": "^29.5.0"
|
|
44
45
|
},
|
|
45
46
|
"keywords": [
|
|
@@ -47,5 +48,5 @@
|
|
|
47
48
|
"jest",
|
|
48
49
|
"babel"
|
|
49
50
|
],
|
|
50
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "8177f7ab8957fdc57fae277bfcde02811ee6a9fd"
|
|
51
52
|
}
|
package/dist/babelPrep.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/babelPrep.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const scripts_1 = require("@digest/scripts");
|
|
4
|
-
const DISABLE_PLUGINS = {
|
|
5
|
-
'@babel/plugin-syntax-dynamic-import': true,
|
|
6
|
-
'@babel/plugin-transform-regenerator': true,
|
|
7
|
-
'@babel/plugin-transform-typescript': true,
|
|
8
|
-
'@dr.pogodin/babel-plugin-react-css-modules': true,
|
|
9
|
-
'babel-plugin-react-remove-properties': true,
|
|
10
|
-
'babel-plugin-transform-inline-environment-variables': true,
|
|
11
|
-
'babel-plugin-transform-node-env-inline': true
|
|
12
|
-
};
|
|
13
|
-
const DISABLE_PRESETS = {
|
|
14
|
-
'babel-preset-minify': true
|
|
15
|
-
};
|
|
16
|
-
const babelPrep = function (api) {
|
|
17
|
-
let babelConfig;
|
|
18
|
-
if (scripts_1.config.babel) {
|
|
19
|
-
babelConfig = require(scripts_1.config.babel)(api);
|
|
20
|
-
}
|
|
21
|
-
if (babelConfig) {
|
|
22
|
-
const preparedBabelConfig = Object.assign(Object.assign({}, babelConfig), { plugins: babelConfig.plugins ?
|
|
23
|
-
babelConfig.plugins.filter((plugin) => {
|
|
24
|
-
if (Array.isArray(plugin)) {
|
|
25
|
-
return !DISABLE_PLUGINS[plugin[0]];
|
|
26
|
-
}
|
|
27
|
-
return false;
|
|
28
|
-
}) :
|
|
29
|
-
[], presets: babelConfig.presets ?
|
|
30
|
-
babelConfig.presets.filter((preset) => {
|
|
31
|
-
if (Array.isArray(preset)) {
|
|
32
|
-
return !DISABLE_PRESETS[preset[0]];
|
|
33
|
-
}
|
|
34
|
-
return false;
|
|
35
|
-
}) :
|
|
36
|
-
[] });
|
|
37
|
-
const presetIndex = preparedBabelConfig.presets.findIndex((preset) => {
|
|
38
|
-
if (Array.isArray(preset)) {
|
|
39
|
-
return preset[0] === '@babel/preset-env';
|
|
40
|
-
}
|
|
41
|
-
return false;
|
|
42
|
-
});
|
|
43
|
-
if (scripts_1.config.cssModules &&
|
|
44
|
-
scripts_1.config.react) {
|
|
45
|
-
preparedBabelConfig.plugins.push([
|
|
46
|
-
'@dr.pogodin/babel-plugin-react-css-modules',
|
|
47
|
-
{
|
|
48
|
-
context: scripts_1.config.context,
|
|
49
|
-
generateScopedName: '[local]'
|
|
50
|
-
}
|
|
51
|
-
]);
|
|
52
|
-
}
|
|
53
|
-
if (scripts_1.config.babelPolyfills &&
|
|
54
|
-
presetIndex > -1) {
|
|
55
|
-
preparedBabelConfig.presets[presetIndex][1].modules = 'commonjs';
|
|
56
|
-
preparedBabelConfig.presets[presetIndex][1].targets = 'node 11';
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
preparedBabelConfig.plugins.unshift([
|
|
60
|
-
'@babel/plugin-transform-modules-commonjs'
|
|
61
|
-
]);
|
|
62
|
-
}
|
|
63
|
-
return preparedBabelConfig;
|
|
64
|
-
}
|
|
65
|
-
return {};
|
|
66
|
-
};
|
|
67
|
-
module.exports = babelPrep;
|
package/dist/index.js
DELETED