@lsts_tech/infra 1.0.1 → 1.0.2
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/README.md +54 -73
- package/dist/bin/init.d.ts +4 -3
- package/dist/bin/init.d.ts.map +1 -1
- package/dist/bin/init.js +619 -117
- package/dist/bin/init.js.map +1 -1
- package/dist/src/auth/index.d.ts +17 -0
- package/dist/src/auth/index.d.ts.map +1 -0
- package/dist/src/auth/index.js +18 -0
- package/dist/src/auth/index.js.map +1 -0
- package/dist/stacks/Dns.d.ts +24 -14
- package/dist/stacks/Dns.d.ts.map +1 -1
- package/dist/stacks/Dns.js +69 -18
- package/dist/stacks/Dns.js.map +1 -1
- package/dist/stacks/Pipeline.d.ts +7 -0
- package/dist/stacks/Pipeline.d.ts.map +1 -1
- package/dist/stacks/Pipeline.js +60 -7
- package/dist/stacks/Pipeline.js.map +1 -1
- package/docs/CLI.md +58 -15
- package/docs/CONFIGURATION.md +73 -30
- package/docs/EXAMPLES.md +5 -1
- package/examples/delegated-subdomain/infra.config.ts +102 -0
- package/examples/next-and-expo/infra.config.ts +33 -28
- package/examples/next-only/infra.config.ts +35 -22
- package/package.json +10 -4
- package/scripts/ensure-pipelines.sh +151 -43
- package/scripts/postdeploy-update-dns.sh +42 -11
- package/scripts/predeploy-checks.sh +38 -5
- package/templates/buildspec.yml +23 -0
- package/templates/ensure-pipelines.sh +157 -22
- package/templates/env.example +15 -0
- package/templates/infra.config.expo-web.ts +153 -0
- package/templates/infra.config.next-only.ts +159 -0
- package/templates/infra.config.ts +21 -4
- package/templates/pipelines.example.json +19 -0
- package/templates/private.example.json +13 -0
- package/templates/scaffold.gitignore +29 -0
- package/templates/scaffold.package.json +25 -0
- package/templates/scaffold.tsconfig.json +22 -0
- package/templates/secrets.schema.expo-web.json +8 -0
package/README.md
CHANGED
|
@@ -5,21 +5,20 @@
|
|
|
5
5
|
[](https://github.com/lstechnologysolutions/lstech.solutions/actions/workflows/publish-infra.yml)
|
|
6
6
|
[](https://github.com/lstechnologysolutions/infra)
|
|
7
7
|
|
|
8
|
-
Reusable, white-label SST v3 infrastructure primitives for AWS deployments
|
|
8
|
+
Reusable, white-label SST v3 infrastructure primitives for AWS monorepo deployments.
|
|
9
9
|
|
|
10
|
-
Public
|
|
10
|
+
Public repository: [https://github.com/lstechnologysolutions/infra](https://github.com/lstechnologysolutions/infra)
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
## What It Supports
|
|
13
13
|
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
`v1.0.1` provider support: **AWS only**.
|
|
14
|
+
- AWS provider (v1.x)
|
|
15
|
+
- Next.js and Expo Web deployments
|
|
16
|
+
- `expo-web` scaffold mode (no Next.js resources/secrets)
|
|
17
|
+
- Runtime-driven pipeline definitions (env + optional `config/pipelines.json`)
|
|
18
|
+
- Explicit pipeline mutation gate (`INFRA_CREATE_PIPELINES=true`)
|
|
19
|
+
- `doctor` readiness checks (`npx @lsts_tech/infra doctor`)
|
|
20
|
+
- Optional pipeline IAM mode: `admin` or `least-privilege`
|
|
21
|
+
- Hosted-zone parent fallback support for delegated subdomains
|
|
23
22
|
|
|
24
23
|
## Install
|
|
25
24
|
|
|
@@ -38,18 +37,19 @@ npx @lsts_tech/infra init \
|
|
|
38
37
|
--project myapp \
|
|
39
38
|
--domain example.com \
|
|
40
39
|
--repo myorg/myrepo \
|
|
41
|
-
--
|
|
40
|
+
--profile next-expo \
|
|
41
|
+
--pipelines production,dev,mobile
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
Expo-only setup:
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
47
|
npx @lsts_tech/infra init \
|
|
48
48
|
--project myapp \
|
|
49
49
|
--domain example.com \
|
|
50
|
-
--repo myorg/
|
|
51
|
-
--
|
|
52
|
-
--
|
|
50
|
+
--repo myorg/mobile \
|
|
51
|
+
--profile expo-web \
|
|
52
|
+
--pipelines production,mobile
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
### 2. Review generated files
|
|
@@ -57,30 +57,47 @@ npx @lsts_tech/infra init \
|
|
|
57
57
|
- `sst.config.ts`
|
|
58
58
|
- `sst-env.d.ts`
|
|
59
59
|
- `infra.config.ts`
|
|
60
|
+
- `package.json`
|
|
61
|
+
- `tsconfig.json`
|
|
62
|
+
- `.gitignore`
|
|
60
63
|
- `.env.example`
|
|
61
64
|
- `buildspec.yml`
|
|
62
65
|
- `schemas/secrets.schema.json`
|
|
63
66
|
- `scripts/ensure-pipelines.sh`
|
|
67
|
+
- `scripts/predeploy-checks.sh`
|
|
68
|
+
- `scripts/postdeploy-update-dns.sh`
|
|
69
|
+
- `scripts/sst-deploy.sh`
|
|
70
|
+
- `scripts/ensure-secrets.sh`
|
|
71
|
+
- `config/pipelines.example.json`
|
|
72
|
+
- `config/private.example.json`
|
|
64
73
|
|
|
65
74
|
### 3. Configure environment and secrets
|
|
66
75
|
|
|
67
|
-
|
|
76
|
+
```bash
|
|
77
|
+
cp .env.example .env
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Set minimum SST secrets for Next.js profiles:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npx sst secret set DatabaseUrl "postgresql://..." --stage dev
|
|
84
|
+
npx sst secret set AuthSecret "replace-me" --stage dev
|
|
85
|
+
```
|
|
68
86
|
|
|
69
|
-
|
|
87
|
+
### 4. Validate setup
|
|
70
88
|
|
|
71
89
|
```bash
|
|
72
|
-
npx
|
|
73
|
-
npx sst secrets set AuthSecret "replace-me" --stage dev
|
|
90
|
+
npx @lsts_tech/infra doctor --target .
|
|
74
91
|
```
|
|
75
92
|
|
|
76
|
-
###
|
|
93
|
+
### 5. Deploy app infrastructure
|
|
77
94
|
|
|
78
95
|
```bash
|
|
79
96
|
npx sst deploy --stage dev
|
|
80
97
|
npx sst deploy --stage production
|
|
81
98
|
```
|
|
82
99
|
|
|
83
|
-
###
|
|
100
|
+
### 6. Create/update pipelines explicitly
|
|
84
101
|
|
|
85
102
|
```bash
|
|
86
103
|
APPROVE=true bash scripts/ensure-pipelines.sh
|
|
@@ -88,68 +105,32 @@ APPROVE=true bash scripts/ensure-pipelines.sh
|
|
|
88
105
|
|
|
89
106
|
## CLI
|
|
90
107
|
|
|
91
|
-
### `init`
|
|
92
|
-
|
|
93
108
|
```bash
|
|
94
|
-
npx @lsts_tech/infra
|
|
109
|
+
npx @lsts_tech/infra <command> [options]
|
|
95
110
|
```
|
|
96
111
|
|
|
97
|
-
|
|
98
|
-
|---|---|---|
|
|
99
|
-
| `--provider <name>` | Cloud provider (`aws`) | `aws` |
|
|
100
|
-
| `--project <slug>` | Project/app prefix | `myapp` |
|
|
101
|
-
| `--app-name <name>` | SST app name | `--project` |
|
|
102
|
-
| `--domain <domain>` | Root domain | `example.com` |
|
|
103
|
-
| `--repo <owner/repo>` | GitHub repo for pipeline source | `myorg/myrepo` |
|
|
104
|
-
| `--pipelines <list>` | `production,dev,mobile` CSV or `none` | `production,dev` |
|
|
105
|
-
| `--branch-prod <branch>` | Production branch | `main` |
|
|
106
|
-
| `--branch-dev <branch>` | Dev branch | `develop` |
|
|
107
|
-
| `--branch-mobile <branch>` | Mobile branch | `mobile` |
|
|
108
|
-
| `--with-expo` | Enable Expo scaffold defaults | `false` |
|
|
109
|
-
| `--infra-path <path>` | Infra path from monorepo root | `packages/infra` |
|
|
110
|
-
| `--target <path>` | Output directory | `.` |
|
|
111
|
-
| `--force` | Overwrite existing files | `false` |
|
|
112
|
-
|
|
113
|
-
Full CLI docs: [docs/CLI.md](./docs/CLI.md)
|
|
114
|
-
|
|
115
|
-
## API Reference
|
|
116
|
-
|
|
117
|
-
### `resolveDomain(config: DnsConfig): DomainResult`
|
|
118
|
-
|
|
119
|
-
Stage-aware domain resolution.
|
|
120
|
-
|
|
121
|
-
### `createNextSite(config: NextSiteConfig): { site, url }`
|
|
122
|
-
|
|
123
|
-
Creates an SST `aws.Nextjs` deployment.
|
|
124
|
-
|
|
125
|
-
### `createExpoSite(config: ExpoSiteConfig): { site, url }`
|
|
126
|
-
|
|
127
|
-
Creates an SST `aws.StaticSite` deployment for Expo web exports.
|
|
112
|
+
Commands:
|
|
128
113
|
|
|
129
|
-
|
|
114
|
+
- `init` — scaffold infra project files
|
|
115
|
+
- `doctor` — validate Route53/ACM/CodeStar/branch/domain config before deploy
|
|
130
116
|
|
|
131
|
-
|
|
117
|
+
Full reference: [docs/CLI.md](./docs/CLI.md)
|
|
132
118
|
|
|
133
|
-
##
|
|
119
|
+
## API
|
|
134
120
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
| `scripts/ensure-secrets.sh` | SST secret provisioning from schema |
|
|
140
|
-
| `scripts/sst-deploy.sh` | CI-safe SST deploy wrapper |
|
|
141
|
-
| `scripts/ensure-pipelines.sh` | Ensure configured pipelines exist |
|
|
142
|
-
| `scripts/pulumi-deploy.sh` | CI-safe Pulumi deploy wrapper |
|
|
143
|
-
| `scripts/cleanup-orphan-lambdas.sh` | Cleanup stale Lambda functions |
|
|
144
|
-
| `scripts/delete-amplify-app.sh` | Remove legacy Amplify apps |
|
|
121
|
+
- `resolveDomain(config: DnsConfig): DomainResult`
|
|
122
|
+
- `createNextSite(config: NextSiteConfig): { site, url }`
|
|
123
|
+
- `createExpoSite(config: ExpoSiteConfig): { site, url }`
|
|
124
|
+
- `createPipeline(config: PipelineConfig): PipelineResult`
|
|
145
125
|
|
|
146
|
-
##
|
|
126
|
+
## Docs and Examples
|
|
147
127
|
|
|
148
128
|
- Configuration guide: [docs/CONFIGURATION.md](./docs/CONFIGURATION.md)
|
|
149
|
-
- CLI
|
|
129
|
+
- CLI reference: [docs/CLI.md](./docs/CLI.md)
|
|
150
130
|
- Example index: [docs/EXAMPLES.md](./docs/EXAMPLES.md)
|
|
151
131
|
- Next-only example: [examples/next-only/infra.config.ts](./examples/next-only/infra.config.ts)
|
|
152
132
|
- Next + Expo example: [examples/next-and-expo/infra.config.ts](./examples/next-and-expo/infra.config.ts)
|
|
133
|
+
- Delegated subdomain example: [examples/delegated-subdomain/infra.config.ts](./examples/delegated-subdomain/infra.config.ts)
|
|
153
134
|
|
|
154
135
|
## Publish Checklist
|
|
155
136
|
|
|
@@ -158,7 +139,7 @@ Before publishing to npm:
|
|
|
158
139
|
1. `npm run build`
|
|
159
140
|
2. `npm run check-types`
|
|
160
141
|
3. `npm pack --dry-run`
|
|
161
|
-
4. Verify tarball
|
|
142
|
+
4. Verify tarball contains no private state/secrets (`.env`, `.sst`, Pulumi state)
|
|
162
143
|
|
|
163
144
|
## License
|
|
164
145
|
|
package/dist/bin/init.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* @lsts_tech/infra — CLI
|
|
3
|
+
* @lsts_tech/infra — CLI
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Commands:
|
|
6
|
+
* - init: scaffold white-label infra files
|
|
7
|
+
* - doctor: validate AWS/domain/pipeline readiness before deploy
|
|
7
8
|
*/
|
|
8
9
|
export {};
|
|
9
10
|
//# sourceMappingURL=init.d.ts.map
|
package/dist/bin/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../bin/init.ts"],"names":[],"mappings":";AAEA
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../bin/init.ts"],"names":[],"mappings":";AAEA;;;;;;GAMG"}
|