@synopackageland/cli 0.52.18 → 0.53.1

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.53.1 (2026-11-10)
4
+
5
+ - Fix daemon RPCs returning 404 when an App with `daemon.ingress` opens through its Application Portal alias on DSM's default web server (80/443). The build now also enables `daemon/ingress-nginx.conf` as `nginx-static-config` `type: www` for Apps that declare `portal`; the location, socket, headers and limits are the same file as on the DSM ports. Apps without `portal`, and Apps without `daemon.ingress`, keep an unchanged `conf/resource`.
6
+ - `inspect` expects the `www` entry in a portal App with daemon ingress; rebuild SPKs made with 0.53.0 or earlier.
7
+
8
+ ## 0.53.0 (2026-11-10)
9
+
10
+ - Recommend pnpm throughout project creation, CLI hints and bundled skills
11
+ - Read pnpm SDK locks and preserve compatibility with existing npm Apps
12
+ - Use pnpm for frontend commands selected by project metadata
13
+ - Require the pnpm templates release for new projects
14
+
3
15
  ## 0.52.18 (2026-11-10)
4
16
 
5
17
  - 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
- npm install -g @synopackageland/cli --registry=https://registry.npmjs.org
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 1.26.10 and npm. The CLI is tested on Node.js 22.19.
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 && npm install)
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 npm lockfiles. Do not disable checksum verification for public SDK
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 npm installation to receive them.
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 `npm ci` to reproduce a chosen dependency tree.
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 (`npm install --install-links`) without building it: run
132
- `npm ci && npm run build` in `$SYNOPKGLAND_SDK_DIR/ts` first, and again after SDK changes.
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 npm run test:glossary
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 `npm run e2e:smoke` and a small test. Run `npm install`
285
- at the project root and `npx @e2e-dev/web install chromium` once before using it:
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, `npx --no syno-pkg-land-ui catalog --json` lists the
326
- UI components and `npx --no syno-pkg-land-ui describe Button --json` describes one.
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 `npm install` in
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
- `npm run gates` runs basic checks and is the default for release packaging and CI.
707
- Use `npm run gates:full` only when explicitly requested. See
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/provider").LanguageModelV4;
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 -- npx e2e run
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";
@@ -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 [npm, run, build].",
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 (npm ci when package-lock.json exists, otherwise npm install), then run the UI build command and fix the errors.",
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 npm ci && npm run build in $SYNOPKGLAND_SDK_DIR/ts (npm does not build file: packages for you).",
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 npm ci --omit=dev in the App directory and build again; the CLI places @synopackageland/app, so it does not need installing.",
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 npm ci && npm run build in node/ of the SYNOPKGLAND_SDK_DIR checkout first; a release SDK must contain node/dist.",
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: [npm, run, build]}")
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": "npm ci && npm test && npm run build",
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
- // --install-links packs a local SDK like the released package; a symlink would load the checkout's own node_modules.
397
+ // Local SDK overrides change the dependency graph and need a refreshed lockfile.
398
398
  const install = frontend
399
- ? ` (cd frontend && npm install${localSdk ? " --install-links" : ""})\n`
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: npm installs a file: package as it is, without its build.
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; npm does not build a local SDK when the frontend installs it. Run (cd ${ts} && npm ci && npm run build) first, and rebuild after SDK source changes.`);
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
- // npm installs what the lockfile records; without the released entry it installs the local package.
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 npm ci && npm run build in node/ of the SYNOPKGLAND_SDK_DIR checkout first; a release SDK must contain node/dist.`);
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
- throw new StandaloneBuildError("STANDALONE_NODE_DEPENDENCY_MISSING", `The package.json dependencies are not installed in the App's node_modules: ${missing.join(", ")}. Run npm ci --omit=dev in the App directory and build again.`);
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. */
@@ -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 [command, ...args] = build.command;
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 = command === "npm" &&
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. Run npm ${existsSync(join(build.cwd, "package-lock.json")) ? "ci" : "install"} in ${build.cwd}, then run build again.`
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 (${build.command.join(" ")}) failed. ${installHint}\n${result.stderr}`);
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. */
@@ -14,9 +14,20 @@ export declare function daemonIngressMinDsmProblem(osMinVer: string | undefined)
14
14
  export declare const daemonIngressSocket: (pkg: string) => string;
15
15
  /** What the daemon learns: where to listen and which path prefix it serves. */
16
16
  export declare function ingressEnv(pkg: string, ingress: DaemonIngress): Record<string, string>;
