@cfxlabsinc/nx-sstWorkspace-internal Nx plugin for the apps deployed with SST.
createNodes watches **/sst.config.ts and contributes these targets:
| Target | Command |
|---|---|
deploy-sst |
bun sst deploy --stage <stage> (on a runner, src/ci.sh) |
deploy |
nx:noop over deploy-sst and, with a Pulumi program beside the app, deploy-pulumi |
cancel |
bun sst unlock --stage <stage> |
sst-refresh |
bun sst refresh --stage <stage> |
deploy-pr |
CI only: src/ci.sh to the SST_STAGE=pr-<N> preview stage |
sst-reap |
Next apps: bash packages/nx-sst/src/reap.sh {projectRoot} {projectName} |
deploy is the name a deploy run selects on every deployable. The two halves are ordered by one edge: deploy-pulumi waits on deploy-sst (the dashboards' stacks grant roles SST mints), unless the project sets metadata.deploy.pulumiFirst, when deploy-sst waits on deploy-pulumi (ui-sandbox's stack makes the hosted zone SST looks up; vpc's owns the retired Route53 preview zone its Router still writes until previews move off it). deploy-sst also waits on db:migrate.
deploy-sst, cancel and sst-refresh take -c dev or -c prod and have no default: nx runs a missing configuration as the default, which would put a prod run on the dev stage. Without -c they refuse. An app that deploys fewer stages lists them in metadata.deploy.sstStages (vpc: ["dev"]); its other configuration only says so. The app is tagged deploy and stack:<stage> for each stage it deploys. On a runner with CFX_CI_AWS_PROFILE_PREFIX set, each command uses AWS_PROFILE=<prefix>-<stage>.
deploy-pr and sst-reap exist on the Next apps (a next.config.mjs beside the config). pr.yml's Previews reaches deploy-pr through nx affected in the same call as its Pulumi previews. sst-reap runs reap.sh for the stages cron-sst-preview-reaper.yml lists. docs-site declares its own deploy-pr (the docs preview), so a step that wants the SST apps alone filters with --projects tag:nextjs. deploy-pr refuses to run off a runner or without a pr-* SST_STAGE.
cancel releases the stage lock a killed or timed-out deploy leaves behind — the SST counterpart to pulumi cancel, which is where the name comes from.
nx run admin-dashboard:deploy-sst -c dev --excludeTaskDependencies # the SST half alone
nx run admin-dashboard:deploy -c prod # migration, SST, then Pulumi
nx run admin-dashboard:cancel -c dev
sst.config.ts is the markerIt is the file the SST CLI itself resolves to identify an app, so the targets exist exactly where sst would actually run — no tag to keep in sync. Today that is admin-dashboard, bank-dashboard, customer-dashboard, ui-sandbox and vpc.
Registered in workspace nx.json under plugins:
{
"plugin": "@cfxlabsinc/nx-sst",
"options": {}
}
Resolves through the workspace dependency in the root package.json:
"@cfxlabsinc/nx-sst": "workspace:*"