@appstrata/dev 0.1.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.
Files changed (53) hide show
  1. package/README.md +164 -0
  2. package/dist/completion-notification.d.ts +22 -0
  3. package/dist/completion-notification.d.ts.map +1 -0
  4. package/dist/completion-notification.js +184 -0
  5. package/dist/completion-notification.js.map +1 -0
  6. package/dist/dev-overlay.css +450 -0
  7. package/dist/dev-overlay.d.ts +56 -0
  8. package/dist/dev-overlay.d.ts.map +1 -0
  9. package/dist/dev-overlay.js +371 -0
  10. package/dist/dev-overlay.js.map +1 -0
  11. package/dist/index.d.ts +16 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +22 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/intercepting-transport.d.ts +11 -0
  16. package/dist/intercepting-transport.d.ts.map +1 -0
  17. package/dist/intercepting-transport.js +31 -0
  18. package/dist/intercepting-transport.js.map +1 -0
  19. package/dist/load-config.d.ts +42 -0
  20. package/dist/load-config.d.ts.map +1 -0
  21. package/dist/load-config.js +87 -0
  22. package/dist/load-config.js.map +1 -0
  23. package/dist/logging-hmr.d.ts +20 -0
  24. package/dist/logging-hmr.d.ts.map +1 -0
  25. package/dist/logging-hmr.js +28 -0
  26. package/dist/logging-hmr.js.map +1 -0
  27. package/dist/mock-init.d.ts +9 -0
  28. package/dist/mock-init.d.ts.map +1 -0
  29. package/dist/mock-init.js +171 -0
  30. package/dist/mock-init.js.map +1 -0
  31. package/dist/mock-player.d.ts +117 -0
  32. package/dist/mock-player.d.ts.map +1 -0
  33. package/dist/mock-player.js +132 -0
  34. package/dist/mock-player.js.map +1 -0
  35. package/dist/mock-services.d.ts +32 -0
  36. package/dist/mock-services.d.ts.map +1 -0
  37. package/dist/mock-services.js +141 -0
  38. package/dist/mock-services.js.map +1 -0
  39. package/dist/player/index.html +22 -0
  40. package/dist/player/main.d.ts +10 -0
  41. package/dist/player/main.d.ts.map +1 -0
  42. package/dist/player/main.js +352 -0
  43. package/dist/player/main.js.map +1 -0
  44. package/dist/player/styles.css +80 -0
  45. package/dist/plugin.d.ts +103 -0
  46. package/dist/plugin.d.ts.map +1 -0
  47. package/dist/plugin.js +292 -0
  48. package/dist/plugin.js.map +1 -0
  49. package/dist/types.d.ts +376 -0
  50. package/dist/types.d.ts.map +1 -0
  51. package/dist/types.js +75 -0
  52. package/dist/types.js.map +1 -0
  53. package/package.json +50 -0
