Skip to content

Commit

Permalink
fix(cli): upgrade commitlint version to resolve config extension issue (
Browse files Browse the repository at this point in the history
#187)

* chore: use pnpm catalog management of dependencies 

link #180
  • Loading branch information
Zhengqbbb authored Sep 28, 2024
1 parent 241577b commit dee8b44
Show file tree
Hide file tree
Showing 13 changed files with 269 additions and 425 deletions.
14 changes: 1 addition & 13 deletions .commitlintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const { execSync } = require('node:child_process')

const fg = require('fast-glob')

// git branch name = feature/cli_33 => auto get defaultIssues = #33
Expand All @@ -8,18 +7,9 @@ const issue = execSync('git rev-parse --abbrev-ref HEAD')
.trim()
.split('_')[1]

// monorepo dynamic get name
// dynamic get monorepo packages name
const packages = fg.sync('*', { cwd: 'packages/@cz-git', onlyDirectories: true })

/** Add Co-authored-by Last Line */
// const coAuthoredBy
// = '\n\n'
// + `Co-authored-by: ${
// execSync('git config user.name').toString().replace(/(\r\n\t|\n|\r\t)/g, '')
// } <${
// execSync('git config user.email').toString().replace(/(\r\n\t|\n|\r\t)/g, '')
// }>`

/** @type {import('cz-git').UserConfig} */
module.exports = {
extends: ['@commitlint/config-conventional'],
Expand All @@ -29,7 +19,6 @@ module.exports = {
'subject-empty': [2, 'never'],
},
prompt: {
// @see: https://github.com/Zhengqbbb/cz-git#options
alias: {
'b': 'chore: bump dependencies',
'c': 'chore: update config files',
Expand All @@ -47,6 +36,5 @@ module.exports = {
aiDiffIgnore: ['pnpm-lock.yaml', 'docs/public'],
customIssuePrefixAlign: !issue ? 'top' : 'bottom',
defaultIssues: !issue ? '' : `#${issue}`,
// formatMessageCB: ({ defaultMessage }) => defaultMessage + coAuthoredBy,
},
}
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
".env": "*.env, .env.*, .envrc, env.d.ts",
"readme*": "authors, backers.md, changelog*, citation*, code_of_conduct.md, codeowners, contributing.md, contributors, copying, credits, governance.md, history.md, license*, maintainers, readme*, security.md, sponsors.md",
"vite.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, cssnano.config.*, cypress.json, env.d.ts, htmlnanorc.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, playwright.config.*, postcss.config.*, puppeteer.config.*, svgo.config.*, tailwind.config.*, tsdoc.*, unocss.config.*, vitest.config.*, webpack.config.*, windi.config.*",
"package.json": ".browserslist*, .circleci*, .codecov, .cz-config.js, .czrc, .editorconfig, .eslint*, eslint*, .firebase*, .flowconfig, .github*, .gitlab*, .gitpod*, .huskyrc*, .jslint*, .lighthouserc.*, .lintstagedrc*, .markdownlint*, .mocha*, .node-version, .nodemon*, .npm*, .nvmrc, .pm2*, .pnp.*, .pnpm*, .prettier*, .releaserc*, .sentry*, .stackblitz*, .styleci*, .stylelint*, .tazerc*, .textlint*, .tool-versions, .travis*, .versionrc*, .vscode*, .watchman*, .xo-config*, .yamllint*, .yarnrc*, Procfile, api-extractor.json, apollo.config.*, appveyor*, ava.config.*, azure-pipelines*, bower.json, build.config.*, commitlint*, crowdin*, cypress.json, dangerfile*, dprint.json, firebase.json, grunt*, gulp*, jasmine.*, jenkins*, jest.config.*, jsconfig.*, karma*, lerna*, lighthouserc.*, lint-staged*, nest-cli.*, netlify*, nodemon*, nx.*, package-lock.json, phpcs.xml, playwright.config.*, pm2.*, pnpm*, prettier*, pullapprove*, puppeteer.config.*, pyrightconfig.json, renovate*, rollup.config.*, stylelint*, tsdoc.*, tslint*, tsup.config.*, turbo*, typedoc*, vercel*, vetur.config.*, vitest.config.*, webpack.config.*, workspace.json, xo.config.*, yarn*",
"tsconfig.json": "tsconfig.*",
"package.json": ".browserslist*, .circleci*, .codecov, .cz-config.js, .czrc, .editorconfig, .eslint*, eslint*, .firebase*, .flowconfig, .github*, .gitlab*, .gitpod*, .huskyrc*, .jslint*, .lighthouserc.*, .lintstagedrc*, .markdownlint*, .mocha*, .node-version, .nodemon*, .npm*, .nvmrc, .pm2*, .pnp.*, .pnpm*, .prettier*, .releaserc*, .sentry*, .stackblitz*, .styleci*, .stylelint*, .tazerc*, .textlint*, .tool-versions, .travis*, .versionrc*, .vscode*, .watchman*, .xo-config*, .yamllint*, .yarnrc*, Procfile, api-extractor.json, apollo.config.*, appveyor*, ava.config.*, azure-pipelines*, bower.json, build.config.*, commitlint*, crowdin*, cypress.json, dangerfile*, dprint.json, firebase.json, grunt*, gulp*, jasmine.*, jenkins*, jest.config.*, jsconfig.*, karma*, lerna*, lighthouserc.*, lint-staged*, nest-cli.*, netlify*, nodemon*, nx.*, package-lock.json, phpcs.xml, playwright.config.*, pm2.*, pnpm-lock*, prettier*, pullapprove*, puppeteer.config.*, pyrightconfig.json, renovate*, rollup.config.*, stylelint*, tsdoc.*, tslint*, tsup.config.*, turbo*, typedoc*, vercel*, vetur.config.*, vitest.config.*, webpack.config.*, workspace.json, xo.config.*, yarn*",
"tsconfig.json": "tsconfig.*"
},
"files.associations": {
"**/.x-cmd/*": "shellscript",
Expand Down
1 change: 1 addition & 0 deletions .x-cmd/bump
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
-x inquirer \
-x @types/inquirer \
-x https-proxy-agent \
-x node-fetch-cjs \
-x rimraf \
-x lint-staged \
-x pkg-dir \
Expand Down
1 change: 1 addition & 0 deletions docs/.vitepress/config/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const enConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
indexName: 'cz-git',
searchParameters: {
facetFilters: ['lang:en-US'],
attributesToHighlight: ['hierarchy.lvl0'],
},
},
footer: {
Expand Down
1 change: 1 addition & 0 deletions docs/.vitepress/config/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const zhConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
},
searchParameters: {
facetFilters: ['lang:zh-CN'],
attributesToHighlight: ['hierarchy.lvl0'],
},
},
footer: {
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docs",
"version": "1.10.0-beta.1",
"version": "1.9.4",
"private": true,
"scripts": {
"docs:build": "vitepress build",
Expand Down
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "cz-git",
"version": "1.9.4",
"private": true,
"packageManager": "pnpm@9.9.0",
"packageManager": "pnpm@9.11.0",
"description": "A better customizable and git support commitizen adapter",
"author": "Zhengqbbb <[email protected]> (https://github.com/Zhengqbbb)",
"license": "MIT",
Expand Down Expand Up @@ -53,12 +53,12 @@
},
"devDependencies": {
"@antfu/eslint-config": "^3.0.0",
"@commitlint/cli": "^19.4.1",
"@commitlint/config-conventional": "^19.4.1",
"@commitlint/cli": "catalog:commitlint",
"@commitlint/config-conventional": "catalog:commitlint",
"@cz-git/inquirer": "workspace:*",
"@types/inquirer": "8.2.3",
"@types/inquirer": "catalog:inquirer",
"@types/node": "^22.5.2",
"@types/rimraf": "3.0.2",
"@types/rimraf": "catalog:rimraf",
"bumpp": "^9.5.2",
"conventional-changelog-cli": "^5.0.0",
"cz-git": "workspace:*",
Expand All @@ -70,19 +70,18 @@
"npm-run-all2": "^6.2.3",
"ora": "^8.1.0",
"pathe": "^1.1.2",
"pnpm": "^9.9.0",
"rimraf": "3.0.2",
"pnpm": "^9.11.0",
"rimraf": "catalog:rimraf",
"simple-git-hooks": "^2.11.1",
"ts-json-schema-generator": "^2.3.0",
"ts-node": "^10.9.2",
"tsup": "7.2.0",
"tsup": "^8.3.0",
"tsx": "^4.19.0",
"typescript": "^5.5.4",
"vitest": "^2.0.5"
},
"pnpm": {
"overrides": {
"@commitlint/config-validator": "npm:@qbbsh/[email protected]",
"@commitlint/config-validator": "catalog:commitlint",
"chalk": "4.1.2",
"color-convert": "2.0.1",
"import-meta-resolve": "4.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/@cz-git/plugin-inquirer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@cz-git/inquirer",
"version": "1.9.4",
"description": "provide cz-git inquirer plugins, include search-list, search-checkbox, complete-input",
"author": "Zhengqbbb <1074059947@qq.com>",
"author": "Zhengqbbb <zhengqbbb@gmail.com> (https://github.com/Zhengqbbb)",
"license": "MIT",
"homepage": "https://github.com/Zhengqbbb/cz-git/tree/main/packages/%40cz-git/plugin-inquirer",
"repository": {
Expand Down Expand Up @@ -43,7 +43,7 @@
"clean": "rimraf lib"
},
"devDependencies": {
"inquirer": "8.2.4"
"inquirer": "catalog:inquirer"
},
"publishConfig": {
"access": "public"
Expand Down
8 changes: 4 additions & 4 deletions packages/@cz-git/plugin-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@cz-git/loader",
"version": "1.9.4",
"description": "commitizen and commitlint configure loader for cz-git",
"author": "Zhengqbbb <1074059947@qq.com>",
"author": "Zhengqbbb <zhengqbbb@gmail.com> (https://github.com/Zhengqbbb)",
"license": "MIT",
"homepage": "https://github.com/Zhengqbbb/cz-git/tree/main/packages/%40cz-git/plugin-loader",
"repository": {
Expand Down Expand Up @@ -41,10 +41,10 @@
"clean": "rimraf lib"
},
"devDependencies": {
"@commitlint/resolve-extends": "^19.1.0",
"@commitlint/types": "^19.0.3",
"@commitlint/resolve-extends": "catalog:commitlint",
"@commitlint/types": "catalog:commitlint",
"@types/tmp": "^0.2.3",
"cosmiconfig": "8.2.0",
"cosmiconfig": "catalog:",
"pkg-dir": "5.0.0",
"tmp": "^0.2.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"cachedir": "^2.4.0",
"cz-git": "workspace:*",
"dedent": "^1.5.3",
"inquirer": "8.2.4",
"inquirer": "catalog:inquirer",
"minimist": "^1.2.8",
"mkdirp": "^3.0.1"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cz-git/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@
"@cz-git/loader": "workspace:*",
"https-proxy-agent": "5.0.1",
"node-fetch-cjs": "3.3.2",
"rimraf": "3.0.2"
"rimraf": "catalog:rimraf"
}
}
Loading

0 comments on commit dee8b44

Please sign in to comment.