@omega.js/desktop 0.52.0 → 0.54.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 (345) hide show
  1. package/README.md +53 -48
  2. package/dist/assets/css/core/_initialize.scss +1 -1
  3. package/dist/assets/js/core/app-shell.js +14 -15
  4. package/dist/assets/themes/_template/_theme.js +6 -6
  5. package/dist/assets/themes/base/_includes/global/sections/account.html +4 -4
  6. package/dist/assets/themes/base/_includes/global/sections/app-sidebar.html +5 -5
  7. package/dist/assets/themes/base/_layouts/frontend/pages/account/index.html +3 -3
  8. package/dist/assets/themes/base/_layouts/frontend/pages/alternatives/index.html +1 -1
  9. package/dist/assets/themes/base/_layouts/frontend/pages/blog/tags/tag.html +1 -1
  10. package/dist/assets/themes/base/_layouts/frontend/pages/payment/confirmation.html +1 -1
  11. package/dist/assets/themes/base/_sections/marketing/newsletter-cta/section.js +2 -3
  12. package/dist/assets/themes/base/_sections/verts/unit/section.html +1 -1
  13. package/dist/assets/themes/base/_sections/verts/unit/section.js +3 -4
  14. package/dist/assets/themes/base/_theme.js +4 -3
  15. package/dist/assets/themes/bootstrap/_theme.js +2 -2
  16. package/dist/assets/themes/bootstrap/overrides/_links.scss +1 -1
  17. package/dist/assets/themes/classy/_theme.js +8 -6
  18. package/dist/assets/themes/classy/css/marketing/_sections.scss +1 -2
  19. package/dist/assets/themes/classy/js/hero-demo-form.js +3 -2
  20. package/dist/assets/themes/neobrutalism/_theme.js +5 -5
  21. package/dist/assets/themes/neobrutalism/js/pages/test/libraries/layers/index.js +1 -1
  22. package/dist/assets/themes/newsflash/_theme.js +6 -6
  23. package/dist/assets/themes/newsflash/js/pages/test/libraries/layers/index.js +1 -1
  24. package/dist/build.js +87 -111
  25. package/dist/cli-run.js +4 -1
  26. package/dist/cli.js +3 -3
  27. package/dist/commands/build.js +2 -2
  28. package/dist/commands/cdp/capture.js +2 -2
  29. package/dist/commands/cdp/client.js +1 -1
  30. package/dist/commands/cdp/quit.js +2 -2
  31. package/dist/commands/cdp/relaunch.js +2 -2
  32. package/dist/commands/cdp/theme.js +1 -1
  33. package/dist/commands/cdp.js +1 -1
  34. package/dist/commands/clean.js +4 -5
  35. package/dist/commands/deploy.js +4 -4
  36. package/dist/commands/dev.js +25 -0
  37. package/dist/commands/finalize-release.js +4 -4
  38. package/dist/commands/launch.js +2 -2
  39. package/dist/commands/lib/deploy-precheck.js +3 -3
  40. package/dist/commands/lib/ensure-target.js +18 -23
  41. package/dist/commands/lib/migrate.js +17 -0
  42. package/dist/commands/logs.js +1 -1
  43. package/dist/commands/package.js +2 -2
  44. package/dist/commands/publish.js +2 -2
  45. package/dist/commands/release.js +4 -4
  46. package/dist/commands/runner.js +11 -11
  47. package/dist/commands/sign-windows.js +5 -5
  48. package/dist/commands/test.js +8 -8
  49. package/dist/commands/update.js +7 -6
  50. package/dist/commands/validate-certs.js +4 -4
  51. package/dist/commands/version.js +3 -3
  52. package/dist/defaults/.github/workflows/build.yml +18 -18
  53. package/dist/defaults/_.gitignore +0 -2
  54. package/dist/defaults/_mas/README.md +3 -3
  55. package/dist/defaults/config/certs/README.md +1 -1
  56. package/dist/defaults/config/omega.json5 +43 -43
  57. package/dist/defaults/docs/README.md +3 -3
  58. package/dist/defaults/gulpfile.js +1 -1
  59. package/dist/defaults/hooks/build/post.js +2 -2
  60. package/dist/defaults/hooks/build/pre.js +2 -2
  61. package/dist/defaults/hooks/deploy/pre.js +1 -1
  62. package/dist/defaults/hooks/notarize/post.js +2 -2
  63. package/dist/defaults/hooks/release/post.js +2 -2
  64. package/dist/defaults/hooks/release/pre.js +2 -2
  65. package/dist/defaults/src/assets/js/components/about/index.js +3 -5
  66. package/dist/defaults/src/assets/js/components/main/index.js +3 -5
  67. package/dist/defaults/src/assets/js/components/settings/index.js +3 -5
  68. package/dist/defaults/src/assets/scss/pages/about.scss +1 -1
  69. package/dist/defaults/src/assets/scss/pages/main.scss +1 -1
  70. package/dist/defaults/src/assets/scss/pages/settings.scss +1 -1
  71. package/dist/defaults/src/integrations/context-menu/index.js +13 -13
  72. package/dist/defaults/src/integrations/menu/index.js +8 -8
  73. package/dist/defaults/src/integrations/tray/index.js +12 -12
  74. package/dist/defaults/src/main.js +5 -7
  75. package/dist/defaults/src/preload.js +4 -6
  76. package/dist/defaults/test/README.md +5 -5
  77. package/dist/defaults/test/_init.js +1 -1
  78. package/dist/gulp/main.js +9 -10
  79. package/dist/gulp/tasks/audit.js +11 -14
  80. package/dist/gulp/tasks/build-config.js +8 -8
  81. package/dist/gulp/tasks/bundle.js +16 -16
  82. package/dist/gulp/tasks/defaults.js +3 -3
  83. package/dist/gulp/tasks/distribute.js +2 -2
  84. package/dist/gulp/tasks/html.js +9 -9
  85. package/dist/gulp/tasks/package-quick.js +3 -3
  86. package/dist/gulp/tasks/package.js +3 -3
  87. package/dist/gulp/tasks/release.js +3 -3
  88. package/dist/gulp/tasks/sass.js +6 -6
  89. package/dist/gulp/tasks/serve.js +4 -4
  90. package/dist/hooks/notarize-artifacts.js +1 -1
  91. package/dist/hooks/notarize.js +1 -1
  92. package/dist/index.js +5 -8
  93. package/dist/lib/_environment-mixin.js +50 -0
  94. package/dist/lib/_lifecycle-mixin.js +45 -0
  95. package/dist/lib/analytics.js +33 -35
  96. package/dist/lib/app-state.js +14 -14
  97. package/dist/lib/auth-flow.js +18 -18
  98. package/dist/lib/auth-persistence.js +12 -12
  99. package/dist/lib/auth.js +421 -0
  100. package/dist/lib/auto-updater.js +49 -49
  101. package/dist/lib/context-menu.js +13 -13
  102. package/dist/lib/context.js +19 -19
  103. package/dist/lib/deep-link.js +34 -34
  104. package/dist/lib/fontawesome.js +5 -5
  105. package/dist/lib/ipc.js +4 -4
  106. package/dist/lib/menu.js +25 -25
  107. package/dist/lib/protocol.js +5 -5
  108. package/dist/lib/remote-config.js +22 -22
  109. package/dist/lib/remote-scripts.js +21 -21
  110. package/dist/lib/restart-manager/index.js +29 -29
  111. package/dist/lib/restart-manager/install.js +1 -1
  112. package/dist/lib/restart-manager/protocol.js +1 -1
  113. package/dist/lib/sign-helpers/exec-with-limit.js +1 -1
  114. package/dist/lib/sign-helpers/sign-events.js +1 -1
  115. package/dist/lib/startup.js +18 -13
  116. package/dist/lib/storage.js +10 -10
  117. package/dist/lib/templating.js +16 -16
  118. package/dist/lib/theme.js +10 -10
  119. package/dist/lib/tray.js +27 -27
  120. package/dist/lib/usage.js +11 -11
  121. package/dist/lib/window-manager.js +26 -26
  122. package/dist/main.js +399 -483
  123. package/dist/preload.js +236 -176
  124. package/dist/renderer.js +417 -391
  125. package/dist/test/fixtures/consumer-app/config/omega.json5 +1 -1
  126. package/dist/test/fixtures/consumer-app/src/assets/js/components/main/index.js +8 -11
  127. package/dist/test/fixtures/consumer-app/src/main.js +5 -7
  128. package/dist/test/fixtures/consumer-app/src/preload.js +2 -2
  129. package/dist/test/harness/boot-entry.js +22 -20
  130. package/dist/test/harness/main-entry.js +31 -30
  131. package/dist/test/harness/renderer-entry.js +5 -5
  132. package/dist/test/harness/renderer-preload.js +137 -141
  133. package/dist/test/index.js +10 -10
  134. package/dist/test/runner.js +2 -2
  135. package/dist/test/runners/boot.js +7 -6
  136. package/dist/test/runners/electron.js +3 -2
  137. package/dist/test/runners/render-event.js +2 -2
  138. package/dist/test/suites/boot/consumer-app-boots.test.js +57 -26
  139. package/dist/test/suites/boot/restart-manager.test.js +2 -2
  140. package/dist/test/suites/boot/storage-bundled.test.js +5 -5
  141. package/dist/test/suites/boot/theme.test.js +13 -13
  142. package/dist/test/suites/build/audit.test.js +21 -8
  143. package/dist/test/suites/build/auth-persistence-resolve.test.js +6 -6
  144. package/dist/test/suites/build/boot-fixture.test.js +2 -2
  145. package/dist/test/suites/build/boot-runner-timeout.test.js +6 -5
  146. package/dist/test/suites/build/brand-scss.test.js +1 -1
  147. package/dist/test/suites/build/build-json-bake.test.js +1 -1
  148. package/dist/test/suites/build/build-workflow-jobs.test.js +2 -2
  149. package/dist/test/suites/build/cli.test.js +30 -2
  150. package/dist/test/suites/build/config-schema.test.js +5 -5
  151. package/dist/test/suites/build/defaults-em-dash.test.js +22 -0
  152. package/dist/test/suites/build/defaults-scaffold.test.js +21 -7
  153. package/dist/test/suites/build/deploy-direct.test.js +7 -5
  154. package/dist/test/suites/build/deploy-dispatch.test.js +2 -1
  155. package/dist/test/suites/build/deploy-hook.test.js +7 -5
  156. package/dist/test/suites/build/dev-verb.test.js +67 -0
  157. package/dist/test/suites/build/ensure-target.test.js +13 -5
  158. package/dist/test/suites/build/env-delivery.test.js +2 -2
  159. package/dist/test/suites/build/esm-only-dependency.test.js +2 -2
  160. package/dist/test/suites/build/exports.test.js +9 -8
  161. package/dist/test/suites/build/get-config.test.js +4 -4
  162. package/dist/test/suites/build/manifest-deps.test.js +1 -1
  163. package/dist/test/suites/build/merge-line-files.test.js +7 -7
  164. package/dist/test/suites/build/migrate.test.js +29 -0
  165. package/dist/test/suites/build/omega-shell.test.js +34 -2
  166. package/dist/test/suites/build/omega.test.js +350 -0
  167. package/dist/test/suites/build/project-scripts-deps.test.js +6 -10
  168. package/dist/test/suites/build/renderer-auth-bridge.test.js +211 -78
  169. package/dist/test/suites/build/runner-env-write.test.js +73 -0
  170. package/dist/test/suites/build/runner.test.js +11 -10
  171. package/dist/test/suites/build/sentry.test.js +2 -2
  172. package/dist/test/suites/build/setup-scripts.test.js +27 -0
  173. package/dist/test/suites/build/sign-windows-e2e.test.js +2 -2
  174. package/dist/test/suites/build/templating.test.js +3 -3
  175. package/dist/test/suites/build/test-stealth.test.js +7 -9
  176. package/dist/test/suites/build/url-helpers.test.js +55 -56
  177. package/dist/test/suites/build/validate-config.test.js +15 -4
  178. package/dist/test/suites/build/verb-logs.test.js +20 -0
  179. package/dist/test/suites/build/wave5-pins.test.js +2 -2
  180. package/dist/test/suites/main/analytics.test.js +59 -59
  181. package/dist/test/suites/main/app-state.test.js +66 -66
  182. package/dist/test/suites/main/auth-flow.test.js +41 -41
  183. package/dist/test/suites/main/auth-persistence.test.js +54 -43
  184. package/dist/test/suites/main/{client-bridge.integration.test.js → auth.integration.test.js} +10 -9
  185. package/dist/test/suites/main/auth.test.js +336 -0
  186. package/dist/test/suites/main/auto-updater.test.js +134 -134
  187. package/dist/test/suites/main/boot-sequence.test.js +37 -49
  188. package/dist/test/suites/main/context-menu.test.js +51 -50
  189. package/dist/test/suites/main/context.test.js +25 -25
  190. package/dist/test/suites/main/deep-link.test.js +74 -74
  191. package/dist/test/suites/main/fontawesome.test.js +27 -27
  192. package/dist/test/suites/main/ipc.test.js +35 -35
  193. package/dist/test/suites/main/menu.test.js +101 -100
  194. package/dist/test/suites/main/protocol.test.js +19 -19
  195. package/dist/test/suites/main/remote-config.test.js +63 -63
  196. package/dist/test/suites/main/remote-scripts.test.js +103 -103
  197. package/dist/test/suites/main/request.test.js +71 -0
  198. package/dist/test/suites/main/restart-manager.test.js +33 -33
  199. package/dist/test/suites/main/startup-paths-and-ua.test.js +4 -4
  200. package/dist/test/suites/main/startup.test.js +26 -26
  201. package/dist/test/suites/main/stealth-window.test.js +1 -1
  202. package/dist/test/suites/main/storage.test.js +25 -25
  203. package/dist/test/suites/main/theme.test.js +34 -34
  204. package/dist/test/suites/main/tray.test.js +79 -79
  205. package/dist/test/suites/main/url-helpers.test.js +133 -133
  206. package/dist/test/suites/main/usage.test.js +25 -25
  207. package/dist/test/suites/main/window-bounds.test.js +27 -27
  208. package/dist/test/suites/main/window-manager.test.js +44 -44
  209. package/dist/test/suites/renderer/analytics-bridge.test.js +5 -5
  210. package/dist/test/suites/renderer/cross-context-helpers.test.js +37 -31
  211. package/dist/test/suites/renderer/round-trip.test.js +3 -3
  212. package/dist/test/suites/renderer/tooltips.test.js +15 -15
  213. package/dist/test/suites/renderer/{window-em-surface.test.js → window-desktop-surface.test.js} +28 -8
  214. package/dist/test/utils/extended-mode-warning.js +1 -1
  215. package/dist/utils/boot-harness.js +56 -0
  216. package/dist/utils/build-pipeline.js +4 -4
  217. package/dist/utils/mode-helpers.js +2 -15
  218. package/dist/utils/runner-env.js +13 -28
  219. package/dist/utils/ship-keys.js +3 -3
  220. package/dist/utils/signing-status.js +51 -0
  221. package/dist/utils/test-events.js +7 -0
  222. package/dist/utils/test-stealth.js +6 -6
  223. package/dist/utils/url-helpers.js +52 -42
  224. package/dist/utils/user-agent.js +44 -0
  225. package/dist/vendor/account/engine.js +3 -3
  226. package/dist/vendor/account/index.js +14 -45
  227. package/dist/vendor/account/resolve-account.js +44 -0
  228. package/dist/vendor/account/schema.js +1 -1
  229. package/dist/vendor/account/user.js +99 -0
  230. package/dist/vendor/config/client-config.js +1 -1
  231. package/dist/vendor/config/company.js +46 -14
  232. package/dist/vendor/config/defaults.js +30 -7
  233. package/dist/vendor/config/edit.js +25 -3
  234. package/dist/vendor/config/env-delivery.js +1 -1
  235. package/dist/vendor/config/env-schema.js +3 -6
  236. package/dist/vendor/config/env.js +34 -22
  237. package/dist/vendor/config/environment.js +11 -30
  238. package/dist/vendor/config/index.js +21 -28
  239. package/dist/vendor/config/load.js +16 -9
  240. package/dist/vendor/config/platforms.js +1 -1
  241. package/dist/vendor/config/repo.js +10 -27
  242. package/dist/vendor/config/schema-client.js +64 -0
  243. package/dist/vendor/config/schema-cloud.js +38 -0
  244. package/dist/vendor/config/schema-manager.js +118 -0
  245. package/dist/vendor/config/schema-overrides.js +68 -0
  246. package/dist/vendor/config/schema.js +104 -160
  247. package/dist/vendor/config/site-global.js +2 -3
  248. package/dist/vendor/config/validate.js +97 -78
  249. package/dist/vendor/config/winback.js +1 -1
  250. package/dist/vendor/devkit/actions-secrets.js +1 -1
  251. package/dist/vendor/devkit/agents-md.js +233 -0
  252. package/dist/vendor/devkit/attach-log-file.js +16 -2
  253. package/dist/vendor/devkit/build-json.js +1 -1
  254. package/dist/vendor/devkit/ci-workflows.js +30 -30
  255. package/dist/vendor/devkit/cli-router.js +16 -11
  256. package/dist/vendor/devkit/defaults-engine.js +15 -51
  257. package/dist/vendor/devkit/deploy-snapshot.js +44 -9
  258. package/dist/vendor/devkit/env-lines.js +183 -0
  259. package/dist/vendor/devkit/local.js +64 -10
  260. package/dist/vendor/devkit/lockfile.js +32 -13
  261. package/dist/vendor/devkit/logger.js +7 -2
  262. package/dist/vendor/devkit/merge-line-files.js +219 -177
  263. package/dist/vendor/devkit/omega-bin.js +208 -111
  264. package/dist/vendor/devkit/preludes/docs-sync.js +52 -0
  265. package/dist/vendor/devkit/preludes/index.js +1 -0
  266. package/dist/vendor/devkit/target-picker.js +45 -0
  267. package/dist/vendor/devkit/test/dashed-files.js +37 -0
  268. package/dist/vendor/devkit/test/run-verb-under-tee.js +71 -0
  269. package/dist/vendor/devkit/test/runner-core.js +6 -6
  270. package/dist/vendor/devkit/update.js +15 -15
  271. package/dist/vendor/devkit/verb-scripts.js +40 -0
  272. package/dist/vendor/devkit/verbs.js +170 -0
  273. package/dist/vendor/monitoring/env.js +2 -2
  274. package/dist/vendor/monitoring/index.js +1 -1
  275. package/dist/vendor/monitoring/main.js +1 -1
  276. package/dist/vendor/monitoring/preload.js +1 -1
  277. package/dist/vendor/monitoring/renderer.js +1 -1
  278. package/package.json +19 -26
  279. package/dist/commands/install.js +0 -37
  280. package/dist/defaults/AGENTS.md +0 -110
  281. package/dist/defaults/CLAUDE.md +0 -1
  282. package/dist/lib/client-bridge.js +0 -374
  283. package/dist/lib/logger.js +0 -4
  284. package/dist/test/suites/build/manager.test.js +0 -213
  285. package/dist/test/suites/main/client-bridge.test.js +0 -262
  286. package/dist/vendor/config/env-retired.js +0 -137
  287. package/dist/vendor/config/retired-keys.js +0 -635
  288. package/docs/analytics.md +0 -140
  289. package/docs/app-state.md +0 -92
  290. package/docs/audit.md +0 -69
  291. package/docs/auto-updater.md +0 -243
  292. package/docs/boot-sequence.md +0 -39
  293. package/docs/build-system.md +0 -169
  294. package/docs/cdp-debugging.md +0 -169
  295. package/docs/client-bridge.md +0 -269
  296. package/docs/common-mistakes.md +0 -21
  297. package/docs/config-schema.md +0 -120
  298. package/docs/context-menu.md +0 -112
  299. package/docs/context.md +0 -81
  300. package/docs/css.md +0 -90
  301. package/docs/deep-link.md +0 -186
  302. package/docs/environment-detection.md +0 -112
  303. package/docs/fontawesome.md +0 -107
  304. package/docs/hooks.md +0 -89
  305. package/docs/icons.md +0 -79
  306. package/docs/index.md +0 -317
  307. package/docs/installer-options.md +0 -165
  308. package/docs/ipc.md +0 -61
  309. package/docs/lib-modules.md +0 -53
  310. package/docs/logging.md +0 -229
  311. package/docs/menu.md +0 -160
  312. package/docs/releasing.md +0 -239
  313. package/docs/remote-config.md +0 -118
  314. package/docs/remote-scripts.md +0 -144
  315. package/docs/restart-manager.md +0 -144
  316. package/docs/runner.md +0 -290
  317. package/docs/sentry.md +0 -97
  318. package/docs/shared/agent-docs.md +0 -89
  319. package/docs/shared/analytics.md +0 -612
  320. package/docs/shared/brands.md +0 -57
  321. package/docs/shared/breaking-changes.md +0 -851
  322. package/docs/shared/config.md +0 -1952
  323. package/docs/shared/deploys.md +0 -341
  324. package/docs/shared/icons.md +0 -219
  325. package/docs/shared/local-dev.md +0 -167
  326. package/docs/shared/logging.md +0 -205
  327. package/docs/shared/monitoring.md +0 -167
  328. package/docs/shared/publishing.md +0 -187
  329. package/docs/shared/rulings.md +0 -34
  330. package/docs/shared/testing.md +0 -147
  331. package/docs/shared/theming.md +0 -629
  332. package/docs/shared/translation.md +0 -333
  333. package/docs/shared/updates.md +0 -61
  334. package/docs/signing.md +0 -293
  335. package/docs/startup.md +0 -142
  336. package/docs/storage.md +0 -59
  337. package/docs/templating.md +0 -101
  338. package/docs/test-boot-layer.md +0 -157
  339. package/docs/test-framework.md +0 -362
  340. package/docs/themes.md +0 -149
  341. package/docs/tooltips.md +0 -99
  342. package/docs/tray.md +0 -164
  343. package/docs/usage.md +0 -58
  344. package/docs/verts.md +0 -62
  345. package/docs/windows.md +0 -149
