Skip to content

Commit 6889f85

Browse files
committed
feat: ✨ update package deps & Unified upgrade version
1 parent 04707b1 commit 6889f85

37 files changed

+1045
-632
lines changed

.changeset/rude-dryers-impress.md

-16
This file was deleted.

.changeset/tough-numbers-jump.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
"@unconfig/simple-git-hooks-config": patch
3+
"@unconfig/lint-staged-config": patch
4+
"@unconfig/commitlint-config": patch
5+
"@unconfig/changeset-config": patch
6+
"@unconfig/stylelint-config": patch
7+
"@unconfig/prettier-config": patch
8+
"@unconfig/eslint-config": patch
9+
"@unconfig/ts-config": patch
10+
"@unconfig/github": patch
11+
"@unconfig/meta": patch
12+
"@unconfig/utils": patch
13+
---
14+
15+
Unified upgrade version
16+

.commitlintrc.cjs

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const fs = require('node:fs')
22
const path = require('node:path')
3-
const _config = require('@unconfig/commitlint-config').all
3+
const all = require('@unconfig/commitlint-config').all
4+
const configBuilder = require('@unconfig/commitlint-config').configBuilder
45

56
const excludeFileNames = ['.DS_Store', 'README.md']
67

@@ -28,15 +29,18 @@ function createScopes() {
2829
]
2930
}
3031

31-
module.exports = {
32-
..._config,
32+
const config = configBuilder({
33+
...all,
3334

3435
prompt: {
35-
..._config.prompt,
36+
...all.prompt,
3637
scopes: [...createScopes()],
3738
},
39+
3840
rules: {
39-
..._config.rules,
41+
...all.rules,
4042
'scope-enum': [2, 'always', createScopes()],
4143
},
42-
}
44+
})
45+
46+
module.exports = config

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ jobs:
2525
- name: Setup pnpm
2626
uses: pnpm/action-setup@v2
2727
with:
28-
version: 9
28+
version: 9.4.0
2929

3030
- name: Setup Node.js
3131
uses: actions/setup-node@v4
3232
with:
33-
node-version: 22
33+
node-version: 20.15.0
3434
cache: pnpm
3535

3636
- name: Install Dependencies

.lintstagedrc.cjs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
const config = require('@unconfig/lint-staged-config').all
1+
const configBuilder = require('@unconfig/lint-staged-config').configBuilder
2+
3+
const config = configBuilder()
24

35
module.exports = config

.simple-git-hooks.cjs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
const config = require('@unconfig/simple-git-hooks-config').all
1+
const configBuilder = require('@unconfig/simple-git-hooks-config').configBuilder
2+
3+
const config = configBuilder()
24

35
module.exports = config

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171
"npm-run-all2": "^6.2.0",
7272
"rimraf": "^5.0.7",
7373
"tsup": "^8.1.0",
74-
"tsx": "^4.15.7",
75-
"turbo": "^2.0.5",
74+
"tsx": "^4.16.0",
75+
"turbo": "^2.0.6",
7676
"typescript": "^5.5.2",
7777
"vitest": "^1.6.0"
7878
},

