@synopackageland/cli 0.52.18 → 0.53.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 +7 -0
- package/README.md +19 -16
- package/dist/e2e/dsm.d.ts +1 -1
- package/dist/e2e/dsm.js +1 -1
- package/dist/error-registry.js +5 -5
- package/dist/init.js +10 -8
- package/dist/package-manager.d.ts +4 -0
- package/dist/package-manager.js +48 -0
- package/dist/standalone/bridge-app.js +4 -2
- package/dist/standalone/build.js +6 -5
- package/dist/standalone/manifest.js +1 -1
- package/dist/standalone/sdk-check.js +2 -4
- package/package.json +6 -5
- package/schema/dsm-api-contract.json +1 -1
- package/skills/SKILL.md +8 -8
- package/skills/reference/compose.md +1 -1
- package/skills/reference/create.md +1 -1
- package/skills/reference/ctl.md +1 -1
- package/skills/reference/testing.md +7 -7
- package/skills/reference/ui-json.md +8 -8
- package/skills/reference/ui-vue.md +6 -6
- package/skills/reference/upstream-fork.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.53.0 (2026-11-10)
|
|
4
|
+
|
|
5
|
+
- Recommend pnpm throughout project creation, CLI hints and bundled skills
|
|
6
|
+
- Read pnpm SDK locks and preserve compatibility with existing npm Apps
|
|
7
|
+
- Use pnpm for frontend commands selected by project metadata
|
|
8
|
+
- Require the pnpm templates release for new projects
|
|
9
|
+
|
|
3
10
|
## 0.52.18 (2026-11-10)
|
|
4
11
|
|
|
5
12
|
- Add `install.recommended_memory_mb`: below it, the install wizard shows a warning page the administrator can continue past, with the NAS memory, the recommendation and the App's optional `install.recommended_memory_message` catalog text in each wizard language. Preinst, upgrades and CLI installations never check it.
|
package/README.md
CHANGED
|
@@ -7,18 +7,21 @@ Full documentation: <https://www.varvis.me/docs/> ([繁體中文](https://www.va
|
|
|
7
7
|
|
|
8
8
|
## Install
|
|
9
9
|
|
|
10
|
+
Enable pnpm with Corepack before installing the CLI:
|
|
11
|
+
|
|
10
12
|
```sh
|
|
11
|
-
|
|
13
|
+
corepack enable pnpm
|
|
14
|
+
pnpm add -g @synopackageland/cli --registry=https://registry.npmjs.org
|
|
12
15
|
```
|
|
13
16
|
|
|
14
|
-
Native Go apps need Go
|
|
17
|
+
Native Go apps need Go and pnpm. The CLI is tested on the supported Node.js release.
|
|
15
18
|
|
|
16
19
|
## Quick start
|
|
17
20
|
|
|
18
21
|
```sh
|
|
19
22
|
synopkgland init -t native-go --with files,jobs,login --package MyApp my-app
|
|
20
23
|
cd my-app
|
|
21
|
-
(cd frontend &&
|
|
24
|
+
(cd frontend && pnpm install)
|
|
22
25
|
synopkgland check --json
|
|
23
26
|
synopkgland build --arch x86_64 --json
|
|
24
27
|
synopkgland inspect dist/MyApp-0.1.0-0001-x86_64.spk --json
|
|
@@ -85,7 +88,7 @@ A Portal without an SDK is rejected by both `check` and `build` with
|
|
|
85
88
|
|
|
86
89
|
SDK module downloads preserve normal Go checksum verification and the user's Go
|
|
87
90
|
settings; Go Apps also check their existing `backend/go.sum`. Commit that file
|
|
88
|
-
alongside
|
|
91
|
+
alongside package lockfiles. Do not disable checksum verification for public SDK
|
|
89
92
|
packages. Private mirrors can use explicitly configured Go authentication and
|
|
90
93
|
checksum settings; a failed fetch reports `SDK_DOWNLOAD_FAILED`.
|
|
91
94
|
|
|
@@ -114,9 +117,9 @@ with the latest SDK; HTTP navigation then shows standard HTTPS guidance. See
|
|
|
114
117
|
`init` and `add` read their templates from the locally installed
|
|
115
118
|
`@synopackageland/templates`. The CLI's npm dependency range selects compatible
|
|
116
119
|
templates patches during installation or update. Templates
|
|
117
|
-
patches need only a templates release; update the
|
|
120
|
+
patches need only a templates release; update the CLI installation with pnpm to receive them.
|
|
118
121
|
The CLI never fetches templates at runtime, so offline use works after installation;
|
|
119
|
-
commit a lockfile and use `
|
|
122
|
+
commit a lockfile and use `pnpm install --frozen-lockfile` to reproduce a chosen dependency tree.
|
|
120
123
|
The CLI accepts SDK executor manifest format 1 across SDK minor versions. The
|
|
121
124
|
exact SDK Go module sum anchors the build manifest; npm integrity anchors the
|
|
122
125
|
identical manifest in `@synopackageland/sdk/executor-manifest.json`. No manifest
|
|
@@ -128,8 +131,8 @@ format can still require one.
|
|
|
128
131
|
For development against local checkouts, set `SYNOPKGLAND_TEMPLATES_DIR` to a
|
|
129
132
|
templates checkout and `SYNOPKGLAND_SDK_DIR` to an SDK checkout; SPKs built with
|
|
130
133
|
`SYNOPKGLAND_SDK_DIR` warn `EXECUTOR_DIGEST_UNVERIFIED` and must not be published. A Vue project
|
|
131
|
-
packs the local SDK into its frontend (`
|
|
132
|
-
`
|
|
134
|
+
packs the local SDK into its frontend (`pnpm install --no-frozen-lockfile`) without building it: run
|
|
135
|
+
`pnpm install && pnpm run build` in `$SYNOPKGLAND_SDK_DIR/ts` first, and again after SDK changes.
|
|
133
136
|
|
|
134
137
|
Frontend builds may emit `app.module.js` exporting `mount(root, ctx)`, plus
|
|
135
138
|
`app.css` and relative ES module chunks. The CLI packages that output under a
|
|
@@ -141,7 +144,7 @@ Apps keep their existing registration contract and paths. See the SDK's
|
|
|
141
144
|
To check the CLI's DSM terminology rules against templates without a new templates release:
|
|
142
145
|
|
|
143
146
|
```sh
|
|
144
|
-
SYNOPKGLAND_TEMPLATES_DIR=/path/to/templates
|
|
147
|
+
SYNOPKGLAND_TEMPLATES_DIR=/path/to/templates pnpm run test:glossary
|
|
145
148
|
```
|
|
146
149
|
|
|
147
150
|
This compares `OFF_GLOSSARY` and the Italian sentence rule, including regex sources and
|
|
@@ -281,8 +284,8 @@ flight otherwise rejects into a run error that carries its headers.
|
|
|
281
284
|
|
|
282
285
|
### App-open smoke
|
|
283
286
|
|
|
284
|
-
Every template includes `
|
|
285
|
-
at the project root and `
|
|
287
|
+
Every template includes `pnpm run e2e:smoke` and a small test. Run `pnpm install`
|
|
288
|
+
at the project root and `pnpm dlx @e2e-dev/web install chromium` once before using it:
|
|
286
289
|
|
|
287
290
|
```ts
|
|
288
291
|
import { appOpenSmoke } from '@synopackageland/cli/e2e';
|
|
@@ -322,8 +325,8 @@ The smoke never installs packages or changes accounts/privileges.
|
|
|
322
325
|
Every project includes `AGENTS.md` and a `CLAUDE.md` pointer. Start with
|
|
323
326
|
`synopkgland skill list` and `synopkgland skill show orchestrator`. For UI work, read
|
|
324
327
|
`synopkgland skill show ui-vue` (Vue components) or `synopkgland skill show ui-json`
|
|
325
|
-
(JSON specs). From an installed frontend, `
|
|
326
|
-
UI components and `
|
|
328
|
+
(JSON specs). From an installed frontend, `pnpm exec syno-pkg-land-ui catalog --json` lists the
|
|
329
|
+
UI components and `pnpm exec syno-pkg-land-ui describe Button --json` describes one.
|
|
327
330
|
|
|
328
331
|
## Licensing
|
|
329
332
|
|
|
@@ -335,7 +338,7 @@ Third-party components keep their own terms.
|
|
|
335
338
|
- An SPK carries its legal notices under `LICENSES/` in the installed payload: `TEMPLATE.txt`,
|
|
336
339
|
an optional `APP.txt`, `SDK.txt` (the SDK's MIT license, when `backend/go.mod` requires the SDK),
|
|
337
340
|
Go's license, patents and third-party notices, and the Vue UI notices.
|
|
338
|
-
- Vue builds generate the UI notices from the installed dependencies; run `
|
|
341
|
+
- Vue builds generate the UI notices from the installed dependencies; run `pnpm install` in
|
|
339
342
|
`frontend/` first. A missing notice or version mismatch fails the build.
|
|
340
343
|
- Keep `backend/THIRD_PARTY_NOTICES.txt` current when you change Go modules. Your own binaries,
|
|
341
344
|
added modules, container images and upstream apps need their own notices.
|
|
@@ -703,8 +706,8 @@ For same-origin App URLs, see [DSM path ingress](docs/path-ingress.md).
|
|
|
703
706
|
|
|
704
707
|
### CLI release checks
|
|
705
708
|
|
|
706
|
-
`
|
|
707
|
-
Use `
|
|
709
|
+
`pnpm run gates` runs basic checks and is the default for release packaging and CI.
|
|
710
|
+
Use `pnpm run gates:full` only when explicitly requested. See
|
|
708
711
|
[release entry points and checks](docs/release-checks.md) for the complete inventory.
|
|
709
712
|
|
|
710
713
|
## Native HTTP ctl
|
package/dist/e2e/dsm.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export declare function llmSettings(env?: Env): {
|
|
|
51
51
|
};
|
|
52
52
|
/** The `agents.default` entry of e2e.config.ts: model plus the effort sent with every request. */
|
|
53
53
|
export declare function e2eAgent(env?: Env): {
|
|
54
|
-
model: import("@ai-sdk/
|
|
54
|
+
model: ReturnType<ReturnType<typeof import("@ai-sdk/openai").createOpenAI>["chat"]>;
|
|
55
55
|
providerOptions: {
|
|
56
56
|
openai: {
|
|
57
57
|
reasoningEffort: string;
|
package/dist/e2e/dsm.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// cookies and tokens are masked in what that command prints and leaves in its
|
|
9
9
|
// e2e output, which is made private (directories 700, files 600).
|
|
10
10
|
//
|
|
11
|
-
// node tests/e2e/support/dsm.ts tunnel --
|
|
11
|
+
// node tests/e2e/support/dsm.ts tunnel -- pnpm exec e2e run
|
|
12
12
|
import { loginDsm } from "../nas/auth.js";
|
|
13
13
|
import { sessionFetch } from "../nas/transport.js";
|
|
14
14
|
import { canonicalOrigin } from "../nas/transport.js";
|
package/dist/error-registry.js
CHANGED
|
@@ -616,7 +616,7 @@ export const ERROR_REGISTRY = {
|
|
|
616
616
|
STANDALONE_UI_BUILD_INVALID: {
|
|
617
617
|
code: "STANDALONE_UI_BUILD_INVALID",
|
|
618
618
|
description: "The ui.build configuration is invalid.",
|
|
619
|
-
suggestion: "ui.build.command must be an argv string array (not going through a shell), for example [
|
|
619
|
+
suggestion: "ui.build.command must be an argv string array (not going through a shell), for example [pnpm, run, build]",
|
|
620
620
|
},
|
|
621
621
|
STANDALONE_TIMEOUT_UNSUPPORTED: {
|
|
622
622
|
code: "STANDALONE_TIMEOUT_UNSUPPORTED",
|
|
@@ -641,7 +641,7 @@ export const ERROR_REGISTRY = {
|
|
|
641
641
|
STANDALONE_UI_BUILD_FAILED: {
|
|
642
642
|
code: "STANDALONE_UI_BUILD_FAILED",
|
|
643
643
|
description: "The UI build command failed.",
|
|
644
|
-
suggestion: "Install the UI dependencies in ui.build.cwd (
|
|
644
|
+
suggestion: "Install the UI dependencies in ui.build.cwd (pnpm install --frozen-lockfile when pnpm-lock.yaml exists, otherwise pnpm install), then run the UI build command and fix the errors",
|
|
645
645
|
},
|
|
646
646
|
STANDALONE_UI_ENTRY_MISSING: {
|
|
647
647
|
code: "STANDALONE_UI_ENTRY_MISSING",
|
|
@@ -1071,7 +1071,7 @@ export const ERROR_REGISTRY = {
|
|
|
1071
1071
|
SDK_DIR_NOT_READY: {
|
|
1072
1072
|
code: "SDK_DIR_NOT_READY",
|
|
1073
1073
|
description: "The SDK checkout SYNOPKGLAND_SDK_DIR points at has no go.mod, or the ts package a Vue project needs is not built (no ts/dist).",
|
|
1074
|
-
suggestion: "Point at a syno-pkg-land-sdk checkout; for a Vue project first run
|
|
1074
|
+
suggestion: "Point at a syno-pkg-land-sdk checkout; for a Vue project first run pnpm install && pnpm run build in $SYNOPKGLAND_SDK_DIR/ts (pnpm does not build file: packages for you)",
|
|
1075
1075
|
},
|
|
1076
1076
|
SDK_DOWNLOAD_FAILED: {
|
|
1077
1077
|
code: "SDK_DOWNLOAD_FAILED",
|
|
@@ -1181,7 +1181,7 @@ export const ERROR_REGISTRY = {
|
|
|
1181
1181
|
STANDALONE_NODE_DEPENDENCY_MISSING: {
|
|
1182
1182
|
code: "STANDALONE_NODE_DEPENDENCY_MISSING",
|
|
1183
1183
|
description: "The Node App's package.json dependencies are not installed in the App's node_modules.",
|
|
1184
|
-
suggestion: "Run
|
|
1184
|
+
suggestion: "Run pnpm install --prod --node-linker=hoisted in the App directory and build again; the CLI places @synopackageland/app, so it does not need installing",
|
|
1185
1185
|
},
|
|
1186
1186
|
STANDALONE_BRIDGE_APP_INVALID: {
|
|
1187
1187
|
code: "STANDALONE_BRIDGE_APP_INVALID",
|
|
@@ -1206,7 +1206,7 @@ export const ERROR_REGISTRY = {
|
|
|
1206
1206
|
STANDALONE_NODE_SDK_NOT_BUILT: {
|
|
1207
1207
|
code: "STANDALONE_NODE_SDK_NOT_BUILT",
|
|
1208
1208
|
description: "The App's SDK version has no built Node SDK (node/dist).",
|
|
1209
|
-
suggestion: "Run
|
|
1209
|
+
suggestion: "Run pnpm install && pnpm run build in node/ of the SYNOPKGLAND_SDK_DIR checkout first; a release SDK must contain node/dist",
|
|
1210
1210
|
},
|
|
1211
1211
|
COMPOSE_POSIX_ALL_SHARES_UNDECLARED: {
|
|
1212
1212
|
code: "COMPOSE_POSIX_ALL_SHARES_UNDECLARED",
|
package/dist/init.js
CHANGED
|
@@ -208,7 +208,7 @@ export function initFromTemplate(template, targetDir, options = {}) {
|
|
|
208
208
|
"AGENTS.md",
|
|
209
209
|
"CLAUDE.md",
|
|
210
210
|
...sharedScripts,
|
|
211
|
-
...["package.json", "e2e.config.ts", "e2e.ai.config.ts"].filter(file => existsSync(join(shared, file))),
|
|
211
|
+
...["package.json", "pnpm-lock.yaml", "pnpm-workspace.yaml", "e2e.config.ts", "e2e.ai.config.ts"].filter(file => existsSync(join(shared, file))),
|
|
212
212
|
...["tests", "scripts"].flatMap(dir => existsSync(join(shared, dir)) ? templateFiles(join(shared, dir)).map(file => `${dir}/${file}`) : []),
|
|
213
213
|
];
|
|
214
214
|
const files = [
|
|
@@ -321,7 +321,7 @@ export function initFromTemplate(template, targetDir, options = {}) {
|
|
|
321
321
|
if (ui === "vue") {
|
|
322
322
|
const manifest = join(targetDir, "dsm-package.yaml");
|
|
323
323
|
writeFileSync(manifest, readFileSync(manifest, "utf8")
|
|
324
|
-
.replace(" dir: ui", " dir: frontend/dist\n build: {cwd: frontend, command: [
|
|
324
|
+
.replace(" dir: ui", " dir: frontend/dist\n build: {cwd: frontend, command: [pnpm, run, build]}")
|
|
325
325
|
.replace(" launch: new-page\n", "")
|
|
326
326
|
.replace("Non-UI-SDK frontends open a full page", "UI SDK frontends open a DSM window"));
|
|
327
327
|
rmSync(join(targetDir, "ui"), { recursive: true });
|
|
@@ -387,16 +387,16 @@ export function initFromTemplate(template, targetDir, options = {}) {
|
|
|
387
387
|
const BACKEND_TESTS = {
|
|
388
388
|
"native-go": "go test ./...",
|
|
389
389
|
"native-python": "python3 -m unittest discover -s tests",
|
|
390
|
-
"native-node": "
|
|
390
|
+
"native-node": "pnpm install --frozen-lockfile && pnpm test && pnpm run build",
|
|
391
391
|
"native-rust": "cargo test --locked",
|
|
392
392
|
};
|
|
393
393
|
/** What to run after init in `dir`, for a template built from source; undefined for the others. */
|
|
394
394
|
export function initNextSteps(template, dir, frontend, localSdk) {
|
|
395
395
|
if (!isNativeTemplate(template))
|
|
396
396
|
return undefined;
|
|
397
|
-
//
|
|
397
|
+
// Local SDK overrides change the dependency graph and need a refreshed lockfile.
|
|
398
398
|
const install = frontend
|
|
399
|
-
? ` (cd frontend &&
|
|
399
|
+
? ` (cd frontend && pnpm install${localSdk ? " --no-frozen-lockfile" : " --frozen-lockfile"})\n`
|
|
400
400
|
: "";
|
|
401
401
|
return `Next steps:\n cd ${dir}\n (cd backend && ${BACKEND_TESTS[template]})\n${install} synopkgland ctl generate\n synopkgland check\n synopkgland build\nSee README.md.`;
|
|
402
402
|
}
|
|
@@ -496,7 +496,7 @@ function vendorAppSdk(template, targetDir) {
|
|
|
496
496
|
}
|
|
497
497
|
/**
|
|
498
498
|
* A local sdk checkout must hold the Go module, and for a Vue frontend the
|
|
499
|
-
* built ts package:
|
|
499
|
+
* built ts package: pnpm installs a file: package as it is, without its build.
|
|
500
500
|
*/
|
|
501
501
|
function assertLocalSdkReady(sdkDir, vue) {
|
|
502
502
|
if (!existsSync(join(sdkDir, "go.mod"))) {
|
|
@@ -504,7 +504,7 @@ function assertLocalSdkReady(sdkDir, vue) {
|
|
|
504
504
|
}
|
|
505
505
|
const ts = join(sdkDir, "ts");
|
|
506
506
|
if (vue && !existsSync(join(ts, "dist"))) {
|
|
507
|
-
throw new Error(`[SDK_DIR_NOT_READY] ${ts} is not built;
|
|
507
|
+
throw new Error(`[SDK_DIR_NOT_READY] ${ts} is not built; pnpm does not build a local SDK when the frontend installs it. Run (cd ${ts} && pnpm install && pnpm run build) first, and rebuild after SDK source changes`);
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
510
|
/**
|
|
@@ -531,7 +531,9 @@ function useLocalSdk(targetDir, sdkDir) {
|
|
|
531
531
|
const pkg = JSON.parse(readFileSync(frontend, "utf8"));
|
|
532
532
|
pkg.dependencies[SDK_PACKAGE] = local;
|
|
533
533
|
writeFileSync(frontend, JSON.stringify(pkg, null, 2) + "\n");
|
|
534
|
-
//
|
|
534
|
+
// Keep pnpm's complete graph until install --no-frozen-lockfile resolves
|
|
535
|
+
// the changed manifest; a file: importer without its package entry is invalid.
|
|
536
|
+
// Keep older npm templates usable with a local SDK override.
|
|
535
537
|
const lockPath = join(targetDir, "frontend/package-lock.json");
|
|
536
538
|
if (!existsSync(lockPath))
|
|
537
539
|
return;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function packageManager(root: string): "pnpm" | "npm";
|
|
2
|
+
export declare function installCommand(root: string): string;
|
|
3
|
+
/** Prefer pnpm evidence, never accept a stale importer or a missing package. */
|
|
4
|
+
export declare function lockedDependencyVersion(root: string, name: string, spec: string): string | undefined;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { parseAllDocuments } from "yaml";
|
|
4
|
+
export function packageManager(root) {
|
|
5
|
+
let declared;
|
|
6
|
+
try {
|
|
7
|
+
declared = JSON.parse(readFileSync(join(root, "package.json"), "utf8")).packageManager;
|
|
8
|
+
}
|
|
9
|
+
catch { }
|
|
10
|
+
if (existsSync(join(root, "pnpm-lock.yaml")) || String(declared).startsWith("pnpm@"))
|
|
11
|
+
return "pnpm";
|
|
12
|
+
return String(declared).startsWith("npm@") || existsSync(join(root, "package-lock.json")) ? "npm" : "pnpm";
|
|
13
|
+
}
|
|
14
|
+
export function installCommand(root) {
|
|
15
|
+
if (packageManager(root) === "npm")
|
|
16
|
+
return existsSync(join(root, "package-lock.json")) ? "npm ci" : "npm install";
|
|
17
|
+
return existsSync(join(root, "pnpm-lock.yaml")) ? "pnpm install --frozen-lockfile" : "pnpm install";
|
|
18
|
+
}
|
|
19
|
+
/** Prefer pnpm evidence, never accept a stale importer or a missing package. */
|
|
20
|
+
export function lockedDependencyVersion(root, name, spec) {
|
|
21
|
+
try {
|
|
22
|
+
if (existsSync(join(root, "pnpm-lock.yaml"))) {
|
|
23
|
+
const documents = parseAllDocuments(readFileSync(join(root, "pnpm-lock.yaml"), "utf8"));
|
|
24
|
+
if (documents.some(document => document.errors.length))
|
|
25
|
+
return undefined;
|
|
26
|
+
const lock = documents.at(-1)?.toJSON();
|
|
27
|
+
const importer = lock?.importers?.["."] ?? lock;
|
|
28
|
+
const entry = importer?.dependencies?.[name] ?? importer?.devDependencies?.[name];
|
|
29
|
+
const declared = entry?.specifier ?? importer?.specifiers?.[name];
|
|
30
|
+
if (declared !== spec)
|
|
31
|
+
return undefined;
|
|
32
|
+
const resolved = String(entry?.version ?? entry).replace(/^\//, "");
|
|
33
|
+
const version = resolved.match(/^(?:.*\/)?(\d+\.\d+\.\d+)(?:\(|_|$)/)?.[1];
|
|
34
|
+
if (!version)
|
|
35
|
+
return undefined;
|
|
36
|
+
return Object.keys(lock.packages ?? {}).some(key => key === `${name}@${version}` || key.startsWith(`${name}@${version}(`) ||
|
|
37
|
+
key === `/${name}@${version}` || key.startsWith(`/${name}@${version}(`) ||
|
|
38
|
+
key === `/${name}/${version}` || key.startsWith(`/${name}/${version}_`)) ? version : undefined;
|
|
39
|
+
}
|
|
40
|
+
const lock = JSON.parse(readFileSync(join(root, "package-lock.json"), "utf8"));
|
|
41
|
+
const importer = lock.packages?.[""];
|
|
42
|
+
return (importer?.dependencies?.[name] ?? importer?.devDependencies?.[name]) === spec
|
|
43
|
+
? lock.packages?.[`node_modules/${name}`]?.version : undefined;
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -6,6 +6,7 @@ import { METHOD } from "./bridge-backend.js";
|
|
|
6
6
|
import { PYTHON_VENDOR_DIR } from "./bridge-json.js";
|
|
7
7
|
import { sdkBackend } from "./manifest.js";
|
|
8
8
|
import { StandaloneBuildError } from "./spk.js";
|
|
9
|
+
import { installCommand, packageManager } from "../package-manager.js";
|
|
9
10
|
/** The Node SDK's package name, which the CLI places in the App's node_modules. */
|
|
10
11
|
export const NODE_SDK_PACKAGE = "@synopackageland/app";
|
|
11
12
|
const PYTHON_SDK = "synopkgland_app";
|
|
@@ -102,7 +103,7 @@ export function copyPythonSdk(sdkRoot, target) {
|
|
|
102
103
|
/** The Node SDK as npm would install it: its package.json and its compiled dist/. */
|
|
103
104
|
export function copyNodeSdk(source, target) {
|
|
104
105
|
if (!existsSync(join(source, "dist/index.js"))) {
|
|
105
|
-
throw new StandaloneBuildError("STANDALONE_NODE_SDK_NOT_BUILT", `The Node SDK has no dist/: ${source}. Run
|
|
106
|
+
throw new StandaloneBuildError("STANDALONE_NODE_SDK_NOT_BUILT", `The Node SDK has no dist/: ${source}. Run pnpm install && pnpm run build in node/ of the SYNOPKGLAND_SDK_DIR checkout first; a release SDK must contain node/dist`);
|
|
106
107
|
}
|
|
107
108
|
mkdirSync(target, { recursive: true });
|
|
108
109
|
copyFileSync(join(source, "package.json"), join(target, "package.json"));
|
|
@@ -117,7 +118,8 @@ function checkNodeDependencies(dir) {
|
|
|
117
118
|
const dependencies = JSON.parse(readFileSync(manifest, "utf8")).dependencies ?? {};
|
|
118
119
|
const missing = Object.keys(dependencies).filter(name => name !== NODE_SDK_PACKAGE && !existsSync(join(dir, "node_modules", name, "package.json")));
|
|
119
120
|
if (missing.length) {
|
|
120
|
-
|
|
121
|
+
const command = `${installCommand(dir)} ${packageManager(dir) === "pnpm" ? "--prod --node-linker=hoisted" : "--omit=dev"}`;
|
|
122
|
+
throw new StandaloneBuildError("STANDALONE_NODE_DEPENDENCY_MISSING", `The package.json dependencies are not installed in the App's node_modules: ${missing.join(", ")}; run ${command} in the App directory and build again`);
|
|
121
123
|
}
|
|
122
124
|
}
|
|
123
125
|
/** Copies an App tree: regular files and directories only, without dot entries and Python bytecode. */
|
package/dist/standalone/build.js
CHANGED
|
@@ -8,6 +8,7 @@ import { buildApiDescription } from "./api-description.js";
|
|
|
8
8
|
import { buildNativeMetadataCgi } from './native-http.js';
|
|
9
9
|
import { goChildEnv } from "../runtime/go-env.js";
|
|
10
10
|
import { spawn } from "node:child_process";
|
|
11
|
+
import { installCommand, packageManager } from "../package-manager.js";
|
|
11
12
|
import { goModulePath, privateSdkHint, SDK_MODULE, sdkSource, } from "../runtime/sdk-source.js";
|
|
12
13
|
import { existsSync, mkdirSync, mkdtempSync, rmSync } from "node:fs";
|
|
13
14
|
import { tmpdir } from "node:os";
|
|
@@ -202,18 +203,18 @@ async function buildUi(manifest, run) {
|
|
|
202
203
|
if (!build) {
|
|
203
204
|
return;
|
|
204
205
|
}
|
|
205
|
-
const [
|
|
206
|
+
const [configured, ...args] = build.command;
|
|
207
|
+
const command = configured === "npm" || configured === "pnpm" ? packageManager(build.cwd) : configured;
|
|
206
208
|
const result = await run(command, args, {
|
|
207
209
|
cwd: build.cwd,
|
|
208
210
|
env: { ...process.env },
|
|
209
211
|
});
|
|
210
212
|
if (result.missing || result.status !== 0) {
|
|
211
|
-
const installHint =
|
|
212
|
-
existsSync(join(build.cwd, "package.json")) &&
|
|
213
|
+
const installHint = existsSync(join(build.cwd, "package.json")) &&
|
|
213
214
|
!existsSync(join(build.cwd, "node_modules"))
|
|
214
|
-
? `\nThe UI dependencies are not installed
|
|
215
|
+
? `\nThe UI dependencies are not installed; run ${installCommand(build.cwd)} in ${build.cwd}, then run build again`
|
|
215
216
|
: "";
|
|
216
|
-
throw new StandaloneBuildError("STANDALONE_UI_BUILD_FAILED", `UI build (${
|
|
217
|
+
throw new StandaloneBuildError("STANDALONE_UI_BUILD_FAILED", `UI build (${[command, ...args].join(" ")}) failed${installHint}\n${result.stderr}`);
|
|
217
218
|
}
|
|
218
219
|
}
|
|
219
220
|
/** The checked CGI of one architecture and, with capabilities.jobs, its fixed worker; or the runtime and App of a bridge App. */
|
|
@@ -1056,7 +1056,7 @@ function readUi(value, c) {
|
|
|
1056
1056
|
if (!Array.isArray(command) ||
|
|
1057
1057
|
command.length === 0 ||
|
|
1058
1058
|
!command.every((arg) => typeof arg === "string" && arg !== "")) {
|
|
1059
|
-
return c.fail("STANDALONE_UI_BUILD_INVALID", "ui.build.command must be an argv string array (not going through a shell), for example [
|
|
1059
|
+
return c.fail("STANDALONE_UI_BUILD_INVALID", "ui.build.command must be an argv string array (not going through a shell), for example [pnpm, run, build]");
|
|
1060
1060
|
}
|
|
1061
1061
|
const cwd = c.path(build.cwd, "ui.build.cwd");
|
|
1062
1062
|
return dir && cwd
|
|
@@ -4,6 +4,7 @@ import { CLI_VERSION } from "../cli-version.js";
|
|
|
4
4
|
import { appSdkVersion, SDK_DEPENDENCY, SDK_FLOOR, SDK_PACKAGE, sdkBelowFloor, sdkSource, goModDownload } from "../runtime/sdk-source.js";
|
|
5
5
|
import { predatesExecutorManifest } from '../runtime/sdk-executor-manifest.js';
|
|
6
6
|
import { SHIPPED_EXECUTOR_DIGESTS } from '../runtime/executor-source.js';
|
|
7
|
+
import { lockedDependencyVersion } from "../package-manager.js";
|
|
7
8
|
/** The file that names each backend kind's SDK version. */
|
|
8
9
|
const SDK_VERSION_FILE = { go: "backend/go.mod", rust: "Cargo.lock", python: "backend.sdk", node: "backend.sdk" };
|
|
9
10
|
/**
|
|
@@ -61,10 +62,7 @@ function frontendSdkVersion(frontendDir) {
|
|
|
61
62
|
const tilde = /^~(\d+)\.(\d+)\.(\d+)$/.exec(spec);
|
|
62
63
|
if (tilde) {
|
|
63
64
|
const installed = readJson(join(frontendDir, "node_modules", SDK_PACKAGE, "package.json"));
|
|
64
|
-
const
|
|
65
|
-
const declared = lock?.packages?.[""];
|
|
66
|
-
const lockedSpec = declared?.dependencies?.[SDK_PACKAGE] ?? declared?.devDependencies?.[SDK_PACKAGE];
|
|
67
|
-
const version = installed?.version ?? (lockedSpec === spec ? lock?.packages?.[`node_modules/${SDK_PACKAGE}`]?.version : undefined);
|
|
65
|
+
const version = installed?.version ?? lockedDependencyVersion(frontendDir, SDK_PACKAGE, spec);
|
|
68
66
|
const resolved = typeof version === "string" ? /^(\d+)\.(\d+)\.(\d+)$/.exec(version) : null;
|
|
69
67
|
return { spec, version: resolved && resolved[1] === tilde[1] && resolved[2] === tilde[2] &&
|
|
70
68
|
Number(resolved[3]) >= Number(tilde[3]) ? version : undefined };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synopackageland/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.0",
|
|
4
4
|
"description": "Syno Package Land Developer Kit CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"scripts": {
|
|
29
29
|
"check:docs": "node --test scripts/check-doc-versions.test.mjs && node scripts/check-doc-versions.mjs",
|
|
30
30
|
"build": "rm -rf dist && node scripts/prepare-native-http.mjs && tsc",
|
|
31
|
-
"test": "
|
|
31
|
+
"test": "pnpm run build && node --import tsx --import ./test/helpers/strict-dsm-setup.ts --test --test-concurrency=${SYNOPKGLAND_GATE_JOBS:-3} test/*.test.ts test/ctl/*.test.ts",
|
|
32
32
|
"test:glossary": "node --test scripts/test/glossary-drift.test.mjs",
|
|
33
33
|
"test:scripts": "node --test scripts/test/gate.test.mjs scripts/test/release.test.mjs scripts/test/pack-docker.test.mjs scripts/test/npm-pack.test.mjs scripts/test/executor-bump.test.mjs scripts/test/smoke-exports.test.mjs scripts/test/parallel.test.mjs scripts/test/scaffold-matrix.test.mjs scripts/test/frontend-deps.test.mjs scripts/test/docker-gate.test.mjs scripts/test/gate-plan.test.mjs scripts/test/gates.test.mjs && python3 scripts/test/npm-publish.py",
|
|
34
34
|
"gates": "bash scripts/ci/gates.sh",
|
|
35
35
|
"gates:fast": "bash scripts/ci/gates.sh",
|
|
36
|
-
"prepublishOnly": "
|
|
36
|
+
"prepublishOnly": "pnpm run build && node --input-type=module -e 'import {enforceRepositorySecrets} from \"./dist/secret-files.js\"; enforceRepositorySecrets(process.cwd())'",
|
|
37
37
|
"gates:full": "bash scripts/ci/gates.sh --full",
|
|
38
38
|
"test:basic": "node --import tsx --test test/schema.test.ts test/standalone-manifest.test.ts test/native-arch.test.ts test/archive-inventory.test.ts test/secret-files.test.ts",
|
|
39
39
|
"check:dsm-contract": "node scripts/check-dsm-api-contract.mjs",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@napi-rs/keyring": "^2.1.1",
|
|
44
|
-
"@synopackageland/templates": "~0.
|
|
44
|
+
"@synopackageland/templates": "~0.42.0",
|
|
45
45
|
"ajv": "^8.17.1",
|
|
46
46
|
"commander": "^13.1.0",
|
|
47
47
|
"esbuild": "^0.28.2",
|
|
@@ -98,5 +98,6 @@
|
|
|
98
98
|
"./package.json": "./package.json",
|
|
99
99
|
"./native-layout": "./dist/standalone/native-layout.js",
|
|
100
100
|
"./e2e": "./dist/e2e/dsm.js"
|
|
101
|
-
}
|
|
101
|
+
},
|
|
102
|
+
"packageManager": "pnpm@12.18.0"
|
|
102
103
|
}
|
|
@@ -1144,7 +1144,7 @@
|
|
|
1144
1144
|
"deploy/plan.ts": "1f772811ca963bdf863462a256d8e810c151e096a55a91a753bd5bf855921536",
|
|
1145
1145
|
"deploy/spk-version.ts": "407a79491ffac8d00ecb9b056ab0b352e08bf6142871fa46f302fd217f98fc24",
|
|
1146
1146
|
"e2e/certificates.ts": "e9801e5f4d326d31c3c281e5106f34138493e26cd7f0ad2b1dd3f6a566832389",
|
|
1147
|
-
"e2e/dsm.ts": "
|
|
1147
|
+
"e2e/dsm.ts": "f1a21dcfa3bfae23051b845a0265569fcbb5aa82660e701c0cc4e71da2dba428",
|
|
1148
1148
|
"error-registry.ts": "91f2de89bf98750a09fce54420e3a25e3527980be175ed704890a520181f1dc9",
|
|
1149
1149
|
"host/catalog-install.ts": "13908fd47d75f8a2f4ed412c9310b80b2d0a1d190ce46db34f15850c2ed45578",
|
|
1150
1150
|
"host/compose-project-recovery.ts": "51f93197898677b5daebd745ef848e07b7d6454fc86b5d4e1fa210fe089ac414",
|
package/skills/SKILL.md
CHANGED
|
@@ -27,9 +27,9 @@ SPK packing rejects local environment files, npm tokens and private-key PEM bloc
|
|
|
27
27
|
See [reference/create.md](reference/create.md).
|
|
28
28
|
|
|
29
29
|
The CLI installs templates through its declared npm dependency range. A templates patch needs only a
|
|
30
|
-
templates release;
|
|
30
|
+
templates release; pnpm install/update selects a patch in that minor line. The CLI
|
|
31
31
|
uses the locally installed templates and reads their SDK pin for defaults; it
|
|
32
|
-
never downloads templates at runtime. Preserve the lockfile and use `
|
|
32
|
+
never downloads templates at runtime. Preserve the lockfile and use `pnpm install --frozen-lockfile` for
|
|
33
33
|
reproducible offline-ready installations. SDK minor releases are independent of
|
|
34
34
|
the CLI: executor manifest format 1 in the resolved SDK pins the executor release,
|
|
35
35
|
Go toolchain and six payload digests. Preserve npm integrity and Go module sums.
|
|
@@ -208,10 +208,10 @@ UI/locale strings and release notes unchanged. See
|
|
|
208
208
|
[Vue copy and i18n](reference/ui-vue.md#ui-copy-and-i18n) and
|
|
209
209
|
[JSON copy and i18n](reference/ui-json.md#ui-copy-and-i18n) for examples.
|
|
210
210
|
|
|
211
|
-
For UI discovery, run `
|
|
212
|
-
`
|
|
211
|
+
For UI discovery, run `pnpm exec syno-pkg-land-ui catalog --json` and
|
|
212
|
+
`pnpm exec syno-pkg-land-ui describe Button --json` from the installed frontend.
|
|
213
213
|
Read its prompt and exported Vue docs/types before choosing component APIs.
|
|
214
|
-
Use `syno-pkg-land-ui` directly in
|
|
214
|
+
Use `syno-pkg-land-ui` directly in package scripts; keep AI guidance version-independent.
|
|
215
215
|
|
|
216
216
|
For existing native products, schema 2 `backend: {kind: native}` preserves project-owned payload/metadata, prepare/compile argv hooks and pinned toolkits. See the native-layout guide; run `check`, `build`, then `inspect <spk>` locally. Keep lifecycle/systemd as the package account and preserve product-owned digest approval/revocation. Native layouts do not opt into generated Go capabilities.
|
|
217
217
|
|
|
@@ -391,7 +391,7 @@ adequate model with low effort, never an expensive default.
|
|
|
391
391
|
|
|
392
392
|
## App-open smoke
|
|
393
393
|
|
|
394
|
-
Every generated project has `tests/e2e/smoke.e2e.ts` and `
|
|
394
|
+
Every generated project has `tests/e2e/smoke.e2e.ts` and `pnpm run e2e:smoke`.
|
|
395
395
|
Use `appOpenSmoke` from `@synopackageland/cli/e2e`; keep one content-specific
|
|
396
396
|
`ready` selector or text marker. It derives the manifest entry and launcher,
|
|
397
397
|
reuses the existing DSM credentials/profiles/tunnel, and registers administrator,
|
|
@@ -467,8 +467,8 @@ HTTPS 要求,不能陷入重登入循環。另驗跨分頁重新登入後的
|
|
|
467
467
|
|
|
468
468
|
## Maintaining this CLI
|
|
469
469
|
|
|
470
|
-
For CLI releases, `
|
|
471
|
-
npm pack and tarball content checks. Run `
|
|
470
|
+
For CLI releases, `pnpm run gates` runs basic build/typecheck, core unit checks,
|
|
471
|
+
npm pack and tarball content checks. Run `pnpm run gates:full` only when the user
|
|
472
472
|
explicitly requests extended matrices and integration checks. Publishing does
|
|
473
473
|
not require a full-gate result. Application fixture acceptance remains scoped
|
|
474
474
|
to the application task's authorization.
|
|
@@ -276,7 +276,7 @@ declared availability readiness, LAN isolation/egress, protected grant lifecycle
|
|
|
276
276
|
ACLs, two-user visibility and clean install/upgrade/reboot/stop/uninstall before
|
|
277
277
|
calling the package supported on a NAS. No NAS is accessed by the build gate.
|
|
278
278
|
|
|
279
|
-
The unified Compose contract uses SDK defaults from locally installed templates and a matching CLI. Templates patches can ship independently;
|
|
279
|
+
The unified Compose contract uses SDK defaults from locally installed templates and a matching CLI. Templates patches can ship independently; pnpm install/update resolves them, and SDK defaults come from the installed templates. SDK minor upgrades do not require a CLI release when they declare supported executor manifest format 1; the resolved SDK owns the release mapping and verified payload digests. The CLI does not fetch templates at runtime. The legacy packaging route and bridge publish mode are removed.
|
|
280
280
|
|
|
281
281
|
Primary override files, and each included override set, must share a directory. Cross-directory override bases are rejected before loader I/O. Included implicit .env files are confined, inventoried and preserved; symlinks are rejected.
|
|
282
282
|
|
|
@@ -76,7 +76,7 @@ backend: {runtime: rust, dir: app, entry: hello, methods: [hello.greet]}
|
|
|
76
76
|
`init -t native-python|native-node|native-rust` 沿用 native-go 的 UI(`ui/`、`i18n/`,Vue 時是 `frontend/`)、jobs/delegate 的前端與 root-ops 的 `root/whoami.sh`;能力 overlay 換掉 backend 的 stub 模組。`--with jobs` 的範例讀取呼叫者選的檔案,所以同時宣告 `files: session`;delegate 讓登入使用者開啟 App 並存報告(`app.status`、`report.save` 為 `authenticated`);Rust 的 `backend.methods` 會加上能力的 methods。init 把測試要 import 的 App SDK 放進 `backend/vendor/`(`backend.sdk` 的 release,或 SYNOPKGLAND_SDK_DIR);build 另外打包它。`--shared-folder` 只適用於 native-go;`add` 仍只支援 Go backend。
|
|
77
77
|
|
|
78
78
|
- Python:DSM 的 `/usr/bin/python3`;SDK 放進 `app/vendor/synopkgland_app/`,`PYTHONPATH=vendor`。
|
|
79
|
-
- Node:Package Center 的 Node.js_v18/v20/v22 成為 INFO `install_dep_packages`;SDK 的 `package.json` 與 `dist/` 放進 `node_modules/@synopackageland/app`,其他 dependencies 先在 App 目錄 `
|
|
79
|
+
- Node:Package Center 的 Node.js_v18/v20/v22 成為 INFO `install_dep_packages`;SDK 的 `package.json` 與 `dist/` 放進 `node_modules/@synopackageland/app`,其他 dependencies 先在 App 目錄 `pnpm install --frozen-lockfile --prod`。
|
|
80
80
|
- Rust:Cargo.toml 以 git+tag 相依 `syno-pkg-land-app`;`cargo zigbuild` 交叉編譯(x86_64/aarch64 musl、armv7 glibc),`panic = "unwind"`;binary 在 `app/bin/<entry>`。需要 rustup 的 cargo、三個 target、cargo-zigbuild 與 zig。
|
|
81
81
|
- methods:沒寫時 build 在建置機執行 `<entry> --describe`;Rust 必須寫。每個 App method 都必須明列於 `operations.json` 並指定 AI class;`ctl generate` 產生 `permissions.json` 與 runtime bindings,且表內只能設定 methods 內的 method。動態名稱與自訂 HTTP dispatcher 會被拒絕;請使用固定 SDK routes。
|
|
82
82
|
- capabilities:`files`、`identity`、`jobs`、`rootOps`、`delegate`(僅 `until-revoked`+`files.moveFromStaging`+destinations)與 `portal`;daemon 需要 Go。jobs 或 delegate 時,同一個 runtime 另裝為 `target/background/worker`,DSM 以套件帳號執行 `worker --worker`;rootOps、delegate 附 executor,`bridge.json` 的 delegate digest 必須等於 SPK 的 executor。
|
package/skills/reference/ctl.md
CHANGED
|
@@ -429,7 +429,7 @@ handler and SPK inspect. Business effects are explicitly authored: POST can be a
|
|
|
429
429
|
read and a confirmed GET can be an action. Never infer effect from the HTTP verb.
|
|
430
430
|
|
|
431
431
|
For CLI development, set `SYNOPKGLAND_SDK_DIR` to an authorized matching SDK
|
|
432
|
-
checkout before `
|
|
432
|
+
checkout before `pnpm run build` and focused native tests. The build generates
|
|
433
433
|
contract types and packaged schema assets directly from that checkout. Release
|
|
434
434
|
builds must use a published matching SDK selected by
|
|
435
435
|
`SYNOPKGLAND_NATIVE_HTTP_SDK_VERSION`; development checkouts are test inputs,
|
|
@@ -10,20 +10,20 @@ after every change. Nothing runs on a NAS automatically.
|
|
|
10
10
|
|
|
11
11
|
| Tier | Explicit command | Minimal useful assertion |
|
|
12
12
|
| --- | --- | --- |
|
|
13
|
-
| Local unit / ctl registry | `
|
|
14
|
-
| Local package | `
|
|
15
|
-
| Real-NAS ctl | `
|
|
16
|
-
| Real-NAS UI, no AI | `
|
|
17
|
-
| Optional AI UI step | `
|
|
13
|
+
| Local unit / ctl registry | `pnpm test` or `pnpm run test:unit` | Pin an operation's CLI path, read/write effect and handler; unit-test business results |
|
|
14
|
+
| Local package | `pnpm run test:local` | Check, build one architecture, inspect each emitted SPK |
|
|
15
|
+
| Real-NAS ctl | `pnpm run test:nas:ctl` | Use actual `synopkgland ctl` commands and assert package ID, caller role and nonroot UID |
|
|
16
|
+
| Real-NAS UI, no AI | `pnpm run e2e:ui` | Use selectors, perform the primary action and assert its changed saved/read-back result |
|
|
17
|
+
| Optional AI UI step | `pnpm run e2e:ai` | One bounded `agent.act` followed by the same deterministic result assertion |
|
|
18
18
|
|
|
19
19
|
After the user opts into tests, the default development loop runs only the first
|
|
20
20
|
tier relevant to the change. The local package tier is a separate, explicit
|
|
21
|
-
check. Every NAS tier, including `
|
|
21
|
+
check. Every NAS tier, including `pnpm run e2e:smoke`, needs an explicit user
|
|
22
22
|
request and authorized fixtures. Keep build/release and lifecycle hooks independent
|
|
23
23
|
of tests. Test failures are evidence to report, not an automatic release veto.
|
|
24
24
|
|
|
25
25
|
`init` includes examples under `tests/unit`, `tests/local`, `tests/ctl` and
|
|
26
|
-
`tests/e2e`, plus independent
|
|
26
|
+
`tests/e2e`, plus independent package scripts. Adapt examples when replacing the
|
|
27
27
|
starter status operation; an empty upstream registry has no starter contract to
|
|
28
28
|
test. Do not add ctl to a wrapper merely to enable the example. Existing
|
|
29
29
|
backend-language unit tests remain useful when the user chooses them.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# JSON UI for DSM apps
|
|
2
2
|
|
|
3
3
|
Use the project's installed `@synopackageland/ui` from the frontend directory.
|
|
4
|
-
Run `
|
|
4
|
+
Run `pnpm install --frozen-lockfile` first if dependencies are missing. Run `pnpm exec syno-pkg-land-ui <command>`
|
|
5
5
|
to use the package bin, or add `node_modules/.bin` to PATH and use `syno-pkg-land-ui <command>`
|
|
6
6
|
for the commands below. Discovery and validation must use the app's installed SDK
|
|
7
7
|
and lockfile. If the installed bin is missing, report the missing CLI and stop the
|
|
@@ -11,11 +11,11 @@ Check the installed package CLI usage for its supported options.
|
|
|
11
11
|
## Discover before generating
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
pnpm exec syno-pkg-land-ui prompt
|
|
15
|
+
pnpm exec syno-pkg-land-ui catalog --json
|
|
16
|
+
pnpm exec syno-pkg-land-ui schema
|
|
17
|
+
pnpm exec syno-pkg-land-ui describe AppRoot --json
|
|
18
|
+
pnpm exec syno-pkg-land-ui describe AppShell --json
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
Read these outputs and describe each additional component you need. Use the
|
|
@@ -59,7 +59,7 @@ This is authoring guidance; it does not add validation to the commands below.
|
|
|
59
59
|
After saving the generated spec as `ui.json`, run:
|
|
60
60
|
|
|
61
61
|
```sh
|
|
62
|
-
|
|
62
|
+
pnpm exec syno-pkg-land-ui validate ui.json --json --strict
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
Pass the actual host contracts when needed: `--actions save,refresh`,
|
|
@@ -72,7 +72,7 @@ Fix every reported JSON Pointer `path` using its `hint`, then validate again
|
|
|
72
72
|
until exit 0 with no warnings. Next run:
|
|
73
73
|
|
|
74
74
|
```sh
|
|
75
|
-
|
|
75
|
+
pnpm exec syno-pkg-land-ui render ui.json --json --strict --widths 390,700,960,1350 --out shots
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
Render needs Node 22 or newer and local Chrome/Chromium; set `CHROME` to its
|
|
@@ -31,12 +31,12 @@ Do not convert the existing app merely to run the JSON checker.
|
|
|
31
31
|
|
|
32
32
|
## Discover the installed contract
|
|
33
33
|
|
|
34
|
-
Work from `frontend` after `
|
|
34
|
+
Work from `frontend` after `pnpm install --frozen-lockfile`. See [ui-json.md](ui-json.md) for the shared
|
|
35
35
|
package-bin setup. Query the installed package before choosing components:
|
|
36
36
|
|
|
37
37
|
```sh
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
pnpm exec syno-pkg-land-ui catalog --json
|
|
39
|
+
pnpm exec syno-pkg-land-ui describe Button --json
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
Describe each component you intend to use. The CLI catalog describes the JSON
|
|
@@ -153,9 +153,9 @@ excluding upstream source; this guidance does not add a CLI check or gate.
|
|
|
153
153
|
From `frontend`, run:
|
|
154
154
|
|
|
155
155
|
```sh
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
pnpm exec vue-tsc --noEmit
|
|
157
|
+
pnpm run build
|
|
158
|
+
pnpm test
|
|
159
159
|
```
|
|
160
160
|
|
|
161
161
|
Inspect screenshots of the actual app at its minimum DSM width and a maximized
|
|
@@ -154,7 +154,7 @@ When the upstream web panel is the only UI, configure `daemon` and
|
|
|
154
154
|
`i18n/messages/` for its localized responses. Keep the manifest's i18n
|
|
155
155
|
declaration, wrapper lifecycle files, notices and any explicitly authorized ctl
|
|
156
156
|
adapters/registry. Delete the unused `ui/` (or Vue `frontend/`) and UI e2e files
|
|
157
|
-
under `tests/e2e/`, along with unused e2e configs,
|
|
157
|
+
under `tests/e2e/`, along with unused e2e configs, package scripts and dependencies.
|
|
158
158
|
Retain any local/backend tests you choose to use.
|
|
159
159
|
|
|
160
160
|
The DSM menu and Package Center Open both use `sso/open.cgi` to open the
|