Releases: swordjs/sword-framework
cli-v1.7.2
1.7.2
Minor Changes
- Add conditional compilation function and optimize code package
// @ifdef server || unicloud
console.log("server or unicloud")
// @endif
// @ifdef server
console.log("server")
// @endif
// @ifndef server
console.log("server")
// @endif
conditional compiled code can also be written in other ways
if(process.env._SWORD_PLATFORM === "server"){
// do something...
}
Similarly, we used to use useProd
and useDev
to determine the runtime environment, now we can use the following method to determine the runtime environment, this will be compiled in advance, the generated code will only contain the code of the current environment, in short, it reduces the runtime overhead
if(process.env._SWORD_COMMAND === "build"){
// do something...
// dev / build / doc etc...
}
In the latest example, the type hint for the env (src/global.d.ts) has been added to the sample project so that the developer has a good type hint
- Vscode plugin adds conditional compilation code snippets
For conditional compilation, we can write comment macros, or we can make judgments directly on process.env._SWORD_PLATFORM, and when you use comment macros, the latest vscode plugin will help you write comment macros, like this
cli-v1.7.1
1.7.1
Minor Changes
- Add conditional compilation function and optimize code package
- Vscode plugin adds conditional compilation code snippets
cli-v1.6.0
1.6.0
Minor Changes
- add custom doc compile and output for markdown
- Preliminary completion of the extension of the old solution for front-end and back-end type synchronization #15
v1.4.1
v1.4.0
v1.3.2
v1.3.1
@swordjs/sword-framework 1.3.1
- support multiple routes on api core
@swordjs/sword-framework-cli v1.5.0
- proto.json -> api.json and add alias
tips
new vscode extension: https://marketplace.visualstudio.com/items?itemName=swordjs.framework-helper
v1.3.0
@swordjs/sword-framework 1.3.0
- add useIsDev & useIsProd
- api.json support
@swordjs/sword-framework-cli v1.4.0
- add util core
- proto.json -> api.json
- add env support (shim)
tips
If you need use useIsDev
& useIsProd
, you must pre run:
sword util --util-name=clearShim
v1.2.2
[壮举] 新增unicloud平台云函数url化功能🎉
[壮举] 新增集成返回功能
[壮举] 新的swordjs组织名称以及新的域名: swordjs.dev
[完善] dev模式的swc引擎修改为esbuild, 现在是pure esbuild, 原因是因为ts的swc register不满足业务需要, 生态中没有更好的swc register了
[修复] 修复已知问题, 调整源码结构
[修复] 完善cli生成代码功能