Skip to content

Commit 990d501

Browse files
committed
feat(cli): add init command
1 parent 2c48e4c commit 990d501

39 files changed

+514
-170
lines changed

Diff for: README.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- [x] define-render
99
- [x] export-render
1010
- [x] define-slots
11-
- [x] short-v-model
11+
- [x] short-vmodel
1212
- [x] setup-sfc
1313

1414

@@ -19,11 +19,20 @@
1919
pnpm add -g @vue-macros/cli
2020
```
2121

22-
### sg
22+
### SG
2323
```shell
2424
vue-macros sg
2525
```
2626

27-
## License
27+
### Init
28+
```shell
29+
pnpm create vite my-vue-macros --template vue
30+
31+
cd my-vue-macros
32+
33+
vue-macros init
34+
```
35+
36+
## Licenase
2837

2938
MIT License © 2023-PRESENT [zhiyuanzmj](https://github.com/zhiyuanzmj)

Diff for: build.config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ export default defineBuildConfig({
55
'src/index',
66
{
77
builder: 'mkdist',
8-
input: './src',
9-
outDir: './dist',
8+
input: './src/sg',
9+
outDir: './dist/sg',
1010
},
1111
],
1212
clean: true,

Diff for: eslint.config.js

-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@ export default antfu(
1717
'yaml/indent': 'off',
1818
},
1919
},
20-
ignores: ['**/playground/**'],
2120
},
2221
)

Diff for: package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@
4242
"prepublishOnly": "pnpm run build"
4343
},
4444
"dependencies": {
45-
"@ast-grep/cli": "^0.14.1",
45+
"@antfu/ni": "^0.21.12",
46+
"@ast-grep/cli": "^0.14.2",
4647
"@inquirer/prompts": "^3.3.0",
48+
"magicast": "^0.3.2",
4749
"pkg-types": "^1.0.3",
4850
"zx": "^7.2.3"
4951
},

Diff for: playground/nuxt.config.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// @ts-expect-error ignore
2+
export default defineNuxtConfig({
3+
4+
})

Diff for: playground/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"type": "module",
33
"scripts": {
4-
"sg": "tsx ../src/index.ts sg ./src",
4+
"sg": "node ../dist/index.mjs",
55
"dev": "vite",
66
"build": "vite build"
77
},
@@ -11,10 +11,11 @@
1111
"devDependencies": {
1212
"@vitejs/plugin-vue": "^4.5.0",
1313
"@vitejs/plugin-vue-jsx": "^3.1.0",
14-
"unplugin-vue-macros": "^2.7.0",
1514
"@vue-macros/volar": "^0.17.4",
1615
"@vue/babel-helper-vue-transform-on": "1.2.0-alpha.0",
1716
"tsx": "^4.6.1",
17+
"typescript": "^5.3.2",
18+
"unplugin-vue-macros": "^2.7.0",
1819
"vite": "^5.0.4"
1920
}
2021
}

Diff for: playground/pnpm-lock.yaml

+36-26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: playground/src/App.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { shallowRef } from 'vue';
2+
import { shallowRef } from 'vue'
33
import Comp from './components/Comp.vue'
44
55
const list = [{ id: 1 }]
@@ -15,8 +15,8 @@ const compRef = shallowRef()
1515
v-if="select"
1616
:key="i.id"
1717
v-bind="bind"
18-
v-model:id="i.id"
1918
ref="compRef"
19+
v-model:id="i.id"
2020
v-loading.fullscreen.lock="true"
2121
v-memo="[select?.id === i.id]"
2222
v-on="on"
@@ -38,4 +38,4 @@ const compRef = shallowRef()
3838
body {
3939
font-size: 14px;
4040
}
41-
</style>
41+
</style>

0 commit comments

Comments
 (0)