@foray1010/common-presets-utils 6.0.0 → 7.0.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/CHANGELOG.md +22 -0
- package/{index.cjs → index.mjs} +8 -14
- package/package.json +6 -5
- package/tsconfig.json +1 -1
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
|
+
## [7.0.1](https://github.com/foray1010/common-presets/compare/@foray1010/common-presets-utils@7.0.0...@foray1010/common-presets-utils@7.0.1) (2023-03-23)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **eslint-config:** disable some eslint-plugin-import rules due to not support flat config ([3a84a7d](https://github.com/foray1010/common-presets/commit/3a84a7d10e0bdd8b81ce115ad509e46eee2330c5))
|
|
11
|
+
|
|
12
|
+
## [7.0.0](https://github.com/foray1010/common-presets/compare/@foray1010/common-presets-utils@6.0.0...@foray1010/common-presets-utils@7.0.0) (2023-03-23)
|
|
13
|
+
|
|
14
|
+
### ⚠ BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
- **eslint-config:** migrate to eslint flat config and mjs
|
|
17
|
+
- require node `^16.14.0 || >=18.12.0`
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
- **eslint-config:** migrate to eslint flat config and mjs ([d435d01](https://github.com/foray1010/common-presets/commit/d435d012faf1574dda750917dbada56048eecd09))
|
|
22
|
+
- **tsconfig:** split tsconfig to mutliple files for different scenarios ([fcaf3ae](https://github.com/foray1010/common-presets/commit/fcaf3aee3f9f1851439d01631c2e8584bde685ba))
|
|
23
|
+
|
|
24
|
+
### Miscellaneous Chores
|
|
25
|
+
|
|
26
|
+
- require node `^16.14.0 || >=18.12.0` ([5baf6eb](https://github.com/foray1010/common-presets/commit/5baf6eba6d42958596c130724a502c59fe1a4e83))
|
|
27
|
+
|
|
6
28
|
## [6.0.0](https://github.com/foray1010/common-presets/compare/@foray1010/common-presets-utils@5.1.0...@foray1010/common-presets-utils@6.0.0) (2022-11-07)
|
|
7
29
|
|
|
8
30
|
### ⚠ BREAKING CHANGES
|
package/{index.cjs → index.mjs}
RENAMED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import path from 'node:path'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
const readPkgUp = require('read-pkg-up')
|
|
3
|
+
import { readPackageUpSync } from 'read-pkg-up'
|
|
5
4
|
|
|
6
|
-
const { packageJson: pkg, path: pkgPath } =
|
|
5
|
+
const { packageJson: pkg, path: pkgPath } = readPackageUpSync() ?? {}
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
export { pkg }
|
|
8
|
+
|
|
9
|
+
export const pkgDir = pkgPath ? path.dirname(pkgPath) : undefined
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Check if current application has a package as dependencies/devDependencies/peerDependencies
|
|
@@ -13,16 +14,9 @@ const pkgDir = pkgPath ? path.dirname(pkgPath) : undefined
|
|
|
13
14
|
* @param {string} packageName package name in registry
|
|
14
15
|
* @returns {boolean} whether current application has this package as dependencies/devDependencies/peerDependencies or not
|
|
15
16
|
*/
|
|
16
|
-
const hasDep = (packageName) =>
|
|
17
|
+
export const hasDep = (packageName) =>
|
|
17
18
|
[pkg?.dependencies, pkg?.devDependencies, pkg?.peerDependencies]
|
|
18
19
|
.flatMap((dependencies) => Object.keys(dependencies ?? {}))
|
|
19
20
|
.includes(packageName)
|
|
20
21
|
|
|
21
|
-
const isESM = () => pkg?.['type'] === 'module'
|
|
22
|
-
|
|
23
|
-
module.exports = {
|
|
24
|
-
hasDep,
|
|
25
|
-
isESM,
|
|
26
|
-
pkg,
|
|
27
|
-
pkgDir,
|
|
28
|
-
}
|
|
22
|
+
export const isESM = () => pkg?.['type'] === 'module'
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@foray1010/common-presets-utils",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "7.0.1",
|
|
5
5
|
"homepage": "https://github.com/foray1010/common-presets/tree/master/packages/common-presets-utils#readme",
|
|
6
6
|
"bugs": "https://github.com/foray1010/common-presets/issues",
|
|
7
7
|
"repository": {
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"directory": "packages/common-presets-utils"
|
|
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"
|
|
@@ -19,13 +20,13 @@
|
|
|
19
20
|
"type:check": "tsc"
|
|
20
21
|
},
|
|
21
22
|
"dependencies": {
|
|
22
|
-
"read-pkg-up": "^
|
|
23
|
+
"read-pkg-up": "^9.1.0"
|
|
23
24
|
},
|
|
24
25
|
"engines": {
|
|
25
|
-
"node": "^
|
|
26
|
+
"node": "^16.14.0 || >=18.12.0"
|
|
26
27
|
},
|
|
27
28
|
"publishConfig": {
|
|
28
29
|
"access": "public"
|
|
29
30
|
},
|
|
30
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "c532946a18c6a773dd05bb8be2c90e905181e165"
|
|
31
32
|
}
|