-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtools.schema.json
More file actions
124 lines (124 loc) · 4.91 KB
/
tools.schema.json
File metadata and controls
124 lines (124 loc) · 4.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "socket-addon tools.json",
"description": "Declares which tools publish.mts knows how to publish, and the per-tool conventions that drive download/verify/stage/publish. Two shapes: `per-platform-addon` (umbrella + N per-platform shims, e.g. NAPI .node), and `umbrella-only` (single umbrella package containing one or more platform-agnostic assets, e.g. WASM).",
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": {
"type": "string"
},
"$comment": {
"type": "string"
},
"tools": {
"type": "object",
"additionalProperties": {
"oneOf": [
{ "$ref": "#/definitions/perPlatformAddon" },
{ "$ref": "#/definitions/umbrellaOnly" }
]
}
}
},
"definitions": {
"perPlatformAddon": {
"type": "object",
"additionalProperties": false,
"required": [
"shape",
"umbrellaDir",
"platformDirPrefix",
"binaryFileName",
"assetExtension",
"platforms"
],
"properties": {
"shape": {
"const": "per-platform-addon",
"description": "Discriminator: umbrella + per-platform shims (e.g. NAPI .node)."
},
"umbrellaDir": {
"type": "string",
"description": "Directory name under packages/ for the umbrella package, e.g. 'opentui' (publishes as @socketaddon/opentui).",
"minLength": 1
},
"platformDirPrefix": {
"type": "string",
"description": "Prefix for per-platform package directories under packages/, e.g. 'opentui-' (so opentui-darwin-arm64, opentui-linux-x64, etc.). The releaseSuffix or npmSuffix is appended to form the full dir name.",
"minLength": 1
},
"binaryFileName": {
"type": "string",
"description": "Filename inside the staged per-platform package where the verified binary is written, e.g. 'opentui.node'.",
"minLength": 1
},
"assetExtension": {
"type": "string",
"description": "File extension of the asset downloaded from socket-btm Release, e.g. '.node' or '.tar.gz'. Includes the leading dot.",
"pattern": "^\\..+$"
},
"platforms": {
"type": "array",
"description": "Per-platform package directory mappings. Each entry's `releaseSuffix` is the suffix on socket-btm's release asset filename, e.g. 'darwin-arm64'. The full package dir is `<platformDirPrefix><releaseSuffix>` (or remapped via npmSuffix when btm and npm naming diverge).",
"minItems": 1,
"items": {
"type": "object",
"additionalProperties": false,
"required": ["releaseSuffix"],
"properties": {
"releaseSuffix": {
"type": "string",
"description": "Suffix on the socket-btm release asset, e.g. 'darwin-arm64', 'linux-x64-musl', 'win32-x64'.",
"minLength": 1
},
"npmSuffix": {
"type": "string",
"description": "If the per-platform package directory name differs from releaseSuffix, give the directory suffix here. Used when socket-btm uses 'win-' but npm uses 'win32-' (process.platform naming).",
"minLength": 1
}
}
}
}
}
},
"umbrellaOnly": {
"type": "object",
"additionalProperties": false,
"required": ["shape", "umbrellaDir", "umbrellaAssets"],
"properties": {
"shape": {
"const": "umbrella-only",
"description": "Discriminator: single umbrella package containing N platform-agnostic assets (e.g. WASM)."
},
"umbrellaDir": {
"type": "string",
"description": "Directory name under packages/ for the single published package, e.g. 'onnxruntime' (publishes as @socketaddon/onnxruntime).",
"minLength": 1
},
"umbrellaAssets": {
"type": "array",
"description": "Asset files to download from the socket-btm Release into the umbrella's staged dir. Each asset has a `remoteName` (filename as uploaded to GH Release) and `localName` (filename inside the staged package).",
"minItems": 1,
"items": {
"type": "object",
"additionalProperties": false,
"required": ["remoteName", "localName"],
"properties": {
"remoteName": {
"type": "string",
"description": "Asset filename on socket-btm GH Release, e.g. 'ort.wasm'.",
"minLength": 1
},
"localName": {
"type": "string",
"description": "Filename inside the staged package, e.g. 'ort.wasm'. Usually identical to remoteName.",
"minLength": 1
}
}
}
}
}
}
}
}