@tanqory/partner-cli 0.1.0-alpha.0 → 0.1.0-alpha.2

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/lib/check.mjs CHANGED
@@ -1,6 +1,8 @@
1
1
  // `theme check`: the partner checks that need no sandbox, run here exactly as the platform runs them on an upload
2
2
  // (build-service's own code, bundled into lib/vendor by scripts/prepare.mjs):
3
- // ingest_gate, sandbox_build, source_text on the .tgz `theme package` makes
3
+ // ingest_gate, sandbox_build, source_text, editability on the .tgz `theme package` makes (editability: every
4
+ // word, image, link and list a shopper sees is a setting or a block, labels in
5
+ // English and Thai, and every image address answers; theme-standard EDITABILITY.md)
4
6
  // manifest, manifest_brand_term, manifest_emoji, no_eval, licences on the build output (dist/abi)
5
7
  // The other six lines (the two sandbox builds and their digests, entry scan, ABI conformance, network allowlist,
6
8
  // budgets, accessibility, preview renders) run the theme, in the platform's sandbox, when a version is installed on a
@@ -35,7 +37,7 @@ function vendor() {
35
37
  export async function checkTheme(dir, { build = true, quiet = false } = {}) {
36
38
  const out = build ? buildTheme(dir, { quiet }).out : join(dir, 'dist', 'abi')
37
39
  const { bytes } = await packSource(dir)
38
- const report = await vendor().checkPartnerSource(bytes, out)
40
+ const report = await vendor().checkPartnerSource(bytes, out, { imageFetch: globalThis.fetch })
39
41
  return { ok: report.lines.every((l) => l.status === 'passed'), lines: report.lines, tgzBytes: report.tgzBytes, layout: report.layout, out }
40
42
  }
41
43
 
@@ -57,7 +59,8 @@ export function formatLines(lines) {
57
59
  const rows = []
58
60
  for (const l of lines) {
59
61
  rows.push(`${l.status === 'passed' ? 'passed' : 'FAILED'} ${l.key}: ${l.message}`)
60
- if (l.status !== 'passed') for (const e of l.errors.slice(1, 20)) rows.push(` ${e.path} ${e.message}`)
62
+ // every finding of a failed line as file, rule, message (the first is also the line's message)
63
+ if (l.status !== 'passed') for (const e of l.errors.slice(0, 20)) rows.push(` ${e.path || '(source)'} ${e.code || 'error'} ${e.message}`)
61
64
  }
62
65
  return rows.join('\n')
63
66
  }
package/lib/mcp.mjs CHANGED
@@ -47,7 +47,7 @@ export function toolList() {
47
47
  confirmationToken: confirm,
48
48
  }, ['dir'], ann(false)),
49
49
  tool('partner_theme_install', 'Install a version on a development store', "Builds the version in Tanqory's sandbox, runs every check and installs it as the store's developer draft, never live. You approve it first.", { versionId: { type: 'string' }, storeId: { type: 'string', description: 'Leave out when the organization has one development store.' }, org, confirmationToken: confirm }, ['versionId'], ann(false)),
50
- tool('partner_theme_status', 'Read a version and its checks', 'Shows a version, each of its 14 check lines and its development installs with the preview link. Each read moves the install and the checks on.', { versionId: { type: 'string' }, org }, ['versionId'], ann(true)),
50
+ tool('partner_theme_status', 'Read a version and its checks', 'Shows a version, each of its 15 check lines and its development installs with the preview link. Each read moves the install and the checks on.', { versionId: { type: 'string' }, org }, ['versionId'], ann(true)),
51
51
  tool('partner_theme_list', 'List partner themes', "Lists the organization's themes and each one's latest version.", { org }, null, ann(true)),
52
52
  tool('partner_development_stores', 'List development stores', "Lists the organization's development stores, to install a version on.", { org }, null, ann(true)),
53
53
  ]
package/lib/theme.mjs CHANGED
@@ -7,8 +7,8 @@
7
7
  // walk that applies the folder's .gitignore;
8
8
  // - never node_modules, dist or .git;
9
9
  // - no lockfile (package-lock.json, pnpm-lock.yaml, yarn.lock, bun.lockb): the builder never installs from one (it
10
- // uses its own toolchain), and the licences check lists every package of an uploaded lockfile as shipped, so the
11
- // developer tools of a local install would fail it (DECISIONS row 170 (7)).
10
+ // uses its own toolchain). (An uploaded lockfile is read for the SBOM only; since DECISIONS row 185 the licences
11
+ // check counts only what it ships, so its developer tools no longer fail it.)
12
12
  import { execFileSync, spawnSync } from 'node:child_process'
13
13
  import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync, copyFileSync } from 'node:fs'
14
14
  import { dirname, join, resolve } from 'node:path'