@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,103 @@
1
+ /**
2
+ * Vite plugin for AppStrata Apps development.
3
+ *
4
+ * Provides:
5
+ * - App dev server with optional embedded Dev Player
6
+ * - Standalone Dev Player for hosting an App in an iframe, with or without a relay Transport
7
+ * - Supports injection of appstrata.config.ts configuration into both App and Player
8
+ * - HMR for config changes in appstrata.config.ts
9
+ */
10
+ import type { Plugin } from "vite";
11
+ export interface AppStrataPluginOptions {
12
+ /**
13
+ * Path to appstrata.config.ts file.
14
+ * @default "appstrata.config.ts"
15
+ */
16
+ configFile?: string;
17
+ /**
18
+ * Controls whether this plugin launches a Dev Player.
19
+ *
20
+ * - `"embedded"` (default) -- Injects an embedded mock player into the
21
+ * app during development. The app and player share the same window.
22
+ * - `"none"` -- No player is injected. Use this when the app is loaded
23
+ * by a standalone dev player (e.g. via `appstrata dev`).
24
+ * The plugin still injects logging meta tags and the bootstrap IIFE.
25
+ * - `"standalone"` -- Runs a standalone player server that loads the
26
+ * app in an iframe. Used internally by `@appstrata/cli` (`appstrata dev`).
27
+ * Not intended for direct use in app vite.config files.
28
+ *
29
+ * @default "embedded"
30
+ */
31
+ player?: "embedded" | "none" | "standalone";
32
+ /**
33
+ * Relay configuration for forwarding messages to a remote HTTP player.
34
+ * Only valid when `player` is `"standalone"`.
35
+ *
36
+ * Used internally by `@appstrata/cli` (`appstrata dev --relay <url>`).
37
+ */
38
+ relay?: {
39
+ /** URL of the remote HTTP player to relay to. */
40
+ playerUrl: string;
41
+ /** HTTP transport mode. @default "sse" */
42
+ transport: "sse" | "polling";
43
+ };
44
+ /**
45
+ * When set to `"yodeck"`, the plugin does the following during `vite build`:
46
+ *
47
+ * - Emits the pre-built Yodeck unified IIFE (`yodeck.iife.js`) from
48
+ * `@appstrata/adapter-yodeck` into the build output directory.
49
+ * - Injects a `<script src="yodeck.iife.js">` tag into `<head>`.
50
+ * - Transparently rewires all `getPlayer()` calls (including those inside
51
+ * `@appstrata/react` hooks) to target `window` instead of `window.parent`,
52
+ * which is required because the Yodeck adapter runs in the same window as
53
+ * the app rather than in a parent frame.
54
+ *
55
+ * Has no effect during `vite serve`.
56
+ *
57
+ * Activate via a dedicated build script, e.g.:
58
+ * ```json
59
+ * "build:yodeck": "tsc && vite build --mode yodeck"
60
+ * ```
61
+ * Then in `vite.config.ts`:
62
+ * ```ts
63
+ * export default defineConfig(({ mode }) => ({
64
+ * plugins: [appstrata({ adapter: mode === "yodeck" ? "yodeck" : undefined })],
65
+ * }));
66
+ * ```
67
+ */
68
+ adapter?: "yodeck";
69
+ }
70
+ /**
71
+ * AppStrata Vite plugin.
72
+ *
73
+ * Provides:
74
+ * - App dev server with optional embedded Dev Player
75
+ * - Standalone Dev Player for hosting an App in an iframe, with or without a relay Transport
76
+ * - Supports injection of appstrata.config.ts configuration into both App and Player
77
+ * - HMR for config changes in appstrata.config.ts
78
+ *
79
+ * How to interpret the player option:
80
+ * - player: "none" means this is just an app, not a player.
81
+ * - player: "embedded" means this is an app with an embedded Dev Player.
82
+ * - player: "standalone" means this is just a Dev Player, not an app.
83
+ *
84
+ * @param options - Plugin options
85
+ * @returns Vite plugin
86
+ *
87
+ * @example
88
+ * ```typescript
89
+ * // vite.config.ts
90
+ * import { defineConfig } from "vite";
91
+ * import react from "@vitejs/plugin-react";
92
+ * import { appstrata } from "@appstrata/dev";
93
+ *
94
+ * export default defineConfig({
95
+ * plugins: [
96
+ * react(),
97
+ * appstrata(),
98
+ * ],
99
+ * });
100
+ * ```
101
+ */
102
+ export declare function appstrata(options?: AppStrataPluginOptions): Plugin;
103
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAoC,MAAM,MAAM,CAAC;AAYrE,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,YAAY,CAAC;IAE5C;;;;;OAKG;IACH,KAAK,CAAC,EAAE;QACN,iDAAiD;QACjD,SAAS,EAAE,MAAM,CAAC;QAClB,0CAA0C;QAC1C,SAAS,EAAE,KAAK,GAAG,SAAS,CAAC;KAC9B,CAAC;IAEF;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,OAAO,CAAC,EAAE,QAAQ,CAAC;CACpB;AAgBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,sBAA2B,GAAG,MAAM,CAmQtE"}
package/dist/plugin.js ADDED
@@ -0,0 +1,292 @@
1
+ /**
2
+ * Vite plugin for AppStrata Apps development.
3
+ *
4
+ * Provides:
5
+ * - App dev server with optional embedded Dev Player
6
+ * - Standalone Dev Player for hosting an App in an iframe, with or without a relay Transport
7
+ * - Supports injection of appstrata.config.ts configuration into both App and Player
8
+ * - HMR for config changes in appstrata.config.ts
9
+ */
10
+ import { fileURLToPath } from "node:url";
11
+ import { existsSync, readFileSync } from "node:fs";
12
+ import { createRequire } from "node:module";
13
+ import * as path from "node:path";
14
+ import { CONFIG_CHANGE_EVENT, DEFAULT_CONTEXT, DEFAULT_LIFECYCLE } from "./types.js";
15
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
16
+ const mockInitJs = path.resolve(__dirname, "mock-init.js");
17
+ const loggingHmrJs = path.resolve(__dirname, "logging-hmr.js");
18
+ /**
19
+ * Virtual module IDs using path-like IDs so they can be used as script src.
20
+ */
21
+ const VIRTUAL_MOCK_INIT = "/@appstrata-dev/mock-init.js";
22
+ const VIRTUAL_LOGGING_HMR = "/@appstrata-dev/logging-hmr.js";
23
+ /**
24
+ * Virtual module ID for the @appstrata/web shim used when adapter: "yodeck"
25
+ * is set. Rewires getPlayer() to target window instead of window.parent.
26
+ */
27
+ const VIRTUAL_WEB_SHIM_ID = "\0virtual:appstrata-web-yodeck-shim";
28
+ import { loadConfig } from "./load-config.js";
29
+ /**
30
+ * AppStrata Vite plugin.
31
+ *
32
+ * Provides:
33
+ * - App dev server with optional embedded Dev Player
34
+ * - Standalone Dev Player for hosting an App in an iframe, with or without a relay Transport
35
+ * - Supports injection of appstrata.config.ts configuration into both App and Player
36
+ * - HMR for config changes in appstrata.config.ts
37
+ *
38
+ * How to interpret the player option:
39
+ * - player: "none" means this is just an app, not a player.
40
+ * - player: "embedded" means this is an app with an embedded Dev Player.
41
+ * - player: "standalone" means this is just a Dev Player, not an app.
42
+ *
43
+ * @param options - Plugin options
44
+ * @returns Vite plugin
45
+ *
46
+ * @example
47
+ * ```typescript
48
+ * // vite.config.ts
49
+ * import { defineConfig } from "vite";
50
+ * import react from "@vitejs/plugin-react";
51
+ * import { appstrata } from "@appstrata/dev";
52
+ *
53
+ * export default defineConfig({
54
+ * plugins: [
55
+ * react(),
56
+ * appstrata(),
57
+ * ],
58
+ * });
59
+ * ```
60
+ */
61
+ export function appstrata(options = {}) {
62
+ const configFile = options.configFile || "appstrata.config.ts";
63
+ const player = options.player ?? "embedded";
64
+ const relay = options.relay ?? null;
65
+ const adapter = options.adapter ?? null;
66
+ if (relay != null && player !== "standalone") {
67
+ throw new Error('[AppStrata plugin] "relay" option requires player: "standalone"');
68
+ }
69
+ let config = null;
70
+ let resolvedConfigPath = null;
71
+ let server = null;
72
+ let root = process.cwd();
73
+ let command = "serve";
74
+ return {
75
+ name: "appstrata-dev",
76
+ enforce: "pre",
77
+ configResolved(resolvedConfig) {
78
+ root = resolvedConfig.root;
79
+ command = resolvedConfig.command;
80
+ },
81
+ async buildStart() {
82
+ // In dev server mode, config is already loaded by configureServer.
83
+ // In build mode (no server), load it here.
84
+ if (!config) {
85
+ const result = await loadConfig(configFile, root);
86
+ if (result) {
87
+ config = result.config;
88
+ resolvedConfigPath = result.filePath;
89
+ }
90
+ }
91
+ if (config) {
92
+ console.log("[AppStrata plugin] Loaded config from", resolvedConfigPath);
93
+ }
94
+ else {
95
+ console.log("[AppStrata plugin] No config file found, using defaults");
96
+ }
97
+ // Emit the Yodeck IIFE as a fixed-name asset so it lands in the output dir.
98
+ if (command === "build" && adapter === "yodeck") {
99
+ const _require = createRequire(import.meta.url);
100
+ const pkgJsonPath = _require.resolve("@appstrata/adapter-yodeck/package.json");
101
+ const bundleDir = path.join(path.dirname(pkgJsonPath), "dist/bundle");
102
+ const iifeName = "yodeck.iife.js";
103
+ const iifePath = path.join(bundleDir, iifeName);
104
+ this.emitFile({ type: "asset", fileName: iifeName, source: readFileSync(iifePath) });
105
+ const mapName = `${iifeName}.map`;
106
+ const mapPath = path.join(bundleDir, mapName);
107
+ if (existsSync(mapPath)) {
108
+ this.emitFile({ type: "asset", fileName: mapName, source: readFileSync(mapPath) });
109
+ }
110
+ }
111
+ },
112
+ // Resolve virtual modules to actual files/content.
113
+ resolveId(id, importer) {
114
+ if (id === VIRTUAL_MOCK_INIT) {
115
+ return mockInitJs;
116
+ }
117
+ if (id === VIRTUAL_LOGGING_HMR) {
118
+ return loggingHmrJs;
119
+ }
120
+ // When building with adapter: "yodeck", redirect all imports of
121
+ // @appstrata/web to the shim that rewires getPlayer() to target window.
122
+ // The importer guard prevents infinite recursion when the shim itself
123
+ // imports from @appstrata/web.
124
+ if (adapter === "yodeck" && command === "build"
125
+ && id === "@appstrata/web"
126
+ && importer !== VIRTUAL_WEB_SHIM_ID) {
127
+ return VIRTUAL_WEB_SHIM_ID;
128
+ }
129
+ },
130
+ load(id) {
131
+ if (id === VIRTUAL_WEB_SHIM_ID) {
132
+ // Re-export everything from the real @appstrata/web, then override
133
+ // getPlayer so it defaults hostWindow to window (same frame as the
134
+ // Yodeck IIFE) instead of window.parent.
135
+ // The explicit named export shadows the export * for getPlayer per
136
+ // the ES module spec, so Rollup picks this override correctly.
137
+ return [
138
+ 'export * from "@appstrata/web";',
139
+ 'import { getPlayer as __origGetPlayer } from "@appstrata/web";',
140
+ 'export function getPlayer(hostWindow) {',
141
+ ' return __origGetPlayer(hostWindow ?? window);',
142
+ '}',
143
+ ].join('\n');
144
+ }
145
+ },
146
+ async configureServer(s) {
147
+ server = s;
148
+ // Load config and set up watcher here — configureServer runs before
149
+ // buildStart, so the config is ready for both the watcher and the
150
+ // buildStart log message.
151
+ const result = await loadConfig(configFile, root);
152
+ if (result) {
153
+ config = result.config;
154
+ resolvedConfigPath = result.filePath;
155
+ console.log("[AppStrata plugin] Watching config file: ", resolvedConfigPath);
156
+ server.watcher.add(resolvedConfigPath);
157
+ }
158
+ server.watcher.on("change", async (file) => {
159
+ if (!resolvedConfigPath || file !== resolvedConfigPath)
160
+ return;
161
+ console.log("[AppStrata plugin] Config changed, reloading...");
162
+ const result = await loadConfig(resolvedConfigPath);
163
+ config = result?.config ?? null;
164
+ // Broadcast the updated config via HMR. Which clients receive
165
+ // this depends on which Vite server this plugin instance backs:
166
+ //
167
+ // - "none" / "embedded" (app server): logging-hmr reconfigures
168
+ // logging; the embedded player (if present) hot-swaps context.
169
+ //
170
+ // - "standalone" (player server, started by `appstrata dev`):
171
+ // player/main.ts hot-swaps context or reloads the iframe when
172
+ // dev.logging (URL-delivered) changes.
173
+ server?.ws.send({
174
+ type: "custom",
175
+ event: CONFIG_CHANGE_EVENT,
176
+ data: {
177
+ app: config?.app,
178
+ dev: config?.dev,
179
+ context: config?.dev?.context || DEFAULT_CONTEXT,
180
+ capabilities: config?.dev?.capabilities || ["storage", "proxy"],
181
+ },
182
+ });
183
+ });
184
+ // Serve mock context endpoint
185
+ // Applicable for embedded and standalone non-relay player modes.
186
+ if (player === "embedded" || (player === "standalone" && relay == null)) {
187
+ server.middlewares.use((req, res, next) => {
188
+ if (req.url === "/__appstrata__/context") {
189
+ const context = config?.dev?.context || DEFAULT_CONTEXT;
190
+ const capabilities = config?.dev?.capabilities || ["storage", "proxy"];
191
+ const lifecycle = config?.dev?.lifecycle || DEFAULT_LIFECYCLE;
192
+ const app = config?.app;
193
+ res.setHeader("Content-Type", "application/json");
194
+ res.setHeader("Cache-Control", "no-cache");
195
+ const dev = config?.dev;
196
+ res.end(JSON.stringify({ app, dev, context, capabilities, lifecycle, relay }));
197
+ return;
198
+ }
199
+ next();
200
+ });
201
+ }
202
+ },
203
+ // Transform the index.html of the app (not the player).
204
+ transformIndexHtml() {
205
+ // if standalone player, no app to transform
206
+ if (player === "standalone")
207
+ return [];
208
+ const tags = [];
209
+ // --- Logging config and preset (head-prepend) ---
210
+ // These must be in the DOM before the logging IIFE runs.
211
+ // Inject app.logging profiles as a JSON script tag.
212
+ // Convenience so that developers don't need to include it manually.
213
+ // Applicable both during serve and build.
214
+ if (config?.app?.logging && Object.keys(config.app.logging).length > 0) {
215
+ tags.push({
216
+ tag: "script",
217
+ attrs: { type: "application/json", id: "appstrata:logging" },
218
+ children: JSON.stringify(config.app.logging, null, 2),
219
+ injectTo: "head-prepend",
220
+ });
221
+ }
222
+ // Inject the dev player's runtime logging preset as a meta tag
223
+ // (equivalent of ?logLevels= + ?logSinks= URL params).
224
+ // Only applicable for embedded player mode. The standalone player
225
+ // uses URL params on the app iframe URL instead.
226
+ // Applicable only during serve, not build.
227
+ if (command === "serve" && player === "embedded") {
228
+ const dev = config?.dev?.logging;
229
+ if (dev?.level || dev?.sinks?.length) {
230
+ tags.push({
231
+ tag: "meta",
232
+ attrs: {
233
+ name: "appstrata:log",
234
+ content: JSON.stringify(dev),
235
+ },
236
+ injectTo: "head-prepend",
237
+ });
238
+ }
239
+ }
240
+ // --- Scripts ---
241
+ // appstrata-logging.js: this is the logging sync IIFE script
242
+ // that bootstraps the logging system before anything else.
243
+ // Using "head-prepend" so this appears before any other scripts.
244
+ // Even though it's "head-prepend", Vite puts it after the above
245
+ // meta tags. Not sure if it's because of the order in our array
246
+ // or because of the tag type, but the final order is correct.
247
+ // Convenience so that developers don't need to include it manually.
248
+ // Applicable both during serve and build.
249
+ const _require = createRequire(import.meta.url);
250
+ const loggingIife = readFileSync(_require.resolve("@appstrata/web/appstrata-logging.js"), "utf-8");
251
+ tags.push({
252
+ tag: "script",
253
+ children: loggingIife,
254
+ injectTo: "head-prepend",
255
+ });
256
+ // Inject the logging HMR handler so app.logging / dev.logging
257
+ // changes in appstrata.config.ts are applied live without a page reload.
258
+ // Applicable during serve (standalone is already excluded above).
259
+ if (command === "serve") {
260
+ tags.push({
261
+ tag: "script",
262
+ attrs: { type: "module", src: VIRTUAL_LOGGING_HMR },
263
+ injectTo: "head",
264
+ });
265
+ }
266
+ // Inject the embedded Dev Player.
267
+ // type="module" so it's deferred -- runs after all sync scripts.
268
+ // Applicable only during serve, not build.
269
+ if (command === "serve" && player === "embedded") {
270
+ tags.push({
271
+ tag: "script",
272
+ attrs: { type: "module", src: VIRTUAL_MOCK_INIT },
273
+ injectTo: "head",
274
+ });
275
+ }
276
+ // Inject the Yodeck IIFE script tag.
277
+ // Classic synchronous script in <head>: runs before body parsing begins,
278
+ // guaranteeing it executes before the app entry script regardless of
279
+ // defer/module behaviour on the main bundle.
280
+ // Applicable only during build, not serve.
281
+ if (command === "build" && adapter === "yodeck") {
282
+ tags.push({
283
+ tag: "script",
284
+ attrs: { src: "yodeck.iife.js" },
285
+ injectTo: "head",
286
+ });
287
+ }
288
+ return tags;
289
+ },
290
+ };
291
+ }
292
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,UAA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