@quatronic/qore 0.1.1 → 0.1.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 +79 -0
- package/dist/cli.js +1048 -249
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -176,6 +176,85 @@ If a repository resolves to no module on any portal you're logged in to,
|
|
|
176
176
|
the error lists the portals it tried and, when a staging repository looks
|
|
177
177
|
likely, suggests `qore login --portal staging`.
|
|
178
178
|
|
|
179
|
+
### Workspaces
|
|
180
|
+
|
|
181
|
+
`qore clone` sets up a local directory holding one or more of an app's
|
|
182
|
+
modules, each in its own repository; `qore sync` keeps that directory in
|
|
183
|
+
step with the app afterwards.
|
|
184
|
+
|
|
185
|
+
```sh
|
|
186
|
+
qore clone <app> # clones every module of <app> into ./<app-slug>
|
|
187
|
+
qore clone <app> <dir> # ...into <dir> instead
|
|
188
|
+
cd <app-slug>
|
|
189
|
+
qore status # app-level table, one row per module/environment
|
|
190
|
+
cd <module>
|
|
191
|
+
qore env pull # no trust prompt — a clone made by qore is already trusted
|
|
192
|
+
cd ..
|
|
193
|
+
qore sync # clone any module that's new, fetch the rest
|
|
194
|
+
qore sync --pull # ...and fast-forward every clean repository with an upstream
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
- **`--protocol https|ssh`** picks the clone URL (default `https`). `ssh`
|
|
198
|
+
rewrites `https://github.com/o/r` to `git@github.com:o/r.git`; your own
|
|
199
|
+
git `insteadOf` config still applies on top of either.
|
|
200
|
+
- **`--tenant <slug>`** on `qore clone` disambiguates an app slug that
|
|
201
|
+
exists in more than one tenant you have access to.
|
|
202
|
+
- **The workspace file** is `qore.workspace.json` at the directory `qore
|
|
203
|
+
clone` created, holding `{"schemaVersion": 1, "portal": "<apiOrigin>",
|
|
204
|
+
"appId": "<uuid>"}`. It never lists modules — those always come from the
|
|
205
|
+
portal, so a module added to the app later shows up on the next `qore
|
|
206
|
+
sync` with no local change needed. `qore` finds it by walking up from the
|
|
207
|
+
current directory (stopping at your home directory). The module commands
|
|
208
|
+
(`env pull`, `run`, …), `qore status` and `qore sync` pick up its portal
|
|
209
|
+
(and, for a module shared by several apps, its app) automatically when run
|
|
210
|
+
from inside the workspace — including from a module's own repository;
|
|
211
|
+
`qore clone`, `qore whoami` and `qore tenant` do not read it. An explicit
|
|
212
|
+
`--portal` flag always wins over it. `qore status` shows the app-level
|
|
213
|
+
table only when run in the directory that holds `qore.workspace.json`
|
|
214
|
+
itself (not inside one of its module repositories, which shows that
|
|
215
|
+
module).
|
|
216
|
+
- **Nothing is ever deleted, moved or overwritten.** A present module
|
|
217
|
+
directory is left exactly as it is; `sync` only fetches into it, and
|
|
218
|
+
only fast-forwards with `--pull`, and only when the tree is clean and has
|
|
219
|
+
an upstream — a dirty tree, one with no upstream, or one that would need
|
|
220
|
+
a merge is reported, never touched. `sync` runs a plain `git fetch` (no
|
|
221
|
+
`--prune`). A module's directory whose `origin` doesn't point at that
|
|
222
|
+
module's repository is reported as re-pointed, and one that isn't a git
|
|
223
|
+
repository at all is reported too — neither is repaired; move it aside
|
|
224
|
+
and run `qore sync` again. A repository directory in the workspace that
|
|
225
|
+
isn't one of the app's modules (typically a module that left the app) is
|
|
226
|
+
reported as removed, and left on disk.
|
|
227
|
+
- **A target directory that already holds something else** — someone
|
|
228
|
+
else's files, or another app's or portal's workspace — makes `qore
|
|
229
|
+
clone` fail with `QORE_WORKSPACE_CONFLICT` before writing anything,
|
|
230
|
+
including `qore.workspace.json`. Pick a different directory
|
|
231
|
+
(`qore clone <app> <dir>`).
|
|
232
|
+
- **Per-module clone failures** are diagnosed individually and don't stop
|
|
233
|
+
the rest of the run:
|
|
234
|
+
- `QORE_GITHUB_NOT_LINKED` — your GitHub account isn't linked in Qore;
|
|
235
|
+
link it at the account page, then `qore sync`.
|
|
236
|
+
- `QORE_REPO_NO_ACCESS` — you have no seat on the repository; the error
|
|
237
|
+
names the dev team(s) that build the module and their maintainers to ask.
|
|
238
|
+
- `QORE_REPO_ACCESS_PENDING` — access was granted recently, or your
|
|
239
|
+
GitHub organisation invitation isn't accepted yet; the error links the
|
|
240
|
+
invitation page.
|
|
241
|
+
- `QORE_GIT_AUTH` — git itself couldn't authenticate (no SSH key,
|
|
242
|
+
GitHub's SSH host key not accepted yet, no `gh auth login`, or SSO
|
|
243
|
+
authorisation needed for the org); the error names the fix.
|
|
244
|
+
|
|
245
|
+
`clone`/`sync` exits `0` when at least one module cloned or was already
|
|
246
|
+
present and every failure is one of the first three above
|
|
247
|
+
(`QORE_GITHUB_NOT_LINKED`, `QORE_REPO_NO_ACCESS`,
|
|
248
|
+
`QORE_REPO_ACCESS_PENDING`) — so a developer missing a seat on one module
|
|
249
|
+
of a multi-module app still gets a usable workspace for the rest.
|
|
250
|
+
`QORE_GIT_AUTH` is not an access failure in this sense: it fails the run
|
|
251
|
+
(exit `5`). Any other failure, or a run where nothing succeeded at all,
|
|
252
|
+
exits with that failure's own code. With `--json`, once the per-module
|
|
253
|
+
loop has run its results are under `data.results` (or
|
|
254
|
+
`error.details.results` on failure); an error before that (not logged in,
|
|
255
|
+
no workspace, a conflicting target directory) is an ordinary error
|
|
256
|
+
document without results.
|
|
257
|
+
|
|
179
258
|
### `--json`
|
|
180
259
|
|
|
181
260
|
Every command accepts `--json`, which prints exactly one JSON document on
|