17
- export declare function daemonIngressResource(): Record<string, unknown>;
18
17
  /**
19
- * Included in DSM's own server blocks. Streaming responses (SSE) pass
18
+ * DSM's web-config worker includes a `type: dsm` file only in the DSM server
19
+ * blocks (ports 5000/5001 and the DSM custom domain). An Application Portal
20
+ * alias such as `https://<nas>/<alias>/` lives in the default server (80/443),
21
+ * which includes only `type: www` files, so the App loaded there would get 404
22
+ * from its own daemon. With a portal the same location is also enabled for the
23
+ * default server; the path and proxy rules stay identical. The portal mustache
24
+ * cannot carry it: DSM renders that inside the alias location, where nginx
25
+ * refuses a location outside `/<alias>/`.
26
+ */
27
+ export declare function daemonIngressResource(portal?: boolean): Record<string, unknown>;
28
+ /**
29
+ * Included in DSM's own server blocks, and with a portal in the default
30
+ * server too. Streaming responses (SSE) pass
20
31
  * unbuffered; nginx replaces any client X-Real-IP with the peer address.
21
32
  */
22
33
  export declare function renderDaemonIngressConfig(pkg: string, ingress: DaemonIngress): string;
@@ -38,11 +38,25 @@ function checkedIngressPath(pkg, ingress) {
38
38
  export function ingressEnv(pkg, ingress) {
39
39
  return { SYNOPKGLAND_INGRESS_PATH: checkedIngressPath(pkg, ingress), SYNOPKGLAND_INGRESS_SOCKET: daemonIngressSocket(pkg) };
40
40
  }
41
- export function daemonIngressResource() {
42
- return { "nginx-static-config": { enable: [{ type: "dsm", relpath: DAEMON_INGRESS_CONFIG }] } };
41
+ /**
42
+ * DSM's web-config worker includes a `type: dsm` file only in the DSM server
43
+ * blocks (ports 5000/5001 and the DSM custom domain). An Application Portal
44
+ * alias such as `https://<nas>/<alias>/` lives in the default server (80/443),
45
+ * which includes only `type: www` files, so the App loaded there would get 404
46
+ * from its own daemon. With a portal the same location is also enabled for the
47
+ * default server; the path and proxy rules stay identical. The portal mustache
48
+ * cannot carry it: DSM renders that inside the alias location, where nginx
49
+ * refuses a location outside `/<alias>/`.
50
+ */
51
+ export function daemonIngressResource(portal = false) {
52
+ return { "nginx-static-config": { enable: [
53
+ { type: "dsm", relpath: DAEMON_INGRESS_CONFIG },
54
+ ...(portal ? [{ type: "www", relpath: DAEMON_INGRESS_CONFIG }] : []),
55
+ ] } };
43
56
  }
44
57
  /**
45
- * Included in DSM's own server blocks. Streaming responses (SSE) pass
58
+ * Included in DSM's own server blocks, and with a portal in the default
59
+ * server too. Streaming responses (SSE) pass
46
60
  * unbuffered; nginx replaces any client X-Real-IP with the peer address.
47
61
  */
48
62
  export function renderDaemonIngressConfig(pkg, ingress) {
@@ -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 [npm, run, build].");
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
@@ -10,7 +10,7 @@ import { daemonIngressResource } from "./daemon-ingress.js";
10
10
  */
11
11
  export function renderStandaloneResource(m, portal) {
12
12
  const dataShare = m.sharedFolder && sharedFolderResource(m.package, m.sharedFolder);
13
- const nginx = [nativeGatewayResource(m), m.daemon?.ingress && daemonIngressResource()]
13
+ const nginx = [nativeGatewayResource(m), m.daemon?.ingress && daemonIngressResource(Boolean(portal))]
14
14
  .flatMap((r) => r?.["nginx-static-config"]?.enable ?? []);
15
15
  const webConfig = { ...(portal ? portalResource()['web-config'] : {}),
16
16
  ...(nginx.length ? { 'nginx-static-config': { enable: nginx } } : {}) };
@@ -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 lock = readJson(join(frontendDir, "package-lock.json"));
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/docs/daemon.md CHANGED
@@ -202,6 +202,24 @@ The build adds DSM's `web-config` resource:
202
202
  {"web-config":{"nginx-static-config":{"enable":[{"type":"dsm","relpath":"daemon/ingress-nginx.conf"}]}}}
203
203
  ```
204
204
 
205
+ With `portal`, the same file is also enabled as `type: www`, next to the
206
+ `app-portal` entry:
207
+
208
+ ```json
209
+ {"web-config":{"app-portal":{"json-relpath":"etc/portal.json","mustache-relpath":"etc/portal.mustache"},"nginx-static-config":{"enable":[{"type":"dsm","relpath":"daemon/ingress-nginx.conf"},{"type":"www","relpath":"daemon/ingress-nginx.conf"}]}}}
210
+ ```
211
+
212
+ DSM's `web-config` worker includes `type: dsm` files only in the DSM server
213
+ blocks (5000/5001 and the DSM custom domain), and `type: www` files only in the
214
+ default server (80/443). An Application Portal alias (`https://<nas>/<alias>/`)
215
+ is served by that default server, so without the `www` entry the App's page
216
+ loads there but every request to `/synopkgland/<package>/` returns 404. The
217
+ portal mustache stays DSM's CGI partial: DSM renders it inside the alias
218
+ location, where nginx refuses a location outside `/<alias>/`. Apps without a
219
+ portal keep the `dsm` entry alone, so their daemon is not reachable on 80/443.
220
+ A portal alias that an administrator moves to its own port or domain is a
221
+ separate server block; this release does not add the ingress there.
222
+
205
223
  `daemon.ingress.path` must be exactly `/synopkgland/<package>/`, where
206
224
  `<package>` is the manifest's case-sensitive package ID. For `package: MyApp`,
207
225
  the only accepted path is `/synopkgland/MyApp/`. Build, SPK inspection and App
@@ -211,7 +229,8 @@ The SDK's `api.ServeIngress` validates this
211
229
  same namespace against the package ID in the ingress socket.
212
230
 
213
231
  `daemon/ingress-nginx.conf` is a fixed `location ^~ /synopkgland/<package>/` block. DSM includes
214
- it in its own 5000/5001 server blocks and custom domains, so the browser sends
232
+ it in its own 5000/5001 server blocks and custom domains, and with a portal in
233
+ the 80/443 default server with identical rules, so the browser sends
215
234
  its DSM cookie and the page stays same-origin. The block sets:
216
235
 
217
236
  - `proxy_pass http://unix:/tmp/synopkgland-ingress-<package>.sock:` (nginx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synopackageland/cli",
3
- "version": "0.52.18",
3
+ "version": "0.53.1",
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": "npm 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",
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": "npm run build && node --input-type=module -e 'import {enforceRepositorySecrets} from \"./dist/secret-files.js\"; enforceRepositorySecrets(process.cwd())'",
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.41.3",
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": "66c9b3f6d907a8069202c5f88f13f8051c07b099de66d3ebce5de51c6374201f",
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; npm install/update selects a patch in that minor line. The CLI
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 `npm ci` for
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 `npx --no syno-pkg-land-ui catalog --json` and
212
- `npx --no syno-pkg-land-ui describe Button --json` from the installed frontend.
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 npm scripts; keep AI guidance version-independent.
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 `npm run e2e:smoke`.
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, `npm run gates` runs basic build/typecheck, core unit checks,
471
- npm pack and tarball content checks. Run `npm run gates:full` only when the user
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; npm 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.
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 目錄 `npm ci --omit=dev`。
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。
@@ -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 `npm run build` and focused native tests. The build generates
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 | `npm test` or `npm run test:unit` | Pin an operation's CLI path, read/write effect and handler; unit-test business results |
14
- | Local package | `npm run test:local` | Check, build one architecture, inspect each emitted SPK |
15
- | Real-NAS ctl | `npm run test:nas:ctl` | Use actual `synopkgland ctl` commands and assert package ID, caller role and nonroot UID |
16
- | Real-NAS UI, no AI | `npm run e2e:ui` | Use selectors, perform the primary action and assert its changed saved/read-back result |
17
- | Optional AI UI step | `npm run e2e:ai` | One bounded `agent.act` followed by the same deterministic result assertion |
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 `npm run e2e:smoke`, needs an explicit user
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 npm scripts. Adapt examples when replacing the
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 `npm ci` first if dependencies are missing. Run `npx --no syno-pkg-land-ui <command>`
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
- npx --no syno-pkg-land-ui prompt
15
- npx --no syno-pkg-land-ui catalog --json
16
- npx --no syno-pkg-land-ui schema
17
- npx --no syno-pkg-land-ui describe AppRoot --json
18
- npx --no syno-pkg-land-ui describe AppShell --json
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
- npx --no syno-pkg-land-ui validate ui.json --json --strict
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
- npx --no syno-pkg-land-ui render ui.json --json --strict --widths 390,700,960,1350 --out shots
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 `npm ci`. See [ui-json.md](ui-json.md) for the shared
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
- npx --no syno-pkg-land-ui catalog --json
39
- npx --no syno-pkg-land-ui describe Button --json
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
- npx --no-install vue-tsc --noEmit
157
- npm run build
158
- npm test
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, npm scripts and dependencies.
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