Skip to content

Releases: swordjs/sword-framework

cli-v1.7.2

13 Feb 12:57
Compare
Choose a tag to compare

1.7.2

Minor Changes

  1. 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

  1. 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

i4qah-4qds2

cli-v1.7.1

13 Feb 12:27
Compare
Choose a tag to compare

1.7.1

Minor Changes

  1. Add conditional compilation function and optimize code package
  2. Vscode plugin adds conditional compilation code snippets

cli-v1.6.0

02 Jan 09:53
Compare
Choose a tag to compare

1.6.0

Minor Changes

  1. add custom doc compile and output for markdown
  2. Preliminary completion of the extension of the old solution for front-end and back-end type synchronization #15

v1.4.1

30 Oct 11:21
Compare
Choose a tag to compare

@swordjs/sword-framework 1.4.1

  • fix api route error in windows

@swordjs/sword-framework-cli v1.5.5

  • fix api route error in windows

v1.4.0

05 Aug 14:41
Compare
Choose a tag to compare

@swordjs/sword-framework 1.4.0

  • support preApi & postApi on plugin root

@swordjs/sword-framework-cli v1.5.2

  • update framework version

v1.3.2

23 Jul 14:43
Compare
Choose a tag to compare

@swordjs/sword-framework 1.3.2

  • update checkPath core

@swordjs/sword-framework-cli v1.5.1

  • update framework version

v1.3.1

22 Jul 16:01
132c9c8
Compare
Choose a tag to compare

@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

16 Jul 16:52
Compare
Choose a tag to compare

@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

04 Jul 15:59
Compare
Choose a tag to compare

[壮举] 新增unicloud平台云函数url化功能🎉
[壮举] 新增集成返回功能
[壮举] 新的swordjs组织名称以及新的域名: swordjs.dev
[完善] dev模式的swc引擎修改为esbuild, 现在是pure esbuild, 原因是因为ts的swc register不满足业务需要, 生态中没有更好的swc register了
[修复] 修复已知问题, 调整源码结构
[修复] 完善cli生成代码功能

v1.2.1

05 Jun 15:10
Compare
Choose a tag to compare
🎈 perf: update turbo config