@@ -0,0 +1,376 @@
1
+ /**
2
+ * Configuration types for AppStrata development.
3
+ */
4
+ import type { AppContext } from "@appstrata/core";
5
+ import type { AppLoggingConfig, LoggingPreset } from "@appstrata/utils";
6
+ /**
7
+ * Development context configuration.
8
+ *
9
+ * Derived from AppContext (minus `hasCapability`, which is added automatically
10
+ * based on the `capabilities` array). This ensures the dev mock context stays
11
+ * in sync with the core AppContext type.
12
+ */
13
+ export type DevContextConfig = Omit<AppContext, "hasCapability">;
14
+ /**
15
+ * Lifecycle timing configuration.
16
+ */
17
+ export interface LifecycleConfig {
18
+ /**
19
+ * Delay in ms before onInit fires.
20
+ * @default 0
21
+ */
22
+ initDelay?: number;
23
+ /**
24
+ * Delay in ms before onShow fires (after init).
25
+ * @default 50
26
+ */
27
+ showDelay?: number;
28
+ /**
29
+ * Delay in ms before onStart fires (after show).
30
+ * @default 50
31
+ */
32
+ startDelay?: number;
33
+ /**
34
+ * Delay in ms before onHide fires (after notifyComplete).
35
+ * @default 100
36
+ */
37
+ hideDelay?: number;
38
+ /**
39
+ * Delay in ms before onStop fires (after hide).
40
+ * @default 50
41
+ */
42
+ stopDelay?: number;
43
+ }
44
+ /**
45
+ * Development server configuration.
46
+ */
47
+ export interface DevConfig {
48
+ /**
49
+ * Port for the dev server.
50
+ * @default 5173
51
+ */
52
+ port?: number;
53
+ /**
54
+ * Mock context configuration.
55
+ */
56
+ context?: DevContextConfig;
57
+ /**
58
+ * Enabled capabilities.
59
+ * Use ["all"] to enable all capabilities, or list specific ones.
60
+ * @default ["storage", "proxy"]
61
+ */
62
+ capabilities?: string[] | ["all"];
63
+ /**
64
+ * Lifecycle timing configuration.
65
+ */
66
+ lifecycle?: LifecycleConfig;
67
+ /**
68
+ * Development-time logging preset.
69
+ *
70
+ * Translated to `?logLevels=` and `?logSinks=` params on the app URL
71
+ * by the dev player and injected as a `<meta appstrata:log>` tag by
72
+ * the Vite plugin.
73
+ *
74
+ * @example
75
+ * ```ts
76
+ * logging: {
77
+ * level: "debug",
78
+ * sinks: ["console", "overlay"],
79
+ * namespaces: {
80
+ * Protocol: "debug",
81
+ * Transport: "info",
82
+ * },
83
+ * }
84
+ * ```
85
+ */
86
+ logging?: LoggingPreset & {
87
+ /** Narrows to built-in sink names for autocomplete. */
88
+ sinks?: Array<"console" | "overlay" | "player">;
89
+ };
90
+ /**
91
+ * Protocol messages panel configuration.
92
+ *
93
+ * Controls what appears in the intercepted-messages popup in the dev overlay.
94
+ */
95
+ messages?: {
96
+ /**
97
+ * When true, protocol messages with op `log` are included in the messages
98
+ * panel. Defaults to false (log traffic is hidden to reduce noise).
99
+ * @default false
100
+ */
101
+ showLogMessages?: boolean;
102
+ };
103
+ }
104
+ /**
105
+ * Base properties shared by all input types.
106
+ */
107
+ export interface BaseInput {
108
+ title: string;
109
+ help?: string;
110
+ validators?: {
111
+ required?: boolean;
112
+ };
113
+ }
114
+ export interface TextInput extends BaseInput {
115
+ type: "text";
116
+ default?: string;
117
+ validators?: {
118
+ required?: boolean;
119
+ minLength?: number;
120
+ maxLength?: number;
121
+ };
122
+ }
123
+ export interface ColorInput extends BaseInput {
124
+ type: "color";
125
+ default?: string;
126
+ }
127
+ export interface BooleanInput extends BaseInput {
128
+ type: "boolean";
129
+ default?: boolean;
130
+ }
131
+ export interface NumberInput extends BaseInput {
132
+ type: "number";
133
+ default?: number;
134
+ min?: number;
135
+ max?: number;
136
+ step?: number;
137
+ }
138
+ export interface SelectInput extends BaseInput {
139
+ type: "select";
140
+ default?: string;
141
+ options: {
142
+ label: string;
143
+ value: string;
144
+ }[];
145
+ }
146
+ export interface RangeInput extends BaseInput {
147
+ type: "range";
148
+ default?: number;
149
+ min: number;
150
+ max: number;
151
+ step?: number;
152
+ }
153
+ export interface FontInput extends BaseInput {
154
+ type: "font";
155
+ }
156
+ export interface ImageInput extends BaseInput {
157
+ type: "image";
158
+ }
159
+ export type InputDefinition = TextInput | ColorInput | BooleanInput | NumberInput | SelectInput | RangeInput | FontInput | ImageInput;
160
+ /**
161
+ * Configuration inputs that define the app's CMS form fields.
162
+ */
163
+ export interface ConfigurationConfig {
164
+ inputs: Record<string, InputDefinition>;
165
+ }
166
+ /**
167
+ * Auto-zoom strategy for the dev player.
168
+ *
169
+ * Controls how the app content is scaled to fit the browser viewport
170
+ * during development.
171
+ *
172
+ * **Fixed canvas** — The layout is always exactly
173
+ * `viewportWidth × viewportHeight`. Content does not reflow.
174
+ *
175
+ * - `'contain'` — Show everything; gaps appear when aspect ratios differ.
176
+ * - `'cover'` — Fill the screen; content is clipped when aspect ratios differ.
177
+ *
178
+ * **Responsive density** — Content reflows at a target pixel density,
179
+ * filling all available space with no gaps.
180
+ *
181
+ * - `'min'` — Effective resolution is at least the target. The
182
+ * constraining axis matches the target; the other gets
183
+ * bonus pixels.
184
+ * - `'max'` — Effective resolution is at most the target. The
185
+ * non-constraining axis matches; the other gets fewer pixels.
186
+ * - `'width'` — Effective width is always exactly `viewportWidth`.
187
+ * Height scales proportionally.
188
+ * - `'height'` — Effective height is always exactly `viewportHeight`.
189
+ * Width scales proportionally.
190
+ * - `'longest'` — The longest edge of the effective resolution matches the
191
+ * longest edge of the target. Both axes scale uniformly.
192
+ *
193
+ * **Orientation-aware** — Like `'width'`, but the target automatically
194
+ * swaps when the screen orientation differs from the design orientation.
195
+ *
196
+ * - `'auto-width'` — Scale based on width. When the screen is portrait
197
+ * but the design is landscape (or vice versa), the
198
+ * narrow design dimension becomes the width target.
199
+ *
200
+ * - `'none'` — No auto-zoom (default when omitted).
201
+ */
202
+ export type AutoZoomMode = 'none' | 'contain' | 'cover' | 'min' | 'max' | 'width' | 'height' | 'longest' | 'auto-width';
203
+ /**
204
+ * App metadata configuration.
205
+ */
206
+ export interface AppConfig {
207
+ /**
208
+ * Unique app identifier.
209
+ */
210
+ id: string;
211
+ /**
212
+ * Entry URL for cloud-hosted apps.
213
+ *
214
+ * When set, the player loads this URL instead of looking for a bundled
215
+ * `index.html`. Must be an absolute HTTPS URL. The player appends
216
+ * runtime parameters (hostOrigin, auth token, etc.) per the RPC spec's
217
+ * auth-profile mechanism.
218
+ *
219
+ * Omit for local/bundled apps whose code is included in the package ZIP.
220
+ */
221
+ url?: string;
222
+ /**
223
+ * Display name.
224
+ */
225
+ name: string;
226
+ /**
227
+ * App version (semver).
228
+ */
229
+ version: string;
230
+ /**
231
+ * Brief app description for marketplace/gallery listings.
232
+ */
233
+ description?: string;
234
+ /**
235
+ * Detailed description (can include HTML) for marketplace/gallery listings.
236
+ */
237
+ details?: string;
238
+ /**
239
+ * Publisher name.
240
+ */
241
+ publisher?: string;
242
+ /**
243
+ * Configuration inputs defining the app's CMS form fields.
244
+ * Used to auto-generate the schema.json when packaging.
245
+ */
246
+ configuration?: ConfigurationConfig;
247
+ /**
248
+ * How the dev player should scale app content to fit the browser viewport.
249
+ * Defaults to `'none'` (no scaling) when omitted.
250
+ * @see {@link AutoZoomMode}
251
+ */
252
+ autoZoom?: AutoZoomMode;
253
+ /**
254
+ * Arbitrary pass-through properties merged into the generated schema.json.
255
+ *
256
+ * The object structure should mirror the schema output. For example, to add
257
+ * extra fields inside `meta`, nest them under a `meta` key here:
258
+ *
259
+ * @example
260
+ * ```ts
261
+ * properties: {
262
+ * meta: {
263
+ * html_player_support: true,
264
+ * preview_category: "logo",
265
+ * packageSku: "650",
266
+ * },
267
+ * supportLiveUpdate: true,
268
+ * }
269
+ * ```
270
+ */
271
+ properties?: Record<string, unknown>;
272
+ /**
273
+ * Named logging profiles.
274
+ *
275
+ * Each key is a profile name; each value is a config with sink declarations,
276
+ * a root logger, and per-namespace overrides.
277
+ * The `"default"` profile is used when no runtime directive selects one.
278
+ *
279
+ * Serialised into a `<script type="application/json" id="appstrata:logging">`
280
+ * tag by the Vite plugin. At runtime, `?logLevels=` / `?logSinks=` URL
281
+ * params or `?logProfile=` can override logging behaviour.
282
+ *
283
+ * @example
284
+ * ```ts
285
+ * logging: {
286
+ * default: {
287
+ * sinks: { console: { formatter: "timestamp", colors: true } },
288
+ * root: { level: "info", sinks: ["console"] },
289
+ * },
290
+ * verbose: {
291
+ * sinks: { console: {}, overlay: {} },
292
+ * root: { level: "debug", sinks: ["console", "overlay"] },
293
+ * },
294
+ * }
295
+ * ```
296
+ */
297
+ logging?: Record<string, AppLoggingConfig>;
298
+ }
299
+ /**
300
+ * Complete AppStrata configuration.
301
+ *
302
+ * This is the shape of `appstrata.config.ts`.
303
+ *
304
+ * TODO: add all properties needed to build the App Manifest.
305
+ */
306
+ export interface AppStrataConfig {
307
+ /**
308
+ * App metadata.
309
+ */
310
+ app: AppConfig;
311
+ /**
312
+ * Development server configuration.
313
+ */
314
+ dev?: DevConfig;
315
+ }
316
+ /**
317
+ * Helper function to define AppStrata configuration with type checking.
318
+ *
319
+ * @example
320
+ * ```typescript
321
+ * // appstrata.config.ts
322
+ * import { defineConfig } from "@appstrata/dev";
323
+ *
324
+ * export default defineConfig({
325
+ * app: {
326
+ * id: "my-app",
327
+ * name: "My Signage App",
328
+ * version: "1.0.0",
329
+ * },
330
+ * dev: {
331
+ * context: {
332
+ * mode: "development",
333
+ * environment: "development",
334
+ * viewportWidth: 1920,
335
+ * viewportHeight: 1080,
336
+ * config: { title: "Hello World" },
337
+ * resources: [],
338
+ * device: {
339
+ * id: "dev-player",
340
+ * locale: "en-US",
341
+ * timezone: "UTC",
342
+ * },
343
+ * },
344
+ * },
345
+ * });
346
+ * ```
347
+ */
348
+ export declare function defineConfig(config: AppStrataConfig): AppStrataConfig;
349
+ /**
350
+ * Response shape of the `/__appstrata__/context` dev server endpoint.
351
+ */
352
+ export interface DevServerContextResponse {
353
+ app: AppConfig | undefined;
354
+ dev: DevConfig | undefined;
355
+ context: DevContextConfig;
356
+ capabilities: string[];
357
+ lifecycle: LifecycleConfig;
358
+ relay: {
359
+ playerUrl: string;
360
+ transport: "sse" | "polling";
361
+ } | null;
362
+ }
363
+ /**
364
+ * Default context configuration used when no config file is provided.
365
+ */
366
+ export declare const DEFAULT_CONTEXT: DevContextConfig;
367
+ /**
368
+ * Default lifecycle timing configuration.
369
+ */
370
+ /**
371
+ * Custom HMR event name used by the Vite plugin, embedded player,
372
+ * standalone player, and logging-hmr module.
373
+ */
374
+ export declare const CONFIG_CHANGE_EVENT = "appstrata:config-change";
375
+ export declare const DEFAULT_LIFECYCLE: LifecycleConfig;
376
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAExE;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAA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
package/dist/types.js ADDED
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Configuration types for AppStrata development.
3
+ */
4
+ /**
5
+ * Helper function to define AppStrata configuration with type checking.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * // appstrata.config.ts
10
+ * import { defineConfig } from "@appstrata/dev";
11
+ *
12
+ * export default defineConfig({
13
+ * app: {
14
+ * id: "my-app",
15
+ * name: "My Signage App",
16
+ * version: "1.0.0",
17
+ * },
18
+ * dev: {
19
+ * context: {
20
+ * mode: "development",
21
+ * environment: "development",
22
+ * viewportWidth: 1920,
23
+ * viewportHeight: 1080,
24
+ * config: { title: "Hello World" },
25
+ * resources: [],
26
+ * device: {
27
+ * id: "dev-player",
28
+ * locale: "en-US",
29
+ * timezone: "UTC",
30
+ * },
31
+ * },
32
+ * },
33
+ * });
34
+ * ```
35
+ */
36
+ export function defineConfig(config) {
37
+ return config;
38
+ }
39
+ /**
40
+ * Default context configuration used when no config file is provided.
41
+ */
42
+ export const DEFAULT_CONTEXT = {
43
+ instanceId: "dev-instance",
44
+ duration: 30,
45
+ mode: "development",
46
+ environment: "development",
47
+ viewportWidth: 1920,
48
+ viewportHeight: 1080,
49
+ config: {},
50
+ resources: [],
51
+ device: {
52
+ id: "dev-player",
53
+ name: "Development Player",
54
+ type: "web-player",
55
+ platformName: "AppStrata Dev",
56
+ locale: "en-US",
57
+ timezone: "UTC",
58
+ },
59
+ };
60
+ /**
61
+ * Default lifecycle timing configuration.
62
+ */
63
+ /**
64
+ * Custom HMR event name used by the Vite plugin, embedded player,
65
+ * standalone player, and logging-hmr module.
66
+ */
67
+ export const CONFIG_CHANGE_EVENT = "appstrata:config-change";
68
+ export const DEFAULT_LIFECYCLE = {
69
+ initDelay: 0,
70
+ showDelay: 50,
71
+ startDelay: 50,
72
+ hideDelay: 100,
73
+ stopDelay: 50,
74
+ };
75
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAmWH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAU,YAAY,CAAC,MAAuB;IAClD,OAAO,MAAM,CAAC;AAChB,CAAC;AAcD;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAqB;IAC/C,UAAU,EAAE,cAAc;IAC1B,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,IAAI;IACpB,MAAM,EAAE,EAAE;IACV,SAAS,EAAE,EAAE;IACb,MAAM,EAAE;QACN,EAAE,EAAE,YAAY;QAChB,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,YAAY;QAClB,YAAY,EAAE,eAAe;QAC7B,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,KAAK;KAChB;CACF,CAAC;AAEF;;GAEG;AACH;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,yBAAyB,CAAC;AAE7D,MAAM,CAAC,MAAM,iBAAiB,GAAoB;IAChD,SAAS,EAAE,CAAC;IACZ,SAAS,EAAE,EAAE;IACb,UAAU,EAAE,EAAE;IACd,SAAS,EAAE,GAAG;IACd,SAAS,EAAE,EAAE;CACd,CAAC"}
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@appstrata/dev",
3
+ "version": "0.1.0",
4
+ "description": "AppStrata Development Tools - Vite plugin and mock player for local development",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "keywords": [
15
+ "digital-signage",
16
+ "appstrata",
17
+ "vite",
18
+ "plugin",
19
+ "development"
20
+ ],
21
+ "author": "AppStrata",
22
+ "license": "MIT",
23
+ "files": [
24
+ "dist"
25
+ ],
26
+ "publishConfig": {
27
+ "access": "restricted"
28
+ },
29
+ "dependencies": {
30
+ "jiti": "^2.6.1",
31
+ "@appstrata/core": "0.1.0",
32
+ "@appstrata/protocol": "0.1.0",
33
+ "@appstrata/adapter-yodeck": "0.1.0",
34
+ "@appstrata/player-lib": "0.1.0",
35
+ "@appstrata/utils": "0.1.0"
36
+ },
37
+ "peerDependencies": {
38
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
39
+ },
40
+ "devDependencies": {
41
+ "typescript": "^5.3.3",
42
+ "vite": "^6.0.0"
43
+ },
44
+ "scripts": {
45
+ "build": "tsc --build tsconfig.build.json && npm run copy-player",
46
+ "copy-player": "mkdir -p dist/player && cp src/player/index.html dist/player/ && cp src/player/styles.css dist/player/ && cp src/dev-overlay.css dist/",
47
+ "clean": "rm -rf dist *.tsbuildinfo",
48
+ "dev": "tsc --build --watch"
49
+ }
50
+ }