@wildo-ai/wildo-cli 1.1.14 → 1.1.16
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/dist/src/commands/context/journey.command.d.ts.map +1 -1
- package/dist/src/commands/context/journey.command.js +12 -0
- package/dist/src/commands/context/journey.command.js.map +1 -1
- package/dist/src/commands/creation/drive.command.d.ts.map +1 -1
- package/dist/src/commands/creation/drive.command.js +2 -1
- package/dist/src/commands/creation/drive.command.js.map +1 -1
- package/dist/src/commands/generate/email-command.utils.d.ts +2 -0
- package/dist/src/commands/generate/email-command.utils.d.ts.map +1 -1
- package/dist/src/commands/generate/email-command.utils.js +5 -0
- package/dist/src/commands/generate/email-command.utils.js.map +1 -1
- package/dist/src/commands/init.command.d.ts.map +1 -1
- package/dist/src/commands/init.command.js +7 -2
- package/dist/src/commands/init.command.js.map +1 -1
- package/dist/src/commands/local/deregister.command.d.ts.map +1 -1
- package/dist/src/commands/local/deregister.command.js +4 -0
- package/dist/src/commands/local/deregister.command.js.map +1 -1
- package/dist/src/commands/local/dev.command.d.ts +50 -0
- package/dist/src/commands/local/dev.command.d.ts.map +1 -1
- package/dist/src/commands/local/dev.command.js +144 -1
- package/dist/src/commands/local/dev.command.js.map +1 -1
- package/dist/src/commands/local/jobs-command.utils.d.ts +24 -0
- package/dist/src/commands/local/jobs-command.utils.d.ts.map +1 -0
- package/dist/src/commands/local/jobs-command.utils.js +44 -0
- package/dist/src/commands/local/jobs-command.utils.js.map +1 -0
- package/dist/src/commands/local/jobs-run.command.d.ts +7 -0
- package/dist/src/commands/local/jobs-run.command.d.ts.map +1 -0
- package/dist/src/commands/local/jobs-run.command.js +92 -0
- package/dist/src/commands/local/jobs-run.command.js.map +1 -0
- package/dist/src/commands/local/jobs.command.d.ts +7 -0
- package/dist/src/commands/local/jobs.command.d.ts.map +1 -0
- package/dist/src/commands/local/jobs.command.js +59 -0
- package/dist/src/commands/local/jobs.command.js.map +1 -0
- package/dist/src/commands/local/tunnel.command.d.ts +84 -0
- package/dist/src/commands/local/tunnel.command.d.ts.map +1 -0
- package/dist/src/commands/local/tunnel.command.js +274 -0
- package/dist/src/commands/local/tunnel.command.js.map +1 -0
- package/dist/src/commands/providers/grant-export.command.d.ts +16 -0
- package/dist/src/commands/providers/grant-export.command.d.ts.map +1 -0
- package/dist/src/commands/providers/grant-export.command.js +78 -0
- package/dist/src/commands/providers/grant-export.command.js.map +1 -0
- package/dist/src/commands/providers/grant-import.command.d.ts +15 -0
- package/dist/src/commands/providers/grant-import.command.d.ts.map +1 -0
- package/dist/src/commands/providers/grant-import.command.js +78 -0
- package/dist/src/commands/providers/grant-import.command.js.map +1 -0
- package/dist/src/kernel/command-runner.d.ts.map +1 -1
- package/dist/src/kernel/command-runner.js +4 -6
- package/dist/src/kernel/command-runner.js.map +1 -1
- package/dist/src/kernel/hooks.d.ts.map +1 -1
- package/dist/src/kernel/hooks.js +2 -1
- package/dist/src/kernel/hooks.js.map +1 -1
- package/dist/src/kernel/json-document-output.d.ts +7 -0
- package/dist/src/kernel/json-document-output.d.ts.map +1 -1
- package/dist/src/kernel/json-document-output.js +8 -0
- package/dist/src/kernel/json-document-output.js.map +1 -1
- package/dist/src/kernel/types.d.ts +8 -0
- package/dist/src/kernel/types.d.ts.map +1 -1
- package/dist/src/kernel/types.js.map +1 -1
- package/dist/src/services/application/app-bootstrap.service.d.ts +65 -7
- package/dist/src/services/application/app-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/application/app-bootstrap.service.js +94 -15
- package/dist/src/services/application/app-bootstrap.service.js.map +1 -1
- package/dist/src/services/application/app-local-runtime-addresses.service.d.ts +1 -1
- package/dist/src/services/application/app-local-runtime-addresses.service.d.ts.map +1 -1
- package/dist/src/services/application/app-local-runtime-addresses.service.js.map +1 -1
- package/dist/src/services/application/app-runtime-targets.service.d.ts.map +1 -1
- package/dist/src/services/application/app-runtime-targets.service.js +16 -2
- package/dist/src/services/application/app-runtime-targets.service.js.map +1 -1
- package/dist/src/services/application/application-dependency-alignment.service.d.ts +20 -0
- package/dist/src/services/application/application-dependency-alignment.service.d.ts.map +1 -1
- package/dist/src/services/application/application-dependency-alignment.service.js +32 -2
- package/dist/src/services/application/application-dependency-alignment.service.js.map +1 -1
- package/dist/src/services/application/application-runtime-bootstrap.service.d.ts +13 -0
- package/dist/src/services/application/application-runtime-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/application/application-runtime-bootstrap.service.js +32 -0
- package/dist/src/services/application/application-runtime-bootstrap.service.js.map +1 -1
- package/dist/src/services/application/environment-provider-configurations.service.d.ts +7 -0
- package/dist/src/services/application/environment-provider-configurations.service.d.ts.map +1 -1
- package/dist/src/services/application/environment-provider-configurations.service.js +1 -1
- package/dist/src/services/application/environment-provider-configurations.service.js.map +1 -1
- package/dist/src/services/application/local-tunnel.service.d.ts +153 -0
- package/dist/src/services/application/local-tunnel.service.d.ts.map +1 -0
- package/dist/src/services/application/local-tunnel.service.js +295 -0
- package/dist/src/services/application/local-tunnel.service.js.map +1 -0
- package/dist/src/services/application/provider-runtime-sync.service.d.ts.map +1 -1
- package/dist/src/services/application/provider-runtime-sync.service.js +3 -0
- package/dist/src/services/application/provider-runtime-sync.service.js.map +1 -1
- package/dist/src/services/application/saas-skeleton.service.d.ts +7 -0
- package/dist/src/services/application/saas-skeleton.service.d.ts.map +1 -1
- package/dist/src/services/application/saas-skeleton.service.js +2 -0
- package/dist/src/services/application/saas-skeleton.service.js.map +1 -1
- package/dist/src/services/catalog/service-address-resolver.service.d.ts +7 -1
- package/dist/src/services/catalog/service-address-resolver.service.d.ts.map +1 -1
- package/dist/src/services/catalog/service-address-resolver.service.js +6 -3
- package/dist/src/services/catalog/service-address-resolver.service.js.map +1 -1
- package/dist/src/services/companion/companion-client.service.d.ts +17 -0
- package/dist/src/services/companion/companion-client.service.d.ts.map +1 -1
- package/dist/src/services/companion/companion-client.service.js +21 -0
- package/dist/src/services/companion/companion-client.service.js.map +1 -1
- package/dist/src/services/companion/creation-drive.service.d.ts +18 -0
- package/dist/src/services/companion/creation-drive.service.d.ts.map +1 -1
- package/dist/src/services/companion/creation-drive.service.js +70 -1
- package/dist/src/services/companion/creation-drive.service.js.map +1 -1
- package/dist/src/services/credentials/application-secrets.service.d.ts +6 -0
- package/dist/src/services/credentials/application-secrets.service.d.ts.map +1 -1
- package/dist/src/services/credentials/application-secrets.service.js +1 -1
- package/dist/src/services/credentials/application-secrets.service.js.map +1 -1
- package/dist/src/services/credentials/provider-env-vars.utils.d.ts.map +1 -1
- package/dist/src/services/credentials/provider-env-vars.utils.js +3 -1
- package/dist/src/services/credentials/provider-env-vars.utils.js.map +1 -1
- package/dist/src/services/credentials/secrets-writer.service.d.ts +11 -2
- package/dist/src/services/credentials/secrets-writer.service.d.ts.map +1 -1
- package/dist/src/services/credentials/secrets-writer.service.js +12 -3
- package/dist/src/services/credentials/secrets-writer.service.js.map +1 -1
- package/dist/src/services/deployment/ci-deploy-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/ci-deploy-generator.service.js +3 -3
- package/dist/src/services/deployment/ci-deploy-generator.service.js.map +1 -1
- package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts +12 -3
- package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/docker-compose-generator.service.js +40 -22
- package/dist/src/services/deployment/docker/docker-compose-generator.service.js.map +1 -1
- package/dist/src/services/deployment/framework-pod-network-membership.d.ts +6 -0
- package/dist/src/services/deployment/framework-pod-network-membership.d.ts.map +1 -1
- package/dist/src/services/deployment/framework-pod-network-membership.js +17 -3
- package/dist/src/services/deployment/framework-pod-network-membership.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.d.ts +4 -1
- package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js +17 -7
- package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest.schemas.d.ts +7 -0
- package/dist/src/services/deployment/k8s/k8s-manifest.schemas.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest.schemas.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.js +15 -9
- package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.js.map +1 -1
- package/dist/src/services/deployment/k8s/kind-pod-host-gateway.d.ts +43 -0
- package/dist/src/services/deployment/k8s/kind-pod-host-gateway.d.ts.map +1 -0
- package/dist/src/services/deployment/k8s/kind-pod-host-gateway.js +12 -0
- package/dist/src/services/deployment/k8s/kind-pod-host-gateway.js.map +1 -0
- package/dist/src/services/deployment/k8s/off-cluster-backing-services.d.ts +3 -1
- package/dist/src/services/deployment/k8s/off-cluster-backing-services.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/off-cluster-backing-services.js.map +1 -1
- package/dist/src/services/deployment/local-dev-late-workspace-members.service.d.ts +163 -0
- package/dist/src/services/deployment/local-dev-late-workspace-members.service.d.ts.map +1 -0
- package/dist/src/services/deployment/local-dev-late-workspace-members.service.js +356 -0
- package/dist/src/services/deployment/local-dev-late-workspace-members.service.js.map +1 -0
- package/dist/src/services/environment/authored-infra-config.utils.d.ts +13 -3
- package/dist/src/services/environment/authored-infra-config.utils.d.ts.map +1 -1
- package/dist/src/services/environment/authored-infra-config.utils.js +24 -4
- package/dist/src/services/environment/authored-infra-config.utils.js.map +1 -1
- package/dist/src/services/environment/container-host-gateway-listen-host.d.ts +6 -0
- package/dist/src/services/environment/container-host-gateway-listen-host.d.ts.map +1 -1
- package/dist/src/services/environment/container-host-gateway-listen-host.js +6 -0
- package/dist/src/services/environment/container-host-gateway-listen-host.js.map +1 -1
- package/dist/src/services/environment/env-configuration-generator.service.d.ts +12 -0
- package/dist/src/services/environment/env-configuration-generator.service.d.ts.map +1 -1
- package/dist/src/services/environment/env-configuration-generator.service.js +37 -5
- package/dist/src/services/environment/env-configuration-generator.service.js.map +1 -1
- package/dist/src/services/environment/env-vars-builder.service.d.ts +2 -1
- package/dist/src/services/environment/env-vars-builder.service.d.ts.map +1 -1
- package/dist/src/services/environment/env-vars-builder.service.js +47 -32
- package/dist/src/services/environment/env-vars-builder.service.js.map +1 -1
- package/dist/src/services/environment/environment-lifecycle.service.d.ts +7 -4
- package/dist/src/services/environment/environment-lifecycle.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment-lifecycle.service.js +14 -18
- package/dist/src/services/environment/environment-lifecycle.service.js.map +1 -1
- package/dist/src/services/environment/environment-setup.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment-setup.service.js +17 -6
- package/dist/src/services/environment/environment-setup.service.js.map +1 -1
- package/dist/src/services/environment/environment.service.d.ts +4 -3
- package/dist/src/services/environment/environment.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment.service.js +0 -1
- package/dist/src/services/environment/environment.service.js.map +1 -1
- package/dist/src/services/framework/framework-docker-publish.service.d.ts +55 -15
- package/dist/src/services/framework/framework-docker-publish.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-docker-publish.service.js +115 -25
- package/dist/src/services/framework/framework-docker-publish.service.js.map +1 -1
- package/dist/src/services/framework/package-install.service.d.ts +7 -0
- package/dist/src/services/framework/package-install.service.d.ts.map +1 -1
- package/dist/src/services/framework/package-install.service.js +8 -1
- package/dist/src/services/framework/package-install.service.js.map +1 -1
- package/dist/src/services/registry/application-provider-connection.service.d.ts +16 -1
- package/dist/src/services/registry/application-provider-connection.service.d.ts.map +1 -1
- package/dist/src/services/registry/application-provider-connection.service.js +23 -0
- package/dist/src/services/registry/application-provider-connection.service.js.map +1 -1
- package/dist/src/services/registry/provider-grant-transfer.service.d.ts +48 -0
- package/dist/src/services/registry/provider-grant-transfer.service.d.ts.map +1 -0
- package/dist/src/services/registry/provider-grant-transfer.service.js +144 -0
- package/dist/src/services/registry/provider-grant-transfer.service.js.map +1 -0
- package/dist/src/services/registry/provider-module-scaffold.service.d.ts.map +1 -1
- package/dist/src/services/registry/provider-module-scaffold.service.js +10 -3
- package/dist/src/services/registry/provider-module-scaffold.service.js.map +1 -1
- package/dist/src/services/security/csp-sync.service.d.ts.map +1 -1
- package/dist/src/services/security/csp-sync.service.js +21 -2
- package/dist/src/services/security/csp-sync.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +19 -19
- package/templates/infra/docker-compose/docker-compose.wildo-platform.yml.hbs +16 -7
- package/templates/infra/k8s/platform/platform-crontabs-batches-manager/deployment.yaml.hbs +13 -0
- package/templates/saas/i18n/email/system/remote-agent-task-updated/labels.en.ts +11 -0
- package/templates/saas/i18n/email/system/remote-agent-task-updated/template.tsx +56 -0
- package/templates/saas/i18n/engine/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.en.ts +61 -0
- package/templates/saas/i18n/engine/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.fr.ts +61 -0
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/docusaurus.config.ts.hbs +5 -4
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/package.json.hbs +1 -1
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/scripts/substitute-api-origin.mjs +97 -32
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/src/plugins/api-reference-pages.ts +7 -6
- package/templates/saas/skeleton/.wildo-saas/wildo-dev-companion/scripts/dev-supervised.sh +18 -4
- package/templates/saas/skeleton/frontend/nginx-config/default.conf.hbs +1 -1
- package/templates/saas/skeleton/frontend/src/generated/csp.generated.json.hbs +4 -4
- package/templates/saas/skeleton/infrastructure/local/wildo.infra.local.config.ts.hbs +2 -0
- package/wildo-framework.info.json +1 -1
|
@@ -47,6 +47,6 @@ export declare function loadAppLocalRuntimeServiceAddresses(appRoot: string,
|
|
|
47
47
|
* copies; a real CLI process already holds them, so the configuration file is all it evaluates.
|
|
48
48
|
*/
|
|
49
49
|
evaluation?: {
|
|
50
|
-
readonly loadOptions: Pick<LoadConfigOptions, 'moduleResolution'> | undefined;
|
|
50
|
+
readonly loadOptions: Pick<LoadConfigOptions, 'moduleResolution' | 'freshModuleCache'> | undefined;
|
|
51
51
|
}): Promise<Record<string, LocalRuntimeServiceAddress> | undefined>;
|
|
52
52
|
//# sourceMappingURL=app-local-runtime-addresses.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-local-runtime-addresses.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/app-local-runtime-addresses.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwD,KAAK,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAE7H,MAAM,WAAW,0BAA0B;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAuED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,mCAAmC,CACvD,OAAO,EAAE,MAAM;AACf;;;;;;;;;;;;;GAaG;AACH,UAAU,CAAC,EAAE;IAAE,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,GAAG,SAAS,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"app-local-runtime-addresses.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/app-local-runtime-addresses.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwD,KAAK,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAE7H,MAAM,WAAW,0BAA0B;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAuED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,mCAAmC,CACvD,OAAO,EAAE,MAAM;AACf;;;;;;;;;;;;;GAaG;AACH,UAAU,CAAC,EAAE;IAAE,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,iBAAiB,EAAE,kBAAkB,GAAG,kBAAkB,CAAC,GAAG,SAAS,CAAA;CAAE,GAClH,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,GAAG,SAAS,CAAC,CAiCjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-local-runtime-addresses.service.js","sourceRoot":"","sources":["../../../../src/services/application/app-local-runtime-addresses.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,gBAAgB,EAA0B,MAAM,+BAA+B,CAAC;AAQ7H,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC;AAED,SAAS,mCAAmC,CAAC,GAAY;IACvD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,IAAI,GAAG,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACjE,MAAM,IAAI,GAAG,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACjE,MAAM,GAAG,GAAG,OAAO,GAAG,CAAC,GAAG,KAAK,QAAQ;QACrC,CAAC,CAAC,GAAG,CAAC,GAAG;QACT,CAAC,CAAC,IAAI,KAAK,SAAS;YAClB,CAAC,CAAC,UAAU,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,IAAI,IAAI,EAAE;YACrE,CAAC,CAAC,SAAS,CAAC;IAEhB,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,GAAG,EAAE,CAAC;QACxC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;AAC7B,CAAC;AAED,SAAS,uBAAuB,CAAC,GAAY;IAC3C,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACnB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,SAAS,GAA+C,EAAE,CAAC;IAEjE,IAAI,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3B,KAAK,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YACtE,MAAM,UAAU,GAAG,mCAAmC,CAAC,YAAY,CAAC,CAAC;YACrE,IAAI,UAAU,EAAE,CAAC;gBACf,SAAS,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;YACrC,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,YAAY,GAAG,mCAAmC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC3E,IAAI,YAAY,EAAE,CAAC;QACjB,SAAS,CAAC,YAAY,GAAG,YAAY,CAAC;IACxC,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;AACnE,CAAC;AAED,KAAK,UAAU,iCAAiC,CAC9C,UAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"app-local-runtime-addresses.service.js","sourceRoot":"","sources":["../../../../src/services/application/app-local-runtime-addresses.service.ts"],"names":[],"mappings":"AA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;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,KAAK,UAAU,mCAAmC,CACvD,OAAe;AACf;;;;;;;;;;;;;GAaG;AACH,UAAmH;IAEnH,MAAM,oBAAoB,GAAG,UAAU,KAAK,SAAS;QACnD,CAAC,CAAC,EAAE,gBAAgB,EAAE,sBAAsB,CAAC,gBAAgB,EAAE;QAC/D,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC;IAC3B,MAAM,SAAS,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC5C,MAAM,mBAAmB,GAAG,IAAI,CAC9B,SAAS,CAAC,uBAAuB,EACjC,OAAO,EACP,WAAW,EACX,QAAQ,EACR,aAAa,CACd,CAAC;IACF,IAAI,UAAU,CAAC,mBAAmB,CAAC,EAAE,CAAC;QACpC,MAAM,kBAAkB,GAAG,wCAAwC,CAAC,mBAAmB,CAAC,CAAC;QACzF,IAAI,kBAAkB,EAAE,CAAC;YACvB,OAAO,kBAAkB,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,MAAM,kBAAkB,GAAG;QACzB,IAAI,CAAC,SAAS,CAAC,0BAA0B,EAAE,OAAO,EAAE,6BAA6B,CAAC;KACnF,CAAC;IACF,KAAK,MAAM,SAAS,IAAI,kBAAkB,EAAE,CAAC;QAC3C,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3B,SAAS;QACX,CAAC;QAED,MAAM,SAAS,GAAG,MAAM,iCAAiC,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;QAC3F,IAAI,SAAS,EAAE,CAAC;YACd,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { existsSync, readFileSync } from 'fs';\nimport { join } from 'path';\nimport { ConfigModuleResolution, loadConfig, resolveAppLayout, type LoadConfigOptions } from '@wildo-ai/platform-config-lib';\n\nexport interface LocalRuntimeServiceAddress {\n host?: string;\n port?: number;\n url?: string;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n\nfunction normalizeLocalRuntimeServiceAddress(raw: unknown): LocalRuntimeServiceAddress | null {\n if (!isRecord(raw)) {\n return null;\n }\n\n const host = typeof raw.host === 'string' ? raw.host : undefined;\n const port = typeof raw.port === 'number' ? raw.port : undefined;\n const url = typeof raw.url === 'string'\n ? raw.url\n : port !== undefined\n ? `http://${host && host !== '0.0.0.0' ? host : 'localhost'}:${port}`\n : undefined;\n\n if (!host && port === undefined && !url) {\n return null;\n }\n\n return { host, port, url };\n}\n\nfunction extractServiceAddresses(raw: unknown): Record<string, LocalRuntimeServiceAddress> | undefined {\n if (!isRecord(raw)) {\n return undefined;\n }\n\n const addresses: Record<string, LocalRuntimeServiceAddress> = {};\n\n if (isRecord(raw.services)) {\n for (const [serviceKey, serviceValue] of Object.entries(raw.services)) {\n const normalized = normalizeLocalRuntimeServiceAddress(serviceValue);\n if (normalized) {\n addresses[serviceKey] = normalized;\n }\n }\n }\n\n const devCompanion = normalizeLocalRuntimeServiceAddress(raw.devCompanion);\n if (devCompanion) {\n addresses.devCompanion = devCompanion;\n }\n\n return Object.keys(addresses).length > 0 ? addresses : undefined;\n}\n\nasync function tryLoadServiceAddressesFromConfig(\n configPath: string,\n loadOptions: Pick<LoadConfigOptions, 'moduleResolution' | 'freshModuleCache'> | undefined,\n): Promise<Record<string, LocalRuntimeServiceAddress> | undefined> {\n try {\n const config = await loadConfig<unknown>(configPath, loadOptions);\n return extractServiceAddresses(config);\n } catch {\n return undefined;\n }\n}\n\nfunction tryLoadServiceAddressesFromGeneratedJson(configPath: string): Record<string, LocalRuntimeServiceAddress> | undefined {\n try {\n const raw = JSON.parse(readFileSync(configPath, 'utf8')) as unknown;\n return extractServiceAddresses(raw);\n } catch {\n return undefined;\n }\n}\n\n/**\n * Resolve local runtime service addresses for a targeted app.\n *\n * Resolution order matters:\n * 1. generated app-owned runtime config under `.wildo-saas`\n * 2. authored flattened local infra descriptor under `infrastructure/local`\n *\n * **Slice 3 deep-review M-5 (2026-04-13) — dual-source contract.**\n *\n * `devCompanion` (along with the per-app `services.<key>` addresses) is\n * authored in `wildo.infra.<env>.config.ts` and resolved through the two\n * candidates above. It is intentionally NOT persisted into the\n * platform-level `wildo-secrets/environments/<env>/config.json` (handled\n * by `PlatformEnvConfigJson_Schema`) because dev companion topology is a\n * per-app local-execution concern that must NOT cross app boundaries.\n *\n * The two `config.json` files this CLI knows about have different owners:\n * - PLATFORM `<wildo-secrets>/environments/<env>/config.json` — shared\n * runtime posture (backing services, serviceAuth, logging, ...).\n * - APP `<appRoot>/.wildo-saas/runtime-environments/local/generated/config/config.json`\n * — per-app local service addresses (this function's first candidate).\n *\n * If a future change wants to consolidate, pin `devCompanion` to ONE\n * canonical location first (likely the app-level file, since the platform\n * file is shared) — silently writing it to both would create a\n * dual-source-of-truth that drifts over time.\n */\nexport async function loadAppLocalRuntimeServiceAddresses(\n appRoot: string,\n /**\n * How the authored infra configuration is evaluated, when it is.\n *\n * A caller that passes this object decides, and `loadOptions: undefined` keeps the loader's own inference\n * (`AppRuntimeTargetsService.resolve`, whose contract is to leave the default alone unless its caller asks, #3440).\n * A caller that passes nothing gets {@link ConfigModuleResolution.LOADER_INSTANCES}. Every such caller asks only what\n * the configuration DECLARES (a host, a port, a URL), from inside the CLI, which already runs the framework's built\n * packages: the reader that mode exists for. The inference answers `package` for an application outside the framework\n * checkout, and in a checkout where `platform-config-lib` carries its `src/` that still aliases the package to\n * `config-authoring.entry.ts`, so every cold read transpiled about 120 framework source modules to learn one port:\n * 2.3 s on a 12-core host and over 5 s on the CI runner, where `companionPost`'s test timed out (#3610). With the CLI's\n * own built modules the same read measured 1.0 s cold in a test process, which holds them only as Vite-transformed\n * copies; a real CLI process already holds them, so the configuration file is all it evaluates.\n */\n evaluation?: { readonly loadOptions: Pick<LoadConfigOptions, 'moduleResolution' | 'freshModuleCache'> | undefined },\n): Promise<Record<string, LocalRuntimeServiceAddress> | undefined> {\n const effectiveLoadOptions = evaluation === undefined\n ? { moduleResolution: ConfigModuleResolution.LOADER_INSTANCES }\n : evaluation.loadOptions;\n const appLayout = resolveAppLayout(appRoot);\n const generatedConfigPath = join(\n appLayout.runtimeEnvironmentsHome,\n 'local',\n 'generated',\n 'config',\n 'config.json',\n );\n if (existsSync(generatedConfigPath)) {\n const generatedAddresses = tryLoadServiceAddressesFromGeneratedJson(generatedConfigPath);\n if (generatedAddresses) {\n return generatedAddresses;\n }\n }\n\n const authoredCandidates = [\n join(appLayout.authoredInfrastructureHome, 'local', 'wildo.infra.local.config.ts'),\n ];\n for (const candidate of authoredCandidates) {\n if (!existsSync(candidate)) {\n continue;\n }\n\n const addresses = await tryLoadServiceAddressesFromConfig(candidate, effectiveLoadOptions);\n if (addresses) {\n return addresses;\n }\n }\n return undefined;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-runtime-targets.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/app-runtime-targets.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAE3B,KAAK,0BAA0B,EAE/B,KAAK,0CAA0C,EAC/C,KAAK,gBAAgB,EACrB,KAAK,eAAe,EAErB,MAAM,+BAA+B,CAAC;AAIvC,MAAM,WAAW,4BAA4B;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC;;;;OAIG;IACH,SAAS,EAAE,gBAAgB,CAAC;CAC7B;AAED,MAAM,WAAW,6BAA6B;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC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,MAAM,EAAE,0CAA0C,CAAC,GAAG,SAAS,CAAC;IAC/F;;;;;;OAMG;IACH,yBAAyB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7C,4DAA4D;IAC5D,SAAS,EAAE,WAAW,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC;IACrD,uEAAuE;IACvE,cAAc,CAAC,EAAE,eAAe,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAAC;IAC/D,2DAA2D;IAC3D,eAAe,EAAE,WAAW,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC;IACzD,4DAA4D;IAC5D,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7C,wDAAwD;IACxD,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,qBAAa,wBAAwB;mBACd,mBAAmB;mBAqHnB,4BAA4B;IAiCjD;;;;;;;;;;;;;;OAcG;WACU,OAAO,CAClB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE;QACP,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;QAC/B,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACtC,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;KACjD,GACA,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC;WA0C9B,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAQ1F"}
|
|
@@ -7,7 +7,11 @@ export class AppRuntimeTargetsService {
|
|
|
7
7
|
static async buildResolvedTarget(appRoot, saasConfig, declaredServiceKeys,
|
|
8
8
|
/** The application's provider configuration with the target environment's values laid over it. */
|
|
9
9
|
providerConfigurations,
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* How every per-folder and infra configuration read here is evaluated: the one `resolve` was asked for, FRESH
|
|
12
|
+
* included, so a minion's or worker's own configuration is read as it is now in a long-lived `wildo local dev`
|
|
13
|
+
* exactly as the declaration naming it is (#3985).
|
|
14
|
+
*/
|
|
11
15
|
loadOptions) {
|
|
12
16
|
const workerConfigs = await loadWorkerConfigs(appRoot, saasConfig, loadOptions);
|
|
13
17
|
const minionConfigs = await loadMinionConfigs(appRoot, saasConfig, loadOptions);
|
|
@@ -145,7 +149,15 @@ export class AppRuntimeTargetsService {
|
|
|
145
149
|
if (!existsSync(saasConfigPath)) {
|
|
146
150
|
return null;
|
|
147
151
|
}
|
|
148
|
-
|
|
152
|
+
/*
|
|
153
|
+
* A FRESH read (#3985): `wildo local dev` resolves the targets again while it runs, when the declared topology changes,
|
|
154
|
+
* and jiti's module cache is process-wide, so a cached read would project the topology the stack STARTED with and
|
|
155
|
+
* regenerate the very env files that are missing the new service.
|
|
156
|
+
*/
|
|
157
|
+
const loadOptions = {
|
|
158
|
+
freshModuleCache: true,
|
|
159
|
+
...(options.configModuleResolution === undefined ? {} : { moduleResolution: options.configModuleResolution }),
|
|
160
|
+
};
|
|
149
161
|
const saasConfig = await loadSaasConfig(saasConfigPath, loadOptions);
|
|
150
162
|
if (!saasConfig) {
|
|
151
163
|
return null;
|
|
@@ -158,6 +170,8 @@ export class AppRuntimeTargetsService {
|
|
|
158
170
|
saasRoot,
|
|
159
171
|
applicationProviderConfigurations: saasConfig.providerConfigurations,
|
|
160
172
|
environmentName: options.environmentName,
|
|
173
|
+
// The environment's overlay is part of the same declaration, so it is read the same way (fresh).
|
|
174
|
+
infraConfigLoadOptions: loadOptions,
|
|
161
175
|
});
|
|
162
176
|
return AppRuntimeTargetsService.buildResolvedTarget(saasRoot, saasConfig, new Set(Object.keys(saasConfig.services)), providerConfigurations, loadOptions);
|
|
163
177
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-runtime-targets.service.js","sourceRoot":"","sources":["../../../../src/services/application/app-runtime-targets.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;A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AAC;QACD,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC;CACF","sourcesContent":["import { existsSync } from 'fs';\nimport { join } from 'path';\nimport {\n loadWorkerConfigs,\n loadMinionConfigs,\n loadSaasConfig,\n type AppBootstrapFirstAdminSeed,\n type ConfigModuleResolution,\n type LoadConfigOptions,\n type AdminAppManagedDeclaration,\n normalizeSaasRuntimeDescriptor,\n type NormalizedLocalServiceAddressingDescriptor,\n type RuntimeIsolation,\n type WildoSaasConfig,\n WORKSPACE_CONFIG_NAMES,\n} from '@wildo-ai/platform-config-lib';\nimport { loadAppLocalRuntimeServiceAddresses } from './app-local-runtime-addresses.service';\nimport { resolveEnvironmentProviderConfigurations } from './environment-provider-configurations.service';\n\nexport interface ResolvedBackendServiceTarget {\n key: string;\n path: string;\n serviceName: string;\n defaultPort?: number | undefined;\n /**\n * Effective container isolation, resolved at the config boundary by\n * `resolveAppServiceIsolation` (see the normalized descriptor). Passed through\n * unchanged to both deploy renderers.\n */\n isolation: RuntimeIsolation;\n}\n\nexport interface ResolvedFrontendServiceTarget {\n key: string;\n path: string;\n serviceName: string;\n defaultPort?: number | undefined;\n frontendType: string;\n /**\n * Effective container isolation, resolved at the config boundary by\n * `resolveAppServiceIsolation` (see the normalized descriptor). Passed through\n * unchanged to both deploy renderers.\n */\n isolation: RuntimeIsolation;\n}\n\nexport interface ResolvedAppRuntimeTarget {\n appSlug: string;\n appDisplayName: string;\n appRoot: string;\n saasConfigPath: string;\n appDatabaseName?: string | undefined;\n /**\n * Authored `wildo.saas.config.dataServices.redis.keyPrefix` (Slice 3.6).\n * Threaded through to per-app `.env` as `REDIS_KEY_PREFIX`.\n */\n redisKeyPrefix?: string | undefined;\n /**\n * Authored `wildo.saas.config.dataServices.s3.bucketPrefix` (Slice 3.6).\n * Threaded through to per-app `.env` as `STORAGE_BUCKET_PREFIX`.\n */\n storageBucketPrefix?: string | undefined;\n requiresJavaBackendBase: boolean;\n backendServices: ResolvedBackendServiceTarget[];\n frontendServices: ResolvedFrontendServiceTarget[];\n managedDeclaration: AdminAppManagedDeclaration;\n firstAdminSeed?: AppBootstrapFirstAdminSeed | undefined;\n localServiceAddresses?: Record<string, NormalizedLocalServiceAddressingDescriptor> | undefined;\n /**\n * Provider refs the BACKEND declares (`providers.scopes.backend.providers`).\n *\n * Resolved here, where the saas config is already parsed, rather than by a\n * second `loadConfig` in the env-target builder — one read, one source, and no\n * new filesystem requirement on callers that construct this target in tests.\n */\n backendScopedProviderRefs: readonly string[];\n /** Global library declarations from wildo.saas.config.ts */\n libraries: NonNullable<WildoSaasConfig['libraries']>;\n /** App specifications package declaration from wildo.saas.config.ts */\n specifications?: WildoSaasConfig['specifications'] | undefined;\n /** Declarative domain modules from wildo.saas.config.ts */\n declaredModules: NonNullable<WildoSaasConfig['modules']>;\n /** Derived module ids keyed by declared SaaS service key */\n moduleIdsByService: Record<string, string[]>;\n /** All declared module ids from wildo.saas.config.ts */\n moduleIds: string[];\n}\n\nexport class AppRuntimeTargetsService {\n private static async buildResolvedTarget(\n appRoot: string,\n saasConfig: WildoSaasConfig,\n declaredServiceKeys: Set<string>,\n /** The application's provider configuration with the target environment's values laid over it. */\n providerConfigurations: WildoSaasConfig['providerConfigurations'],\n /** How every per-folder and infra configuration read here is evaluated: the one `resolve` was asked for. */\n loadOptions: Pick<LoadConfigOptions, 'moduleResolution'> | undefined,\n ): Promise<ResolvedAppRuntimeTarget> {\n const workerConfigs = await loadWorkerConfigs(appRoot, saasConfig, loadOptions);\n const minionConfigs = await loadMinionConfigs(appRoot, saasConfig, loadOptions);\n // Merge per-folder `wildo.minion.config.ts` (`mode` + `schedule`) into\n // the runtime declaration alongside the saas-config-level\n // `resourceAccess`. KD-12 cron-tick path (Phase 3 closeout): the\n // backend-api's `cron-job-sync.backend.service.ts` reads these to\n // register `mode: 'cron'` minions as CronJob records on\n // platform-crontabs-batches-manager.\n const minionConfigByKey = new Map(\n minionConfigs.map((entry) => [entry.key, entry.config] as const),\n );\n const minionsWithRuntime = saasConfig.minions\n ? Object.fromEntries(\n Object.entries(saasConfig.minions).map(([key, saasEntry]) => {\n const folderConfig = minionConfigByKey.get(key);\n return [\n key,\n {\n ...saasEntry,\n ...(folderConfig\n ? {\n mode: folderConfig.mode,\n schedule: folderConfig.schedule,\n }\n : {}),\n },\n ];\n }),\n )\n : undefined;\n const normalized = normalizeSaasRuntimeDescriptor({\n name: saasConfig.name,\n slug: saasConfig.slug,\n displayName: saasConfig.displayName,\n description: saasConfig.description,\n type: saasConfig.type,\n services: saasConfig.services,\n minions: minionsWithRuntime,\n workers: Object.fromEntries(\n workerConfigs.map((entry) => [\n entry.key,\n {\n name: entry.config.name,\n displayName: entry.config.displayName,\n description: entry.config.description,\n runtime: entry.config.runtime,\n http: entry.config.http,\n auth: entry.config.auth,\n replicas: entry.config.replicas,\n resources: entry.config.resources,\n dataAccess: entry.config.dataAccess,\n },\n ]),\n ),\n engineCapabilities: saasConfig.engineCapabilities,\n providers: saasConfig.providers,\n providerConfigurations,\n // Carried to apps-manager so it can derive the type of the organization it seeds for the first\n // administrator (#1032).\n organizationTypes: saasConfig.organizationTypes,\n // Carried for the same reason one line up: apps-manager stores the declaration, and the CLI and\n // the backend both derive each instance's environment-variable names from it (#1055).\n systemsOfRecord: saasConfig.systemsOfRecord,\n // Carried with the types it is a statement about (#2722).\n organizationRelationships: saasConfig.organizationRelationships,\n // Carried with the people it is a statement about (#2967): a decision may require one of these kinds.\n professionalQualificationKinds: saasConfig.professionalQualificationKinds,\n // Carried to apps-manager, which signs with the keys these bindings name (#2891).\n keyManagement: saasConfig.keyManagement,\n dataServices: saasConfig.dataServices,\n modules: saasConfig.modules,\n libraries: saasConfig.libraries,\n specifications: saasConfig.specifications,\n bootstrap: saasConfig.bootstrap,\n });\n const localServiceAddresses = await AppRuntimeTargetsService.resolveLocalServiceAddresses(\n appRoot,\n declaredServiceKeys,\n loadOptions,\n );\n\n return {\n appSlug: normalized.appSlug,\n appDisplayName: normalized.appDisplayName,\n appRoot,\n saasConfigPath: join(appRoot, WORKSPACE_CONFIG_NAMES.SAAS),\n appDatabaseName: normalized.appDatabaseName,\n redisKeyPrefix: normalized.redisKeyPrefix,\n storageBucketPrefix: normalized.storageBucketPrefix,\n requiresJavaBackendBase: normalized.requiresJavaBackendBase,\n backendServices: normalized.backendServices,\n frontendServices: normalized.frontendServices,\n managedDeclaration: normalized.managedDeclaration,\n firstAdminSeed: normalized.firstAdminSeed,\n localServiceAddresses,\n backendScopedProviderRefs: Object.keys(saasConfig.providers?.scopes?.backend?.providers ?? {}),\n libraries: normalized.libraries,\n specifications: normalized.specifications,\n declaredModules: normalized.declaredModules,\n moduleIdsByService: normalized.moduleIdsByService,\n moduleIds: normalized.moduleIds,\n };\n }\n\n private static async resolveLocalServiceAddresses(\n appRoot: string,\n declaredServiceKeys: Set<string>,\n loadOptions: Pick<LoadConfigOptions, 'moduleResolution'> | undefined,\n ): Promise<Record<string, NormalizedLocalServiceAddressingDescriptor> | undefined> {\n const serviceAddresses = await loadAppLocalRuntimeServiceAddresses(appRoot, { loadOptions });\n if (!serviceAddresses) {\n return undefined;\n }\n\n // Local infra descriptors may contain executor-only services that are not\n // part of the SaaS runtime descriptor (for example the nested dev companion).\n // When a service key is already declared in `wildo.saas.config.ts`, the SaaS\n // descriptor remains the single source of truth for local backend/frontend\n // topology and we ignore the duplicate infra entry here.\n const localServiceAddresses = Object.fromEntries(\n Object.entries(serviceAddresses)\n .filter(([serviceKey]) => !declaredServiceKeys.has(serviceKey))\n .map(([serviceKey, service]) => [\n serviceKey,\n {\n host: service.host,\n port: service.port,\n url: service.url,\n } satisfies NormalizedLocalServiceAddressingDescriptor,\n ]),\n );\n\n return Object.keys(localServiceAddresses).length > 0\n ? localServiceAddresses\n : undefined;\n }\n\n /**\n * Resolve the application target, with its managed declaration bound to ONE environment.\n *\n * `environmentName` is required, and `null` is an answer rather than a default: the declaration carries the\n * application's provider configuration, and an environment's `wildo.infra.<env>.config.ts` lays its own values over\n * it (an OAuth client ID registered for that deployment). A caller that SENDS the declaration to an environment's\n * apps-manager — registration, reapply, the doctor's dry-run comparison — must name that environment, or it would\n * store (or compare against) another environment's values. A caller that only reads the services list passes `null`.\n *\n * `configModuleResolution` is how the framework packages are resolved while `wildo.saas.config.ts`, the per-folder\n * worker and minion configurations and the local infra configuration are evaluated ({@link ConfigModuleResolution});\n * omitted, the loader infers it. A caller that reads only what the\n * declaration states, inside a process that already runs the framework, passes `LOADER_INSTANCES`, so the evaluation\n * reuses this CLI's own framework modules instead of loading a second copy from source (#3440).\n */\n static async resolve(\n saasRoot: string,\n options: {\n environmentName: string | null;\n requestedAppSlug?: string | undefined;\n configModuleResolution?: ConfigModuleResolution;\n },\n ): Promise<ResolvedAppRuntimeTarget | null> {\n const saasConfigPath = join(saasRoot, WORKSPACE_CONFIG_NAMES.SAAS);\n if (!existsSync(saasConfigPath)) {\n return null;\n }\n\n const loadOptions = options.configModuleResolution === undefined ? undefined : { moduleResolution: options.configModuleResolution };\n const saasConfig = await loadSaasConfig(saasConfigPath, loadOptions);\n if (!saasConfig) {\n return null;\n }\n\n const authoredSlug = saasConfig.slug ?? saasConfig.name;\n if (options.requestedAppSlug && authoredSlug !== options.requestedAppSlug) {\n throw new Error(`App '${options.requestedAppSlug}' does not match the targeted app at ${saasRoot}`);\n }\n\n const providerConfigurations = await resolveEnvironmentProviderConfigurations({\n saasRoot,\n applicationProviderConfigurations: saasConfig.providerConfigurations,\n environmentName: options.environmentName,\n });\n\n return AppRuntimeTargetsService.buildResolvedTarget(\n saasRoot,\n saasConfig,\n new Set(Object.keys(saasConfig.services)),\n providerConfigurations,\n loadOptions,\n );\n }\n\n static async resolveRunRoot(saasRoot: string, requestedAppSlug?: string): Promise<string> {\n // Only the root is read, which no environment changes.\n const target = await AppRuntimeTargetsService.resolve(saasRoot, { environmentName: null, requestedAppSlug });\n if (!target) {\n throw new Error('No runnable SaaS application target found from the current targeted-app root.');\n }\n return target.appRoot;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"app-runtime-targets.service.js","sourceRoot":"","sources":["../../../../src/services/application/app-runtime-targets.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EAKd,8BAA8B,EAI9B,sBAAsB,GACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAC5F,OAAO,EAAE,wCAAwC,EAAE,MAAM,+CAA+C,CAAC;AAuEzG,MAAM,OAAO,wBAAwB;IAC3B,MAAM,CAAC,KAAK,CAAC,mBAAmB,CACtC,OAAe,EACf,UAA2B,EAC3B,mBAAgC;IAChC,kGAAkG;IAClG,sBAAiE;IACjE;;;;OAIG;IACH,WAAyF;QAEzF,MAAM,aAAa,GAAG,MAAM,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;QAChF,MAAM,aAAa,GAAG,MAAM,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;QAChF,uEAAuE;QACvE,0DAA0D;QAC1D,iEAAiE;QACjE,kEAAkE;QAClE,wDAAwD;QACxD,qCAAqC;QACrC,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAC/B,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAU,CAAC,CACjE,CAAC;QACF,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO;YAC3C,CAAC,CAAC,MAAM,CAAC,WAAW,CAChB,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,EAAE;gBAC1D,MAAM,YAAY,GAAG,iBAAiB,CAA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AyB;QACrE,uDAAuD;QACvD,MAAM,MAAM,GAAG,MAAM,wBAAwB,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,CAAC;QAC7G,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,+EAA+E,CAAC,CAAC;QACnG,CAAC;QACD,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC;CACF","sourcesContent":["import { existsSync } from 'fs';\nimport { join } from 'path';\nimport {\n loadWorkerConfigs,\n loadMinionConfigs,\n loadSaasConfig,\n type AppBootstrapFirstAdminSeed,\n type ConfigModuleResolution,\n type LoadConfigOptions,\n type AdminAppManagedDeclaration,\n normalizeSaasRuntimeDescriptor,\n type NormalizedLocalServiceAddressingDescriptor,\n type RuntimeIsolation,\n type WildoSaasConfig,\n WORKSPACE_CONFIG_NAMES,\n} from '@wildo-ai/platform-config-lib';\nimport { loadAppLocalRuntimeServiceAddresses } from './app-local-runtime-addresses.service';\nimport { resolveEnvironmentProviderConfigurations } from './environment-provider-configurations.service';\n\nexport interface ResolvedBackendServiceTarget {\n key: string;\n path: string;\n serviceName: string;\n defaultPort?: number | undefined;\n /**\n * Effective container isolation, resolved at the config boundary by\n * `resolveAppServiceIsolation` (see the normalized descriptor). Passed through\n * unchanged to both deploy renderers.\n */\n isolation: RuntimeIsolation;\n}\n\nexport interface ResolvedFrontendServiceTarget {\n key: string;\n path: string;\n serviceName: string;\n defaultPort?: number | undefined;\n frontendType: string;\n /**\n * Effective container isolation, resolved at the config boundary by\n * `resolveAppServiceIsolation` (see the normalized descriptor). Passed through\n * unchanged to both deploy renderers.\n */\n isolation: RuntimeIsolation;\n}\n\nexport interface ResolvedAppRuntimeTarget {\n appSlug: string;\n appDisplayName: string;\n appRoot: string;\n saasConfigPath: string;\n appDatabaseName?: string | undefined;\n /**\n * Authored `wildo.saas.config.dataServices.redis.keyPrefix` (Slice 3.6).\n * Threaded through to per-app `.env` as `REDIS_KEY_PREFIX`.\n */\n redisKeyPrefix?: string | undefined;\n /**\n * Authored `wildo.saas.config.dataServices.s3.bucketPrefix` (Slice 3.6).\n * Threaded through to per-app `.env` as `STORAGE_BUCKET_PREFIX`.\n */\n storageBucketPrefix?: string | undefined;\n requiresJavaBackendBase: boolean;\n backendServices: ResolvedBackendServiceTarget[];\n frontendServices: ResolvedFrontendServiceTarget[];\n managedDeclaration: AdminAppManagedDeclaration;\n firstAdminSeed?: AppBootstrapFirstAdminSeed | undefined;\n localServiceAddresses?: Record<string, NormalizedLocalServiceAddressingDescriptor> | undefined;\n /**\n * Provider refs the BACKEND declares (`providers.scopes.backend.providers`).\n *\n * Resolved here, where the saas config is already parsed, rather than by a\n * second `loadConfig` in the env-target builder — one read, one source, and no\n * new filesystem requirement on callers that construct this target in tests.\n */\n backendScopedProviderRefs: readonly string[];\n /** Global library declarations from wildo.saas.config.ts */\n libraries: NonNullable<WildoSaasConfig['libraries']>;\n /** App specifications package declaration from wildo.saas.config.ts */\n specifications?: WildoSaasConfig['specifications'] | undefined;\n /** Declarative domain modules from wildo.saas.config.ts */\n declaredModules: NonNullable<WildoSaasConfig['modules']>;\n /** Derived module ids keyed by declared SaaS service key */\n moduleIdsByService: Record<string, string[]>;\n /** All declared module ids from wildo.saas.config.ts */\n moduleIds: string[];\n}\n\nexport class AppRuntimeTargetsService {\n private static async buildResolvedTarget(\n appRoot: string,\n saasConfig: WildoSaasConfig,\n declaredServiceKeys: Set<string>,\n /** The application's provider configuration with the target environment's values laid over it. */\n providerConfigurations: WildoSaasConfig['providerConfigurations'],\n /**\n * How every per-folder and infra configuration read here is evaluated: the one `resolve` was asked for, FRESH\n * included, so a minion's or worker's own configuration is read as it is now in a long-lived `wildo local dev`\n * exactly as the declaration naming it is (#3985).\n */\n loadOptions: Pick<LoadConfigOptions, 'moduleResolution' | 'freshModuleCache'> | undefined,\n ): Promise<ResolvedAppRuntimeTarget> {\n const workerConfigs = await loadWorkerConfigs(appRoot, saasConfig, loadOptions);\n const minionConfigs = await loadMinionConfigs(appRoot, saasConfig, loadOptions);\n // Merge per-folder `wildo.minion.config.ts` (`mode` + `schedule`) into\n // the runtime declaration alongside the saas-config-level\n // `resourceAccess`. KD-12 cron-tick path (Phase 3 closeout): the\n // backend-api's `cron-job-sync.backend.service.ts` reads these to\n // register `mode: 'cron'` minions as CronJob records on\n // platform-crontabs-batches-manager.\n const minionConfigByKey = new Map(\n minionConfigs.map((entry) => [entry.key, entry.config] as const),\n );\n const minionsWithRuntime = saasConfig.minions\n ? Object.fromEntries(\n Object.entries(saasConfig.minions).map(([key, saasEntry]) => {\n const folderConfig = minionConfigByKey.get(key);\n return [\n key,\n {\n ...saasEntry,\n ...(folderConfig\n ? {\n mode: folderConfig.mode,\n schedule: folderConfig.schedule,\n }\n : {}),\n },\n ];\n }),\n )\n : undefined;\n const normalized = normalizeSaasRuntimeDescriptor({\n name: saasConfig.name,\n slug: saasConfig.slug,\n displayName: saasConfig.displayName,\n description: saasConfig.description,\n type: saasConfig.type,\n services: saasConfig.services,\n minions: minionsWithRuntime,\n workers: Object.fromEntries(\n workerConfigs.map((entry) => [\n entry.key,\n {\n name: entry.config.name,\n displayName: entry.config.displayName,\n description: entry.config.description,\n runtime: entry.config.runtime,\n http: entry.config.http,\n auth: entry.config.auth,\n replicas: entry.config.replicas,\n resources: entry.config.resources,\n dataAccess: entry.config.dataAccess,\n },\n ]),\n ),\n engineCapabilities: saasConfig.engineCapabilities,\n providers: saasConfig.providers,\n providerConfigurations,\n // Carried to apps-manager so it can derive the type of the organization it seeds for the first\n // administrator (#1032).\n organizationTypes: saasConfig.organizationTypes,\n // Carried for the same reason one line up: apps-manager stores the declaration, and the CLI and\n // the backend both derive each instance's environment-variable names from it (#1055).\n systemsOfRecord: saasConfig.systemsOfRecord,\n // Carried with the types it is a statement about (#2722).\n organizationRelationships: saasConfig.organizationRelationships,\n // Carried with the people it is a statement about (#2967): a decision may require one of these kinds.\n professionalQualificationKinds: saasConfig.professionalQualificationKinds,\n // Carried to apps-manager, which signs with the keys these bindings name (#2891).\n keyManagement: saasConfig.keyManagement,\n dataServices: saasConfig.dataServices,\n modules: saasConfig.modules,\n libraries: saasConfig.libraries,\n specifications: saasConfig.specifications,\n bootstrap: saasConfig.bootstrap,\n });\n const localServiceAddresses = await AppRuntimeTargetsService.resolveLocalServiceAddresses(\n appRoot,\n declaredServiceKeys,\n loadOptions,\n );\n\n return {\n appSlug: normalized.appSlug,\n appDisplayName: normalized.appDisplayName,\n appRoot,\n saasConfigPath: join(appRoot, WORKSPACE_CONFIG_NAMES.SAAS),\n appDatabaseName: normalized.appDatabaseName,\n redisKeyPrefix: normalized.redisKeyPrefix,\n storageBucketPrefix: normalized.storageBucketPrefix,\n requiresJavaBackendBase: normalized.requiresJavaBackendBase,\n backendServices: normalized.backendServices,\n frontendServices: normalized.frontendServices,\n managedDeclaration: normalized.managedDeclaration,\n firstAdminSeed: normalized.firstAdminSeed,\n localServiceAddresses,\n backendScopedProviderRefs: Object.keys(saasConfig.providers?.scopes?.backend?.providers ?? {}),\n libraries: normalized.libraries,\n specifications: normalized.specifications,\n declaredModules: normalized.declaredModules,\n moduleIdsByService: normalized.moduleIdsByService,\n moduleIds: normalized.moduleIds,\n };\n }\n\n private static async resolveLocalServiceAddresses(\n appRoot: string,\n declaredServiceKeys: Set<string>,\n loadOptions: Pick<LoadConfigOptions, 'moduleResolution' | 'freshModuleCache'> | undefined,\n ): Promise<Record<string, NormalizedLocalServiceAddressingDescriptor> | undefined> {\n const serviceAddresses = await loadAppLocalRuntimeServiceAddresses(appRoot, { loadOptions });\n if (!serviceAddresses) {\n return undefined;\n }\n\n // Local infra descriptors may contain executor-only services that are not\n // part of the SaaS runtime descriptor (for example the nested dev companion).\n // When a service key is already declared in `wildo.saas.config.ts`, the SaaS\n // descriptor remains the single source of truth for local backend/frontend\n // topology and we ignore the duplicate infra entry here.\n const localServiceAddresses = Object.fromEntries(\n Object.entries(serviceAddresses)\n .filter(([serviceKey]) => !declaredServiceKeys.has(serviceKey))\n .map(([serviceKey, service]) => [\n serviceKey,\n {\n host: service.host,\n port: service.port,\n url: service.url,\n } satisfies NormalizedLocalServiceAddressingDescriptor,\n ]),\n );\n\n return Object.keys(localServiceAddresses).length > 0\n ? localServiceAddresses\n : undefined;\n }\n\n /**\n * Resolve the application target, with its managed declaration bound to ONE environment.\n *\n * `environmentName` is required, and `null` is an answer rather than a default: the declaration carries the\n * application's provider configuration, and an environment's `wildo.infra.<env>.config.ts` lays its own values over\n * it (an OAuth client ID registered for that deployment). A caller that SENDS the declaration to an environment's\n * apps-manager — registration, reapply, the doctor's dry-run comparison — must name that environment, or it would\n * store (or compare against) another environment's values. A caller that only reads the services list passes `null`.\n *\n * `configModuleResolution` is how the framework packages are resolved while `wildo.saas.config.ts`, the per-folder\n * worker and minion configurations and the local infra configuration are evaluated ({@link ConfigModuleResolution});\n * omitted, the loader infers it. A caller that reads only what the\n * declaration states, inside a process that already runs the framework, passes `LOADER_INSTANCES`, so the evaluation\n * reuses this CLI's own framework modules instead of loading a second copy from source (#3440).\n */\n static async resolve(\n saasRoot: string,\n options: {\n environmentName: string | null;\n requestedAppSlug?: string | undefined;\n configModuleResolution?: ConfigModuleResolution;\n },\n ): Promise<ResolvedAppRuntimeTarget | null> {\n const saasConfigPath = join(saasRoot, WORKSPACE_CONFIG_NAMES.SAAS);\n if (!existsSync(saasConfigPath)) {\n return null;\n }\n\n /*\n * A FRESH read (#3985): `wildo local dev` resolves the targets again while it runs, when the declared topology changes,\n * and jiti's module cache is process-wide, so a cached read would project the topology the stack STARTED with and\n * regenerate the very env files that are missing the new service.\n */\n const loadOptions = {\n freshModuleCache: true,\n ...(options.configModuleResolution === undefined ? {} : { moduleResolution: options.configModuleResolution }),\n };\n const saasConfig = await loadSaasConfig(saasConfigPath, loadOptions);\n if (!saasConfig) {\n return null;\n }\n\n const authoredSlug = saasConfig.slug ?? saasConfig.name;\n if (options.requestedAppSlug && authoredSlug !== options.requestedAppSlug) {\n throw new Error(`App '${options.requestedAppSlug}' does not match the targeted app at ${saasRoot}`);\n }\n\n const providerConfigurations = await resolveEnvironmentProviderConfigurations({\n saasRoot,\n applicationProviderConfigurations: saasConfig.providerConfigurations,\n environmentName: options.environmentName,\n // The environment's overlay is part of the same declaration, so it is read the same way (fresh).\n infraConfigLoadOptions: loadOptions,\n });\n\n return AppRuntimeTargetsService.buildResolvedTarget(\n saasRoot,\n saasConfig,\n new Set(Object.keys(saasConfig.services)),\n providerConfigurations,\n loadOptions,\n );\n }\n\n static async resolveRunRoot(saasRoot: string, requestedAppSlug?: string): Promise<string> {\n // Only the root is read, which no environment changes.\n const target = await AppRuntimeTargetsService.resolve(saasRoot, { environmentName: null, requestedAppSlug });\n if (!target) {\n throw new Error('No runnable SaaS application target found from the current targeted-app root.');\n }\n return target.appRoot;\n }\n}\n"]}
|
|
@@ -119,6 +119,11 @@ export declare class ApplicationDependencyAlignmentService {
|
|
|
119
119
|
static align(input: {
|
|
120
120
|
applicationRoot: string;
|
|
121
121
|
write: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* The framework-assets root whose alignment manifest names the pins `wildo init` writes (#3994). Defaults to the
|
|
124
|
+
* running CLI's; `null` when there is none, and the orphan report then knows only the derived pins.
|
|
125
|
+
*/
|
|
126
|
+
frameworkAssetsRoot?: string | null;
|
|
122
127
|
}): ApplicationAlignmentResult;
|
|
123
128
|
/**
|
|
124
129
|
* The application's own workspace members, plus its root (`.`).
|
|
@@ -210,6 +215,21 @@ export declare class ApplicationDependencyAlignmentService {
|
|
|
210
215
|
private static reconcileRootOverrides;
|
|
211
216
|
private static reconcileMemberPeers;
|
|
212
217
|
private static readManifest;
|
|
218
|
+
/**
|
|
219
|
+
* The override keys `wildo init` writes into every application (#3994): `propagatedOverrideKeys` and
|
|
220
|
+
* `additionalPropagatedOverrideKeys` of the alignment manifest that travels with the CLI.
|
|
221
|
+
*
|
|
222
|
+
* The orphan report needs them because derivation cannot see two kinds of pin the framework writes on purpose:
|
|
223
|
+
* a name NO framework manifest declares (`stripe`: the engine lazily `require`s the SDK, #239), and a peer of a
|
|
224
|
+
* framework package this application has not installed (`@mdx-js/react`, a peer of `saas-website`, in an
|
|
225
|
+
* application with no website). Both were reported as "no authority writes it — remove it", which told the
|
|
226
|
+
* operator to undo the framework's own pin. The manifest IS that authority. Opt-in package pins are not
|
|
227
|
+
* included: they are written only beside the package, so once it is gone they really do pin nothing.
|
|
228
|
+
*
|
|
229
|
+
* Returns `[]` when no manifest is reachable: the report then falls back to the derived pins alone, which can
|
|
230
|
+
* only over-report a warning, never hide one.
|
|
231
|
+
*/
|
|
232
|
+
static readFrameworkWrittenOverrideKeys(frameworkAssetsRoot: string | null): string[];
|
|
213
233
|
/** Exposed for the scaffolder's exclusion seeding, which reads the framework's own list. */
|
|
214
234
|
static readFrameworkExclusions(frameworkPath: string): Record<string, string>;
|
|
215
235
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-dependency-alignment.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/application-dependency-alignment.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"application-dependency-alignment.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/application-dependency-alignment.service.ts"],"names":[],"mappings":"AAwDA,8FAA8F;AAC9F,eAAO,MAAM,0CAA0C,2CAA2C,CAAC;AAKnG,UAAU,eAAe;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC9D,oBAA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;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,qBAAqB,EAAE,MAAM,GAAG,MAAM,EAAE,CAiBpF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,SAAS,MAAM,EAAE,GAC1B;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,mBAAmB,EAAE,MAAM,EAAE,CAAA;CAAE,CA8BtD"}
|
|
@@ -43,6 +43,8 @@
|
|
|
43
43
|
import { existsSync, readdirSync, readFileSync, writeFileSync } from 'fs';
|
|
44
44
|
import { dirname, join, relative } from 'path';
|
|
45
45
|
import { migrateApplicationPnpmSettings, PNPM_OWNED_SETTINGS, PnpmSettingsSource, readApplicationPnpmSettings, WILDO_SAAS_LOCK_RELATIVE_PATH, writeApplicationPnpmSettings, } from '@wildo-ai/platform-config-lib';
|
|
46
|
+
import { FRAMEWORK_OVERRIDES_MANIFEST_RELATIVE } from '@wildo-ai/application-creation-runtime';
|
|
47
|
+
import { resolveInstalledFrameworkAssetsRoot } from '../../services/framework/installed-framework-assets.service.js';
|
|
46
48
|
/** Where an application declares the names its own toolchain owns. Seeded by `wildo init`. */
|
|
47
49
|
export const APPLICATION_DEPENDENCY_EXCLUSIONS_RELATIVE = '.wildo-saas/dependency-exclusions.json';
|
|
48
50
|
const FRAMEWORK_SCOPE_PREFIX = '@wildo-ai/';
|
|
@@ -181,7 +183,10 @@ export class ApplicationDependencyAlignmentService {
|
|
|
181
183
|
const reports = findDependencyOrphans({
|
|
182
184
|
appOverrides: settingsAfterWrite.overrides ?? {},
|
|
183
185
|
overridesRelativePath: settingsAfterWrite.sources.overrides,
|
|
184
|
-
authoredKeys: new Set(
|
|
186
|
+
authoredKeys: new Set([
|
|
187
|
+
...Object.keys(derivedOverrides),
|
|
188
|
+
...ApplicationDependencyAlignmentService.readFrameworkWrittenOverrideKeys(input.frameworkAssetsRoot === undefined ? resolveInstalledFrameworkAssetsRoot() : input.frameworkAssetsRoot),
|
|
189
|
+
]),
|
|
185
190
|
adoptedVendorPins: readAdoptedVendorPins(input.applicationRoot),
|
|
186
191
|
manifests: workspaceMembers.map((member) => ({ member, manifest: readJsonObject(join(input.applicationRoot, member, 'package.json')) })),
|
|
187
192
|
resolvedNames: readResolvedPackageNames(existsSync(lockPath) ? readFileSync(lockPath, 'utf8') : undefined),
|
|
@@ -498,9 +503,34 @@ export class ApplicationDependencyAlignmentService {
|
|
|
498
503
|
return null;
|
|
499
504
|
return JSON.parse(readFileSync(path, 'utf8'));
|
|
500
505
|
}
|
|
506
|
+
/**
|
|
507
|
+
* The override keys `wildo init` writes into every application (#3994): `propagatedOverrideKeys` and
|
|
508
|
+
* `additionalPropagatedOverrideKeys` of the alignment manifest that travels with the CLI.
|
|
509
|
+
*
|
|
510
|
+
* The orphan report needs them because derivation cannot see two kinds of pin the framework writes on purpose:
|
|
511
|
+
* a name NO framework manifest declares (`stripe`: the engine lazily `require`s the SDK, #239), and a peer of a
|
|
512
|
+
* framework package this application has not installed (`@mdx-js/react`, a peer of `saas-website`, in an
|
|
513
|
+
* application with no website). Both were reported as "no authority writes it — remove it", which told the
|
|
514
|
+
* operator to undo the framework's own pin. The manifest IS that authority. Opt-in package pins are not
|
|
515
|
+
* included: they are written only beside the package, so once it is gone they really do pin nothing.
|
|
516
|
+
*
|
|
517
|
+
* Returns `[]` when no manifest is reachable: the report then falls back to the derived pins alone, which can
|
|
518
|
+
* only over-report a warning, never hide one.
|
|
519
|
+
*/
|
|
520
|
+
static readFrameworkWrittenOverrideKeys(frameworkAssetsRoot) {
|
|
521
|
+
if (frameworkAssetsRoot === null)
|
|
522
|
+
return [];
|
|
523
|
+
const path = join(frameworkAssetsRoot, FRAMEWORK_OVERRIDES_MANIFEST_RELATIVE);
|
|
524
|
+
if (!existsSync(path))
|
|
525
|
+
return [];
|
|
526
|
+
const parsed = JSON.parse(readFileSync(path, 'utf8'));
|
|
527
|
+
return [parsed.propagatedOverrideKeys, parsed.additionalPropagatedOverrideKeys]
|
|
528
|
+
.flatMap((keys) => (Array.isArray(keys) ? keys : []))
|
|
529
|
+
.filter((key) => typeof key === 'string');
|
|
530
|
+
}
|
|
501
531
|
/** Exposed for the scaffolder's exclusion seeding, which reads the framework's own list. */
|
|
502
532
|
static readFrameworkExclusions(frameworkPath) {
|
|
503
|
-
const path = join(frameworkPath,
|
|
533
|
+
const path = join(frameworkPath, FRAMEWORK_OVERRIDES_MANIFEST_RELATIVE);
|
|
504
534
|
if (!existsSync(path))
|
|
505
535
|
return {};
|
|
506
536
|
const parsed = JSON.parse(readFileSync(path, 'utf8'));
|