@swipt/cli 0.1.0-nightly.31 → 0.1.0-nightly.33
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/client.mjs +312 -0
- package/device.mjs +620 -0
- package/ignore.mjs +137 -0
- package/output.mjs +61 -0
- package/package.json +12 -5
- package/{cli.mjs → project.mjs} +109 -111
- package/proto/common_pb.js +98 -0
- package/proto/logs_pb.js +34 -0
- package/proto/repl_pb.js +55 -0
- package/proto/swiplets_pb.js +179 -0
- package/proto/system_pb.js +27 -0
- package/sourcemap.mjs +77 -0
- package/swipt.mjs +301 -0
package/proto/repl_pb.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// @generated by protoc-gen-es v2.16.0 with parameter "target=js,import_extension=.js"
|
|
2
|
+
// @generated from file repl.proto (package swipt, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
|
|
6
|
+
import { file_google_protobuf_empty } from "@bufbuild/protobuf/wkt";
|
|
7
|
+
import { file_common } from "./common_pb.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Describes the file repl.proto.
|
|
11
|
+
*/
|
|
12
|
+
export const file_repl = /*@__PURE__*/
|
|
13
|
+
fileDesc("CgpyZXBsLnByb3RvEgVzd2lwdCIyCg5FeGVjdXRlUmVxdWVzdBIMCgRjb2RlGAEgASgJEhIKCnRpbWVvdXRfbXMYAiABKA0iPQoNQ29uc29sZU91dHB1dBIeCgVsZXZlbBgBIAEoDjIPLnN3aXB0LkxvZ0xldmVsEgwKBHRleHQYAiABKAkiKQoLU2NyaXB0VmFsdWUSDAoEanNvbhgBIAEoCRIMCgR0ZXh0GAIgASgJIp0BCg9FeGVjdXRlUmVzcG9uc2USJwoHY29uc29sZRgBIAEoCzIULnN3aXB0LkNvbnNvbGVPdXRwdXRIABIjCgV2YWx1ZRgCIAEoCzISLnN3aXB0LlNjcmlwdFZhbHVlSAASDwoFaW1hZ2UYAyABKAxIABIjCgVlcnJvchgEIAEoCzISLnN3aXB0LlNjcmlwdEVycm9ySABCBgoEcGFydCItChdHZXREZWNsYXJhdGlvbnNSZXNwb25zZRISCgp0eXBlc2NyaXB0GAEgASgJMs0BCgtSRVBMU2VydmljZRI6CgdFeGVjdXRlEhUuc3dpcHQuRXhlY3V0ZVJlcXVlc3QaFi5zd2lwdC5FeGVjdXRlUmVzcG9uc2UwARI3CgVSZXNldBIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRJJCg9HZXREZWNsYXJhdGlvbnMSFi5nb29nbGUucHJvdG9idWYuRW1wdHkaHi5zd2lwdC5HZXREZWNsYXJhdGlvbnNSZXNwb25zZUIyWjBnaXRodWIuY29tL3N3aXB0LWF1dG9tYXRpb24vc3dpcHQvaW50ZXJuYWwvcHJvdG9iBnByb3RvMw", [file_google_protobuf_empty, file_common]);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Describes the message swipt.ExecuteRequest.
|
|
17
|
+
* Use `create(ExecuteRequestSchema)` to create a new message.
|
|
18
|
+
*/
|
|
19
|
+
export const ExecuteRequestSchema = /*@__PURE__*/
|
|
20
|
+
messageDesc(file_repl, 0);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Describes the message swipt.ConsoleOutput.
|
|
24
|
+
* Use `create(ConsoleOutputSchema)` to create a new message.
|
|
25
|
+
*/
|
|
26
|
+
export const ConsoleOutputSchema = /*@__PURE__*/
|
|
27
|
+
messageDesc(file_repl, 1);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Describes the message swipt.ScriptValue.
|
|
31
|
+
* Use `create(ScriptValueSchema)` to create a new message.
|
|
32
|
+
*/
|
|
33
|
+
export const ScriptValueSchema = /*@__PURE__*/
|
|
34
|
+
messageDesc(file_repl, 2);
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Describes the message swipt.ExecuteResponse.
|
|
38
|
+
* Use `create(ExecuteResponseSchema)` to create a new message.
|
|
39
|
+
*/
|
|
40
|
+
export const ExecuteResponseSchema = /*@__PURE__*/
|
|
41
|
+
messageDesc(file_repl, 3);
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Describes the message swipt.GetDeclarationsResponse.
|
|
45
|
+
* Use `create(GetDeclarationsResponseSchema)` to create a new message.
|
|
46
|
+
*/
|
|
47
|
+
export const GetDeclarationsResponseSchema = /*@__PURE__*/
|
|
48
|
+
messageDesc(file_repl, 4);
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @generated from service swipt.REPLService
|
|
52
|
+
*/
|
|
53
|
+
export const REPLService = /*@__PURE__*/
|
|
54
|
+
serviceDesc(file_repl, 0);
|
|
55
|
+
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
// @generated by protoc-gen-es v2.16.0 with parameter "target=js,import_extension=.js"
|
|
2
|
+
// @generated from file swiplets.proto (package swipt, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
import { enumDesc, fileDesc, messageDesc, serviceDesc, tsEnum } from "@bufbuild/protobuf/codegenv2";
|
|
6
|
+
import { file_google_protobuf_empty, file_google_protobuf_struct, file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
|
|
7
|
+
import { file_common } from "./common_pb.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Describes the file swiplets.proto.
|
|
11
|
+
*/
|
|
12
|
+
export const file_swiplets = /*@__PURE__*/
|
|
13
|
+
fileDesc("Cg5zd2lwbGV0cy5wcm90bxIFc3dpcHQivgEKDVN3aXBsZXRBY3Rpb24SDAoEbmFtZRgBIAEoCRINCgV0aXRsZRgCIAEoCRITCgtkZXNjcmlwdGlvbhgDIAEoCRIcChRleHBvc2VkX3RvX3Nob3J0Y3V0cxgEIAEoCBItCgxpbnB1dF9zY2hlbWE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ZWFkRGF0YUZpbGVSZXF1ZXN0Ghsuc3dpcHQuUmVhZERhdGFGaWxlUmVzcG9uc2UwARJMCg1Xcml0ZURhdGFGaWxlEhsuc3dpcHQuV3JpdGVEYXRhRmlsZVJlcXVlc3QaHC5zd2lwdC5Xcml0ZURhdGFGaWxlUmVzcG9uc2UoARJGCg5SZW1vdmVEYXRhRmlsZRIcLnN3aXB0LlJlbW92ZURhdGFGaWxlUmVxdWVzdBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eUIyWjBnaXRodWIuY29tL3N3aXB0LWF1dG9tYXRpb24vc3dpcHQvaW50ZXJuYWwvcHJvdG9iBnByb3RvMw", [file_google_protobuf_empty, file_google_protobuf_struct, file_google_protobuf_timestamp, file_common]);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Describes the message swipt.SwipletAction.
|
|
17
|
+
* Use `create(SwipletActionSchema)` to create a new message.
|
|
18
|
+
*/
|
|
19
|
+
export const SwipletActionSchema = /*@__PURE__*/
|
|
20
|
+
messageDesc(file_swiplets, 0);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Describes the message swipt.ServiceState.
|
|
24
|
+
* Use `create(ServiceStateSchema)` to create a new message.
|
|
25
|
+
*/
|
|
26
|
+
export const ServiceStateSchema = /*@__PURE__*/
|
|
27
|
+
messageDesc(file_swiplets, 1);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Describes the message swipt.Swiplet.
|
|
31
|
+
* Use `create(SwipletSchema)` to create a new message.
|
|
32
|
+
*/
|
|
33
|
+
export const SwipletSchema = /*@__PURE__*/
|
|
34
|
+
messageDesc(file_swiplets, 2);
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Describes the message swipt.ListSwipletsResponse.
|
|
38
|
+
* Use `create(ListSwipletsResponseSchema)` to create a new message.
|
|
39
|
+
*/
|
|
40
|
+
export const ListSwipletsResponseSchema = /*@__PURE__*/
|
|
41
|
+
messageDesc(file_swiplets, 3);
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Describes the message swipt.CallActionRequest.
|
|
45
|
+
* Use `create(CallActionRequestSchema)` to create a new message.
|
|
46
|
+
*/
|
|
47
|
+
export const CallActionRequestSchema = /*@__PURE__*/
|
|
48
|
+
messageDesc(file_swiplets, 4);
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Describes the message swipt.CallActionResponse.
|
|
52
|
+
* Use `create(CallActionResponseSchema)` to create a new message.
|
|
53
|
+
*/
|
|
54
|
+
export const CallActionResponseSchema = /*@__PURE__*/
|
|
55
|
+
messageDesc(file_swiplets, 5);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Describes the message swipt.SetServiceEnabledRequest.
|
|
59
|
+
* Use `create(SetServiceEnabledRequestSchema)` to create a new message.
|
|
60
|
+
*/
|
|
61
|
+
export const SetServiceEnabledRequestSchema = /*@__PURE__*/
|
|
62
|
+
messageDesc(file_swiplets, 6);
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Describes the message swipt.SetServiceEnabledResponse.
|
|
66
|
+
* Use `create(SetServiceEnabledResponseSchema)` to create a new message.
|
|
67
|
+
*/
|
|
68
|
+
export const SetServiceEnabledResponseSchema = /*@__PURE__*/
|
|
69
|
+
messageDesc(file_swiplets, 7);
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Describes the message swipt.WatchServicesRequest.
|
|
73
|
+
* Use `create(WatchServicesRequestSchema)` to create a new message.
|
|
74
|
+
*/
|
|
75
|
+
export const WatchServicesRequestSchema = /*@__PURE__*/
|
|
76
|
+
messageDesc(file_swiplets, 8);
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Describes the message swipt.WatchServicesResponse.
|
|
80
|
+
* Use `create(WatchServicesResponseSchema)` to create a new message.
|
|
81
|
+
*/
|
|
82
|
+
export const WatchServicesResponseSchema = /*@__PURE__*/
|
|
83
|
+
messageDesc(file_swiplets, 9);
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Describes the message swipt.DeploySwipletRequest.
|
|
87
|
+
* Use `create(DeploySwipletRequestSchema)` to create a new message.
|
|
88
|
+
*/
|
|
89
|
+
export const DeploySwipletRequestSchema = /*@__PURE__*/
|
|
90
|
+
messageDesc(file_swiplets, 10);
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Describes the message swipt.DeploySwipletResponse.
|
|
94
|
+
* Use `create(DeploySwipletResponseSchema)` to create a new message.
|
|
95
|
+
*/
|
|
96
|
+
export const DeploySwipletResponseSchema = /*@__PURE__*/
|
|
97
|
+
messageDesc(file_swiplets, 11);
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Describes the message swipt.RemoveSwipletRequest.
|
|
101
|
+
* Use `create(RemoveSwipletRequestSchema)` to create a new message.
|
|
102
|
+
*/
|
|
103
|
+
export const RemoveSwipletRequestSchema = /*@__PURE__*/
|
|
104
|
+
messageDesc(file_swiplets, 12);
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Describes the message swipt.ListDataFilesRequest.
|
|
108
|
+
* Use `create(ListDataFilesRequestSchema)` to create a new message.
|
|
109
|
+
*/
|
|
110
|
+
export const ListDataFilesRequestSchema = /*@__PURE__*/
|
|
111
|
+
messageDesc(file_swiplets, 13);
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Describes the message swipt.ListDataFilesResponse.
|
|
115
|
+
* Use `create(ListDataFilesResponseSchema)` to create a new message.
|
|
116
|
+
*/
|
|
117
|
+
export const ListDataFilesResponseSchema = /*@__PURE__*/
|
|
118
|
+
messageDesc(file_swiplets, 14);
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Describes the message swipt.ReadDataFileRequest.
|
|
122
|
+
* Use `create(ReadDataFileRequestSchema)` to create a new message.
|
|
123
|
+
*/
|
|
124
|
+
export const ReadDataFileRequestSchema = /*@__PURE__*/
|
|
125
|
+
messageDesc(file_swiplets, 15);
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Describes the message swipt.ReadDataFileResponse.
|
|
129
|
+
* Use `create(ReadDataFileResponseSchema)` to create a new message.
|
|
130
|
+
*/
|
|
131
|
+
export const ReadDataFileResponseSchema = /*@__PURE__*/
|
|
132
|
+
messageDesc(file_swiplets, 16);
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Describes the message swipt.WriteDataFileHeader.
|
|
136
|
+
* Use `create(WriteDataFileHeaderSchema)` to create a new message.
|
|
137
|
+
*/
|
|
138
|
+
export const WriteDataFileHeaderSchema = /*@__PURE__*/
|
|
139
|
+
messageDesc(file_swiplets, 17);
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Describes the message swipt.WriteDataFileRequest.
|
|
143
|
+
* Use `create(WriteDataFileRequestSchema)` to create a new message.
|
|
144
|
+
*/
|
|
145
|
+
export const WriteDataFileRequestSchema = /*@__PURE__*/
|
|
146
|
+
messageDesc(file_swiplets, 18);
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Describes the message swipt.WriteDataFileResponse.
|
|
150
|
+
* Use `create(WriteDataFileResponseSchema)` to create a new message.
|
|
151
|
+
*/
|
|
152
|
+
export const WriteDataFileResponseSchema = /*@__PURE__*/
|
|
153
|
+
messageDesc(file_swiplets, 19);
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Describes the message swipt.RemoveDataFileRequest.
|
|
157
|
+
* Use `create(RemoveDataFileRequestSchema)` to create a new message.
|
|
158
|
+
*/
|
|
159
|
+
export const RemoveDataFileRequestSchema = /*@__PURE__*/
|
|
160
|
+
messageDesc(file_swiplets, 20);
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Describes the enum swipt.ServiceStatus.
|
|
164
|
+
*/
|
|
165
|
+
export const ServiceStatusSchema = /*@__PURE__*/
|
|
166
|
+
enumDesc(file_swiplets, 0);
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* @generated from enum swipt.ServiceStatus
|
|
170
|
+
*/
|
|
171
|
+
export const ServiceStatus = /*@__PURE__*/
|
|
172
|
+
tsEnum(ServiceStatusSchema);
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @generated from service swipt.SwipletService
|
|
176
|
+
*/
|
|
177
|
+
export const SwipletService = /*@__PURE__*/
|
|
178
|
+
serviceDesc(file_swiplets, 0);
|
|
179
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// @generated by protoc-gen-es v2.16.0 with parameter "target=js,import_extension=.js"
|
|
2
|
+
// @generated from file system.proto (package swipt, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
|
|
6
|
+
import { file_google_protobuf_empty } from "@bufbuild/protobuf/wkt";
|
|
7
|
+
import { file_common } from "./common_pb.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Describes the file system.proto.
|
|
11
|
+
*/
|
|
12
|
+
export const file_system = /*@__PURE__*/
|
|
13
|
+
fileDesc("CgxzeXN0ZW0ucHJvdG8SBXN3aXB0IoABCg9HZXRJbmZvUmVzcG9uc2USFgoOc2VydmVyX3ZlcnNpb24YASABKAkSEwoLZGV2aWNlX25hbWUYAiABKAkSDAoEdWRpZBgDIAEoCRIyChFkZXZpY2VfY29ubmVjdGlvbhgEIAEoCzIXLnN3aXB0LkRldmljZUNvbm5lY3Rpb24ySgoNU3lzdGVtU2VydmljZRI5CgdHZXRJbmZvEhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5GhYuc3dpcHQuR2V0SW5mb1Jlc3BvbnNlQjJaMGdpdGh1Yi5jb20vc3dpcHQtYXV0b21hdGlvbi9zd2lwdC9pbnRlcm5hbC9wcm90b2IGcHJvdG8z", [file_google_protobuf_empty, file_common]);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Describes the message swipt.GetInfoResponse.
|
|
17
|
+
* Use `create(GetInfoResponseSchema)` to create a new message.
|
|
18
|
+
*/
|
|
19
|
+
export const GetInfoResponseSchema = /*@__PURE__*/
|
|
20
|
+
messageDesc(file_system, 0);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @generated from service swipt.SystemService
|
|
24
|
+
*/
|
|
25
|
+
export const SystemService = /*@__PURE__*/
|
|
26
|
+
serviceDesc(file_system, 0);
|
|
27
|
+
|
package/sourcemap.mjs
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
import { TraceMap, originalPositionFor } from "@jridgewell/trace-mapping";
|
|
5
|
+
|
|
6
|
+
import { loadProject } from "./project.mjs";
|
|
7
|
+
|
|
8
|
+
const suffix = ".map";
|
|
9
|
+
|
|
10
|
+
function loadSourceMap(name) {
|
|
11
|
+
const raw = JSON.parse(fs.readFileSync(name, "utf8"));
|
|
12
|
+
const directory = path.dirname(name);
|
|
13
|
+
const working = process.cwd();
|
|
14
|
+
const resolve = source => {
|
|
15
|
+
const resolved = path.join(directory, raw.sourceRoot ?? "", source);
|
|
16
|
+
const relative = path.relative(working, resolved);
|
|
17
|
+
return relative.startsWith("..") || path.isAbsolute(relative) ? resolved : relative;
|
|
18
|
+
};
|
|
19
|
+
const map = new TraceMap({ ...raw, sourceRoot: undefined });
|
|
20
|
+
return (line, column) => {
|
|
21
|
+
const found = originalPositionFor(map, { line, column: column - 1 });
|
|
22
|
+
return found.source === null ? undefined : { file: resolve(found.source), line: found.line, column: found.column + 1 };
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export class SourceMaps {
|
|
27
|
+
root = "";
|
|
28
|
+
loaded = new Map();
|
|
29
|
+
|
|
30
|
+
forSwiplet(id) {
|
|
31
|
+
if (this.root === "") {
|
|
32
|
+
return {};
|
|
33
|
+
}
|
|
34
|
+
if (this.loaded.has(id)) {
|
|
35
|
+
return this.loaded.get(id);
|
|
36
|
+
}
|
|
37
|
+
const found = {};
|
|
38
|
+
let project;
|
|
39
|
+
try {
|
|
40
|
+
project = loadProject(this.root);
|
|
41
|
+
} catch {
|
|
42
|
+
project = undefined;
|
|
43
|
+
}
|
|
44
|
+
if (project?.config.id === id) {
|
|
45
|
+
const directory = path.join(project.root, "dist", id, "src");
|
|
46
|
+
let names = [];
|
|
47
|
+
try {
|
|
48
|
+
names = fs.readdirSync(directory).filter(name => name.endsWith(suffix));
|
|
49
|
+
} catch {
|
|
50
|
+
names = [];
|
|
51
|
+
}
|
|
52
|
+
for (const name of names) {
|
|
53
|
+
try {
|
|
54
|
+
found[name.slice(0, -suffix.length)] = loadSourceMap(path.join(directory, name));
|
|
55
|
+
} catch {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
this.loaded.set(id, found);
|
|
61
|
+
return found;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
forget(id) {
|
|
65
|
+
this.loaded.delete(id);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
frame(id) {
|
|
69
|
+
return frame => {
|
|
70
|
+
const lookup = this.forSwiplet(id)[frame.file];
|
|
71
|
+
const mapped = lookup?.(frame.line, frame.column);
|
|
72
|
+
return mapped ? { ...frame, ...mapped } : frame;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export const sources = new SourceMaps();
|
package/swipt.mjs
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { parseArgs } from "node:util";
|
|
4
|
+
|
|
5
|
+
import { Code, RpcError, UsageError } from "./client.mjs";
|
|
6
|
+
import * as device from "./device.mjs";
|
|
7
|
+
import { FalseResult } from "./output.mjs";
|
|
8
|
+
import { buildProject, createCommand, sourceCommand } from "./project.mjs";
|
|
9
|
+
import { sources } from "./sourcemap.mjs";
|
|
10
|
+
|
|
11
|
+
const globalOptions = {
|
|
12
|
+
host: { type: "string", value: "URL", help: "Swipt URL (SWIPT_HOST)" },
|
|
13
|
+
token: { type: "string", value: "TOKEN", help: "API token (SWIPT_TOKEN)" },
|
|
14
|
+
timeout: { type: "string", value: "DURATION", help: "time limit" },
|
|
15
|
+
help: { type: "boolean", short: "h", help: "help" },
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const projectOption = { project: { type: "string", value: "DIRECTORY", help: "swiplet project for source maps" } };
|
|
19
|
+
|
|
20
|
+
const durationUnits = { ns: 1e-6, us: 1e-3, "µs": 1e-3, ms: 1, s: 1000, m: 60_000, h: 3_600_000 };
|
|
21
|
+
|
|
22
|
+
function parseDuration(text, option) {
|
|
23
|
+
if (text === undefined) {
|
|
24
|
+
return 0;
|
|
25
|
+
}
|
|
26
|
+
if (/^-?\d+$/.test(text) && Number(text) === 0) {
|
|
27
|
+
return 0;
|
|
28
|
+
}
|
|
29
|
+
let total = 0;
|
|
30
|
+
let rest = text;
|
|
31
|
+
while (rest !== "") {
|
|
32
|
+
const match = /^(\d+(?:\.\d*)?|\.\d+)(ns|us|µs|ms|s|m|h)/.exec(rest);
|
|
33
|
+
if (!match) {
|
|
34
|
+
throw new UsageError(`invalid argument ${JSON.stringify(text)} for ${option}: it is a duration such as 30s or 1m30s`);
|
|
35
|
+
}
|
|
36
|
+
total += Number(match[1]) * durationUnits[match[2]];
|
|
37
|
+
rest = rest.slice(match[0].length);
|
|
38
|
+
}
|
|
39
|
+
return total;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function parseCount(text, option) {
|
|
43
|
+
if (text === undefined) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
if (!/^\d+$/.test(text) || Number(text) > 0xffffffff) {
|
|
47
|
+
throw new UsageError(`invalid argument ${JSON.stringify(text)} for ${option}: it is a number`);
|
|
48
|
+
}
|
|
49
|
+
return Number(text);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const commands = [
|
|
53
|
+
{
|
|
54
|
+
name: "create",
|
|
55
|
+
use: "create DIRECTORY",
|
|
56
|
+
short: "Make a swiplet project in a new or empty directory",
|
|
57
|
+
args: [1, 1],
|
|
58
|
+
run: ({ args }) => createCommand(args[0]),
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "build",
|
|
62
|
+
short: "Bundle the project in this directory into dist/<swiplet.id>.swiplet",
|
|
63
|
+
args: [0, 0],
|
|
64
|
+
run: async () => {
|
|
65
|
+
const { archive } = await buildProject(process.cwd());
|
|
66
|
+
console.log(path.relative(process.cwd(), archive));
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "source",
|
|
71
|
+
use: "source [SWIPLET...]",
|
|
72
|
+
short: 'Gather the built swiplets of this directory\'s workspaces, or the given ones, into dist/ with a swiplets.json described by "source" in package.json',
|
|
73
|
+
args: [0, Infinity],
|
|
74
|
+
run: ({ args }) => sourceCommand(process.cwd(), args),
|
|
75
|
+
},
|
|
76
|
+
{ name: "devices", short: "List the devices that publish Swipt on the local network", args: [0, 0], run: device.devices },
|
|
77
|
+
{ name: "info", short: "Show the device and its connection", args: [0, 0], run: device.info },
|
|
78
|
+
{ name: "version", short: "Print the version", args: [0, 0], run: device.printVersion },
|
|
79
|
+
{ name: "swiplets", use: "swiplets [ID]", short: "List the swiplets or show one", args: [0, 1], options: projectOption, run: device.swiplets },
|
|
80
|
+
{
|
|
81
|
+
name: "call",
|
|
82
|
+
use: "call ID ACTION",
|
|
83
|
+
short: "Call a swiplet action",
|
|
84
|
+
args: [2, 2],
|
|
85
|
+
options: { input: { type: "string", value: "JSON", help: "input JSON, @FILE or -" }, ...projectOption },
|
|
86
|
+
run: device.call,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: "service",
|
|
90
|
+
short: "Manage swiplet services",
|
|
91
|
+
options: projectOption,
|
|
92
|
+
commands: [
|
|
93
|
+
{ name: "enable", use: "enable ID", short: "Turn on a swiplet service", args: [1, 1], options: { watch: { type: "boolean", help: "watch the state" } }, run: device.setService(true) },
|
|
94
|
+
{ name: "disable", use: "disable ID", short: "Turn off a swiplet service", args: [1, 1], options: { watch: { type: "boolean", help: "watch the state" } }, run: device.setService(false) },
|
|
95
|
+
{ name: "watch", use: "watch [ID]", short: "Watch swiplet services", args: [0, 1], run: device.serviceWatch },
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
{ name: "remove", use: "remove ID", short: "Remove a swiplet", args: [1, 1], run: device.remove },
|
|
99
|
+
{
|
|
100
|
+
name: "files",
|
|
101
|
+
short: "Manage swiplet data files",
|
|
102
|
+
commands: [
|
|
103
|
+
{ name: "list", use: "list ID [PATH]", short: "List data files", args: [1, 2], options: { recursive: { type: "boolean", help: "include subdirectories" } }, run: device.filesList },
|
|
104
|
+
{ name: "read", use: "read ID PATH", short: "Read a data file or directory", args: [2, 2], options: { output: { type: "string", value: "PATH", help: "destination" } }, run: device.filesRead },
|
|
105
|
+
{ name: "write", use: "write ID PATH [FILE | -]", short: "Write a data file", args: [2, 3], run: device.filesWrite },
|
|
106
|
+
{ name: "remove", use: "remove ID PATH", short: "Remove a data file", args: [2, 2], options: { recursive: { type: "boolean", help: "include directory contents" } }, run: device.filesRemove },
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
{ name: "deploy", use: "deploy [ARCHIVE | PROJECT]", short: "Build and install a swiplet", args: [0, 1], run: device.deployCommand },
|
|
110
|
+
{
|
|
111
|
+
name: "develop",
|
|
112
|
+
use: "develop [PROJECT]",
|
|
113
|
+
short: "Build, install and follow a swiplet project as it changes",
|
|
114
|
+
args: [0, 1],
|
|
115
|
+
options: { "no-logs": { type: "boolean", help: "without logs" } },
|
|
116
|
+
run: device.develop,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: "logs",
|
|
120
|
+
short: "Print the logs",
|
|
121
|
+
args: [0, 0],
|
|
122
|
+
options: {
|
|
123
|
+
follow: { type: "boolean", help: "follow new entries" },
|
|
124
|
+
tail: { type: "string", value: "COUNT", help: "number of past entries (default 100)" },
|
|
125
|
+
since: { type: "string", value: "DURATION", help: "maximum age" },
|
|
126
|
+
level: { type: "string", value: "LEVEL", help: "minimum level (default info)" },
|
|
127
|
+
swiplet: { type: "string", value: "ID", help: "swiplet ID" },
|
|
128
|
+
},
|
|
129
|
+
parse: options => ({ ...options, tail: parseCount(options.tail, "--tail"), since: parseDuration(options.since, "--since"), level: options.level ?? "info" }),
|
|
130
|
+
run: device.logs,
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: "js",
|
|
134
|
+
use: "js [CODE | -]",
|
|
135
|
+
short: "Run JavaScript on the device",
|
|
136
|
+
args: [0, 1],
|
|
137
|
+
options: {
|
|
138
|
+
file: { type: "string", value: "FILE", help: "script file" },
|
|
139
|
+
reset: { type: "boolean", help: "reset the session first" },
|
|
140
|
+
api: { type: "boolean", help: "TypeScript declarations" },
|
|
141
|
+
output: { type: "string", value: "DIRECTORY", help: "image directory" },
|
|
142
|
+
},
|
|
143
|
+
run: device.js,
|
|
144
|
+
},
|
|
145
|
+
];
|
|
146
|
+
|
|
147
|
+
const root = { name: "swipt", short: "Operate a device through Swipt", commands };
|
|
148
|
+
|
|
149
|
+
const parseOptions = options => Object.fromEntries(Object.entries(options ?? {}).map(([name, option]) => [name, { type: option.type, ...(option.short ? { short: option.short } : {}) }]));
|
|
150
|
+
|
|
151
|
+
function allOptions(command, collected = {}) {
|
|
152
|
+
Object.assign(collected, parseOptions(command.options));
|
|
153
|
+
for (const child of command.commands ?? []) {
|
|
154
|
+
allOptions(child, collected);
|
|
155
|
+
}
|
|
156
|
+
return collected;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function usage(trail) {
|
|
160
|
+
const command = trail.at(-1);
|
|
161
|
+
const name = trail.map(it => it.name).join(" ");
|
|
162
|
+
const lines = [command.short, ""];
|
|
163
|
+
if (command.commands) {
|
|
164
|
+
lines.push(`usage: ${name} COMMAND`, "", "commands:");
|
|
165
|
+
lines.push(...columns(command.commands.map(child => [` ${child.use ?? child.name}`, child.short])).split("\n"));
|
|
166
|
+
} else {
|
|
167
|
+
lines.push(`usage: ${trail.slice(0, -1).map(it => it.name).join(" ")} ${command.use ?? command.name}`.replace(/ +/g, " "));
|
|
168
|
+
}
|
|
169
|
+
const options = { ...trail.reduce((found, it) => ({ ...found, ...it.options }), {}), ...globalOptions };
|
|
170
|
+
lines.push("", "options:");
|
|
171
|
+
lines.push(...columns(Object.entries(options).map(([option, it]) => [` --${option}${it.value ? ` ${it.value}` : ""}`, it.help])).split("\n"));
|
|
172
|
+
return lines.join("\n");
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function columns(rows) {
|
|
176
|
+
const width = Math.max(...rows.map(row => row[0].length));
|
|
177
|
+
return rows.map(row => `${row[0].padEnd(width + 2)}${row[1]}`).join("\n");
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function resolve(argv) {
|
|
181
|
+
const loose = parseArgs({ args: argv, options: { ...parseOptions(globalOptions), ...allOptions(root) }, allowPositionals: true, strict: false });
|
|
182
|
+
const trail = [root];
|
|
183
|
+
let consumed = 0;
|
|
184
|
+
let help = loose.positionals[0] === "help";
|
|
185
|
+
if (help) {
|
|
186
|
+
consumed++;
|
|
187
|
+
}
|
|
188
|
+
while (trail.at(-1).commands) {
|
|
189
|
+
const current = trail.at(-1);
|
|
190
|
+
const word = loose.positionals[consumed];
|
|
191
|
+
if (word === undefined) {
|
|
192
|
+
if (help || current !== root || argv.length === 0) {
|
|
193
|
+
return { trail, help: true };
|
|
194
|
+
}
|
|
195
|
+
throw new UsageError("a command is missing");
|
|
196
|
+
}
|
|
197
|
+
const found = current.commands.find(it => it.name === word);
|
|
198
|
+
if (!found) {
|
|
199
|
+
throw new UsageError(`unknown command ${JSON.stringify(word)} for ${JSON.stringify(trail.map(it => it.name).join(" "))}`);
|
|
200
|
+
}
|
|
201
|
+
trail.push(found);
|
|
202
|
+
consumed++;
|
|
203
|
+
}
|
|
204
|
+
const options = trail.reduce((found, it) => ({ ...found, ...it.options }), {});
|
|
205
|
+
let parsed;
|
|
206
|
+
try {
|
|
207
|
+
parsed = parseArgs({ args: argv, options: { ...parseOptions(globalOptions), ...parseOptions(options) }, allowPositionals: true, strict: true });
|
|
208
|
+
} catch (error) {
|
|
209
|
+
throw new UsageError(error.message);
|
|
210
|
+
}
|
|
211
|
+
if (parsed.values.help) {
|
|
212
|
+
help = true;
|
|
213
|
+
}
|
|
214
|
+
const args = parsed.positionals.slice(consumed);
|
|
215
|
+
const command = trail.at(-1);
|
|
216
|
+
if (!help && (args.length < command.args[0] || args.length > command.args[1])) {
|
|
217
|
+
const [least, most] = command.args;
|
|
218
|
+
const expected = least === most ? `${least} arg(s)` : most === Infinity ? `at least ${least} arg(s)` : `between ${least} and ${most} arg(s)`;
|
|
219
|
+
throw new UsageError(`accepts ${expected}, received ${args.length}`);
|
|
220
|
+
}
|
|
221
|
+
return { trail, help, args, values: parsed.values };
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function printError(error, { host, timeout, timedOut }, operation) {
|
|
225
|
+
let exit = 1;
|
|
226
|
+
let message = error.message;
|
|
227
|
+
if (error instanceof UsageError) {
|
|
228
|
+
exit = 2;
|
|
229
|
+
} else if (timedOut) {
|
|
230
|
+
message = `the command ran past --timeout ${timeout}`;
|
|
231
|
+
} else if (error instanceof RpcError) {
|
|
232
|
+
switch (error.code) {
|
|
233
|
+
case Code.Unavailable:
|
|
234
|
+
exit = 5;
|
|
235
|
+
message = `Swipt at ${host} is unreachable: ${message}`;
|
|
236
|
+
break;
|
|
237
|
+
case Code.Unauthenticated:
|
|
238
|
+
message += "; copy the token from Swipt › Developer";
|
|
239
|
+
break;
|
|
240
|
+
case Code.Unimplemented:
|
|
241
|
+
message = `Swipt at ${host} does not have this command; update Swipt`;
|
|
242
|
+
break;
|
|
243
|
+
case Code.DeadlineExceeded:
|
|
244
|
+
if (timeout) {
|
|
245
|
+
message = `the command ran past --timeout ${timeout}`;
|
|
246
|
+
}
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
console.error("error:", operation === undefined ? message : `${operation}: ${message}`);
|
|
251
|
+
if (exit === 2) {
|
|
252
|
+
console.error('run "swipt help" for usage');
|
|
253
|
+
}
|
|
254
|
+
return exit;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
async function main() {
|
|
258
|
+
const interrupt = new AbortController();
|
|
259
|
+
const interrupted = () => interrupt.abort();
|
|
260
|
+
process.once("SIGINT", interrupted);
|
|
261
|
+
process.once("SIGTERM", interrupted);
|
|
262
|
+
let timeout;
|
|
263
|
+
const state = { host: "", timeout: undefined, timedOut: false };
|
|
264
|
+
try {
|
|
265
|
+
const resolved = resolve(process.argv.slice(2));
|
|
266
|
+
if (resolved.help) {
|
|
267
|
+
console.log(usage(resolved.trail));
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
const command = resolved.trail.at(-1);
|
|
271
|
+
const values = command.parse ? command.parse(resolved.values) : resolved.values;
|
|
272
|
+
state.host = values.host ?? process.env.SWIPT_HOST ?? "";
|
|
273
|
+
state.timeout = values.timeout;
|
|
274
|
+
const timeoutMs = parseDuration(values.timeout, "--timeout");
|
|
275
|
+
if (timeoutMs > 0) {
|
|
276
|
+
timeout = AbortSignal.timeout(timeoutMs);
|
|
277
|
+
timeout.addEventListener("abort", () => {
|
|
278
|
+
state.timedOut = true;
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
if (values.project !== undefined) {
|
|
282
|
+
sources.root = path.resolve(values.project);
|
|
283
|
+
}
|
|
284
|
+
const globals = { host: values.host ?? "", token: values.token ?? "", timeoutMs };
|
|
285
|
+
const signal = timeout ? AbortSignal.any([interrupt.signal, timeout]) : interrupt.signal;
|
|
286
|
+
await command.run({ args: resolved.args, options: values, globals, signal, interrupt: interrupt.signal, printError: (error, operation) => printError(error, state, operation) });
|
|
287
|
+
} catch (error) {
|
|
288
|
+
if (error instanceof FalseResult) {
|
|
289
|
+
process.exitCode = 1;
|
|
290
|
+
} else if (interrupt.signal.aborted) {
|
|
291
|
+
process.exitCode = 130;
|
|
292
|
+
} else {
|
|
293
|
+
process.exitCode = printError(error, state);
|
|
294
|
+
}
|
|
295
|
+
} finally {
|
|
296
|
+
process.off("SIGINT", interrupted);
|
|
297
|
+
process.off("SIGTERM", interrupted);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
await main();
|