@monimesl/dot-runtime 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/README.md +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/logic.d.ts +3 -0
- package/dist/logic.js +3 -0
- package/dist/react.d.ts +3 -0
- package/dist/react.js +3 -0
- package/dist/testing.d.ts +1 -0
- package/dist/testing.js +10 -0
- package/dist/testing.js.map +1 -0
- package/dist/ui.d.ts +1 -0
- package/dist/ui.js +1 -0
- package/dot.schema.json +118 -0
- package/globals.d.ts +34 -0
- package/package.json +77 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @monimesl/dot-runtime
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AlertAction, AlertOptions, AlertResult, CallOptions, DashRequest, HostError, HostErrorCode, TorchState, VibrateOptions, VibrationStyle, dash } from "./logic.js";
|
|
2
|
+
export * from "@monimesl/dot-service";
|
|
3
|
+
export { type AlertAction, type AlertOptions, type AlertResult, type CallOptions, type DashRequest, HostError, type HostErrorCode, type TorchState, type VibrateOptions, type VibrationStyle, dash };
|
package/dist/index.js
ADDED
package/dist/logic.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AlertAction, AlertOptions, AlertResult, CallOptions, DashRequest, HostError, HostErrorCode, TorchState, VibrateOptions, VibrationStyle, dash } from "@monimesl/dot-dash";
|
|
2
|
+
export * from "@monimesl/dot-service";
|
|
3
|
+
export { type AlertAction, type AlertOptions, type AlertResult, type CallOptions, type DashRequest, HostError, type HostErrorCode, type TorchState, type VibrateOptions, type VibrationStyle, dash };
|
package/dist/logic.js
ADDED
package/dist/react.d.ts
ADDED
package/dist/react.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@monimesl/dot-service/testing";
|
package/dist/testing.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.js","names":[],"sources":["../src/testing.ts"],"sourcesContent":["// Import before the page under test: it installs the globals a dot's code uses without imports.\n// `env` starts empty; a test gives the page its values with `Object.assign(env, { ... })`.\nimport { dash } from '@monimesl/dot-dash';\n\nexport * from '@monimesl/dot-service/testing';\n\nObject.assign(globalThis, { dash, env: {} });\n"],"mappings":";;;AAMA,OAAO,OAAO,YAAY;CAAE;CAAM,KAAK,CAAC;AAAE,CAAC"}
|
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@monimesl/dot-webview";
|
package/dist/ui.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@monimesl/dot-webview";
|
package/dot.schema.json
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "dot.json",
|
|
4
|
+
"description": "Settings for a dot, a mini app that runs inside Dash. Pages are listed in dot.ts, with defineDot({ pages }).",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"$schema": {
|
|
8
|
+
"description": "The schema editors use to check and complete this file.",
|
|
9
|
+
"type": "string"
|
|
10
|
+
},
|
|
11
|
+
"id": {
|
|
12
|
+
"description": "The dot's unique identifier, as a reverse domain name, such as \"com.example.counter\". It never changes once the dot is published.",
|
|
13
|
+
"type": "string",
|
|
14
|
+
"pattern": "^(?=[a-z])[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$",
|
|
15
|
+
"maxLength": 128,
|
|
16
|
+
"patternErrorMessage": "Use a reverse domain name, such as \"com.example.counter\": lowercase words of letters, digits and hyphens, joined by dots. A word can't start or end with a hyphen, or be longer than 63 characters."
|
|
17
|
+
},
|
|
18
|
+
"name": {
|
|
19
|
+
"description": "The dot's display name, which Dash shows.",
|
|
20
|
+
"type": "string",
|
|
21
|
+
"minLength": 1
|
|
22
|
+
},
|
|
23
|
+
"version": {
|
|
24
|
+
"description": "The dot's version, in semantic versioning (https://semver.org), such as \"1.0.0\". Raise it for every release.",
|
|
25
|
+
"type": "string",
|
|
26
|
+
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
|
|
27
|
+
"patternErrorMessage": "Use a semantic version, such as \"1.0.0\".",
|
|
28
|
+
"examples": ["1.0.0", "1.1.0-beta.1"]
|
|
29
|
+
},
|
|
30
|
+
"description": {
|
|
31
|
+
"description": "One line about what the dot does, shown in Dash's listing.",
|
|
32
|
+
"type": "string",
|
|
33
|
+
"minLength": 1
|
|
34
|
+
},
|
|
35
|
+
"categories": {
|
|
36
|
+
"description": "Where Dash lists the dot: one or more, such as [\"finance\", \"savings\"].",
|
|
37
|
+
"type": "array",
|
|
38
|
+
"items": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"enum": [
|
|
41
|
+
"agriculture",
|
|
42
|
+
"asset_finance",
|
|
43
|
+
"donations",
|
|
44
|
+
"education",
|
|
45
|
+
"electricity",
|
|
46
|
+
"entertainment",
|
|
47
|
+
"events",
|
|
48
|
+
"finance",
|
|
49
|
+
"food_and_drink",
|
|
50
|
+
"gambling",
|
|
51
|
+
"games",
|
|
52
|
+
"government",
|
|
53
|
+
"health",
|
|
54
|
+
"insurance",
|
|
55
|
+
"internet_service_provider",
|
|
56
|
+
"investments",
|
|
57
|
+
"jobs",
|
|
58
|
+
"lifestyle",
|
|
59
|
+
"loans",
|
|
60
|
+
"micro_credit",
|
|
61
|
+
"microfinance",
|
|
62
|
+
"news",
|
|
63
|
+
"other",
|
|
64
|
+
"productivity",
|
|
65
|
+
"real_estate",
|
|
66
|
+
"religion",
|
|
67
|
+
"remittances",
|
|
68
|
+
"savings",
|
|
69
|
+
"shopping",
|
|
70
|
+
"social",
|
|
71
|
+
"sports",
|
|
72
|
+
"telecom",
|
|
73
|
+
"television",
|
|
74
|
+
"transport",
|
|
75
|
+
"travel",
|
|
76
|
+
"utilities",
|
|
77
|
+
"water"
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
"minItems": 1,
|
|
81
|
+
"uniqueItems": true
|
|
82
|
+
},
|
|
83
|
+
"icon": {
|
|
84
|
+
"description": "The dot's icon: a square PNG file, relative to this file, such as \"icon.png\".",
|
|
85
|
+
"type": "string",
|
|
86
|
+
"pattern": "\\.png$",
|
|
87
|
+
"patternErrorMessage": "Use a PNG file, such as \"icon.png\"."
|
|
88
|
+
},
|
|
89
|
+
"permissions": {
|
|
90
|
+
"description": "What the dot may ask the person for, each with the reason Dash shows before granting it.",
|
|
91
|
+
"type": "object",
|
|
92
|
+
"properties": {
|
|
93
|
+
"account": {
|
|
94
|
+
"description": "The Dash account the person is logged into: their username (email or phone) and full name. Give the reason Dash shows the person.",
|
|
95
|
+
"type": "string",
|
|
96
|
+
"minLength": 1
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"additionalProperties": false
|
|
100
|
+
},
|
|
101
|
+
"dash": {
|
|
102
|
+
"description": "What the dot needs from Dash, the app it runs in.",
|
|
103
|
+
"type": "object",
|
|
104
|
+
"properties": {
|
|
105
|
+
"minVersion": {
|
|
106
|
+
"description": "The oldest Dash version the dot runs in, such as \"2.4.0\". Older versions of Dash should not open it.",
|
|
107
|
+
"type": "string",
|
|
108
|
+
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
|
|
109
|
+
"patternErrorMessage": "Use a semantic version, such as \"2.4.0\".",
|
|
110
|
+
"examples": ["2.4.0"]
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"additionalProperties": false
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"required": ["id", "name", "version"],
|
|
117
|
+
"additionalProperties": false
|
|
118
|
+
}
|
package/globals.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Enable with `"types": ["@monimesl/dot-runtime/globals"]`; the compiler adds the imports.
|
|
2
|
+
import type * as dot from '@monimesl/dot-runtime';
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
const definePage: typeof dot.definePage;
|
|
6
|
+
const defineDot: typeof dot.defineDot;
|
|
7
|
+
const createEvent: typeof dot.createEvent;
|
|
8
|
+
const dash: typeof dot.dash;
|
|
9
|
+
// The dot's public configuration: the DOT_PUBLIC_ variables from its .env files, fixed at build
|
|
10
|
+
// time. Anyone with the dot can read them, so they never hold secrets.
|
|
11
|
+
const env: [keyof DotPublicEnv] extends [never]
|
|
12
|
+
? Readonly<Record<string, string | undefined>>
|
|
13
|
+
: DotPublicEnv;
|
|
14
|
+
// Filled in by the generated .dot/env.d.ts; until the first build, any name is allowed.
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
16
|
+
interface DotPublicEnv {}
|
|
17
|
+
type DotEvent<Detail = unknown> = dot.DotEvent<Detail>;
|
|
18
|
+
type PageId = dot.PageId;
|
|
19
|
+
type PageState = dot.PageState;
|
|
20
|
+
type PageLaunchOptions = dot.PageLaunchOptions;
|
|
21
|
+
type Theme = dot.Theme;
|
|
22
|
+
|
|
23
|
+
// The service has no DOM lib, but every host provides `console`.
|
|
24
|
+
interface Console {
|
|
25
|
+
debug(...data: unknown[]): void;
|
|
26
|
+
error(...data: unknown[]): void;
|
|
27
|
+
info(...data: unknown[]): void;
|
|
28
|
+
log(...data: unknown[]): void;
|
|
29
|
+
warn(...data: unknown[]): void;
|
|
30
|
+
}
|
|
31
|
+
var console: Console;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@monimesl/dot-runtime",
|
|
3
|
+
"version": "0.1.0-alpha.2",
|
|
4
|
+
"description": "A composer of the service and webview runtimes and the default React renderer",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/monime-lab/dot.git",
|
|
9
|
+
"directory": "packages/runtime"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"globals.d.ts",
|
|
15
|
+
"dot.schema.json"
|
|
16
|
+
],
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"@monimesl/dot-source": "./src/index.ts",
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js",
|
|
22
|
+
"default": "./dist/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./logic": {
|
|
25
|
+
"@monimesl/dot-source": "./src/logic.ts",
|
|
26
|
+
"types": "./dist/logic.d.ts",
|
|
27
|
+
"import": "./dist/logic.js",
|
|
28
|
+
"default": "./dist/logic.js"
|
|
29
|
+
},
|
|
30
|
+
"./ui": {
|
|
31
|
+
"@monimesl/dot-source": "./src/ui.ts",
|
|
32
|
+
"types": "./dist/ui.d.ts",
|
|
33
|
+
"import": "./dist/ui.js",
|
|
34
|
+
"default": "./dist/ui.js"
|
|
35
|
+
},
|
|
36
|
+
"./react": {
|
|
37
|
+
"@monimesl/dot-source": "./src/react.ts",
|
|
38
|
+
"types": "./dist/react.d.ts",
|
|
39
|
+
"import": "./dist/react.js",
|
|
40
|
+
"default": "./dist/react.js"
|
|
41
|
+
},
|
|
42
|
+
"./testing": {
|
|
43
|
+
"@monimesl/dot-source": "./src/testing.ts",
|
|
44
|
+
"types": "./dist/testing.d.ts",
|
|
45
|
+
"import": "./dist/testing.js",
|
|
46
|
+
"default": "./dist/testing.js"
|
|
47
|
+
},
|
|
48
|
+
"./globals": {
|
|
49
|
+
"types": "./globals.d.ts"
|
|
50
|
+
},
|
|
51
|
+
"./dot.schema.json": "./dot.schema.json",
|
|
52
|
+
"./package.json": "./package.json"
|
|
53
|
+
},
|
|
54
|
+
"main": "./dist/index.js",
|
|
55
|
+
"types": "./dist/index.d.ts",
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"@monimesl/dot-renderer-react": "0.1.0-alpha.2",
|
|
58
|
+
"@monimesl/dot-webview": "0.1.0-alpha.2",
|
|
59
|
+
"@monimesl/dot-service": "0.1.0-alpha.2",
|
|
60
|
+
"@monimesl/dot-dash": "0.1.0-alpha.2"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"publint": "^0.3.24",
|
|
64
|
+
"rimraf": "^6.1.3",
|
|
65
|
+
"tsdown": "^0.23.0",
|
|
66
|
+
"typescript": "^5.9.3"
|
|
67
|
+
},
|
|
68
|
+
"publishConfig": {
|
|
69
|
+
"access": "public"
|
|
70
|
+
},
|
|
71
|
+
"scripts": {
|
|
72
|
+
"build": "tsdown",
|
|
73
|
+
"dev": "tsdown --watch",
|
|
74
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
75
|
+
"clean": "rimraf dist *.tsbuildinfo"
|
|
76
|
+
}
|
|
77
|
+
}
|