@anybuild-ai/ab 0.1.1 → 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/CHANGELOG.md +20 -0
- package/README.md +41 -4
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +2 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/pull.d.ts.map +1 -1
- package/dist/commands/pull.js +67 -5
- package/dist/commands/pull.js.map +1 -1
- package/dist/commands/push.d.ts.map +1 -1
- package/dist/commands/push.js +6 -1
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +12 -4
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +3 -1
- package/dist/commands/validate.js.map +1 -1
- package/dist/export/checksum.d.ts +4 -0
- package/dist/export/checksum.d.ts.map +1 -1
- package/dist/export/checksum.js +8 -0
- package/dist/export/checksum.js.map +1 -1
- package/dist/export/import-batch.d.ts +2 -0
- package/dist/export/import-batch.d.ts.map +1 -1
- package/dist/export/import-batch.js +139 -24
- package/dist/export/import-batch.js.map +1 -1
- package/dist/export/path-based-status.d.ts.map +1 -1
- package/dist/export/path-based-status.js +4 -2
- package/dist/export/path-based-status.js.map +1 -1
- package/dist/export/restore-hint.d.ts +8 -0
- package/dist/export/restore-hint.d.ts.map +1 -0
- package/dist/export/restore-hint.js +38 -0
- package/dist/export/restore-hint.js.map +1 -0
- package/dist/export/schema-json.d.ts +19 -0
- package/dist/export/schema-json.d.ts.map +1 -0
- package/dist/export/schema-json.js +97 -0
- package/dist/export/schema-json.js.map +1 -0
- package/dist/export/status.d.ts +2 -2
- package/dist/export/status.d.ts.map +1 -1
- package/dist/export/status.js +117 -47
- package/dist/export/status.js.map +1 -1
- package/dist/export/sync.d.ts +4 -2
- package/dist/export/sync.d.ts.map +1 -1
- package/dist/export/sync.js +170 -20
- package/dist/export/sync.js.map +1 -1
- package/dist/export/types.d.ts +6 -3
- package/dist/export/types.d.ts.map +1 -1
- package/dist/export/working-dirs.d.ts +13 -1
- package/dist/export/working-dirs.d.ts.map +1 -1
- package/dist/export/working-dirs.js +49 -2
- package/dist/export/working-dirs.js.map +1 -1
- package/dist/export/working-tree-validation.d.ts +1 -1
- package/dist/export/working-tree-validation.d.ts.map +1 -1
- package/dist/export/working-tree-validation.js +32 -0
- package/dist/export/working-tree-validation.js.map +1 -1
- package/dist/io/confirm-yes.d.ts +6 -0
- package/dist/io/confirm-yes.d.ts.map +1 -0
- package/dist/io/confirm-yes.js +21 -0
- package/dist/io/confirm-yes.js.map +1 -0
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +3 -2
- package/dist/router.js.map +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 0.2.0
|
|
6
|
+
|
|
7
|
+
- `validate` is public again: same pending batch as `push`, sent with `validate_only`. The server checks import gates (paths, checksums, JSON identity/expand, JS parse, delete guards) and does not apply, build, or stamp. It does not prove SQL or entity compile.
|
|
8
|
+
- Writable `be/entities/` and `be/views/` (simple authoring JSON); designer views convert to code on push; collision filenames (`slug.<thing_id>.ext`); pull after push to refresh `meta/` catalogs
|
|
9
|
+
- Writable `ui/portals/*.json` for portal (`ui_application`) records (create/update/delete on push; public/secure master pages + navigation)
|
|
10
|
+
- Writable `ui/navigation/*.json` for portal navigation trees (create/update/delete on push; menus load this tree at runtime)
|
|
11
|
+
- Default entity widgets (autogenerated list/create/edit) export under read-only `meta/ui/lit/components/`; custom Lit widgets stay in `ui/lit/components/`
|
|
12
|
+
- Pull treats a missing CLI checksum as unstamped (must download); status shows those files as Modified
|
|
13
|
+
- `pull --force <path>` re-downloads only those files (does not fetch the whole project); `status` and a no-op pull print how to restore a local file from the server
|
|
14
|
+
- Pull writes the files-API checksum when it differs from a cached manifest stamp (live schema projection vs last CLI stamp)
|
|
15
|
+
- Push commits checksums for files that saved even if other files in the same batch fail
|
|
16
|
+
- View/entity save success stays applied if build or a dependant rebuild fails; CLI prints `Warning:` and still updates the checksum
|
|
17
|
+
- View authoring sources identify the target by thing UUID (`id`), not `entity_id` / `view_id` / `component_id` (those labels are not unique across applications)
|
|
18
|
+
|
|
19
|
+
## 0.1.2
|
|
20
|
+
|
|
21
|
+
- `push` asks for confirmation when the batch includes deletions; use `--yes` / `-y` to skip (required non-interactively)
|
|
22
|
+
|
|
3
23
|
## 0.1.1
|
|
4
24
|
|
|
5
25
|
- Consumer-facing README (no internal API / auth-path docs)
|
package/README.md
CHANGED
|
@@ -55,6 +55,43 @@ anybuild logout https://your-host.example.com
|
|
|
55
55
|
|
|
56
56
|
On push conflicts, **pull** again, resolve locally, then **push**.
|
|
57
57
|
|
|
58
|
+
A normal **pull** only downloads files whose last snapshot (`.ab/file-state.json`) differs from the server. If a local file still looks Modified after that, the disk copy does not match the stamped checksum. Restore that file without re-downloading the whole project:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
anybuild pull --force be/views/transport_events.json
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
If a push includes **deletions**, the CLI lists them and asks for confirmation. Pass `--yes` (or `-y`) to skip the prompt (required in non-interactive / CI use).
|
|
65
|
+
|
|
66
|
+
## Working trees
|
|
67
|
+
|
|
68
|
+
`status` / `push` track these folders:
|
|
69
|
+
|
|
70
|
+
| Path | What you edit |
|
|
71
|
+
| --- | --- |
|
|
72
|
+
| `ui/lit/components/` | Custom Lit widgets (`.js`) and theme JSON |
|
|
73
|
+
| `ui/navigation/` | Navigation instance JSON |
|
|
74
|
+
| `ui/portals/` | Portal (`ui_application`) JSON |
|
|
75
|
+
| `be/plv8/` | PLV8 functions (`.js`) |
|
|
76
|
+
| `be/node/` | Node modules (`.js`) |
|
|
77
|
+
| `be/entities/` | Entity authoring JSON |
|
|
78
|
+
| `be/views/` | Custom view authoring JSON |
|
|
79
|
+
|
|
80
|
+
`meta/` is **read-only** (catalogs, generated schema dumps, default entity widgets, AI rule files). Do not put source entity/view JSON there.
|
|
81
|
+
|
|
82
|
+
**Entities, views, navigation, and portals**
|
|
83
|
+
|
|
84
|
+
- Files are simple JSON (`id` = thing UUID; `entity_id` / `view_id` / `navigation_id` / `application_id` stay inside the file as labels). View **sources** use target `id` (thing UUID), not `entity_id` / `view_id`, so they can point at objects in other applications. Format: `AGENTS.md` plus `meta/be/entities/RULES.md`, `meta/be/views/RULES.md`, `meta/ui/navigation/RULES.md`, and `meta/ui/portals/RULES.md` after clone/pull.
|
|
85
|
+
- New views are always **code mode** (SQL + named sources).
|
|
86
|
+
- Custom **designer** views export as the same JSON. Editing one and pushing **converts it to code** on the server. Untouched designer views stay designer.
|
|
87
|
+
- Default entity/component views are **not** under `be/views/` (they stay in `meta/`).
|
|
88
|
+
- Default entity widgets (autogenerated list/create/edit) are **not** under `ui/lit/components/` (they stay in `meta/ui/lit/components/`). After pull, delete leftover copies from `ui/lit/components/` if they still appear as Added.
|
|
89
|
+
- If two records share the same `entity_id` / `view_id` / `navigation_id` / `application_id`, files are `slug.json` and `slug.<thing_id>.json`. Push does **not** rename the live id from the filename.
|
|
90
|
+
- Schema apply is one POST: save, then build in dependency order (entities before views, source views before dependents). In a mixed push the order is widgets, then navigation, then portals, then schema.
|
|
91
|
+
- After a schema, navigation, or portal push, run **`anybuild pull`**. Catalogs under `meta/be/catalog/` refresh only on pull.
|
|
92
|
+
|
|
93
|
+
Checksums: `.json` under `ui/lit`, `ui/navigation`, `ui/portals`, `be/entities`, and `be/views` uses canonical JSON; other files use raw UTF-8.
|
|
94
|
+
|
|
58
95
|
## Commands
|
|
59
96
|
|
|
60
97
|
| Command | Description |
|
|
@@ -62,9 +99,10 @@ On push conflicts, **pull** again, resolve locally, then **push**.
|
|
|
62
99
|
| `anybuild login <host-url>` | Sign in (prompts for username and password) |
|
|
63
100
|
| `anybuild logout <host-url>` | Sign out and remove the local session for that host |
|
|
64
101
|
| `anybuild clone <host-url>/<app> [directory]` | Download an application into `./<app>/` (or `[directory]`; use `.` for cwd). Options: `--force`, `--debug` |
|
|
65
|
-
| `anybuild pull` | Download latest changes. Options: `--force
|
|
102
|
+
| `anybuild pull [paths…]` | Download latest changes. Options: `--force` (overwrite local files even when the last snapshot already matches the server; with no paths this re-downloads everything), `--debug` |
|
|
66
103
|
| `anybuild status` | List local added / modified / deleted files |
|
|
67
|
-
| `anybuild
|
|
104
|
+
| `anybuild validate [paths…]` | Check pending changes against the server without applying them (checksums, JSON shape, JS parse, schema expand). Does not compile entities or views. Options: `--debug` |
|
|
105
|
+
| `anybuild push [paths…]` | Upload local changes (optional file paths). Options: `--debug`, `--yes` / `-y` (skip confirm when the push includes deletions) |
|
|
68
106
|
|
|
69
107
|
Also: `anybuild help`, `anybuild -v` / `--version`.
|
|
70
108
|
|
|
@@ -87,12 +125,11 @@ anybuild clone https://your-host.example.com/my-app ./other-folder --force
|
|
|
87
125
|
| `~/.ab/config.json` | Your login sessions (credentials for each host) |
|
|
88
126
|
| `.ab/` in the project | Project settings and sync state (no passwords) |
|
|
89
127
|
|
|
90
|
-
Run project commands (`pull`, `push`, `status`) from inside a cloned application directory.
|
|
128
|
+
Run project commands (`pull`, `push`, `status`, `validate`) from inside a cloned application directory.
|
|
91
129
|
|
|
92
130
|
## Security
|
|
93
131
|
|
|
94
132
|
- Sessions live in `~/.ab/` with restrictive file permissions on Unix. Do not share or commit that folder.
|
|
95
|
-
- Prefer **HTTPS** host URLs.
|
|
96
133
|
- On shared machines, run `anybuild logout <host-url>` when done.
|
|
97
134
|
- Avoid `--debug` in shared or CI logs.
|
|
98
135
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAQnD,CAAC"}
|
package/dist/commands/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { logout } from "./logout.js";
|
|
|
4
4
|
import { pull } from "./pull.js";
|
|
5
5
|
import { push } from "./push.js";
|
|
6
6
|
import { status } from "./status.js";
|
|
7
|
+
import { validate } from "./validate.js";
|
|
7
8
|
export const commands = {
|
|
8
9
|
login,
|
|
9
10
|
logout,
|
|
@@ -11,5 +12,6 @@ export const commands = {
|
|
|
11
12
|
pull,
|
|
12
13
|
status,
|
|
13
14
|
push,
|
|
15
|
+
validate,
|
|
14
16
|
};
|
|
15
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAKzC,MAAM,CAAC,MAAM,QAAQ,GAAmC;IACtD,KAAK;IACL,MAAM;IACN,KAAK;IACL,IAAI;IACJ,MAAM;IACN,IAAI;IACJ,QAAQ;CACT,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../../src/commands/pull.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../../src/commands/pull.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AA6DjD,eAAO,MAAM,IAAI,EAAE,cAgElB,CAAC"}
|
package/dist/commands/pull.js
CHANGED
|
@@ -1,16 +1,67 @@
|
|
|
1
|
+
import { basename } from "node:path";
|
|
1
2
|
import { manifestToFileState, readFileState } from "../export/file-state.js";
|
|
3
|
+
import { restoreFromServerHintForPaths } from "../export/restore-hint.js";
|
|
4
|
+
import { computeExportStatus, statusLineToDiskPath, } from "../export/status.js";
|
|
2
5
|
import { exportPullProject } from "../export/sync.js";
|
|
3
6
|
import { readManifestJson } from "../export/manifest-io.js";
|
|
4
7
|
import { findProjectRoot, loadProjectConfig } from "../config/project-config.js";
|
|
5
8
|
import { createClientForProjectRoot } from "../http/client.js";
|
|
6
9
|
import { AbCliError, CLI_PROGRAM } from "../errors.js";
|
|
7
10
|
import { logProgress } from "../progress.js";
|
|
11
|
+
function normalizeProjectRelativePath(p) {
|
|
12
|
+
return p.trim().replace(/\\/g, "/").replace(/^\.\//, "").replace(/^\/+/, "");
|
|
13
|
+
}
|
|
14
|
+
function isPullFlag(a) {
|
|
15
|
+
return a === "--force" || a === "--debug";
|
|
16
|
+
}
|
|
17
|
+
function formatPullProgress(force, onlyPaths) {
|
|
18
|
+
if (onlyPaths.length === 0) {
|
|
19
|
+
return force ? "Pulling from server (force)…" : "Pulling from server…";
|
|
20
|
+
}
|
|
21
|
+
if (onlyPaths.length === 1) {
|
|
22
|
+
const name = basename(normalizeProjectRelativePath(onlyPaths[0]));
|
|
23
|
+
return force
|
|
24
|
+
? `Force-pulling ${name} from server…`
|
|
25
|
+
: `Pulling ${name} from server…`;
|
|
26
|
+
}
|
|
27
|
+
const n = String(onlyPaths.length);
|
|
28
|
+
return force
|
|
29
|
+
? `Force-pulling ${n} files from server…`
|
|
30
|
+
: `Pulling ${n} files from server…`;
|
|
31
|
+
}
|
|
32
|
+
function formatPullComplete(force, onlyPaths) {
|
|
33
|
+
if (onlyPaths.length === 0) {
|
|
34
|
+
return force ? "Force pull complete." : "Pull complete.";
|
|
35
|
+
}
|
|
36
|
+
if (onlyPaths.length === 1) {
|
|
37
|
+
const name = basename(normalizeProjectRelativePath(onlyPaths[0]));
|
|
38
|
+
return force
|
|
39
|
+
? `Force-pulled ${name} from server.`
|
|
40
|
+
: `Pulled ${name}.`;
|
|
41
|
+
}
|
|
42
|
+
const n = String(onlyPaths.length);
|
|
43
|
+
return force
|
|
44
|
+
? `Force-pulled ${n} files from server.`
|
|
45
|
+
: `Pulled ${n} files.`;
|
|
46
|
+
}
|
|
47
|
+
function remainingDirtyPaths(projectRoot, onlyPaths) {
|
|
48
|
+
const status = computeExportStatus(projectRoot);
|
|
49
|
+
const dirty = [
|
|
50
|
+
...status.modified.map(statusLineToDiskPath),
|
|
51
|
+
...status.deleted,
|
|
52
|
+
].map(normalizeProjectRelativePath);
|
|
53
|
+
if (onlyPaths.length === 0) {
|
|
54
|
+
return [...new Set(dirty)].sort();
|
|
55
|
+
}
|
|
56
|
+
const requested = new Set(onlyPaths.map(normalizeProjectRelativePath));
|
|
57
|
+
return [...new Set(dirty.filter((p) => requested.has(p)))].sort();
|
|
58
|
+
}
|
|
8
59
|
export const pull = async (args) => {
|
|
9
60
|
const force = args.includes("--force");
|
|
10
61
|
const debug = args.includes("--debug");
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
13
|
-
console.error(`Usage: ${CLI_PROGRAM} pull [--force] [--debug]`);
|
|
62
|
+
const paths = args.filter((a) => !isPullFlag(a));
|
|
63
|
+
if (args.some((a) => a.startsWith("-") && !isPullFlag(a))) {
|
|
64
|
+
console.error(`Usage: ${CLI_PROGRAM} pull [--force] [--debug] [path…]`);
|
|
14
65
|
process.exitCode = 1;
|
|
15
66
|
return;
|
|
16
67
|
}
|
|
@@ -32,13 +83,24 @@ export const pull = async (args) => {
|
|
|
32
83
|
if (!state) {
|
|
33
84
|
state = manifestToFileState(manifest);
|
|
34
85
|
}
|
|
35
|
-
logProgress(
|
|
86
|
+
logProgress(formatPullProgress(force, paths));
|
|
36
87
|
const client = await createClientForProjectRoot(root);
|
|
37
88
|
await exportPullProject(root, client, project.application_id, state, {
|
|
38
89
|
force,
|
|
39
90
|
debug,
|
|
91
|
+
onlyPaths: paths.length > 0 ? paths : undefined,
|
|
40
92
|
});
|
|
41
|
-
console.log(force
|
|
93
|
+
console.log(formatPullComplete(force, paths));
|
|
94
|
+
try {
|
|
95
|
+
const hint = restoreFromServerHintForPaths(remainingDirtyPaths(root, paths));
|
|
96
|
+
if (hint !== undefined) {
|
|
97
|
+
console.log("");
|
|
98
|
+
console.log(hint);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
/* status hint is best-effort after a successful pull */
|
|
103
|
+
}
|
|
42
104
|
}
|
|
43
105
|
catch (e) {
|
|
44
106
|
if (e instanceof AbCliError) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pull.js","sourceRoot":"","sources":["../../src/commands/pull.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EA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AM,IAAI,GAAG,6BAA6B,CACxC,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,CACjC,CAAC;YACF,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACvB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBAChB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,wDAAwD;QAC1D,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,YAAY,UAAU,EAAE,CAAC;YAC5B,OAAO,CAAC,KAAK,CAAC,GAAG,WAAW,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YACnD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;QACD,OAAO,CAAC,KAAK,CACX,GAAG,WAAW,UAAU,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CACrE,CAAC;QACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/commands/push.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/commands/push.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAMjD,eAAO,MAAM,IAAI,EAAE,cAiClB,CAAC"}
|
package/dist/commands/push.js
CHANGED
|
@@ -2,10 +2,14 @@ import { findProjectRoot, loadProjectConfig } from "../config/project-config.js"
|
|
|
2
2
|
import { formatImportActionProgress, runImportPush, } from "../export/import-batch.js";
|
|
3
3
|
import { AbCliError, CLI_PROGRAM } from "../errors.js";
|
|
4
4
|
import { logProgress } from "../progress.js";
|
|
5
|
+
function isYesFlag(a) {
|
|
6
|
+
return a === "--yes" || a === "-y";
|
|
7
|
+
}
|
|
5
8
|
export const push = async (args) => {
|
|
6
9
|
try {
|
|
7
10
|
const debug = args.includes("--debug");
|
|
8
|
-
const
|
|
11
|
+
const yes = args.some(isYesFlag);
|
|
12
|
+
const paths = args.filter((a) => a !== "--debug" && !isYesFlag(a));
|
|
9
13
|
logProgress(formatImportActionProgress("push", paths) ?? "Pushing changes to server…");
|
|
10
14
|
const root = findProjectRoot();
|
|
11
15
|
if (root === null) {
|
|
@@ -16,6 +20,7 @@ export const push = async (args) => {
|
|
|
16
20
|
loadProjectConfig(root);
|
|
17
21
|
await runImportPush(root, {
|
|
18
22
|
debug,
|
|
23
|
+
yes,
|
|
19
24
|
onlyPaths: paths.length > 0 ? paths : undefined,
|
|
20
25
|
});
|
|
21
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../src/commands/push.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACjF,OAAO,EACL,0BAA0B,EAC1B,aAAa,GACd,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,MAAM,CAAC,MAAM,IAAI,GAAmB,KAAK,EAAE,IAAI,EAAE,EAAE;IACjD,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QACvC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"push.js","sour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,CAAC,SAAS;SAChD,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,YAAY,UAAU,EAAE,CAAC;YAC5B,OAAO,CAAC,KAAK,CAAC,GAAG,WAAW,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YACnD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;QACD,OAAO,CAAC,KAAK,CACX,GAAG,WAAW,UAAU,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CACrE,CAAC;QACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAwDjD,eAAO,MAAM,MAAM,EAAE,cA8CpB,CAAC"}
|
package/dist/commands/status.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { computeExportStatus, } from "../export/status.js";
|
|
1
|
+
import { computeExportStatus, statusLineToDiskPath, } from "../export/status.js";
|
|
2
|
+
import { restoreFromServerHintGeneric } from "../export/restore-hint.js";
|
|
2
3
|
import { findProjectRoot } from "../config/project-config.js";
|
|
3
4
|
import { AbCliError, CLI_PROGRAM } from "../errors.js";
|
|
4
5
|
import { logProgress } from "../progress.js";
|
|
@@ -19,13 +20,13 @@ function printDebugChecksums(d) {
|
|
|
19
20
|
return;
|
|
20
21
|
}
|
|
21
22
|
console.log("");
|
|
22
|
-
console.log("Checksums (MD5 hex, utf-8): manifest = .ab/manifest.json. Disk: .json under ui/lit uses canonical JSON; other files use raw UTF-8. Backend trees (be/plv8, be/node) also show Modified when manifest differs from .ab/file-state.json (new manifest row). Added = on-disk file not listed in manifest.");
|
|
23
|
+
console.log("Checksums (MD5 hex, utf-8): manifest = .ab/manifest.json. Disk: .json under ui/lit, ui/navigation, ui/portals, be/entities, and be/views uses canonical JSON; other files use raw UTF-8. Backend trees (be/plv8, be/node) also show Modified when manifest differs from .ab/file-state.json (new manifest row). Added = on-disk file not listed in manifest.");
|
|
23
24
|
if (d.modified.length > 0) {
|
|
24
25
|
console.log("");
|
|
25
26
|
console.log("Modified (detail):");
|
|
26
27
|
for (const m of d.modified) {
|
|
27
28
|
const idPart = m.id !== undefined ? ` id: ${m.id}\n` : "";
|
|
28
|
-
console.log(` ${m.line}\n${idPart} manifest: ${m.manifestChecksum}\n disk: ${m.diskChecksum}`);
|
|
29
|
+
console.log(` ${m.line}\n${idPart} manifest: ${m.manifestChecksum ?? "(none)"}\n disk: ${m.diskChecksum}`);
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
if (d.added.length > 0) {
|
|
@@ -40,7 +41,7 @@ function printDebugChecksums(d) {
|
|
|
40
41
|
console.log("Deleted (detail):");
|
|
41
42
|
for (const x of d.deleted) {
|
|
42
43
|
const idPart = x.id !== undefined ? ` id: ${x.id}\n` : "";
|
|
43
|
-
console.log(` ${x.path}\n${idPart} manifest (last known): ${x.manifestChecksum}`);
|
|
44
|
+
console.log(` ${x.path}\n${idPart} manifest (last known): ${x.manifestChecksum ?? "(none)"}`);
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
}
|
|
@@ -65,6 +66,13 @@ export const status = async (args) => {
|
|
|
65
66
|
printSection("Modified", modified);
|
|
66
67
|
printSection("Added", added);
|
|
67
68
|
printSection("Deleted", deleted);
|
|
69
|
+
if (modified.length > 0 || deleted.length > 0) {
|
|
70
|
+
console.log("");
|
|
71
|
+
console.log(restoreFromServerHintGeneric([
|
|
72
|
+
...modified.map(statusLineToDiskPath),
|
|
73
|
+
...deleted,
|
|
74
|
+
]));
|
|
75
|
+
}
|
|
68
76
|
if (debug && result.debug) {
|
|
69
77
|
printDebugChecksums(result.debug);
|
|
70
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GAErB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,SAAS,YAAY,CAAC,KAAa,EAAE,KAAe;IAClD,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;IACzB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACxB,OAAO;IACT,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACxB,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAAC,CAAoB;IAC/C,IACE,CAAC,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;QACvB,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;QACpB,CAAC,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EACtB,CAAC;QACD,OAAO;IACT,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACh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MAAM,GAAG,CAAC,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC9C,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAChB,OAAO,CAAC,GAAG,CACT,4BAA4B,CAAC;gBAC3B,GAAG,QAAQ,CAAC,GAAG,CAAC,oBAAoB,CAAC;gBACrC,GAAG,OAAO;aACX,CAAC,CACH,CAAC;QACJ,CAAC;QACD,IAAI,KAAK,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YAC1B,mBAAmB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,YAAY,UAAU,EAAE,CAAC;YAC5B,OAAO,CAAC,KAAK,CAAC,GAAG,WAAW,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YACrD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;QACD,OAAO,CAAC,KAAK,CACX,GAAG,WAAW,YAAY,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CACvE,CAAC;QACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,eAAO,MAAM,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,eAAO,MAAM,QAAQ,EAAE,cAgCtB,CAAC"}
|
|
@@ -4,7 +4,8 @@ import { AbCliError, CLI_PROGRAM } from "../errors.js";
|
|
|
4
4
|
import { logProgress } from "../progress.js";
|
|
5
5
|
export const validate = async (args) => {
|
|
6
6
|
try {
|
|
7
|
-
const
|
|
7
|
+
const debug = args.includes("--debug");
|
|
8
|
+
const paths = args.filter((a) => a !== "--debug");
|
|
8
9
|
logProgress(formatImportActionProgress("validate", paths) ??
|
|
9
10
|
"Validating changes with server…");
|
|
10
11
|
const root = findProjectRoot();
|
|
@@ -15,6 +16,7 @@ export const validate = async (args) => {
|
|
|
15
16
|
}
|
|
16
17
|
loadProjectConfig(root);
|
|
17
18
|
await runImportValidate(root, {
|
|
19
|
+
debug,
|
|
18
20
|
onlyPaths: paths.length > 0 ? paths : undefined,
|
|
19
21
|
});
|
|
20
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACjF,OAAO,EACL,0BAA0B,EAC1B,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,MAAM,CAAC,MAAM,QAAQ,GAAmB,KAAK,EAAE,IAAI,EAAE,EAAE;IACrD,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACjF,OAAO,EACL,0BAA0B,EAC1B,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvD,O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AAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
/** MD5 hex of UTF-8 string (matches export manifest/checksum in examples). */
|
|
2
2
|
export declare function md5HexUtf8(content: string): string;
|
|
3
|
+
/** True when the server (or a stamp) actually hashed the file. Empty / null is “unknown”. */
|
|
4
|
+
export declare function hasManifestChecksum(value: unknown): value is string;
|
|
5
|
+
/** Disk differs, or the snapshot has no checksum yet so the file must be treated as dirty. */
|
|
6
|
+
export declare function diskDiffersFromManifestChecksum(diskChecksum: string, manifestChecksum: unknown): boolean;
|
|
3
7
|
//# sourceMappingURL=checksum.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checksum.d.ts","sourceRoot":"","sources":["../../src/export/checksum.ts"],"names":[],"mappings":"AAEA,8EAA8E;AAC9E,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAElD"}
|
|
1
|
+
{"version":3,"file":"checksum.d.ts","sourceRoot":"","sources":["../../src/export/checksum.ts"],"names":[],"mappings":"AAEA,8EAA8E;AAC9E,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,6FAA6F;AAC7F,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAEnE;AAED,8FAA8F;AAC9F,wBAAgB,+BAA+B,CAC7C,YAAY,EAAE,MAAM,EACpB,gBAAgB,EAAE,OAAO,GACxB,OAAO,CAIT"}
|
package/dist/export/checksum.js
CHANGED
|
@@ -3,4 +3,12 @@ import { createHash } from "node:crypto";
|
|
|
3
3
|
export function md5HexUtf8(content) {
|
|
4
4
|
return createHash("md5").update(content, "utf8").digest("hex");
|
|
5
5
|
}
|
|
6
|
+
/** True when the server (or a stamp) actually hashed the file. Empty / null is “unknown”. */
|
|
7
|
+
export function hasManifestChecksum(value) {
|
|
8
|
+
return typeof value === "string" && value.length > 0;
|
|
9
|
+
}
|
|
10
|
+
/** Disk differs, or the snapshot has no checksum yet so the file must be treated as dirty. */
|
|
11
|
+
export function diskDiffersFromManifestChecksum(diskChecksum, manifestChecksum) {
|
|
12
|
+
return (!hasManifestChecksum(manifestChecksum) || diskChecksum !== manifestChecksum);
|
|
13
|
+
}
|
|
6
14
|
//# sourceMappingURL=checksum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checksum.js","sourceRoot":"","sources":["../../src/export/checksum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,8EAA8E;AAC9E,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACjE,CAAC"}
|
|
1
|
+
{"version":3,"file":"checksum.js","sourceRoot":"","sources":["../../src/export/checksum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,8EAA8E;AAC9E,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACjE,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AACvD,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,+BAA+B,CAC7C,YAAoB,EACpB,gBAAyB;IAEzB,OAAO,CACL,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,IAAI,YAAY,KAAK,gBAAgB,CAC5E,CAAC;AACJ,CAAC"}
|
|
@@ -10,6 +10,8 @@ export type ImportBatchOptions = {
|
|
|
10
10
|
debug?: boolean;
|
|
11
11
|
/** When set, only push/validate these project-relative paths (must be pending changes). */
|
|
12
12
|
onlyPaths?: readonly string[];
|
|
13
|
+
/** Skip interactive confirmation for pushes that include deletions. */
|
|
14
|
+
yes?: boolean;
|
|
13
15
|
};
|
|
14
16
|
/** Progress line for push/validate when specific paths are requested. */
|
|
15
17
|
export declare function formatImportActionProgress(action: "push" | "validate", onlyPaths: readonly string[] | undefined): string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-batch.d.ts","sourceRoot":"","sources":["../../src/export/import-batch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"import-batch.d.ts","sourceRoot":"","sources":["../../src/export/import-batch.ts"],"names":[],"mappings":"AA6BA,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AASrB,OAAO,KAAK,EAEV,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EACjB,MAAM,YAAY,CAAC;AA0JpB;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,kBAAkB,EAC5B,MAAM,CAAC,EAAE,kBAAkB,GAC1B,cAAc,EAAE,CA2GlB;AAuCD,mFAAmF;AACnF,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,cAAc,EAAE,EACvB,MAAM,EAAE,kBAAkB,EAC1B,SAAS,EAAE,SAAS,MAAM,EAAE,GAC3B,cAAc,EAAE,CAgClB;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2FAA2F;IAC3F,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,uEAAuE;IACvE,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,yEAAyE;AACzE,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,MAAM,GAAG,UAAU,EAC3B,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG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