quidproquo-cli 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/README.md +3 -0
  2. package/docker/cdk-deployer/Dockerfile +13 -0
  3. package/docker/dev-server/Dockerfile +48 -0
  4. package/lib/commonjs/bin/qpq.d.ts +2 -0
  5. package/lib/commonjs/bin/qpq.js +6 -0
  6. package/lib/commonjs/bin/qpq.js.map +1 -0
  7. package/lib/commonjs/bin/qpqCdkApp.d.ts +1 -0
  8. package/lib/commonjs/bin/qpqCdkApp.js +8 -0
  9. package/lib/commonjs/bin/qpqCdkApp.js.map +1 -0
  10. package/lib/commonjs/cli/index.d.ts +1 -0
  11. package/lib/commonjs/cli/index.js +18 -0
  12. package/lib/commonjs/cli/index.js.map +1 -0
  13. package/lib/commonjs/cli/runCli.d.ts +1 -0
  14. package/lib/commonjs/cli/runCli.js +80 -0
  15. package/lib/commonjs/cli/runCli.js.map +1 -0
  16. package/lib/commonjs/commands/go.d.ts +1 -0
  17. package/lib/commonjs/commands/go.js +28 -0
  18. package/lib/commonjs/commands/go.js.map +1 -0
  19. package/lib/commonjs/commands/goDev.d.ts +1 -0
  20. package/lib/commonjs/commands/goDev.js +143 -0
  21. package/lib/commonjs/commands/goDev.js.map +1 -0
  22. package/lib/commonjs/commands/goDevWeb.d.ts +1 -0
  23. package/lib/commonjs/commands/goDevWeb.js +122 -0
  24. package/lib/commonjs/commands/goDevWeb.js.map +1 -0
  25. package/lib/commonjs/commands/goDocker.d.ts +1 -0
  26. package/lib/commonjs/commands/goDocker.js +32 -0
  27. package/lib/commonjs/commands/goDocker.js.map +1 -0
  28. package/lib/commonjs/commands/hooks.d.ts +1 -0
  29. package/lib/commonjs/commands/hooks.js +26 -0
  30. package/lib/commonjs/commands/hooks.js.map +1 -0
  31. package/lib/commonjs/commands/prep.d.ts +1 -0
  32. package/lib/commonjs/commands/prep.js +28 -0
  33. package/lib/commonjs/commands/prep.js.map +1 -0
  34. package/lib/commonjs/commands/publish.d.ts +4 -0
  35. package/lib/commonjs/commands/publish.js +54 -0
  36. package/lib/commonjs/commands/publish.js.map +1 -0
  37. package/lib/commonjs/commands/synth.d.ts +1 -0
  38. package/lib/commonjs/commands/synth.js +79 -0
  39. package/lib/commonjs/commands/synth.js.map +1 -0
  40. package/lib/commonjs/commands/teardown.d.ts +1 -0
  41. package/lib/commonjs/commands/teardown.js +33 -0
  42. package/lib/commonjs/commands/teardown.js.map +1 -0
  43. package/lib/commonjs/index.d.ts +1 -0
  44. package/lib/commonjs/index.js +18 -0
  45. package/lib/commonjs/index.js.map +1 -0
  46. package/lib/commonjs/lib/args.d.ts +2 -0
  47. package/lib/commonjs/lib/args.js +21 -0
  48. package/lib/commonjs/lib/args.js.map +1 -0
  49. package/lib/commonjs/lib/deployEnv.d.ts +6 -0
  50. package/lib/commonjs/lib/deployEnv.js +76 -0
  51. package/lib/commonjs/lib/deployEnv.js.map +1 -0
  52. package/lib/commonjs/lib/deployPrompts.d.ts +25 -0
  53. package/lib/commonjs/lib/deployPrompts.js +83 -0
  54. package/lib/commonjs/lib/deployPrompts.js.map +1 -0
  55. package/lib/commonjs/lib/devServerEntry.d.ts +1 -0
  56. package/lib/commonjs/lib/devServerEntry.js +53 -0
  57. package/lib/commonjs/lib/devServerEntry.js.map +1 -0
  58. package/lib/commonjs/lib/discovery.d.ts +10 -0
  59. package/lib/commonjs/lib/discovery.js +56 -0
  60. package/lib/commonjs/lib/discovery.js.map +1 -0
  61. package/lib/commonjs/lib/hooks.d.ts +2 -0
  62. package/lib/commonjs/lib/hooks.js +45 -0
  63. package/lib/commonjs/lib/hooks.js.map +1 -0
  64. package/lib/commonjs/lib/packageRoot.d.ts +1 -0
  65. package/lib/commonjs/lib/packageRoot.js +21 -0
  66. package/lib/commonjs/lib/packageRoot.js.map +1 -0
  67. package/lib/commonjs/lib/prompts.d.ts +3 -0
  68. package/lib/commonjs/lib/prompts.js +64 -0
  69. package/lib/commonjs/lib/prompts.js.map +1 -0
  70. package/lib/commonjs/lib/qpqConfigs.d.ts +3 -0
  71. package/lib/commonjs/lib/qpqConfigs.js +19 -0
  72. package/lib/commonjs/lib/qpqConfigs.js.map +1 -0
  73. package/lib/commonjs/lib/resolveAppSelection.d.ts +6 -0
  74. package/lib/commonjs/lib/resolveAppSelection.js +58 -0
  75. package/lib/commonjs/lib/resolveAppSelection.js.map +1 -0
  76. package/lib/commonjs/lib/rspackRun.d.ts +2 -0
  77. package/lib/commonjs/lib/rspackRun.js +23 -0
  78. package/lib/commonjs/lib/rspackRun.js.map +1 -0
  79. package/lib/commonjs/lib/runCommand.d.ts +13 -0
  80. package/lib/commonjs/lib/runCommand.js +78 -0
  81. package/lib/commonjs/lib/runCommand.js.map +1 -0
  82. package/lib/commonjs/lib/runTasks.d.ts +10 -0
  83. package/lib/commonjs/lib/runTasks.js +42 -0
  84. package/lib/commonjs/lib/runTasks.js.map +1 -0
  85. package/lib/commonjs/lib/timing.d.ts +2 -0
  86. package/lib/commonjs/lib/timing.js +11 -0
  87. package/lib/commonjs/lib/timing.js.map +1 -0
  88. package/lib/commonjs/lib/views.d.ts +2 -0
  89. package/lib/commonjs/lib/views.js +32 -0
  90. package/lib/commonjs/lib/views.js.map +1 -0
  91. package/lib/commonjs/platforms/aws/awsCredentials.d.ts +1 -0
  92. package/lib/commonjs/platforms/aws/awsCredentials.js +28 -0
  93. package/lib/commonjs/platforms/aws/awsCredentials.js.map +1 -0
  94. package/lib/commonjs/platforms/aws/cdkApp.d.ts +2 -0
  95. package/lib/commonjs/platforms/aws/cdkApp.js +19 -0
  96. package/lib/commonjs/platforms/aws/cdkApp.js.map +1 -0
  97. package/lib/commonjs/platforms/aws/go.d.ts +2 -0
  98. package/lib/commonjs/platforms/aws/go.js +116 -0
  99. package/lib/commonjs/platforms/aws/go.js.map +1 -0
  100. package/lib/commonjs/platforms/aws/goDocker.d.ts +2 -0
  101. package/lib/commonjs/platforms/aws/goDocker.js +287 -0
  102. package/lib/commonjs/platforms/aws/goDocker.js.map +1 -0
  103. package/lib/commonjs/platforms/aws/identity.d.ts +2 -0
  104. package/lib/commonjs/platforms/aws/identity.js +26 -0
  105. package/lib/commonjs/platforms/aws/identity.js.map +1 -0
  106. package/lib/commonjs/platforms/aws/index.d.ts +2 -0
  107. package/lib/commonjs/platforms/aws/index.js +19 -0
  108. package/lib/commonjs/platforms/aws/index.js.map +1 -0
  109. package/lib/commonjs/platforms/aws/publish.d.ts +4 -0
  110. package/lib/commonjs/platforms/aws/publish.js +66 -0
  111. package/lib/commonjs/platforms/aws/publish.js.map +1 -0
  112. package/lib/commonjs/platforms/aws/remote.d.ts +11 -0
  113. package/lib/commonjs/platforms/aws/remote.js +106 -0
  114. package/lib/commonjs/platforms/aws/remote.js.map +1 -0
  115. package/lib/commonjs/platforms/aws/stacks.d.ts +7 -0
  116. package/lib/commonjs/platforms/aws/stacks.js +91 -0
  117. package/lib/commonjs/platforms/aws/stacks.js.map +1 -0
  118. package/lib/commonjs/platforms/aws/teardown.d.ts +2 -0
  119. package/lib/commonjs/platforms/aws/teardown.js +59 -0
  120. package/lib/commonjs/platforms/aws/teardown.js.map +1 -0
  121. package/lib/commonjs/platforms/aws/viewsSync.d.ts +2 -0
  122. package/lib/commonjs/platforms/aws/viewsSync.js +39 -0
  123. package/lib/commonjs/platforms/aws/viewsSync.js.map +1 -0
  124. package/lib/commonjs/platforms/docker/go.d.ts +2 -0
  125. package/lib/commonjs/platforms/docker/go.js +160 -0
  126. package/lib/commonjs/platforms/docker/go.js.map +1 -0
  127. package/lib/commonjs/platforms/docker/index.d.ts +2 -0
  128. package/lib/commonjs/platforms/docker/index.js +27 -0
  129. package/lib/commonjs/platforms/docker/index.js.map +1 -0
  130. package/lib/commonjs/platforms/index.d.ts +4 -0
  131. package/lib/commonjs/platforms/index.js +39 -0
  132. package/lib/commonjs/platforms/index.js.map +1 -0
  133. package/lib/commonjs/platforms/types.d.ts +16 -0
  134. package/lib/commonjs/platforms/types.js +9 -0
  135. package/lib/commonjs/platforms/types.js.map +1 -0
  136. package/lib/esm/bin/qpq.d.ts +2 -0
  137. package/lib/esm/bin/qpq.js +4 -0
  138. package/lib/esm/bin/qpq.js.map +1 -0
  139. package/lib/esm/bin/qpqCdkApp.d.ts +1 -0
  140. package/lib/esm/bin/qpqCdkApp.js +6 -0
  141. package/lib/esm/bin/qpqCdkApp.js.map +1 -0
  142. package/lib/esm/cli/index.d.ts +1 -0
  143. package/lib/esm/cli/index.js +2 -0
  144. package/lib/esm/cli/index.js.map +1 -0
  145. package/lib/esm/cli/runCli.d.ts +1 -0
  146. package/lib/esm/cli/runCli.js +67 -0
  147. package/lib/esm/cli/runCli.js.map +1 -0
  148. package/lib/esm/commands/go.d.ts +1 -0
  149. package/lib/esm/commands/go.js +15 -0
  150. package/lib/esm/commands/go.js.map +1 -0
  151. package/lib/esm/commands/goDev.d.ts +1 -0
  152. package/lib/esm/commands/goDev.js +127 -0
  153. package/lib/esm/commands/goDev.js.map +1 -0
  154. package/lib/esm/commands/goDevWeb.d.ts +1 -0
  155. package/lib/esm/commands/goDevWeb.js +107 -0
  156. package/lib/esm/commands/goDevWeb.js.map +1 -0
  157. package/lib/esm/commands/goDocker.d.ts +1 -0
  158. package/lib/esm/commands/goDocker.js +19 -0
  159. package/lib/esm/commands/goDocker.js.map +1 -0
  160. package/lib/esm/commands/hooks.d.ts +1 -0
  161. package/lib/esm/commands/hooks.js +13 -0
  162. package/lib/esm/commands/hooks.js.map +1 -0
  163. package/lib/esm/commands/prep.d.ts +1 -0
  164. package/lib/esm/commands/prep.js +15 -0
  165. package/lib/esm/commands/prep.js.map +1 -0
  166. package/lib/esm/commands/publish.d.ts +4 -0
  167. package/lib/esm/commands/publish.js +38 -0
  168. package/lib/esm/commands/publish.js.map +1 -0
  169. package/lib/esm/commands/synth.d.ts +1 -0
  170. package/lib/esm/commands/synth.js +63 -0
  171. package/lib/esm/commands/synth.js.map +1 -0
  172. package/lib/esm/commands/teardown.d.ts +1 -0
  173. package/lib/esm/commands/teardown.js +20 -0
  174. package/lib/esm/commands/teardown.js.map +1 -0
  175. package/lib/esm/index.d.ts +1 -0
  176. package/lib/esm/index.js +2 -0
  177. package/lib/esm/index.js.map +1 -0
  178. package/lib/esm/lib/args.d.ts +2 -0
  179. package/lib/esm/lib/args.js +16 -0
  180. package/lib/esm/lib/args.js.map +1 -0
  181. package/lib/esm/lib/deployEnv.d.ts +6 -0
  182. package/lib/esm/lib/deployEnv.js +60 -0
  183. package/lib/esm/lib/deployEnv.js.map +1 -0
  184. package/lib/esm/lib/deployPrompts.d.ts +25 -0
  185. package/lib/esm/lib/deployPrompts.js +69 -0
  186. package/lib/esm/lib/deployPrompts.js.map +1 -0
  187. package/lib/esm/lib/devServerEntry.d.ts +1 -0
  188. package/lib/esm/lib/devServerEntry.js +46 -0
  189. package/lib/esm/lib/devServerEntry.js.map +1 -0
  190. package/lib/esm/lib/discovery.d.ts +10 -0
  191. package/lib/esm/lib/discovery.js +40 -0
  192. package/lib/esm/lib/discovery.js.map +1 -0
  193. package/lib/esm/lib/hooks.d.ts +2 -0
  194. package/lib/esm/lib/hooks.js +27 -0
  195. package/lib/esm/lib/hooks.js.map +1 -0
  196. package/lib/esm/lib/packageRoot.d.ts +1 -0
  197. package/lib/esm/lib/packageRoot.js +14 -0
  198. package/lib/esm/lib/packageRoot.js.map +1 -0
  199. package/lib/esm/lib/prompts.d.ts +3 -0
  200. package/lib/esm/lib/prompts.js +16 -0
  201. package/lib/esm/lib/prompts.js.map +1 -0
  202. package/lib/esm/lib/qpqConfigs.d.ts +3 -0
  203. package/lib/esm/lib/qpqConfigs.js +14 -0
  204. package/lib/esm/lib/qpqConfigs.js.map +1 -0
  205. package/lib/esm/lib/resolveAppSelection.d.ts +6 -0
  206. package/lib/esm/lib/resolveAppSelection.js +45 -0
  207. package/lib/esm/lib/resolveAppSelection.js.map +1 -0
  208. package/lib/esm/lib/rspackRun.d.ts +2 -0
  209. package/lib/esm/lib/rspackRun.js +19 -0
  210. package/lib/esm/lib/rspackRun.js.map +1 -0
  211. package/lib/esm/lib/runCommand.d.ts +13 -0
  212. package/lib/esm/lib/runCommand.js +69 -0
  213. package/lib/esm/lib/runCommand.js.map +1 -0
  214. package/lib/esm/lib/runTasks.d.ts +10 -0
  215. package/lib/esm/lib/runTasks.js +28 -0
  216. package/lib/esm/lib/runTasks.js.map +1 -0
  217. package/lib/esm/lib/timing.d.ts +2 -0
  218. package/lib/esm/lib/timing.js +6 -0
  219. package/lib/esm/lib/timing.js.map +1 -0
  220. package/lib/esm/lib/views.d.ts +2 -0
  221. package/lib/esm/lib/views.js +15 -0
  222. package/lib/esm/lib/views.js.map +1 -0
  223. package/lib/esm/platforms/aws/awsCredentials.d.ts +1 -0
  224. package/lib/esm/platforms/aws/awsCredentials.js +15 -0
  225. package/lib/esm/platforms/aws/awsCredentials.js.map +1 -0
  226. package/lib/esm/platforms/aws/cdkApp.d.ts +2 -0
  227. package/lib/esm/platforms/aws/cdkApp.js +11 -0
  228. package/lib/esm/platforms/aws/cdkApp.js.map +1 -0
  229. package/lib/esm/platforms/aws/go.d.ts +2 -0
  230. package/lib/esm/platforms/aws/go.js +100 -0
  231. package/lib/esm/platforms/aws/go.js.map +1 -0
  232. package/lib/esm/platforms/aws/goDocker.d.ts +2 -0
  233. package/lib/esm/platforms/aws/goDocker.js +271 -0
  234. package/lib/esm/platforms/aws/goDocker.js.map +1 -0
  235. package/lib/esm/platforms/aws/identity.d.ts +2 -0
  236. package/lib/esm/platforms/aws/identity.js +22 -0
  237. package/lib/esm/platforms/aws/identity.js.map +1 -0
  238. package/lib/esm/platforms/aws/index.d.ts +2 -0
  239. package/lib/esm/platforms/aws/index.js +16 -0
  240. package/lib/esm/platforms/aws/index.js.map +1 -0
  241. package/lib/esm/platforms/aws/publish.d.ts +4 -0
  242. package/lib/esm/platforms/aws/publish.js +50 -0
  243. package/lib/esm/platforms/aws/publish.js.map +1 -0
  244. package/lib/esm/platforms/aws/remote.d.ts +11 -0
  245. package/lib/esm/platforms/aws/remote.js +90 -0
  246. package/lib/esm/platforms/aws/remote.js.map +1 -0
  247. package/lib/esm/platforms/aws/stacks.d.ts +7 -0
  248. package/lib/esm/platforms/aws/stacks.js +69 -0
  249. package/lib/esm/platforms/aws/stacks.js.map +1 -0
  250. package/lib/esm/platforms/aws/teardown.d.ts +2 -0
  251. package/lib/esm/platforms/aws/teardown.js +46 -0
  252. package/lib/esm/platforms/aws/teardown.js.map +1 -0
  253. package/lib/esm/platforms/aws/viewsSync.d.ts +2 -0
  254. package/lib/esm/platforms/aws/viewsSync.js +25 -0
  255. package/lib/esm/platforms/aws/viewsSync.js.map +1 -0
  256. package/lib/esm/platforms/docker/go.d.ts +2 -0
  257. package/lib/esm/platforms/docker/go.js +143 -0
  258. package/lib/esm/platforms/docker/go.js.map +1 -0
  259. package/lib/esm/platforms/docker/index.d.ts +2 -0
  260. package/lib/esm/platforms/docker/index.js +15 -0
  261. package/lib/esm/platforms/docker/index.js.map +1 -0
  262. package/lib/esm/platforms/index.d.ts +4 -0
  263. package/lib/esm/platforms/index.js +20 -0
  264. package/lib/esm/platforms/index.js.map +1 -0
  265. package/lib/esm/platforms/types.d.ts +16 -0
  266. package/lib/esm/platforms/types.js +6 -0
  267. package/lib/esm/platforms/types.js.map +1 -0
  268. package/package.json +63 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"goDocker.js","sourceRoot":"","sources":["../../../../src/platforms/aws/goDocker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yEAAyE;AACzE,+CAA+C;AAC/C,EAAE;AACF,6EAA6E;AAC7E,0EAA0E;AAC1E,2EAA2E;AAC3E,6EAA6E;AAC7E,6EAA6E;AAC7E,oEAAoE;AACpE,mEAAmE;AACnE,4EAA4E;AAC5E,6EAA6E;AAC7E,oBAAoB;AACpB,sEAAsE;AACtE,gDAAgD;AAChD,EAAE;AACF,yEAAyE;AACzE,4CAA4C;AAC5C,EAAE;AACF,qEAAqE;AACrE,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,SAAS,OAAO,EAAE;YACzB,GAAG,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,IAAA,4BAAe,GAAE,EAAE,OAAO,EAAE,OAAO,CAAC;SAChE,CAAC,CAAC,EACH,kBAAkB,CACnB,CACF,CAAC;QACF,IAAA,mBAAU,EAAC,WAAW,CAAC,CAAC;IAC1B,CAAC;IAED,IAAA,mBAAU,EAAC,WAAW,CAAC,CAAC;AAC1B,CAAC,CAAA,CAAC;AA5MW,QAAA,WAAW,eA4MtB","sourcesContent":["// `qpq go:docker` — asks the same questions as `qpq go`, then deploys in\n// parallel via docker instead of sequentially:\n//\n// 1. Build everything locally first: QPQ config synth, rspack API bundles,\n// rspack view bundles, and one self-contained CDK cloud assembly per\n// service (`cdk synth --output dist/qpq/cdk-docker/<app>/<service>`).\n// 2. Wave 1 (inf): one docker container per service deploys its inf stack,\n// all concurrently. Containers run only the CDK CLI against the mounted\n// pre-synthesized assembly — the workspace (and its npm-linked\n// quidproquo packages) never needs to exist inside the image.\n// 3. Wave 2 (api + web): once every inf stack is done, api and web stacks\n// for all services deploy concurrently (they depend only on inf, not on\n// each other).\n// 4. Views: the already-built bundles are synced to S3, one aws-cli\n// container per service, all concurrently.\n//\n// domain/bootstrap menu options deploy host-side exactly like `qpq go` —\n// a single stack gains nothing from docker.\n//\n// Requires the same env as `go` plus a running docker daemon. Knobs:\n// GO_DOCKER_BUILD_CONCURRENCY (default 4 — local builds are CPU-bound) and\n// GO_DOCKER_DEPLOY_CONCURRENCY (default unlimited — deploys just wait on\n// CloudFormation).\nimport { qpqDeployAwsCdkUtils } from 'quidproquo-deploy-awscdk';\nimport { getServiceRspackConfig } from 'quidproquo-deploy-rspack';\n\nimport fs from 'fs';\nimport path from 'path';\n\nimport { synthCommand } from '../../commands/synth';\nimport { DeployPlan } from '../../lib/deployPrompts';\nimport { getRoot, getServiceDirectory, getServiceNamesWithViews } from '../../lib/discovery';\nimport { runAppHook } from '../../lib/hooks';\nimport { loadServiceQpqConfig } from '../../lib/qpqConfigs';\nimport { runRspack } from '../../lib/rspackRun';\nimport { nextPrefixColor, runCommand, runCommandPrefixed } from '../../lib/runCommand';\nimport { assertNoFailures, runTasks } from '../../lib/runTasks';\nimport { logTimeEnd, logTimeStart } from '../../lib/timing';\nimport { bundleViews, getViewsDistDir } from '../../lib/views';\nimport { isAwsCredentialsValid } from './awsCredentials';\nimport { getCdkAppCommand, getDockerDir } from './cdkApp';\nimport { deployAccountStack, deployBootstrapStack, deployDomainStack } from './stacks';\nimport { getViewsS3Destinations } from './viewsSync';\n\nconst IMAGE_TAG = 'qpq-cdk-deployer';\nconst AWS_CLI_IMAGE = 'amazon/aws-cli';\n\nconst BUILD_CONCURRENCY = Number(process.env.GO_DOCKER_BUILD_CONCURRENCY) || 4;\nconst DEPLOY_CONCURRENCY = Number(process.env.GO_DOCKER_DEPLOY_CONCURRENCY) || Infinity;\n\n// Credentials/region reach the containers via `docker run -e NAME` (value\n// inherited from this process's env, never on the docker command line).\nconst AWS_ENV_PASSTHROUGH = [\n 'AWS_ACCESS_KEY_ID',\n 'AWS_SECRET_ACCESS_KEY',\n 'AWS_SESSION_TOKEN',\n 'AWS_REGION',\n 'AWS_DEFAULT_REGION',\n 'AWS_DEFAULT_ACCOUNT',\n];\n\nconst assemblyDir = (appName: string, serviceName: string): string => path.join(getRoot(), 'dist', 'qpq', 'cdk-docker', appName, serviceName);\n\nconst assertDockerRunning = async (): Promise<void> => {\n try {\n await runCommand('docker', ['info', '--format', '\"docker daemon ok — server {{.ServerVersion}}\"']);\n } catch {\n throw new Error('Docker daemon is not running (start Docker Desktop and retry).');\n }\n};\n\nconst buildDeployerImage = async (): Promise<void> => {\n // Pin the image's CDK CLI to the CLI's own aws-cdk version so it can always\n // read the assembly schema the host synthesized.\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const cdkVersion = require('aws-cdk/package.json').version as string;\n console.log(`Building deployer image [${IMAGE_TAG}] (aws-cdk ${cdkVersion})`);\n await runCommand('docker', ['build', '-t', IMAGE_TAG, '--build-arg', `CDK_VERSION=${cdkVersion}`, getDockerDir()]);\n};\n\n// Deploy one stack from a pre-synthesized assembly in a throwaway container\n// named <service>-<stackType> (e.g. mini-web) so `docker ps` reads cleanly.\n// The assembly mounts read-only and is copied container-local first — the CDK\n// CLI writes lock files next to the assembly it reads, and the copy keeps\n// parallel api/web deploys of the same service fully isolated.\nconst dockerDeployStack = (\n color: number,\n appName: string,\n serviceName: string,\n stackType: 'inf' | 'api' | 'web',\n stackName: string,\n): Promise<void> => {\n const containerName = `${serviceName}-${stackType}`;\n return runCommandPrefixed(\n `${stackType}:${serviceName}`,\n 'docker',\n [\n // A container left behind by an interrupted run would block reusing the\n // name — clear it quietly first.\n 'rm',\n '-f',\n containerName,\n '>/dev/null',\n '2>&1',\n ';',\n 'docker',\n 'run',\n '--rm',\n '--name',\n containerName,\n '-v',\n `\"${assemblyDir(appName, serviceName)}:/assembly:ro\"`,\n ...AWS_ENV_PASSTHROUGH.flatMap((name) => ['-e', name]),\n IMAGE_TAG,\n 'bash',\n '-c',\n `\"cp -r /assembly /work/assembly && cdk deploy ${stackName} --app /work/assembly --require-approval never --progress events\"`,\n ],\n { color },\n );\n};\n\n// Sync one service's pre-built views to S3 in a throwaway aws-cli container\n// named <service>-views. The official image's entrypoint is `aws`. Multiple\n// destinations (shell → website root + views prefix) run sequentially within\n// the service, reusing the container name.\nconst dockerSyncViews = async (color: number, appName: string, serviceName: string): Promise<void> => {\n const containerName = `${serviceName}-views`;\n for (const destination of getViewsS3Destinations(appName, serviceName)) {\n await runCommandPrefixed(\n `views:${serviceName}`,\n 'docker',\n [\n 'rm',\n '-f',\n containerName,\n '>/dev/null',\n '2>&1',\n ';',\n 'docker',\n 'run',\n '--rm',\n '--name',\n containerName,\n '-v',\n `\"${getViewsDistDir(appName, serviceName)}:/views:ro\"`,\n ...AWS_ENV_PASSTHROUGH.flatMap((name) => ['-e', name]),\n AWS_CLI_IMAGE,\n 's3',\n 'sync',\n '/views',\n destination,\n ],\n { color },\n );\n }\n};\n\nexport const awsGoDocker = async (appName: string, plan: DeployPlan): Promise<void> => {\n if (plan.kind === 'cancelled') {\n return;\n }\n\n if ((await isAwsCredentialsValid()) === false) {\n console.log('Credentials are expired or invalid.');\n return;\n }\n\n logTimeStart('totalTime');\n\n if (plan.kind === 'account') {\n await deployAccountStack(plan.appName);\n logTimeEnd('totalTime');\n return;\n }\n\n if (plan.kind === 'bootstrap') {\n if (plan.includeDomain) {\n await deployDomainStack(plan.appName);\n }\n await deployBootstrapStack(plan.appName);\n logTimeEnd('totalTime');\n return;\n }\n\n const { services, stacks } = plan;\n\n const allStacks = stacks === 'all';\n const needInf = allStacks || stacks === 'inf';\n const needApi = allStacks || stacks === 'api';\n const needWeb = allStacks || stacks === 'web';\n const needViews = allStacks || stacks === 'views';\n const needCdkDeploys = needInf || needApi || needWeb;\n\n const viewServices = needViews ? services.filter((s) => getServiceNamesWithViews(appName).includes(s)) : [];\n\n console.log('\\n\\nRunning dockerized deploy\\n\\n');\n console.log('Executing for services');\n console.log(services.join(', '));\n\n if (needCdkDeploys || viewServices.length > 0) {\n await assertDockerRunning();\n }\n if (needCdkDeploys) {\n await buildDeployerImage();\n }\n if (viewServices.length > 0) {\n // Pull up front so the views wave doesn't race N containers into pulling\n // the same image.\n await runCommand('docker', ['pull', AWS_CLI_IMAGE]);\n }\n\n // ---- Phase 1: build everything locally ----\n console.log('\\n=== Phase 1: local builds ===\\n');\n\n await runAppHook(appName, 'predeploy');\n\n // Workspace packages resolve through their built dist/ (package.json main),\n // so bundles would ship stale code unless every lib is tsc'd first. npm runs\n // the workspaces in topological order; tsc -b is incremental, so this is\n // seconds when nothing changed.\n console.log('Building workspace packages');\n await runCommand('npm', ['run', 'build', '--workspaces', '--if-present']);\n\n // Synth QPQ configs (shell's config resolves the view bucket names).\n // In-process (no subprocess per service) — it's just config loads + JSON writes.\n const qpqSynthServices = [...new Set([...services, ...(needViews ? ['shell'] : [])])];\n for (const service of qpqSynthServices) {\n await synthCommand([service, '--app', appName]);\n }\n\n if (stacks !== 'views') {\n assertNoFailures(\n 'API bundling',\n await runTasks(\n services.map((service) => ({\n label: `bundle-api:${service}`,\n run: async () => {\n console.log(`Bundling api: [${service}]`);\n const qpqConfig = loadServiceQpqConfig(appName, service);\n await runRspack(getServiceRspackConfig(qpqConfig, path.join(getServiceDirectory(appName, service), 'service')));\n },\n })),\n BUILD_CONCURRENCY,\n ),\n );\n }\n\n assertNoFailures(\n 'Views bundling',\n await runTasks(\n viewServices.map((service) => ({\n label: `bundle-views:${service}`,\n run: async () => {\n console.log(`Bundling views: [${service}]`);\n await bundleViews(appName, service);\n },\n })),\n BUILD_CONCURRENCY,\n ),\n );\n\n if (needCdkDeploys) {\n // One self-contained cloud assembly per service (all its stacks + staged\n // assets) — separate --output dirs so synths can run in parallel and\n // containers never share mutable state.\n assertNoFailures(\n 'CDK synth',\n await runTasks(\n services.map((service) => ({\n label: `cdk-synth:${service}`,\n run: async () => {\n const outputDir = assemblyDir(appName, service);\n fs.rmSync(outputDir, { recursive: true, force: true });\n await runCommandPrefixed(\n `cdk-synth:${service}`,\n 'npx',\n ['cdk', 'synth', '--all', '--quiet', '--app', `'${getCdkAppCommand()}'`, '--output', `\"${outputDir}\"`],\n {\n cwd: getRoot(),\n env: { DEPLOY_SERVICE_NAME: service, DEPLOY_APP_NAME: appName },\n color: nextPrefixColor(),\n },\n );\n },\n })),\n BUILD_CONCURRENCY,\n ),\n );\n }\n\n // Stack names come from each service's live config, resolved once up front.\n const stackNames = new Map(\n services.map((service) => {\n const qpqConfig = loadServiceQpqConfig(appName, service);\n return [\n service,\n {\n inf: qpqDeployAwsCdkUtils.getInfStackName(qpqConfig),\n api: qpqDeployAwsCdkUtils.getApiStackName(qpqConfig),\n web: qpqDeployAwsCdkUtils.getWebStackName(qpqConfig),\n },\n ];\n }),\n );\n\n // ---- Phase 2: inf stacks, one container per service, all concurrent ----\n if (needInf) {\n console.log('\\n=== Phase 2: deploy inf stacks (docker) ===\\n');\n logTimeStart('infWave');\n assertNoFailures(\n 'Inf deploy',\n await runTasks(\n services.map((service) => ({\n label: `inf:${service}`,\n run: () => dockerDeployStack(nextPrefixColor(), appName, service, 'inf', stackNames.get(service)!.inf),\n })),\n DEPLOY_CONCURRENCY,\n ),\n );\n logTimeEnd('infWave');\n }\n\n // ---- Phase 3: api + web stacks, all concurrent ----\n if (needApi || needWeb) {\n console.log('\\n=== Phase 3: deploy api + web stacks (docker) ===\\n');\n logTimeStart('apiWebWave');\n assertNoFailures(\n 'Api/Web deploy',\n await runTasks(\n (['api', 'web'] as const)\n .filter((stackType) => (stackType === 'api' ? needApi : needWeb))\n .flatMap((stackType) =>\n services.map((service) => ({\n label: `${stackType}:${service}`,\n run: () => dockerDeployStack(nextPrefixColor(), appName, service, stackType, stackNames.get(service)![stackType]),\n })),\n ),\n DEPLOY_CONCURRENCY,\n ),\n );\n logTimeEnd('apiWebWave');\n }\n\n // ---- Phase 4: sync the pre-built views to S3, all concurrent ----\n if (viewServices.length > 0) {\n console.log('\\n=== Phase 4: sync views to S3 (docker) ===\\n');\n logTimeStart('viewsWave');\n assertNoFailures(\n 'Views sync',\n await runTasks(\n viewServices.map((service) => ({\n label: `views:${service}`,\n run: () => dockerSyncViews(nextPrefixColor(), appName, service),\n })),\n DEPLOY_CONCURRENCY,\n ),\n );\n logTimeEnd('viewsWave');\n }\n\n logTimeEnd('totalTime');\n};\n"]}
