@supacloud/compiler 0.42.1 → 0.43.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/dist/cli.js +967 -398
- package/dist/delivery-bundle-worker.js +11 -0
- package/dist/diagnostics.js +4 -2
- package/dist/fixtures/runtime-source.d.ts +2 -2
- package/dist/index.js +967 -398
- package/dist/migration-app-version.d.ts +1 -1
- package/dist/migration-elysia-version.d.ts +1 -1
- package/dist/source-semantics.d.ts +18 -0
- package/dist/type-safety.d.ts +12 -0
- package/dist/types.d.ts +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -608,8 +608,8 @@ export default defineSupacloudConfig({
|
|
|
608
608
|
| `invalid-aspect-reference` | error | aspect 不是可静态解析的函数声明、箭头函数或函数表达式 |
|
|
609
609
|
| `invalid-command-mode` | error | transaction/idempotency 必须显式为 `"required"` 或 `"none"`,不允许拼写错误或动态值悄悄关闭治理(SC4012) |
|
|
610
610
|
| `missing-deps` | warn(strict 时 error) | 构造/工厂依赖无法静态解析 |
|
|
611
|
-
| `generated-any` |
|
|
612
|
-
| `source-any` |
|
|
611
|
+
| `generated-any` | error | 生成的 TypeScript 产物包含 `any` |
|
|
612
|
+
| `source-any` | error | 未被排除的生产源码包含显式或推断出的 `any` |
|
|
613
613
|
| `source-type-assertion` | warn(strict 时 error) | 生产源码使用 `as T` 或 `<T>value` 类型断言 |
|
|
614
614
|
| `source-non-null-assertion` | warn(strict 时 error) | 生产源码使用非空断言 `value!` |
|
|
615
615
|
| `source-implicit-widening` | warn(strict 时 error) | 可静态判定的字面量类型隐式宽化 |
|
|
@@ -619,7 +619,11 @@ export default defineSupacloudConfig({
|
|
|
619
619
|
|
|
620
620
|
## 类型安全扫描
|
|
621
621
|
|
|
622
|
-
`strict:
|
|
622
|
+
生产源码与生成产物的类型安全门始终开启,不能通过 `strict: false`、`--no-strict` 或 `typeSafety.scanProductionSource/noAnyInGenerated: false` 关闭。`strict` 仍控制其他 warning 是否升级为 error。
|
|
623
|
+
|
|
624
|
+
生产源码检查强制启用 TypeScript `strict` 及其子选项,以及 `noUncheckedIndexedAccess`、`exactOptionalPropertyTypes`、`noImplicitOverride`、`noPropertyAccessFromIndexSignature` 和 `noFallthroughCasesInSwitch`。项目关闭这些选项不会降低编译检查强度。类型错误及 `any` 错误不会被 `writeOnError` 绕过,增量编译也会重新执行类型安全门。
|
|
625
|
+
|
|
626
|
+
生产源码扫描默认排除测试、fixture、声明文件、`generated` 和 `dist`,并支持 `typeSafety.exclude` 增加项目自定义排除规则。这些排除项属于检查范围边界,不代表被排除文件已经通过类型检查。第三方声明的完整安全性仍不在保证范围内。
|
|
623
627
|
|
|
624
628
|
```bash
|
|
625
629
|
supacloud-compiler check --root ./app --out ./app/generated --strict
|