@versatiles/release-tool 1.2.1 → 1.2.3

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.
@@ -27,6 +27,8 @@ export async function release(directory, branch = 'main') {
27
27
  panic('package.json is missing "scripts"');
28
28
  if (!('check' in pkg.scripts))
29
29
  panic('missing npm script "check" in package.json');
30
+ if (!('prepack' in pkg.scripts))
31
+ panic('missing npm script "prepack" in package.json');
30
32
  // get last version
31
33
  const tag = await check('get last github tag', getLastGitHubTag());
32
34
  const shaLast = tag?.sha;
@@ -37,15 +39,17 @@ export async function release(directory, branch = 'main') {
37
39
  // get current sha
38
40
  const { sha: shaCurrent } = await check('get current github commit', getCurrentGitHubCommit());
39
41
  // handle version
40
- const nextVersion = await editVersion(versionLastPackage);
41
- // prepare release notes
42
- const releaseNotes = await check('prepare release notes', getReleaseNotes(nextVersion, shaLast, shaCurrent));
43
- // update version
44
- await check('update version', setNextVersion(nextVersion));
42
+ const nextVersion = await getNewVersion(versionLastPackage);
45
43
  // test
46
44
  await check('run checks', shell.run('npm run check'));
47
- // npm publish
48
- await check('npm publish', shell.run('npm publish --access public'));
45
+ // update version
46
+ await check('update version', setNextVersion(nextVersion));
47
+ // prepare release notes
48
+ const releaseNotes = await check('prepare release notes', getReleaseNotes(nextVersion, shaLast, shaCurrent));
49
+ if (!('private' in pkg) || !Boolean(pkg.private)) {
50
+ // npm publish
51
+ await check('npm publish', shell.run('npm publish --access public'));
52
+ }
49
53
  // git push
50
54
  await check('git add', shell.run('git add .'));
51
55
  await check('git commit', shell.run(`git commit -m "v${nextVersion}"`, false));
@@ -80,10 +84,10 @@ export async function release(directory, branch = 'main') {
80
84
  let notes = commits.reverse()
81
85
  .map(commit => '- ' + commit.message.replace(/\s+/g, ' '))
82
86
  .join('\n');
83
- notes = `# Release v${version}\n\nchanges: \n${notes}\n\n`;
87
+ notes = `# Release v${version}\n\nchanges:\n${notes}\n\n`;
84
88
  return notes;
85
89
  }
86
- async function editVersion(versionPackage) {
90
+ async function getNewVersion(versionPackage) {
87
91
  // ask for new version
88
92
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
89
93
  const versionNew = (await inquirer.prompt({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versatiles/release-tool",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "VersaTiles release and documentation tools",
5
5
  "bin": {
6
6
  "vrt": "./dist/index.js"
@@ -30,22 +30,23 @@
30
30
  "homepage": "https://github.com/versatiles-org/node-versatiles/blob/main/versatiles-release-tool/README.md",
31
31
  "devDependencies": {
32
32
  "@types/inquirer": "^9.0.7",
33
- "@types/jest": "^29.5.11",
34
- "@types/node": "^20.11.15",
35
- "@typescript-eslint/eslint-plugin": "^6.20.0",
36
- "@typescript-eslint/parser": "^6.20.0",
37
- "eslint": "^8.56.0",
33
+ "@types/jest": "^29.5.12",
34
+ "@types/node": "^20.12.4",
35
+ "@typescript-eslint/eslint-plugin": "^7.5.0",
36
+ "@typescript-eslint/parser": "^7.5.0",
37
+ "eslint": "^8.57.0",
38
38
  "jest": "^29.7.0",
39
+ "npm-check-updates": "^16.14.18",
39
40
  "ts-jest": "^29.1.2",
40
41
  "ts-node": "^10.9.2",
41
- "tsx": "^4.7.0",
42
- "typescript": "^5.3.3"
42
+ "tsx": "^4.7.2",
43
+ "typescript": "^5.4.4"
43
44
  },
44
45
  "dependencies": {
45
- "commander": "^11.1.0",
46
- "inquirer": "^9.2.13",
46
+ "commander": "^12.0.0",
47
+ "inquirer": "^9.2.17",
47
48
  "remark": "^15.0.1",
48
49
  "remark-gfm": "^4.0.0",
49
- "typedoc": "^0.25.7"
50
+ "typedoc": "^0.25.12"
50
51
  }
51
52
  }