@saacms/cli 0.1.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 +23 -0
- package/dist/commands/codegen.d.ts +29 -0
- package/dist/commands/codegen.d.ts.map +1 -0
- package/dist/commands/codegen.js +24 -0
- package/dist/commands/dev.d.ts +54 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +26 -0
- package/dist/commands/doctor.d.ts +55 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +25 -0
- package/dist/commands/init.d.ts +35 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +106 -0
- package/dist/commands/logs.d.ts +55 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +30 -0
- package/dist/commands/migrate.d.ts +95 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +81 -0
- package/dist/commands/publish.d.ts +53 -0
- package/dist/commands/publish.d.ts.map +1 -0
- package/dist/commands/publish.js +32 -0
- package/dist/main.d.ts +13 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +1634 -0
- package/package.json +31 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `saacms publish` — compile + commit the saacms-owned source set (collections /
|
|
3
|
+
* blocks / pages / migrations, the API mount, `saacms.config.ts`, host route
|
|
4
|
+
* files, published content JSON, and repo-mode media bytes) to the developer's
|
|
5
|
+
* Git repo.
|
|
6
|
+
*
|
|
7
|
+
* v1 alpha scope is **local git only**: compile → stage → commit, with an
|
|
8
|
+
* optional `--push`. saacms publishes by committing *to your repo* — the
|
|
9
|
+
* developer's existing Git remote + CI is the deploy pipeline (ADR 0024).
|
|
10
|
+
*
|
|
11
|
+
* ───────────────────────────────────────────────────────────────────────────
|
|
12
|
+
* Compile step (ADR 0001 + ADR 0003 + ADR 0009):
|
|
13
|
+
* When `saacms.config.ts` is present and has a host adapter, `publish` runs
|
|
14
|
+
* `compileForPublish` before the git status/stage step. This emits:
|
|
15
|
+
* - `src/pages/<url>.astro` for every configured Page (via the host adapter)
|
|
16
|
+
* - `content/pages/<id>.json` for every configured Page (published content)
|
|
17
|
+
* - `public/saacms/<slug>/<name>` for every pending repo-mode media record
|
|
18
|
+
* The EXACT emitted paths (from the manifest) are staged, not broad dirs.
|
|
19
|
+
* In `--dry` mode, compile runs without writing files; the manifest is
|
|
20
|
+
* reported in the dry-run output.
|
|
21
|
+
* ───────────────────────────────────────────────────────────────────────────
|
|
22
|
+
* TODO(v1.x) — GitHub OAuth user-token remote provisioning. Per ADR 0024, a
|
|
23
|
+
* v1.x fast-follow will, when no Git remote exists, use a GitHub OAuth *user*
|
|
24
|
+
* token (NOT a GitHub App) to create the repo and wire the remote before the
|
|
25
|
+
* push. That flow (token storage, scope prompts, repo-create API) is
|
|
26
|
+
* deliberately NOT built here — v1 alpha only commits to the local repo and,
|
|
27
|
+
* if `--push` is given and a remote already exists, pushes.
|
|
28
|
+
* ───────────────────────────────────────────────────────────────────────────
|
|
29
|
+
*/
|
|
30
|
+
export declare function redactSecrets(text: string): string;
|
|
31
|
+
export declare const publishCommand: import("citty").CommandDef<{
|
|
32
|
+
dry: {
|
|
33
|
+
type: "boolean";
|
|
34
|
+
description: string;
|
|
35
|
+
default: false;
|
|
36
|
+
};
|
|
37
|
+
message: {
|
|
38
|
+
type: "string";
|
|
39
|
+
description: string;
|
|
40
|
+
required: false;
|
|
41
|
+
};
|
|
42
|
+
cwd: {
|
|
43
|
+
type: "string";
|
|
44
|
+
description: string;
|
|
45
|
+
required: false;
|
|
46
|
+
};
|
|
47
|
+
push: {
|
|
48
|
+
type: "boolean";
|
|
49
|
+
description: string;
|
|
50
|
+
default: false;
|
|
51
|
+
};
|
|
52
|
+
}>;
|
|
53
|
+
//# sourceMappingURL=publish.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/commands/publish.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AA8DH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMlD;AAuJD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;EA8MzB,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `saacms publish` — commit the current draft set + any generated route file
|
|
3
|
+
* changes to the developer's Git repo. Per ADR 0024, v1 alpha publishes via
|
|
4
|
+
* a GitHub OAuth user token (not a GitHub App — that's a v1.x fast-follow).
|
|
5
|
+
*
|
|
6
|
+
* Scaffold only.
|
|
7
|
+
*/
|
|
8
|
+
import { defineCommand } from "citty";
|
|
9
|
+
export const publishCommand = defineCommand({
|
|
10
|
+
meta: {
|
|
11
|
+
name: "publish",
|
|
12
|
+
description: "Commit drafts + generated routes to the dev's Git repo (v1 alpha: GitHub OAuth user token).",
|
|
13
|
+
},
|
|
14
|
+
args: {
|
|
15
|
+
dry: {
|
|
16
|
+
type: "boolean",
|
|
17
|
+
description: "Print the commit plan without committing.",
|
|
18
|
+
default: false,
|
|
19
|
+
},
|
|
20
|
+
message: {
|
|
21
|
+
type: "string",
|
|
22
|
+
description: "Override the commit message saacms would otherwise derive from the draft set.",
|
|
23
|
+
required: false,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
run({ args }) {
|
|
27
|
+
console.log(`saacms publish${args.dry ? " (dry-run)" : ""} — would commit drafts + generated routes via GitHub OAuth user token (ADR 0024).`);
|
|
28
|
+
if (args.message) {
|
|
29
|
+
console.log(` message override: ${args.message}`);
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
});
|
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
/**
|
|
3
|
+
* @saacms/cli — entry point.
|
|
4
|
+
*
|
|
5
|
+
* Wires up the top-level `saacms` command and its sub-commands using citty.
|
|
6
|
+
* Each sub-command lives in `./commands/<name>.ts` so the surface is easy
|
|
7
|
+
* to grep and extend without touching this file.
|
|
8
|
+
*
|
|
9
|
+
* Per ADR 0011, this binary is **not** a server. It is a thin orchestrator
|
|
10
|
+
* for codegen, migrations, publish, log fetching, and environment health.
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG"}
|