@appstrata/cli 0.1.1 → 1.0.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-http-player.d.ts","sourceRoot":"","sources":["../../src/commands/dev-http-player.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAkDH,UAAU,oBAAoB;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAmFD,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"dev-http-player.d.ts","sourceRoot":"","sources":["../../src/commands/dev-http-player.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAkDH,UAAU,oBAAoB;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAmFD,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4QvF"}
|
|
@@ -186,30 +186,8 @@ export async function devHttpPlayerCommand(options) {
|
|
|
186
186
|
target: {},
|
|
187
187
|
transport,
|
|
188
188
|
retryInterval: 500,
|
|
189
|
-
|
|
190
|
-
console.log(`[AppStrata Dev HTTP Player] [${sessionId}] App
|
|
191
|
-
setTimeout(() => {
|
|
192
|
-
console.log(`[AppStrata Dev HTTP Player] [${sessionId}] fireHide`);
|
|
193
|
-
appHost.fireHide();
|
|
194
|
-
}, hideDelay);
|
|
195
|
-
setTimeout(() => {
|
|
196
|
-
console.log(`[AppStrata Dev HTTP Player] [${sessionId}] fireStop`);
|
|
197
|
-
appHost.fireStop();
|
|
198
|
-
}, hideDelay + stopDelay);
|
|
199
|
-
},
|
|
200
|
-
notifyEstimatedEnd: (expectedFinishTime) => {
|
|
201
|
-
const secsUntil = Math.round((expectedFinishTime - Date.now()) / 1000);
|
|
202
|
-
console.log(`[AppStrata Dev HTTP Player] [${sessionId}] App called notifyEstimatedEnd() — finishes in ~${secsUntil}s (${new Date(expectedFinishTime).toISOString()})`);
|
|
203
|
-
},
|
|
204
|
-
notifyNoContent: (options) => {
|
|
205
|
-
const parts = [`[AppStrata Dev HTTP Player] [${sessionId}] App called notifyNoContent()`];
|
|
206
|
-
if (options?.reason)
|
|
207
|
-
parts.push(`reason="${options.reason}"`);
|
|
208
|
-
if (options?.retryNotBefore) {
|
|
209
|
-
const secsUntil = Math.round((options.retryNotBefore - Date.now()) / 1000);
|
|
210
|
-
parts.push(`retry in ~${secsUntil}s`);
|
|
211
|
-
}
|
|
212
|
-
console.log(parts.join(" — "));
|
|
189
|
+
markComplete: () => {
|
|
190
|
+
console.log(`[AppStrata Dev HTTP Player] [${sessionId}] App marked complete`);
|
|
213
191
|
setTimeout(() => {
|
|
214
192
|
console.log(`[AppStrata Dev HTTP Player] [${sessionId}] fireHide`);
|
|
215
193
|
appHost.fireHide();
|
package/dist/index.js
CHANGED
|
@@ -4,18 +4,15 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
|
-
import { createRequire } from "node:module";
|
|
8
7
|
import { Command } from "commander";
|
|
9
8
|
import { devCommand } from "./commands/dev.js";
|
|
10
9
|
import { devHttpPlayerCommand } from "./commands/dev-http-player.js";
|
|
11
10
|
import { packageCommand } from "./commands/package.js";
|
|
12
|
-
const require = createRequire(import.meta.url);
|
|
13
|
-
const pkg = require("../package.json");
|
|
14
11
|
const program = new Command();
|
|
15
12
|
program
|
|
16
13
|
.name("appstrata")
|
|
17
14
|
.description("AppStrata Development Tools CLI")
|
|
18
|
-
.version(
|
|
15
|
+
.version("1.0.0");
|
|
19
16
|
program
|
|
20
17
|
.command("dev")
|
|
21
18
|
.description("Start development player with iframe")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-generator.d.ts","sourceRoot":"","sources":["../src/schema-generator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,SAAS,
|
|
1
|
+
{"version":3,"file":"schema-generator.d.ts","sourceRoot":"","sources":["../src/schema-generator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,SAAS,EAUV,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE;QACJ,gBAAgB,EAAE,MAAM,CAAC;QACzB,mBAAmB,EAAE,MAAM,CAAC;QAC5B,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IACF,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,aAAa,EAAE,OAAO,EAAE,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAC9C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;AAuMD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,SAAS,GAAG,YAAY,CA0CvE"}
|
package/dist/schema-generator.js
CHANGED
|
@@ -158,10 +158,6 @@ function transformImageInput(input) {
|
|
|
158
158
|
field.validators = validators;
|
|
159
159
|
return field;
|
|
160
160
|
}
|
|
161
|
-
const KNOWN_INPUT_TYPES = ["text", "color", "boolean", "number", "select", "range", "font", "image"];
|
|
162
|
-
function isKnownInput(input) {
|
|
163
|
-
return KNOWN_INPUT_TYPES.includes(input.type);
|
|
164
|
-
}
|
|
165
161
|
function transformInput(input) {
|
|
166
162
|
switch (input.type) {
|
|
167
163
|
case "text": return transformTextInput(input);
|
|
@@ -208,19 +204,12 @@ function deepMerge(base, override) {
|
|
|
208
204
|
*/
|
|
209
205
|
export function generateYodeckSchema(appConfig) {
|
|
210
206
|
const inputs = appConfig.configuration?.inputs ?? {};
|
|
207
|
+
const keys = Object.keys(inputs);
|
|
211
208
|
const data = {};
|
|
212
209
|
const schema = {};
|
|
213
210
|
const fieldKeys = [];
|
|
214
|
-
for (const key of
|
|
211
|
+
for (const key of keys) {
|
|
215
212
|
const input = inputs[key];
|
|
216
|
-
if (!isKnownInput(input)) {
|
|
217
|
-
const { default: defaultVal, ...rest } = input;
|
|
218
|
-
fieldKeys.push(key);
|
|
219
|
-
schema[key] = rest;
|
|
220
|
-
if (defaultVal !== undefined)
|
|
221
|
-
data[key] = defaultVal;
|
|
222
|
-
continue;
|
|
223
|
-
}
|
|
224
213
|
const schemaKey = input.type === "image" ? `${key}__file` : key;
|
|
225
214
|
fieldKeys.push(schemaKey);
|
|
226
215
|
schema[schemaKey] = transformInput(input);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appstrata/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "AppStrata CLI - Command-line tools for digital signage app development",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"archiver": "^7.0.1",
|
|
33
33
|
"commander": "^12.1.0",
|
|
34
34
|
"vite": "^6.0.0",
|
|
35
|
-
"@appstrata/
|
|
36
|
-
"@appstrata/
|
|
37
|
-
"@appstrata/player-lib": "0.
|
|
38
|
-
"@appstrata/protocol": "0.
|
|
35
|
+
"@appstrata/core": "1.0.0",
|
|
36
|
+
"@appstrata/dev": "1.0.0",
|
|
37
|
+
"@appstrata/player-lib": "1.0.0",
|
|
38
|
+
"@appstrata/protocol": "1.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/archiver": "^7.0.0",
|