@anybuild-ai/ab 0.1.2 → 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 +16 -0
- package/README.md +38 -3
- 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/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.map +1 -1
- package/dist/export/import-batch.js +123 -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/router.d.ts.map +1 -1
- package/dist/router.js +2 -1
- package/dist/router.js.map +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
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
|
+
|
|
3
19
|
## 0.1.2
|
|
4
20
|
|
|
5
21
|
- `push` asks for confirmation when the batch includes deletions; use `--yes` / `-y` to skip (required non-interactively)
|
package/README.md
CHANGED
|
@@ -55,8 +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
|
+
|
|
58
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).
|
|
59
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
|
+
|
|
60
95
|
## Commands
|
|
61
96
|
|
|
62
97
|
| Command | Description |
|
|
@@ -64,8 +99,9 @@ If a push includes **deletions**, the CLI lists them and asks for confirmation.
|
|
|
64
99
|
| `anybuild login <host-url>` | Sign in (prompts for username and password) |
|
|
65
100
|
| `anybuild logout <host-url>` | Sign out and remove the local session for that host |
|
|
66
101
|
| `anybuild clone <host-url>/<app> [directory]` | Download an application into `./<app>/` (or `[directory]`; use `.` for cwd). Options: `--force`, `--debug` |
|
|
67
|
-
| `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` |
|
|
68
103
|
| `anybuild status` | List local added / modified / deleted files |
|
|
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` |
|
|
69
105
|
| `anybuild push [paths…]` | Upload local changes (optional file paths). Options: `--debug`, `--yes` / `-y` (skip confirm when the push includes deletions) |
|
|
70
106
|
|
|
71
107
|
Also: `anybuild help`, `anybuild -v` / `--version`.
|
|
@@ -89,12 +125,11 @@ anybuild clone https://your-host.example.com/my-app ./other-folder --force
|
|
|
89
125
|
| `~/.ab/config.json` | Your login sessions (credentials for each host) |
|
|
90
126
|
| `.ab/` in the project | Project settings and sync state (no passwords) |
|
|
91
127
|
|
|
92
|
-
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.
|
|
93
129
|
|
|
94
130
|
## Security
|
|
95
131
|
|
|
96
132
|
- Sessions live in `~/.ab/` with restrictive file permissions on Unix. Do not share or commit that folder.
|
|
97
|
-
- Prefer **HTTPS** host URLs.
|
|
98
133
|
- On shared machines, run `anybuild logout <host-url>` when done.
|
|
99
134
|
- Avoid `--debug` in shared or CI logs.
|
|
100
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,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,
|
|
1
|
+
{"version":3,"file":"pull.js","sourceRoot":"","sources":["../../src/commands/pull.ts"],"names":[],"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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;IAChB,OAAO,CAAC,GAAG,CACT,8VAA8V,CAC/V,CAAC;IACF,IAAI,CAAC,CAAC,QAAQ,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O,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,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,MAAM,CAAC,MAAM,QAAQ,G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|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-batch.d.ts","sourceRoot":"","sources":["../../src/export/import-batch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version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"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
|
-
import { basename } from "node:path";
|
|
1
|
+
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { basename, dirname } from "node:path";
|
|
3
3
|
import { stdin, stdout } from "node:process";
|
|
4
4
|
import { canonicalJsonUtf8 } from "./canonical-json.js";
|
|
5
|
+
import { hasManifestChecksum } from "./checksum.js";
|
|
5
6
|
import { AbCliError, CLI_PROGRAM } from "../errors.js";
|
|
6
7
|
import { confirmYesNo } from "../io/confirm-yes.js";
|
|
7
8
|
import { logBatchProgress, logProgress } from "../progress.js";
|
|
@@ -11,10 +12,12 @@ import { postImportFiles, zipImportOutcomes, } from "./import-files-api.js";
|
|
|
11
12
|
import { manifestToFileState, writeFileState } from "./file-state.js";
|
|
12
13
|
import { readManifestJson, writeManifestJson } from "./manifest-io.js";
|
|
13
14
|
import { safeProjectFilePath } from "./path-sanitize.js";
|
|
14
|
-
import { pathIsUnderBeWorkingTree, pathIsUnderUiLitWorkingTree, } from "./working-dirs.js";
|
|
15
|
+
import { pathIsNavigationFile, pathIsPortalFile, pathIsSchemaEntityFile, pathIsSchemaViewFile, pathIsUnderBeWorkingTree, pathIsUnderCanonicalJsonWorkingTree, pathIsUnderNavigationWorkingTree, pathIsUnderPortalWorkingTree, pathIsUnderSchemaWorkingTree, pathIsUnderUiLitWorkingTree, } from "./working-dirs.js";
|
|
15
16
|
import { computeExportStatus, statusLinePreviousPath, statusLineToDiskPath, } from "./status.js";
|
|
16
17
|
import { parseThingIdFromPlv8Source } from "./be-plv8-identity.js";
|
|
17
18
|
import { isUiWorkingTreeJsPath, isUiWorkingTreeJsonPath, parseCeUuidFromJsSource, } from "./ui-component-identity.js";
|
|
19
|
+
import { normalizeExportContentForWrite } from "./file-content.js";
|
|
20
|
+
import { parseCanonicalAuthoringJson } from "./schema-json.js";
|
|
18
21
|
const IMPORT_FILES_BATCH_SIZE = 10;
|
|
19
22
|
function normalizeProjectRelativePath(p) {
|
|
20
23
|
return p.trim().replace(/\\/g, "/").replace(/^\/+/, "");
|
|
@@ -131,21 +134,44 @@ export function buildImportFileItems(projectRoot, manifest, status) {
|
|
|
131
134
|
items.push({
|
|
132
135
|
operation: "update",
|
|
133
136
|
path: normalizeProjectRelativePath(diskPath),
|
|
134
|
-
type:
|
|
137
|
+
type: pathIsSchemaEntityFile(diskPath)
|
|
138
|
+
? "entity"
|
|
139
|
+
: pathIsSchemaViewFile(diskPath)
|
|
140
|
+
? "view"
|
|
141
|
+
: pathIsNavigationFile(diskPath)
|
|
142
|
+
? "navigation"
|
|
143
|
+
: pathIsPortalFile(diskPath)
|
|
144
|
+
? "portal"
|
|
145
|
+
: entry.type,
|
|
135
146
|
id: entry.id,
|
|
136
147
|
base_timestamp: entry.timestamp,
|
|
137
|
-
base_checksum: entry.checksum
|
|
148
|
+
base_checksum: hasManifestChecksum(entry.checksum)
|
|
149
|
+
? entry.checksum
|
|
150
|
+
: undefined,
|
|
138
151
|
content,
|
|
139
152
|
encoding: "utf-8",
|
|
140
153
|
});
|
|
141
154
|
}
|
|
142
155
|
for (const path of buckets.added) {
|
|
143
156
|
const p = normalizeProjectRelativePath(path);
|
|
144
|
-
if (isUiWorkingTreeJsonPath(p)) {
|
|
157
|
+
if (isUiWorkingTreeJsonPath(p) && !pathIsUnderCanonicalJsonWorkingTree(p)) {
|
|
145
158
|
throw new AbCliError("VALIDATION", `Cannot create JSON via push: ${path}`);
|
|
146
159
|
}
|
|
147
160
|
const abs = safeProjectFilePath(projectRoot, path);
|
|
148
|
-
|
|
161
|
+
let content = readFileSync(abs, "utf8");
|
|
162
|
+
if (pathIsUnderCanonicalJsonWorkingTree(p)) {
|
|
163
|
+
const identity = parseCanonicalAuthoringJson(p, content);
|
|
164
|
+
content = canonicalJsonUtf8(content);
|
|
165
|
+
items.push({
|
|
166
|
+
operation: "create",
|
|
167
|
+
path: p,
|
|
168
|
+
type: identity.kind,
|
|
169
|
+
id: identity.id,
|
|
170
|
+
content,
|
|
171
|
+
encoding: "utf-8",
|
|
172
|
+
});
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
149
175
|
const parsed = parseJsIdentityFromSource(content, path);
|
|
150
176
|
if (!parsed.ok) {
|
|
151
177
|
throw new AbCliError("VALIDATION", `${path}: ${parsed.message}`);
|
|
@@ -171,10 +197,20 @@ export function buildImportFileItems(projectRoot, manifest, status) {
|
|
|
171
197
|
items.push({
|
|
172
198
|
operation: "delete",
|
|
173
199
|
path: normalizeProjectRelativePath(entry.path),
|
|
174
|
-
type:
|
|
200
|
+
type: pathIsSchemaEntityFile(np)
|
|
201
|
+
? "entity"
|
|
202
|
+
: pathIsSchemaViewFile(np)
|
|
203
|
+
? "view"
|
|
204
|
+
: pathIsNavigationFile(np)
|
|
205
|
+
? "navigation"
|
|
206
|
+
: pathIsPortalFile(np)
|
|
207
|
+
? "portal"
|
|
208
|
+
: entry.type,
|
|
175
209
|
id: entry.id,
|
|
176
210
|
base_timestamp: entry.timestamp,
|
|
177
|
-
base_checksum: entry.checksum
|
|
211
|
+
base_checksum: hasManifestChecksum(entry.checksum)
|
|
212
|
+
? entry.checksum
|
|
213
|
+
: undefined,
|
|
178
214
|
});
|
|
179
215
|
}
|
|
180
216
|
return items;
|
|
@@ -266,8 +302,8 @@ export function applyImportResultsToManifest(manifest, items, results) {
|
|
|
266
302
|
continue;
|
|
267
303
|
}
|
|
268
304
|
if (item.operation === "create") {
|
|
269
|
-
if (r.
|
|
270
|
-
|
|
305
|
+
if (!hasManifestChecksum(r.checksum) || r.timestamp === undefined) {
|
|
306
|
+
continue;
|
|
271
307
|
}
|
|
272
308
|
manifest.files.push({
|
|
273
309
|
id: r.id,
|
|
@@ -279,8 +315,8 @@ export function applyImportResultsToManifest(manifest, items, results) {
|
|
|
279
315
|
continue;
|
|
280
316
|
}
|
|
281
317
|
if (item.operation === "update") {
|
|
282
|
-
if (r.
|
|
283
|
-
|
|
318
|
+
if (!hasManifestChecksum(r.checksum) || r.timestamp === undefined) {
|
|
319
|
+
continue;
|
|
284
320
|
}
|
|
285
321
|
const idn = normId(r.id);
|
|
286
322
|
const f = manifest.files.find((x) => normId(x.id) === idn);
|
|
@@ -300,12 +336,50 @@ export function applyImportResultsToManifest(manifest, items, results) {
|
|
|
300
336
|
}
|
|
301
337
|
manifest.project.timestamp = latest;
|
|
302
338
|
}
|
|
339
|
+
function writeAppliedSchemaFiles(projectRoot, items, results) {
|
|
340
|
+
for (let i = 0; i < items.length; i++) {
|
|
341
|
+
const item = items[i];
|
|
342
|
+
const result = results[i];
|
|
343
|
+
if (result.status !== "applied" || item.operation === "delete") {
|
|
344
|
+
continue;
|
|
345
|
+
}
|
|
346
|
+
if (!pathIsUnderCanonicalJsonWorkingTree(item.path)) {
|
|
347
|
+
continue;
|
|
348
|
+
}
|
|
349
|
+
if (result.content === undefined) {
|
|
350
|
+
continue;
|
|
351
|
+
}
|
|
352
|
+
const abs = safeProjectFilePath(projectRoot, item.path);
|
|
353
|
+
mkdirSync(dirname(abs), { recursive: true });
|
|
354
|
+
const body = normalizeExportContentForWrite(result.content, {
|
|
355
|
+
id: result.id,
|
|
356
|
+
manifestPath: item.path,
|
|
357
|
+
absPath: abs,
|
|
358
|
+
});
|
|
359
|
+
writeFileSync(abs, body, "utf8");
|
|
360
|
+
}
|
|
361
|
+
}
|
|
303
362
|
async function sendImportBatches(projectRoot, items, validateOnly, debug) {
|
|
304
363
|
const project = loadProjectConfig(projectRoot);
|
|
305
364
|
const client = await createClientForProjectRoot(projectRoot);
|
|
306
365
|
const allItems = [];
|
|
307
366
|
const allResults = [];
|
|
308
|
-
const
|
|
367
|
+
const schemaItems = items.filter((item) => pathIsUnderSchemaWorkingTree(item.path));
|
|
368
|
+
const navigationItems = items.filter((item) => pathIsUnderNavigationWorkingTree(item.path));
|
|
369
|
+
const portalItems = items.filter((item) => pathIsUnderPortalWorkingTree(item.path));
|
|
370
|
+
const otherItems = items.filter((item) => !pathIsUnderSchemaWorkingTree(item.path) &&
|
|
371
|
+
!pathIsUnderNavigationWorkingTree(item.path) &&
|
|
372
|
+
!pathIsUnderPortalWorkingTree(item.path));
|
|
373
|
+
const batches = chunk(otherItems, IMPORT_FILES_BATCH_SIZE);
|
|
374
|
+
if (navigationItems.length > 0) {
|
|
375
|
+
batches.push(navigationItems);
|
|
376
|
+
}
|
|
377
|
+
if (portalItems.length > 0) {
|
|
378
|
+
batches.push(portalItems);
|
|
379
|
+
}
|
|
380
|
+
if (schemaItems.length > 0) {
|
|
381
|
+
batches.push(schemaItems);
|
|
382
|
+
}
|
|
309
383
|
const batchLabel = validateOnly ? "Validating" : "Uploading";
|
|
310
384
|
if (batches.length > 0) {
|
|
311
385
|
logProgress(`${batchLabel} ${String(items.length)} change(s)…`);
|
|
@@ -338,20 +412,33 @@ async function sendImportBatches(projectRoot, items, validateOnly, debug) {
|
|
|
338
412
|
}
|
|
339
413
|
throw e;
|
|
340
414
|
}
|
|
341
|
-
const { failures } = zipImportOutcomes(batch, response.results);
|
|
342
|
-
if (failures.length > 0) {
|
|
343
|
-
const head = validateOnly ? "Validation failed" : "Import failed";
|
|
344
|
-
const tail = validateOnly ? "" : "\nRun pull and retry.";
|
|
345
|
-
const debugDump = debug
|
|
346
|
-
? `\n\n[debug] request (/api/cli/v1/import/files):\n${requestBodyText}\n\n[debug] response:\n${responseBodyText}`
|
|
347
|
-
: "";
|
|
348
|
-
throw new AbCliError("HTTP", `${head}:\n${failures.join("\n")}${tail}${debugDump}`);
|
|
349
|
-
}
|
|
350
415
|
allItems.push(...batch);
|
|
351
416
|
allResults.push(...response.results);
|
|
417
|
+
if (validateOnly) {
|
|
418
|
+
const { failures } = zipImportOutcomes(batch, response.results);
|
|
419
|
+
if (failures.length > 0) {
|
|
420
|
+
const debugDump = debug
|
|
421
|
+
? `\n\n[debug] request (/api/cli/v1/import/files):\n${requestBodyText}\n\n[debug] response:\n${responseBodyText}`
|
|
422
|
+
: "";
|
|
423
|
+
throw new AbCliError("HTTP", `Validation failed:\n${failures.join("\n")}${debugDump}`);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
352
426
|
}
|
|
353
427
|
return { allItems, allResults };
|
|
354
428
|
}
|
|
429
|
+
function uniqueAppliedMessages(results) {
|
|
430
|
+
const messages = [];
|
|
431
|
+
for (const result of results) {
|
|
432
|
+
if (result.status !== "applied") {
|
|
433
|
+
continue;
|
|
434
|
+
}
|
|
435
|
+
const message = result.message?.trim();
|
|
436
|
+
if (message && !messages.includes(message)) {
|
|
437
|
+
messages.push(message);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
return messages;
|
|
441
|
+
}
|
|
355
442
|
function resolveImportItems(projectRoot, manifest, onlyPaths) {
|
|
356
443
|
const status = computeExportStatus(projectRoot, { onlyPaths });
|
|
357
444
|
let items = buildImportFileItems(projectRoot, manifest, status);
|
|
@@ -374,7 +461,7 @@ export async function runImportValidate(projectRoot, options) {
|
|
|
374
461
|
console.log("Nothing to validate (no local changes vs manifest).");
|
|
375
462
|
return;
|
|
376
463
|
}
|
|
377
|
-
await sendImportBatches(projectRoot, items, true,
|
|
464
|
+
await sendImportBatches(projectRoot, items, true, options?.debug === true);
|
|
378
465
|
console.log(`Validated ${items.length} pending change(s). OK.`);
|
|
379
466
|
}
|
|
380
467
|
export async function runImportPush(projectRoot, options) {
|
|
@@ -407,9 +494,21 @@ export async function runImportPush(projectRoot, options) {
|
|
|
407
494
|
}
|
|
408
495
|
const working = cloneManifest(manifest);
|
|
409
496
|
const { allItems, allResults } = await sendImportBatches(projectRoot, items, false, options?.debug === true);
|
|
497
|
+
writeAppliedSchemaFiles(projectRoot, allItems, allResults);
|
|
410
498
|
applyImportResultsToManifest(working, allItems, allResults);
|
|
411
499
|
writeManifestJson(projectRoot, working);
|
|
412
500
|
writeFileState(projectRoot, manifestToFileState(working));
|
|
501
|
+
const appliedCount = allResults.filter(result => result.status === `applied`).length;
|
|
502
|
+
for (const message of uniqueAppliedMessages(allResults)) {
|
|
503
|
+
console.log(`Warning: ${message}`);
|
|
504
|
+
}
|
|
505
|
+
const { failures } = zipImportOutcomes(allItems, allResults);
|
|
506
|
+
if (failures.length > 0) {
|
|
507
|
+
const committed = appliedCount > 0
|
|
508
|
+
? `\nCommitted ${String(appliedCount)} file(s). Failed files are still dirty.`
|
|
509
|
+
: ``;
|
|
510
|
+
throw new AbCliError(`HTTP`, `Import failed:\n${failures.join(`\n`)}${committed}`);
|
|
511
|
+
}
|
|
413
512
|
if (onlyPaths !== undefined && onlyPaths.length === 1) {
|
|
414
513
|
console.log(`Pushed ${basename(normalizeProjectRelativePath(onlyPaths[0]))}.`);
|
|
415
514
|
}
|