@synopackageland/cli 0.52.17 → 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.
Files changed (37) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +19 -16
  3. package/dist/build-spk/install-wizard.d.ts +8 -3
  4. package/dist/build-spk/install-wizard.js +38 -10
  5. package/dist/build-spk/wizard-messages.d.ts +22 -0
  6. package/dist/build-spk/wizard-messages.js +22 -0
  7. package/dist/e2e/dsm.d.ts +1 -1
  8. package/dist/e2e/dsm.js +1 -1
  9. package/dist/error-registry.js +6 -5
  10. package/dist/init.js +10 -8
  11. package/dist/native-http-schema/source.json +1 -1
  12. package/dist/package-manager.d.ts +4 -0
  13. package/dist/package-manager.js +48 -0
  14. package/dist/standalone/bridge-app.js +4 -2
  15. package/dist/standalone/build.js +6 -5
  16. package/dist/standalone/inspect-spk.d.ts +2 -0
  17. package/dist/standalone/inspect-spk.js +14 -10
  18. package/dist/standalone/install-memory.d.ts +25 -2
  19. package/dist/standalone/install-memory.js +90 -6
  20. package/dist/standalone/manifest.d.ts +3 -0
  21. package/dist/standalone/manifest.js +4 -2
  22. package/dist/standalone/sdk-check.js +2 -4
  23. package/dist/standalone/shared-folder.js +3 -3
  24. package/dist/standalone/spk.js +2 -1
  25. package/docs/install-memory.md +29 -1
  26. package/package.json +6 -5
  27. package/schema/dsm-api-contract.json +1 -1
  28. package/schema/dsm-package.schema.json +6 -0
  29. package/skills/SKILL.md +9 -9
  30. package/skills/reference/compose.md +1 -1
  31. package/skills/reference/create.md +1 -1
  32. package/skills/reference/ctl.md +1 -1
  33. package/skills/reference/install.md +2 -1
  34. package/skills/reference/testing.md +7 -7
  35. package/skills/reference/ui-json.md +8 -8
  36. package/skills/reference/ui-vue.md +6 -6
  37. package/skills/reference/upstream-fork.md +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
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
+
10
+ ## 0.52.18 (2026-11-10)
11
+
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.
13
+ - Report `recommendedMemoryMb` in `inspect --json` and verify the generated install wizards against the packaged declaration.
14
+ - Add the `INSTALL_RECOMMENDED_MEMORY_INVALID` explanation.
15
+
3
16
  ## 0.52.17 (2026-11-09)
4
17
 
5
18
  - Use SDK 0.53.26 by default.
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
@@ -1,5 +1,6 @@
1
1
  import { type Locale } from "../standalone/i18n.js";
2
2
  import { type Translate } from "./wizard-i18n.js";
3
+ import { type MemoryAdvice } from "../standalone/install-memory.js";
3
4
  /** One step of a DSM install wizard; `items` are rendered verbatim as JSON. */
