Skip to content

Commit

Permalink
chore: create bump scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ngseke committed Nov 22, 2023
1 parent cb39972 commit 0c65f68
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
"private": true,
"version": "0.0.0",
"type": "module",
"repository": {
"type": "git",
"url": "https://github.com/ngseke/versatile-npm"
},
"scripts": {
"dev": "vite",
"build": "vue-tsc && vite build",
"preview": "vite preview",
"lint": "npx eslint . --ext .ts,.js,.cjs,.vue",
"lint:fix": "npx eslint --fix . --ext .ts,.js,.cjs,.vue"
"lint:fix": "npx eslint --fix . --ext .ts,.js,.cjs,.vue",
"bump": "node ./scripts/bump.js"
},
"engines": {
"node": ">=18",
Expand Down
16 changes: 16 additions & 0 deletions scripts/bump.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* eslint-disable no-console */
import { execSync } from 'child_process'
import { openReleasePage } from './openReleasePage.js'

const execWithStdio = (command) => execSync(command, { stdio: 'inherit' })

async function bump () {
const commitMessage = 'chore: bump version v%s'
execWithStdio(`npx bumpp --commit "${commitMessage}"`)

await openReleasePage()

console.log('\n✅ All Done!')
}

bump()
9 changes: 9 additions & 0 deletions scripts/openReleasePage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import open from 'open'
import packageJson from '../package.json' assert { type: 'json' }

export async function openReleasePage () {
const { default: urlJoin } = await import('url-join')
const url = urlJoin(packageJson.repository.url, 'releases')
console.log(url)
await open(url)
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"src/**/*.vue",
"vite.config.ts",
"manifest.config.ts",
".eslintrc.cjs"
".eslintrc.cjs",
"scripts/**/*.js",
],
"references": [{ "path": "./tsconfig.node.json" }]
}

0 comments on commit 0c65f68

Please sign in to comment.