@omega.js/desktop 0.52.0 → 0.53.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.
- package/README.md +17 -12
- package/dist/assets/css/core/_initialize.scss +1 -1
- package/dist/assets/js/core/app-shell.js +14 -15
- package/dist/assets/themes/_template/_theme.js +6 -6
- package/dist/assets/themes/base/_includes/global/sections/account.html +4 -4
- package/dist/assets/themes/base/_includes/global/sections/app-sidebar.html +5 -5
- package/dist/assets/themes/base/_layouts/frontend/pages/account/index.html +3 -3
- package/dist/assets/themes/base/_layouts/frontend/pages/alternatives/index.html +1 -1
- package/dist/assets/themes/base/_layouts/frontend/pages/blog/tags/tag.html +1 -1
- package/dist/assets/themes/base/_layouts/frontend/pages/payment/confirmation.html +1 -1
- package/dist/assets/themes/base/_sections/marketing/newsletter-cta/section.js +2 -3
- package/dist/assets/themes/base/_sections/verts/unit/section.html +1 -1
- package/dist/assets/themes/base/_sections/verts/unit/section.js +3 -4
- package/dist/assets/themes/base/_theme.js +4 -3
- package/dist/assets/themes/bootstrap/_theme.js +2 -2
- package/dist/assets/themes/bootstrap/overrides/_links.scss +1 -1
- package/dist/assets/themes/classy/_theme.js +8 -6
- package/dist/assets/themes/classy/css/marketing/_sections.scss +1 -2
- package/dist/assets/themes/classy/js/hero-demo-form.js +3 -2
- package/dist/assets/themes/neobrutalism/_theme.js +5 -5
- package/dist/assets/themes/neobrutalism/js/pages/test/libraries/layers/index.js +1 -1
- package/dist/assets/themes/newsflash/_theme.js +6 -6
- package/dist/assets/themes/newsflash/js/pages/test/libraries/layers/index.js +1 -1
- package/dist/build.js +87 -111
- package/dist/cli.js +1 -1
- package/dist/commands/build.js +2 -2
- package/dist/commands/cdp/capture.js +2 -2
- package/dist/commands/cdp/quit.js +2 -2
- package/dist/commands/cdp/relaunch.js +2 -2
- package/dist/commands/cdp/theme.js +1 -1
- package/dist/commands/clean.js +2 -2
- package/dist/commands/deploy.js +4 -4
- package/dist/commands/finalize-release.js +4 -4
- package/dist/commands/install.js +3 -3
- package/dist/commands/launch.js +2 -2
- package/dist/commands/lib/deploy-precheck.js +3 -3
- package/dist/commands/lib/ensure-target.js +6 -6
- package/dist/commands/package.js +2 -2
- package/dist/commands/publish.js +2 -2
- package/dist/commands/release.js +3 -3
- package/dist/commands/runner.js +11 -11
- package/dist/commands/sign-windows.js +5 -5
- package/dist/commands/test.js +4 -4
- package/dist/commands/update.js +2 -2
- package/dist/commands/validate-certs.js +4 -4
- package/dist/commands/version.js +3 -3
- package/dist/defaults/AGENTS.md +17 -8
- package/dist/defaults/config/omega.json5 +7 -7
- package/dist/defaults/hooks/build/post.js +1 -1
- package/dist/defaults/hooks/build/pre.js +1 -1
- package/dist/defaults/hooks/deploy/pre.js +1 -1
- package/dist/defaults/hooks/release/post.js +1 -1
- package/dist/defaults/hooks/release/pre.js +1 -1
- package/dist/defaults/src/assets/js/components/about/index.js +3 -5
- package/dist/defaults/src/assets/js/components/main/index.js +3 -5
- package/dist/defaults/src/assets/js/components/settings/index.js +3 -5
- package/dist/defaults/src/integrations/context-menu/index.js +2 -2
- package/dist/defaults/src/integrations/menu/index.js +3 -3
- package/dist/defaults/src/integrations/tray/index.js +3 -3
- package/dist/defaults/src/main.js +3 -5
- package/dist/defaults/src/preload.js +3 -5
- package/dist/defaults/test/README.md +2 -2
- package/dist/gulp/main.js +9 -10
- package/dist/gulp/tasks/audit.js +7 -7
- package/dist/gulp/tasks/build-config.js +8 -8
- package/dist/gulp/tasks/bundle.js +16 -16
- package/dist/gulp/tasks/defaults.js +3 -3
- package/dist/gulp/tasks/distribute.js +2 -2
- package/dist/gulp/tasks/html.js +9 -9
- package/dist/gulp/tasks/package-quick.js +3 -3
- package/dist/gulp/tasks/package.js +3 -3
- package/dist/gulp/tasks/release.js +3 -3
- package/dist/gulp/tasks/sass.js +6 -6
- package/dist/gulp/tasks/serve.js +4 -4
- package/dist/hooks/notarize-artifacts.js +1 -1
- package/dist/hooks/notarize.js +1 -1
- package/dist/index.js +5 -8
- package/dist/lib/_environment-mixin.js +50 -0
- package/dist/lib/_lifecycle-mixin.js +45 -0
- package/dist/lib/analytics.js +33 -35
- package/dist/lib/app-state.js +14 -14
- package/dist/lib/auth-flow.js +18 -18
- package/dist/lib/auth-persistence.js +12 -12
- package/dist/lib/auth.js +421 -0
- package/dist/lib/auto-updater.js +49 -49
- package/dist/lib/context-menu.js +13 -13
- package/dist/lib/context.js +19 -19
- package/dist/lib/deep-link.js +34 -34
- package/dist/lib/fontawesome.js +5 -5
- package/dist/lib/ipc.js +4 -4
- package/dist/lib/menu.js +25 -25
- package/dist/lib/protocol.js +5 -5
- package/dist/lib/remote-config.js +22 -22
- package/dist/lib/remote-scripts.js +21 -21
- package/dist/lib/restart-manager/index.js +28 -28
- package/dist/lib/sign-helpers/exec-with-limit.js +1 -1
- package/dist/lib/sign-helpers/sign-events.js +1 -1
- package/dist/lib/startup.js +18 -13
- package/dist/lib/storage.js +10 -10
- package/dist/lib/templating.js +16 -16
- package/dist/lib/theme.js +10 -10
- package/dist/lib/tray.js +27 -27
- package/dist/lib/usage.js +11 -11
- package/dist/lib/window-manager.js +26 -26
- package/dist/main.js +398 -483
- package/dist/preload.js +236 -176
- package/dist/renderer.js +417 -391
- package/dist/test/fixtures/consumer-app/config/omega.json5 +1 -1
- package/dist/test/fixtures/consumer-app/src/assets/js/components/main/index.js +8 -11
- package/dist/test/fixtures/consumer-app/src/main.js +5 -7
- package/dist/test/fixtures/consumer-app/src/preload.js +2 -2
- package/dist/test/harness/boot-entry.js +22 -20
- package/dist/test/harness/main-entry.js +31 -30
- package/dist/test/harness/renderer-entry.js +5 -5
- package/dist/test/harness/renderer-preload.js +137 -141
- package/dist/test/index.js +10 -10
- package/dist/test/runner.js +2 -2
- package/dist/test/runners/boot.js +7 -6
- package/dist/test/runners/electron.js +3 -2
- package/dist/test/runners/render-event.js +2 -2
- package/dist/test/suites/boot/consumer-app-boots.test.js +57 -26
- package/dist/test/suites/boot/restart-manager.test.js +2 -2
- package/dist/test/suites/boot/storage-bundled.test.js +5 -5
- package/dist/test/suites/boot/theme.test.js +13 -13
- package/dist/test/suites/build/audit.test.js +1 -1
- package/dist/test/suites/build/auth-persistence-resolve.test.js +6 -6
- package/dist/test/suites/build/boot-fixture.test.js +2 -2
- package/dist/test/suites/build/boot-runner-timeout.test.js +6 -5
- package/dist/test/suites/build/brand-scss.test.js +1 -1
- package/dist/test/suites/build/build-json-bake.test.js +1 -1
- package/dist/test/suites/build/cli.test.js +2 -2
- package/dist/test/suites/build/config-schema.test.js +5 -5
- package/dist/test/suites/build/defaults-scaffold.test.js +2 -2
- package/dist/test/suites/build/deploy-hook.test.js +3 -3
- package/dist/test/suites/build/ensure-target.test.js +2 -2
- package/dist/test/suites/build/env-delivery.test.js +2 -2
- package/dist/test/suites/build/esm-only-dependency.test.js +2 -2
- package/dist/test/suites/build/exports.test.js +9 -8
- package/dist/test/suites/build/get-config.test.js +4 -4
- package/dist/test/suites/build/manifest-deps.test.js +1 -1
- package/dist/test/suites/build/merge-line-files.test.js +1 -1
- package/dist/test/suites/build/omega-shell.test.js +34 -2
- package/dist/test/suites/build/omega.test.js +350 -0
- package/dist/test/suites/build/renderer-auth-bridge.test.js +211 -78
- package/dist/test/suites/build/runner.test.js +2 -2
- package/dist/test/suites/build/sentry.test.js +2 -2
- package/dist/test/suites/build/sign-windows-e2e.test.js +2 -2
- package/dist/test/suites/build/templating.test.js +3 -3
- package/dist/test/suites/build/test-stealth.test.js +7 -9
- package/dist/test/suites/build/url-helpers.test.js +55 -56
- package/dist/test/suites/build/validate-config.test.js +2 -2
- package/dist/test/suites/build/wave5-pins.test.js +2 -2
- package/dist/test/suites/main/analytics.test.js +59 -59
- package/dist/test/suites/main/app-state.test.js +66 -66
- package/dist/test/suites/main/auth-flow.test.js +41 -41
- package/dist/test/suites/main/auth-persistence.test.js +54 -43
- package/dist/test/suites/main/{client-bridge.integration.test.js → auth.integration.test.js} +10 -9
- package/dist/test/suites/main/auth.test.js +336 -0
- package/dist/test/suites/main/auto-updater.test.js +134 -134
- package/dist/test/suites/main/boot-sequence.test.js +37 -49
- package/dist/test/suites/main/context-menu.test.js +51 -50
- package/dist/test/suites/main/context.test.js +25 -25
- package/dist/test/suites/main/deep-link.test.js +74 -74
- package/dist/test/suites/main/fontawesome.test.js +27 -27
- package/dist/test/suites/main/ipc.test.js +35 -35
- package/dist/test/suites/main/menu.test.js +101 -100
- package/dist/test/suites/main/protocol.test.js +19 -19
- package/dist/test/suites/main/remote-config.test.js +63 -63
- package/dist/test/suites/main/remote-scripts.test.js +103 -103
- package/dist/test/suites/main/request.test.js +71 -0
- package/dist/test/suites/main/restart-manager.test.js +33 -33
- package/dist/test/suites/main/startup-paths-and-ua.test.js +4 -4
- package/dist/test/suites/main/startup.test.js +26 -26
- package/dist/test/suites/main/stealth-window.test.js +1 -1
- package/dist/test/suites/main/storage.test.js +25 -25
- package/dist/test/suites/main/theme.test.js +34 -34
- package/dist/test/suites/main/tray.test.js +79 -79
- package/dist/test/suites/main/url-helpers.test.js +133 -133
- package/dist/test/suites/main/usage.test.js +25 -25
- package/dist/test/suites/main/window-bounds.test.js +27 -27
- package/dist/test/suites/main/window-manager.test.js +44 -44
- package/dist/test/suites/renderer/analytics-bridge.test.js +5 -5
- package/dist/test/suites/renderer/cross-context-helpers.test.js +37 -31
- package/dist/test/suites/renderer/round-trip.test.js +3 -3
- package/dist/test/suites/renderer/tooltips.test.js +15 -15
- package/dist/test/suites/renderer/{window-em-surface.test.js → window-desktop-surface.test.js} +27 -7
- package/dist/test/utils/extended-mode-warning.js +1 -1
- package/dist/utils/boot-harness.js +56 -0
- package/dist/utils/mode-helpers.js +2 -15
- package/dist/utils/ship-keys.js +3 -3
- package/dist/utils/signing-status.js +51 -0
- package/dist/utils/test-events.js +7 -0
- package/dist/utils/test-stealth.js +6 -6
- package/dist/utils/url-helpers.js +52 -42
- package/dist/utils/user-agent.js +44 -0
- package/dist/vendor/account/engine.js +3 -3
- package/dist/vendor/account/index.js +14 -45
- package/dist/vendor/account/resolve-account.js +44 -0
- package/dist/vendor/account/schema.js +1 -1
- package/dist/vendor/account/user.js +99 -0
- package/dist/vendor/config/client-config.js +1 -1
- package/dist/vendor/config/environment.js +11 -30
- package/dist/vendor/config/index.js +8 -11
- package/dist/vendor/config/load.js +1 -2
- package/dist/vendor/config/platforms.js +1 -1
- package/dist/vendor/config/retired-keys.js +2 -2
- package/dist/vendor/config/schema.js +5 -8
- package/dist/vendor/config/site-global.js +2 -3
- package/dist/vendor/config/validate.js +1 -2
- package/dist/vendor/config/winback.js +1 -1
- package/dist/vendor/devkit/actions-secrets.js +1 -1
- package/dist/vendor/devkit/attach-log-file.js +1 -1
- package/dist/vendor/devkit/build-json.js +1 -1
- package/dist/vendor/devkit/cli-router.js +3 -4
- package/dist/vendor/devkit/defaults-engine.js +9 -11
- package/dist/vendor/devkit/local.js +2 -0
- package/dist/vendor/devkit/merge-line-files.js +2 -3
- package/dist/vendor/devkit/test/runner-core.js +6 -6
- package/dist/vendor/monitoring/env.js +2 -2
- package/dist/vendor/monitoring/index.js +1 -1
- package/dist/vendor/monitoring/main.js +1 -1
- package/dist/vendor/monitoring/preload.js +1 -1
- package/dist/vendor/monitoring/renderer.js +1 -1
- package/docs/analytics.md +8 -8
- package/docs/app-state.md +19 -19
- package/docs/audit.md +4 -4
- package/docs/{client-bridge.md → auth.md} +88 -73
- package/docs/auto-updater.md +8 -8
- package/docs/boot-sequence.md +11 -6
- package/docs/build-system.md +1 -1
- package/docs/cdp-debugging.md +1 -1
- package/docs/common-mistakes.md +7 -7
- package/docs/config-schema.md +1 -1
- package/docs/context-menu.md +13 -13
- package/docs/context.md +11 -11
- package/docs/css.md +3 -9
- package/docs/deep-link.md +25 -25
- package/docs/environment-detection.md +16 -16
- package/docs/fontawesome.md +7 -5
- package/docs/hooks.md +8 -8
- package/docs/index.md +38 -27
- package/docs/ipc.md +10 -10
- package/docs/lib-modules.md +9 -9
- package/docs/logging.md +12 -14
- package/docs/menu.md +18 -18
- package/docs/remote-config.md +9 -9
- package/docs/remote-scripts.md +12 -12
- package/docs/restart-manager.md +8 -8
- package/docs/sentry.md +4 -4
- package/docs/shared/analytics.md +1 -1
- package/docs/shared/breaking-changes.md +79 -13
- package/docs/shared/config.md +17 -21
- package/docs/shared/logging.md +1 -1
- package/docs/shared/monitoring.md +5 -5
- package/docs/shared/testing.md +2 -2
- package/docs/shared/theming.md +1 -1
- package/docs/shared/translation.md +19 -10
- package/docs/startup.md +16 -16
- package/docs/storage.md +11 -11
- package/docs/templating.md +3 -3
- package/docs/test-boot-layer.md +12 -12
- package/docs/test-framework.md +17 -17
- package/docs/themes.md +7 -7
- package/docs/tooltips.md +2 -2
- package/docs/tray.md +31 -31
- package/docs/usage.md +7 -7
- package/docs/verts.md +1 -1
- package/docs/windows.md +22 -22
- package/package.json +3 -4
- package/dist/lib/client-bridge.js +0 -374
- package/dist/lib/logger.js +0 -4
- package/dist/test/suites/build/manager.test.js +0 -213
- package/dist/test/suites/main/client-bridge.test.js +0 -262
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
// applyDefaults(config) — the shared OMEGA defaults-scaffolding engine.
|
|
2
2
|
//
|
|
3
3
|
// Every framework ships a defaults tree (src/defaults/ → dist/defaults/) that
|
|
4
|
-
// setup copies into the consumer project.
|
|
5
|
-
//
|
|
6
|
-
// copyDefaults; UJM carries a third copy of the BXM shape). This is the single
|
|
7
|
-
// plain-fs engine, a normalized superset of both.
|
|
4
|
+
// setup copies into the consumer project. This is the single plain-fs engine
|
|
5
|
+
// every framework's scaffold runs.
|
|
8
6
|
//
|
|
9
7
|
// File-map rules: minimatch patterns (dot:true) matched against the RAW path
|
|
10
8
|
// relative to defaultsDir, last-match-wins option merging. Per-rule options:
|
|
@@ -28,7 +26,7 @@
|
|
|
28
26
|
// Engine built-ins (not expressed in the file map):
|
|
29
27
|
// - `_.name` segments lose the leading `_` (dotfiles ship past npm's filter)
|
|
30
28
|
// - non-final segments starting `_` (but not `_.`) are ARCHIVE dirs — skipped
|
|
31
|
-
// (reference material that ships in the framework package, e.g.
|
|
29
|
+
// (reference material that ships in the framework package, e.g. desktop's `_mas/`)
|
|
32
30
|
// - `.gitkeep` creates the destination directory, the file itself never copies
|
|
33
31
|
// - `.DS_Store` never copies
|
|
34
32
|
// - text writes are skipped when the destination is byte-identical (idempotent
|
|
@@ -46,7 +44,7 @@ const { minimatch } = require('minimatch');
|
|
|
46
44
|
const { mergeLineBasedFiles, hasSectionMarkers, getCustomSection } = require('./merge-line-files');
|
|
47
45
|
|
|
48
46
|
// Files with these extensions copy byte-for-byte and never go through
|
|
49
|
-
// template/merge/transform
|
|
47
|
+
// template/merge/transform.
|
|
50
48
|
const BINARY_EXTENSIONS = /\.(jpg|jpeg|png|gif|webp|svg|ico|woff|woff2|ttf|otf|eot|pdf|zip|tar|gz|mp3|mp4|avi|mov)$/i;
|
|
51
49
|
|
|
52
50
|
const RULE_DEFAULTS = {
|
|
@@ -70,7 +68,7 @@ const RULE_DEFAULTS = {
|
|
|
70
68
|
* @param {Object<string, object>} [config.fileMap] - minimatch pattern → rule options (see header)
|
|
71
69
|
* @param {string[]} [config.files] - Only process these absolute source paths (watch single-file mode)
|
|
72
70
|
* @param {Function} [config.transform] - `(contents, item) => contents` global hook, run on every
|
|
73
|
-
* non-binary file after per-rule processing (
|
|
71
|
+
* non-binary file after per-rule processing (e.g. extension's site-token templating pass)
|
|
74
72
|
* @param {object} [config.logger] - `{ log, warn, error }` (defaults to console)
|
|
75
73
|
* @returns {{ written: string[], merged: string[], skipped: string[], removed: string[] }} destination-relative paths per outcome
|
|
76
74
|
*/
|
|
@@ -202,7 +200,7 @@ function applyDefaults(config) {
|
|
|
202
200
|
let didMerge = false;
|
|
203
201
|
|
|
204
202
|
// Per-rule template render happens BEFORE merging, so merges compare
|
|
205
|
-
// rendered framework defaults against the consumer's file
|
|
203
|
+
// rendered framework defaults against the consumer's file.
|
|
206
204
|
if (options.template) {
|
|
207
205
|
contents = renderTemplate(contents, options.template);
|
|
208
206
|
}
|
|
@@ -309,7 +307,7 @@ function strippedSegments(segments) {
|
|
|
309
307
|
return segments.map((s) => (s.startsWith('_.') ? s.slice(1) : s));
|
|
310
308
|
}
|
|
311
309
|
|
|
312
|
-
// Last-match-wins option resolution across the file map
|
|
310
|
+
// Last-match-wins option resolution across the file map.
|
|
313
311
|
function resolveOptions(relativePath, fileMap) {
|
|
314
312
|
let options = { ...RULE_DEFAULTS };
|
|
315
313
|
|
|
@@ -323,7 +321,7 @@ function resolveOptions(relativePath, fileMap) {
|
|
|
323
321
|
return options;
|
|
324
322
|
}
|
|
325
323
|
|
|
326
|
-
// Minimal `{{ key.path }}` substitution
|
|
324
|
+
// Minimal `{{ key.path }}` substitution, tolerant of unknown keys.
|
|
327
325
|
// Unknown keys render as the original `{{ ... }}` string, so non-template content
|
|
328
326
|
// with literal braces (e.g. GitHub Actions `${{ secrets.X }}`) survives.
|
|
329
327
|
function renderTemplate(content, context) {
|
|
@@ -334,7 +332,7 @@ function renderTemplate(content, context) {
|
|
|
334
332
|
});
|
|
335
333
|
}
|
|
336
334
|
|
|
337
|
-
// JSON5 defaults merge
|
|
335
|
+
// JSON5 defaults merge: framework defaults provide shape and
|
|
338
336
|
// order; the consumer's values win unless they're the literal string 'default';
|
|
339
337
|
// consumer-only keys survive at every nesting level, EXCEPT one holding the
|
|
340
338
|
// 'default' sentinel, which is the framework's own unset marker and drops (#926).
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Merge line-based files (.env, .gitignore, AGENTS.md) during framework setup —
|
|
2
|
-
// the OMEGA marker-section protocol.
|
|
3
|
-
//
|
|
4
|
-
// BXM/UJM inline copies) plus @omega.js/backend's custom-key promotion (a key the framework
|
|
2
|
+
// the OMEGA marker-section protocol: .env double-quote normalization,
|
|
3
|
+
// order-safe key substitution, and custom-key promotion (a key the framework
|
|
5
4
|
// newly adopts into its Default section is promoted UP from the user's Custom
|
|
6
5
|
// section with their value, instead of appearing empty in Default and set in
|
|
7
6
|
// Custom).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Shared test-runner core for the OMEGA frameworks — discovery, suite/group/standalone
|
|
2
|
-
// execution, filtering, skip semantics, init hooks, and reporting
|
|
3
|
-
//
|
|
4
|
-
//
|
|
2
|
+
// execution, filtering, skip semantics, init hooks, and reporting, on the 3-layer
|
|
3
|
+
// build/page/boot model. The frameworks differ only in title, package name, CLI
|
|
4
|
+
// target alias, and their special layers — all injected via config.
|
|
5
5
|
//
|
|
6
6
|
// Test-definition forms supported (see each framework's test/index.js for docs):
|
|
7
7
|
// - Standalone: module.exports = { layer, description, run, cleanup, timeout, skip };
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// Suites stop on first failure (sequential, share state). Groups run all tests regardless.
|
|
13
13
|
//
|
|
14
14
|
// createRunner(config) config surface:
|
|
15
|
-
// title — heading printed at the top of a run ('
|
|
15
|
+
// title — heading printed at the top of a run ('OMEGA Extension Tests')
|
|
16
16
|
// packageName — framework npm name; cwd package === this ⇒ framework self-test mode
|
|
17
17
|
// (framework boot/ suites only run in self-test mode — they assert on
|
|
18
18
|
// the framework's own fixture consumer)
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
// options, results, projectRoot }) => void }]
|
|
29
29
|
// The callback owns runner loading, skip messaging, and results
|
|
30
30
|
// mutation — framework glue stays framework-side.
|
|
31
|
-
// bootDefaultTimeout — per-test default for boot-layer inspect() (
|
|
31
|
+
// bootDefaultTimeout — per-test default for boot-layer inspect() (each framework's runner sets its own)
|
|
32
32
|
// boot: { run: async ({ tests, suites, options, results, projectRoot }) => void }
|
|
33
33
|
// Called with the aggregated flat boot test list plus the boot-BOUND
|
|
34
34
|
// suites (at least one of the two is non-empty).
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
// partitions that FILE into the boot layer whatever its `layer` says,
|
|
38
38
|
// and hands it to boot.run WHOLE (`suites: [{ file, mod }]`) instead
|
|
39
39
|
// of flattening it into the inspect list: for suites that need the
|
|
40
|
-
// boot lane's built app but run their own way (
|
|
40
|
+
// boot lane's built app but run their own way (desktop's `view:` renderer
|
|
41
41
|
// suites). Default: () => false. An array-form file is never bound.
|
|
42
42
|
|
|
43
43
|
const path = require('path');
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* signal with its own opinion: a build-mode run of a development artifact
|
|
22
22
|
* reported as production, and a packaged production app whose lane did not
|
|
23
23
|
* carry the flag reported as development. @omega.js/backend still passes its
|
|
24
|
-
* own answer in (`
|
|
24
|
+
* own answer in (`omega.isProduction()`), and a boolean a host supplies
|
|
25
25
|
* always wins.
|
|
26
26
|
*/
|
|
27
27
|
|
|
@@ -30,7 +30,7 @@ const { isProduction } = require('../config/environment.js');
|
|
|
30
30
|
/**
|
|
31
31
|
* Read the environment gates for core.resolveConfig().
|
|
32
32
|
* @param {object} [host] - the host's own signals, and the context the one
|
|
33
|
-
* environment is read off (
|
|
33
|
+
* environment is read off (an Omega instance carrying the baked `config`)
|
|
34
34
|
* @param {boolean} [host.isProduction] - overrides the one environment's answer
|
|
35
35
|
* @param {boolean} [host.allowInDev] - the host's own dev opt-in (e.g. @omega.js/backend's `reportErrorsInDev`)
|
|
36
36
|
* @returns {{ killed: boolean, killedReason: string|null, isProduction: boolean, allowInDev: boolean }}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The @omega.js/monitoring entry — the Electron context-aware delegator (#380).
|
|
3
|
-
* Lifted from @omega.js/desktop's lib/sentry/index.js: a desktop
|
|
3
|
+
* Lifted from @omega.js/desktop's lib/sentry/index.js: a desktop Omega instance
|
|
4
4
|
* singleton requires this file from whichever process it is in, and every call
|
|
5
5
|
* forwards to the right per-context module.
|
|
6
6
|
*
|
|
@@ -18,7 +18,7 @@ const preload = {
|
|
|
18
18
|
_enabled: false,
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* @param {object} host - the desktop
|
|
21
|
+
* @param {object} host - the desktop Omega instance: { config }
|
|
22
22
|
*/
|
|
23
23
|
initialize(host) {
|
|
24
24
|
const { shouldEnable, reason } = resolveConfig(host && host.config && host.config.monitoring, readGates(host));
|
|
@@ -21,7 +21,7 @@ const renderer = {
|
|
|
21
21
|
_Sentry: null,
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* @param {object} host - the desktop
|
|
24
|
+
* @param {object} host - the desktop Omega instance: { config, getVersion() }
|
|
25
25
|
*/
|
|
26
26
|
initialize(host) {
|
|
27
27
|
renderer._initialized = true;
|
package/docs/analytics.md
CHANGED
|
@@ -51,11 +51,11 @@ The `bundle` task's esbuild `define` bakes `process.env.GOOGLE_ANALYTICS_SECRET`
|
|
|
51
51
|
## API
|
|
52
52
|
|
|
53
53
|
```js
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
omega.analytics.event('button_click', { button_id: 'cta' });
|
|
55
|
+
omega.analytics.pageview('/settings');
|
|
56
|
+
omega.analytics.screenview('SettingsScreen');
|
|
57
|
+
omega.analytics.setUserProperties({ plan: 'premium', trial: false });
|
|
58
|
+
omega.analytics.setUserId('firebase-uid-abc'); // usually wired automatically
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
Same surface in renderer:
|
|
@@ -71,10 +71,10 @@ The renderer surface is fire-and-forget IPC (`ipcRenderer.send`) for events; onl
|
|
|
71
71
|
|
|
72
72
|
## The renderer NEVER sends — it forwards ([#411](https://github.com/Omega-JS-Stack/omega/issues/411))
|
|
73
73
|
|
|
74
|
-
A renderer's own `omega.analytics
|
|
74
|
+
A renderer's own `omega.analytics.event(...)` (the embedded @omega.js/client, the surface a vert click or a permission prompt fires through) routes to the bridge above and is delivered by the MAIN process's sender. There is exactly one sender per install:
|
|
75
75
|
|
|
76
76
|
```
|
|
77
|
-
renderer: omega.analytics
|
|
77
|
+
renderer: omega.analytics.event('vert_click', { … })
|
|
78
78
|
→ @omega.js/client reads config.analyticsBridge (src/renderer.js injects the
|
|
79
79
|
preload's window.desktop.analytics when it boots the client)
|
|
80
80
|
→ ipcRenderer.send('desktop:analytics:event', { name, params })
|
|
@@ -136,5 +136,5 @@ free-typed string here.
|
|
|
136
136
|
## Tests
|
|
137
137
|
|
|
138
138
|
- `src/test/suites/main/analytics.test.js` — disabled paths, uuidv5 stability, the catalog contract (canonical name in, GA4 descriptor out; unknown names never post), queueing, auth-bridge wiring, IPC handlers, secret-not-leaked guard.
|
|
139
|
-
- `src/test/suites/renderer/analytics-bridge.test.js
|
|
139
|
+
- `src/test/suites/renderer/analytics-bridge.test.js`: renderer-side surface shape, `getStatus` round-trip, and the #411 pin: a renderer-originated `omega.analytics.event(...)` reaches main's sender exactly once, and the payload GA would receive carries main's `client_id` and main's session id, while the bridged client holds no secret and no device id of its own (the harness hands it credentials on purpose). The harness taps main's transport (`harness/main-entry.js`) so a renderer suite can read back what the sender was handed: a test run never reaches a real GA property. Harness fidelity, stated plainly: it drives the real client and the real IPC channel into the real main-process sender, but the client runs in the preload world holding the bridge object directly, not the contextBridge proxy a page bundle gets, the proxy hop is the one link this pin does not exercise.
|
|
140
140
|
- `packages/client/test/analytics.test.js` — the client half: the bridge is the injected config value alone (a planted `window.desktop` bridges nothing), a bridged client drops credentials and mints no device id, an uncatalogued name never leaves the renderer, and a forward that throws never reaches the caller.
|
package/docs/app-state.md
CHANGED
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
Storage-backed launch flags + crash sentinel. Tells you *whether* this is the first launch ever, *how many* times the app has launched, *whether* the previous run crashed, and *whether* the version changed.
|
|
4
4
|
|
|
5
|
-
## Public API on `
|
|
5
|
+
## Public API on `omega.appState`
|
|
6
6
|
|
|
7
7
|
```js
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
omega.appState.isFirstLaunch() // boolean: true ONLY on the very first boot
|
|
9
|
+
omega.appState.getLaunchCount() // number: total successful launches (including this one)
|
|
10
|
+
omega.appState.getInstalledAt() // Date: first ever launch timestamp
|
|
11
|
+
omega.appState.getLastLaunchAt() // Date | null: previous launch (null on first)
|
|
12
|
+
omega.appState.getLastQuitAt() // Date | null: previous graceful quit; null if it crashed
|
|
13
|
+
omega.appState.recoveredFromCrash() // boolean: previous run did not exit cleanly
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
omega.appState.getVersion() // string | null: package version of this launch
|
|
16
|
+
omega.appState.getPreviousVersion() // string | null: version before this launch
|
|
17
|
+
omega.appState.wasUpgraded() // boolean: true if THIS launch's version differs from the prior
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
omega.appState.launchedAtLogin() // boolean: OS booted us via openAtLogin
|
|
20
|
+
omega.appState.launchedFromDeepLink() // boolean: argv had a deep-link payload (set by lib/deep-link)
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
omega.appState.reset() // wipe persisted state (test helper / factory-reset command)
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## Storage shape (key `appState`)
|
|
@@ -66,24 +66,24 @@ appState.getPreviousVersion() // '1.0.0' (preserved — useful for "what's new"
|
|
|
66
66
|
### Show onboarding on first launch
|
|
67
67
|
|
|
68
68
|
```js
|
|
69
|
-
if (
|
|
70
|
-
|
|
69
|
+
if (omega.appState.isFirstLaunch()) {
|
|
70
|
+
omega.windows.show('onboarding');
|
|
71
71
|
}
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
### Crash report ping
|
|
75
75
|
|
|
76
76
|
```js
|
|
77
|
-
if (
|
|
78
|
-
|
|
77
|
+
if (omega.appState.recoveredFromCrash()) {
|
|
78
|
+
omega.sentry.captureMessage('recovered from crash', 'warning');
|
|
79
79
|
}
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
### What's new modal after upgrade
|
|
83
83
|
|
|
84
84
|
```js
|
|
85
|
-
if (
|
|
86
|
-
|
|
85
|
+
if (omega.appState.wasUpgraded()) {
|
|
86
|
+
omega.windows.show('changelog');
|
|
87
87
|
}
|
|
88
88
|
```
|
|
89
89
|
|
package/docs/audit.md
CHANGED
|
@@ -24,10 +24,10 @@ Mirrored across all four OMEGA frameworks (UJM / @omega.js/backend / BXM / @omeg
|
|
|
24
24
|
|----|-----|-------|-------|
|
|
25
25
|
| U-01 | HIGH | B | Every feature has tests at EVERY layer it surfaces (build / main / renderer / boot) — never mocked, real harness only ([test-framework.md](test-framework.md)) |
|
|
26
26
|
| U-02 | HIGH | B | Test hygiene — real-external-API tests gated behind `TEST_EXTENDED_MODE` in-source (not mocked); no tests that assert nothing ([test-framework.md](test-framework.md)) |
|
|
27
|
-
| U-03 | CRIT | B | XSS
|
|
28
|
-
| U-04 | HIGH | B | @omega.js/client owns Firebase
|
|
27
|
+
| U-03 | CRIT | B | XSS: renderer DOM sinks escape untrusted values inline via `omega.utilities.escapeHTML(value)` (+ `sanitizeURL` for URL sinks); zero local escape helpers (rules mirror @omega.js/web and @omega.js/extension `docs/xss-prevention.md`; see also DSK-01 for navigation sinks) |
|
|
28
|
+
| U-04 | HIGH | B | @omega.js/client owns Firebase: never `require('firebase')`; renderers use `omega.auth` / `omega.firestore`, main uses `omega.auth` ([common-mistakes.md](common-mistakes.md), [auth.md](auth.md)) |
|
|
29
29
|
| U-05 | HIGH | C | No @omega.js/desktop transitive deps installed in the consumer `package.json` (`firebase`, `@omega.js/client`, `fs-jetpack`, …) — the bundle task's framework-deps hook resolves them ([common-mistakes.md](common-mistakes.md)) |
|
|
30
|
-
| U-06 | HIGH | B | Env behavior gated on the INTENTIONAL check
|
|
30
|
+
| U-06 | HIGH | B | Env behavior gated on the INTENTIONAL check: `isProduction()` or `isDevelopment() \|\| isTesting()`, never `!isDevelopment()`; no ad-hoc `process.env` reads where a helper exists ([environment-detection.md](environment-detection.md)) |
|
|
31
31
|
| U-07 | HIGH | B | Config canon — `config/omega.json5` validates against the schema (boot validator green); canonical cross-framework blocks (`brand`, `app`, `cloud.{provider,config}`, `monitoring`, `analytics`, `payment`) not reinvented ([config-schema.md](config-schema.md)) |
|
|
32
32
|
| U-08 | CRIT | B | No private credentials committed — signing certs (`config/certs/` gitignored), `.env` secrets, tokens, API secret keys ([signing.md](signing.md)). (The Firebase WEB `apiKey` is public by design — do NOT flag it.) |
|
|
33
33
|
| U-09 | HIGH | B | Source discipline — nothing edited in `dist/` or generated files (`dist/electron-builder.yml`, entitlements plist); no live code referencing `_legacy/` / `_backup/` ([build-system.md](build-system.md), [common-mistakes.md](common-mistakes.md)) |
|
|
@@ -44,7 +44,7 @@ Mirrored across all four OMEGA frameworks (UJM / @omega.js/backend / BXM / @omeg
|
|
|
44
44
|
| DSK-01 | CRIT | B | Zero-trust URLs — every DYNAMIC URL is gated through `sanitize-url.js` before `shell.openExternal` / `BrowserWindow.loadURL` / `window.location.href =` (hardcoded internal-scheme URLs bypass) ([the framework guide](../../../docs/desktop/index.md) §File Conventions, [common-mistakes.md](common-mistakes.md)) |
|
|
45
45
|
| DSK-02 | HIGH | B | Path resolution — `app.getAppPath()` / `utils/app-root.js`, never `process.cwd()`, in runtime code (it's `/` in packaged apps) ([common-mistakes.md](common-mistakes.md)) |
|
|
46
46
|
| DSK-03 | HIGH | C | Windows — every `windows.create()` is `await`ed; the `main` window is ALWAYS created (even hidden launches, with `show: false`) so activate/second-instance can surface UI ([windows.md](windows.md), [common-mistakes.md](common-mistakes.md)) |
|
|
47
|
-
| DSK-04 | HIGH | B | Zero-trust IPC
|
|
47
|
+
| DSK-04 | HIGH | B | Zero-trust IPC: all channels go through `omega.ipc` (never raw `ipcMain`); handlers validate payload content before acting, especially in apps embedding remote web content ([ipc.md](ipc.md#zero-trust-payloads)) |
|
|
48
48
|
| DSK-05 | MED | C | Icons — one native-size PNG per slot (no `@2x` siblings), macOS tray source named `tray.png` (@omega.js/desktop owns the `Template` rename), no `app.icons` config block ([icons.md](icons.md)) |
|
|
49
49
|
| DSK-06 | HIGH | C | File-based integrations — tray/menu/context-menu logic lives in `src/integrations/<name>/index.js`, never expressed in config JSON ([tray.md](tray.md), [menu.md](menu.md), [context-menu.md](context-menu.md)) |
|
|
50
50
|
| DSK-07 | HIGH | B | Presence-driven feature flags — credentials enable features (`monitoring.providers.sentry.dsn`, `analytics.providers.google.id`, `cloud.config`); no invented `enabled:` toggles ([config-schema.md](config-schema.md)) |
|