README
@tuyaworks/core
此包的意义在于抽离各插件公共的逻辑以便复用,也是抽离于运行环境,只依赖于 nodejs 的工具包。
- config:放置 tuyaworks 各种约定配置
- constants:管理各种常量 key
- privateApi:管理内网 api,这里使用内网 npm 作为数据源,插件打包只会打包进一个 npm 包的地址,而不会打包进去 api 列表,从而实现接口脱敏。
- downloadTarball:下载 npm、github 或者 gitlab 的 tarball
- gitlab:gitlab 操作相关
- template:模板操作相关
- compiler:ts编译器分析能力
install
yarn add @tuyaworks/core
gitlab
import { getDefaultGitlabBranchName } from '@tuyaworks/core'
privateApi
// 推荐这样使用,按需引入
import { installPrivateApi } from '@tuyaworks/core/lib/privateApi'
compiler
// compiler分析器
// 需要将typescrupt安装为依赖,yarn add typescript -S
// compiler只可以通过/lib/compiler引入,同时.vscodeignore添加:
// node_modules/typescript/
// !node_modules/typescript/lib/typescript.js
import { checki18n } from '@tuyaworks/core/lib/compiler'
待补充