@deot/dev-cli 1.0.2 → 1.0.4

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.
Files changed (2) hide show
  1. package/dist/index.js +24 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -438,7 +438,7 @@ class Builder {
438
438
  commonjs({ extensions: ['.js', '.ts'] }),
439
439
  nodeResolve(),
440
440
  replace({
441
- '1.0.1': `'${packageOptions.version}'`,
441
+ '1.0.3': `'${packageOptions.version}'`,
442
442
  false: 'false',
443
443
  true: true
444
444
  })
@@ -547,14 +547,22 @@ class Releaser {
547
547
  params = ['--no-pager', 'log', `${latestTag}..HEAD`, `--format=%B%n${HASH}%n%H${SUFFIX}`];
548
548
  const rePlugin = new RegExp(`^[\\w\\!]+\\(([\\w,-]+)?${packageFolderName}([\\w,-]+)?\\)`, 'i');
549
549
  let { stdout } = await Shell.exec('git', params);
550
- if (!stdout) {
551
- if (latestTag)
550
+ let skipGetLog = false;
551
+ if (latestTag) {
552
+ const log1 = await Shell.exec('git', ['rev-parse', latestTag]);
553
+ const log2 = await Shell.exec('git', ['--no-pager', 'log', '-1', '--format=%H']);
554
+ if (log1.stdout === log2.stdout) {
555
+ skipGetLog = true;
556
+ }
557
+ }
558
+ if (!skipGetLog && !stdout) {
559
+ if (latestTag) {
552
560
  params.splice(2, 1, `${latestTag}`);
553
- else
561
+ }
562
+ else {
554
563
  params.splice(2, 1, 'HEAD');
555
- ({
556
- stdout
557
- } = await Shell.exec('git', params));
564
+ }
565
+ ({ stdout } = await Shell.exec('git', params));
558
566
  }
559
567
  const commits = stdout
560
568
  .split(SUFFIX)
@@ -680,6 +688,11 @@ class Releaser {
680
688
  notes.updates.push(message);
681
689
  }
682
690
  }
691
+ Object.keys(notes).forEach(i => {
692
+ notes[i] = notes[i].filter((j) => {
693
+ return !logFile.includes(j);
694
+ });
695
+ });
683
696
  const parts = [
684
697
  notes.breaking.length ? `### Breaking Changes\n\n- ${notes.breaking.join('\n- ')}`.trim() : '',
685
698
  notes.fixes.length ? `### Bugfixes\n\n- ${notes.fixes.join('\n- ')}`.trim() : '',
@@ -949,7 +962,9 @@ const run = (options) => Utils.autoCatch(async () => {
949
962
  Logger.log(chalk.magenta(`COMMIT: `) + chalk.yellow(`Skipping Git Commit`) + `\n${message}`);
950
963
  }
951
964
  else {
952
- Logger.log(chalk.magenta(`COMMIT: `) + `CHANGELOG.md, package.json`);
965
+ Logger.log(chalk.magenta(`CHANGED: `) + `pnpm-lock.yaml`);
966
+ await Shell.spawn('npx', ['pnpm', 'install', '--lockfile-only']);
967
+ Logger.log(chalk.magenta(`COMMIT: `) + `CHANGELOG.md, package.json, pnpm-lock.yaml`);
953
968
  await Shell.spawn('git', ['add', process.cwd()]);
954
969
  await Shell.spawn('git', ['commit', '--m', `'${message}'`]);
955
970
  }
@@ -970,6 +985,7 @@ const run = (options) => Utils.autoCatch(async () => {
970
985
  }
971
986
  else {
972
987
  await Shell.spawn('git', ['push']);
988
+ await Shell.spawn('git', ['push', '--tags']);
973
989
  }
974
990
  if (options.dryRun) {
975
991
  Logger.log(chalk.green('NO DRY RUN WAY: ')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deot/dev-cli",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",