@geek-fun/serverlessinsight 0.9.3 → 0.9.5

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.
Files changed (82) hide show
  1. package/AGENTS.md +5 -2
  2. package/CHANGELOG.md +56 -0
  3. package/README.md +266 -179
  4. package/README.zh-CN.md +264 -147
  5. package/codecov +0 -0
  6. package/codecov.SHA256SUM +1 -1
  7. package/codecov.SHA256SUM.sig +13 -13
  8. package/dist/package.json +22 -19
  9. package/dist/src/commands/deploy.js +7 -2
  10. package/dist/src/commands/destroy.js +6 -3
  11. package/dist/src/commands/forceUnlock.js +16 -21
  12. package/dist/src/commands/index.js +26 -63
  13. package/dist/src/commands/migrate.js +105 -132
  14. package/dist/src/commands/plan.js +27 -3
  15. package/dist/src/commands/show.js +17 -6
  16. package/dist/src/common/aggregateState.js +185 -0
  17. package/dist/src/common/aggregateStore.js +247 -0
  18. package/dist/src/common/aliyunClient/apigwOperations.js +32 -9
  19. package/dist/src/common/apiClient.js +35 -12
  20. package/dist/src/common/constants.js +2 -1
  21. package/dist/src/common/context.js +22 -15
  22. package/dist/src/common/effectiveConfig.js +48 -0
  23. package/dist/src/common/index.js +5 -0
  24. package/dist/src/common/jsonOutput.js +2 -13
  25. package/dist/src/common/migrationMarker.js +0 -7
  26. package/dist/src/common/nameBuilder.js +2 -3
  27. package/dist/src/common/regionalMigration.js +261 -0
  28. package/dist/src/common/saasProtocol.js +41 -0
  29. package/dist/src/common/stateBackend/cosStateBackend.js +88 -8
  30. package/dist/src/common/stateBackend/index.js +42 -18
  31. package/dist/src/common/stateBackend/localStateBackend.js +61 -26
  32. package/dist/src/common/stateBackend/ossStateBackend.js +62 -9
  33. package/dist/src/common/stateBackend/remoteStateBackend.js +94 -94
  34. package/dist/src/common/stateBackend/saasStateBackend.js +327 -92
  35. package/dist/src/common/stateBackend/types.js +9 -0
  36. package/dist/src/common/stateManager.js +38 -11
  37. package/dist/src/common/stateScope.js +34 -0
  38. package/dist/src/common/stateStorageIO.js +31 -0
  39. package/dist/src/lang/en.js +48 -6
  40. package/dist/src/lang/index.js +28 -14
  41. package/dist/src/lang/zh-CN.js +48 -6
  42. package/dist/src/parser/index.js +25 -4
  43. package/dist/src/stack/aliyunStack/apigwDomainPlan.js +82 -0
  44. package/dist/src/stack/aliyunStack/apigwExecutor.js +4 -1
  45. package/dist/src/stack/aliyunStack/apigwPlanner.js +115 -55
  46. package/dist/src/stack/aliyunStack/apigwResource.js +169 -124
  47. package/dist/src/stack/aliyunStack/deployer.js +5 -5
  48. package/dist/src/stack/aliyunStack/destroyer.js +5 -5
  49. package/dist/src/stack/aliyunStack/fc3Planner.js +1 -1
  50. package/dist/src/stack/aliyunStack/fc3Resource.js +2 -2
  51. package/dist/src/stack/aliyunStack/planner.js +1 -1
  52. package/dist/src/stack/aliyunStack/sharedLogProject.js +2 -2
  53. package/dist/src/stack/ownershipTag.js +34 -26
  54. package/dist/src/stack/scfStack/deployer.js +5 -5
  55. package/dist/src/stack/scfStack/destroyer.js +5 -6
  56. package/dist/src/stack/scfStack/planner.js +1 -1
  57. package/dist/src/stack/scfStack/scfResource.js +1 -1
  58. package/dist/src/stack/scfStack/sharedLogset.js +5 -2
  59. package/dist/src/stack/volcengineStack/deployer.js +3 -3
  60. package/dist/src/stack/volcengineStack/destroyer.js +2 -3
  61. package/dist/src/stack/volcengineStack/planner.js +1 -1
  62. package/dist/src/stack/volcengineStack/sharedLogProject.js +4 -4
  63. package/dist/src/stack/volcengineStack/vefaasResource.js +1 -1
  64. package/dist/src/types/domains/state.js +28 -2
  65. package/dist/src/validator/rootSchema.js +8 -0
  66. package/dist/tsconfig.tsbuildinfo +1 -1
  67. package/package.json +22 -19
  68. package/release-notes.md +27 -56
  69. package/samples/README_TENCENT_COS.md +68 -26
  70. package/samples/README_TENCENT_SCF.md +47 -29
  71. package/.serverlessinsight/state-cdn-flow-app-cdn-flow-service.json.backup +0 -14
  72. package/.serverlessinsight/state-iam-test-app-iam-test-service.json.backup +0 -32
  73. package/.serverlessinsight/state-insight-poc-app-insight-poc-tencent.json.backup +0 -90
  74. package/.serverlessinsight/state-insight-poc-app-log-insight-poc-tencent-log.json.backup +0 -118
  75. package/.serverlessinsight/state-insight-poc-deploy-app-insight-poc-deploy.json.backup +0 -215
  76. package/.serverlessinsight/state-insight-poc-destroy-app-insight-poc-destroy.json.backup +0 -14
  77. package/.serverlessinsight/state-insight-poc-timer-app-insight-poc-timer.json.backup +0 -132
  78. package/.serverlessinsight/state-insight-volc-app-insight-volc.json.backup +0 -55
  79. package/.serverlessinsight/state-insight-volc-destroy-app-insight-volc-destroy.json.backup +0 -1
  80. package/.serverlessinsight/state-insight-volc-nested-app-insight-volc-nested.json.backup +0 -93
  81. package/.serverlessinsight/state-nested-drift-app-nested-drift-service.json.backup +0 -163
  82. package/.serverlessinsight/state-role-reconcile-test-app-role-reconcile-test-service.json.backup +0 -148