packages/changeset-config/package.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@unconfig/changeset-config",
3-
"version": "0.1.7",
3+
"version": "0.1.9",
44
"description": "🚀 The package offer changeset-config for @unconfig!",
55
"keywords": [
66
"unconfig",
@@ -57,6 +57,9 @@
5757
"clean:cache": "rimraf .turbo && rimraf dist",
5858
"clean:deps": "rimraf node_modules"
5959
},
60+
"peerDependencies": {
61+
"@changesets/cli": "^2.27.6"
62+
},
6063
"dependencies": {
6164
"@changesets/assemble-release-plan": "^6.0.2",
6265
"@changesets/cli": "^2.27.6",
@@ -70,11 +73,13 @@
7073
"@types/semver": "^7.5.8",
7174
"@unconfig/meta": "workspace:*",
7275
"changesets-format-with-issue-links": "^0.3.0",
73-
"inquirer": "^9.2.23",
76+
"inquirer": "^9.3.2",
7477
"prettier": "^3.3.2",
7578
"semver": "^7.6.2"
7679
},
7780
"devDependencies": {
81+
"npm-run-all2": "^6.2.0",
82+
"rimraf": "^5.0.7",
7883
"tsup": "^8.1.0"
7984
},
8085
"engines": {

packages/commitlint-config/package.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@unconfig/commitlint-config",
3-
"version": "0.1.3",
3+
"version": "0.1.9",
44
"description": "🚀 The package offer commitlint-config for @unconfig!",
55
"keywords": [
66
"unconfig",
@@ -53,13 +53,14 @@
5353
"test": "vitest",
5454
"lint": "run-s \"lint:**\"",
5555
"lint:prettier": "prettier . --write",
56-
"clean": "run-s \"clean:**\"",
56+
"clean": "pnpm exec run-s \"clean:**\"",
5757
"clean:cache": "rimraf .turbo && rimraf dist",
5858
"clean:deps": "rimraf node_modules"
5959
},
6060
"peerDependencies": {
61-
"@commitlint/cli": "^17.4.4",
62-
"@commitlint/config-conventional": "^17.4.4"
61+
"@commitlint/cli": "^19.3.0",
62+
"@commitlint/config-conventional": "^19.2.2",
63+
"czg": "^1.9.3"
6364
},
6465
"dependencies": {
6566
"@commitlint/cli": "^19.3.0",
@@ -68,6 +69,8 @@
6869
"czg": "^1.9.3"
6970
},
7071
"devDependencies": {
72+
"npm-run-all2": "^6.2.0",
73+
"rimraf": "^5.0.7",
7174
"tsup": "^8.1.0"
7275
},
7376
"engines": {

packages/commitlint-config/src/index.ts

+25-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
/** @type {import('czg').UserConfig} */
2-
const presetBasic = {
1+
import type { UserConfig } from 'czg'
2+
3+
export type Config = UserConfig
4+
5+
const presetBasic: Partial<Config> = {
36
ignores: [(commit: any) => commit.includes('init')],
47
extends: ['@commitlint/config-conventional'],
58
rules: {
@@ -19,8 +22,7 @@ const presetBasic = {
1922
},
2023
}
2124

22-
/** @type {import('czg').UserConfig} */
23-
const presetAll = {
25+
const presetAll: Partial<Config> = {
2426
...presetBasic,
2527
prompt: {
2628
useEmoji: true,
@@ -30,3 +32,22 @@ const presetAll = {
3032
}
3133

3234
export { presetBasic as basic, presetAll as all }
35+
36+
/**
37+
*
38+
* @param config
39+
* @returns
40+
*/
41+
export function configBuilder(config: Config = {}): Config {
42+
let configs = {
43+
...presetAll,
44+
}
45+
46+
if (Object.keys(config).length > 0) {
47+
configs = {
48+
...configs,
49+
...config,
50+
}
51+
}
52+
return configs
53+
}

packages/eslint-config/eslint.config.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const configBuilder = require('dist/index.js').configBuilder
1+
const configBuilder = require('./dist/index.js').configBuilder
22
const config = configBuilder()
33
// [
44
// {

packages/eslint-config/package.json

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@unconfig/eslint-config",
3-
"version": "0.1.3",
3+
"version": "0.1.9",
44
"description": "🚀 The package offer eslint-config for @unconfig!",
55
"keywords": [
66
"unconfig",
@@ -11,11 +11,16 @@
1111
"eslint",
1212
"eslint-config"
1313
],
14+
"license": "MIT",
1415
"homepage": "https://github.com/i7eo/unconfig/blob/master/packages/eslint-config#readme",
1516
"bugs": {
1617
"url": "https://github.com/i7eo/unconfig/issues"
1718
},
18-
"license": "MIT",
19+
"repository": {
20+
"type": "git",
21+
"url": "https://github.com/i7eo/unconfig.git",
22+
"directory": "packages/eslint-config"
23+
},
1924
"author": "i7eo <admin@i7eo.com> (https://github.com/i7eo)",
2025
"files": [
2126
"*.d.ts",
@@ -42,11 +47,6 @@
4247
]
4348
}
4449
},
45-
"repository": {
46-
"type": "git",
47-
"url": "https://github.com/i7eo/unconfig.git",
48-
"directory": "packages/eslint-config"
49-
},
5050
"scripts": {
5151
"build": "tsup",
5252
"dev": "DEV=true pnpm build",
@@ -57,8 +57,12 @@
5757
"clean:cache": "rimraf .turbo && rimraf dist",
5858
"clean:deps": "rimraf node_modules"
5959
},
60+
"peerDependencies": {
61+
"eslint": "^9.6.0"
62+
},
6063
"dependencies": {
61-
"eslint": "^9.5.0",
64+
"@unconfig/utils": "workspace:*",
65+
"eslint": "^9.6.0",
6266
"eslint-config-prettier": "^9.1.0",
6367
"eslint-define-config": "^2.1.0",
6468
"eslint-plugin-eslint-comments": "^3.2.0",
@@ -73,16 +77,17 @@
7377
"eslint-plugin-unused-imports": "^4.0.0",
7478
"eslint-plugin-vue": "^9.26.0",
7579
"eslint-plugin-yml": "^1.14.0",
76-
"globals": "^15.6.0",
80+
"globals": "^15.7.0",
7781
"jsonc-eslint-parser": "^2.4.0",
78-
"local-pkg": "^0.5.0",
7982
"prettier": "^3.3.2",
8083
"typescript-eslint": "^7.14.1",
8184
"vue-eslint-parser": "^9.4.3",
8285
"yaml-eslint-parser": "^1.2.3"
8386
},
8487
"devDependencies": {
8588
"@unconfig/prettier-config": "workspace:*",
89+
"npm-run-all2": "^6.2.0",
90+
"rimraf": "^5.0.7",
8691
"tsup": "^8.1.0"
8792
},
8893
"engines": {

packages/eslint-config/src/configs/javascript.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import globals from 'globals'
2+
import { isInEditor } from '@unconfig/utils'
23
import { pluginUnusedImports } from '../plugins'
3-
import { isInEditor } from '../env'
44
import type { FlatESLintConfig } from 'eslint-define-config'
55

66
export const restrictedSyntaxJs = [

packages/eslint-config/src/configs/vue.ts

+2-15
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,10 @@
11
import process from 'node:process'
2-
import { getPackageInfoSync } from 'local-pkg'
2+
import { isVue3 } from '@unconfig/utils'
33
import { GLOB_VUE } from '../globs'
44
import { parserVue, pluginVue, tseslint } from '../plugins'
55
import { typescriptCore } from './typescript'
66
import type { FlatESLintConfig, Rules } from 'eslint-define-config'
77

8-
export function getVueVersion() {
9-
const pkg = getPackageInfoSync('vue', { paths: [process.cwd()] })
10-
if (
11-
pkg &&
12-
typeof pkg.version === 'string' &&
13-
!Number.isNaN(+pkg.version[0])
14-
) {
15-
return +pkg.version[0]
16-
}
17-
return 3
18-
}
19-
const isVue3 = getVueVersion() === 3
20-
218
export const reactivityTransform: FlatESLintConfig[] = [
229
{
2310
languageOptions: {
@@ -119,7 +106,7 @@ export const vue: FlatESLintConfig[] = [
119106
},
120107
processor: pluginVue.processors['.vue'],
121108
rules: {
122-
...(isVue3 ? vue3Rules : vue2Rules),
109+
...(isVue3(process.cwd()) ? vue3Rules : vue2Rules),
123110
...vueCustomRules,
124111
},
125112
},

packages/eslint-config/src/env.ts

-15
This file was deleted.

packages/eslint-config/src/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export * from './configs'
2-
export * from './env'
32
export * from './globs'
43
export * from './plugins'
54
export * from './presets'

packages/eslint-config/src/presets.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { hasVue } from './env'
1+
import { hasVue } from '@unconfig/utils'
22
import {
33
comments,
44
ignores,
@@ -48,15 +48,15 @@ export const presetAll = [
4848
...prettier,
4949
]
5050
export { presetBasic as basic, presetAll as all }
51-
51+
export type Config = FlatESLintConfig
5252
/**
5353
*
5454
* @param config
5555
* @param features
5656
* @returns
5757
*/
5858
export function configBuilder(
59-
config: FlatESLintConfig | FlatESLintConfig[] = [],
59+
config: Config | Config[] = [],
6060
{
6161
markdown: enableMarkdown = true,
6262
prettier: enablePrettier = true,
@@ -70,7 +70,7 @@ export function configBuilder(
7070
markdown: boolean
7171
sortKeys: boolean
7272
}> = {},
73-
): FlatESLintConfig[] {
73+
): Config[] {
7474
const configs = [...presetBasic, ...yml, ...presetJsonc]
7575
if (enableVue) {
7676
configs.push(...vue)

0 commit comments

Comments
 (0)