@supacloud/compiler 0.7.0 → 0.8.0
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 +8 -0
- package/dist/cli.js +2 -0
- package/dist/config.d.ts +4 -2
- package/dist/index.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,11 +44,19 @@ export default defineSupacloudConfig({
|
|
|
44
44
|
generateClient: true,
|
|
45
45
|
generatePermissions: true,
|
|
46
46
|
moduleBoundaryPreset: "modular-monolith",
|
|
47
|
+
commandCapabilities: {
|
|
48
|
+
permission: true,
|
|
49
|
+
audit: true,
|
|
50
|
+
idempotency: true,
|
|
51
|
+
transaction: true,
|
|
52
|
+
},
|
|
47
53
|
});
|
|
48
54
|
```
|
|
49
55
|
|
|
50
56
|
命令行参数优先级高于配置文件。`--no-strict`、`--no-client` 和
|
|
51
57
|
`--no-permissions` 只建议用于本地迁移或调试;生产 CI 应保留默认 strict。
|
|
58
|
+
`commandCapabilities` 用于声明运行时实际支持的命令治理能力;命令声明了
|
|
59
|
+
`permission`、`audit` 或 `idempotency` 时,若对应能力关闭,编译器会失败。
|
|
52
60
|
|
|
53
61
|
## API
|
|
54
62
|
|
package/dist/cli.js
CHANGED
|
@@ -5115,6 +5115,7 @@ function resolveSupacloudConfig(config = {}, cwd = process.cwd()) {
|
|
|
5115
5115
|
generateClient: resolved.generateClient ?? DEFAULT_SUPACLOUD_CONFIG.generateClient,
|
|
5116
5116
|
generatePermissions: resolved.generatePermissions ?? DEFAULT_SUPACLOUD_CONFIG.generatePermissions,
|
|
5117
5117
|
moduleBoundaryPreset: resolved.moduleBoundaryPreset ?? DEFAULT_SUPACLOUD_CONFIG.moduleBoundaryPreset,
|
|
5118
|
+
commandCapabilities: resolved.commandCapabilities,
|
|
5118
5119
|
treeShakeUnusedProviders: resolved.treeShakeUnusedProviders ?? DEFAULT_SUPACLOUD_CONFIG.treeShakeUnusedProviders
|
|
5119
5120
|
};
|
|
5120
5121
|
}
|
|
@@ -5141,6 +5142,7 @@ function compileOptionsFromConfig(config, cwd = process.cwd()) {
|
|
|
5141
5142
|
generateClient: resolved.generateClient,
|
|
5142
5143
|
generatePermissions: resolved.generatePermissions,
|
|
5143
5144
|
moduleBoundaryPreset: resolved.moduleBoundaryPreset,
|
|
5145
|
+
commandCapabilities: resolved.commandCapabilities,
|
|
5144
5146
|
treeShakeUnusedProviders: resolved.treeShakeUnusedProviders
|
|
5145
5147
|
};
|
|
5146
5148
|
}
|
package/dist/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CompileOptions, ModuleBoundaryPresetName } from "./types";
|
|
1
|
+
import type { CommandExecutionCapabilities, CompileOptions, ModuleBoundaryPresetName } from "./types";
|
|
2
2
|
export interface SupaCloudConfig {
|
|
3
3
|
root?: string;
|
|
4
4
|
outDir?: string;
|
|
@@ -7,9 +7,10 @@ export interface SupaCloudConfig {
|
|
|
7
7
|
generateClient?: boolean;
|
|
8
8
|
generatePermissions?: boolean;
|
|
9
9
|
moduleBoundaryPreset?: ModuleBoundaryPresetName;
|
|
10
|
+
commandCapabilities?: CommandExecutionCapabilities;
|
|
10
11
|
treeShakeUnusedProviders?: boolean;
|
|
11
12
|
}
|
|
12
|
-
export declare const DEFAULT_SUPACLOUD_CONFIG: Required<Omit<SupaCloudConfig, "include" | "moduleBoundaryPreset">> & {
|
|
13
|
+
export declare const DEFAULT_SUPACLOUD_CONFIG: Required<Omit<SupaCloudConfig, "include" | "moduleBoundaryPreset" | "commandCapabilities">> & {
|
|
13
14
|
include: string[];
|
|
14
15
|
moduleBoundaryPreset: ModuleBoundaryPresetName;
|
|
15
16
|
};
|
|
@@ -22,6 +23,7 @@ export declare function resolveSupacloudConfig(config?: SupaCloudConfig, cwd?: s
|
|
|
22
23
|
generateClient: boolean;
|
|
23
24
|
generatePermissions: boolean;
|
|
24
25
|
moduleBoundaryPreset: ModuleBoundaryPresetName;
|
|
26
|
+
commandCapabilities?: CommandExecutionCapabilities;
|
|
25
27
|
treeShakeUnusedProviders: boolean;
|
|
26
28
|
};
|
|
27
29
|
export declare function loadSupacloudConfig(cwd?: string): Promise<SupaCloudConfig>;
|
package/dist/index.js
CHANGED
|
@@ -5106,6 +5106,7 @@ function resolveSupacloudConfig(config = {}, cwd = process.cwd()) {
|
|
|
5106
5106
|
generateClient: resolved.generateClient ?? DEFAULT_SUPACLOUD_CONFIG.generateClient,
|
|
5107
5107
|
generatePermissions: resolved.generatePermissions ?? DEFAULT_SUPACLOUD_CONFIG.generatePermissions,
|
|
5108
5108
|
moduleBoundaryPreset: resolved.moduleBoundaryPreset ?? DEFAULT_SUPACLOUD_CONFIG.moduleBoundaryPreset,
|
|
5109
|
+
commandCapabilities: resolved.commandCapabilities,
|
|
5109
5110
|
treeShakeUnusedProviders: resolved.treeShakeUnusedProviders ?? DEFAULT_SUPACLOUD_CONFIG.treeShakeUnusedProviders
|
|
5110
5111
|
};
|
|
5111
5112
|
}
|
|
@@ -5132,6 +5133,7 @@ function compileOptionsFromConfig(config, cwd = process.cwd()) {
|
|
|
5132
5133
|
generateClient: resolved.generateClient,
|
|
5133
5134
|
generatePermissions: resolved.generatePermissions,
|
|
5134
5135
|
moduleBoundaryPreset: resolved.moduleBoundaryPreset,
|
|
5136
|
+
commandCapabilities: resolved.commandCapabilities,
|
|
5135
5137
|
treeShakeUnusedProviders: resolved.treeShakeUnusedProviders
|
|
5136
5138
|
};
|
|
5137
5139
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supacloud/compiler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Static compiler for @supacloud/app metadata: builds the application graph from AST, validates it, and generates reflection-free factory code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|