Just an ordinary web frontend programmer.
- 🔭 I’m currently working on
JavaScript
TypeScript
Vue
Futter
... - 🌱 I’m currently learning
Dart
Go
Based on the docs to provide code prompt files for vue component library
License: MIT License
This is a great project, thank you very much. In my case, some documents contain comments to assist prettier
formatting, such as <!-- prettier-ignore -->
, as the picture shows:
so I should handle this situation in tableRegExp. And this is my tableRegExp configuration.
helper({
name,
version: _version,
entry: 'website/docs/zh-CN/vc-entity.md',
outDir: 'lib',
reComponentName,
reDocUrl,
reAttribute,
props: '属性',
propsName: '属性名',
propsDescription: '描述',
propsType: '类型',
propsDefault: '默认值',
propsOptions: '可选值',
events: '事件',
eventsName: '事件名',
eventsDescription: '描述',
slots: '插槽',
slotsName: '插槽名',
slotsDescription: '描述',
directives: '插槽',
directivesName: '插槽名',
directivesDescription: '描述',
directivesType: '类型',
tableRegExp: '#+\\s+(.*\\s*属性|.*\\s*事件|.*\\s*插槽|.*\\s*指令)\\s*\\n+((<!--.*?-->)*)\\n*(\\|?.+\\|.+)\\n\\|?\\s*:?-+:?\\s*\\|.+((\\n\\|?.+\\|.+)+)'
})
Among them, ((<!--.*?-->)*)\\n*
is what I added.
I think it looks okay, but I can’t get the correct result. I hope I can get your help.
Error: ENOENT: no such file or directory, open 'C:/XXX\element-plus\dist\element-plus\tags.json'
at Object.openSync (node:fs:585:3)
at Object.writeFileSync (node:fs:2153:35)
at C:\XXX\element-plus\node_modules\.pnpm\[email protected]\node_modules\components-helper\lib\index.js:438:12
at FSReqCallback.oncomplete (node:fs:188:23)
at FSReqCallback.callbackTrampoline (node:internal/async_hooks:130:17) {
errno: -4058,
syscall: 'open',
code: 'ENOENT',
path: 'C:/Users\\XXX\\element-plus\\dist\\element-plus\\tags.json'
}
We can modify it to
const path = path.resolve(options.outDir, options[type])
components-helper/src/write.ts
Line 10 in 61cf40b
Is there a way to automatically generate subtags, or manually define subtags?
windows 的路径是 \
分割符,用 path.substring(0, path.lastIndexOf('/'))
拆分目录不兼容。可以使用内置的方法 path.dirname
获取目录,不会有兼容问题。
Error: ENOENT: no such file or directory, open 'E:\haiweilian\github\vlib-starter\packages\vlib-ui\dist\tags.json'
at Object.openSync (node:fs:603:3)
at Object.writeFileSync (node:fs:2324:35)
at E:\haiweilian\github\vlib-starter\packages\vlib-ui\scripts\build\task\helper.js:700:8
at FSReqCallback.oncomplete (node:fs:200:23)
at FSReqCallback.callbackTrampoline (node:internal/async_hooks:130:17) {
errno: -4058,
syscall: 'open',
code: 'ENOENT',
path: 'E:\\haiweilian\\github\\vlib-starter\\packages\\vlib-ui\\dist\\tags.json'
}
Node.js v18.18.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.