@synopackageland/cli 0.54.6 → 0.54.8
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 +9 -0
- package/README.md +20 -0
- package/dist/bin.js +0 -0
- package/dist/native-http-schema/source.json +1 -1
- package/dist/package-metadata.d.ts +4 -1
- package/dist/package-metadata.js +3 -2
- package/dist/runtime/sdk-source.d.ts +1 -1
- package/dist/runtime/sdk-source.js +1 -1
- package/dist/standalone/short-paths.d.ts +22 -0
- package/dist/standalone/short-paths.js +45 -1
- package/dist/standalone/spk.js +7 -1
- package/package.json +14 -16
- package/schema/package-metadata.schema.json +9 -0
- package/schema/synology-app.schema.json +9 -0
- package/skills/reference/mobile.md +7 -2
- package/skills/reference/ui-vue.md +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.54.8 (2026-11-18)
|
|
4
|
+
|
|
5
|
+
- Use SDK 0.53.50 by default.
|
|
6
|
+
- A short path keeps its address: `https://<nas>:5001/m` stays `/m` in the address bar instead of becoming `/webman/3rdparty/<package>/app/<build>/m/index.html`. The redirect now puts `spl-short=<path>` first in the query; the build puts a small script first in the `<head>` of each `.html` stable page a short path opens (before the UI digest), which adds `<base href>` with the page's real URL and replaces the address with the short path, keeping the rest of the query and the fragment. A short path to `app` is handled by the SDK's entry boot. Reload, bookmarks and Add to Home Screen open the short path, and therefore the current build; the stable page and build URLs keep working and keep their own address. A short path to `app` needs the App's frontend `@synopackageland/sdk` 0.53.50 or later; an older one keeps the marker in the query.
|
|
7
|
+
|
|
8
|
+
## 0.54.7 (2026-11-17)
|
|
9
|
+
|
|
10
|
+
- App metadata accepts `screenshots_mobile`, a list of phone screenshots under the same rules as `screenshots` (at most 5 `https://` PNG or JPG URLs). `screenshots` stays the desktop list. The App page on synopkgland.com shows phone screenshots under a Mobile tab; DSM Package Center shows only `screenshots`.
|
|
11
|
+
|
|
3
12
|
## 0.54.6 (2026-11-15)
|
|
4
13
|
|
|
5
14
|
- Approval baselines with an SDK inventory read historical approval facts instead of replaying the latest UI and lifecycle formats. Older entry pages without `launch.html` remain comparable; missing facts, inconsistent payload/asset pins and invalid executor task bindings report `APPROVAL_BASELINE_INVALID` with the failing fact.
|
package/README.md
CHANGED
|
@@ -487,6 +487,26 @@ App's short path returns DSM's 404, and an upgrade replaces the file. With
|
|
|
487
487
|
`portal`, short paths still stay on DSM's server only: their target,
|
|
488
488
|
`/webman/3rdparty/`, is not served on 80/443.
|
|
489
489
|
|
|
490
|
+
The address bar keeps the short path. The redirect puts `spl-short=<path>`
|
|
491
|
+
first in the query (`/connect` → `…/m/index.html?spl-short=connect&<query>`).
|
|
492
|
+
For a stable page whose target is an `.html` file, the build puts a small
|
|
493
|
+
script first in the target's `<head>` (after the page's own `<base>`, if it
|
|
494
|
+
has one), before the UI digest. On a page with the marker of one of its
|
|
495
|
+
declared paths, the script adds `<base href>` with the page's real URL, so
|
|
496
|
+
relative scripts, styles, images, `fetch` and Expo/Vite chunk URLs keep
|
|
497
|
+
resolving in the build folder, then `history.replaceState` shows
|
|
498
|
+
`/connect?<query>#<fragment>`. A reload, a bookmark or iOS Add to Home Screen
|
|
499
|
+
therefore opens the short path again and lands on the current build. A short
|
|
500
|
+
path to `app` does the same in the SDK's entry boot, which also keeps it
|
|
501
|
+
across a DSM sign-in in the same tab. A page opened without the marker (the
|
|
502
|
+
stable page or build URL itself, an Application Portal domain or port) keeps
|
|
503
|
+
its URL, and the long URLs keep working. Code that reads `location.pathname`
|
|
504
|
+
sees the short path: derive package URLs from `document.baseURI` or a
|
|
505
|
+
relative URL instead. With the `<base>`, a link that is only a fragment
|
|
506
|
+
(`href="#top"`) resolves to the page's real URL and reloads it there. A Web
|
|
507
|
+
App Manifest's `start_url` stays the App's own; Android Chrome's install uses
|
|
508
|
+
it, not the address bar.
|
|
509
|
+
|
|
490
510
|
`check` refuses the root, DSM and SDK names (the reserved list of custom ingress,
|
|
491
511
|
including `/mobile`, `/webman`, `/webapi`, `/sharing` and `/synopkgland`), a
|
|
492
512
|
path that overlaps the package's own ingress, an undeclared page
|
package/dist/bin.js
CHANGED
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"module":"github.com/synopackageland/syno-pkg-land-sdk","version":"0.53.
|
|
1
|
+
{"module":"github.com/synopackageland/syno-pkg-land-sdk","version":"0.53.50","local":false}
|
|
@@ -24,10 +24,13 @@ export interface PackageMetadata {
|
|
|
24
24
|
distributor_url?: string;
|
|
25
25
|
support_url?: string;
|
|
26
26
|
helpurl?: string;
|
|
27
|
+
/** Desktop screenshots; the DSM Package Center feed shows only these. */
|
|
27
28
|
screenshots?: string[];
|
|
29
|
+
/** Phone screenshots, shown on the website under a separate tab. */
|
|
30
|
+
screenshots_mobile?: string[];
|
|
28
31
|
}
|
|
29
32
|
export declare function safeMetadataUrl(value: unknown, mail?: boolean): value is string;
|
|
30
|
-
/** The catalog shows at most 5 screenshots and loads them over https only. */
|
|
33
|
+
/** The catalog shows at most 5 screenshots of each form and loads them over https only. */
|
|
31
34
|
export declare const MAX_SCREENSHOTS = 5;
|
|
32
35
|
export declare function validateMetadata(raw: unknown): PackageMetadata;
|
|
33
36
|
export declare function metadataInfoFields(metadata?: PackageMetadata): [string, string][];
|
package/dist/package-metadata.js
CHANGED
|
@@ -37,7 +37,7 @@ export function safeMetadataUrl(value, mail = false) {
|
|
|
37
37
|
return false;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
/** The catalog shows at most 5 screenshots and loads them over https only. */
|
|
40
|
+
/** The catalog shows at most 5 screenshots of each form and loads them over https only. */
|
|
41
41
|
export const MAX_SCREENSHOTS = 5;
|
|
42
42
|
const safeScreenshotUrl = (value) => safeMetadataUrl(value) && value.startsWith("https:");
|
|
43
43
|
export function validateMetadata(raw) {
|
|
@@ -60,6 +60,7 @@ export function validateMetadata(raw) {
|
|
|
60
60
|
"support_url",
|
|
61
61
|
"helpurl",
|
|
62
62
|
"screenshots",
|
|
63
|
+
"screenshots_mobile",
|
|
63
64
|
];
|
|
64
65
|
for (const [k, v] of Object.entries(raw)) {
|
|
65
66
|
if (!allowed.includes(k))
|
|
@@ -68,7 +69,7 @@ export function validateMetadata(raw) {
|
|
|
68
69
|
upstreamMetadata(v);
|
|
69
70
|
continue;
|
|
70
71
|
}
|
|
71
|
-
if (k === "screenshots") {
|
|
72
|
+
if (k === "screenshots" || k === "screenshots_mobile") {
|
|
72
73
|
if (!Array.isArray(v) ||
|
|
73
74
|
v.length > MAX_SCREENSHOTS ||
|
|
74
75
|
!v.every(safeScreenshotUrl))
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { goPrivateCovers } from './go-env.js';
|
|
2
2
|
import { type ExecutorManifest } from './sdk-executor-manifest.js';
|
|
3
3
|
/** Pinned SDK for CLI-owned controllers and Compose planning; App pins take precedence. */
|
|
4
|
-
export declare const DEFAULT_SDK_VERSION = "0.53.
|
|
4
|
+
export declare const DEFAULT_SDK_VERSION = "0.53.50";
|
|
5
5
|
export declare const SDK_PACKAGE = "@synopackageland/sdk";
|
|
6
6
|
export declare const SDK_MODULE = "github.com/synopackageland/syno-pkg-land-sdk";
|
|
7
7
|
export declare const EXECUTOR_MODULE = "github.com/synopackageland/syno-pkg-land-sdk/executor";
|
|
@@ -5,7 +5,7 @@ import { tmpdir } from 'node:os';
|
|
|
5
5
|
import { join } from 'node:path';
|
|
6
6
|
import { readExecutorManifest, predatesExecutorManifest } from './sdk-executor-manifest.js';
|
|
7
7
|
/** Pinned SDK for CLI-owned controllers and Compose planning; App pins take precedence. */
|
|
8
|
-
export const DEFAULT_SDK_VERSION = '0.53.
|
|
8
|
+
export const DEFAULT_SDK_VERSION = '0.53.50';
|
|
9
9
|
export const SDK_PACKAGE = '@synopackageland/sdk';
|
|
10
10
|
export const SDK_MODULE = 'github.com/synopackageland/syno-pkg-land-sdk';
|
|
11
11
|
export const EXECUTOR_MODULE = `${SDK_MODULE}/executor`;
|
|
@@ -9,10 +9,20 @@ import { type StablePages } from "./stable-pages.js";
|
|
|
9
9
|
* relative Location: no proxy, no upstream, no cookie and no package code runs,
|
|
10
10
|
* so they widen no access. The browser keeps the query (passed on) and the
|
|
11
11
|
* fragment (never sent to the server, kept across the redirect).
|
|
12
|
+
*
|
|
13
|
+
* The redirect puts `spl-short=<path>` first in the query. The page it opens
|
|
14
|
+
* then shows the short path in the address bar again (history.replaceState),
|
|
15
|
+
* with a `<base>` that keeps its relative URLs on the page's own folder: a
|
|
16
|
+
* stable page's target through the landing script below, the entry page
|
|
17
|
+
* through the SDK's entry boot. Only a page reached through the short path
|
|
18
|
+
* has the marker, so a page opened on another origin (an Application Portal
|
|
19
|
+
* domain or port, where the short path does not exist) keeps its own URL.
|
|
12
20
|
*/
|
|
13
21
|
export type ShortPaths = Record<string, string>;
|
|
14
22
|
export declare const SHORT_PATHS_CONFIG = "etc/short-paths-nginx.conf";
|
|
15
23
|
export declare const SHORT_PATH_LIMIT = 4;
|
|
24
|
+
/** The query parameter the redirect puts first; its value is the path without the leading /. */
|
|
25
|
+
export declare const SHORT_PATH_MARKER = "spl-short";
|
|
16
26
|
/** Undefined when valid; otherwise why. `stablePages` are the package's declared pages. */
|
|
17
27
|
export declare function shortPathsProblem(value: unknown, stablePages: StablePages | undefined): string | undefined;
|
|
18
28
|
/** DSM before 7.2 rejects an unsigned web-config, the worker that adds the locations. */
|
|
@@ -28,6 +38,18 @@ export declare function shortPathTarget(pkg: string, page: string): string;
|
|
|
28
38
|
* 302 is never cached permanently, so a removed package leaves no stale redirect.
|
|
29
39
|
*/
|
|
30
40
|
export declare function renderShortPathsConfig(pkg: string, paths: ShortPaths): string;
|
|
41
|
+
/**
|
|
42
|
+
* The script a stable page's target gets first in its head when a short path
|
|
43
|
+
* opens the page. It runs before the page's own scripts: with the marker of a
|
|
44
|
+
* declared path first in the query, it adds `<base href>` with the page's own
|
|
45
|
+
* URL (unless the page has one) and replaces the address with the short path,
|
|
46
|
+
* the rest of the query and the fragment. Anything else leaves the page alone.
|
|
47
|
+
*/
|
|
48
|
+
export declare function shortPathLanding(paths: string[]): string;
|
|
49
|
+
/** The page with the landing after its <base> (resolved against the page's own URL), else first in <head>, else after the doctype, else first. */
|
|
50
|
+
export declare function withShortPathLanding(html: string, paths: string[]): string;
|
|
51
|
+
/** Each stable page target a short path opens, with those paths; only HTML pages get the landing. */
|
|
52
|
+
export declare function shortPathLandings(paths: ShortPaths, stablePages: StablePages | undefined): Map<string, string[]>;
|
|
31
53
|
export declare function shortPathsResourceEntry(): {
|
|
32
54
|
type: string;
|
|
33
55
|
relpath: string;
|
|
@@ -4,6 +4,8 @@ import { STABLE_PAGE_FILE } from "./stable-pages.js";
|
|
|
4
4
|
import { ENTRY_SHORT_PATH_TARGET, entryPagePath } from "./entry-page.js";
|
|
5
5
|
export const SHORT_PATHS_CONFIG = "etc/short-paths-nginx.conf";
|
|
6
6
|
export const SHORT_PATH_LIMIT = 4;
|
|
7
|
+
/** The query parameter the redirect puts first; its value is the path without the leading /. */
|
|
8
|
+
export const SHORT_PATH_MARKER = "spl-short";
|
|
7
9
|
const PATH = /^\/[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
8
10
|
const PACKAGE = /^[A-Za-z][A-Za-z0-9]{1,63}$/;
|
|
9
11
|
/** The lifecycle hooks that check the paths before DSM activates the resource, as for custom ingress. */
|
|
@@ -57,7 +59,49 @@ export function shortPathTarget(pkg, page) {
|
|
|
57
59
|
* 302 is never cached permanently, so a removed package leaves no stale redirect.
|
|
58
60
|
*/
|
|
59
61
|
export function renderShortPathsConfig(pkg, paths) {
|
|
60
|
-
return checked(pkg, paths).map(([path, page]) => [path, `${path}/`].map(from => `location = ${from} {\n absolute_redirect off;\n return 302 ${shortPathTarget(pkg, page)}
|
|
62
|
+
return checked(pkg, paths).map(([path, page]) => [path, `${path}/`].map(from => `location = ${from} {\n absolute_redirect off;\n return 302 ${shortPathTarget(pkg, page)}?${SHORT_PATH_MARKER}=${path.slice(1)}&$args;\n}\n`).join("")).join("");
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The script a stable page's target gets first in its head when a short path
|
|
66
|
+
* opens the page. It runs before the page's own scripts: with the marker of a
|
|
67
|
+
* declared path first in the query, it adds `<base href>` with the page's own
|
|
68
|
+
* URL (unless the page has one) and replaces the address with the short path,
|
|
69
|
+
* the rest of the query and the fragment. Anything else leaves the page alone.
|
|
70
|
+
*/
|
|
71
|
+
export function shortPathLanding(paths) {
|
|
72
|
+
if (!paths.length || paths.some(path => path.length > 65 || !PATH.test(path)))
|
|
73
|
+
throw new Error("Invalid ui.short_paths declaration");
|
|
74
|
+
return `<script>(function () {
|
|
75
|
+
try {
|
|
76
|
+
var m = /^\\?${SHORT_PATH_MARKER}=([a-z0-9]+(?:-[a-z0-9]+)*)(?:&|$)/.exec(location.search);
|
|
77
|
+
if (!m || ${JSON.stringify([...paths].sort())}.indexOf("/" + m[1]) < 0) return;
|
|
78
|
+
if (!document.querySelector("base[href]")) {
|
|
79
|
+
var base = document.createElement("base"), head = document.head || document.documentElement;
|
|
80
|
+
base.href = location.origin + location.pathname;
|
|
81
|
+
head.insertBefore(base, head.firstChild);
|
|
82
|
+
}
|
|
83
|
+
var rest = location.search.slice(m[0].length);
|
|
84
|
+
history.replaceState(history.state, "", "/" + m[1] + (rest ? "?" + rest : "") + location.hash);
|
|
85
|
+
} catch (e) {}
|
|
86
|
+
})();</script>`;
|
|
87
|
+
}
|
|
88
|
+
/** The page with the landing after its <base> (resolved against the page's own URL), else first in <head>, else after the doctype, else first. */
|
|
89
|
+
export function withShortPathLanding(html, paths) {
|
|
90
|
+
const tag = shortPathLanding(paths);
|
|
91
|
+
const at = /<base\b[^>]*>/i.exec(html) ?? /<head\b[^>]*>/i.exec(html) ?? /^\s*<!doctype\b[^>]*>/i.exec(html);
|
|
92
|
+
const end = at ? at.index + at[0].length : 0;
|
|
93
|
+
return html.slice(0, end) + tag + html.slice(end);
|
|
94
|
+
}
|
|
95
|
+
/** Each stable page target a short path opens, with those paths; only HTML pages get the landing. */
|
|
96
|
+
export function shortPathLandings(paths, stablePages) {
|
|
97
|
+
const out = new Map();
|
|
98
|
+
for (const [path, page] of Object.entries(paths)) {
|
|
99
|
+
const target = page === ENTRY_SHORT_PATH_TARGET ? undefined : stablePages?.[page];
|
|
100
|
+
if (!target || !/\.html?$/i.test(target))
|
|
101
|
+
continue;
|
|
102
|
+
out.set(target, [...(out.get(target) ?? []), path].sort());
|
|
103
|
+
}
|
|
104
|
+
return out;
|
|
61
105
|
}
|
|
62
106
|
export function shortPathsResourceEntry() {
|
|
63
107
|
return { type: "dsm", relpath: SHORT_PATHS_CONFIG };
|
package/dist/standalone/spk.js
CHANGED
|
@@ -30,7 +30,7 @@ import { renderStandaloneScript } from "./lifecycle.js";
|
|
|
30
30
|
import { APP_SCRIPTS_DIR, APP_SCRIPTS_SPK_DIR } from "./app-scripts.js";
|
|
31
31
|
import { MODULE_UI_ENTRY, precompressUiTree, uiTreeDigest } from "./ui-assets.js";
|
|
32
32
|
import { writeStablePages } from "./stable-pages.js";
|
|
33
|
-
import { SHORT_PATHS_CONFIG, renderShortPathsConfig } from "./short-paths.js";
|
|
33
|
+
import { SHORT_PATHS_CONFIG, renderShortPathsConfig, shortPathLandings, withShortPathLanding } from "./short-paths.js";
|
|
34
34
|
import { enforcePublicUi, isUiBundle, logicalUiFile, minifyUi, minifyUiTree, storedUiSecretIgnores, uiFiles } from "./public-ui.js";
|
|
35
35
|
import { codedMessage } from "../errors.js";
|
|
36
36
|
import { CHECKSUM_PLACEHOLDER, DIGEST_PLACEHOLDER, largestInstalledInfo, projectInstalledInfoIssue, stagedInstalledInfoIssue } from "../spk/installed-info.js";
|
|
@@ -106,6 +106,12 @@ export async function assembleStandaloneSpk(options) {
|
|
|
106
106
|
copyUiTree(manifest.ui.dir, appDir, manifest.root);
|
|
107
107
|
else
|
|
108
108
|
mkdirSync(appDir, { recursive: true });
|
|
109
|
+
// Before the digest: a page a short path opens shows that path again.
|
|
110
|
+
for (const [target, paths] of shortPathLandings(manifest.ui?.shortPaths ?? {}, manifest.ui?.stablePages)) {
|
|
111
|
+
const file = join(appDir, target);
|
|
112
|
+
if (existsSync(file) && lstatSync(file).isFile())
|
|
113
|
+
writeFileSync(file, withShortPathLanding(readFileSync(file, "utf8"), paths));
|
|
114
|
+
}
|
|
109
115
|
minifyUiTree(appDir);
|
|
110
116
|
precompressUiTree(appDir);
|
|
111
117
|
const moduleUi = hasSdkWindow(manifest) && existsSync(join(appDir, MODULE_UI_ENTRY));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synopackageland/cli",
|
|
3
|
-
"version": "0.54.
|
|
3
|
+
"version": "0.54.8",
|
|
4
4
|
"description": "Syno Package Land Developer Kit CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -26,20 +26,6 @@
|
|
|
26
26
|
"docs/install-memory.md",
|
|
27
27
|
"docs/catalog-text.md"
|
|
28
28
|
],
|
|
29
|
-
"scripts": {
|
|
30
|
-
"check:docs": "node --test scripts/check-doc-versions.test.mjs && node scripts/check-doc-versions.mjs",
|
|
31
|
-
"build": "rm -rf dist && node scripts/prepare-native-http.mjs && tsc",
|
|
32
|
-
"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",
|
|
33
|
-
"test:glossary": "node --test scripts/test/glossary-drift.test.mjs",
|
|
34
|
-
"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",
|
|
35
|
-
"gates": "bash scripts/ci/gates.sh",
|
|
36
|
-
"gates:fast": "bash scripts/ci/gates.sh",
|
|
37
|
-
"prepublishOnly": "pnpm run build && node --input-type=module -e 'import {enforceRepositorySecrets} from \"./dist/secret-files.js\"; enforceRepositorySecrets(process.cwd())'",
|
|
38
|
-
"gates:full": "bash scripts/ci/gates.sh --full",
|
|
39
|
-
"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",
|
|
40
|
-
"check:dsm-contract": "node scripts/check-dsm-api-contract.mjs",
|
|
41
|
-
"check:dsm-hub": "node scripts/check-dsm-api-hub.mjs"
|
|
42
|
-
},
|
|
43
29
|
"dependencies": {
|
|
44
30
|
"@napi-rs/keyring": "^2.1.1",
|
|
45
31
|
"@synopackageland/templates": "~0.44.1",
|
|
@@ -102,5 +88,17 @@
|
|
|
102
88
|
"./native-layout": "./dist/standalone/native-layout.js",
|
|
103
89
|
"./e2e": "./dist/e2e/dsm.js"
|
|
104
90
|
},
|
|
105
|
-
"
|
|
91
|
+
"scripts": {
|
|
92
|
+
"check:docs": "node --test scripts/check-doc-versions.test.mjs && node scripts/check-doc-versions.mjs",
|
|
93
|
+
"build": "rm -rf dist && node scripts/prepare-native-http.mjs && tsc",
|
|
94
|
+
"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",
|
|
95
|
+
"test:glossary": "node --test scripts/test/glossary-drift.test.mjs",
|
|
96
|
+
"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",
|
|
97
|
+
"gates": "bash scripts/ci/gates.sh",
|
|
98
|
+
"gates:fast": "bash scripts/ci/gates.sh",
|
|
99
|
+
"gates:full": "bash scripts/ci/gates.sh --full",
|
|
100
|
+
"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",
|
|
101
|
+
"check:dsm-contract": "node scripts/check-dsm-api-contract.mjs",
|
|
102
|
+
"check:dsm-hub": "node scripts/check-dsm-api-hub.mjs"
|
|
103
|
+
}
|
|
106
104
|
}
|
|
@@ -113,6 +113,15 @@
|
|
|
113
113
|
"maxLength": 2048
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
|
+
"screenshots_mobile": {
|
|
117
|
+
"type": "array",
|
|
118
|
+
"maxItems": 5,
|
|
119
|
+
"items": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"pattern": "^https://",
|
|
122
|
+
"maxLength": 2048
|
|
123
|
+
}
|
|
124
|
+
},
|
|
116
125
|
"upstream": {
|
|
117
126
|
"oneOf": [
|
|
118
127
|
{
|
|
@@ -315,6 +315,15 @@
|
|
|
315
315
|
"pattern": "^https://",
|
|
316
316
|
"maxLength": 2048
|
|
317
317
|
}
|
|
318
|
+
},
|
|
319
|
+
"screenshots_mobile": {
|
|
320
|
+
"type": "array",
|
|
321
|
+
"maxItems": 5,
|
|
322
|
+
"items": {
|
|
323
|
+
"type": "string",
|
|
324
|
+
"pattern": "^https://",
|
|
325
|
+
"maxLength": 2048
|
|
326
|
+
}
|
|
318
327
|
}
|
|
319
328
|
}
|
|
320
329
|
}
|
|
@@ -80,8 +80,13 @@ probing, language fallback and the package-specific identity cache.
|
|
|
80
80
|
|
|
81
81
|
App-owned `app.status` should use SDK Go `api.AppStatusHandler`, registered via
|
|
82
82
|
`api.HandleRequest`, or return `package`, `version`, `user`, `admin`, `lang` and
|
|
83
|
-
`locale`.
|
|
84
|
-
|
|
83
|
+
`locale`. With a nil language, `api.AppStatusHandler` answers in the caller's
|
|
84
|
+
DSM display language: the entry page reads it on DSM's own origin and sends it
|
|
85
|
+
as the `dsmLanguage` parameter (a DSM code such as `cht`). Without a usable hint,
|
|
86
|
+
or when DSM follows the browser (`def`), it uses the browser's Accept-Language.
|
|
87
|
+
The backend never reads DSM with the browser's session. Declare the optional
|
|
88
|
+
`dsmLanguage` string in the `app.status` `paramsSchema`; the node, python and
|
|
89
|
+
rust templates map the same hint themselves.
|
|
85
90
|
|
|
86
91
|
Run `synopkgland inspect dist/<package>-<version>-<arch>.spk`. It replays the
|
|
87
92
|
recorded registration and asset digests; a changed or missing `mobile.json`,
|
|
@@ -288,6 +288,11 @@ ui:
|
|
|
288
288
|
- build 寫入 `etc/short-paths-nginx.conf`:`location = /connect` 與 `location = /connect/`,回 302、相對 `Location`
|
|
289
289
|
(`absolute_redirect off`,經反向代理或 tunnel 進來也不會被帶到 :5001),query 照傳,fragment 由瀏覽器保留。
|
|
290
290
|
不 proxy、不碰 cookie、不跑套件程式。
|
|
291
|
+
- 網址列維持短網址:302 在 query 最前面加 `spl-short=<path>`;`.html` 目標頁由 build 在 `<head>` 最前面(頁面已有 `<base>` 就放在它後面)
|
|
292
|
+
插一段小 script,加上指向實際頁面的 `<base href>` 後用 `history.replaceState` 換回 `/connect?<query>#<fragment>`;短網址到 `app` 由 SDK entry boot
|
|
293
|
+
處理(同分頁 DSM 登入後也維持)。重新整理、書籤、iOS 加到主畫面都回到短網址並載入目前 build;沒有標記(直接開 stable page/長網址、
|
|
294
|
+
Application Portal 網域)就不改網址,長網址照常可用。頁面程式讀 `location.pathname` 會得到短網址,套件內網址請用 `document.baseURI`
|
|
295
|
+
或相對網址;只有 fragment 的連結(`href="#top"`)會解析到實際頁面並重新載入。
|
|
291
296
|
- DSM `web-config` worker 在套件啟動時加入 DSM server(5000/5001 與 DSM 自訂網域),停止時移除;停止或解除安裝後回 404。
|
|
292
297
|
有 `portal` 也只註冊在 DSM server:80/443 不提供 `/webman/3rdparty/`。
|
|
293
298
|
- 規則:單一小寫片段(字母、數字、中間的 `-`,最多 64 字元,不可結尾 `/`),最多 4 個;不可用 `/`、DSM/SDK 名稱
|