blogwright 0.1.0 → 0.2.0
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 +122 -5
- package/agent/agent-manifest.json +1 -1
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -1,12 +1,129 @@
|
|
|
1
1
|
# blogwright
|
|
2
2
|
|
|
3
|
-
Deploy a static
|
|
4
|
-
|
|
3
|
+
Deploy a static site to AWS from one CLI: S3 + CloudFront hosting, builds in an
|
|
4
|
+
isolated **Lambda MicroVM**, PR previews, keyless GitHub-OIDC CI deploys, and
|
|
5
|
+
optional [standard.site](https://standard.site) (AT Protocol) publishing. No
|
|
6
|
+
CloudFormation, no Terraform, no CDK — the infrastructure is a reconcilable
|
|
7
|
+
dependency graph the CLI applies directly through signed AWS API calls.
|
|
8
|
+
|
|
9
|
+
Works with any static site that installs and builds with pnpm: an Astro blog at
|
|
10
|
+
the repo root, a SvelteKit/Vite SPA in a monorepo subdirectory, anything that
|
|
11
|
+
ends in a directory of files to serve.
|
|
12
|
+
|
|
13
|
+
## Requirements
|
|
14
|
+
|
|
15
|
+
- Node ≥ 22 and pnpm (your site must build with `pnpm build`)
|
|
16
|
+
- AWS credentials in the ambient provider chain (`aws sso login`, env vars, or
|
|
17
|
+
an assumed role — whatever your shell already has)
|
|
18
|
+
- A git or jj repository (deploys are keyed to your revision hash)
|
|
19
|
+
|
|
20
|
+
## Get running
|
|
5
21
|
|
|
6
22
|
```sh
|
|
7
23
|
pnpm add -D blogwright
|
|
8
|
-
|
|
9
|
-
pnpm exec blogwright
|
|
24
|
+
|
|
25
|
+
pnpm exec blogwright init # wizard: writes config/production.jsonc
|
|
26
|
+
pnpm exec blogwright bootstrap # creates the bucket, CDN, roles, builder image
|
|
27
|
+
pnpm exec blogwright deploy # zip → build in a MicroVM → live site
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`init` asks four questions (site name, region, optional domain, optional GitHub
|
|
31
|
+
repo). `bootstrap` prints the CloudFront domain — and, if you set a domain, the
|
|
32
|
+
ACM validation CNAMEs to add to DNS. `deploy` streams the build log with live
|
|
33
|
+
progress and ends with a summary card and your URL. The `bw` alias works
|
|
34
|
+
everywhere `blogwright` does.
|
|
35
|
+
|
|
36
|
+
No TTY? Create the config by hand — only two fields are required:
|
|
37
|
+
|
|
38
|
+
```jsonc
|
|
39
|
+
// config/production.jsonc
|
|
40
|
+
{ "region": "us-east-1", "siteName": "myblog" }
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Commands
|
|
44
|
+
|
|
45
|
+
| Command | What it does |
|
|
46
|
+
| --- | --- |
|
|
47
|
+
| `init` | First-run wizard — writes `config/production.jsonc` |
|
|
48
|
+
| `bootstrap [env]` | Create/reconcile the infrastructure (idempotent; re-run after config changes) |
|
|
49
|
+
| `deploy [env]` | Zip the repo, build in a MicroVM, sync to S3, invalidate only changed paths |
|
|
50
|
+
| `status [env]` | Planned infrastructure vs live state, as a drift tree |
|
|
51
|
+
| `history [env]` | Deployment history with a `← live` marker |
|
|
52
|
+
| `logs <hash>` | CloudWatch build logs for a deploy |
|
|
53
|
+
| `rollback <hash>` | Re-deploy an earlier build's stored artifact |
|
|
54
|
+
| `preview …` | PR preview stack: `bootstrap`, `deploy pr-42`, `list`, `destroy pr-42`, `teardown` |
|
|
55
|
+
| `pds …` | standard.site publishing: `keygen`, `login`, `init`, `sync`, `secret status` |
|
|
56
|
+
| `delete` / `destroy --yes` | Empty the live site / tear everything down |
|
|
57
|
+
|
|
58
|
+
Environment defaults to `production`; pass `staging` (or anything) positionally.
|
|
59
|
+
Each environment is fully isolated: its own bucket, distribution, roles, and
|
|
60
|
+
state, all named `<env>-<siteName>-…`.
|
|
61
|
+
|
|
62
|
+
## Configuration
|
|
63
|
+
|
|
64
|
+
`config/<env>.jsonc` at your repo root (comments and trailing commas welcome).
|
|
65
|
+
Everything beyond `region` + `siteName` has sensible defaults:
|
|
66
|
+
|
|
67
|
+
```jsonc
|
|
68
|
+
{
|
|
69
|
+
"region": "us-east-1",
|
|
70
|
+
"siteName": "myblog", // names every AWS resource — never change it
|
|
71
|
+
"domain": "blog.example.com", // ACM cert + CloudFront alias
|
|
72
|
+
"githubRepo": "you/your-repo", // enables keyless CI deploys (OIDC)
|
|
73
|
+
|
|
74
|
+
// Non-Astro-shaped sites:
|
|
75
|
+
"spa": true, // unknown paths → /index.html (200)
|
|
76
|
+
"paths": { "app": "web", "dist": "web/build" }, // monorepo build dir + output
|
|
77
|
+
"sourceInclude": ["web/src/pkg/"], // gitignored pre-built artifacts to ship
|
|
78
|
+
"sourceIgnore": ["server/"] // extra paths to keep out of the build zip
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`sourceInclude` is for artifacts you build *before* deploying (a wasm bundle, a
|
|
83
|
+
generated dataset) with toolchains the builder image deliberately lacks — run
|
|
84
|
+
your pre-build, then `blogwright deploy`; a missing entry fails fast with a
|
|
85
|
+
pointer.
|
|
86
|
+
|
|
87
|
+
## CI deploys (no stored keys)
|
|
88
|
+
|
|
89
|
+
With `githubRepo` set, `bootstrap` provisions a GitHub-OIDC role. Your workflow
|
|
90
|
+
assumes it and deploys — no AWS secrets in GitHub:
|
|
91
|
+
|
|
92
|
+
```yaml
|
|
93
|
+
permissions: { id-token: write, contents: read }
|
|
94
|
+
steps:
|
|
95
|
+
- uses: actions/checkout@v4
|
|
96
|
+
- uses: pnpm/action-setup@v4
|
|
97
|
+
- uses: actions/setup-node@v4
|
|
98
|
+
with: { node-version: 22 }
|
|
99
|
+
- uses: aws-actions/configure-aws-credentials@v4
|
|
100
|
+
with:
|
|
101
|
+
role-to-assume: arn:aws:iam::<account>:role/staging-<siteName>-gh
|
|
102
|
+
aws-region: us-east-1
|
|
103
|
+
- run: pnpm install --frozen-lockfile
|
|
104
|
+
- run: pnpm exec blogwright deploy staging --plain
|
|
10
105
|
```
|
|
11
106
|
|
|
12
|
-
|
|
107
|
+
`preview bootstrap` sets up the same pattern for pull requests: every PR gets
|
|
108
|
+
`https://pr-<n>.<preview-domain>` from one shared distribution, and teardown is
|
|
109
|
+
a prefix delete.
|
|
110
|
+
|
|
111
|
+
## Output modes
|
|
112
|
+
|
|
113
|
+
Pretty by default on a TTY — live build progress, a deploy summary card, drift
|
|
114
|
+
trees. Piped output and CI get stable, line-oriented plain text automatically;
|
|
115
|
+
`--plain` forces it (ideal for agents), and `NO_COLOR` disables colour only.
|
|
116
|
+
|
|
117
|
+
## standard.site publishing
|
|
118
|
+
|
|
119
|
+
Add a `pds` section to the config and your posts mirror to your AT Protocol
|
|
120
|
+
PDS as standard.site records after every production deploy — OAuth
|
|
121
|
+
confidential client, keys in Secrets Manager, rkeys derived from URL paths
|
|
122
|
+
(exposed as the `blogwright/rkey` subpath so your site renders matching link
|
|
123
|
+
tags). Setup order matters; see the
|
|
124
|
+
[full guide](https://github.com/antstanley/blogwright#standardsite-publishing-at-protocol).
|
|
125
|
+
|
|
126
|
+
## More
|
|
127
|
+
|
|
128
|
+
Full documentation, architecture notes, and issues:
|
|
129
|
+
https://github.com/antstanley/blogwright
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blogwright",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"blogwright": "./dist/bin.js",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"fflate": "^0.8.3",
|
|
21
|
-
"blogwright-core": "0.
|
|
22
|
-
"blogwright-pds": "0.
|
|
21
|
+
"blogwright-core": "0.2.0",
|
|
22
|
+
"blogwright-pds": "0.2.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/node": "^26.1.0",
|
|
@@ -47,6 +47,8 @@
|
|
|
47
47
|
"engines": {
|
|
48
48
|
"node": ">=22"
|
|
49
49
|
},
|
|
50
|
+
"homepage": "https://github.com/antstanley/blogwright#readme",
|
|
51
|
+
"bugs": "https://github.com/antstanley/blogwright/issues",
|
|
50
52
|
"scripts": {
|
|
51
53
|
"build": "tsc -p tsconfig.json && node scripts/copy-agent.mjs",
|
|
52
54
|
"typecheck": "tsc -p tsconfig.typecheck.json",
|