Giter VIP home page Giter VIP logo

components-helper's Introduction

Hi there 👋

Just an ordinary web frontend programmer.

  • 🔭 I’m currently working on JavaScript TypeScript Vue Futter ...
  • 🌱 I’m currently learning Dart Go

Anurag's GitHub stats

Top Langs

components-helper's People

Contributors

sxzz avatar tolking avatar zouyaoji avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

components-helper's Issues

Ask a question about tableRegExp

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:

image

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.

Not compatible with windows

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])

const path = join(options.outDir, options[type]).replace(/\\/, '/')

Windows 写入文件错误

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

调试信息

WechatIMG404

WechatIMG406

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.