roojay520 / bob-plug Goto Github PK
View Code? Open in Web Editor NEWBob 插件开发工具,包含 cli 项目初始化工具和 Bob 插件核心类型封装
Bob 插件开发工具,包含 cli 项目初始化工具和 Bob 插件核心类型封装
我看到很多类型包括命名都用了 addtion
,比如
// https://ripperhe.gitee.io/bob/#/plugin/object/serviceerror
export interface ServiceError {
type: ServiceErrorType; // 错误类型
message: string; // 错误描述,用于展示给用户看
addtion: string; // 附加信息,可以是任何可 json 序列化的数据类型,用于 debug
}
但这个拼写应该是 typo,正确的拼写是 addition,我看现在的 Bob 文档中也是写作 addition
.
现在的问题就是想知道,这两个字段哪个才是正确的;看到这个字段是用于 debug,但我在 Console 中并没有看到 addtion
或者 addition
字段
macos控制台显示
[❌] 插件未实现 supportLanguages 方法: pluginIdentifier=com.silver-ymz.microsoft-translate
在通过production模式构建时,rollup会重命名函数名,导致supportLanguages
和translate
函数仅在exports
中可见,而在main.js
中不存在。
手动将打包后的main.js
文件中exports.supportLanguages=ou,exports.translate=iu;
改为var supportLanguages = ou, translate = iu
,就能正常在bob中运行
安装完成后,首次执行 bob create xxx
提示 Error: Cannot find module 'fs-extra'
~/Desktop [23:06:47]
➜ yarn global add @bob-plug/cli
yarn global v1.22.17
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
success Installed "@bob-plug/[email protected]" with binaries:
- bob
✨ Done in 23.33s.
~/Desktop [23:07:43]
➜ bob create test
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'fs-extra'
Require stack:
- /Users/ripper/.config/yarn/global/node_modules/@bob-plug/cli/lib/index.cjs.js
- /Users/ripper/.config/yarn/global/node_modules/@bob-plug/cli/bin/bob.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/Users/ripper/.config/yarn/global/node_modules/@bob-plug/cli/lib/index.cjs.js:7:10)
at Module._compile (node:internal/modules/cjs/loader:1095:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1147:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/ripper/.config/yarn/global/node_modules/@bob-plug/cli/lib/index.cjs.js',
'/Users/ripper/.config/yarn/global/node_modules/@bob-plug/cli/bin/bob.js'
]
}
Node.js v17.0.1
然后手动安装 fs-extra
之后好了
~/Desktop [23:10:25]
➜ yarn global add fs-extra
yarn global v1.22.17
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
warning "[email protected]" has no binaries
✨ Done in 16.34s.
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.