4
5
  export interface InstallWizardStep {
5
6
  step_title: string;
@@ -18,9 +19,13 @@ export interface InstallWizardFiles {
18
19
  * versions and flows that do not run the dynamic script; both carry the same
19
20
  * items, and only the dynamic one adds the reuse notice when data exists.
20
21
  */
21
- export declare function renderInstallWizardFiles(packageName: string, render: (t: Translate) => InstallWizardStep[], minMemoryMb?: number): InstallWizardFiles;
22
- /** Prepend to an existing dynamic wizard; retain its normal pages when memory is sufficient. */
23
- export declare function renderMemoryWizardCheck(minMemoryMb: number | undefined, locale: Locale): string;
22
+ export declare function renderInstallWizardFiles(packageName: string, render: (t: Translate) => InstallWizardStep[], minMemoryMb?: number, advice?: MemoryAdvice): InstallWizardFiles;
23
+ /**
24
+ * Prepend to an existing dynamic wizard; retain its normal pages when memory is sufficient.
25
+ * With `advice`, it also defines the filter that puts a warning page before
26
+ * those pages; the warning has no validator, so Next stays available.
27
+ */
28
+ export declare function renderMemoryWizardCheck(minMemoryMb: number | undefined, locale: Locale, advice?: MemoryAdvice): string;
24
29
  /** Lists the App's unauthenticated service callbacks for the administrator. */
25
30
  export declare function integrationWizardSteps(t: Translate, methods?: readonly string[]): InstallWizardStep[];
26
31
  /** The native-go install step: no parameters, only the app-space consent. */
@@ -1,6 +1,6 @@
1
1
  import { DSM_LANGS, LOCALES } from "../standalone/i18n.js";
2
2
  import { renderWizardFiles, translator } from "./wizard-i18n.js";
3
- import { memoryReason, renderMemoryProbe } from "../standalone/install-memory.js";
3
+ import { memoryAdviceTexts, memoryReason, renderMemoryProbe } from "../standalone/install-memory.js";
4
4
  const BASE = "install_uifile";
5
5
  function shellQuote(value) {
6
6
  return `'${value.replaceAll("'", "'\\''")}'`;
@@ -27,7 +27,7 @@ function withReuseNotice(steps, packageName, t) {
27
27
  * is chosen after the wizard on some flows). The wizard JSON is written to
28
28
  * `SYNOPKG_TEMP_LOGFILE`, DSM's documented channel, or stdout without it.
29
29
  */
30
- function renderDynamicScript(packageName, withData, withoutData, memoryCheck = "") {
30
+ function renderDynamicScript(packageName, withData, withoutData, memoryCheck = "", advice = false) {
31
31
  return `#!/bin/sh
32
32
  # Generated by synopkgland. Read-only: it checks whether this package already
33
33
  # has App Data on a volume, then prints the install wizard for this language.
@@ -42,7 +42,7 @@ done
42
42
  if [ -n "\${SYNOPKG_TEMP_LOGFILE:-}" ]; then
43
43
  exec > "$SYNOPKG_TEMP_LOGFILE"
44
44
  fi
45
- if [ -n "$existing" ]; then
45
+ ${advice ? "{\n" : ""}if [ -n "$existing" ]; then
46
46
  cat <<'SYNOPKGLAND_WIZARD'
47
47
  ${withData}
48
48
  SYNOPKGLAND_WIZARD
@@ -51,7 +51,7 @@ else
51
51
  ${withoutData}
52
52
  SYNOPKGLAND_WIZARD
53
53
  fi
54
- `;
54
+ ${advice ? "} | synopkgland_memory_advice_page\n" : ""}`;
55
55
  }
56
56
  /**
57
57
  * Builds the static `<base>` wizard files and one dynamic `<base>.sh` script
@@ -59,7 +59,7 @@ fi
59
59
  * versions and flows that do not run the dynamic script; both carry the same
60
60
  * items, and only the dynamic one adds the reuse notice when data exists.
61
61
  */
62
- export function renderInstallWizardFiles(packageName, render, minMemoryMb) {
62
+ export function renderInstallWizardFiles(packageName, render, minMemoryMb, advice) {
63
63
  const staticFiles = renderWizardFiles(BASE, render);
64
64
  const dynamic = {};
65
65
  for (const locale of LOCALES) {
@@ -67,14 +67,18 @@ export function renderInstallWizardFiles(packageName, render, minMemoryMb) {
67
67
  const steps = render(t);
68
68
  const withData = JSON.stringify(withReuseNotice(steps, packageName, t), null, 2);
69
69
  const withoutData = JSON.stringify(steps, null, 2);
70
- dynamic[localeName(locale, ".sh")] = renderDynamicScript(packageName, withData, withoutData, renderMemoryWizardCheck(minMemoryMb, locale));
70
+ dynamic[localeName(locale, ".sh")] = renderDynamicScript(packageName, withData, withoutData, renderMemoryWizardCheck(minMemoryMb, locale, advice), Boolean(advice));
71
71
  }
72
72
  return { static: staticFiles, dynamic };
73
73
  }
74
- /** Prepend to an existing dynamic wizard; retain its normal pages when memory is sufficient. */
75
- export function renderMemoryWizardCheck(minMemoryMb, locale) {
74
+ /**
75
+ * Prepend to an existing dynamic wizard; retain its normal pages when memory is sufficient.
76
+ * With `advice`, it also defines the filter that puts a warning page before
77
+ * those pages; the warning has no validator, so Next stays available.
78
+ */
79
+ export function renderMemoryWizardCheck(minMemoryMb, locale, advice) {
76
80
  if (minMemoryMb === undefined)
77
- return "";
81
+ return advice ? renderMemoryProbe(undefined, advice.mb) + renderMemoryAdvicePage(advice, locale) : "";
78
82
  const reason = memoryReason(minMemoryMb, locale, "__SYNOPKGLAND_MEMORY_GB__");
79
83
  const page = [{
80
84
  step_title: translator(locale)("memory.title"),
@@ -86,7 +90,7 @@ export function renderMemoryWizardCheck(minMemoryMb, locale) {
86
90
  }];
87
91
  // Only a formatted numeric value enters JSON, never shell or meminfo text.
88
92
  const json = JSON.stringify(page, null, 2);
89
- return `${renderMemoryProbe(minMemoryMb)}if [ -n "$synopkgland_memory_low" ]; then
93
+ return `${renderMemoryProbe(minMemoryMb, advice?.mb)}if [ -n "$synopkgland_memory_low" ]; then
90
94
  if [ -n "\${SYNOPKG_TEMP_LOGFILE:-}" ]; then
91
95
  exec > "$SYNOPKG_TEMP_LOGFILE"
92
96
  fi
@@ -95,6 +99,30 @@ ${json}
95
99
  SYNOPKGLAND_MEMORY_WIZARD
96
100
  exit 0
97
101
  fi
102
+ ${advice ? renderMemoryAdvicePage(advice, locale) : ""}`;
103
+ }
104
+ /**
105
+ * A shell filter over the wizard's JSON array (pretty-printed, so its first
106
+ * line is \`[\` or \`[]\`): below the recommendation it emits the warning
107
+ * page first; otherwise it passes the wizard through unchanged.
108
+ */
109
+ function renderMemoryAdvicePage(advice, locale) {
110
+ const page = {
111
+ step_title: translator(locale)("memory.recommendedTitle"),
112
+ items: memoryAdviceTexts(advice, locale, "__SYNOPKGLAND_MEMORY_GB__").map(desc => ({ desc })),
113
+ };
114
+ // Only a formatted numeric value enters JSON, never shell or meminfo text.
115
+ return `synopkgland_memory_advice_page() {
116
+ if [ -z "$synopkgland_memory_advice" ]; then
117
+ cat
118
+ return
119
+ fi
120
+ printf '[\\n'
121
+ sed "s/__SYNOPKGLAND_MEMORY_GB__/$synopkgland_memory_gb/g" <<'SYNOPKGLAND_MEMORY_ADVICE'
122
+ ${JSON.stringify(page, null, 2)}
123
+ SYNOPKGLAND_MEMORY_ADVICE
124
+ sed -e '1s/^\\[\\]$/]/' -e '1s/^\\[$/,/'
125
+ }
98
126
  `;
99
127
  }
100
128
  /** Lists the App's unauthenticated service callbacks for the administrator. */
@@ -21,6 +21,28 @@ export declare const WIZARD_MESSAGES: {
21
21
  es: string;
22
22
  it: string;
23
23
  };
24
+ "memory.recommendedTitle": {
25
+ en: string;
26
+ "zh-TW": string;
27
+ "zh-CN": string;
28
+ ja: string;
29
+ ko: string;
30
+ de: string;
31
+ fr: string;
32
+ es: string;
33
+ it: string;
34
+ };
35
+ "memory.recommended": {
36
+ en: string;
37
+ "zh-TW": string;
38
+ "zh-CN": string;
39
+ ja: string;
40
+ ko: string;
41
+ de: string;
42
+ fr: string;
43
+ es: string;
44
+ it: string;
45
+ };
24
46
  "ports.http": {
25
47
  en: string;
26
48
  "zh-TW": string;
@@ -21,6 +21,28 @@ export const WIZARD_MESSAGES = {
21
21
  "es": "Esta aplicación requiere al menos {required} GB de RAM; este NAS tiene {actual} GB",
22
22
  "it": "Questa app richiede almeno {required} GB di RAM; questo NAS dispone di {actual} GB"
23
23
  },
24
+ "memory.recommendedTitle": {
25
+ "en": "Memory recommendation",
26
+ "zh-TW": "記憶體建議",
27
+ "zh-CN": "内存建议",
28
+ "ja": "推奨メモリ",
29
+ "ko": "권장 메모리",
30
+ "de": "Arbeitsspeicherempfehlung",
31
+ "fr": "Mémoire recommandée",
32
+ "es": "Memoria recomendada",
33
+ "it": "Memoria consigliata"
34
+ },
35
+ "memory.recommended": {
36
+ "en": "This App recommends at least {recommended} GB of RAM; this NAS has {actual} GB. Installation can continue, but the App may run slowly",
37
+ "zh-TW": "此應用程式建議至少 {recommended} GB 記憶體,此 NAS 有 {actual} GB。仍可繼續安裝,但應用程式可能執行緩慢",
38
+ "zh-CN": "此应用程序建议至少 {recommended} GB 内存,此 NAS 有 {actual} GB。仍可继续安装,但应用程序可能运行缓慢",
39
+ "ja": "このアプリには {recommended} GB 以上の RAM を推奨します。この NAS のメモリは {actual} GB です。インストールは続行できますが、アプリの動作が遅くなる場合があります",
40
+ "ko": "이 앱에는 {recommended} GB 이상의 RAM을 권장합니다. 이 NAS의 메모리는 {actual} GB입니다. 설치는 계속할 수 있지만 앱이 느리게 실행될 수 있습니다",
41
+ "de": "Diese App empfiehlt mindestens {recommended} GB RAM; dieses NAS verfügt über {actual} GB. Die Installation kann fortgesetzt werden, aber die App läuft möglicherweise langsam",
42
+ "fr": "Cette application recommande au moins {recommended} Go de RAM ; ce NAS dispose de {actual} Go. L'installation peut continuer, mais l'application risque d'être lente",
43
+ "es": "Esta aplicación recomienda al menos {recommended} GB de RAM; este NAS tiene {actual} GB. La instalación puede continuar, pero la aplicación podría funcionar con lentitud",
44
+ "it": "Questa app consiglia almeno {recommended} GB di RAM; questo NAS dispone di {actual} GB. L'installazione può continuare, ma l'app potrebbe essere lenta"
45
+ },
24
46
  "ports.http": {
25
47
  "en": "HTTP port",
26
48
  "zh-TW": "HTTP 連接埠",
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";
@@ -51,6 +51,7 @@ export const ERROR_REGISTRY = {
51
51
  STANDALONE_IDENTITY_WITHOUT_PORTAL: { code: 'STANDALONE_IDENTITY_WITHOUT_PORTAL', description: 'Standalone identity is enabled without an Application Portal declaration', suggestion: 'Use HTTPS-only standalone login outside DSM windows; declare portal only when an alias is needed' },
52
52
  INSTALL_SETTINGS_INVALID: { "code": "INSTALL_SETTINGS_INVALID", "description": "The installation setting declaration is invalid.", "suggestion": "Declare 1–32 lowercase identifier keys in install.settings, each with type https-origin, a plain label and an explicit boolean required; omit defaults and values." },
53
53
  INSTALL_MIN_MEMORY_INVALID: { code: "INSTALL_MIN_MEMORY_INVALID", description: "The physical memory requirement or its packaged check is invalid.", suggestion: "Set install.min_memory_mb to a positive integer in MiB, at most 2147483647, and rebuild with the generated package-account hooks and wizards." },
54
+ INSTALL_RECOMMENDED_MEMORY_INVALID: { code: "INSTALL_RECOMMENDED_MEMORY_INVALID", description: "The recommended physical memory, its App message or its packaged install wizard warning is invalid.", suggestion: "Set install.recommended_memory_mb to a positive integer in MiB above install.min_memory_mb, keep the App's install.recommended_memory_message catalog text plain and single-line (1-300 characters, without <, > or &) with an English entry, and rebuild with the generated wizards." },
54
55
  INSTALL_PORT_INVALID: { code: "INSTALL_PORT_INVALID", description: "The installation port declaration or selected value is invalid", suggestion: "Enable install.ports for a declared identity gateway and choose distinct available non-reserved ports between 1024 and 65535" },
55
56
  SDK_PORT_SETTINGS_UNSUPPORTED: { code: "SDK_PORT_SETTINGS_UNSUPPORTED", description: "The selected SDK does not provide installer-selected ports", suggestion: "Pin SDK 0.38.2 or a matching supported release and rebuild with the matching CLI" },
56
57
  SDK_INSTALL_SETTINGS_UNSUPPORTED: { "code": "SDK_INSTALL_SETTINGS_UNSUPPORTED", "description": "The selected SDK does not provide native installation settings.", "suggestion": "Pin SDK 0.24.0 or a matching supported release with installsettings/cmd/control, then rebuild with the matching CLI." },
@@ -615,7 +616,7 @@ export const ERROR_REGISTRY = {
615
616
  STANDALONE_UI_BUILD_INVALID: {
616
617
  code: "STANDALONE_UI_BUILD_INVALID",
617
618
  description: "The ui.build configuration is invalid.",
618
- 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]",
619
620
  },
620
621
  STANDALONE_TIMEOUT_UNSUPPORTED: {
621
622
  code: "STANDALONE_TIMEOUT_UNSUPPORTED",
@@ -640,7 +641,7 @@ export const ERROR_REGISTRY = {
640
641
  STANDALONE_UI_BUILD_FAILED: {
641
642
  code: "STANDALONE_UI_BUILD_FAILED",
642
643
  description: "The UI build command failed.",
643
- 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",
644
645
  },
645
646
  STANDALONE_UI_ENTRY_MISSING: {
646
647
  code: "STANDALONE_UI_ENTRY_MISSING",
@@ -1070,7 +1071,7 @@ export const ERROR_REGISTRY = {
1070
1071
  SDK_DIR_NOT_READY: {
1071
1072
  code: "SDK_DIR_NOT_READY",
1072
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).",
1073
- 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)",
1074
1075
  },
1075
1076
  SDK_DOWNLOAD_FAILED: {
1076
1077
  code: "SDK_DOWNLOAD_FAILED",
@@ -1180,7 +1181,7 @@ export const ERROR_REGISTRY = {
1180
1181
  STANDALONE_NODE_DEPENDENCY_MISSING: {
1181
1182
  code: "STANDALONE_NODE_DEPENDENCY_MISSING",
1182
1183
  description: "The Node App's package.json dependencies are not installed in the App's node_modules.",
1183
- 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",
1184
1185
  },
1185
1186
  STANDALONE_BRIDGE_APP_INVALID: {
1186
1187
  code: "STANDALONE_BRIDGE_APP_INVALID",
@@ -1205,7 +1206,7 @@ export const ERROR_REGISTRY = {
1205
1206
  STANDALONE_NODE_SDK_NOT_BUILT: {
1206
1207
  code: "STANDALONE_NODE_SDK_NOT_BUILT",
1207
1208
  description: "The App's SDK version has no built Node SDK (node/dist).",
1208
- 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",
1209
1210
  },
1210
1211
  COMPOSE_POSIX_ALL_SHARES_UNDECLARED: {
1211
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;
@@ -1 +1 @@
1
- {"module":"github.com/synopackageland/syno-pkg-land-sdk","version":"development","local":true}
1
+ {"module":"github.com/synopackageland/syno-pkg-land-sdk","version":"0.53.26","local":false}
@@ -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. */
@@ -21,6 +21,8 @@ export interface SpkInspection {
21
21
  dependencies?: PackageDependencies;
22
22
  installSettings?: InstallSettings;
23
23
  minMemoryMb?: number;
24
+ /** `install.recommended_memory_mb`: the non-blocking install wizard warning threshold. */
25
+ recommendedMemoryMb?: number;
24
26
  /** Hyper Backup application backup, as sdk-package.json records it. */
25
27
  hyperBackup?: HyperBackup;
26
28
  identityGateway?: GatewayAdmissionReport;