Skip to content

Commit

Permalink
feat: ✨ update package deps & Unified upgrade version
Browse files Browse the repository at this point in the history
  • Loading branch information
i7eo committed Jul 1, 2024
1 parent 04707b1 commit 6889f85
Show file tree
Hide file tree
Showing 37 changed files with 1,045 additions and 632 deletions.
16 changes: 0 additions & 16 deletions .changeset/rude-dryers-impress.md

This file was deleted.

16 changes: 16 additions & 0 deletions .changeset/tough-numbers-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
"@unconfig/simple-git-hooks-config": patch
"@unconfig/lint-staged-config": patch
"@unconfig/commitlint-config": patch
"@unconfig/changeset-config": patch
"@unconfig/stylelint-config": patch
"@unconfig/prettier-config": patch
"@unconfig/eslint-config": patch
"@unconfig/ts-config": patch
"@unconfig/github": patch
"@unconfig/meta": patch
"@unconfig/utils": patch
---

Unified upgrade version

16 changes: 10 additions & 6 deletions .commitlintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const fs = require('node:fs')
const path = require('node:path')
const _config = require('@unconfig/commitlint-config').all
const all = require('@unconfig/commitlint-config').all
const configBuilder = require('@unconfig/commitlint-config').configBuilder

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

Expand Down Expand Up @@ -28,15 +29,18 @@ function createScopes() {
]
}

module.exports = {
..._config,
const config = configBuilder({
...all,

prompt: {
..._config.prompt,
...all.prompt,
scopes: [...createScopes()],
},

rules: {
..._config.rules,
...all.rules,
'scope-enum': [2, 'always', createScopes()],
},
}
})

module.exports = config
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ jobs:
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 9
version: 9.4.0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
node-version: 20.15.0
cache: pnpm

- name: Install Dependencies
Expand Down
4 changes: 3 additions & 1 deletion .lintstagedrc.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const config = require('@unconfig/lint-staged-config').all
const configBuilder = require('@unconfig/lint-staged-config').configBuilder

const config = configBuilder()

module.exports = config
4 changes: 3 additions & 1 deletion .simple-git-hooks.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const config = require('@unconfig/simple-git-hooks-config').all
const configBuilder = require('@unconfig/simple-git-hooks-config').configBuilder

const config = configBuilder()

