@getquick/site 0.0.0-stage → 0.1.1
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/CHANGELOG.md +53 -0
- package/LICENSE +21 -0
- package/README.md +146 -2
- package/bin/gq.mjs +14 -0
- package/docs/research/ploi-api.md +2371 -0
- package/package.json +56 -4
- package/src/exec.mjs +23 -0
- package/src/index.mjs +1 -0
- package/src/ops/cli.mjs +349 -0
- package/src/ops/env.mjs +73 -0
- package/src/ops/output.mjs +62 -0
- package/src/ops/ploi-api-command.mjs +225 -0
- package/src/ops/project-context.mjs +103 -0
- package/src/ops/providers/cloudflare.mjs +95 -0
- package/src/ops/providers/github.mjs +104 -0
- package/src/ops/providers/http.mjs +31 -0
- package/src/ops/providers/ploi-catalog.mjs +49 -0
- package/src/ops/providers/ploi-endpoints.mjs +1590 -0
- package/src/ops/providers/ploi.mjs +159 -0
- package/src/ops/ui.mjs +84 -0
- package/src/run.mjs +45 -0
- package/src/version.mjs +3 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@getquick/site` are recorded here. Versions follow
|
|
4
|
+
[Semantic Versioning](https://semver.org/); each release is tagged `v<version>`.
|
|
5
|
+
|
|
6
|
+
## 0.1.1 — 2026-10-01
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
|
|
10
|
+
- The README describes the published package: install, configuration,
|
|
11
|
+
commands, `run()`, and releasing.
|
|
12
|
+
- `exec` no longer crashes the process when a child exits without reading
|
|
13
|
+
its input, and decodes output as UTF-8 so multibyte characters survive
|
|
14
|
+
chunk boundaries.
|
|
15
|
+
- `run()` rejects a call without `stdout` and `stderr` up front instead of
|
|
16
|
+
failing while reporting another error.
|
|
17
|
+
- `release:publish` stops with a clear message when a `git` check fails,
|
|
18
|
+
instead of reading a failed `git status` as a clean tree.
|
|
19
|
+
|
|
20
|
+
## 0.1.0 — 2026-09-30
|
|
21
|
+
|
|
22
|
+
First release: `gq-ops` 0.1.0 (`Quick-Release/gq-ops@d972d12`) as the `gq` bin
|
|
23
|
+
of `@getquick/site`.
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- `run(argv, { cwd, env, fetch, exec, stdout, stderr })`, the in-process entry
|
|
28
|
+
point behind `gq`. It resolves to the exit code; commands read no
|
|
29
|
+
`process.env` or `process.cwd()`, and every provider request and child
|
|
30
|
+
process goes through the injected `fetch` and `exec`.
|
|
31
|
+
- A fixture-site test harness (`test/support/fixture-site.mjs`): a temporary
|
|
32
|
+
Git repository with a `gq.ops.json`, and recording `fetch` and `exec` fakes.
|
|
33
|
+
- `pnpm release:publish`, which publishes a tagged version with `NPM_TOKEN`
|
|
34
|
+
from Sigillo.
|
|
35
|
+
|
|
36
|
+
### Carried over from gq-ops, unchanged
|
|
37
|
+
|
|
38
|
+
- `gq context show`, `gq ploi …` (including all 225 `ploi api` operations),
|
|
39
|
+
`gq cloudflare …`, and `gq github actions sync`, with the same forms, output,
|
|
40
|
+
and `gq.ops.json` discovery.
|
|
41
|
+
|
|
42
|
+
### Changed
|
|
43
|
+
|
|
44
|
+
- Without `XDG_CONFIG_HOME` or `HOME` in `env`, no machine `gq/ops.env` is read.
|
|
45
|
+
- Ploi requests identify as `getquick-site/<version>` instead of
|
|
46
|
+
`gq-ops/<version>`.
|
|
47
|
+
|
|
48
|
+
### Removed
|
|
49
|
+
|
|
50
|
+
- `gq credentials configure`, which wrote provider tokens to `.env`; sites
|
|
51
|
+
inject them per command from Sigillo instead.
|
|
52
|
+
- `gq test post-deploy`, which only ran a site's own `pnpm gq test post-deploy`
|
|
53
|
+
script.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Quick Release
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,147 @@
|
|
|
1
|
-
#
|
|
1
|
+
# getquick-site
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Shared tooling for GETQUICK sites, published to public npm as
|
|
4
|
+
[`@getquick/site`](https://www.npmjs.com/package/@getquick/site): one `gq`
|
|
5
|
+
CLI, configured by each site's own `gq.ops.json`.
|
|
6
|
+
|
|
7
|
+
It replaces [`gq-ops`](https://github.com/Quick-Release/gq-ops) and the
|
|
8
|
+
vendored `shop-devtools`. The package is being extracted from the Lombardi
|
|
9
|
+
site (phase 1 of the GETQUICK blueprint rollout); release and version sync,
|
|
10
|
+
Ploi provisioning and releases, database sync and backups, Cloudflare CI and
|
|
11
|
+
media, Sigillo secret injection, and the `setup`/`doctor`/`verify` runners
|
|
12
|
+
move in over the coming releases. Today it carries `gq-ops`'s commands: Ploi,
|
|
13
|
+
Cloudflare, and GitHub Actions sync.
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
Pin an exact version in the site's root `devDependencies`; it needs no
|
|
18
|
+
registry login:
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
pnpm add --save-dev --save-exact @getquick/site
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"scripts": {
|
|
27
|
+
"ops": "gq"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Configure a site
|
|
33
|
+
|
|
34
|
+
`gq` walks up from the current directory to the nearest `gq.ops.json`,
|
|
35
|
+
stopping at the enclosing Git repository, and treats that directory as the
|
|
36
|
+
site root. Every site-relative path resolves from there. `--project <dir>` or
|
|
37
|
+
`--config <file>` selects a site explicitly.
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"project": "example-site",
|
|
42
|
+
"ploi": { "serverId": "12345", "siteId": "67890" },
|
|
43
|
+
"cloudflare": {
|
|
44
|
+
"accountId": "0123456789abcdef0123456789abcdef",
|
|
45
|
+
"zoneId": "abcdef0123456789abcdef0123456789",
|
|
46
|
+
"zoneName": "example.com"
|
|
47
|
+
},
|
|
48
|
+
"github": {
|
|
49
|
+
"repository": "Quick-Release/example-site",
|
|
50
|
+
"environment": "production",
|
|
51
|
+
"secrets": ["CLOUDFLARE_API_TOKEN"],
|
|
52
|
+
"variables": ["CLOUDFLARE_ACCOUNT_ID"]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Provider IDs are safe to commit; tokens are not. `gq` reads `PLOI_API_TOKEN`,
|
|
58
|
+
`CLOUDFLARE_API_TOKEN` and optional ID overrides (`PLOI_SERVER_ID`,
|
|
59
|
+
`PLOI_SITE_ID`, `CLOUDFLARE_ACCOUNT_ID`, `CLOUDFLARE_ZONE_ID`,
|
|
60
|
+
`CLOUDFLARE_ZONE_NAME`) from, in increasing precedence:
|
|
61
|
+
|
|
62
|
+
1. `${XDG_CONFIG_HOME:-$HOME/.config}/gq/ops.env`
|
|
63
|
+
2. the site's `.env`
|
|
64
|
+
3. the process environment, which is where a secret manager such as Sigillo
|
|
65
|
+
injects them per command
|
|
66
|
+
4. flags (`--server`, `--site`, `--account`, `--zone`)
|
|
67
|
+
|
|
68
|
+
## Commands
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
gq --version
|
|
72
|
+
gq context show [--json]
|
|
73
|
+
|
|
74
|
+
gq ploi servers list
|
|
75
|
+
gq ploi server show [--server <id>]
|
|
76
|
+
gq ploi sites list [--server <id>]
|
|
77
|
+
gq ploi site show [--server <id>] [--site <id>]
|
|
78
|
+
gq ploi api list [--group <group>] [--search <text>]
|
|
79
|
+
gq ploi api describe <operation-id>
|
|
80
|
+
gq ploi api <operation-id> [--path name=value] [--query name=value]
|
|
81
|
+
[--page <n>] [--per-page <n>] [--data <json> | --data-file <file>]
|
|
82
|
+
[--all] [--max-pages <n>] [--dry-run | --yes]
|
|
83
|
+
|
|
84
|
+
gq cloudflare accounts list
|
|
85
|
+
gq cloudflare zones list [--account <id>]
|
|
86
|
+
gq cloudflare zone show [--zone <id>]
|
|
87
|
+
gq cloudflare dns list [--zone <id>] [--name <hostname>] [--type <type>]
|
|
88
|
+
|
|
89
|
+
gq github actions sync [--dry-run] [--yes]
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
`--json` prints machine-readable output; `ploi api` always prints the
|
|
93
|
+
provider's JSON. In a terminal, `gq` with no arguments opens a command picker.
|
|
94
|
+
|
|
95
|
+
`ploi api` covers all 225 operations in the Ploi API reference
|
|
96
|
+
([inventory](docs/research/ploi-api.md)); operation IDs follow the docs' routes,
|
|
97
|
+
such as `sites.log-site`. Every non-GET operation needs `--yes` (or a prompt in
|
|
98
|
+
a terminal); `--dry-run` prints the resolved request without sending it.
|
|
99
|
+
Cloudflare commands are read-only. `github actions sync` pipes each value to
|
|
100
|
+
`gh` on stdin and never prints it.
|
|
101
|
+
|
|
102
|
+
## Programmatic use
|
|
103
|
+
|
|
104
|
+
The CLI is a thin shell over `run()`, which resolves to an exit code:
|
|
105
|
+
|
|
106
|
+
```js
|
|
107
|
+
import { run } from "@getquick/site";
|
|
108
|
+
|
|
109
|
+
const code = await run(["ploi", "site", "show", "--json"], {
|
|
110
|
+
cwd, // where discovery starts
|
|
111
|
+
env, // replaces process.env
|
|
112
|
+
fetch, // every provider request
|
|
113
|
+
exec, // every child process: (command, args, { cwd, env, input }) => { code, stdout, stderr }
|
|
114
|
+
stdout, // anything with write()
|
|
115
|
+
stderr,
|
|
116
|
+
});
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
No command reads `process.env` or `process.cwd()`; `bin/gq.mjs` is the only
|
|
120
|
+
place that passes the real ones.
|
|
121
|
+
|
|
122
|
+
## Development
|
|
123
|
+
|
|
124
|
+
```sh
|
|
125
|
+
pnpm install
|
|
126
|
+
pnpm check # Prettier, ESLint, node:test
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Tests call `run()` against a fixture site (a temporary Git repository with a
|
|
130
|
+
`gq.ops.json`) with recording fakes for `fetch` and `exec`
|
|
131
|
+
([`test/support/fixture-site.mjs`](test/support/fixture-site.mjs)). They need
|
|
132
|
+
no network, credentials, or provider accounts.
|
|
133
|
+
|
|
134
|
+
## Releasing
|
|
135
|
+
|
|
136
|
+
1. Bump `version` in `package.json`, add its section to `CHANGELOG.md`, and
|
|
137
|
+
commit.
|
|
138
|
+
2. Tag the commit `v<version>` and push the commit and tag.
|
|
139
|
+
3. `pnpm release:publish` checks that `HEAD` carries that tag and that
|
|
140
|
+
`pnpm check` passes, then runs `npm publish` under Sigillo's `operations`
|
|
141
|
+
environment (`gq.ops.json`), where `NPM_TOKEN` lives. The token is never
|
|
142
|
+
written to disk. It is a granular token that expires within 90 days, so
|
|
143
|
+
rotate it before then.
|
|
144
|
+
|
|
145
|
+
## License
|
|
146
|
+
|
|
147
|
+
[MIT](LICENSE)
|
package/bin/gq.mjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { exec } from "../src/exec.mjs";
|
|
4
|
+
import { run } from "../src/run.mjs";
|
|
5
|
+
|
|
6
|
+
process.exitCode = await run(process.argv.slice(2), {
|
|
7
|
+
cwd: process.cwd(),
|
|
8
|
+
env: process.env,
|
|
9
|
+
fetch: globalThis.fetch,
|
|
10
|
+
exec,
|
|
11
|
+
stdout: process.stdout,
|
|
12
|
+
stderr: process.stderr,
|
|
13
|
+
interactive: Boolean(process.stdin.isTTY && process.stdout.isTTY),
|
|
14
|
+
});
|