@foray1010/babel-preset 10.0.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 CHANGED
@@ -3,6 +3,28 @@
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
+
6
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)
7
29
 
8
30
  ### ⚠ BREAKING CHANGES
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.cjs` in the project root
21
+ 3. Create an `.babelrc.mjs` in the project root
22
22
 
23
23
  ```js
24
- 'use strict'
25
-
26
- module.exports = {
24
+ const config = {
27
25
  presets: ['@foray1010/babel-preset'],
28
26
  }
27
+ export default config
29
28
  ```
@@ -1,11 +1,10 @@
1
- 'use strict'
1
+ import process from 'node:process'
2
2
 
3
- const { declare } = require('@babel/helper-plugin-utils')
3
+ import { declare } from '@babel/helper-plugin-utils'
4
4
  // @ts-expect-error
5
- const { hasDep, pkg, pkgDir } = require('@foray1010/common-presets-utils')
6
- const browserslist = require('browserslist')
7
- const process = require('node:process')
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.CommonJS },
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
- module.exports = babelPreset
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": "10.0.0",
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
- "exports": "./index.cjs",
13
+ "type": "module",
14
+ "exports": "./index.mjs",
14
15
  "files": [
15
16
  "**/*.{cjs,js,json,mjs}",
16
17
  "*.md"
@@ -20,15 +21,15 @@
20
21
  },
21
22
  "dependencies": {
22
23
  "@babel/helper-plugin-utils": "^7.19.0",
23
- "@babel/plugin-transform-react-constant-elements": "^7.18.12",
24
- "@babel/plugin-transform-react-inline-elements": "^7.12.3",
25
- "@babel/plugin-transform-runtime": "^7.19.6",
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",
26
27
  "@babel/preset-env": "^7.19.4",
27
28
  "@babel/preset-react": "^7.13.13",
28
- "@babel/preset-typescript": "^7.13.0",
29
- "@foray1010/common-presets-utils": "^6.0.0",
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.4",
32
+ "browserslist": "^4.21.5",
32
33
  "semver": "^7.3.5"
33
34
  },
34
35
  "devDependencies": {
@@ -39,10 +40,10 @@
39
40
  "@babel/runtime": "^7.9.6"
40
41
  },
41
42
  "engines": {
42
- "node": "^14.18.0 || ^16.13.0 || >=18.12.0"
43
+ "node": "^16.14.0 || >=18.12.0"
43
44
  },
44
45
  "publishConfig": {
45
46
  "access": "public"
46
47
  },
47
- "gitHead": "4acba77dace91746ac98872f4b8f62b410de82f5"
48
+ "gitHead": "ee22f073ee1702354310091b7c3a5ec18a930bec"
48
49
  }
package/tsconfig.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/tsconfig",
3
- "extends": "@foray1010/tsconfig",
3
+ "extends": "@foray1010/tsconfig/tsconfig.base.json",
4
4
  "compilerOptions": {
5
5
  "allowJs": true,
6
6
  "checkJs": true