module.exports = config
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
"npm-run-all2": "^6.2.0",
"rimraf": "^5.0.7",
"tsup": "^8.1.0",
"tsx": "^4.15.7",
"turbo": "^2.0.5",
"tsx": "^4.16.0",
"turbo": "^2.0.6",
"typescript": "^5.5.2",
"vitest": "^1.6.0"
},
Expand Down
9 changes: 7 additions & 2 deletions packages/changeset-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unconfig/changeset-config",
"version": "0.1.7",
"version": "0.1.9",
"description": "🚀 The package offer changeset-config for @unconfig!",
"keywords": [
"unconfig",
Expand Down Expand Up @@ -57,6 +57,9 @@
"clean:cache": "rimraf .turbo && rimraf dist",
"clean:deps": "rimraf node_modules"
},
"peerDependencies": {
"@changesets/cli": "^2.27.6"
},
"dependencies": {
"@changesets/assemble-release-plan": "^6.0.2",
"@changesets/cli": "^2.27.6",
Expand All @@ -70,11 +73,13 @@
"@types/semver": "^7.5.8",
"@unconfig/meta": "workspace:*",
"changesets-format-with-issue-links": "^0.3.0",
"inquirer": "^9.2.23",
"inquirer": "^9.3.2",
"prettier": "^3.3.2",
"semver": "^7.6.2"
},
"devDependencies": {
"npm-run-all2": "^6.2.0",
"rimraf": "^5.0.7",
"tsup": "^8.1.0"
},
"engines": {
Expand Down
11 changes: 7 additions & 4 deletions packages/commitlint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unconfig/commitlint-config",
"version": "0.1.3",
"version": "0.1.9",
"description": "🚀 The package offer commitlint-config for @unconfig!",
"keywords": [
"unconfig",
Expand Down Expand Up @@ -53,13 +53,14 @@
"test": "vitest",
"lint": "run-s \"lint:**\"",
"lint:prettier": "prettier . --write",
"clean": "run-s \"clean:**\"",
"clean": "pnpm exec run-s \"clean:**\"",
"clean:cache": "rimraf .turbo && rimraf dist",
"clean:deps": "rimraf node_modules"
},
"peerDependencies": {
"@commitlint/cli": "^17.4.4",
"@commitlint/config-conventional": "^17.4.4"
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"czg": "^1.9.3"
},
"dependencies": {
"@commitlint/cli": "^19.3.0",
Expand All @@ -68,6 +69,8 @@
"czg": "^1.9.3"
},
"devDependencies": {
"npm-run-all2": "^6.2.0",
"rimraf": "^5.0.7",
"tsup": "^8.1.0"
},
"engines": {
Expand Down
29 changes: 25 additions & 4 deletions packages/commitlint-config/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/** @type {import('czg').UserConfig} */
const presetBasic = {
import type { UserConfig } from 'czg'

export type Config = UserConfig

const presetBasic: Partial<Config> = {
ignores: [(commit: any) => commit.includes('init')],
extends: ['@commitlint/config-conventional'],
rules: {
Expand All @@ -19,8 +22,7 @@ const presetBasic = {
},
}

/** @type {import('czg').UserConfig} */
const presetAll = {
const presetAll: Partial<Config> = {
...presetBasic,
prompt: {
useEmoji: true,
Expand All @@ -30,3 +32,22 @@ const presetAll = {
}

export { presetBasic as basic, presetAll as all }

/**
*
* @param config
* @returns
*/
export function configBuilder(config: Config = {}): Config {
let configs = {
...presetAll,
}

if (Object.keys(config).length > 0) {
configs = {
...configs,
...config,
}
}
return configs
}
2 changes: 1 addition & 1 deletion packages/eslint-config/eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const configBuilder = require('dist/index.js').configBuilder
const configBuilder = require('./dist/index.js').configBuilder
const config = configBuilder()
// [
// {
Expand Down
25 changes: 15 additions & 10 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unconfig/eslint-config",
"version": "0.1.3",
"version": "0.1.9",
"description": "🚀 The package offer eslint-config for @unconfig!",
"keywords": [
"unconfig",
Expand All @@ -11,11 +11,16 @@
"eslint",
"eslint-config"
],
"license": "MIT",
"homepage": "https://github.com/i7eo/unconfig/blob/master/packages/eslint-config#readme",
"bugs": {
"url": "https://github.com/i7eo/unconfig/issues"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/i7eo/unconfig.git",
"directory": "packages/eslint-config"
},
"author": "i7eo <admin@i7eo.com> (https://github.com/i7eo)",
"files": [
"*.d.ts",
Expand All @@ -42,11 +47,6 @@
]
}
},
"repository": {
"type": "git",
"url": "https://github.com/i7eo/unconfig.git",
"directory": "packages/eslint-config"
},
"scripts": {
"build": "tsup",
"dev": "DEV=true pnpm build",
Expand All @@ -57,8 +57,12 @@
"clean:cache": "rimraf .turbo && rimraf dist",
"clean:deps": "rimraf node_modules"
},
"peerDependencies": {
"eslint": "^9.6.0"
},
"dependencies": {
"eslint": "^9.5.0",
"@unconfig/utils": "workspace:*",
"eslint": "^9.6.0",
"eslint-config-prettier": "^9.1.0",
"eslint-define-config": "^2.1.0",
"eslint-plugin-eslint-comments": "^3.2.0",
Expand All @@ -73,16 +77,17 @@
"eslint-plugin-unused-imports": "^4.0.0",
"eslint-plugin-vue": "^9.26.0",
"eslint-plugin-yml": "^1.14.0",
"globals": "^15.6.0",
"globals": "^15.7.0",
"jsonc-eslint-parser": "^2.4.0",
"local-pkg": "^0.5.0",
"prettier": "^3.3.2",
"typescript-eslint": "^7.14.1",
"vue-eslint-parser": "^9.4.3",
"yaml-eslint-parser": "^1.2.3"
},
"devDependencies": {
"@unconfig/prettier-config": "workspace:*",
"npm-run-all2": "^6.2.0",
"rimraf": "^5.0.7",
"tsup": "^8.1.0"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config/src/configs/javascript.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import globals from 'globals'
import { isInEditor } from '@unconfig/utils'
import { pluginUnusedImports } from '../plugins'
import { isInEditor } from '../env'
import type { FlatESLintConfig } from 'eslint-define-config'

export const restrictedSyntaxJs = [
Expand Down
17 changes: 2 additions & 15 deletions packages/eslint-config/src/configs/vue.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
import process from 'node:process'
import { getPackageInfoSync } from 'local-pkg'
import { isVue3 } from '@unconfig/utils'
import { GLOB_VUE } from '../globs'
import { parserVue, pluginVue, tseslint } from '../plugins'
import { typescriptCore } from './typescript'
import type { FlatESLintConfig, Rules } from 'eslint-define-config'

export function getVueVersion() {
const pkg = getPackageInfoSync('vue', { paths: [process.cwd()] })
if (
pkg &&
typeof pkg.version === 'string' &&
!Number.isNaN(+pkg.version[0])
) {
return +pkg.version[0]
}
return 3
}
const isVue3 = getVueVersion() === 3

export const reactivityTransform: FlatESLintConfig[] = [
{
languageOptions: {
Expand Down Expand Up @@ -119,7 +106,7 @@ export const vue: FlatESLintConfig[] = [
},
processor: pluginVue.processors['.vue'],
rules: {
...(isVue3 ? vue3Rules : vue2Rules),
...(isVue3(process.cwd()) ? vue3Rules : vue2Rules),
...vueCustomRules,
},
},
Expand Down
15 changes: 0 additions & 15 deletions packages/eslint-config/src/env.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/eslint-config/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from './configs'
export * from './env'
export * from './globs'
export * from './plugins'
export * from './presets'
8 changes: 4 additions & 4 deletions packages/eslint-config/src/presets.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hasVue } from './env'
import { hasVue } from '@unconfig/utils'
import {
comments,
ignores,
Expand Down Expand Up @@ -48,15 +48,15 @@ export const presetAll = [
...prettier,
]
export { presetBasic as basic, presetAll as all }

export type Config = FlatESLintConfig
/**
*
* @param config
* @param features
* @returns
*/
export function configBuilder(
config: FlatESLintConfig | FlatESLintConfig[] = [],
config: Config | Config[] = [],
{
markdown: enableMarkdown = true,
prettier: enablePrettier = true,
Expand All @@ -70,7 +70,7 @@ export function configBuilder(
markdown: boolean
sortKeys: boolean
}> = {},
): FlatESLintConfig[] {
): Config[] {
const configs = [...presetBasic, ...yml, ...presetJsonc]
if (enableVue) {
configs.push(...vue)
Expand Down
Loading

0 comments on commit 6889f85

Please sign in to comment.