-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from caorushizi/dev/plugins
fix: 🐛 types
- Loading branch information
Showing
15 changed files
with
128 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* eslint-env node */ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
}, | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:prettier/recommended", | ||
], | ||
overrides: [], | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
ecmaVersion: "latest", | ||
sourceType: "module", | ||
}, | ||
plugins: ["@typescript-eslint"], | ||
rules: {}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ | |
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Ignore artifacts: | ||
build | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,101 @@ | ||
// eslint-disable-next-line no-undef | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'], // extends can be nested | ||
parserPreset: 'conventional-changelog-conventionalcommits', | ||
extends: ["@commitlint/config-conventional"], // extends can be nested | ||
parserPreset: "conventional-changelog-conventionalcommits", | ||
prompt: { | ||
settings: {}, | ||
messages: { | ||
skip: ':skip', | ||
max: 'upper %d chars', | ||
min: '%d chars at least', | ||
emptyWarning: 'can not be empty', | ||
upperLimitWarning: 'over limit', | ||
lowerLimitWarning: 'below limit' | ||
skip: ":skip", | ||
max: "upper %d chars", | ||
min: "%d chars at least", | ||
emptyWarning: "can not be empty", | ||
upperLimitWarning: "over limit", | ||
lowerLimitWarning: "below limit", | ||
}, | ||
types: [ | ||
{ value: 'feat', name: 'feat: ✨ A new feature', emoji: '✨ ' }, | ||
{ value: 'fix', name: 'fix: 🐛 A bug fix', emoji: '🐛 ' }, | ||
{ value: 'docs', name: 'docs: 📝 Documentation only changes', emoji: '📝 ' }, | ||
{ value: "feat", name: "feat: ✨ A new feature", emoji: "✨ " }, | ||
{ value: "fix", name: "fix: 🐛 A bug fix", emoji: "🐛 " }, | ||
{ | ||
value: 'style', | ||
name: 'style: 💄 Changes that do not affect the meaning of the code', | ||
emoji: '💄 ' | ||
value: "docs", | ||
name: "docs: 📝 Documentation only changes", | ||
emoji: "📝 ", | ||
}, | ||
{ | ||
value: 'refactor', | ||
name: 'refactor: 📦️ A code change that neither fixes a bug nor adds a feature', | ||
emoji: '📦️ ' | ||
value: "style", | ||
name: "style: 💄 Changes that do not affect the meaning of the code", | ||
emoji: "💄 ", | ||
}, | ||
{ | ||
value: 'perf', | ||
name: 'perf: 🚀 A code change that improves performance', | ||
emoji: '🚀 ' | ||
value: "refactor", | ||
name: "refactor: 📦️ A code change that neither fixes a bug nor adds a feature", | ||
emoji: "📦️ ", | ||
}, | ||
{ | ||
value: 'test', | ||
name: 'test: 🚨 Adding missing tests or correcting existing tests', | ||
emoji: '🚨 ' | ||
value: "perf", | ||
name: "perf: 🚀 A code change that improves performance", | ||
emoji: "🚀 ", | ||
}, | ||
{ | ||
value: 'build', | ||
name: 'build: 🛠 Changes that affect the build system or external dependencies', | ||
emoji: '🛠 ' | ||
value: "test", | ||
name: "test: 🚨 Adding missing tests or correcting existing tests", | ||
emoji: "🚨 ", | ||
}, | ||
{ | ||
value: 'ci', | ||
name: 'ci: 🎡 Changes to our CI configuration files and scripts', | ||
emoji: '🎡 ' | ||
value: "build", | ||
name: "build: 🛠 Changes that affect the build system or external dependencies", | ||
emoji: "🛠 ", | ||
}, | ||
{ | ||
value: 'chore', | ||
value: "ci", | ||
name: "ci: 🎡 Changes to our CI configuration files and scripts", | ||
emoji: "🎡 ", | ||
}, | ||
{ | ||
value: "chore", | ||
name: "chore: 🔨 Other changes that don't modify src or test files", | ||
emoji: '🔨 ' | ||
emoji: "🔨 ", | ||
}, | ||
{ | ||
value: "revert", | ||
name: "revert: ⏪️ Reverts a previous commit", | ||
emoji: ":rewind:", | ||
}, | ||
{ value: 'revert', name: 'revert: ⏪️ Reverts a previous commit', emoji: ':rewind:' } | ||
], | ||
useEmoji: true, | ||
confirmColorize: true, | ||
emojiAlign: 'center', | ||
emojiAlign: "center", | ||
questions: { | ||
scope: { | ||
description: 'What is the scope of this change (e.g. component or file name)' | ||
description: | ||
"What is the scope of this change (e.g. component or file name)", | ||
}, | ||
subject: { | ||
description: 'Write a short, imperative tense description of the change' | ||
description: | ||
"Write a short, imperative tense description of the change", | ||
}, | ||
body: { | ||
description: 'Provide a longer description of the change' | ||
description: "Provide a longer description of the change", | ||
}, | ||
isBreaking: { | ||
description: 'Are there any breaking changes?' | ||
description: "Are there any breaking changes?", | ||
}, | ||
breakingBody: { | ||
description: | ||
'A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself' | ||
"A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself", | ||
}, | ||
breaking: { | ||
description: 'Describe the breaking changes' | ||
description: "Describe the breaking changes", | ||
}, | ||
isIssueAffected: { | ||
description: 'Does this change affect any open issues?' | ||
description: "Does this change affect any open issues?", | ||
}, | ||
issuesBody: { | ||
description: | ||
'If issues are closed, the commit requires a body. Please enter a longer description of the commit itself' | ||
"If issues are closed, the commit requires a body. Please enter a longer description of the commit itself", | ||
}, | ||
issues: { | ||
description: 'Add issue references (e.g. "fix #123", "re #123".)' | ||
} | ||
} | ||
} | ||
} | ||
description: 'Add issue references (e.g. "fix #123", "re #123".)', | ||
}, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,4 @@ | |
"**/docs/**", | ||
"**/stats.html" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
#!/usr/bin/env zx | ||
|
||
import { $ } from 'zx' | ||
import { $ } from "zx"; | ||
|
||
console.log('开始执行代码质量评估...\n') | ||
console.log("开始执行代码质量评估...\n"); | ||
|
||
await import('./check').catch((out) => { | ||
throw new Error('代码质量评估失败, 请检查代码') | ||
}) | ||
await import("./check").catch(() => { | ||
throw new Error("代码质量评估失败, 请检查代码"); | ||
}); | ||
|
||
console.log('printf "检测通过, 创建 commit 中...\n') | ||
console.log('printf "检测通过, 创建 commit 中...\n'); | ||
|
||
await $`git add .` | ||
await $`git add .`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { ProcessOutput } from 'zx/core' | ||
import { ProcessOutput } from "zx/core"; | ||
|
||
export function printObject( | ||
object: Record<string, unknown> | ProcessOutput, | ||
method: 'log' | 'warn' | 'error' = 'log' | ||
method: "log" | "warn" | "error" = "log", | ||
) { | ||
for (const [key, value] of Object.entries(object)) { | ||
// eslint-disable-next-line no-console | ||
console[method](`${key}:\n${value}\n`) | ||
console[method](`${key}:\n${value}\n`); | ||
} | ||
} |