@@ -0,0 +1,2 @@
1
+ import { QpqAppDeployEnvironment } from 'quidproquo-deploy-awscdk';
2
+ export declare const awsPrimeDeployIdentity: (target: QpqAppDeployEnvironment | undefined) => string[];
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.awsPrimeDeployIdentity = void 0;
4
+ // AWS deploy identity: service configs and the CDK app read
5
+ // AWS_DEFAULT_ACCOUNT / AWS_DEFAULT_REGION at load time, so they're primed
6
+ // into process.env from the environment's deploy.config.json entry. Already-set
7
+ // env vars win, so CI overrides and older setups keep working.
8
+ //
9
+ // Returns human-readable descriptions of anything still missing — deploys
10
+ // treat that as fatal, local dev commands ignore it.
11
+ const awsPrimeDeployIdentity = (target) => {
12
+ if ((target === null || target === void 0 ? void 0 : target.accountId) && !process.env.AWS_DEFAULT_ACCOUNT) {
13
+ process.env.AWS_DEFAULT_ACCOUNT = target.accountId;
14
+ }
15
+ if ((target === null || target === void 0 ? void 0 : target.region) && !process.env.AWS_DEFAULT_REGION) {
16
+ process.env.AWS_DEFAULT_REGION = target.region;
17
+ }
18
+ const missing = [];
19
+ if (!process.env.AWS_DEFAULT_ACCOUNT)
20
+ missing.push('"accountId" (or AWS_DEFAULT_ACCOUNT)');
21
+ if (!process.env.AWS_DEFAULT_REGION)
22
+ missing.push('"region" (or AWS_DEFAULT_REGION)');
23
+ return missing;
24
+ };
25
+ exports.awsPrimeDeployIdentity = awsPrimeDeployIdentity;
26
+ //# sourceMappingURL=identity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.js","sourceRoot":"","sources":["../../../../src/platforms/aws/identity.ts"],"names":[],"mappings":";;;AAEA,4DAA4D;AAC5D,2EAA2E;AAC3E,gFAAgF;AAChF,+DAA+D;AAC/D,EAAE;AACF,0EAA0E;AAC1E,qDAAqD;AAC9C,MAAM,sBAAsB,GAAG,CAAC,MAA2C,EAAY,EAAE;IAC9F,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,KAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,CAAC;QAC1D,OAAO,CAAC,GAAG,CAAC,mBAAmB,GAAG,MAAM,CAAC,SAAS,CAAC;IACrD,CAAC;IACD,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,KAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,CAAC;QACtD,OAAO,CAAC,GAAG,CAAC,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC;IACjD,CAAC;IAED,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB;QAAE,OAAO,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;IAC3F,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB;QAAE,OAAO,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;IACtF,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAZW,QAAA,sBAAsB,0BAYjC","sourcesContent":["import { QpqAppDeployEnvironment } from 'quidproquo-deploy-awscdk';\n\n// AWS deploy identity: service configs and the CDK app read\n// AWS_DEFAULT_ACCOUNT / AWS_DEFAULT_REGION at load time, so they're primed\n// into process.env from the environment's deploy.config.json entry. Already-set\n// env vars win, so CI overrides and older setups keep working.\n//\n// Returns human-readable descriptions of anything still missing — deploys\n// treat that as fatal, local dev commands ignore it.\nexport const awsPrimeDeployIdentity = (target: QpqAppDeployEnvironment | undefined): string[] => {\n if (target?.accountId && !process.env.AWS_DEFAULT_ACCOUNT) {\n process.env.AWS_DEFAULT_ACCOUNT = target.accountId;\n }\n if (target?.region && !process.env.AWS_DEFAULT_REGION) {\n process.env.AWS_DEFAULT_REGION = target.region;\n }\n\n const missing: string[] = [];\n if (!process.env.AWS_DEFAULT_ACCOUNT) missing.push('\"accountId\" (or AWS_DEFAULT_ACCOUNT)');\n if (!process.env.AWS_DEFAULT_REGION) missing.push('\"region\" (or AWS_DEFAULT_REGION)');\n return missing;\n};\n"]}
@@ -0,0 +1,2 @@
1
+ import { QpqPlatformDriver } from '../types';
2
+ export declare const awsPlatformDriver: QpqPlatformDriver;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.awsPlatformDriver = void 0;
4
+ const go_1 = require("./go");
5
+ const goDocker_1 = require("./goDocker");
6
+ const identity_1 = require("./identity");
7
+ const publish_1 = require("./publish");
8
+ const teardown_1 = require("./teardown");
9
+ exports.awsPlatformDriver = {
10
+ primeDeployIdentity: identity_1.awsPrimeDeployIdentity,
11
+ go: go_1.awsGo,
12
+ goDocker: goDocker_1.awsGoDocker,
13
+ teardown: teardown_1.awsTeardown,
14
+ publish: publish_1.awsPublish,
15
+ publishBuild: publish_1.awsPublishBuild,
16
+ publishUpload: publish_1.awsPublishUpload,
17
+ publishDeploy: publish_1.awsPublishDeploy,
18
+ };
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platforms/aws/index.ts"],"names":[],"mappings":";;;AACA,6BAA6B;AAC7B,yCAAyC;AACzC,yCAAoD;AACpD,uCAA4F;AAC5F,yCAAyC;AAE5B,QAAA,iBAAiB,GAAsB;IAClD,mBAAmB,EAAE,iCAAsB;IAE3C,EAAE,EAAE,UAAK;IACT,QAAQ,EAAE,sBAAW;IACrB,QAAQ,EAAE,sBAAW;IAErB,OAAO,EAAE,oBAAU;IACnB,YAAY,EAAE,yBAAe;IAC7B,aAAa,EAAE,0BAAgB;IAC/B,aAAa,EAAE,0BAAgB;CAChC,CAAC","sourcesContent":["import { QpqPlatformDriver } from '../types';\nimport { awsGo } from './go';\nimport { awsGoDocker } from './goDocker';\nimport { awsPrimeDeployIdentity } from './identity';\nimport { awsPublish, awsPublishBuild, awsPublishDeploy, awsPublishUpload } from './publish';\nimport { awsTeardown } from './teardown';\n\nexport const awsPlatformDriver: QpqPlatformDriver = {\n primeDeployIdentity: awsPrimeDeployIdentity,\n\n go: awsGo,\n goDocker: awsGoDocker,\n teardown: awsTeardown,\n\n publish: awsPublish,\n publishBuild: awsPublishBuild,\n publishUpload: awsPublishUpload,\n publishDeploy: awsPublishDeploy,\n};\n"]}
@@ -0,0 +1,4 @@
1
+ export declare const awsPublishBuild: (appName: string, serviceNames: string[]) => Promise<void>;
2
+ export declare const awsPublishUpload: (appName: string, serviceNames: string[]) => Promise<void>;
3
+ export declare const awsPublishDeploy: (appName: string, serviceNames: string[]) => Promise<void>;
4
+ export declare const awsPublish: (appName: string, serviceNames: string[]) => Promise<void>;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.awsPublish = exports.awsPublishDeploy = exports.awsPublishUpload = exports.awsPublishBuild = void 0;
13
+ // AWS federated remote publishing — build each backend service as a
14
+ // module-federation remote and publish it into that service's federated code
15
+ // bucket (see ./remote for the three-phase mechanics).
16
+ const awsCredentials_1 = require("./awsCredentials");
17
+ const remote_1 = require("./remote");
18
+ const requireAwsCredentials = () => __awaiter(void 0, void 0, void 0, function* () {
19
+ if (!(yield (0, awsCredentials_1.isAwsCredentialsValid)())) {
20
+ console.error('AWS credentials are not valid. Configure them and retry.');
21
+ process.exit(1);
22
+ }
23
+ });
24
+ const awsPublishBuild = (appName, serviceNames) => __awaiter(void 0, void 0, void 0, function* () {
25
+ console.log(`Building federated remotes for [${appName}]: ${serviceNames.join(', ')}`);
26
+ for (const serviceName of serviceNames) {
27
+ yield (0, remote_1.buildRemote)(appName, serviceName);
28
+ }
29
+ console.log('Done. Next: qpq publish:upload, then qpq publish:deploy.');
30
+ });
31
+ exports.awsPublishBuild = awsPublishBuild;
32
+ const awsPublishUpload = (appName, serviceNames) => __awaiter(void 0, void 0, void 0, function* () {
33
+ yield requireAwsCredentials();
34
+ // Resolve every target up front - a missing build fails the whole step
35
+ // before a single byte is uploaded.
36
+ const targets = serviceNames.map((serviceName) => (0, remote_1.resolvePublishTarget)(appName, serviceName));
37
+ console.log(`Uploading federated remotes for [${appName}]: ${serviceNames.join(', ')}`);
38
+ yield Promise.all(targets.map((target) => (0, remote_1.uploadRemoteVersion)(target)));
39
+ console.log('Done. Run qpq publish:deploy to flip lambdas to the new versions.');
40
+ });
41
+ exports.awsPublishUpload = awsPublishUpload;
42
+ const awsPublishDeploy = (appName, serviceNames) => __awaiter(void 0, void 0, void 0, function* () {
43
+ yield requireAwsCredentials();
44
+ const targets = serviceNames.map((serviceName) => (0, remote_1.resolvePublishTarget)(appName, serviceName));
45
+ console.log(`Deploying federated remote manifests for [${appName}]: ${serviceNames.join(', ')}`);
46
+ yield Promise.all(targets.map((target) => (0, remote_1.deployRemoteManifest)(target)));
47
+ console.log('Done. New lambda cold starts will federate these services from S3.');
48
+ });
49
+ exports.awsPublishDeploy = awsPublishDeploy;
50
+ const awsPublish = (appName, serviceNames) => __awaiter(void 0, void 0, void 0, function* () {
51
+ yield requireAwsCredentials();
52
+ console.log(`Publishing federated remotes for [${appName}]: ${serviceNames.join(', ')}`);
53
+ // 1. Build everything first - any build failure bails before any upload,
54
+ // so the buckets never end up with a half-published set of services.
55
+ for (const serviceName of serviceNames) {
56
+ yield (0, remote_1.buildRemote)(appName, serviceName);
57
+ }
58
+ const targets = serviceNames.map((serviceName) => (0, remote_1.resolvePublishTarget)(appName, serviceName));
59
+ // 2. Upload all version dirs in parallel - manifests untouched, nothing live yet.
60
+ yield Promise.all(targets.map((target) => (0, remote_1.uploadRemoteVersion)(target)));
61
+ // 3. Every version dir is fully uploaded - flip the manifests, in parallel.
62
+ yield Promise.all(targets.map((target) => (0, remote_1.deployRemoteManifest)(target)));
63
+ console.log('Done. New lambda cold starts will federate these services from S3.');
64
+ });
65
+ exports.awsPublish = awsPublish;
66
+ //# sourceMappingURL=publish.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publish.js","sourceRoot":"","sources":["../../../../src/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M,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAA,4BAAmB,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAExE,4EAA4E;IAC5E,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAA,6BAAoB,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAEzE,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;AACpF,CAAC,CAAA,CAAC;AAnBW,QAAA,UAAU,cAmBrB","sourcesContent":["// AWS federated remote publishing — build each backend service as a\n// module-federation remote and publish it into that service's federated code\n// bucket (see ./remote for the three-phase mechanics).\nimport { isAwsCredentialsValid } from './awsCredentials';\nimport { buildRemote, deployRemoteManifest, resolvePublishTarget, uploadRemoteVersion } from './remote';\n\nconst requireAwsCredentials = async (): Promise<void> => {\n if (!(await isAwsCredentialsValid())) {\n console.error('AWS credentials are not valid. Configure them and retry.');\n process.exit(1);\n }\n};\n\nexport const awsPublishBuild = async (appName: string, serviceNames: string[]): Promise<void> => {\n console.log(`Building federated remotes for [${appName}]: ${serviceNames.join(', ')}`);\n\n for (const serviceName of serviceNames) {\n await buildRemote(appName, serviceName);\n }\n\n console.log('Done. Next: qpq publish:upload, then qpq publish:deploy.');\n};\n\nexport const awsPublishUpload = async (appName: string, serviceNames: string[]): Promise<void> => {\n await requireAwsCredentials();\n\n // Resolve every target up front - a missing build fails the whole step\n // before a single byte is uploaded.\n const targets = serviceNames.map((serviceName) => resolvePublishTarget(appName, serviceName));\n\n console.log(`Uploading federated remotes for [${appName}]: ${serviceNames.join(', ')}`);\n await Promise.all(targets.map((target) => uploadRemoteVersion(target)));\n\n console.log('Done. Run qpq publish:deploy to flip lambdas to the new versions.');\n};\n\nexport const awsPublishDeploy = async (appName: string, serviceNames: string[]): Promise<void> => {\n await requireAwsCredentials();\n\n const targets = serviceNames.map((serviceName) => resolvePublishTarget(appName, serviceName));\n\n console.log(`Deploying federated remote manifests for [${appName}]: ${serviceNames.join(', ')}`);\n await Promise.all(targets.map((target) => deployRemoteManifest(target)));\n\n console.log('Done. New lambda cold starts will federate these services from S3.');\n};\n\nexport const awsPublish = async (appName: string, serviceNames: string[]): Promise<void> => {\n await requireAwsCredentials();\n\n console.log(`Publishing federated remotes for [${appName}]: ${serviceNames.join(', ')}`);\n\n // 1. Build everything first - any build failure bails before any upload,\n // so the buckets never end up with a half-published set of services.\n for (const serviceName of serviceNames) {\n await buildRemote(appName, serviceName);\n }\n const targets = serviceNames.map((serviceName) => resolvePublishTarget(appName, serviceName));\n\n // 2. Upload all version dirs in parallel - manifests untouched, nothing live yet.\n await Promise.all(targets.map((target) => uploadRemoteVersion(target)));\n\n // 3. Every version dir is fully uploaded - flip the manifests, in parallel.\n await Promise.all(targets.map((target) => deployRemoteManifest(target)));\n\n console.log('Done. New lambda cold starts will federate these services from S3.');\n};\n"]}
@@ -0,0 +1,11 @@
1
+ export type RemotePublishTarget = {
2
+ serviceName: string;
3
+ publishPath: string;
4
+ manifestHash: string;
5
+ bucketName: string;
6
+ servicePrefix: string;
7
+ };
8
+ export declare const buildRemote: (appName: string, serviceName: string) => Promise<void>;
9
+ export declare const resolvePublishTarget: (appName: string, serviceName: string) => RemotePublishTarget;
10
+ export declare const uploadRemoteVersion: (target: RemotePublishTarget) => Promise<void>;
11
+ export declare const deployRemoteManifest: (target: RemotePublishTarget) => Promise<void>;
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.deployRemoteManifest = exports.uploadRemoteVersion = exports.resolvePublishTarget = exports.buildRemote = void 0;
16
+ // Build a backend service as a module-federation remote and publish it into the
17
+ // shared federated-code storage drive, under the service's own prefix. After this
18
+ // runs, the already-deployed lambdas load their stories from the bucket (quidproquo's
19
+ // dynamicModuleLoader tries the federated store first, falls back to the bundled
20
+ // code when nothing's published).
21
+ //
22
+ // The store is one storage drive shared across services (via `owner`). Each service
23
+ // opts in with defineFederatedModuleStore(<driveName>) and its lambdas read from
24
+ // s3://<bucket>/<service>. Read access comes from the storage drive's own grants, so
25
+ // the drive + a deploy of each service must exist before publishing. The bucket name
26
+ // resolves from the same service config the deploy used, so it always matches.
27
+ //
28
+ // Publishing is split into three phases so they can run as separate commands
29
+ // (publish:build / publish:upload / publish:deploy) or chained by `qpq publish`:
30
+ // buildRemote - rspack the remote + lay out service-remote-published/
31
+ // uploadRemoteVersion - sync the hashed version dir (everything BUT manifest.json)
32
+ // deployRemoteManifest - upload manifest.json, atomically flipping lambdas over
33
+ // Version files always land before the manifest that references them, so a reading
34
+ // lambda never sees a manifest whose files aren't all present yet.
35
+ const quidproquo_actionprocessor_awslambda_1 = require("quidproquo-actionprocessor-awslambda");
36
+ const quidproquo_core_1 = require("quidproquo-core");
37
+ const quidproquo_deploy_rspack_1 = require("quidproquo-deploy-rspack");
38
+ const fs_1 = __importDefault(require("fs"));
39
+ const path_1 = __importDefault(require("path"));
40
+ const discovery_1 = require("../../lib/discovery");
41
+ const qpqConfigs_1 = require("../../lib/qpqConfigs");
42
+ const rspackRun_1 = require("../../lib/rspackRun");
43
+ const runCommand_1 = require("../../lib/runCommand");
44
+ const getPublishPath = (appName, serviceName) => path_1.default.join((0, discovery_1.getRoot)(), 'dist', 'apps', appName, 'services', serviceName, 'service-remote-published');
45
+ // Resolve the shared store bucket from the service's defineFederatedModuleStore
46
+ // setting (same derivation the lambda env var uses) and the per-service prefix
47
+ // so many services share one bucket.
48
+ const resolveRemoteStore = (appName, serviceName) => {
49
+ var _a;
50
+ const qpqConfig = (0, qpqConfigs_1.loadServiceQpqConfig)(appName, serviceName);
51
+ const federatedStore = quidproquo_core_1.qpqCoreUtils.getFederatedModuleStore(qpqConfig);
52
+ if (!federatedStore) {
53
+ throw new Error(`service [${serviceName}] has no defineFederatedModuleStore(...) - add it (and the matching storage drive) to opt into federation`);
54
+ }
55
+ const storageDrive = quidproquo_core_1.qpqCoreUtils.getStorageDriveByName(federatedStore.storageDrive, qpqConfig);
56
+ if (!storageDrive) {
57
+ throw new Error(`defineFederatedModuleStore references storage drive [${federatedStore.storageDrive}] which service [${serviceName}] does not declare`);
58
+ }
59
+ const bucketName = quidproquo_actionprocessor_awslambda_1.awsNamingUtils.resolveConfigRuntimeResourceNameFromConfig(((_a = storageDrive.owner) === null || _a === void 0 ? void 0 : _a.resourceNameOverride) || storageDrive.storageDrive, qpqConfig, storageDrive.owner);
60
+ const servicePrefix = quidproquo_core_1.qpqCoreUtils.getApplicationModuleName(qpqConfig);
61
+ return { bucketName, servicePrefix };
62
+ };
63
+ // Phase 1: rspack the federated remote container and lay out the publishable
64
+ // version dir + manifest.json under service-remote-published/. Validates the
65
+ // federation config up front so a misconfigured service fails before the build.
66
+ const buildRemote = (appName, serviceName) => __awaiter(void 0, void 0, void 0, function* () {
67
+ resolveRemoteStore(appName, serviceName);
68
+ const serviceDir = path_1.default.join((0, discovery_1.getServiceDirectory)(appName, serviceName), 'service');
69
+ const qpqConfig = (0, qpqConfigs_1.loadServiceQpqConfig)(appName, serviceName);
70
+ console.log(`Building federated remote: [${serviceName}]`);
71
+ const config = (0, quidproquo_deploy_rspack_1.getServiceRemoteRspackConfig)(qpqConfig, serviceDir);
72
+ yield (0, rspackRun_1.runRspack)(config);
73
+ const remoteBuildPath = config.output.path;
74
+ (0, quidproquo_deploy_rspack_1.publishFederatedRemote)(qpqConfig, remoteBuildPath, getPublishPath(appName, serviceName));
75
+ });
76
+ exports.buildRemote = buildRemote;
77
+ // Resolve a publish target from a prior buildRemote's on-disk output.
78
+ const resolvePublishTarget = (appName, serviceName) => {
79
+ const publishPath = getPublishPath(appName, serviceName);
80
+ const manifestPath = path_1.default.join(publishPath, 'manifest.json');
81
+ if (!fs_1.default.existsSync(manifestPath)) {
82
+ throw new Error(`no built remote found for [${serviceName}] (missing ${manifestPath}) - run \`qpq publish:build --app ${appName}\` first`);
83
+ }
84
+ const manifest = JSON.parse(fs_1.default.readFileSync(manifestPath, 'utf-8'));
85
+ return Object.assign({ serviceName,
86
+ publishPath, manifestHash: manifest.hash }, resolveRemoteStore(appName, serviceName));
87
+ };
88
+ exports.resolvePublishTarget = resolvePublishTarget;
89
+ // Phase 2: upload the hashed version dir - everything EXCEPT manifest.json, so
90
+ // nothing referenced by a live manifest changes. Safe to run concurrently across
91
+ // services - each writes only under its own prefix.
92
+ const uploadRemoteVersion = (target) => __awaiter(void 0, void 0, void 0, function* () {
93
+ const { serviceName, publishPath, manifestHash, bucketName, servicePrefix } = target;
94
+ console.log(`Uploading [${serviceName}] version [${manifestHash}] to [s3://${bucketName}/${servicePrefix}/${manifestHash}]`);
95
+ yield (0, runCommand_1.runCommand)('aws', ['s3', 'sync', path_1.default.join(publishPath, manifestHash), `s3://${bucketName}/${servicePrefix}/${manifestHash}`]);
96
+ });
97
+ exports.uploadRemoteVersion = uploadRemoteVersion;
98
+ // Phase 3: upload manifest.json, the pointer lambdas read - this is the moment
99
+ // the new version goes live. Only run once the version dir is fully uploaded.
100
+ const deployRemoteManifest = (target) => __awaiter(void 0, void 0, void 0, function* () {
101
+ const { serviceName, publishPath, manifestHash, bucketName, servicePrefix } = target;
102
+ console.log(`Deploying [${serviceName}] manifest for version [${manifestHash}] to [s3://${bucketName}/${servicePrefix}/manifest.json]`);
103
+ yield (0, runCommand_1.runCommand)('aws', ['s3', 'cp', path_1.default.join(publishPath, 'manifest.json'), `s3://${bucketName}/${servicePrefix}/manifest.json`]);
104
+ });
105
+ exports.deployRemoteManifest = deployRemoteManifest;
106
+ //# sourceMappingURL=remote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote.js","sourceRoot":"","sources":["../../../../src/platforms/aws/remote.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gFAAgF;AAChF,kFAAkF;AAClF,sFAAsF;AACtF,iFAAiF;AACjF,kCAAkC;AAClC,EAAE;AACF,oFAAoF;AACpF,iFAAiF;AACjF,qFAAqF;AACrF,qFAAqF;AACrF,+EAA+E;AAC/E,EAAE;AACF,6EAA6E;AAC7E,iFAAiF;AACjF,iFAAiF;AACjF,sFAAsF;AACtF,kFAAkF;AAClF,mFAAmF;AACnF,mEAAmE;AACnE,+FAAsE;AACtE,qDAA+C;AAC/C,uEAAgG;AAEhG,4CAAoB;AACpB,gDAAwB;AAExB,mDAAmE;AACnE,qDAA4D;AAC5D,mDAAgD;AAChD,qDAAkD;AAalD,MAAM,cAAc,GAAG,CAAC,OAAe,EAAE,WAAmB,EAAU,EAAE,CACtE,cAAI,CAAC,IAAI,CAAC,IAAA,mBAAO,GAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,0BAA0B,CAAC,CAAC;AAErG,gFAAgF;AAChF,+EAA+E;AAC/E,qCAAqC;AACrC,MAAM,kBAAkB,GAAG,CAAC,OAAe,EAAE,WAAmB,EAAiD,EAAE;;IACjH,MAAM,SAAS,GAAG,IAAA,iCAAoB,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAE7D,MAAM,cAAc,GAAG,8BAAY,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;IACvE,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,YAAY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EAAE,CAAC,CAAC,CAAC;AACvI,CAAC,CAAA,CAAC;AALW,QAAA,mBAAmB,uBAK9B;AAEF,+EAA+E;AAC/E,8EAA8E;AACvE,MAAM,oBAAoB,GAAG,CAAO,MAA2B,EAAiB,EAAE;IACvF,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC;IAErF,OAAO,CAAC,GAAG,CAAC,cAAc,WAAW,2BAA2B,YAAY,cAAc,UAAU,IAAI,aAAa,iBAAiB,CAAC,CAAC;IACxI,MAAM,IAAA,uBAAU,EAAC,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,EAAE,QAAQ,UAAU,IAAI,aAAa,gBAAgB,CAAC,CAAC,CAAC;AACtI,CAAC,CAAA,CAAC;AALW,QAAA,oBAAoB,wBAK/B","sourcesContent":["// Build a backend service as a module-federation remote and publish it into the\n// shared federated-code storage drive, under the service's own prefix. After this\n// runs, the already-deployed lambdas load their stories from the bucket (quidproquo's\n// dynamicModuleLoader tries the federated store first, falls back to the bundled\n// code when nothing's published).\n//\n// The store is one storage drive shared across services (via `owner`). Each service\n// opts in with defineFederatedModuleStore(<driveName>) and its lambdas read from\n// s3://<bucket>/<service>. Read access comes from the storage drive's own grants, so\n// the drive + a deploy of each service must exist before publishing. The bucket name\n// resolves from the same service config the deploy used, so it always matches.\n//\n// Publishing is split into three phases so they can run as separate commands\n// (publish:build / publish:upload / publish:deploy) or chained by `qpq publish`:\n// buildRemote - rspack the remote + lay out service-remote-published/\n// uploadRemoteVersion - sync the hashed version dir (everything BUT manifest.json)\n// deployRemoteManifest - upload manifest.json, atomically flipping lambdas over\n// Version files always land before the manifest that references them, so a reading\n// lambda never sees a manifest whose files aren't all present yet.\nimport { awsNamingUtils } from 'quidproquo-actionprocessor-awslambda';\nimport { qpqCoreUtils } from 'quidproquo-core';\nimport { getServiceRemoteRspackConfig, publishFederatedRemote } from 'quidproquo-deploy-rspack';\n\nimport fs from 'fs';\nimport path from 'path';\n\nimport { getRoot, getServiceDirectory } from '../../lib/discovery';\nimport { loadServiceQpqConfig } from '../../lib/qpqConfigs';\nimport { runRspack } from '../../lib/rspackRun';\nimport { runCommand } from '../../lib/runCommand';\n\n// Everything the upload/deploy phases need to publish a built remote. Resolved\n// from the on-disk build output + service config, so each phase can run in its\n// own process without handing state between commands.\nexport type RemotePublishTarget = {\n serviceName: string;\n publishPath: string;\n manifestHash: string;\n bucketName: string;\n servicePrefix: string;\n};\n\nconst getPublishPath = (appName: string, serviceName: string): string =>\n path.join(getRoot(), 'dist', 'apps', appName, 'services', serviceName, 'service-remote-published');\n\n// Resolve the shared store bucket from the service's defineFederatedModuleStore\n// setting (same derivation the lambda env var uses) and the per-service prefix\n// so many services share one bucket.\nconst resolveRemoteStore = (appName: string, serviceName: string): { bucketName: string; servicePrefix: string } => {\n const qpqConfig = loadServiceQpqConfig(appName, serviceName);\n\n const federatedStore = qpqCoreUtils.getFederatedModuleStore(qpqConfig);\n if (!federatedStore) {\n throw new Error(\n `service [${serviceName}] has no defineFederatedModuleStore(...) - add it (and the matching storage drive) to opt into federation`,\n );\n }\n const storageDrive = qpqCoreUtils.getStorageDriveByName(federatedStore.storageDrive, qpqConfig);\n if (!storageDrive) {\n throw new Error(\n `defineFederatedModuleStore references storage drive [${federatedStore.storageDrive}] which service [${serviceName}] does not declare`,\n );\n }\n const bucketName = awsNamingUtils.resolveConfigRuntimeResourceNameFromConfig(\n storageDrive.owner?.resourceNameOverride || storageDrive.storageDrive,\n qpqConfig,\n storageDrive.owner,\n );\n const servicePrefix = qpqCoreUtils.getApplicationModuleName(qpqConfig);\n\n return { bucketName, servicePrefix };\n};\n\n// Phase 1: rspack the federated remote container and lay out the publishable\n// version dir + manifest.json under service-remote-published/. Validates the\n// federation config up front so a misconfigured service fails before the build.\nexport const buildRemote = async (appName: string, serviceName: string): Promise<void> => {\n resolveRemoteStore(appName, serviceName);\n\n const serviceDir = path.join(getServiceDirectory(appName, serviceName), 'service');\n const qpqConfig = loadServiceQpqConfig(appName, serviceName);\n\n console.log(`Building federated remote: [${serviceName}]`);\n const config = getServiceRemoteRspackConfig(qpqConfig, serviceDir);\n await runRspack(config);\n\n const remoteBuildPath = config.output!.path as string;\n publishFederatedRemote(qpqConfig, remoteBuildPath, getPublishPath(appName, serviceName));\n};\n\n// Resolve a publish target from a prior buildRemote's on-disk output.\nexport const resolvePublishTarget = (appName: string, serviceName: string): RemotePublishTarget => {\n const publishPath = getPublishPath(appName, serviceName);\n const manifestPath = path.join(publishPath, 'manifest.json');\n\n if (!fs.existsSync(manifestPath)) {\n throw new Error(`no built remote found for [${serviceName}] (missing ${manifestPath}) - run \\`qpq publish:build --app ${appName}\\` first`);\n }\n const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf-8')) as {\n hash: string;\n };\n\n return {\n serviceName,\n publishPath,\n manifestHash: manifest.hash,\n ...resolveRemoteStore(appName, serviceName),\n };\n};\n\n// Phase 2: upload the hashed version dir - everything EXCEPT manifest.json, so\n// nothing referenced by a live manifest changes. Safe to run concurrently across\n// services - each writes only under its own prefix.\nexport const uploadRemoteVersion = async (target: RemotePublishTarget): Promise<void> => {\n const { serviceName, publishPath, manifestHash, bucketName, servicePrefix } = target;\n\n console.log(`Uploading [${serviceName}] version [${manifestHash}] to [s3://${bucketName}/${servicePrefix}/${manifestHash}]`);\n await runCommand('aws', ['s3', 'sync', path.join(publishPath, manifestHash), `s3://${bucketName}/${servicePrefix}/${manifestHash}`]);\n};\n\n// Phase 3: upload manifest.json, the pointer lambdas read - this is the moment\n// the new version goes live. Only run once the version dir is fully uploaded.\nexport const deployRemoteManifest = async (target: RemotePublishTarget): Promise<void> => {\n const { serviceName, publishPath, manifestHash, bucketName, servicePrefix } = target;\n\n console.log(`Deploying [${serviceName}] manifest for version [${manifestHash}] to [s3://${bucketName}/${servicePrefix}/manifest.json]`);\n await runCommand('aws', ['s3', 'cp', path.join(publishPath, 'manifest.json'), `s3://${bucketName}/${servicePrefix}/manifest.json`]);\n};\n"]}
@@ -0,0 +1,7 @@
1
+ export declare const deployStack: (stackName: string, env?: Record<string, string>) => Promise<void>;
2
+ export declare const deployServiceStack: (serviceName: string, stackName: string, appName: string) => Promise<void>;
3
+ export declare const destroyStack: (stackName: string, env?: Record<string, string>) => Promise<void>;
4
+ export declare const destroyServiceStack: (serviceName: string, stackName: string, appName: string) => Promise<void>;
5
+ export declare const deployDomainStack: (appName: string) => Promise<void>;
6
+ export declare const deployAccountStack: (appName: string) => Promise<void>;
7
+ export declare const deployBootstrapStack: (appName: string) => Promise<void>;
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.deployBootstrapStack = exports.deployAccountStack = exports.deployDomainStack = exports.destroyServiceStack = exports.destroyStack = exports.deployServiceStack = exports.deployStack = void 0;
16
+ // Host-side `cdk deploy` helpers. No cdk.json anywhere: the CDK app command is
17
+ // passed via --app and runs quidproquo-deploy-awscdk's generic workspace app
18
+ // (bin/qpq-cdk-app.js) under ts-node hooks, with DEPLOY_* in the env.
19
+ const quidproquo_deploy_awscdk_1 = require("quidproquo-deploy-awscdk");
20
+ const path_1 = __importDefault(require("path"));
21
+ const discovery_1 = require("../../lib/discovery");
22
+ const qpqConfigs_1 = require("../../lib/qpqConfigs");
23
+ const runCommand_1 = require("../../lib/runCommand");
24
+ const timing_1 = require("../../lib/timing");
25
+ const cdkApp_1 = require("./cdkApp");
26
+ const deployStack = (stackName_1, ...args_1) => __awaiter(void 0, [stackName_1, ...args_1], void 0, function* (stackName, env = {}) {
27
+ (0, timing_1.logTimeStart)(stackName);
28
+ yield (0, runCommand_1.runCommand)('npx', ['cdk', 'deploy', stackName, '--require-approval', 'never', '--app', `'${(0, cdkApp_1.getCdkAppCommand)()}'`, '--output', path_1.default.join('dist', 'qpq', 'cdk.out')], {
29
+ cwd: (0, discovery_1.getRoot)(),
30
+ env,
31
+ });
32
+ (0, timing_1.logTimeEnd)(stackName);
33
+ });
34
+ exports.deployStack = deployStack;
35
+ const deployServiceStack = (serviceName, stackName, appName) => (0, exports.deployStack)(stackName, {
36
+ DEPLOY_SERVICE_NAME: serviceName,
37
+ DEPLOY_APP_NAME: appName,
38
+ });
39
+ exports.deployServiceStack = deployServiceStack;
40
+ // `cdk destroy` still synths the app to find the stack, so it runs the same
41
+ // generic workspace app with the same DEPLOY_* env as deploys — meaning the
42
+ // service bundles under dist/ must exist for asset resolution to succeed.
43
+ const destroyStack = (stackName_1, ...args_1) => __awaiter(void 0, [stackName_1, ...args_1], void 0, function* (stackName, env = {}) {
44
+ (0, timing_1.logTimeStart)(stackName);
45
+ yield (0, runCommand_1.runCommand)('npx', ['cdk', 'destroy', stackName, '--force', '--app', `'${(0, cdkApp_1.getCdkAppCommand)()}'`, '--output', path_1.default.join('dist', 'qpq', 'cdk.out')], {
46
+ cwd: (0, discovery_1.getRoot)(),
47
+ env,
48
+ });
49
+ (0, timing_1.logTimeEnd)(stackName);
50
+ });
51
+ exports.destroyStack = destroyStack;
52
+ const destroyServiceStack = (serviceName, stackName, appName) => (0, exports.destroyStack)(stackName, {
53
+ DEPLOY_SERVICE_NAME: serviceName,
54
+ DEPLOY_APP_NAME: appName,
55
+ });
56
+ exports.destroyServiceStack = destroyServiceStack;
57
+ const deployDomainStack = (appName) => __awaiter(void 0, void 0, void 0, function* () {
58
+ const qpqConfig = (0, qpqConfigs_1.loadServiceQpqConfig)(appName, (0, discovery_1.getServiceNames)(appName)[0]);
59
+ const stackName = quidproquo_deploy_awscdk_1.qpqDeployAwsCdkUtils.getDomainStackName(qpqConfig);
60
+ console.log('Deploy Domain: ', stackName);
61
+ yield (0, exports.deployStack)(stackName, {
62
+ DEPLOY_SERVICE_NAME: '',
63
+ DEPLOY_APP_NAME: appName,
64
+ });
65
+ });
66
+ exports.deployDomainStack = deployDomainStack;
67
+ // Account-level guardrails stack - statically named (one per AWS account,
68
+ // app-agnostic), so no config load is needed to know the name. Callers decide
69
+ // whether an actor deploy should include it (bootstrap skips it; the explicit
70
+ // 'account' menu option always deploys).
71
+ const deployAccountStack = (appName) => __awaiter(void 0, void 0, void 0, function* () {
72
+ const stackName = quidproquo_deploy_awscdk_1.qpqDeployAwsCdkUtils.getAccountStackName();
73
+ console.log('Deploy Account: ', stackName);
74
+ yield (0, exports.deployStack)(stackName, {
75
+ DEPLOY_SERVICE_NAME: '',
76
+ DEPLOY_APP_NAME: appName,
77
+ });
78
+ });
79
+ exports.deployAccountStack = deployAccountStack;
80
+ const deployBootstrapStack = (appName) => __awaiter(void 0, void 0, void 0, function* () {
81
+ const appPrefix = (0, qpqConfigs_1.getAppPrefix)(appName);
82
+ const stackName = process.env.ACTOR_NAME
83
+ ? `${appPrefix}-${process.env.ENVIRONMENT}-${process.env.ACTOR_NAME}-bs`
84
+ : `${appPrefix}-${process.env.ENVIRONMENT}-bs`;
85
+ yield (0, exports.deployStack)(stackName, {
86
+ DEPLOY_SERVICE_NAME: '',
87
+ DEPLOY_APP_NAME: appName,
88
+ });
89
+ });
90
+ exports.deployBootstrapStack = deployBootstrapStack;
91
+ //# sourceMappingURL=stacks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stacks.js","sourceRoot":"","sources":["../../../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AmB,EAAE,EAAE;QACvB,eAAe,EAAE,OAAO;KACzB,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAPW,QAAA,kBAAkB,sBAO7B;AAEK,MAAM,oBAAoB,GAAG,CAAO,OAAe,EAAiB,EAAE;IAC3E,MAAM,SAAS,GAAG,IAAA,yBAAY,EAAC,OAAO,CAAC,CAAC;IACxC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU;QACtC,CAAC,CAAC,GAAG,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,KAAK;QACxE,CAAC,CAAC,GAAG,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,CAAC;IACjD,MAAM,IAAA,mBAAW,EAAC,SAAS,EAAE;QAC3B,mBAAmB,EAAE,EAAE;QACvB,eAAe,EAAE,OAAO;KACzB,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AATW,QAAA,oBAAoB,wBAS/B","sourcesContent":["// Host-side `cdk deploy` helpers. No cdk.json anywhere: the CDK app command is\n// passed via --app and runs quidproquo-deploy-awscdk's generic workspace app\n// (bin/qpq-cdk-app.js) under ts-node hooks, with DEPLOY_* in the env.\nimport { qpqDeployAwsCdkUtils } from 'quidproquo-deploy-awscdk';\n\nimport path from 'path';\n\nimport { getRoot, getServiceNames } from '../../lib/discovery';\nimport { getAppPrefix, loadServiceQpqConfig } from '../../lib/qpqConfigs';\nimport { runCommand } from '../../lib/runCommand';\nimport { logTimeEnd, logTimeStart } from '../../lib/timing';\nimport { getCdkAppCommand } from './cdkApp';\n\nexport const deployStack = async (stackName: string, env: Record<string, string> = {}): Promise<void> => {\n logTimeStart(stackName);\n await runCommand(\n 'npx',\n ['cdk', 'deploy', stackName, '--require-approval', 'never', '--app', `'${getCdkAppCommand()}'`, '--output', path.join('dist', 'qpq', 'cdk.out')],\n {\n cwd: getRoot(),\n env,\n },\n );\n logTimeEnd(stackName);\n};\n\nexport const deployServiceStack = (serviceName: string, stackName: string, appName: string): Promise<void> =>\n deployStack(stackName, {\n DEPLOY_SERVICE_NAME: serviceName,\n DEPLOY_APP_NAME: appName,\n });\n\n// `cdk destroy` still synths the app to find the stack, so it runs the same\n// generic workspace app with the same DEPLOY_* env as deploys — meaning the\n// service bundles under dist/ must exist for asset resolution to succeed.\nexport const destroyStack = async (stackName: string, env: Record<string, string> = {}): Promise<void> => {\n logTimeStart(stackName);\n await runCommand(\n 'npx',\n ['cdk', 'destroy', stackName, '--force', '--app', `'${getCdkAppCommand()}'`, '--output', path.join('dist', 'qpq', 'cdk.out')],\n {\n cwd: getRoot(),\n env,\n },\n );\n logTimeEnd(stackName);\n};\n\nexport const destroyServiceStack = (serviceName: string, stackName: string, appName: string): Promise<void> =>\n destroyStack(stackName, {\n DEPLOY_SERVICE_NAME: serviceName,\n DEPLOY_APP_NAME: appName,\n });\n\nexport const deployDomainStack = async (appName: string): Promise<void> => {\n const qpqConfig = loadServiceQpqConfig(appName, getServiceNames(appName)[0]);\n const stackName = qpqDeployAwsCdkUtils.getDomainStackName(qpqConfig);\n console.log('Deploy Domain: ', stackName);\n await deployStack(stackName, {\n DEPLOY_SERVICE_NAME: '',\n DEPLOY_APP_NAME: appName,\n });\n};\n\n// Account-level guardrails stack - statically named (one per AWS account,\n// app-agnostic), so no config load is needed to know the name. Callers decide\n// whether an actor deploy should include it (bootstrap skips it; the explicit\n// 'account' menu option always deploys).\nexport const deployAccountStack = async (appName: string): Promise<void> => {\n const stackName = qpqDeployAwsCdkUtils.getAccountStackName();\n console.log('Deploy Account: ', stackName);\n await deployStack(stackName, {\n DEPLOY_SERVICE_NAME: '',\n DEPLOY_APP_NAME: appName,\n });\n};\n\nexport const deployBootstrapStack = async (appName: string): Promise<void> => {\n const appPrefix = getAppPrefix(appName);\n const stackName = process.env.ACTOR_NAME\n ? `${appPrefix}-${process.env.ENVIRONMENT}-${process.env.ACTOR_NAME}-bs`\n : `${appPrefix}-${process.env.ENVIRONMENT}-bs`;\n await deployStack(stackName, {\n DEPLOY_SERVICE_NAME: '',\n DEPLOY_APP_NAME: appName,\n });\n};\n"]}
@@ -0,0 +1,2 @@
1
+ import { TeardownPlan } from '../../lib/deployPrompts';
2
+ export declare const awsTeardown: (appName: string, plan: TeardownPlan) => Promise<void>;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.awsTeardown = void 0;
13
+ // AWS sequential teardown (`qpq teardown`) — the stack phases of `qpq go` in
14
+ // reverse. Per phase it destroys every selected service's web, then api, then
15
+ // inf CDK stacks. Phases don't cross-reference each other's CFN outputs
16
+ // (values flow through SSM), so this order is prudence, not a hard dependency.
17
+ // Bootstrap, domain and account stacks are deliberately out of scope — they
18
+ // outlive any one service and are torn down by hand if ever.
19
+ const quidproquo_deploy_awscdk_1 = require("quidproquo-deploy-awscdk");
20
+ const synth_1 = require("../../commands/synth");
21
+ const qpqConfigs_1 = require("../../lib/qpqConfigs");
22
+ const timing_1 = require("../../lib/timing");
23
+ const awsCredentials_1 = require("./awsCredentials");
24
+ const stacks_1 = require("./stacks");
25
+ const teardownPhases = [
26
+ { label: 'Web', getStackName: quidproquo_deploy_awscdk_1.qpqDeployAwsCdkUtils.getWebStackName },
27
+ { label: 'Api', getStackName: quidproquo_deploy_awscdk_1.qpqDeployAwsCdkUtils.getApiStackName },
28
+ { label: 'Inf', getStackName: quidproquo_deploy_awscdk_1.qpqDeployAwsCdkUtils.getInfStackName },
29
+ ];
30
+ const awsTeardown = (appName, plan) => __awaiter(void 0, void 0, void 0, function* () {
31
+ if (plan.kind === 'cancelled') {
32
+ return;
33
+ }
34
+ const { services } = plan;
35
+ console.log('\n\nRunning automated teardown\n\n');
36
+ console.log('Executing for services');
37
+ console.log(services.join(', '));
38
+ if ((yield (0, awsCredentials_1.isAwsCredentialsValid)()) === false) {
39
+ console.log('Credentials are expired or invalid.');
40
+ return;
41
+ }
42
+ (0, timing_1.logTimeStart)('totalTime');
43
+ // The stack-name utils and the cdk app both read the synthed QPQ configs.
44
+ yield services.reduce((cur, service) => __awaiter(void 0, void 0, void 0, function* () {
45
+ yield cur;
46
+ yield (0, synth_1.synthCommand)([service, '--app', appName]);
47
+ }), Promise.resolve());
48
+ for (const { label, getStackName } of teardownPhases) {
49
+ yield services.reduce((cur, service) => __awaiter(void 0, void 0, void 0, function* () {
50
+ yield cur;
51
+ const qpqConfigForService = (0, qpqConfigs_1.loadServiceQpqConfig)(appName, service);
52
+ console.log(`Destroy ${label}: `, service);
53
+ yield (0, stacks_1.destroyServiceStack)(service, getStackName(qpqConfigForService), appName);
54
+ }), Promise.resolve());
55
+ }
56
+ (0, timing_1.logTimeEnd)('totalTime');
57
+ });
58
+ exports.awsTeardown = awsTeardown;
59
+ //# sourceMappingURL=teardown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"teardown.js","sourceRoot":"","sources":["../../../../src/platforms/aws/teardown.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6EAA6E;AAC7E,8EAA8E;AAC9E,wEAAwE;AACxE,+EAA+E;AAC/E,4EAA4E;AAC5E,6DAA6D;AAC7D,uEAAgE;AAEhE,gDAAoD;AAEpD,qDAA4D;AAC5D,6CAA4D;AAC5D,qDAAyD;AACzD,qCAA+C;AAE/C,MAAM,cAAc,GAAG;IACrB,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,+CAAoB,CA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AO,CAAC,CAAC;YACnE,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,IAAI,EAAE,OAAO,CAAC,CAAC;YAC3C,MAAM,IAAA,4BAAmB,EAAC,OAAO,EAAE,YAAY,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC,CAAC;QACjF,CAAC,CAAA,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IACxB,CAAC;IAED,IAAA,mBAAU,EAAC,WAAW,CAAC,CAAC;AAC1B,CAAC,CAAA,CAAC;AAlCW,QAAA,WAAW,eAkCtB","sourcesContent":["// AWS sequential teardown (`qpq teardown`) — the stack phases of `qpq go` in\n// reverse. Per phase it destroys every selected service's web, then api, then\n// inf CDK stacks. Phases don't cross-reference each other's CFN outputs\n// (values flow through SSM), so this order is prudence, not a hard dependency.\n// Bootstrap, domain and account stacks are deliberately out of scope — they\n// outlive any one service and are torn down by hand if ever.\nimport { qpqDeployAwsCdkUtils } from 'quidproquo-deploy-awscdk';\n\nimport { synthCommand } from '../../commands/synth';\nimport { TeardownPlan } from '../../lib/deployPrompts';\nimport { loadServiceQpqConfig } from '../../lib/qpqConfigs';\nimport { logTimeEnd, logTimeStart } from '../../lib/timing';\nimport { isAwsCredentialsValid } from './awsCredentials';\nimport { destroyServiceStack } from './stacks';\n\nconst teardownPhases = [\n { label: 'Web', getStackName: qpqDeployAwsCdkUtils.getWebStackName },\n { label: 'Api', getStackName: qpqDeployAwsCdkUtils.getApiStackName },\n { label: 'Inf', getStackName: qpqDeployAwsCdkUtils.getInfStackName },\n];\n\nexport const awsTeardown = async (appName: string, plan: TeardownPlan): Promise<void> => {\n if (plan.kind === 'cancelled') {\n return;\n }\n\n const { services } = plan;\n\n console.log('\\n\\nRunning automated teardown\\n\\n');\n console.log('Executing for services');\n console.log(services.join(', '));\n\n if ((await isAwsCredentialsValid()) === false) {\n console.log('Credentials are expired or invalid.');\n return;\n }\n\n logTimeStart('totalTime');\n\n // The stack-name utils and the cdk app both read the synthed QPQ configs.\n await services.reduce(async (cur, service) => {\n await cur;\n await synthCommand([service, '--app', appName]);\n }, Promise.resolve());\n\n for (const { label, getStackName } of teardownPhases) {\n await services.reduce(async (cur, service) => {\n await cur;\n const qpqConfigForService = loadServiceQpqConfig(appName, service);\n console.log(`Destroy ${label}: `, service);\n await destroyServiceStack(service, getStackName(qpqConfigForService), appName);\n }, Promise.resolve());\n }\n\n logTimeEnd('totalTime');\n};\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const getViewsS3Destinations: (appName: string, serviceName: string) => string[];
2
+ export declare const syncViewsToS3: (appName: string, serviceName: string) => Promise<void>;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.syncViewsToS3 = exports.getViewsS3Destinations = void 0;
13
+ // Views upload to S3. Bucket names resolve from the shell service's config.
14
+ // shell is the module-federation host: its bundle is the root website, so it
15
+ // syncs to the 'website' bucket root AND to its prefix in the shared 'views'
16
+ // bucket (where every other service's views live).
17
+ const quidproquo_actionprocessor_awslambda_1 = require("quidproquo-actionprocessor-awslambda");
18
+ const qpqConfigs_1 = require("../../lib/qpqConfigs");
19
+ const runCommand_1 = require("../../lib/runCommand");
20
+ const views_1 = require("../../lib/views");
21
+ const getViewsS3Destinations = (appName, serviceName) => {
22
+ const shellConfig = (0, qpqConfigs_1.loadServiceQpqConfig)(appName, 'shell');
23
+ const viewsBucketName = quidproquo_actionprocessor_awslambda_1.awsNamingUtils.getConfigRuntimeResourceNameFromConfig('views', shellConfig);
24
+ const destinations = [`s3://${viewsBucketName}/${serviceName}`];
25
+ if (serviceName === 'shell') {
26
+ const websiteBucketName = quidproquo_actionprocessor_awslambda_1.awsNamingUtils.getConfigRuntimeResourceNameFromConfig('website', shellConfig);
27
+ destinations.push(`s3://${websiteBucketName}`);
28
+ }
29
+ return destinations;
30
+ };
31
+ exports.getViewsS3Destinations = getViewsS3Destinations;
32
+ const syncViewsToS3 = (appName, serviceName) => __awaiter(void 0, void 0, void 0, function* () {
33
+ for (const destination of (0, exports.getViewsS3Destinations)(appName, serviceName)) {
34
+ console.log(`Copying [${serviceName}] views to [${destination}]`);
35
+ yield (0, runCommand_1.runCommand)('aws', ['s3', 'sync', (0, views_1.getViewsDistDir)(appName, serviceName), destination]);
36
+ }
37
+ });
38
+ exports.syncViewsToS3 = syncViewsToS3;
39
+ //# sourceMappingURL=viewsSync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewsSync.js","sourceRoot":"","sources":["../../../../src/platforms/aws/viewsSync.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,mDAAmD;AACnD,+FAAsE;AAEtE,qDAA4D;AAC5D,qDAAkD;AAClD,2CAAkD;AAE3C,MAAM,sBAAsB,GAAG,CAAC,OAAe,EAAE,WAAmB,EAAY,EAAE;IACvF,MAAM,WAAW,GAAG,IAAA,iCAAoB,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3D,MAAM,eAAe,GAAG,qDAAc,CAAC,sCAAsC,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAEpG,MAAM,YAAY,GAAG,CAAC,QAAQ,eAAe,IAAI,WAAW,EAAE,CAAC,CAAC;IAEhE,IAAI,WAAW,KAAK,OAAO,EAAE,CAAC;QAC5B,MAAM,iBAAiB,GAAG,qDAAc,CAAC,sCAAsC,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QACxG,YAAY,CAAC,IAAI,CAAC,QAAQ,iBAAiB,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAZW,QAAA,sBAAsB,0BAYjC;AAEK,MAAM,aAAa,GAAG,CAAO,OAAe,EAAE,WAAmB,EAAiB,EAAE;IACzF,KAAK,MAAM,WAAW,IAAI,IAAA,8BAAsB,EAAC,OAAO,EAAE,WAAW,CAAC,EAAE,CAAC;QACvE,OAAO,CAAC,GAAG,CAAC,YAAY,WAAW,eAAe,WAAW,GAAG,CAAC,CAAC;QAClE,MAAM,IAAA,uBAAU,EAAC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAA,uBAAe,EAAC,OAAO,EAAE,WAAW,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;IAC9F,CAAC;AACH,CAAC,CAAA,CAAC;AALW,QAAA,aAAa,iBAKxB","sourcesContent":["// Views upload to S3. Bucket names resolve from the shell service's config.\n// shell is the module-federation host: its bundle is the root website, so it\n// syncs to the 'website' bucket root AND to its prefix in the shared 'views'\n// bucket (where every other service's views live).\nimport { awsNamingUtils } from 'quidproquo-actionprocessor-awslambda';\n\nimport { loadServiceQpqConfig } from '../../lib/qpqConfigs';\nimport { runCommand } from '../../lib/runCommand';\nimport { getViewsDistDir } from '../../lib/views';\n\nexport const getViewsS3Destinations = (appName: string, serviceName: string): string[] => {\n const shellConfig = loadServiceQpqConfig(appName, 'shell');\n const viewsBucketName = awsNamingUtils.getConfigRuntimeResourceNameFromConfig('views', shellConfig);\n\n const destinations = [`s3://${viewsBucketName}/${serviceName}`];\n\n if (serviceName === 'shell') {\n const websiteBucketName = awsNamingUtils.getConfigRuntimeResourceNameFromConfig('website', shellConfig);\n destinations.push(`s3://${websiteBucketName}`);\n }\n\n return destinations;\n};\n\nexport const syncViewsToS3 = async (appName: string, serviceName: string): Promise<void> => {\n for (const destination of getViewsS3Destinations(appName, serviceName)) {\n console.log(`Copying [${serviceName}] views to [${destination}]`);\n await runCommand('aws', ['s3', 'sync', getViewsDistDir(appName, serviceName), destination]);\n }\n};\n"]}