@deot/dev-cli 1.0.6 → 1.0.7

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.
@@ -1,6 +1,7 @@
1
1
  import fs from 'fs';
2
2
 
3
- const commitRE = /^(revert: )?(fix|feat|docs|style|perf|test|types|build|chore|refactor|workflow|ci|wip|release|breaking change)(\(.+\))?: .{1,50}/;
3
+ // eslint-disable-next-line max-len
4
+ const commitRE = /^(revert: )?(void|fix|feat|docs|style|perf|test|types|build|chore|refactor|workflow|ci|wip|release|breaking change)(\(.+\))?: .{1,50}/;
4
5
  const mergeRE = /Merge branch /;
5
6
 
6
7
  const gitParams = process.env.HUSKY_GIT_PARAMS || process.argv.pop(); // 兼容husky@v4和husky@v8
@@ -30,6 +31,7 @@ if (!commitRE.test(commitMsg) && !mergeRE.test(commitMsg)) {
30
31
  - build:影响构建系统或外部依赖项的更改
31
32
  - ci: 持续集成相关
32
33
  - breaking change:破坏性修改
34
+ - void:无类型,通常用于初始化
33
35
  - Merge branch 'foo' into 'bar'
34
36
  `
35
37
  );
package/dist/index.js CHANGED
@@ -466,7 +466,7 @@ class Builder {
466
466
  commonjs({ extensions: ['.js', '.ts'] }),
467
467
  nodeResolve(),
468
468
  replace({
469
- '1.0.5': `'${packageOptions.version}'`,
469
+ '1.0.6': `'${packageOptions.version}'`,
470
470
  false: 'false',
471
471
  true: true
472
472
  })
@@ -596,12 +596,13 @@ class Releaser {
596
596
  }
597
597
  ({ stdout } = await Shell.exec('git', params));
598
598
  }
599
- const rePlugin = new RegExp(`^[\\w\\!]+\\(([\\w,-]+)?${packageFolderName}([\\w,-]+)?\\)`, 'i');
600
- const commits = stdout
601
- .split(SUFFIX)
599
+ const allowTypes = ['feat', `fix`, `break change`, `style`, `perf`, `types`, `refactor`, `chore`];
600
+ const rePlugin = new RegExp(`^(${allowTypes.join('|')})${workspace ? `\\(${packageFolderName}\\)` : '(\\(.+\\))?'}: .*`, 'i');
601
+ const allCommits = stdout.split(SUFFIX);
602
+ const commits = allCommits
602
603
  .filter((commit) => {
603
604
  const chunk = commit.trim();
604
- return chunk && (!workspace || rePlugin.test(chunk));
605
+ return chunk && rePlugin.test(chunk);
605
606
  })
606
607
  .map((commit) => {
607
608
  const node = parser.sync(commit);
@@ -619,7 +620,11 @@ class Releaser {
619
620
  Logger.log(chalk.red(`No Commits Found.`));
620
621
  }
621
622
  else {
622
- Logger.log(chalk.yellow(`Found `) + chalk.bold(`${commits.length}`) + ` Commits`);
623
+ Logger.log(chalk.yellow(`Found `)
624
+ + chalk.bold(`${allCommits.length}`)
625
+ + ` Commits, `
626
+ + chalk.bold(`${commits.length}`)
627
+ + ' Commits Valid');
623
628
  }
624
629
  const { skipUpdatePackage } = commandOptions;
625
630
  if (commits.length && skipUpdatePackage) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deot/dev-cli",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",