@@ -29,7 +29,7 @@
29
29
  google: { id: '' },
30
30
  },
31
31
  },
32
- // Empty config → client-bridge skips Firebase init (no hang on a fake projectId).
32
+ // Empty config → lib/auth.js skips Firebase init (no hang on a fake projectId).
33
33
  cloud: { provider: 'firebase', config: {} },
34
34
  targets: {
35
35
  desktop: {
@@ -1,17 +1,14 @@
1
1
  // Minimal main-window renderer entry for the boot-layer self-test fixture.
2
- const Manager = require('@omega.js/desktop/renderer');
2
+ import omega from '@omega.js/desktop/renderer';
3
3
 
4
- const manager = new Manager();
5
- manager.initialize();
4
+ omega.initialize();
6
5
 
7
6
  // #925 pins that this renderer answers the lane's environment and not the word
8
- // baked into the bundle, so the boot inspect needs a handle on the Manager the
7
+ // baked into the bundle, so the boot inspect needs a handle on the instance the
9
8
  // answer is given on.
10
- window.__omegaManager = manager;
9
+ window.__omegaInstance = omega;
11
10
 
12
- // #111 — pins that the vendored core module resolves through the renderer's
13
- // `__main_assets__` alias AND runs: with no .omega-shell in this window the
14
- // call registers the shell API on omega._library and returns early, so a
15
- // module that throws on a vendored surface breaks this fixture's boot.
16
- window.__omegaAppShell = require('__main_assets__/js/core/app-shell.js').default;
17
- window.__omegaAppShell();
11
+ // #111 pins that a vendored core module resolves through the renderer's
12
+ // `__main_assets__` alias: an alias that does not resolve fails this fixture's
13
+ // build, and the boot inspect reads the export it bound.
14
+ window.__omegaCreateShell = require('__main_assets__/js/core/app-shell.js').createShell;
@@ -1,15 +1,13 @@
1
1
  // Minimal main entry for @omega.js/desktop's boot-layer self-test fixture. Mirrors a real consumer:
2
2
  // one-line bootstrap, then create the main window once initialize() resolves. The boot
3
- // harness (src/test/harness/boot-entry.js) inspects the live manager after this runs.
4
- const Manager = require('@omega.js/desktop/main');
3
+ // harness (src/test/harness/boot-entry.js) inspects the live instance after this runs.
4
+ const omega = require('@omega.js/desktop/main');
5
5
 
6
- const manager = new Manager();
7
-
8
- manager.initialize()
6
+ omega.initialize()
9
7
  .then(() => {
10
- const { windows, logger } = manager;
8
+ const { windows, logger } = omega;
11
9
 
12
- // Force show:false — the boot harness runs headless and only asserts the window
10
+ // Force show:false: the boot harness runs headless and only asserts the window
13
11
  // EXISTS + loaded the built view, never that it's visible on screen.
14
12
  windows.create('main', { show: false });
15
13
 
@@ -1,4 +1,4 @@
1
1
  // Minimal preload for the boot-layer self-test fixture. Exposes window.desktop to the renderer.
2
- const Manager = require('@omega.js/desktop/preload');
2
+ const omega = require('@omega.js/desktop/preload');
3
3
 
4
- new Manager().initialize();
4
+ omega.initialize();
@@ -1,6 +1,6 @@
1
- // Boot harness — invoked from @omega.js/desktop's main.js after manager.initialize() resolves
1
+ // Boot harness: invoked from @omega.js/desktop's main.js (utils/boot-harness.js) after omega.initialize() resolves
2
2
  // when OMEGA_TEST_BOOT=1. Reads the spec file pointed to by OMEGA_TEST_BOOT_SPEC,
3
- // runs each `inspect` against the live manager, emits results, and quits.
3
+ // runs each `inspect` against the live instance, emits results, and quits.
4
4
  //
5
5
  // Why call from main.js instead of preloading via electron's --require?
6
6
  // Because Electron rejects unknown CLI flags, we can't sneak args/preload modules in.
@@ -11,29 +11,31 @@
11
11
  // a project view (`view: '<name>'`), each in a real window of this booted app. See
12
12
  // runViewSuite() below.
13
13
  //
14
- // Protocol matches main-entry.js — emit `__EM_TEST__` JSON lines on stdout.
14
+ // Protocol matches main-entry.js, emit `__OMEGA_TEST__` JSON lines on stdout.
15
15
 
16
16
  'use strict';
17
17
 
18
+ const { TEST_EVENT_PREFIX } = require('../../utils/test-events.js');
19
+
18
20
  // Belt-and-suspenders for a view suite that never emits `end` (a page that died mid-run).
19
21
  // Same 60s ceiling the harness-page renderer lane uses (harness/main-entry.js).
20
22
  const VIEW_SUITE_TIMEOUT = 60000;
21
23
 
22
24
  function emit(obj) {
23
- process.stdout.write(`__EM_TEST__${JSON.stringify(obj)}\n`);
25
+ process.stdout.write(`${TEST_EVENT_PREFIX}${JSON.stringify(obj)}\n`);
24
26
  }
25
27
 
26
- async function run(manager) {
28
+ async function run(omega) {
27
29
  const { app } = require('electron');
28
30
  const path = require('path');
29
31
 
30
- // Give the consumer's `manager.initialize().then(() => { ... })` callback time
32
+ // Give the consumer's `omega.initialize().then(() => { ... })` callback time
31
33
  // to surface windows / wire up handlers / etc. The harness runs from setImmediate
32
34
  // already (which flushes microtasks once), but `windows.create()` is async, so
33
35
  // we additionally poll for the main window for up to 3s. Apps that intentionally
34
36
  // launch hidden never create a main window — those tests should `if (!win) return`
35
37
  // when inspecting window state.
36
- await waitForMainWindow(manager, 3000);
38
+ await waitForMainWindow(omega, 3000);
37
39
 
38
40
  const specPath = process.env.OMEGA_TEST_BOOT_SPEC;
39
41
  if (!specPath) {
@@ -74,7 +76,7 @@ async function run(manager) {
74
76
  description: t.description,
75
77
  timeout: t.timeout || 15000,
76
78
  inspect: new Function('args', 'require', 'process', 'Buffer',
77
- `return (async function ({ manager, expect, projectRoot, appRoot, frameworkDistRoot, distSnapshotBefore }) {\n${t.inspectSource}\n})(args)`,
79
+ `return (async function ({ omega, expect, projectRoot, appRoot, frameworkDistRoot, distSnapshotBefore }) {\n${t.inspectSource}\n})(args)`,
78
80
  ),
79
81
  }));
80
82
 
@@ -88,7 +90,7 @@ async function run(manager) {
88
90
  const start = Date.now();
89
91
  try {
90
92
  await Promise.race([
91
- t.inspect(Object.assign({ manager, expect }, args), require, process, Buffer),
93
+ t.inspect(Object.assign({ omega, expect }, args), require, process, Buffer),
92
94
  new Promise((_, reject) => setTimeout(() => reject(new Error('Boot test timeout')), t.timeout)),
93
95
  ]);
94
96
  const duration = Date.now() - start;
@@ -109,7 +111,7 @@ async function run(manager) {
109
111
  // remaining suites unreported. This harness exits through app.exit() below regardless.
110
112
  if (viewSuites.length > 0) app.removeAllListeners('window-all-closed');
111
113
  for (let i = 0; i < viewSuites.length; i += 1) {
112
- const counts = await runViewSuite(viewSuites[i], i, manager, spec);
114
+ const counts = await runViewSuite(viewSuites[i], i, omega, spec);
113
115
  passed += counts.passed;
114
116
  failed += counts.failed;
115
117
  skipped += counts.skipped;
@@ -127,7 +129,7 @@ async function run(manager) {
127
129
  // evaluated inside the page, with a shim standing in for the preload bridge it normally
128
130
  // talks to. There is exactly one suite loop and one `expect` in this framework, and this is
129
131
  // not a second copy of either.
130
- async function runViewSuite(suite, index, manager, spec) {
132
+ async function runViewSuite(suite, index, omega, spec) {
131
133
  const fs = require('fs');
132
134
  const path = require('path');
133
135
 
@@ -145,7 +147,7 @@ async function runViewSuite(suite, index, manager, spec) {
145
147
  return counts;
146
148
  }
147
149
 
148
- const win = await manager.windows.create(`omega-test-view-${index}`, {
150
+ const win = await omega.windows.create(`omega-test-view-${index}`, {
149
151
  view: suite.view,
150
152
  show: false,
151
153
  persistBounds: false,
@@ -171,11 +173,11 @@ async function runViewSuite(suite, index, manager, spec) {
171
173
  // surface talking to main over IPC; here the page just queues events for the poll
172
174
  // below, since main is right here.
173
175
  await win.webContents.executeJavaScript(`
174
- window.__emTestQueue = [];
175
- window.__emTest = {
176
+ window.__omegaTestQueue = [];
177
+ window.__omegaTest = {
176
178
  ready() {},
177
- emit(evt) { window.__emTestQueue.push(evt); },
178
- onSuites(handler) { window.__emTestDeliver = handler; },
179
+ emit(evt) { window.__omegaTestQueue.push(evt); },
180
+ onSuites(handler) { window.__omegaTestDeliver = handler; },
179
181
  };
180
182
  null;
181
183
  `);
@@ -187,7 +189,7 @@ async function runViewSuite(suite, index, manager, spec) {
187
189
 
188
190
  // 3. Deliver this window's one suite. One suite per window, so the entry's `end` event
189
191
  // ends this window's run.
190
- await win.webContents.executeJavaScript(`window.__emTestDeliver(${JSON.stringify([suite])}); null;`);
192
+ await win.webContents.executeJavaScript(`window.__omegaTestDeliver(${JSON.stringify([suite])}); null;`);
191
193
 
192
194
  // 4. Drain the queue until the run ends. Every event is forwarded verbatim, so the
193
195
  // parent renders a view suite exactly like a harness-page one.
@@ -195,7 +197,7 @@ async function runViewSuite(suite, index, manager, spec) {
195
197
  let ended = false;
196
198
  while (!ended && Date.now() < deadline) {
197
199
  await new Promise((resolve) => setTimeout(resolve, 50));
198
- const events = await win.webContents.executeJavaScript('window.__emTestQueue.splice(0)');
200
+ const events = await win.webContents.executeJavaScript('window.__omegaTestQueue.splice(0)');
199
201
  for (const evt of events) {
200
202
  emit(evt);
201
203
  if (evt.event === 'end') {
@@ -226,10 +228,10 @@ async function runViewSuite(suite, index, manager, spec) {
226
228
 
227
229
  // Poll for the main window for up to `timeoutMs`. Resolves when it shows up, or after
228
230
  // the timeout (no error — agent/hidden apps never create one and that's fine).
229
- async function waitForMainWindow(manager, timeoutMs) {
231
+ async function waitForMainWindow(omega, timeoutMs) {
230
232
  const deadline = Date.now() + timeoutMs;
231
233
  while (Date.now() < deadline) {
232
- if (manager?.windows?.get?.('main')) return;
234
+ if (omega.windows.get('main')) return;
233
235
  await new Promise((resolve) => setTimeout(resolve, 25));
234
236
  }
235
237
  }
@@ -13,15 +13,16 @@
13
13
  // exits 0 on success / 1 on any failure.
14
14
 
15
15
  const path = require('path');
16
+ const { TEST_EVENT_PREFIX } = require('../../utils/test-events.js');
16
17
  const { app, BrowserWindow, ipcMain } = require('electron');
17
18
 
18
19
  // macOS: suppress app activation BEFORE ready — launching a regular-policy app
19
20
  // steals keyboard focus app-wide even when no window is ever focused. This file
20
- // only initializes its Manager after whenReady (too late: activation fires when
21
+ // only initializes its instance after whenReady (too late: activation fires when
21
22
  // the app finishes launching), so flip the accessory policy here at require time.
22
23
  // This process is always a test run (runners/electron.js spawns it naming
23
24
  // OMEGA_ENVIRONMENT=testing, the one environment input), so
24
- // the shared predicate needs no Manager. OMEGA_TEST_SHOW=1 opts back into normal
25
+ // the shared predicate needs no instance. OMEGA_TEST_SHOW=1 opts back into normal
25
26
  // activation along with visible windows.
26
27
  if (process.platform === 'darwin' && require('../../utils/test-stealth.js')()) {
27
28
  app.dock.hide();
@@ -31,7 +32,7 @@ if (process.platform === 'darwin' && require('../../utils/test-stealth.js')()) {
31
32
  // the harness Electron (e.g. playwright-core connectOverCDP). Port 0 = an
32
33
  // OS-assigned loopback-only port; Chromium writes the resolved port to
33
34
  // DevToolsActivePort inside the userData dir that's CURRENT when the DevTools
34
- // server starts — captured here at require time, because Manager.initialize()
35
+ // server starts, captured here at require time, because omega.initialize()
35
36
  // re-paths userData later (post-ready in this harness). runSuites() resolves
36
37
  // the port from that file and publishes it as process.env.OMEGA_CDP_PORT.
37
38
  if (!app.commandLine.hasSwitch('remote-debugging-port')) {
@@ -73,7 +74,7 @@ const filter = (() => {
73
74
  })();
74
75
 
75
76
  function emit(obj) {
76
- process.stdout.write(`__EM_TEST__${JSON.stringify(obj)}\n`);
77
+ process.stdout.write(`${TEST_EVENT_PREFIX}${JSON.stringify(obj)}\n`);
77
78
  }
78
79
 
79
80
  class SkipError extends Error {
@@ -98,8 +99,8 @@ async function runSuites() {
98
99
  await new Promise((resolve) => setTimeout(resolve, 100));
99
100
  }
100
101
 
101
- const Manager = require('../../main.js');
102
- const manager = new Manager();
102
+ // The ONE main-process instance, the same object a consumer's main.js requires
103
+ const omega = require('../../main.js');
103
104
 
104
105
  // Test mode: load default config from @omega.js/desktop defaults (since the harness CWD won't have
105
106
  // one), resolved for the desktop target via @omega.js/config, and skip window creation
@@ -109,7 +110,7 @@ async function runSuites() {
109
110
  const { loadConfig } = require('../../vendor/config/index.js');
110
111
  const defaultConfig = loadConfig(path.join(__dirname, '..', '..', 'defaults'), 'desktop').config;
111
112
 
112
- await manager.initialize(defaultConfig, { skipWindowCreation: true });
113
+ await omega.initialize(defaultConfig, { skipWindowCreation: true });
113
114
 
114
115
  // Consumer-scheme containment. Main-layer suites exercise consumer code that
115
116
  // loads `<brand.id>://` URLs (tab managers, internal pages), but the consumer's
@@ -151,7 +152,7 @@ async function runSuites() {
151
152
  expect: require('../assert.js'),
152
153
  state,
153
154
  layer: 'main',
154
- manager,
155
+ omega,
155
156
  skip(reason) { throw new SkipError(reason); },
156
157
  });
157
158
 
@@ -200,7 +201,7 @@ async function runSuites() {
200
201
  // After main suites finish, optionally run renderer suites in a hidden BrowserWindow.
201
202
  if (rendererSuiteFiles.length > 0) {
202
203
  try {
203
- const r = await runRendererSuites(rendererSuiteFiles, manager);
204
+ const r = await runRendererSuites(rendererSuiteFiles, omega);
204
205
  passed += r.passed;
205
206
  failed += r.failed;
206
207
  skipped += r.skipped;
@@ -217,7 +218,7 @@ async function runSuites() {
217
218
  // Spawn a hidden BrowserWindow and run each renderer suite inside it. Each suite file is
218
219
  // loaded via require() in main, then its tests are serialized to { name, runSource } and
219
220
  // shipped over IPC for the renderer to reconstruct + execute.
220
- async function runRendererSuites(files, manager) {
221
+ async function runRendererSuites(files, omega) {
221
222
  // Serialize suites for transport. We can't ship functions directly via IPC, so we extract
222
223
  // the function body of each test's `run` and ship that as a string. The renderer rebuilds
223
224
  // it with `new Function('ctx', body)`.
@@ -262,9 +263,9 @@ async function runRendererSuites(files, manager) {
262
263
 
263
264
  const harnessDir = __dirname;
264
265
  // Tell the renderer-preload (running in the BrowserWindow's preload) where to
265
- // require() the renderer Manager from. We resolve by absolute path because the
266
+ // require() the renderer instance from. We resolve by absolute path because the
266
267
  // preload runs with the renderer's module resolution scope, not main's.
267
- process.env.OMEGA_TEST_RENDERER_MANAGER_PATH = path.resolve(__dirname, '..', '..', 'renderer.js');
268
+ process.env.OMEGA_TEST_RENDERER_PATH = path.resolve(__dirname, '..', '..', 'renderer.js');
268
269
 
269
270
  // Register test-only IPC channels so renderer-layer tests can verify round-trip
270
271
  // behavior end-to-end (renderer.invoke → main handler → response). Idempotent:
@@ -273,15 +274,15 @@ async function runRendererSuites(files, manager) {
273
274
  ipcMain.handle('desktop:__test:echo', (_evt, payload) => ({ echoed: payload, ts: Date.now() }));
274
275
  // Forwarded log capture — renderer logger.log(...) sends 'desktop:log:forward'; we
275
276
  // accumulate the most recent payload so the renderer test can verify it landed.
276
- global.__emTestLastForwardedLog = null;
277
+ global.__omegaTestLastForwardedLog = null;
277
278
  ipcMain.removeAllListeners('desktop:__test:forwarded-log-tap');
278
279
  ipcMain.on('desktop:log:forward', (_evt, payload) => {
279
- global.__emTestLastForwardedLog = payload;
280
+ global.__omegaTestLastForwardedLog = payload;
280
281
  });
281
282
  // Test-only handler the renderer can call to read back the most recently
282
283
  // forwarded log payload. Returns null if none yet.
283
284
  try { ipcMain.removeHandler('desktop:__test:read-last-log'); } catch (_) { /* ignore */ }
284
- ipcMain.handle('desktop:__test:read-last-log', () => global.__emTestLastForwardedLog);
285
+ ipcMain.handle('desktop:__test:read-last-log', () => global.__omegaTestLastForwardedLog);
285
286
  // Analytics sender tap ([#411](https://github.com/Omega-JS-Stack/omega/issues/411)):
286
287
  // renderer-originated omega.analytics() calls forward over IPC and must fire
287
288
  // through main's ONE sender, so a renderer suite needs to read back what that
@@ -296,17 +297,17 @@ async function runRendererSuites(files, manager) {
296
297
  // identity fields), so a suite asserts on `client_id` as GA would receive it
297
298
  // rather than on a field the tap made up.
298
299
  const analyticsCore = require('../../vendor/analytics/core.js');
299
- global.__emTestAnalyticsSends = [];
300
- manager.analytics.shutdown();
301
- manager.analytics._send = (descriptor) => {
302
- global.__emTestAnalyticsSends.push({
300
+ global.__omegaTestAnalyticsSends = [];
301
+ omega.analytics.shutdown();
302
+ omega.analytics._send = (descriptor) => {
303
+ global.__omegaTestAnalyticsSends.push({
303
304
  provider: descriptor.provider,
304
305
  name: descriptor.name,
305
306
  payload: descriptor.payload,
306
307
  body: analyticsCore.buildPayload({
307
- clientId: manager.analytics._clientId,
308
- userId: manager.analytics._userId,
309
- userProperties: manager.analytics._userProperties,
308
+ clientId: omega.analytics._clientId,
309
+ userId: omega.analytics._userId,
310
+ userProperties: omega.analytics._userProperties,
310
311
  eventName: descriptor.name,
311
312
  params: descriptor.payload,
312
313
  }),
@@ -314,10 +315,10 @@ async function runRendererSuites(files, manager) {
314
315
  return true;
315
316
  };
316
317
  process.env.GOOGLE_ANALYTICS_SECRET = 'harness-secret';
317
- manager.config.analytics = { providers: { google: { id: 'G-HARNESS1' } } };
318
- manager.analytics.initialize(manager);
318
+ omega.config.analytics = { providers: { google: { id: 'G-HARNESS1' } } };
319
+ omega.analytics.initialize(omega);
319
320
  try { ipcMain.removeHandler('desktop:__test:read-analytics-sends'); } catch (_) { /* ignore */ }
320
- ipcMain.handle('desktop:__test:read-analytics-sends', () => global.__emTestAnalyticsSends);
321
+ ipcMain.handle('desktop:__test:read-analytics-sends', () => global.__omegaTestAnalyticsSends);
321
322
  const win = new BrowserWindow({
322
323
  show: false,
323
324
  width: 800,
@@ -337,16 +338,16 @@ async function runRendererSuites(files, manager) {
337
338
  if (resolved) return;
338
339
  resolved = true;
339
340
  try { win.destroy(); } catch (_e) { /* noop */ }
340
- ipcMain.removeAllListeners('__emTest:ready');
341
- ipcMain.removeAllListeners('__emTest:result');
341
+ ipcMain.removeAllListeners('__omegaTest:ready');
342
+ ipcMain.removeAllListeners('__omegaTest:result');
342
343
  if (err) reject(err); else resolve(val);
343
344
  };
344
345
 
345
- ipcMain.on('__emTest:ready', () => {
346
- win.webContents.send('__emTest:suites', suites);
346
+ ipcMain.on('__omegaTest:ready', () => {
347
+ win.webContents.send('__omegaTest:suites', suites);
347
348
  });
348
349
 
349
- ipcMain.on('__emTest:result', (_e, evt) => {
350
+ ipcMain.on('__omegaTest:result', (_e, evt) => {
350
351
  // Forward verbatim to stdout — same envelope as main-process events.
351
352
  emit(evt);
352
353
  if (evt.event === 'result') {
@@ -1,8 +1,8 @@
1
1
  // Renderer test-harness entry. Runs inside the hidden BrowserWindow.
2
2
  //
3
3
  // Lifecycle:
4
- // 1. window load → __emTest.ready()
5
- // 2. main sends suites via __emTest:suites
4
+ // 1. window load → __omegaTest.ready()
5
+ // 2. main sends suites via __omegaTest:suites
6
6
  // 3. renderer reconstructs each test fn via new Function('ctx', body), runs it sequentially
7
7
  // 4. emits { event, ... } for each result; emits { event: 'end' } when done
8
8
  //
@@ -24,7 +24,7 @@
24
24
  };
25
25
 
26
26
  function emit(evt) {
27
- try { window.__emTest.emit(evt); } catch (e) { /* harness gone */ }
27
+ try { window.__omegaTest.emit(evt); } catch (e) { /* harness gone */ }
28
28
  }
29
29
 
30
30
  // Tiny inline expect — mirrors src/test/assert.js minimal surface used by tests.
@@ -162,12 +162,12 @@
162
162
  emit({ event: 'end', passed, failed, skipped });
163
163
  }
164
164
 
165
- window.__emTest.onSuites((suites) => {
165
+ window.__omegaTest.onSuites((suites) => {
166
166
  runAll(suites).catch((e) => {
167
167
  emit({ event: 'fatal', message: e.message, stack: e.stack });
168
168
  });
169
169
  });
170
170
 
171
171
  // Signal ready as soon as the page is parsed.
172
- window.__emTest.ready();
172
+ window.__omegaTest.ready();
173
173
  })();