Skip to content

Commit

Permalink
release: v0.17.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cloydlau committed Oct 11, 2024
1 parent 140d726 commit 577de0d
Show file tree
Hide file tree
Showing 7 changed files with 218 additions and 204 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
tags:
- 'v*'

permissions:
id-token: write # This is required for requesting the JWT

jobs:
release:
runs-on: ubuntu-latest
Expand All @@ -17,6 +20,15 @@ jobs:
with:
node-version: latest

- run: npm i pnpm@latest -g
- run: pnpm config set registry https://registry.npmmirror.com
- run: pnpm i
- run: pnpm build
- run: npx jsr publish
- run: npm publish --registry=https://registry.npmjs.org --provenance
- run: cnpm sync
- run: curl -L https://npmmirror.com/sync/json-editor-vue
- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion dependency-licenses.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
├─ MIT: 87
├─ MIT: 88
├─ Apache-2.0: 7
├─ BSD-2-Clause: 3
├─ BSD-3-Clause: 2
Expand Down
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cloydlau/json-editor-vue",
"version": "0.17.1",
"version": "0.17.2",
"exports": "./dist/json-editor-vue.mjs",
"publish": {
"include": [
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "json-editor-vue",
"PascalCasedName": "JsonEditorVue",
"type": "commonjs",
"version": "0.17.1",
"version": "0.17.2",
"private": false,
"description": "Vue and Nuxt 2/3 isomorphic JSON editor, viewer, formatter and validator.",
"author": {
Expand Down Expand Up @@ -86,7 +86,7 @@
}
},
"dependencies": {
"vanilla-jsoneditor": "^1.0.6",
"vanilla-jsoneditor": "^1.0.7",
"vue-demi": "^0.14.10"
},
"devDependencies": {
Expand Down Expand Up @@ -126,7 +126,7 @@
"semver": "^7.6.3",
"simple-git-hooks": "^2.11.1",
"tsup": "^8.3.0",
"typescript": "^5.6.2",
"typescript": "^5.6.3",
"unplugin-auto-import": "^0.18.3",
"unplugin-vue-components": "^0.27.4",
"vite": "^5.4.8",
Expand All @@ -138,7 +138,7 @@
"zhlint": "^0.8.2"
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged",
"pre-commit": "pnpm lint-staged && actionlint",
"commit-msg": "npx --no -- commitlint --edit ${1}"
},
"lint-staged": {
Expand Down
363 changes: 182 additions & 181 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/dev.mts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// pnpm i only-allow esno prompts cross-spawn kolorist magicast del -D -w

import type { ASTNode } from 'magicast'
import fs from 'node:fs'
import spawn from 'cross-spawn'
import { cyan } from 'kolorist'
import { loadFile, writeFile } from 'magicast'
import { addVitePlugin } from 'magicast/helpers'
import prompts from 'prompts'
import type { ASTNode } from 'magicast'

type VueVersion = '3' | '2.7' | '2.6'

Expand Down
33 changes: 17 additions & 16 deletions scripts/release.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@ import fs from 'node:fs'
import spawn from 'cross-spawn'
// import { deleteAsync } from 'del'
import { cyan } from 'kolorist'
import open from 'open'
// import open from 'open'
import prompts from 'prompts'
import * as semver from 'semver'

const docsPath = ['./README.md', './docs/README.zh-CN.md']

async function release() {
console.log(cyan('Fetching origin...'))
console.log(cyan('\nFetching origin...'))
if (spawn.sync('git', ['pull'], { stdio: 'inherit' }).status === 1) {
return
}

console.log(cyan('Linting staged...'))
console.log(cyan('\nLinting staged...'))
if (spawn.sync('npx', ['lint-staged'], { stdio: 'inherit' }).status === 1) {
return
}

console.log(cyan('Unit testing...'))
console.log(cyan('\nUnit testing...'))
if (spawn.sync('pnpm', ['test'], { stdio: 'inherit' }).status === 1) {
return
}

console.log(cyan('Building...'))
console.log(cyan('\nBuilding...'))
if (spawn.sync('pnpm', ['build'], { stdio: 'inherit' }).status === 1) {
return
}

console.log(cyan('Publinting...'))
console.log(cyan('\nPublinting...'))
if (spawn.sync('npx', ['publint'], { stdio: 'inherit' }).status === 1) {
return
}

console.log(cyan('Checking exports...'))
console.log(cyan('\nChecking exports...'))
if (spawn.sync('pnpm', ['check-exports'], { stdio: 'inherit' }).status === 1) {
return
}
Expand Down Expand Up @@ -126,7 +126,7 @@ async function release() {
fs.writeFileSync('./jsr.json', JSON.stringify(jsrConfig, null, 2))
fs.writeFileSync('./package.json', JSON.stringify(npmConfig, null, 2))

console.log(cyan('Committing...'))
console.log(cyan('\nCommitting...'))
if (spawn.sync('git', ['add', '-A'], { stdio: 'inherit' }).status === 1) {
return
}
Expand All @@ -139,30 +139,31 @@ async function release() {
return
}

console.log(cyan('Pushing...'))
console.log(cyan('\nPushing...'))
if (spawn.sync('git', ['push'], { stdio: 'inherit' }).status === 1) {
return
}
if (spawn.sync('git', ['tag', `v${targetVersion}`], { stdio: 'inherit' }).status === 1) {
return
}
if (spawn.sync('git', ['push', 'origin', `refs/tags/v${targetVersion}`], { stdio: 'inherit' }).status === 1) {
return
// return
}

console.log(cyan('Publishing to jsr...'))
/* console.log(cyan('\nPublishing to jsr...'))
if (spawn.sync('npx', ['jsr', 'publish'], { stdio: 'inherit' }).status === 1) {
return
}
} */

console.log(cyan('Publishing to npm...'))
// Automatic provenance generation not supported outside of GitHub Actions
/* console.log(cyan('\nPublishing to npm...'))
if (spawn.sync('npm', ['publish', '--registry=https://registry.npmjs.org', '--provenance'], { stdio: 'inherit' }).status === 1) {
return
}
} */

console.log(cyan('Updating npmmirror...'))
/* console.log(cyan('\nUpdating npmmirror...'))
spawn.sync('cnpm', ['sync'], { stdio: 'inherit' })
open(`https://npmmirror.com/sync/${name}`)
open(`https://npmmirror.com/sync/${name}`) */
}

try {
Expand Down

0 comments on commit 577de0d

Please sign in to comment.