@omega.js/desktop 0.51.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 +18 -13
- 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 +145 -48
- 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/.github/workflows/build.yml +2 -0
- 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/runner/job-started.js +1 -1
- 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 +612 -5
- 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 +13 -12
- package/dist/vendor/config/load.js +1 -2
- package/dist/vendor/config/platforms.js +1 -1
- package/dist/vendor/config/repo.js +24 -0
- 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/brand-version.js +162 -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/deploy.js +64 -4
- package/dist/vendor/devkit/git-remote.js +78 -1
- package/dist/vendor/devkit/local.js +53 -3
- package/dist/vendor/devkit/lockfile.js +127 -0
- package/dist/vendor/devkit/merge-line-files.js +2 -3
- package/dist/vendor/devkit/pack-local.js +4 -7
- package/dist/vendor/devkit/preludes/origin-heal.js +35 -49
- package/dist/vendor/devkit/target-secrets.js +34 -45
- 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 +39 -28
- 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/releasing.md +4 -2
- package/docs/remote-config.md +9 -9
- package/docs/remote-scripts.md +12 -12
- package/docs/restart-manager.md +8 -8
- package/docs/runner.md +12 -10
- package/docs/sentry.md +4 -4
- package/docs/shared/analytics.md +1 -1
- package/docs/shared/brands.md +1 -1
- package/docs/shared/breaking-changes.md +79 -13
- package/docs/shared/config.md +24 -21
- package/docs/shared/deploys.md +30 -7
- package/docs/shared/local-dev.md +5 -3
- 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/signing.md +1 -1
- 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,8 +1,8 @@
|
|
|
1
|
-
// Boot-layer self-test — @omega.js/desktop's analog of "does the extension load?"
|
|
2
|
-
// site boot?"
|
|
1
|
+
// Boot-layer self-test — @omega.js/desktop's analog of "does the extension load?" /
|
|
2
|
+
// "does the site boot?". The boot runner esbuild-builds the bundled fixture consumer
|
|
3
3
|
// (src/test/fixtures/consumer-app) into a real main.bundle.js, spawns Electron with
|
|
4
4
|
// it (the actual production boot path — bundled, not the unbundled lib code that the
|
|
5
|
-
// `main` layer exercises), then runs these inspects against the live
|
|
5
|
+
// `main` layer exercises), then runs these inspects against the live omega instance.
|
|
6
6
|
//
|
|
7
7
|
// In @omega.js/desktop's own test run, OMEGA_TEST_BOOT_PROJECT points at the fixture (auto-set in
|
|
8
8
|
// src/commands/test.js when the cwd is the @omega.js/desktop repo). In a real consumer's
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// boot tests under <cwd>/test/boot/.
|
|
12
12
|
//
|
|
13
13
|
// NOTE: inspect bodies are serialized to the spawned Electron process — no closures over
|
|
14
|
-
// module scope. `require`, `process`, and `Buffer` are injected; {
|
|
14
|
+
// module scope. `require`, `process`, and `Buffer` are injected; { omega, expect,
|
|
15
15
|
// projectRoot, appRoot, frameworkDistRoot, distSnapshotBefore } is the inspect argument
|
|
16
16
|
// (projectRoot = the fixture root; appRoot = the staged target root holding the build).
|
|
17
17
|
|
|
@@ -24,25 +24,25 @@ module.exports = defineCases({
|
|
|
24
24
|
timeout: 30000,
|
|
25
25
|
tests: [
|
|
26
26
|
{
|
|
27
|
-
description: '
|
|
28
|
-
inspect: async ({
|
|
29
|
-
expect(
|
|
30
|
-
expect(
|
|
31
|
-
for (const lib of ['storage', 'ipc', 'windows', 'tray', 'menu', 'contextMenu', '
|
|
32
|
-
expect(Boolean(
|
|
27
|
+
description: 'omega initialized with all core libs wired',
|
|
28
|
+
inspect: async ({ omega, expect }) => {
|
|
29
|
+
expect(omega).toBeTruthy();
|
|
30
|
+
expect(omega._initialized).toBe(true);
|
|
31
|
+
for (const lib of ['storage', 'ipc', 'windows', 'tray', 'menu', 'contextMenu', 'auth']) {
|
|
32
|
+
expect(Boolean(omega[lib])).toBe(true);
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
|
|
37
37
|
{
|
|
38
38
|
description: 'the fixture main.js created the main window and loaded the built view',
|
|
39
|
-
inspect: async ({
|
|
39
|
+
inspect: async ({ omega, expect }) => {
|
|
40
40
|
const { BrowserWindow } = require('electron');
|
|
41
41
|
|
|
42
42
|
// windows.create() runs inside the consumer's initialize().then(); poll for it.
|
|
43
43
|
let url = '';
|
|
44
44
|
for (let i = 0; i < 40; i++) {
|
|
45
|
-
const win =
|
|
45
|
+
const win = omega.windows.get('main') || BrowserWindow.getAllWindows()[0];
|
|
46
46
|
if (win && !win.isDestroyed()) {
|
|
47
47
|
url = win.webContents.getURL();
|
|
48
48
|
if (url.includes('/views/main/')) break;
|
|
@@ -50,23 +50,23 @@ module.exports = defineCases({
|
|
|
50
50
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
expect(Boolean(
|
|
53
|
+
expect(Boolean(omega.windows.get('main'))).toBe(true);
|
|
54
54
|
expect(url.includes('/views/main/')).toBe(true);
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
57
|
|
|
58
58
|
{
|
|
59
59
|
description: 'test stealth: app activation suppressed — dock hidden (macOS)',
|
|
60
|
-
inspect: async ({
|
|
60
|
+
inspect: async ({ omega, expect }) => {
|
|
61
61
|
if (process.platform !== 'darwin') {
|
|
62
62
|
return; // accessory activation policy / dock is macOS-only
|
|
63
63
|
}
|
|
64
|
-
//
|
|
64
|
+
// omega.initialize step 1a hides the dock under the stealth predicate,
|
|
65
65
|
// so the spawned consumer app never activates and never steals keyboard
|
|
66
66
|
// focus from the developer's editor.
|
|
67
67
|
const { app } = require('electron');
|
|
68
68
|
expect(app.dock.isVisible()).toBe(false);
|
|
69
|
-
expect(
|
|
69
|
+
expect(omega.isTesting()).toBe(true);
|
|
70
70
|
},
|
|
71
71
|
},
|
|
72
72
|
|
|
@@ -83,8 +83,8 @@ module.exports = defineCases({
|
|
|
83
83
|
{
|
|
84
84
|
// #111 — the fixture's renderer entry imports the vendored app-shell
|
|
85
85
|
// module through the `__main_assets__` alias. Its declarative contract
|
|
86
|
-
// showing up in the built bundle proves the
|
|
87
|
-
// @omega.js/desktop's vendored dist asset
|
|
86
|
+
// showing up in the built bundle proves the chain: esbuild alias →
|
|
87
|
+
// @omega.js/desktop's vendored dist asset.
|
|
88
88
|
description: 'renderer bundle carries the vendored app-shell module via __main_assets__',
|
|
89
89
|
inspect: async ({ expect, appRoot }) => {
|
|
90
90
|
const fs = require('fs');
|
|
@@ -105,12 +105,12 @@ module.exports = defineCases({
|
|
|
105
105
|
// line the bridge logs next is out of reach here, because the fixture's
|
|
106
106
|
// `cloud.config` is empty and this boot never initializes Firebase auth.)
|
|
107
107
|
description: 'the booted app runs in the lane environment, not the one baked into its bundle (#925)',
|
|
108
|
-
inspect: async ({
|
|
108
|
+
inspect: async ({ omega, expect, projectRoot }) => {
|
|
109
109
|
const fs = require('fs');
|
|
110
110
|
const path = require('path');
|
|
111
111
|
|
|
112
|
-
expect(
|
|
113
|
-
expect(
|
|
112
|
+
expect(omega.isTesting()).toBe(true);
|
|
113
|
+
expect(omega.config.environment).toBe('production'); // the artifact IS a production build
|
|
114
114
|
|
|
115
115
|
const log = fs.readFileSync(path.join(projectRoot, 'logs', 'runtime.log'), 'utf8');
|
|
116
116
|
expect(log.includes('auth persistence: none (test mode)')).toBe(true);
|
|
@@ -118,11 +118,11 @@ module.exports = defineCases({
|
|
|
118
118
|
},
|
|
119
119
|
|
|
120
120
|
{
|
|
121
|
-
// #925: a page has no `process`, so its
|
|
121
|
+
// #925: a page has no `process`, so its instance reads the baked word. The
|
|
122
122
|
// preload hands the running one over on `window.desktop`, and the renderer
|
|
123
123
|
// bootstrap applies it, so this window answers what main answers.
|
|
124
124
|
description: 'the main window renderer answers the lane environment too (#925)',
|
|
125
|
-
inspect: async ({
|
|
125
|
+
inspect: async ({ omega, expect }) => {
|
|
126
126
|
const { BrowserWindow } = require('electron');
|
|
127
127
|
|
|
128
128
|
// The window is created in the consumer's initialize().then(), and its
|
|
@@ -131,10 +131,10 @@ module.exports = defineCases({
|
|
|
131
131
|
let answer = null;
|
|
132
132
|
let win = null;
|
|
133
133
|
for (let i = 0; i < 40; i++) {
|
|
134
|
-
win =
|
|
134
|
+
win = omega.windows.get('main') || BrowserWindow.getAllWindows()[0];
|
|
135
135
|
if (win && !win.isDestroyed() && !win.webContents.isLoading()) {
|
|
136
136
|
answer = await win.webContents.executeJavaScript(
|
|
137
|
-
'window.
|
|
137
|
+
'window.__omegaInstance && window.__omegaInstance.config.environment ? window.__omegaInstance.getEnvironment() : null',
|
|
138
138
|
);
|
|
139
139
|
if (answer) break;
|
|
140
140
|
}
|
|
@@ -146,7 +146,38 @@ module.exports = defineCases({
|
|
|
146
146
|
|
|
147
147
|
expect(baked).toBe('production'); // what the build baked
|
|
148
148
|
expect(bridged).toBe('testing'); // what the preload read off the lane
|
|
149
|
-
expect(answer).toBe('testing'); // what the renderer's
|
|
149
|
+
expect(answer).toBe('testing'); // what the renderer's instance answers
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
{
|
|
154
|
+
// The renderer builds `omega.shell` from ITSELF with the vendored app
|
|
155
|
+
// shell's createShell(omega), exactly as web builds it; the fixture binds
|
|
156
|
+
// the same export through the `__main_assets__` alias (#111).
|
|
157
|
+
description: 'the main window renderer carries omega.shell, built by createShell(omega)',
|
|
158
|
+
inspect: async ({ omega, expect }) => {
|
|
159
|
+
const { BrowserWindow } = require('electron');
|
|
160
|
+
|
|
161
|
+
let probe = null;
|
|
162
|
+
for (let i = 0; i < 40; i++) {
|
|
163
|
+
const win = omega.windows.get('main') || BrowserWindow.getAllWindows()[0];
|
|
164
|
+
if (win && !win.isDestroyed() && !win.webContents.isLoading()) {
|
|
165
|
+
probe = await win.webContents.executeJavaScript(`(() => {
|
|
166
|
+
const instance = window.__omegaInstance;
|
|
167
|
+
if (!instance || !instance.shell) return null;
|
|
168
|
+
return {
|
|
169
|
+
createShell: typeof window.__omegaCreateShell,
|
|
170
|
+
isCollapsed: typeof instance.shell.isCollapsed,
|
|
171
|
+
toggleOpen: typeof instance.shell.toggleOpen,
|
|
172
|
+
desktopIsBridge: instance.desktop === window.desktop,
|
|
173
|
+
};
|
|
174
|
+
})()`);
|
|
175
|
+
if (probe) break;
|
|
176
|
+
}
|
|
177
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
expect(probe).toEqual({ createShell: 'function', isCollapsed: 'function', toggleOpen: 'function', desktopIsBridge: true });
|
|
150
181
|
},
|
|
151
182
|
},
|
|
152
183
|
],
|
|
@@ -16,8 +16,8 @@ module.exports = defineCases({
|
|
|
16
16
|
tests: [
|
|
17
17
|
{
|
|
18
18
|
description: 'restartManager wired, bailed as testing, nothing scheduled',
|
|
19
|
-
inspect: async ({
|
|
20
|
-
const rm =
|
|
19
|
+
inspect: async ({ omega, expect }) => {
|
|
20
|
+
const rm = omega.restartManager;
|
|
21
21
|
expect(Boolean(rm)).toBe(true);
|
|
22
22
|
for (const fn of ['register', 'unregister', 'ensureInstalled', 'ensureRunning', 'getStatus', 'shutdown']) {
|
|
23
23
|
expect(typeof rm[fn]).toBe('function');
|
|
@@ -40,19 +40,19 @@ module.exports = defineCases({
|
|
|
40
40
|
|
|
41
41
|
{
|
|
42
42
|
description: 'storage is a REAL store through the bundle (not the no-op fallback)',
|
|
43
|
-
inspect: async ({
|
|
43
|
+
inspect: async ({ omega, expect }) => {
|
|
44
44
|
const fs = require('fs');
|
|
45
45
|
|
|
46
46
|
// The no-op fallback leaves _store null → getPath() null and get() always default.
|
|
47
|
-
|
|
48
|
-
expect(
|
|
47
|
+
omega.storage.set('desktop:boot:storageProof', 'bundled');
|
|
48
|
+
expect(omega.storage.get('desktop:boot:storageProof')).toBe('bundled');
|
|
49
49
|
|
|
50
|
-
const storePath =
|
|
50
|
+
const storePath = omega.storage.getPath();
|
|
51
51
|
expect(Boolean(storePath)).toBe(true);
|
|
52
52
|
expect(storePath.endsWith('omega-storage.json')).toBe(true);
|
|
53
53
|
expect(fs.existsSync(storePath)).toBe(true);
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
omega.storage.delete('desktop:boot:storageProof');
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
58
|
],
|
|
@@ -16,39 +16,39 @@ module.exports = defineCases({
|
|
|
16
16
|
tests: [
|
|
17
17
|
{
|
|
18
18
|
description: 'page boots with data-bs-theme equal to the resolved appearance',
|
|
19
|
-
inspect: async ({
|
|
19
|
+
inspect: async ({ omega, expect }) => {
|
|
20
20
|
const { BrowserWindow } = require('electron');
|
|
21
21
|
|
|
22
|
-
expect(
|
|
23
|
-
expect(['light', 'dark'].includes(
|
|
22
|
+
expect(omega.theme._initialized).toBe(true);
|
|
23
|
+
expect(['light', 'dark'].includes(omega.theme.resolved())).toBe(true);
|
|
24
24
|
|
|
25
25
|
// Wait for the fixture's main window + view, then for the applier to land
|
|
26
26
|
// (it applies at DOMContentLoaded).
|
|
27
27
|
let attr = null;
|
|
28
28
|
for (let i = 0; i < 50; i++) {
|
|
29
|
-
const win =
|
|
29
|
+
const win = omega.windows.get('main') || BrowserWindow.getAllWindows()[0];
|
|
30
30
|
if (win && !win.isDestroyed() && win.webContents.getURL().includes('/views/main/')) {
|
|
31
31
|
attr = await win.webContents.executeJavaScript('document.documentElement.getAttribute("data-bs-theme")').catch(() => null);
|
|
32
|
-
if (attr ===
|
|
32
|
+
if (attr === omega.theme.resolved()) break;
|
|
33
33
|
}
|
|
34
34
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
expect(attr).toBe(
|
|
37
|
+
expect(attr).toBe(omega.theme.resolved());
|
|
38
38
|
},
|
|
39
39
|
},
|
|
40
40
|
|
|
41
41
|
{
|
|
42
42
|
description: 'main-side theme.set() updates the live page attribute (no reload)',
|
|
43
|
-
inspect: async ({
|
|
43
|
+
inspect: async ({ omega, expect }) => {
|
|
44
44
|
const { BrowserWindow } = require('electron');
|
|
45
|
-
const win =
|
|
45
|
+
const win = omega.windows.get('main') || BrowserWindow.getAllWindows()[0];
|
|
46
46
|
expect(Boolean(win && !win.isDestroyed())).toBe(true);
|
|
47
47
|
|
|
48
|
-
const original =
|
|
49
|
-
const target =
|
|
48
|
+
const original = omega.theme.get();
|
|
49
|
+
const target = omega.theme.resolved() === 'dark' ? 'light' : 'dark';
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
omega.theme.set(target);
|
|
52
52
|
|
|
53
53
|
let attr = null;
|
|
54
54
|
for (let i = 0; i < 50; i++) {
|
|
@@ -58,8 +58,8 @@ module.exports = defineCases({
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
// Restore before asserting so a failure can't strand the flipped state.
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
omega.theme.set(original);
|
|
62
|
+
omega.storage.delete('theme.appearance');
|
|
63
63
|
|
|
64
64
|
expect(attr).toBe(target);
|
|
65
65
|
},
|
|
@@ -12,7 +12,7 @@ const defineCases = require('../../../vendor/devkit/test/define-cases.js');
|
|
|
12
12
|
const auditPath = path.join(__dirname, '..', '..', '..', 'gulp', 'tasks', 'audit.js');
|
|
13
13
|
|
|
14
14
|
function freshAudit() {
|
|
15
|
-
// Clear require cache so each test gets a clean module (it
|
|
15
|
+
// Clear require cache so each test gets a clean module (it loads the build module at require time).
|
|
16
16
|
delete require.cache[require.resolve(auditPath)];
|
|
17
17
|
return require(auditPath);
|
|
18
18
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
// The managers are plain objects and `available()` is stubbed, so the production
|
|
5
5
|
// default is provable with no Electron and, above all, with no call into this box's
|
|
6
|
-
// OS keychain. The real-
|
|
6
|
+
// OS keychain. The real-instance half lives in the main suite, which now runs under
|
|
7
7
|
// the forced test-mode strategy itself.
|
|
8
8
|
|
|
9
9
|
const path = require('path');
|
|
@@ -41,7 +41,7 @@ module.exports = defineCases({
|
|
|
41
41
|
description: 'auth-persistence resolve(): the production default, and the test-mode override',
|
|
42
42
|
tests: [
|
|
43
43
|
{
|
|
44
|
-
name: 'a production
|
|
44
|
+
name: 'a production omega instance with no config still picks safeStorage; an unknown name warns to null',
|
|
45
45
|
run: async (ctx) => {
|
|
46
46
|
const vault = stubSafeStorage();
|
|
47
47
|
const lines = [];
|
|
@@ -63,7 +63,7 @@ module.exports = defineCases({
|
|
|
63
63
|
},
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
|
-
name: 'a testing
|
|
66
|
+
name: 'a testing omega instance gets none before any config read, and the vault is never asked',
|
|
67
67
|
run: async (ctx) => {
|
|
68
68
|
const vault = stubSafeStorage();
|
|
69
69
|
const lines = [];
|
|
@@ -97,13 +97,13 @@ module.exports = defineCases({
|
|
|
97
97
|
// explicit one alone ([#925](https://github.com/Omega-JS-Stack/omega/issues/925)),
|
|
98
98
|
// and so the real isTesting() answers the lane, not the bake.
|
|
99
99
|
process.env[ENVIRONMENT_VAR] = 'testing';
|
|
100
|
-
const
|
|
100
|
+
const omega = {
|
|
101
101
|
config: { environment: 'production', omega: { authPersistence: 'safeStorage' } },
|
|
102
102
|
isTesting,
|
|
103
103
|
};
|
|
104
|
-
ctx.expect(
|
|
104
|
+
ctx.expect(omega.isTesting()).toBe(true);
|
|
105
105
|
|
|
106
|
-
const active = await capture(lines, () => authPersistence.resolve(
|
|
106
|
+
const active = await capture(lines, () => authPersistence.resolve(omega));
|
|
107
107
|
ctx.expect(active).toBeNull();
|
|
108
108
|
ctx.expect(vault.calls.available).toBe(0);
|
|
109
109
|
ctx.expect(lines.join('\n')).toMatch(/auth persistence: none \(test mode\)/);
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
|
|
16
16
|
const path = require('path');
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const build = require('../../../build.js');
|
|
19
19
|
|
|
20
|
-
const package =
|
|
20
|
+
const package = build.getPackage('main');
|
|
21
21
|
const fixture = require(path.join(__dirname, '..', '..', 'fixtures', 'consumer-app', 'package.json'));
|
|
22
22
|
const defineCases = require('../../../vendor/devkit/test/define-cases.js');
|
|
23
23
|
|
|
@@ -15,6 +15,7 @@ const jetpack = require('fs-jetpack');
|
|
|
15
15
|
const defineCases = require('../../../vendor/devkit/test/define-cases.js');
|
|
16
16
|
|
|
17
17
|
const { runBootChild } = require(path.join(__dirname, '..', '..', 'runners', 'boot.js'));
|
|
18
|
+
const { TEST_EVENT_PREFIX } = require(path.join(__dirname, '..', '..', '..', 'utils', 'test-events.js'));
|
|
18
19
|
|
|
19
20
|
// A project root the runner reads its report clue from. `logLine` null writes no
|
|
20
21
|
// logs/ at all, the boot that died before the logger ever opened a file.
|
|
@@ -152,11 +153,11 @@ module.exports = defineCases({
|
|
|
152
153
|
killGraceMs: 20,
|
|
153
154
|
});
|
|
154
155
|
|
|
155
|
-
child.stdout.emit('data',
|
|
156
|
+
child.stdout.emit('data', `${TEST_EVENT_PREFIX}${JSON.stringify({ event: 'result', name: 'the app boots', passed: true, duration: 12 })}\n`);
|
|
156
157
|
await sleep(150);
|
|
157
|
-
child.stdout.emit('data',
|
|
158
|
+
child.stdout.emit('data', `${TEST_EVENT_PREFIX}${JSON.stringify({ event: 'result', name: 'a slow suite finishes', passed: true, duration: 12 })}\n`);
|
|
158
159
|
await sleep(150);
|
|
159
|
-
child.stdout.emit('data',
|
|
160
|
+
child.stdout.emit('data', `${TEST_EVENT_PREFIX}${JSON.stringify({ event: 'result', name: 'and another', passed: true, duration: 12 })}\n`);
|
|
160
161
|
await sleep(150);
|
|
161
162
|
child.emit('exit', 0);
|
|
162
163
|
|
|
@@ -196,7 +197,7 @@ module.exports = defineCases({
|
|
|
196
197
|
killGraceMs: 20,
|
|
197
198
|
});
|
|
198
199
|
|
|
199
|
-
child.stdout.emit('data',
|
|
200
|
+
child.stdout.emit('data', `${TEST_EVENT_PREFIX}${JSON.stringify({ event: 'result', name: 'a late line', passed: true, duration: 12 })}\n`);
|
|
200
201
|
child.emit('exit', 0);
|
|
201
202
|
await sleep(40);
|
|
202
203
|
|
|
@@ -231,7 +232,7 @@ module.exports = defineCases({
|
|
|
231
232
|
killGraceMs: 20,
|
|
232
233
|
});
|
|
233
234
|
|
|
234
|
-
child.stdout.emit('data',
|
|
235
|
+
child.stdout.emit('data', `${TEST_EVENT_PREFIX}${JSON.stringify({ event: 'result', name: 'the app boots', passed: true, duration: 12 })}\n`);
|
|
235
236
|
child.emit('exit', 0);
|
|
236
237
|
|
|
237
238
|
const settled = await pending;
|
|
@@ -29,7 +29,7 @@ function stageConsumer(color) {
|
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Run the sass task with the fixture as the project root. Both the task and the
|
|
32
|
-
* build
|
|
32
|
+
* build module resolve that root at REQUIRE time, so each run gets a fresh
|
|
33
33
|
* copy of both.
|
|
34
34
|
*/
|
|
35
35
|
function runSassIn(dir) {
|
|
@@ -133,7 +133,7 @@ module.exports = defineCases({
|
|
|
133
133
|
ctx.expect(blob.license.status).toBe('licensed');
|
|
134
134
|
ctx.expect(typeof blob.builtAt).toBe('string');
|
|
135
135
|
// The mode is the same THREE keys everywhere (#894): desktop's own
|
|
136
|
-
// `server` verdict stays inside the
|
|
136
|
+
// `server` verdict stays inside the build module.
|
|
137
137
|
ctx.expect(Object.keys(blob.mode).sort()).toEqual(['build', 'environment', 'publish']);
|
|
138
138
|
ctx.expect(blob.mode.environment).toBe('production');
|
|
139
139
|
ctx.expect(blob.mode.build).toBe(true);
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
const path = require('path');
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const build = require('../../../build.js');
|
|
7
7
|
const defineCases = require('../../../vendor/devkit/test/define-cases.js');
|
|
8
|
-
const root =
|
|
8
|
+
const root = build.getRootPath('main');
|
|
9
9
|
|
|
10
10
|
module.exports = defineCases({
|
|
11
11
|
type: 'group',
|
|
@@ -10,9 +10,9 @@ const fs = require('fs');
|
|
|
10
10
|
const JSON5 = require('json5');
|
|
11
11
|
const { loadConfig } = require('../../../vendor/config/index.js');
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const build = require('../../../build.js');
|
|
14
14
|
const defineCases = require('../../../vendor/devkit/test/define-cases.js');
|
|
15
|
-
const root =
|
|
15
|
+
const root = build.getRootPath('main');
|
|
16
16
|
const defaultsDir = path.join(root, 'dist', 'defaults');
|
|
17
17
|
const defaultConfigPath = path.join(defaultsDir, 'config', 'omega.json5');
|
|
18
18
|
|
|
@@ -76,7 +76,7 @@ module.exports = defineCases({
|
|
|
76
76
|
name: 'resolved: has app block (appId + productName may be null — derived from brand)',
|
|
77
77
|
run: (ctx) => {
|
|
78
78
|
// appId and productName are derived from brand.id / brand.name at config-load
|
|
79
|
-
// time (
|
|
79
|
+
// time (build.getConfig). The raw scaffold leaves them null on purpose so the
|
|
80
80
|
// user only sets brand.{id,name} once. The `app` block itself must exist for
|
|
81
81
|
// copyright + any future explicit overrides.
|
|
82
82
|
ctx.expect(ctx.state.cfg.app).toBeTruthy();
|
|
@@ -96,7 +96,7 @@ module.exports = defineCases({
|
|
|
96
96
|
run: (ctx) => {
|
|
97
97
|
// Tray, menu, and context-menu use fixed conventional paths
|
|
98
98
|
// (src/integrations/{tray,menu,context-menu}/index.js). Disabling is a runtime
|
|
99
|
-
// call (
|
|
99
|
+
// call (omega.tray.disable() etc.), not a config flag. Config carries no entry
|
|
100
100
|
// for these in v1 — guard against re-introducing one accidentally.
|
|
101
101
|
ctx.expect(ctx.state.cfg.tray).toBeUndefined();
|
|
102
102
|
ctx.expect(ctx.state.cfg.menu).toBeUndefined();
|
|
@@ -125,7 +125,7 @@ module.exports = defineCases({
|
|
|
125
125
|
name: 'has NO deepLinks config block (scheme = brand.id, routes are runtime)',
|
|
126
126
|
run: (ctx) => {
|
|
127
127
|
// deep-link scheme is auto-derived from brand.id; routes register at runtime via
|
|
128
|
-
//
|
|
128
|
+
// omega.deepLink.on(). Guard against re-introducing a config block.
|
|
129
129
|
ctx.expect(ctx.state.cfg.deepLinks).toBeUndefined();
|
|
130
130
|
},
|
|
131
131
|
},
|
|
@@ -9,11 +9,11 @@ const fs = require('fs');
|
|
|
9
9
|
const os = require('os');
|
|
10
10
|
const jetpack = require('fs-jetpack');
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const build = require('../../../build.js');
|
|
13
13
|
const { renderSecretsBlock } = require('../../../vendor/config/env-delivery.js');
|
|
14
14
|
const { copyDefaults } = require('../../../commands/lib/ensure-target.js');
|
|
15
15
|
const defineCases = require('../../../vendor/devkit/test/define-cases.js');
|
|
16
|
-
const package =
|
|
16
|
+
const package = build.getPackage('main');
|
|
17
17
|
|
|
18
18
|
const DEFAULT_MARKER = '# ========== Default Values ==========';
|
|
19
19
|
const CUSTOM_MARKER = '# ========== Custom Values ==========';
|
|
@@ -57,7 +57,7 @@ async function runDeploy(options) {
|
|
|
57
57
|
fs.writeFileSync(path.join(tmp, 'package.json'), '{"name":"desktop-deploy-hook-test"}');
|
|
58
58
|
fs.writeFileSync(
|
|
59
59
|
path.join(tmp, 'hooks', 'deploy', 'pre.js'),
|
|
60
|
-
`module.exports = async (ctx) => { global.__omegaDeployHookRan.push('deploy/pre:' + (ctx.projectRoot === process.cwd() && typeof ctx.
|
|
60
|
+
`module.exports = async (ctx) => { global.__omegaDeployHookRan.push('deploy/pre:' + (ctx.projectRoot === process.cwd() && typeof ctx.build === 'object' && ctx.mode === 'production' ? 'ctx ok' : 'ctx wrong')); };`,
|
|
61
61
|
);
|
|
62
62
|
|
|
63
63
|
const restores = [
|
|
@@ -72,7 +72,7 @@ async function runDeploy(options) {
|
|
|
72
72
|
global.__omegaDeployHookRan = ran;
|
|
73
73
|
|
|
74
74
|
try {
|
|
75
|
-
// Required BEFORE the chdir: the verb
|
|
75
|
+
// Required BEFORE the chdir: the verb loads its build module at load time from
|
|
76
76
|
// the real target; only the hook lookup reads cwd, at call time.
|
|
77
77
|
const deploy = require(resolved);
|
|
78
78
|
process.chdir(tmp);
|
|
@@ -139,7 +139,7 @@ module.exports = defineCases({
|
|
|
139
139
|
description: 'deploy: the consumer\'s hooks/deploy/pre.js runs before the precheck (#899)',
|
|
140
140
|
tests: [
|
|
141
141
|
{
|
|
142
|
-
name: 'the hook runs after the scaffold and before the network precheck, with {
|
|
142
|
+
name: 'the hook runs after the scaffold and before the network precheck, with { build, projectRoot, mode: production }',
|
|
143
143
|
run: async (ctx) => {
|
|
144
144
|
const ran = await runDeploy({});
|
|
145
145
|
ctx.expect(ran).toEqual(['ensure-target', 'deploy/pre:ctx ok', 'precheck', 'STOP AT PRECHECK']);
|
|
@@ -13,13 +13,13 @@ const os = require('os');
|
|
|
13
13
|
const jetpack = require('fs-jetpack');
|
|
14
14
|
|
|
15
15
|
const SRC = path.join(__dirname, '..', '..', '..');
|
|
16
|
-
const
|
|
16
|
+
const build = require(path.join(SRC, 'build.js'));
|
|
17
17
|
const { ensureTarget } = require(path.join(SRC, 'commands', 'lib', 'ensure-target.js'));
|
|
18
18
|
const { deployPrecheck } = require(path.join(SRC, 'commands', 'lib', 'deploy-precheck.js'));
|
|
19
19
|
const cli = require(path.join(SRC, 'cli.js'));
|
|
20
20
|
const defineCases = require('../../../vendor/devkit/test/define-cases.js');
|
|
21
21
|
|
|
22
|
-
const package =
|
|
22
|
+
const package = build.getPackage('main');
|
|
23
23
|
|
|
24
24
|
// A consumer whose peer deps are already satisfied — the steady state.
|
|
25
25
|
function stageConsumer(dir) {
|
|
@@ -19,13 +19,13 @@ const { publishSecretKeys, bakeKeys, renderSecretsBlock, WORKFLOW_OWNED_KEYS } =
|
|
|
19
19
|
const { composeTargetEnv } = require('../../../vendor/config/index.js');
|
|
20
20
|
|
|
21
21
|
const SRC = path.join(__dirname, '..', '..', '..');
|
|
22
|
-
const
|
|
22
|
+
const build = require(path.join(SRC, 'build.js'));
|
|
23
23
|
const { ensureTarget } = require(path.join(SRC, 'commands', 'lib', 'ensure-target.js'));
|
|
24
24
|
const bundleTask = require(path.join(SRC, 'gulp', 'tasks', 'bundle.js'));
|
|
25
25
|
const { collectTargetSecrets } = require('../../../vendor/devkit/target-secrets.js');
|
|
26
26
|
const defineCases = require('../../../vendor/devkit/test/define-cases.js');
|
|
27
27
|
|
|
28
|
-
const package =
|
|
28
|
+
const package = build.getPackage('main');
|
|
29
29
|
|
|
30
30
|
/** A consumer whose peer deps are already satisfied — the steady state. */
|
|
31
31
|
function stageConsumer() {
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
// Both Node bundles are CommonJS (`format: 'cjs'`, `platform: 'node'`), and
|
|
5
5
|
// esbuild rewrites `import.meta` to `{}` in that output: a dependency doing
|
|
6
6
|
// `createRequire(import.meta.url)` was handed `undefined` and threw
|
|
7
|
-
// ERR_INVALID_ARG_VALUE the moment a packaged app booted (
|
|
8
|
-
//
|
|
7
|
+
// ERR_INVALID_ARG_VALUE the moment a packaged app booted (an app that depends
|
|
8
|
+
// on yargs 18 does exactly that). @omega.js/devkit's `bundle()`
|
|
9
9
|
// composes the answer for every cjs+node build, so nothing here wires it.
|
|
10
10
|
//
|
|
11
11
|
// The proof is a RUN, not a read of the bundle text: the fixture package
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
const path = require('path');
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const build = require('../../../build.js');
|
|
7
7
|
const defineCases = require('../../../vendor/devkit/test/define-cases.js');
|
|
8
|
-
const pkg =
|
|
9
|
-
const root =
|
|
8
|
+
const pkg = build.getPackage('main');
|
|
9
|
+
const root = build.getRootPath('main');
|
|
10
10
|
|
|
11
11
|
module.exports = defineCases({
|
|
12
12
|
type: 'group',
|
|
@@ -28,13 +28,14 @@ module.exports = defineCases({
|
|
|
28
28
|
},
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
|
-
|
|
31
|
+
// main and preload load anywhere and export their instance; the renderer
|
|
32
|
+
// needs its preload's window.desktop, so omega.test.js loads it with one
|
|
33
|
+
name: 'main / preload / build all loadable',
|
|
32
34
|
run: (ctx) => {
|
|
33
35
|
const fromDist = (subpath) => path.join(root, 'dist', subpath);
|
|
34
|
-
ctx.expect(typeof require(fromDist('main.js'))).toBe('
|
|
35
|
-
ctx.expect(typeof require(fromDist('
|
|
36
|
-
ctx.expect(typeof require(fromDist('
|
|
37
|
-
ctx.expect(typeof require(fromDist('build.js'))).toBe('function');
|
|
36
|
+
ctx.expect(typeof require(fromDist('main.js'))).toBe('object');
|
|
37
|
+
ctx.expect(typeof require(fromDist('preload.js'))).toBe('object');
|
|
38
|
+
ctx.expect(typeof require(fromDist('build.js'))).toBe('object');
|
|
38
39
|
},
|
|
39
40
|
},
|
|
40
41
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Build-layer tests for
|
|
1
|
+
// Build-layer tests for build.getConfig() — omega.json5 resolution + derived defaults.
|
|
2
2
|
// Stages a temp consumer dir with a config/omega.json5, sets process.cwd()
|
|
3
3
|
// at it, and asserts the resolution + derivation rules.
|
|
4
4
|
|
|
@@ -43,8 +43,8 @@ function loadConfigInDir(dir) {
|
|
|
43
43
|
}
|
|
44
44
|
try {
|
|
45
45
|
process.chdir(dir);
|
|
46
|
-
const
|
|
47
|
-
return
|
|
46
|
+
const build = require(path.join(__dirname, '..', '..', '..', 'build.js'));
|
|
47
|
+
return build.getConfig();
|
|
48
48
|
} finally {
|
|
49
49
|
process.chdir(oldCwd);
|
|
50
50
|
}
|
|
@@ -53,7 +53,7 @@ function loadConfigInDir(dir) {
|
|
|
53
53
|
module.exports = defineCases({
|
|
54
54
|
type: 'suite',
|
|
55
55
|
layer: 'build',
|
|
56
|
-
description: '
|
|
56
|
+
description: 'build.getConfig — omega.json5 resolution + derived defaults',
|
|
57
57
|
tests: [
|
|
58
58
|
{
|
|
59
59
|
name: 'derives appId from the BRAND: reverse-domain of brand.url, else app.<brand.id> (friction #18)',
|
|
@@ -24,7 +24,7 @@ const SOURCE_DIRS = ['lib', 'gulp'];
|
|
|
24
24
|
// The two specifiers that are ALLOWED to be undeclared, each one required inside a
|
|
25
25
|
// try/catch whose catch is the documented behaviour, not a crash:
|
|
26
26
|
// firebase @omega.js/client's own dependency; the client bridge falls back
|
|
27
|
-
// to no-op mode when it is not there (lib/
|
|
27
|
+
// to no-op mode when it is not there (lib/auth.js)
|
|
28
28
|
// app-builder-bin electron-builder's own dependency; blockmap generation is
|
|
29
29
|
// best-effort and warns-and-skips (lib/sign-helpers/update-info.js)
|
|
30
30
|
const GUARDED = new Set(['firebase', 'app-builder-bin']);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Build-layer tests for utils/merge-line-files.js — verify the .env / .gitignore merge convention
|
|
2
|
-
// (
|
|
2
|
+
// (Default + Custom sections) AND the double-quote normalization for .env values.
|
|
3
3
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const { mergeLineBasedFiles, normalizeEnvLine, DEFAULT_MARKER, CUSTOM_MARKER } =
|