@foray1010/babel-preset 9.2.0 → 11.0.0
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 +36 -0
- package/README.md +3 -4
- package/{index.js → index.mjs} +8 -13
- package/package.json +13 -12
- package/tsconfig.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,42 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [11.0.0](https://github.com/foray1010/common-presets/compare/@foray1010/babel-preset@10.0.0...@foray1010/babel-preset@11.0.0) (2023-03-23)
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
- **eslint-config:** migrate to eslint flat config and mjs
|
|
11
|
+
- **babel-preset:** set default dependenciesModules to `esmodules`
|
|
12
|
+
- **babel-preset:** require BABEL_ENV or NODE_ENV
|
|
13
|
+
- **babel-preset:** use mjs
|
|
14
|
+
- require node `^16.14.0 || >=18.12.0`
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
- **babel-preset:** require BABEL_ENV or NODE_ENV ([564a01b](https://github.com/foray1010/common-presets/commit/564a01b3ae602d121c00e30284bcc15b8fab0b56))
|
|
19
|
+
- **babel-preset:** set default dependenciesModules to `esmodules` ([cf55f80](https://github.com/foray1010/common-presets/commit/cf55f8063eef13c9c32dcd1a955570c10cf29824))
|
|
20
|
+
- **eslint-config:** migrate to eslint flat config and mjs ([d435d01](https://github.com/foray1010/common-presets/commit/d435d012faf1574dda750917dbada56048eecd09))
|
|
21
|
+
- **tsconfig:** split tsconfig to mutliple files for different scenarios ([fcaf3ae](https://github.com/foray1010/common-presets/commit/fcaf3aee3f9f1851439d01631c2e8584bde685ba))
|
|
22
|
+
|
|
23
|
+
### Miscellaneous Chores
|
|
24
|
+
|
|
25
|
+
- **babel-preset:** use mjs ([45ce9d8](https://github.com/foray1010/common-presets/commit/45ce9d81b84fa043bad670a1e32b93f0b171800b))
|
|
26
|
+
- require node `^16.14.0 || >=18.12.0` ([5baf6eb](https://github.com/foray1010/common-presets/commit/5baf6eba6d42958596c130724a502c59fe1a4e83))
|
|
27
|
+
|
|
28
|
+
## [10.0.0](https://github.com/foray1010/common-presets/compare/@foray1010/babel-preset@9.2.0...@foray1010/babel-preset@10.0.0) (2022-11-07)
|
|
29
|
+
|
|
30
|
+
### ⚠ BREAKING CHANGES
|
|
31
|
+
|
|
32
|
+
- drop nodejs 14.17 and 18.11
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
- **eslint-config:** prefer node protocol ([204e5c1](https://github.com/foray1010/common-presets/commit/204e5c168aacaa020d2481306489724dfd6da7bc))
|
|
37
|
+
|
|
38
|
+
### Miscellaneous Chores
|
|
39
|
+
|
|
40
|
+
- drop nodejs 14.17 and 18.11 ([8e5c967](https://github.com/foray1010/common-presets/commit/8e5c9677b89d38c88de465f069bb5de683a8a40b))
|
|
41
|
+
|
|
6
42
|
## [9.2.0](https://github.com/foray1010/common-presets/compare/@foray1010/babel-preset@9.1.1...@foray1010/babel-preset@9.2.0) (2022-10-07)
|
|
7
43
|
|
|
8
44
|
### Features
|
package/README.md
CHANGED
|
@@ -18,12 +18,11 @@
|
|
|
18
18
|
|
|
19
19
|
2. `yarn add -DE @babel/core @foray1010/babel-preset`
|
|
20
20
|
|
|
21
|
-
3. Create an `.babelrc.
|
|
21
|
+
3. Create an `.babelrc.mjs` in the project root
|
|
22
22
|
|
|
23
23
|
```js
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
module.exports = {
|
|
24
|
+
const config = {
|
|
27
25
|
presets: ['@foray1010/babel-preset'],
|
|
28
26
|
}
|
|
27
|
+
export default config
|
|
29
28
|
```
|
package/{index.js → index.mjs}
RENAMED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import process from 'node:process'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { declare } from '@babel/helper-plugin-utils'
|
|
4
4
|
// @ts-expect-error
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const semver = require('semver')
|
|
5
|
+
import { hasDep, pkg, pkgDir } from '@foray1010/common-presets-utils'
|
|
6
|
+
import browserslist from 'browserslist'
|
|
7
|
+
import semver from 'semver'
|
|
9
8
|
|
|
10
9
|
const Modules = {
|
|
11
10
|
CommonJS: 'commonjs',
|
|
@@ -28,18 +27,14 @@ const getEnvTargets = () => {
|
|
|
28
27
|
|
|
29
28
|
const babelPreset = declare(function presetDefinitions(
|
|
30
29
|
api,
|
|
31
|
-
{ dependenciesModules = Modules.
|
|
30
|
+
{ dependenciesModules = Modules.ESModules },
|
|
32
31
|
) {
|
|
33
32
|
api.assertVersion(7)
|
|
34
33
|
|
|
35
|
-
const env =
|
|
36
|
-
process.env['BABEL_ENV'] || process.env['NODE_ENV'] || 'development'
|
|
37
|
-
// enable in next major version
|
|
38
|
-
/*
|
|
34
|
+
const env = process.env['BABEL_ENV'] || process.env['NODE_ENV']
|
|
39
35
|
if (!env) {
|
|
40
36
|
throw new Error('missing env: BABEL_ENV or NODE_ENV')
|
|
41
37
|
}
|
|
42
|
-
*/
|
|
43
38
|
|
|
44
39
|
const isDev = env === 'development'
|
|
45
40
|
const isProd = env === 'production'
|
|
@@ -98,4 +93,4 @@ const babelPreset = declare(function presetDefinitions(
|
|
|
98
93
|
}
|
|
99
94
|
})
|
|
100
95
|
|
|
101
|
-
|
|
96
|
+
export default babelPreset
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@foray1010/babel-preset",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "11.0.0",
|
|
5
5
|
"homepage": "https://github.com/foray1010/common-presets/tree/master/packages/babel-preset#readme",
|
|
6
6
|
"bugs": "https://github.com/foray1010/common-presets/issues",
|
|
7
7
|
"repository": {
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"directory": "packages/babel-preset"
|
|
11
11
|
},
|
|
12
12
|
"license": "MIT",
|
|
13
|
-
"
|
|
13
|
+
"type": "module",
|
|
14
|
+
"exports": "./index.mjs",
|
|
14
15
|
"files": [
|
|
15
16
|
"**/*.{cjs,js,json,mjs}",
|
|
16
17
|
"*.md"
|
|
@@ -20,29 +21,29 @@
|
|
|
20
21
|
},
|
|
21
22
|
"dependencies": {
|
|
22
23
|
"@babel/helper-plugin-utils": "^7.19.0",
|
|
23
|
-
"@babel/plugin-transform-react-constant-elements": "^7.
|
|
24
|
-
"@babel/plugin-transform-react-inline-elements": "^7.
|
|
25
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
26
|
-
"@babel/preset-env": "^7.19.
|
|
24
|
+
"@babel/plugin-transform-react-constant-elements": "^7.21.3",
|
|
25
|
+
"@babel/plugin-transform-react-inline-elements": "^7.21.0",
|
|
26
|
+
"@babel/plugin-transform-runtime": "^7.21.0",
|
|
27
|
+
"@babel/preset-env": "^7.19.4",
|
|
27
28
|
"@babel/preset-react": "^7.13.13",
|
|
28
|
-
"@babel/preset-typescript": "^7.
|
|
29
|
-
"@foray1010/common-presets-utils": "^
|
|
29
|
+
"@babel/preset-typescript": "^7.21.0",
|
|
30
|
+
"@foray1010/common-presets-utils": "^7.0.0",
|
|
30
31
|
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
|
31
|
-
"browserslist": "^4.21.
|
|
32
|
+
"browserslist": "^4.21.5",
|
|
32
33
|
"semver": "^7.3.5"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
|
-
"@types/semver": "7.3.
|
|
36
|
+
"@types/semver": "7.3.13"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
39
|
"@babel/core": "^7.0.0",
|
|
39
40
|
"@babel/runtime": "^7.9.6"
|
|
40
41
|
},
|
|
41
42
|
"engines": {
|
|
42
|
-
"node": "^
|
|
43
|
+
"node": "^16.14.0 || >=18.12.0"
|
|
43
44
|
},
|
|
44
45
|
"publishConfig": {
|
|
45
46
|
"access": "public"
|
|
46
47
|
},
|
|
47
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "ee22f073ee1702354310091b7c3a5ec18a930bec"
|
|
48
49
|
}
|