@luvabase/sdk 0.0.1 → 0.0.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/README.md +1 -0
- package/examples/minimal/app.lumo +0 -0
- package/examples/minimal/index.js +11 -0
- package/examples/minimal/luva.jsonc +6 -0
- package/examples/minimal/package-lock.json +1547 -0
- package/examples/minimal/package.json +13 -0
- package/examples/minimal/public/icon.png +0 -0
- package/examples/minimal/wrangler.jsonc +6 -0
- package/examples/snake/icon.png +0 -0
- package/examples/snake/lumobase.jsonc +11 -0
- package/examples/snake/package-lock.json +1016 -0
- package/examples/snake/package.json +15 -0
- package/examples/snake/public/index.html +602 -0
- package/examples/snake/snake.lumo +0 -0
- package/package.json +6 -5
- package/src/envSchema.ts +22 -0
- package/src/index.ts +5 -2
- package/src/manifestSchema.ts +74 -0
- package/tools/tools.ts +7 -0
- package/dist/index.d.ts +0 -5
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -8
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { z } from "zod"
|
|
2
|
+
|
|
3
|
+
export type AppManifest = z.infer<typeof AppManifest>
|
|
4
|
+
export const AppManifest = z.lazy(() =>
|
|
5
|
+
z.object({
|
|
6
|
+
identifier: z
|
|
7
|
+
.string()
|
|
8
|
+
.regex(/^[a-z0-9-]+$/)
|
|
9
|
+
.min(3)
|
|
10
|
+
.max(50)
|
|
11
|
+
.optional()
|
|
12
|
+
.describe(
|
|
13
|
+
"Globally unique url safe and lowercased identifier for the app e.g. 'luvabase-snake' (required for Luvabase submissions)",
|
|
14
|
+
),
|
|
15
|
+
name: z
|
|
16
|
+
.string()
|
|
17
|
+
.min(3)
|
|
18
|
+
.max(30)
|
|
19
|
+
.describe("Name of the app e.g. 'Snake' (max 30 characters)"),
|
|
20
|
+
subtitle: z
|
|
21
|
+
.string()
|
|
22
|
+
.min(3)
|
|
23
|
+
.max(50)
|
|
24
|
+
.optional()
|
|
25
|
+
.describe(
|
|
26
|
+
"Subtitle of the app e.g. 'Play the classic of classics' (max 50 characters)",
|
|
27
|
+
),
|
|
28
|
+
description: z
|
|
29
|
+
.string()
|
|
30
|
+
.max(10000)
|
|
31
|
+
.optional()
|
|
32
|
+
.describe("Full description of the app"),
|
|
33
|
+
screenshots: z
|
|
34
|
+
.array(z.string())
|
|
35
|
+
.optional()
|
|
36
|
+
.describe(
|
|
37
|
+
"Relative paths of app screenshots e.g. ['images/screenshot1.png', 'images/screenshot2.png']",
|
|
38
|
+
),
|
|
39
|
+
category: z
|
|
40
|
+
.string()
|
|
41
|
+
.optional()
|
|
42
|
+
.describe(
|
|
43
|
+
"Could be 'productivity', 'health', etc (must be one of the standard categories listed here https://github.com/w3c/manifest/wiki/Categories)",
|
|
44
|
+
),
|
|
45
|
+
icon: z
|
|
46
|
+
.string()
|
|
47
|
+
.optional()
|
|
48
|
+
.describe(
|
|
49
|
+
"Relative path of the app icon inside the .luva app file e.g. 'images/icon.png'",
|
|
50
|
+
),
|
|
51
|
+
repository: z
|
|
52
|
+
.string()
|
|
53
|
+
.optional()
|
|
54
|
+
.describe(
|
|
55
|
+
"URL of the source code repository e.g. 'https://github.com/luvabase/snake'",
|
|
56
|
+
),
|
|
57
|
+
services: z
|
|
58
|
+
.array(
|
|
59
|
+
z.object({
|
|
60
|
+
type: z.enum(["turso"]),
|
|
61
|
+
name: z.string(),
|
|
62
|
+
}),
|
|
63
|
+
)
|
|
64
|
+
.optional(),
|
|
65
|
+
relatedApps: z.array(RelatedApp).optional(),
|
|
66
|
+
}),
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
export const RelatedApp = z.object({
|
|
70
|
+
type: z.enum(["android", "ios"]),
|
|
71
|
+
identifier: z.string(), // android package name or ios bundle id
|
|
72
|
+
downloadLink: z.string().optional(),
|
|
73
|
+
redirectUrls: z.array(z.string()),
|
|
74
|
+
})
|
package/tools/tools.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { writeFile } from "fs/promises"
|
|
2
|
+
import { AppManifest } from "../src/manifestSchema"
|
|
3
|
+
|
|
4
|
+
export async function generateManifestJsonSchema() {
|
|
5
|
+
const schema = AppManifest.toJSONSchema()
|
|
6
|
+
await writeFile("dist/manifest-schema.json", JSON.stringify(schema, null, 2))
|
|
7
|
+
}
|
package/dist/index.d.ts
DELETED
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";iBAAgB,KAAA,CAAA"}
|
package/dist/index.js
DELETED
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["export function hello() {\n return \"Hello!\"\n}\n"],"mappings":";AAAA,SAAgB,QAAQ;AACtB,QAAO"}
|