package/AGENTS.md CHANGED
@@ -179,7 +179,7 @@ All si-generated cloud resource names MUST come from shared builders — never i
179
179
 
180
180
  | Resource | Builder (single source of truth) | Shape |
181
181
  |---|---|---|
182
- | Function execution role | `buildFunctionRoleName` (`src/common/nameBuilder.ts`) | `${app}-${service}-${stage}-${fn.key}-role` — identical on every provider |
182
+ | Function execution role | `buildFunctionRoleName` (`src/common/nameBuilder.ts`) | `buildFunctionRoleName(serviceName, stage, region, fnKey)` — shared constrained builder; stored names take precedence |
183
183
  | Role execution policy | `buildRolePolicyName` (`src/common/nameBuilder.ts`) | `${roleName}-policy` |
184
184
  | Function log topic/logstore | per-provider shared-log module (`buildFunctionLogTopicName` / `buildFunctionLogstoreName`) | `${service}-${stage}-${fn.key}-fn-logs` |
185
185
  | Shared log project/logset | `buildSharedProjectName` / `buildSharedLogsetName` | `${app}-${stage}-sls` / `-tls` / `-cls` |
@@ -761,7 +761,10 @@ export const createRamOperations = (ramClient: RamSdkClient) => ({
761
761
 
762
762
  ### State Management
763
763
 
764
- - State is stored in `.serverlessinsight/state-{app}-{service}.json`
764
+ - Local state is a V4 aggregate at `.serverlessinsight/state-{app}-{service}.json`; Bucket Store retains its configured key.
765
+ - Deploy, destroy and source-to-SaaS migrate automatically prepare V3 under the existing whole-file/key lock; read-only commands never persist upgrades.
766
+ - Partitions use `stages[stage].providers[provider].regions[region]` and share the whole-file lock.
767
+ - Executors/SaaS consume one V4 deployment view; SaaS uses scope protocol 3. App/Service stay literal; provider/region may be selected through CLI flags.
765
768
  - Use `setResource`, `getResource`, `removeResource` from `src/common/stateManager`
766
769
  - Resources have a `status`: `'ready'` | `'tainted'`
767
770
 
package/CHANGELOG.md CHANGED
@@ -7,6 +7,62 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.9.5] - 2026-11-05
11
+
12
+ ### Changed
13
+
14
+ - Deployment state is now isolated per stage/provider/region: the first
15
+ deploy/destroy/migrate upgrades the legacy state file in place to a V4
16
+ aggregate (original backup kept), so deploying to a second region or
17
+ provider no longer touches another deployment's resources
18
+ ([#280](https://github.com/geek-fun/serverlessinsight/issues/280)). CLI
19
+ versions older than this release refuse the upgraded state — upgrade all
20
+ writers together.
21
+ - SaaS deployments now require a Console with regional scope enabled (scope
22
+ protocol 3) and fail closed with guidance against older servers
23
+ ([#280](https://github.com/geek-fun/serverlessinsight/issues/280)).
24
+
25
+ ### Added
26
+
27
+ - `--bind-unknown-region <region>` on `deploy`, `destroy` and `migrate` to
28
+ explicitly bind legacy state entries that carry no region evidence, instead
29
+ of letting the CLI guess where historical resources live
30
+ ([#280](https://github.com/geek-fun/serverlessinsight/issues/280)).
31
+
32
+ ### Fixed
33
+
34
+ - Console/server conflict messages (state or protocol conflicts) are now
35
+ shown verbatim instead of a generic "HTTP Error 409"
36
+ ([#280](https://github.com/geek-fun/serverlessinsight/issues/280)).
37
+
38
+ ## [0.9.4] - 2026-10-27
39
+
40
+ ### Changed
41
+
42
+ - CLI help, README examples, command references and sample guides now promote
43
+ `si diff` as the only planning command.
44
+
45
+ ### Removed
46
+
47
+ - **Breaking:** `si plan` has been removed; `si diff` is now the sole CLI
48
+ command for previewing deployment changes
49
+ ([#271](https://github.com/geek-fun/serverlessinsight/issues/271)). Invoking
50
+ `si plan` fails fast with a localized error directing to `si diff` before any
51
+ cloud or state access. Migrate by replacing the command verb — `si diff`
52
+ accepts the same options and arguments, exit codes (`0` no changes / `2`
53
+ changes / `1` errors) and `--json` envelope (`planVersion: 1`) as the removed
54
+ command.
55
+
56
+ ### Fixed
57
+
58
+ - Aliyun API Gateway plans now report each custom domain's binding and
59
+ certificate fingerprint, and rewrite only the dimensions that changed.
60
+ - Certificate-only and redirect updates skip DNS verification, and removing a
61
+ domain deletes only the bindings and DNS records si owns, leaving foreign
62
+ records intact.
63
+ - CLI language detection now honors `SI_LANG`, normalizes `LC_ALL`/`LANG`, and
64
+ no longer prints `chcp` errors on Linux and macOS.
65
+
10
66
  ## [0.9.3] - 2026-10-24
11
67
 
12
68
  ### Added