@empire-builder-kit/nx 1.0.0-rc.30 → 1.0.0-rc.32
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/executors.json +8 -3
- package/package.json +14 -7
- package/src/aws/child-environment.d.ts +10 -0
- package/src/aws/child-environment.js +77 -0
- package/src/aws/child-environment.js.map +1 -0
- package/src/aws/identity.d.ts +13 -0
- package/src/aws/identity.js +41 -0
- package/src/aws/identity.js.map +1 -0
- package/src/aws-authority/index.d.ts +1 -0
- package/src/aws-authority/index.js +5 -0
- package/src/aws-authority/index.js.map +1 -0
- package/src/aws-authority/stage-authority.d.ts +240 -0
- package/src/aws-authority/stage-authority.js +2968 -0
- package/src/aws-authority/stage-authority.js.map +1 -0
- package/src/cli/main.d.ts +2 -0
- package/src/cli/main.js +11 -0
- package/src/cli/main.js.map +1 -1
- package/src/developer-agent/generator-planning.js +4 -4
- package/src/developer-agent/generator-planning.js.map +1 -1
- package/src/developer-agent/operation-registry.js +14 -6
- package/src/developer-agent/operation-registry.js.map +1 -1
- package/src/developer-agent/workspace-inspection.js +11 -2
- package/src/developer-agent/workspace-inspection.js.map +1 -1
- package/src/executors/deployment-plan/deployment-plan.js +1 -1
- package/src/executors/deployment-plan/deployment-plan.js.map +1 -1
- package/src/executors/foundation-preflight/foundation-preflight.d.ts +0 -1
- package/src/executors/foundation-preflight/foundation-preflight.js.map +1 -1
- package/src/executors/foundation-preflight/schema.json +0 -5
- package/src/executors/foundation-profile-preflight/foundation-profile-preflight.d.ts +12 -3
- package/src/executors/foundation-profile-preflight/foundation-profile-preflight.js +95 -32
- package/src/executors/foundation-profile-preflight/foundation-profile-preflight.js.map +1 -1
- package/src/executors/foundation-profile-preflight/production-database-safeguard.d.ts +64 -0
- package/src/executors/foundation-profile-preflight/production-database-safeguard.js +221 -0
- package/src/executors/foundation-profile-preflight/production-database-safeguard.js.map +1 -0
- package/src/executors/foundation-profile-preflight/schema.json +1 -6
- package/src/executors/foundation-remove-preflight/foundation-remove-preflight.d.ts +11 -1
- package/src/executors/foundation-remove-preflight/foundation-remove-preflight.js +44 -21
- package/src/executors/foundation-remove-preflight/foundation-remove-preflight.js.map +1 -1
- package/src/executors/foundation-remove-preflight/schema.json +6 -1
- package/src/executors/github-bootstrap/github-bootstrap.d.ts +1 -0
- package/src/executors/github-bootstrap/github-bootstrap.js +1 -0
- package/src/executors/github-bootstrap/github-bootstrap.js.map +1 -1
- package/src/executors/github-bootstrap/schema.json +7 -1
- package/src/executors/infrastructure-plan/infrastructure-plan.d.ts +27 -369
- package/src/executors/infrastructure-plan/infrastructure-plan.js +237 -5470
- package/src/executors/infrastructure-plan/infrastructure-plan.js.map +1 -1
- package/src/executors/infrastructure-plan/schema.json +8 -64
- package/src/executors/local-deploy/federated-credential-transport.d.ts +48 -0
- package/src/executors/local-deploy/federated-credential-transport.js +252 -0
- package/src/executors/local-deploy/federated-credential-transport.js.map +1 -0
- package/src/executors/local-deploy/local-approval.d.ts +4 -9
- package/src/executors/local-deploy/local-approval.js +3 -7
- package/src/executors/local-deploy/local-approval.js.map +1 -1
- package/src/executors/local-deploy/local-deploy.d.ts +60 -43
- package/src/executors/local-deploy/local-deploy.js +955 -804
- package/src/executors/local-deploy/local-deploy.js.map +1 -1
- package/src/executors/local-deploy/schema.json +3 -20
- package/src/executors/refresh/refresh.js +2 -2
- package/src/executors/refresh/refresh.js.map +1 -1
- package/src/executors/remove/remove.js +2 -2
- package/src/executors/remove/remove.js.map +1 -1
- package/src/executors/router-waf-rehearsal/router-waf-rehearsal.d.ts +27 -1
- package/src/executors/router-waf-rehearsal/router-waf-rehearsal.js +907 -22
- package/src/executors/router-waf-rehearsal/router-waf-rehearsal.js.map +1 -1
- package/src/executors/router-waf-rehearsal/schema.json +17 -2
- package/src/executors/secret-initialize/schema.json +42 -0
- package/src/executors/secret-initialize/secret-initialize.d.ts +32 -0
- package/src/executors/secret-initialize/secret-initialize.js +243 -0
- package/src/executors/secret-initialize/secret-initialize.js.map +1 -0
- package/src/executors/secret-metadata/secret-metadata.d.ts +4 -1
- package/src/executors/secret-metadata/secret-metadata.js +76 -29
- package/src/executors/secret-metadata/secret-metadata.js.map +1 -1
- package/src/executors/sst-lifecycle/generated-secret-retirement.d.ts +53 -0
- package/src/executors/sst-lifecycle/generated-secret-retirement.js +192 -0
- package/src/executors/sst-lifecycle/generated-secret-retirement.js.map +1 -0
- package/src/executors/sst-lifecycle/governed-native-operation.d.ts +46 -0
- package/src/executors/sst-lifecycle/governed-native-operation.js +153 -0
- package/src/executors/sst-lifecycle/governed-native-operation.js.map +1 -0
- package/src/executors/sst-lifecycle/run-sst-command.d.ts +27 -7
- package/src/executors/sst-lifecycle/run-sst-command.js +474 -89
- package/src/executors/sst-lifecycle/run-sst-command.js.map +1 -1
- package/src/executors/sst-lifecycle/schema.json +0 -5
- package/src/executors/sst-lifecycle/secret-preflight.d.ts +2 -0
- package/src/executors/sst-lifecycle/secret-preflight.js +13 -7
- package/src/executors/sst-lifecycle/secret-preflight.js.map +1 -1
- package/src/executors/unlock/unlock.js +2 -2
- package/src/executors/unlock/unlock.js.map +1 -1
- package/src/foundation/provision-logical-database.js +2 -0
- package/src/foundation/provision-logical-database.js.map +1 -1
- package/src/foundation/router-waf-rate-rehearsal.d.ts +97 -0
- package/src/foundation/router-waf-rate-rehearsal.js +210 -0
- package/src/foundation/router-waf-rate-rehearsal.js.map +1 -0
- package/src/foundation/router-waf.d.ts +59 -9
- package/src/foundation/router-waf.js +427 -32
- package/src/foundation/router-waf.js.map +1 -1
- package/src/foundation/stages.d.ts +1 -0
- package/src/foundation/stages.js +11 -0
- package/src/foundation/stages.js.map +1 -1
- package/src/generators/formatting.d.ts +8 -0
- package/src/generators/formatting.js +118 -0
- package/src/generators/formatting.js.map +1 -0
- package/src/generators/function/function.js +37 -17
- package/src/generators/function/function.js.map +1 -1
- package/src/generators/post-generation-install.js +2 -2
- package/src/generators/post-generation-install.js.map +1 -1
- package/src/generators/preset/generator.js +28 -8
- package/src/generators/preset/generator.js.map +1 -1
- package/src/generators/preset/schema.d.ts +3 -0
- package/src/generators/preset/schema.json +5 -5
- package/src/generators/preset/workspace-files-developer-agent.js +15 -7
- package/src/generators/preset/workspace-files-developer-agent.js.map +1 -1
- package/src/generators/preset/workspace-files-ecr-inspector.d.ts +18 -0
- package/src/generators/preset/workspace-files-ecr-inspector.js +298 -0
- package/src/generators/preset/workspace-files-ecr-inspector.js.map +1 -0
- package/src/generators/preset/workspace-files-performance-cost.d.ts +2 -2
- package/src/generators/preset/workspace-files-performance-cost.js +8 -8
- package/src/generators/preset/workspace-files-performance-cost.js.map +1 -1
- package/src/generators/preset/workspace-files-performance-load.d.ts +1 -1
- package/src/generators/preset/workspace-files-performance-load.js +29 -24
- package/src/generators/preset/workspace-files-performance-load.js.map +1 -1
- package/src/generators/preset/workspace-files-stage-authority.d.ts +6 -0
- package/src/generators/preset/workspace-files-stage-authority.js +479 -0
- package/src/generators/preset/workspace-files-stage-authority.js.map +1 -0
- package/src/generators/preset/workspace-files-thin-deploy.d.ts +40 -0
- package/src/generators/preset/workspace-files-thin-deploy.js +1500 -0
- package/src/generators/preset/workspace-files-thin-deploy.js.map +1 -0
- package/src/generators/preset/workspace-files-thin-docs.d.ts +5 -0
- package/src/generators/preset/workspace-files-thin-docs.js +240 -0
- package/src/generators/preset/workspace-files-thin-docs.js.map +1 -0
- package/src/generators/preset/workspace-files-thin-release.d.ts +14 -0
- package/src/generators/preset/workspace-files-thin-release.js +26 -0
- package/src/generators/preset/workspace-files-thin-release.js.map +1 -0
- package/src/generators/preset/workspace-files.d.ts +2 -1
- package/src/generators/preset/workspace-files.js +448 -680
- package/src/generators/preset/workspace-files.js.map +1 -1
- package/src/generators/repository-policy/repository-policy.js +149 -19
- package/src/generators/repository-policy/repository-policy.js.map +1 -1
- package/src/generators/repository-policy/schema.d.ts +2 -0
- package/src/generators/repository-policy/schema.json +11 -1
- package/src/generators/repository-policy/tree-policy.d.ts +3 -0
- package/src/generators/repository-policy/tree-policy.js +25 -0
- package/src/generators/repository-policy/tree-policy.js.map +1 -0
- package/src/generators/slice/built-in-plan-api-files.js +1 -0
- package/src/generators/slice/built-in-plan-api-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-async-work-files.js +41 -0
- package/src/generators/slice/built-in-plan-async-work-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-authorization-infrastructure-files.js +6 -0
- package/src/generators/slice/built-in-plan-authorization-infrastructure-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-data-export-infrastructure-files.js +5 -31
- package/src/generators/slice/built-in-plan-data-export-infrastructure-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-data-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-data-files.js +89 -30
- package/src/generators/slice/built-in-plan-data-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.js +19 -0
- package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-data-retention-launcher-files.js +21 -3
- package/src/generators/slice/built-in-plan-data-retention-launcher-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.js +20 -1
- package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-foundation-files.js +3 -5
- package/src/generators/slice/built-in-plan-foundation-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-frontend-files.js +5 -1
- package/src/generators/slice/built-in-plan-frontend-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-infrastructure-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-infrastructure-files.js +199 -188
- package/src/generators/slice/built-in-plan-infrastructure-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-metadata-files.js +13 -0
- package/src/generators/slice/built-in-plan-metadata-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-native-runtime-authority-files.d.ts +2 -0
- package/src/generators/slice/built-in-plan-native-runtime-authority-files.js +307 -0
- package/src/generators/slice/built-in-plan-native-runtime-authority-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-operations-files.js +65 -51
- package/src/generators/slice/built-in-plan-operations-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-performance-files.js +97 -19
- package/src/generators/slice/built-in-plan-performance-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-project-files.js +9 -68
- package/src/generators/slice/built-in-plan-project-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-secret-runtime-files.d.ts +1 -1
- package/src/generators/slice/built-in-plan-secret-runtime-files.js +87 -76
- package/src/generators/slice/built-in-plan-secret-runtime-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-testing-files.js +94 -47
- package/src/generators/slice/built-in-plan-testing-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-thin-release-files.d.ts +11 -0
- package/src/generators/slice/built-in-plan-thin-release-files.js +129 -0
- package/src/generators/slice/built-in-plan-thin-release-files.js.map +1 -0
- package/src/generators/slice/built-in-plan-verification-files.js +6 -2
- package/src/generators/slice/built-in-plan-verification-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-web-files.js +4 -2
- package/src/generators/slice/built-in-plan-web-files.js.map +1 -1
- package/src/generators/slice/built-in-plan-workload-role-files.js +26 -4
- package/src/generators/slice/built-in-plan-workload-role-files.js.map +1 -1
- package/src/generators/slice/built-in-plan.d.ts +1 -0
- package/src/generators/slice/built-in-plan.js +28 -11
- package/src/generators/slice/built-in-plan.js.map +1 -1
- package/src/generators/slice/slice.js +30 -32
- package/src/generators/slice/slice.js.map +1 -1
- package/src/generators/upgrade/upgrade.d.ts +1 -1
- package/src/generators/upgrade/upgrade.js +200 -48
- package/src/generators/upgrade/upgrade.js.map +1 -1
- package/src/generators/workload/performance-registration.d.ts +1 -0
- package/src/generators/workload/performance-registration.js +9 -11
- package/src/generators/workload/performance-registration.js.map +1 -1
- package/src/generators/workload/service-performance-files.d.ts +1 -0
- package/src/generators/workload/service-performance-files.js +27 -7
- package/src/generators/workload/service-performance-files.js.map +1 -1
- package/src/generators/workload/workload.d.ts +1 -1
- package/src/generators/workload/workload.js +55 -28
- package/src/generators/workload/workload.js.map +1 -1
- package/src/git-policy/github-bootstrap.d.ts +28 -7
- package/src/git-policy/github-bootstrap.js +205 -163
- package/src/git-policy/github-bootstrap.js.map +1 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/index.js.map +1 -1
- package/src/local-dev/private-state.d.ts +3 -0
- package/src/local-dev/private-state.js +17 -5
- package/src/local-dev/private-state.js.map +1 -1
- package/src/local-dev/tls.js +5 -1
- package/src/local-dev/tls.js.map +1 -1
- package/src/performance/cost-collection.d.ts +1 -1
- package/src/performance/cost-collection.js +4 -2
- package/src/performance/cost-collection.js.map +1 -1
- package/src/performance/cost-controls.d.ts +3 -1
- package/src/performance/cost-controls.js +9 -4
- package/src/performance/cost-controls.js.map +1 -1
- package/src/performance/evidence.d.ts +1 -1
- package/src/performance/evidence.js +5 -3
- package/src/performance/evidence.js.map +1 -1
- package/src/performance/load-safety.js +5 -3
- package/src/performance/load-safety.js.map +1 -1
- package/src/performance/model.d.ts +2 -2
- package/src/performance/model.js +4 -3
- package/src/performance/model.js.map +1 -1
- package/src/release/index.d.ts +0 -2
- package/src/release/index.js +0 -2
- package/src/release/index.js.map +1 -1
- package/src/release/source-authority.d.ts +4 -5
- package/src/release/source-authority.js +13 -123
- package/src/release/source-authority.js.map +1 -1
- package/src/repository-policy/aurora-preflight.d.ts +1 -1
- package/src/repository-policy/aurora-preflight.js +4 -1
- package/src/repository-policy/aurora-preflight.js.map +1 -1
- package/src/repository-policy/policy.d.ts +21 -2
- package/src/repository-policy/policy.js +290 -25
- package/src/repository-policy/policy.js.map +1 -1
- package/src/schemas/performance-policy-v1.json +3 -1
- package/src/schemas/repository-policy-v1.json +46 -2
- package/src/secrets/adapters.d.ts +7 -2
- package/src/secrets/adapters.js +34 -3
- package/src/secrets/adapters.js.map +1 -1
- package/src/secrets/aws-control-plane.d.ts +10 -1
- package/src/secrets/aws-control-plane.js +67 -0
- package/src/secrets/aws-control-plane.js.map +1 -1
- package/src/secrets/generated-aws-control-plane.d.ts +23 -0
- package/src/secrets/generated-aws-control-plane.js +259 -0
- package/src/secrets/generated-aws-control-plane.js.map +1 -0
- package/src/secrets/metadata.js +38 -10
- package/src/secrets/metadata.js.map +1 -1
- package/src/secrets/model.d.ts +8 -1
- package/src/secrets/model.js +24 -3
- package/src/secrets/model.js.map +1 -1
- package/src/secrets/operator.d.ts +89 -3
- package/src/secrets/operator.js +422 -9
- package/src/secrets/operator.js.map +1 -1
- package/src/secrets/registry.d.ts +2 -1
- package/src/secrets/registry.js +18 -1
- package/src/secrets/registry.js.map +1 -1
- package/src/secrets/workload-access.js +10 -2
- package/src/secrets/workload-access.js.map +1 -1
- package/src/supply-chain/action-pins.js +61 -7
- package/src/supply-chain/action-pins.js.map +1 -1
- package/src/supply-chain/build-output-bounds.d.ts +2 -0
- package/src/supply-chain/build-output-bounds.js +12 -0
- package/src/supply-chain/build-output-bounds.js.map +1 -0
- package/src/supply-chain/build-output.js +2 -4
- package/src/supply-chain/build-output.js.map +1 -1
- package/src/supply-chain/ecr-scanning.d.ts +5 -3
- package/src/supply-chain/ecr-scanning.js +11 -7
- package/src/supply-chain/ecr-scanning.js.map +1 -1
- package/src/supply-chain/ecs-deployed-image.d.ts +5 -3
- package/src/supply-chain/ecs-deployed-image.js +6 -4
- package/src/supply-chain/ecs-deployed-image.js.map +1 -1
- package/src/supply-chain/generated-container-release-command.js +849 -44
- package/src/supply-chain/generated-container-release-command.js.map +1 -1
- package/src/supply-chain/generated-ecr-collector-command.d.ts +0 -1
- package/src/supply-chain/generated-ecr-collector-command.js +188 -91
- package/src/supply-chain/generated-ecr-collector-command.js.map +1 -1
- package/src/supply-chain/generated-files.js +4 -3
- package/src/supply-chain/generated-files.js.map +1 -1
- package/src/supply-chain/index.d.ts +1 -1
- package/src/supply-chain/index.js +2 -1
- package/src/supply-chain/index.js.map +1 -1
- package/src/workload-roles/index.d.ts +10 -17
- package/src/workload-roles/index.js +5 -18
- package/src/workload-roles/index.js.map +1 -1
- package/src/workspace-deployment/identity.d.ts +3 -0
- package/src/workspace-deployment/identity.js +22 -0
- package/src/workspace-deployment/identity.js.map +1 -0
- package/src/workspace-deployment/index.d.ts +3 -0
- package/src/workspace-deployment/index.js +7 -0
- package/src/workspace-deployment/index.js.map +1 -0
- package/src/workspace-deployment/migration-evidence.d.ts +29 -0
- package/src/workspace-deployment/migration-evidence.js +83 -0
- package/src/workspace-deployment/migration-evidence.js.map +1 -0
- package/src/workspace-deployment/migration.d.ts +27 -0
- package/src/workspace-deployment/migration.js +109 -0
- package/src/workspace-deployment/migration.js.map +1 -0
- package/src/workspace-deployment/ownership.d.ts +81 -0
- package/src/workspace-deployment/ownership.js +381 -0
- package/src/workspace-deployment/ownership.js.map +1 -0
|
@@ -55,7 +55,7 @@ export interface UpgradeReport {
|
|
|
55
55
|
}
|
|
56
56
|
export interface SeededReconciliationWork {
|
|
57
57
|
adopterContentSha256: string;
|
|
58
|
-
category: 'async-adapter' | 'async-settings' | 'configuration-contract' | 'configuration-values' | 'feature-controls' | 'frontend-contract' | 'frontend-security' | 'performance-aggregate-provider' | 'performance-policy' | 'reliability-operations' | 'reliability-slo' | 'release-controls';
|
|
58
|
+
category: 'async-adapter' | 'async-settings' | 'configuration-contract' | 'configuration-values' | 'feature-controls' | 'frontend-contract' | 'frontend-security' | 'performance-aggregate-provider' | 'performance-policy' | 'reliability-operations' | 'reliability-slo' | 'release-controls' | 'secret-contract';
|
|
59
59
|
currentFrameworkSha256: string | null;
|
|
60
60
|
implications: string[];
|
|
61
61
|
markerReference: 'PLAN:5.6/seeded-upgrade-reconciliation';
|
|
@@ -13,7 +13,6 @@ const node_crypto_1 = require("node:crypto");
|
|
|
13
13
|
const node_fs_1 = require("node:fs");
|
|
14
14
|
const node_path_1 = require("node:path");
|
|
15
15
|
const node_util_1 = require("node:util");
|
|
16
|
-
const prettier_1 = require("prettier");
|
|
17
16
|
const yaml_1 = require("yaml");
|
|
18
17
|
const index_js_1 = require("../../blueprints/index.js");
|
|
19
18
|
const index_js_2 = require("../../api-contract/index.js");
|
|
@@ -26,12 +25,23 @@ const tool_versions_js_1 = require("../preset/tool-versions.js");
|
|
|
26
25
|
const workspace_files_js_1 = require("../preset/workspace-files.js");
|
|
27
26
|
const built_in_plan_js_1 = require("../slice/built-in-plan.js");
|
|
28
27
|
const workload_js_1 = require("../workload/workload.js");
|
|
28
|
+
const formatting_js_1 = require("../formatting.js");
|
|
29
29
|
const git_inspection_js_1 = require("../../developer-agent/git-inspection.js");
|
|
30
30
|
const context_js_1 = require("../../developer-agent/context.js");
|
|
31
31
|
const model_js_1 = require("../../developer-agent/model.js");
|
|
32
32
|
const preview_source_js_1 = require("../../developer-agent/preview-source.js");
|
|
33
33
|
const preview_changes_js_1 = require("../../developer-agent/preview-changes.js");
|
|
34
34
|
const validation_js_1 = require("../../developer-agent/validation.js");
|
|
35
|
+
const tree_policy_js_1 = require("../repository-policy/tree-policy.js");
|
|
36
|
+
function readRepositoryDeploymentRenderingOptions(tree) {
|
|
37
|
+
const policy = (0, tree_policy_js_1.readRepositoryOperatingPolicyFromTree)(tree);
|
|
38
|
+
return {
|
|
39
|
+
deploymentAccounts: policy.deploymentAccounts,
|
|
40
|
+
deploymentProfile: policy.deploymentProfile,
|
|
41
|
+
deploymentRegion: policy.deploymentRegion,
|
|
42
|
+
workspaceDeploymentId: policy.workspaceDeploymentId,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
35
45
|
function requireTargetCompositionFeatures(files, ownership) {
|
|
36
46
|
if (ownership.compositions.length === 0)
|
|
37
47
|
return;
|
|
@@ -355,9 +365,29 @@ const SEEDED_RECONCILIATION = {
|
|
|
355
365
|
'journey-authority',
|
|
356
366
|
],
|
|
357
367
|
},
|
|
368
|
+
'secrets/declarations.ts': {
|
|
369
|
+
category: 'secret-contract',
|
|
370
|
+
implications: [
|
|
371
|
+
'generation-authority',
|
|
372
|
+
'secret-value-ownership',
|
|
373
|
+
'stage-requirements',
|
|
374
|
+
],
|
|
375
|
+
},
|
|
376
|
+
'secrets/metadata.json': {
|
|
377
|
+
category: 'secret-contract',
|
|
378
|
+
implications: ['logical-identity', 'management-class', 'registry-schema'],
|
|
379
|
+
},
|
|
380
|
+
'secrets/workload-access.json': {
|
|
381
|
+
category: 'secret-contract',
|
|
382
|
+
implications: [
|
|
383
|
+
'logical-identity',
|
|
384
|
+
'runtime-secret-linkage',
|
|
385
|
+
'workload-iam',
|
|
386
|
+
],
|
|
387
|
+
},
|
|
358
388
|
};
|
|
359
389
|
const SEEDED_RECONCILIATION_MARKER_REFERENCE = 'PLAN:5.6/seeded-upgrade-reconciliation';
|
|
360
|
-
const SEEDED_RECONCILIATION_MARKER = '// EBK-TODO(PLAN:5.6/seeded-upgrade-reconciliation): Review retained seeded async, configuration, feature, frontend, performance, reliability, and
|
|
390
|
+
const SEEDED_RECONCILIATION_MARKER = '// EBK-TODO(PLAN:5.6/seeded-upgrade-reconciliation): Review retained seeded async, configuration, feature, frontend, performance, reliability, release, and secret decisions against this framework upgrade before protected promotion.';
|
|
361
391
|
const SEEDED_RECONCILIATION_MARKER_ANCHOR = 'async/recovery-adapters.ts';
|
|
362
392
|
const DEVELOPER_AGENT_AGENTS_HEADING = '## Developer-Agent workflow';
|
|
363
393
|
function developerAgentAgentsAppendix(renderedAgents) {
|
|
@@ -431,8 +461,8 @@ const COMPOSITION_REGIONS = [
|
|
|
431
461
|
'workload-registrations',
|
|
432
462
|
'function-registrations',
|
|
433
463
|
'composition-outputs',
|
|
434
|
-
'
|
|
435
|
-
'
|
|
464
|
+
'native-runtime-extensions',
|
|
465
|
+
'native-runtime-intent-contributions',
|
|
436
466
|
];
|
|
437
467
|
function preserveCompositionRegions(current, target) {
|
|
438
468
|
let merged = target;
|
|
@@ -457,29 +487,117 @@ function preserveCompositionRegions(current, target) {
|
|
|
457
487
|
}
|
|
458
488
|
return merged;
|
|
459
489
|
}
|
|
460
|
-
function
|
|
490
|
+
function countExact(source, value) {
|
|
491
|
+
return source.split(value).length - 1;
|
|
492
|
+
}
|
|
493
|
+
function escapeRegularExpression(value) {
|
|
494
|
+
return value.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&');
|
|
495
|
+
}
|
|
496
|
+
function exactIndentedStringCallMatches(source, callee, argument) {
|
|
497
|
+
const pattern = new RegExp(`^ ${escapeRegularExpression(callee)}\\(\\s*(['"])${escapeRegularExpression(argument)}\\1\\s*,?\\s*\\),[ \\t]*$`, 'gmu');
|
|
498
|
+
return [...source.matchAll(pattern)];
|
|
499
|
+
}
|
|
500
|
+
function reconcileFunctionRegistrationArguments(source, ownership) {
|
|
461
501
|
let reconciled = source;
|
|
462
502
|
for (const composition of ownership.compositions) {
|
|
463
503
|
if (composition.kind !== 'function')
|
|
464
504
|
continue;
|
|
465
505
|
const { register } = (0, function_js_1.createFunctionFilePlan)('unused-workspace', ownership.slice, composition.name, composition.feature);
|
|
466
|
-
const
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
const currentCount = reconciled.split(current).length - 1;
|
|
470
|
-
if (previousCount === 1 && currentCount === 0) {
|
|
471
|
-
reconciled = reconciled.replace(previous, current);
|
|
472
|
-
continue;
|
|
506
|
+
const registrationStart = ` ${register}(\n`;
|
|
507
|
+
if (countExact(reconciled, registrationStart) !== 1) {
|
|
508
|
+
throw new Error(`Retained Function ${composition.name} registration does not expose one exact Router argument shape.`);
|
|
473
509
|
}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
510
|
+
const start = reconciled.indexOf(registrationStart);
|
|
511
|
+
const registrationEnd = '\n );';
|
|
512
|
+
const end = reconciled.indexOf(registrationEnd, start);
|
|
513
|
+
if (end < 0) {
|
|
514
|
+
throw new Error(`Retained Function ${composition.name} registration does not expose one exact Router argument shape.`);
|
|
515
|
+
}
|
|
516
|
+
let registration = reconciled.slice(start, end + registrationEnd.length);
|
|
517
|
+
if (registration.length > 64 * 1024) {
|
|
518
|
+
throw new Error(`Retained Function ${composition.name} registration exceeds its bounded managed shape.`);
|
|
519
|
+
}
|
|
520
|
+
const previousRouter = `\n api,\n foundation.discovery.alertTopicArn,`;
|
|
521
|
+
const currentRouter = `\n api,\n foundation.router,\n foundation.discovery.alertTopicArn,`;
|
|
522
|
+
const previousRouterCount = countExact(registration, previousRouter);
|
|
523
|
+
const currentRouterCount = countExact(registration, currentRouter);
|
|
524
|
+
if (previousRouterCount === 1 && currentRouterCount === 0) {
|
|
525
|
+
registration = registration.replace(previousRouter, currentRouter);
|
|
526
|
+
}
|
|
527
|
+
else if (!(previousRouterCount === 0 && currentRouterCount === 1)) {
|
|
528
|
+
throw new Error(`Retained Function ${composition.name} registration does not expose one exact Router argument shape.`);
|
|
529
|
+
}
|
|
530
|
+
const previousAuthorityMatches = exactIndentedStringCallMatches(registration, 'workloadRoleBindings?.extension.function', composition.name);
|
|
531
|
+
const currentAuthorityMatches = exactIndentedStringCallMatches(registration, 'nativeAuthority.permissions', `${composition.name}-function`);
|
|
532
|
+
if (previousAuthorityMatches.length === 1 &&
|
|
533
|
+
currentAuthorityMatches.length === 0) {
|
|
534
|
+
const [previousAuthority] = previousAuthorityMatches;
|
|
535
|
+
const authorityIndex = previousAuthority.index;
|
|
536
|
+
if (authorityIndex === undefined) {
|
|
537
|
+
throw new Error(`Retained Function ${composition.name} registration authority is not position-bound.`);
|
|
538
|
+
}
|
|
539
|
+
const currentAuthority = ` nativeAuthority.permissions('${composition.name}-function'),`;
|
|
540
|
+
registration =
|
|
541
|
+
registration.slice(0, authorityIndex) +
|
|
542
|
+
currentAuthority +
|
|
543
|
+
registration.slice(authorityIndex + previousAuthority[0].length);
|
|
544
|
+
}
|
|
545
|
+
else if (!(previousAuthorityMatches.length === 0 &&
|
|
546
|
+
currentAuthorityMatches.length === 1)) {
|
|
547
|
+
throw new Error(`Retained Function ${composition.name} registration does not expose one exact native-authority argument shape.`);
|
|
548
|
+
}
|
|
549
|
+
reconciled =
|
|
550
|
+
reconciled.slice(0, start) +
|
|
551
|
+
registration +
|
|
552
|
+
reconciled.slice(end + registrationEnd.length);
|
|
477
553
|
}
|
|
478
554
|
return reconciled;
|
|
479
555
|
}
|
|
480
556
|
function json(value) {
|
|
481
557
|
return `${JSON.stringify(value, null, 2)}\n`;
|
|
482
558
|
}
|
|
559
|
+
const DERIVED_API_ARTIFACT_PATHS = [
|
|
560
|
+
'api/generated/contract.json',
|
|
561
|
+
'api/generated/openapi.json',
|
|
562
|
+
];
|
|
563
|
+
function preserveBuiltInDerivedApiArtifacts(tree, root, currentOwnership, targetFiles) {
|
|
564
|
+
const sourceEntry = currentOwnership.paths.find(({ path }) => path === 'api/contracts/protected.ts');
|
|
565
|
+
const source = tree.read(node_path_1.posix.join(root, 'api/contracts/protected.ts'), 'utf8');
|
|
566
|
+
if (sourceEntry?.mode !== 'seeded' || source === null)
|
|
567
|
+
return targetFiles;
|
|
568
|
+
const currentEntries = new Map(currentOwnership.paths.map((entry) => [entry.path, entry]));
|
|
569
|
+
const artifacts = DERIVED_API_ARTIFACT_PATHS.map((path) => ({
|
|
570
|
+
current: tree.read(node_path_1.posix.join(root, path), 'utf8'),
|
|
571
|
+
entry: currentEntries.get(path),
|
|
572
|
+
path,
|
|
573
|
+
}));
|
|
574
|
+
const missing = artifacts
|
|
575
|
+
.filter(({ current }) => current === null)
|
|
576
|
+
.map(({ path }) => path);
|
|
577
|
+
if (missing.length > 0) {
|
|
578
|
+
throw new Error(`Built-in Product Slice ${currentOwnership.slice} is missing derived managed API artifacts:\n${missing.map((path) => `- ${path}`).join('\n')}\nRun pnpm nx run ${currentOwnership.slice}:api-contract-generate before upgrading.`);
|
|
579
|
+
}
|
|
580
|
+
const completeCleanPair = artifacts.every(({ current, entry }) => current !== null &&
|
|
581
|
+
entry?.mode === 'managed' &&
|
|
582
|
+
entry.origin === 'blueprint' &&
|
|
583
|
+
entry.managedJsonPointers === undefined &&
|
|
584
|
+
(0, index_js_4.hashOwnedContent)(current, entry) === entry.sha256);
|
|
585
|
+
if (!completeCleanPair)
|
|
586
|
+
return targetFiles;
|
|
587
|
+
const retained = { ...targetFiles };
|
|
588
|
+
for (const { current, path } of artifacts) {
|
|
589
|
+
if (current === null) {
|
|
590
|
+
throw new Error(`Derived managed API artifact disappeared: ${path}.`);
|
|
591
|
+
}
|
|
592
|
+
// The built-in API artifacts are derived from the seeded TypeScript
|
|
593
|
+
// contract. An upgrade preserves that adopter-owned source, so rendering
|
|
594
|
+
// fresh artifacts from the uncustomized Blueprint would make the managed
|
|
595
|
+
// output disagree with its authority. The explicit api-contract-generate
|
|
596
|
+
// target remains the only operation that recompiles and restamps them.
|
|
597
|
+
retained[path] = current;
|
|
598
|
+
}
|
|
599
|
+
return retained;
|
|
600
|
+
}
|
|
483
601
|
function upgradeConflictMessage(label, report) {
|
|
484
602
|
const ownershipDetails = [
|
|
485
603
|
...report.conflictingJsonMembers.map((member) => `- conflicting JSON ownership claim: ${member}`),
|
|
@@ -490,26 +608,19 @@ function upgradeConflictMessage(label, report) {
|
|
|
490
608
|
function seededMigrationUpgradeMessage(label, report) {
|
|
491
609
|
return `${label} upgrade cannot rewrite an existing seeded database migration:\n${report.incompatibleSeededMigrations.map((path) => `- ${path}`).join('\n')}\nRegenerate this prerelease workspace instead. Stable-v1 upgrades must add a new migration rather than rewrite migration history.`;
|
|
492
610
|
}
|
|
493
|
-
async function formatRenderedFiles(files, prefix = '') {
|
|
494
|
-
const
|
|
495
|
-
'api/generated/baseline.json',
|
|
496
|
-
'api/generated/contract.json',
|
|
497
|
-
'api/generated/openapi.json',
|
|
498
|
-
]);
|
|
611
|
+
async function formatRenderedFiles(tree, files, prefix = '') {
|
|
612
|
+
const changedOptions = (0, formatting_js_1.changedTreePrettierOptions)(tree);
|
|
499
613
|
return Object.fromEntries(await Promise.all(Object.entries(files).map(async ([path, contents]) => {
|
|
500
614
|
const workspacePath = node_path_1.posix.join(prefix, path);
|
|
501
|
-
if (
|
|
502
|
-
(0, workspace_files_js_1.isRawWorkspaceAuthorityPath)(workspacePath)
|
|
503
|
-
path.startsWith('database/migrations/')) {
|
|
615
|
+
if ((0, built_in_plan_js_1.isBuiltInSliceFormatSensitivePath)(path) ||
|
|
616
|
+
(0, workspace_files_js_1.isRawWorkspaceAuthorityPath)(workspacePath)) {
|
|
504
617
|
return [path, contents];
|
|
505
618
|
}
|
|
506
619
|
try {
|
|
620
|
+
const options = await (0, formatting_js_1.effectiveTreePrettierOptions)(tree, workspacePath, changedOptions);
|
|
507
621
|
return [
|
|
508
622
|
path,
|
|
509
|
-
await (0,
|
|
510
|
-
filepath: workspacePath,
|
|
511
|
-
singleQuote: true,
|
|
512
|
-
}),
|
|
623
|
+
await (0, formatting_js_1.formatTreeContentsToFixedPoint)(contents, options, workspacePath),
|
|
513
624
|
];
|
|
514
625
|
}
|
|
515
626
|
catch {
|
|
@@ -517,6 +628,12 @@ async function formatRenderedFiles(files, prefix = '') {
|
|
|
517
628
|
}
|
|
518
629
|
})));
|
|
519
630
|
}
|
|
631
|
+
async function formatOwnershipRecord(tree, path, label) {
|
|
632
|
+
if (!tree.exists(path)) {
|
|
633
|
+
throw new Error(`${label} ownership metadata is missing at ${path}.`);
|
|
634
|
+
}
|
|
635
|
+
await (0, formatting_js_1.formatTreeFileToFixedPoint)(tree, path);
|
|
636
|
+
}
|
|
520
637
|
function readJson(tree, path, label) {
|
|
521
638
|
const contents = tree.read(path, 'utf8');
|
|
522
639
|
if (contents === null)
|
|
@@ -870,6 +987,22 @@ function mergeStructuredTargetFiles(currentFiles, currentOwnership, targetFiles,
|
|
|
870
987
|
}
|
|
871
988
|
return { files, ...changes };
|
|
872
989
|
}
|
|
990
|
+
async function formatMergedManagedJsonFiles(tree, root, merge, ownership) {
|
|
991
|
+
const files = new Map(merge.files);
|
|
992
|
+
const changedOptions = (0, formatting_js_1.changedTreePrettierOptions)(tree);
|
|
993
|
+
await Promise.all(ownership.paths.map(async (entry) => {
|
|
994
|
+
if (entry.mode !== 'managed' || !entry.managedJsonPointers)
|
|
995
|
+
return;
|
|
996
|
+
const contents = files.get(entry.path);
|
|
997
|
+
if (contents === undefined) {
|
|
998
|
+
throw new Error(`Target did not render managed JSON ${entry.path}.`);
|
|
999
|
+
}
|
|
1000
|
+
const workspacePath = node_path_1.posix.join(root, entry.path);
|
|
1001
|
+
const options = await (0, formatting_js_1.effectiveTreePrettierOptions)(tree, workspacePath, changedOptions);
|
|
1002
|
+
files.set(entry.path, await (0, formatting_js_1.formatTreeContentsToFixedPoint)(contents, options, workspacePath));
|
|
1003
|
+
}));
|
|
1004
|
+
return { ...merge, files };
|
|
1005
|
+
}
|
|
873
1006
|
function renderCompositionUpgradePlan(ownership, workspace, runtimeVersion, serviceAdapterOwner) {
|
|
874
1007
|
const compositionPaths = ownership.paths.filter(({ origin }) => origin === 'composition');
|
|
875
1008
|
const files = {};
|
|
@@ -950,10 +1083,15 @@ function retainedServiceAdapterOwner(tree, root, ownership) {
|
|
|
950
1083
|
const serviceScenario = serviceScenarios[0];
|
|
951
1084
|
const secretAccess = readJson(tree, node_path_1.posix.join(root, 'secrets/workload-access.json'), 'Product Slice secret workload access registry');
|
|
952
1085
|
const bindings = record(secretAccess) ? secretAccess['bindings'] : undefined;
|
|
953
|
-
const logicalName =
|
|
1086
|
+
const logicalName = 'GeneratedPerformanceLoadHmacKeys';
|
|
1087
|
+
const prereleaseLogicalName = `${ownership.slice
|
|
954
1088
|
.split('-')
|
|
955
1089
|
.map((part) => `${part.charAt(0).toUpperCase()}${part.slice(1)}`)
|
|
956
1090
|
.join('')}PerformanceLoadHmacKeys`;
|
|
1091
|
+
if (Array.isArray(bindings) &&
|
|
1092
|
+
bindings.some((binding) => record(binding) && binding['logicalName'] === prereleaseLogicalName)) {
|
|
1093
|
+
throw new Error(`Product Slice ${ownership.slice} still uses the prerelease operator HMAC declaration ${prereleaseLogicalName}. Regenerate the prerelease Slice or reconcile secrets/declarations.ts, secrets/metadata.json, and secrets/workload-access.json to GeneratedPerformanceLoadHmacKeys under a reviewed adoption ledger entry before rerunning the upgrade; no automatic prerelease migration is provided.`);
|
|
1094
|
+
}
|
|
957
1095
|
const protectedLoadBindings = Array.isArray(bindings)
|
|
958
1096
|
? bindings.filter((binding) => record(binding) &&
|
|
959
1097
|
binding['logicalName'] === logicalName &&
|
|
@@ -1035,13 +1173,15 @@ async function upgradeFoundation(tree, options, packageJson, output) {
|
|
|
1035
1173
|
throw new Error('Workspace package.json must declare a name.');
|
|
1036
1174
|
}
|
|
1037
1175
|
const currentOwnership = ownershipResult.value;
|
|
1176
|
+
const deployment = readRepositoryDeploymentRenderingOptions(tree);
|
|
1038
1177
|
const renderedTarget = (0, workspace_files_js_1.renderFoundationFilePlan)({
|
|
1178
|
+
...deployment,
|
|
1039
1179
|
frameworkVersion: (0, generator_js_1.frameworkPackageVersion)(),
|
|
1040
1180
|
name: packageJson.name,
|
|
1041
1181
|
});
|
|
1042
1182
|
const target = {
|
|
1043
1183
|
...renderedTarget,
|
|
1044
|
-
files: await formatRenderedFiles(renderedTarget.files, root),
|
|
1184
|
+
files: await formatRenderedFiles(tree, renderedTarget.files, root),
|
|
1045
1185
|
};
|
|
1046
1186
|
const targetValidation = (0, index_js_4.validateFoundationOwnershipRecord)(target.ownership);
|
|
1047
1187
|
if (!targetValidation.valid) {
|
|
@@ -1057,7 +1197,8 @@ async function upgradeFoundation(tree, options, packageJson, output) {
|
|
|
1057
1197
|
path,
|
|
1058
1198
|
tree.read(node_path_1.posix.join(root, path), 'utf8'),
|
|
1059
1199
|
]));
|
|
1060
|
-
|
|
1200
|
+
let mergedTarget = mergeStructuredTargetFiles(currentFiles, currentOwnership, new Map(Object.entries(target.files)), target.ownership);
|
|
1201
|
+
mergedTarget = await formatMergedManagedJsonFiles(tree, root, mergedTarget, target.ownership);
|
|
1061
1202
|
const report = createUpgradeReport(currentFiles, currentOwnership, mergedTarget.files, target.ownership, mergedTarget);
|
|
1062
1203
|
output.info(`[ebk-upgrade] foundation ${currentOwnership.frameworkVersion} -> ${target.ownership.frameworkVersion}\n${JSON.stringify(report, null, 2)}`);
|
|
1063
1204
|
if (!options.apply)
|
|
@@ -1083,9 +1224,10 @@ async function upgradeFoundation(tree, options, packageJson, output) {
|
|
|
1083
1224
|
}
|
|
1084
1225
|
tree.write(node_path_1.posix.join(root, path), contents);
|
|
1085
1226
|
}
|
|
1086
|
-
if (!options.skipFormat)
|
|
1087
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
1088
1227
|
(0, index_js_4.restampFoundationOwnership)(tree);
|
|
1228
|
+
if (!options.skipFormat) {
|
|
1229
|
+
await formatOwnershipRecord(tree, node_path_1.posix.join(root, '.ebk/ownership.json'), 'Standard Foundation');
|
|
1230
|
+
}
|
|
1089
1231
|
}
|
|
1090
1232
|
async function upgradeWorkspace(tree, options, packageJson, output) {
|
|
1091
1233
|
if (options.blueprint !== undefined || options.inputs !== undefined) {
|
|
@@ -1100,13 +1242,15 @@ async function upgradeWorkspace(tree, options, packageJson, output) {
|
|
|
1100
1242
|
}
|
|
1101
1243
|
const sstVersionState = inspectWorkspaceSstVersion(tree, packageJson);
|
|
1102
1244
|
const currentOwnership = ownershipResult.value;
|
|
1245
|
+
const deployment = readRepositoryDeploymentRenderingOptions(tree);
|
|
1103
1246
|
const renderedTarget = (0, workspace_files_js_1.renderWorkspaceRootFilePlan)({
|
|
1247
|
+
...deployment,
|
|
1104
1248
|
frameworkVersion: (0, generator_js_1.frameworkPackageVersion)(),
|
|
1105
1249
|
name: packageJson.name,
|
|
1106
1250
|
});
|
|
1107
1251
|
const target = {
|
|
1108
1252
|
...renderedTarget,
|
|
1109
|
-
files: await formatRenderedFiles(renderedTarget.files),
|
|
1253
|
+
files: await formatRenderedFiles(tree, renderedTarget.files),
|
|
1110
1254
|
};
|
|
1111
1255
|
const targetValidation = (0, index_js_4.validateWorkspaceOwnershipRecord)(target.ownership);
|
|
1112
1256
|
if (!targetValidation.valid) {
|
|
@@ -1117,7 +1261,8 @@ async function upgradeWorkspace(tree, options, packageJson, output) {
|
|
|
1117
1261
|
...target.ownership.paths.map(({ path }) => path),
|
|
1118
1262
|
]);
|
|
1119
1263
|
const currentFiles = new Map([...allPaths].map((path) => [path, tree.read(path, 'utf8')]));
|
|
1120
|
-
|
|
1264
|
+
let mergedTarget = mergeStructuredTargetFiles(currentFiles, currentOwnership, new Map(Object.entries(target.files)), target.ownership);
|
|
1265
|
+
mergedTarget = await formatMergedManagedJsonFiles(tree, '', mergedTarget, target.ownership);
|
|
1121
1266
|
const developerAgentInstructionAppend = planDeveloperAgentInstructionAppend(currentFiles.get('AGENTS.md') ?? null, target.files['AGENTS.md']);
|
|
1122
1267
|
if (developerAgentInstructionAppend !== null) {
|
|
1123
1268
|
mergedTarget.files.set(developerAgentInstructionAppend.path, developerAgentInstructionAppend.contents);
|
|
@@ -1160,17 +1305,13 @@ async function upgradeWorkspace(tree, options, packageJson, output) {
|
|
|
1160
1305
|
}
|
|
1161
1306
|
tree.write(path, contents);
|
|
1162
1307
|
}
|
|
1163
|
-
if (!options.skipFormat) {
|
|
1164
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
1165
|
-
for (const [path, contents] of Object.entries(target.files)) {
|
|
1166
|
-
if ((0, workspace_files_js_1.isRawWorkspaceAuthorityPath)(path))
|
|
1167
|
-
tree.write(path, contents);
|
|
1168
|
-
}
|
|
1169
|
-
}
|
|
1170
1308
|
if (developerAgentInstructionAppend !== null) {
|
|
1171
1309
|
tree.write(developerAgentInstructionAppend.path, developerAgentInstructionAppend.contents);
|
|
1172
1310
|
}
|
|
1173
1311
|
(0, index_js_4.restampWorkspaceOwnership)(tree);
|
|
1312
|
+
if (!options.skipFormat) {
|
|
1313
|
+
await formatOwnershipRecord(tree, '.ebk/ownership.json', 'Workspace');
|
|
1314
|
+
}
|
|
1174
1315
|
}
|
|
1175
1316
|
async function executeUpgradeGenerator(tree, options, output = devkit_1.logger, executionOptions = {}) {
|
|
1176
1317
|
const name = requireName(options.name);
|
|
@@ -1228,10 +1369,11 @@ async function executeUpgradeGenerator(tree, options, output = devkit_1.logger,
|
|
|
1228
1369
|
let externalBlueprintDestinationPaths;
|
|
1229
1370
|
const scope = workspaceScope(packageJson);
|
|
1230
1371
|
if (blueprint.source === 'built-in') {
|
|
1372
|
+
const deployment = readRepositoryDeploymentRenderingOptions(tree);
|
|
1231
1373
|
const runtimeVersion = packageJson.dependencies?.['@empire-builder-kit/runtime'];
|
|
1232
1374
|
if (!runtimeVersion)
|
|
1233
1375
|
throw new Error('Workspace must depend on @empire-builder-kit/runtime.');
|
|
1234
|
-
const plan = (0, built_in_plan_js_1.createBuiltInSlicePlan)(name, scope, runtimeVersion, blueprint.manifest, inputResult.value);
|
|
1376
|
+
const plan = (0, built_in_plan_js_1.createBuiltInSlicePlan)(name, scope, runtimeVersion, blueprint.manifest, inputResult.value, undefined, deployment.deploymentProfile);
|
|
1235
1377
|
targetFiles = Object.fromEntries(Object.entries(plan.files).map(([path, contents]) => {
|
|
1236
1378
|
const current = tree.read(node_path_1.posix.join(root, path), 'utf8');
|
|
1237
1379
|
return [
|
|
@@ -1329,8 +1471,9 @@ async function executeUpgradeGenerator(tree, options, output = devkit_1.logger,
|
|
|
1329
1471
|
}
|
|
1330
1472
|
targetFiles = {
|
|
1331
1473
|
...targetFiles,
|
|
1332
|
-
[productPath]:
|
|
1474
|
+
[productPath]: reconcileFunctionRegistrationArguments(productSource, currentOwnership),
|
|
1333
1475
|
};
|
|
1476
|
+
targetFiles = preserveBuiltInDerivedApiArtifacts(tree, root, currentOwnership, targetFiles);
|
|
1334
1477
|
}
|
|
1335
1478
|
const targetPathSet = new Set(targetOwnership.paths.map(({ path }) => path));
|
|
1336
1479
|
const compositionPlan = renderCompositionUpgradePlan(currentOwnership, packageJson.name ?? '', packageJson.dependencies?.['@empire-builder-kit/runtime'] ?? '', serviceAdapterOwner);
|
|
@@ -1349,7 +1492,7 @@ async function executeUpgradeGenerator(tree, options, output = devkit_1.logger,
|
|
|
1349
1492
|
}
|
|
1350
1493
|
targetFiles = { ...targetFiles, [entry.path]: contents };
|
|
1351
1494
|
}
|
|
1352
|
-
targetFiles = await formatRenderedFiles(targetFiles, root);
|
|
1495
|
+
targetFiles = await formatRenderedFiles(tree, targetFiles, root);
|
|
1353
1496
|
targetOwnership = {
|
|
1354
1497
|
...targetOwnership,
|
|
1355
1498
|
compositions: currentOwnership.compositions,
|
|
@@ -1386,7 +1529,8 @@ async function executeUpgradeGenerator(tree, options, output = devkit_1.logger,
|
|
|
1386
1529
|
path,
|
|
1387
1530
|
tree.read(node_path_1.posix.join(root, path), 'utf8'),
|
|
1388
1531
|
]));
|
|
1389
|
-
|
|
1532
|
+
let mergedTarget = mergeStructuredTargetFiles(currentFiles, currentOwnership, new Map(Object.entries(targetFiles)), targetOwnership);
|
|
1533
|
+
mergedTarget = await formatMergedManagedJsonFiles(tree, root, mergedTarget, targetOwnership);
|
|
1390
1534
|
requireTargetCompositionFeatures(mergedTarget.files, targetOwnership);
|
|
1391
1535
|
const report = createUpgradeReport(currentFiles, currentOwnership, mergedTarget.files, targetOwnership, mergedTarget);
|
|
1392
1536
|
output.info(`[ebk-upgrade] ${name} ${currentOwnership.blueprint.name}@${currentOwnership.blueprint.version} -> ${blueprint.manifest.name}@${blueprint.manifest.version}\n${JSON.stringify(report, null, 2)}`);
|
|
@@ -1419,10 +1563,18 @@ async function executeUpgradeGenerator(tree, options, output = devkit_1.logger,
|
|
|
1419
1563
|
[blueprint.manifest.name]: blueprint.manifest.version,
|
|
1420
1564
|
};
|
|
1421
1565
|
tree.write('package.json', json(packageJson));
|
|
1566
|
+
if (!options.skipFormat) {
|
|
1567
|
+
const path = 'package.json';
|
|
1568
|
+
if (!tree.exists(path)) {
|
|
1569
|
+
throw new Error('Workspace package.json disappeared during upgrade.');
|
|
1570
|
+
}
|
|
1571
|
+
await (0, formatting_js_1.formatTreeFileToFixedPoint)(tree, path);
|
|
1572
|
+
}
|
|
1422
1573
|
}
|
|
1423
|
-
if (!options.skipFormat)
|
|
1424
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
1425
1574
|
(0, index_js_4.restampProductSliceOwnership)(tree, name, { preserveSeeded: true });
|
|
1575
|
+
if (!options.skipFormat) {
|
|
1576
|
+
await formatOwnershipRecord(tree, node_path_1.posix.join(root, '.ebk/ownership.json'), 'Product Slice');
|
|
1577
|
+
}
|
|
1426
1578
|
return options.skipInstall
|
|
1427
1579
|
? undefined
|
|
1428
1580
|
: () => (0, devkit_1.installPackagesTask)(tree, true);
|