Skip to content

Commit

Permalink
feat: use vue-macros cli
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyuanzmj committed Dec 1, 2023
1 parent ab948c2 commit 3f210e8
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 3 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
push:
tags:
- 'v*'
workflow_dispatch: {}

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Set node
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm
registry-url: 'https://registry.npmjs.org'

- run: npx changelogithub
continue-on-error: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Install Dependencies
run: pnpm i

- name: Publish to NPM
run: pnpm -r publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
NPM_CONFIG_PROVENANCE: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pnpm add -g @vue-macros/cli

### sg
```shell
@vue-macros/cli sg
vue-macros sg
```

## License
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"bin": "./dist/index.mjs",
"bin": {
"vue-macros": "./dist/index.mjs"
},
"files": [
"dist"
],
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if (macro === 'short-v-model') {
})
}

const target = path.resolve(argv._.at(-1) || '.')
const target = path.resolve(argv._.at(1) || './src')
async function toSetupSFC() {
const filename = path.basename(target)
const files = await glob(`${target}${filename ? '' : '/**/*.vue'}`, {
Expand Down

0 comments on commit 3f210e8

Please sign in to comment.