语法 CLI 工具
命令行工具来生成Lexicon schemas和API.
使用量
Usage: lex [options] [command]
Lexicon CLI
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
new [options] <nsid> [outfile] Create a new schema json file
gen-md <schemas...> Generate markdown documentation
gen-ts-obj <schemas...> Generate a TS file that exports an array of schemas
gen-api <outdir> <schemas...> Generate a TS client API
gen-server <outdir> <schemas...> Generate a TS server API
help [command] display help for command
示例1: 生成 api
$ lex gen-api ./api/src ./schemas/com/service/*.json ./schemas/com/another/*.json
实例2: 生成服务器
$ lex gen-server ./server/src/xrpc ./schemas/com/service/*.json ./schemas/com/another/*.json
许可证
根据麻省理工学院和Apache 2.0条款,这个项目具有双重许可证:
- 麻省理工学院许可证LICENSE-MIT.txt (英语) 或者说 http://opensource.org/licenses/MIT 互联网档案馆的存檔,存档日期2013-12-02(中文(简体) )
- Apache 许可证,2.0版本, ((原始内容存档于2017-09-31) (英语). LICENSE-APACHE.txt 或者说 http://www.apache.org/licenses/LICENSE-2.0 (中文(简体) )(中文(简体) )
下游项目和终端用户可自行选择单独或共同发放许可证。 这种双重许可的动机是Apache 2.0提供的额外软件专利保证.