menloapp 1.5.0 → 1.5.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/README.md +8 -0
- package/package.json +1 -1
- package/src/constants.js +1 -1
- package/src/presentation.js +4 -3
- package/src/project-presentation.js +3 -0
package/README.md
CHANGED
|
@@ -38,6 +38,7 @@ listing yours:
|
|
|
38
38
|
"githubRepo": "https://github.com/your-name/your-app",
|
|
39
39
|
"menloLink": "https://menloapp.lol/your-app",
|
|
40
40
|
"icon": "menloapp/icon.png",
|
|
41
|
+
"ogImage": null,
|
|
41
42
|
"screenshots": [
|
|
42
43
|
"menloapp/screenshot-1.png",
|
|
43
44
|
"menloapp/screenshot-2.png",
|
|
@@ -64,6 +65,13 @@ The public page reads metadata and media from your Git commit. Media must be
|
|
|
64
65
|
ordinary files inside `menloapp/`, not symbolic links or Git LFS pointers.
|
|
65
66
|
Only selected files are served. Updates can take up to 60 seconds to appear.
|
|
66
67
|
|
|
68
|
+
Shared links include a 1200 × 630 image with your app icon, title, description,
|
|
69
|
+
and `menloapp.lol/your-app`. To use your own artwork, set
|
|
70
|
+
`"ogImage": "menloapp/share.png"` (PNG or JPEG, up to 10 MiB; 1200 × 630
|
|
71
|
+
recommended), then commit and push the image and `app.json`. Leave `ogImage`
|
|
72
|
+
absent or `null` for the automatic card. Use menloapp 1.5.1 or later when
|
|
73
|
+
deploying metadata with this field. Social networks may cache older previews.
|
|
74
|
+
|
|
67
75
|
## Automatic previews
|
|
68
76
|
|
|
69
77
|
Deploy can build the committed app in a fresh iPhone Simulator, have Codex
|
package/package.json
CHANGED
package/src/constants.js
CHANGED
package/src/presentation.js
CHANGED
|
@@ -29,7 +29,7 @@ function publicURL(value, field) {
|
|
|
29
29
|
/** Public presentation is deliberately small; build and identity are derived elsewhere. */
|
|
30
30
|
export function validatePresentation(value) {
|
|
31
31
|
if (!value || typeof value !== "object" || Array.isArray(value) || value.version !== 1) throw new Error("menloapp/app.json requires version: 1.");
|
|
32
|
-
for (const key of Object.keys(value)) if (!["version", "name", "subtitle", "description", "icon", "screenshots", "preview", "tokenAddress", "website", "menloLink", "githubRepo"].includes(key)) throw new Error(`Unknown menloapp/app.json field: ${key}`);
|
|
32
|
+
for (const key of Object.keys(value)) if (!["version", "name", "subtitle", "description", "icon", "ogImage", "screenshots", "preview", "tokenAddress", "website", "menloLink", "githubRepo"].includes(key)) throw new Error(`Unknown menloapp/app.json field: ${key}`);
|
|
33
33
|
const name = text(value.name, "name", 100, true);
|
|
34
34
|
const subtitle = text(value.subtitle ?? "", "subtitle", 160);
|
|
35
35
|
const description = text(value.description ?? "", "description", 4000);
|
|
@@ -41,6 +41,7 @@ export function validatePresentation(value) {
|
|
|
41
41
|
const tokenAddress = value.tokenAddress == null || value.tokenAddress === "" ? null : value.tokenAddress;
|
|
42
42
|
if (tokenAddress !== null && (typeof tokenAddress !== "string" || !/^eip155:[1-9][0-9]{0,31}\/erc20:0x[a-fA-F0-9]{40}$/.test(tokenAddress))) throw new Error("tokenAddress must be a CAIP-19 ERC-20 identifier: eip155:CHAIN_ID/erc20:0x followed by 40 hex characters.");
|
|
43
43
|
const icon = value.icon == null ? null : mediaPath(value.icon);
|
|
44
|
+
const ogImage = value.ogImage == null ? null : mediaPath(value.ogImage);
|
|
44
45
|
const screenshots = value.screenshots ?? [];
|
|
45
46
|
if (!Array.isArray(screenshots) || screenshots.length > 3 || new Set(screenshots).size !== screenshots.length) throw new Error("Choose up to three distinct screenshots in menloapp/app.json.");
|
|
46
47
|
let preview = null;
|
|
@@ -50,11 +51,11 @@ export function validatePresentation(value) {
|
|
|
50
51
|
if (item.source_commit != null && !/^[a-f0-9]{40}$/.test(item.source_commit)) throw new Error("Preview source_commit must be a full Git commit.");
|
|
51
52
|
preview = { path: mediaPath(item.path, true), kind: item.kind, ...(item.source_commit ? { source_commit: item.source_commit } : {}) };
|
|
52
53
|
}
|
|
53
|
-
return { version: 1, name, subtitle, description, website, tokenAddress, githubRepo, menloLink, icon, screenshots: screenshots.map(item => mediaPath(item)), preview };
|
|
54
|
+
return { version: 1, name, subtitle, description, website, tokenAddress, githubRepo, menloLink, icon, ogImage, screenshots: screenshots.map(item => mediaPath(item)), preview };
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
export function presentationFiles(value) {
|
|
57
|
-
return [...(value.icon ? [value.icon] : []), ...value.screenshots, ...(value.preview ? [value.preview.path] : [])];
|
|
58
|
+
return [...new Set([...(value.icon ? [value.icon] : []), ...(value.ogImage ? [value.ogImage] : []), ...value.screenshots, ...(value.preview ? [value.preview.path] : [])])];
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
export function mediaType(file) {
|
|
@@ -19,6 +19,9 @@ export async function setupPresentation(root, name = path.basename(root)) {
|
|
|
19
19
|
|
|
20
20
|
Edit app.json and run menloapp deploy from your app's repository.
|
|
21
21
|
Name, subtitle, description, icon and screenshots appear on your public page.
|
|
22
|
+
Shared links get a card with the app icon, title, description and MENLO URL.
|
|
23
|
+
Set ogImage to a PNG/JPEG path such as menloapp/share.png for custom share artwork
|
|
24
|
+
(1200 x 630 recommended), or leave it null to use the automatic card.
|
|
22
25
|
website and tokenAddress are optional. An ERC-20 token uses CAIP-19:
|
|
23
26
|
eip155:CHAIN_ID/erc20:0x followed by the token's 40 hex address characters.
|
|
24
27
|
MENLO fills githubRepo and menloLink automatically when you deploy.
|