@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.
- package/README.md +53 -48
- 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-run.js +4 -1
- package/dist/cli.js +3 -3
- package/dist/commands/build.js +2 -2
- package/dist/commands/cdp/capture.js +2 -2
- package/dist/commands/cdp/client.js +1 -1
- 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/cdp.js +1 -1
- package/dist/commands/clean.js +4 -5
- package/dist/commands/deploy.js +4 -4
- package/dist/commands/dev.js +25 -0
- package/dist/commands/finalize-release.js +4 -4
- package/dist/commands/launch.js +2 -2
- package/dist/commands/lib/deploy-precheck.js +3 -3
- package/dist/commands/lib/ensure-target.js +18 -23
- package/dist/commands/lib/migrate.js +17 -0
- package/dist/commands/logs.js +1 -1
- package/dist/commands/package.js +2 -2
- package/dist/commands/publish.js +2 -2
- package/dist/commands/release.js +4 -4
- package/dist/commands/runner.js +11 -11
- package/dist/commands/sign-windows.js +5 -5
- package/dist/commands/test.js +8 -8
- package/dist/commands/update.js +7 -6
- package/dist/commands/validate-certs.js +4 -4
- package/dist/commands/version.js +3 -3
- package/dist/defaults/.github/workflows/build.yml +18 -18
- package/dist/defaults/_.gitignore +0 -2
- package/dist/defaults/_mas/README.md +3 -3
- package/dist/defaults/config/certs/README.md +1 -1
- package/dist/defaults/config/omega.json5 +43 -43
- package/dist/defaults/docs/README.md +3 -3
- package/dist/defaults/gulpfile.js +1 -1
- package/dist/defaults/hooks/build/post.js +2 -2
- package/dist/defaults/hooks/build/pre.js +2 -2
- package/dist/defaults/hooks/deploy/pre.js +1 -1
- package/dist/defaults/hooks/notarize/post.js +2 -2
- package/dist/defaults/hooks/release/post.js +2 -2
- package/dist/defaults/hooks/release/pre.js +2 -2
- 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/assets/scss/pages/about.scss +1 -1
- package/dist/defaults/src/assets/scss/pages/main.scss +1 -1
- package/dist/defaults/src/assets/scss/pages/settings.scss +1 -1
- package/dist/defaults/src/integrations/context-menu/index.js +13 -13
- package/dist/defaults/src/integrations/menu/index.js +8 -8
- package/dist/defaults/src/integrations/tray/index.js +12 -12
- package/dist/defaults/src/main.js +5 -7
- package/dist/defaults/src/preload.js +4 -6
- package/dist/defaults/test/README.md +5 -5
- package/dist/defaults/test/_init.js +1 -1
- package/dist/gulp/main.js +9 -10
- package/dist/gulp/tasks/audit.js +11 -14
- 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 +29 -29
- package/dist/lib/restart-manager/install.js +1 -1
- package/dist/lib/restart-manager/protocol.js +1 -1
- 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 +399 -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 +21 -8
- 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/build-workflow-jobs.test.js +2 -2
- package/dist/test/suites/build/cli.test.js +30 -2
- package/dist/test/suites/build/config-schema.test.js +5 -5
- package/dist/test/suites/build/defaults-em-dash.test.js +22 -0
- package/dist/test/suites/build/defaults-scaffold.test.js +21 -7
- package/dist/test/suites/build/deploy-direct.test.js +7 -5
- package/dist/test/suites/build/deploy-dispatch.test.js +2 -1
- package/dist/test/suites/build/deploy-hook.test.js +7 -5
- package/dist/test/suites/build/dev-verb.test.js +67 -0
- package/dist/test/suites/build/ensure-target.test.js +13 -5
- 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 +7 -7
- package/dist/test/suites/build/migrate.test.js +29 -0
- 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/project-scripts-deps.test.js +6 -10
- package/dist/test/suites/build/renderer-auth-bridge.test.js +211 -78
- package/dist/test/suites/build/runner-env-write.test.js +73 -0
- package/dist/test/suites/build/runner.test.js +11 -10
- package/dist/test/suites/build/sentry.test.js +2 -2
- package/dist/test/suites/build/setup-scripts.test.js +27 -0
- 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 +15 -4
- package/dist/test/suites/build/verb-logs.test.js +20 -0
- 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} +28 -8
- package/dist/test/utils/extended-mode-warning.js +1 -1
- package/dist/utils/boot-harness.js +56 -0
- package/dist/utils/build-pipeline.js +4 -4
- package/dist/utils/mode-helpers.js +2 -15
- package/dist/utils/runner-env.js +13 -28
- 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/company.js +46 -14
- package/dist/vendor/config/defaults.js +30 -7
- package/dist/vendor/config/edit.js +25 -3
- package/dist/vendor/config/env-delivery.js +1 -1
- package/dist/vendor/config/env-schema.js +3 -6
- package/dist/vendor/config/env.js +34 -22
- package/dist/vendor/config/environment.js +11 -30
- package/dist/vendor/config/index.js +21 -28
- package/dist/vendor/config/load.js +16 -9
- package/dist/vendor/config/platforms.js +1 -1
- package/dist/vendor/config/repo.js +10 -27
- package/dist/vendor/config/schema-client.js +64 -0
- package/dist/vendor/config/schema-cloud.js +38 -0
- package/dist/vendor/config/schema-manager.js +118 -0
- package/dist/vendor/config/schema-overrides.js +68 -0
- package/dist/vendor/config/schema.js +104 -160
- package/dist/vendor/config/site-global.js +2 -3
- package/dist/vendor/config/validate.js +97 -78
- package/dist/vendor/config/winback.js +1 -1
- package/dist/vendor/devkit/actions-secrets.js +1 -1
- package/dist/vendor/devkit/agents-md.js +233 -0
- package/dist/vendor/devkit/attach-log-file.js +16 -2
- package/dist/vendor/devkit/build-json.js +1 -1
- package/dist/vendor/devkit/ci-workflows.js +30 -30
- package/dist/vendor/devkit/cli-router.js +16 -11
- package/dist/vendor/devkit/defaults-engine.js +15 -51
- package/dist/vendor/devkit/deploy-snapshot.js +44 -9
- package/dist/vendor/devkit/env-lines.js +183 -0
- package/dist/vendor/devkit/local.js +64 -10
- package/dist/vendor/devkit/lockfile.js +32 -13
- package/dist/vendor/devkit/logger.js +7 -2
- package/dist/vendor/devkit/merge-line-files.js +219 -177
- package/dist/vendor/devkit/omega-bin.js +208 -111
- package/dist/vendor/devkit/preludes/docs-sync.js +52 -0
- package/dist/vendor/devkit/preludes/index.js +1 -0
- package/dist/vendor/devkit/target-picker.js +45 -0
- package/dist/vendor/devkit/test/dashed-files.js +37 -0
- package/dist/vendor/devkit/test/run-verb-under-tee.js +71 -0
- package/dist/vendor/devkit/test/runner-core.js +6 -6
- package/dist/vendor/devkit/update.js +15 -15
- package/dist/vendor/devkit/verb-scripts.js +40 -0
- package/dist/vendor/devkit/verbs.js +170 -0
- 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/package.json +19 -26
- package/dist/commands/install.js +0 -37
- package/dist/defaults/AGENTS.md +0 -110
- package/dist/defaults/CLAUDE.md +0 -1
- 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
- package/dist/vendor/config/env-retired.js +0 -137
- package/dist/vendor/config/retired-keys.js +0 -635
- package/docs/analytics.md +0 -140
- package/docs/app-state.md +0 -92
- package/docs/audit.md +0 -69
- package/docs/auto-updater.md +0 -243
- package/docs/boot-sequence.md +0 -39
- package/docs/build-system.md +0 -169
- package/docs/cdp-debugging.md +0 -169
- package/docs/client-bridge.md +0 -269
- package/docs/common-mistakes.md +0 -21
- package/docs/config-schema.md +0 -120
- package/docs/context-menu.md +0 -112
- package/docs/context.md +0 -81
- package/docs/css.md +0 -90
- package/docs/deep-link.md +0 -186
- package/docs/environment-detection.md +0 -112
- package/docs/fontawesome.md +0 -107
- package/docs/hooks.md +0 -89
- package/docs/icons.md +0 -79
- package/docs/index.md +0 -317
- package/docs/installer-options.md +0 -165
- package/docs/ipc.md +0 -61
- package/docs/lib-modules.md +0 -53
- package/docs/logging.md +0 -229
- package/docs/menu.md +0 -160
- package/docs/releasing.md +0 -239
- package/docs/remote-config.md +0 -118
- package/docs/remote-scripts.md +0 -144
- package/docs/restart-manager.md +0 -144
- package/docs/runner.md +0 -290
- package/docs/sentry.md +0 -97
- package/docs/shared/agent-docs.md +0 -89
- package/docs/shared/analytics.md +0 -612
- package/docs/shared/brands.md +0 -57
- package/docs/shared/breaking-changes.md +0 -851
- package/docs/shared/config.md +0 -1952
- package/docs/shared/deploys.md +0 -341
- package/docs/shared/icons.md +0 -219
- package/docs/shared/local-dev.md +0 -167
- package/docs/shared/logging.md +0 -205
- package/docs/shared/monitoring.md +0 -167
- package/docs/shared/publishing.md +0 -187
- package/docs/shared/rulings.md +0 -34
- package/docs/shared/testing.md +0 -147
- package/docs/shared/theming.md +0 -629
- package/docs/shared/translation.md +0 -333
- package/docs/shared/updates.md +0 -61
- package/docs/signing.md +0 -293
- package/docs/startup.md +0 -142
- package/docs/storage.md +0 -59
- package/docs/templating.md +0 -101
- package/docs/test-boot-layer.md +0 -157
- package/docs/test-framework.md +0 -362
- package/docs/themes.md +0 -149
- package/docs/tooltips.md +0 -99
- package/docs/tray.md +0 -164
- package/docs/usage.md +0 -58
- package/docs/verts.md +0 -62
- package/docs/windows.md +0 -149
|
@@ -4,7 +4,7 @@ Drop your project test suites here. The framework auto-runs them alongside its o
|
|
|
4
4
|
|
|
5
5
|
## Layers
|
|
6
6
|
|
|
7
|
-
Match the framework's four layers
|
|
7
|
+
Match the framework's four layers. OMEGA Desktop's test runner discovers files by the directory they sit in:
|
|
8
8
|
|
|
9
9
|
| Directory | Runtime | Use for |
|
|
10
10
|
|---|---|---|
|
|
@@ -17,19 +17,19 @@ A renderer suite that declares `view: '<name>'` runs against that view of YOUR a
|
|
|
17
17
|
|
|
18
18
|
## Coverage
|
|
19
19
|
|
|
20
|
-
Every feature ships with tests at every layer it has a surface in
|
|
20
|
+
Every feature ships with tests at every layer it has a surface in: logic (`build`/`main`), UI (`renderer`), end-to-end (`boot`). Skip a layer only when the feature genuinely has no surface there; "the logic test covers it" does not excuse the UI test.
|
|
21
21
|
|
|
22
22
|
## Quick example
|
|
23
23
|
|
|
24
24
|
```js
|
|
25
25
|
// test/build/my-feature.test.js
|
|
26
|
-
const
|
|
26
|
+
const build = require('@omega.js/desktop/build');
|
|
27
27
|
|
|
28
28
|
module.exports = {
|
|
29
29
|
layer: 'build',
|
|
30
30
|
description: 'the project config carries a brand id',
|
|
31
31
|
run: (ctx) => {
|
|
32
|
-
ctx.expect(
|
|
32
|
+
ctx.expect(build.getConfig().brand.id).toBeTruthy();
|
|
33
33
|
},
|
|
34
34
|
};
|
|
35
35
|
```
|
|
@@ -38,4 +38,4 @@ That is the standalone form: one test per file. Every `run` receives `ctx`, whos
|
|
|
38
38
|
|
|
39
39
|
## See also
|
|
40
40
|
|
|
41
|
-
`node_modules/@omega.js/
|
|
41
|
+
`node_modules/@omega.js/manager/docs/desktop/test-framework.md`: full reference for the test framework (layers, assert API, fixtures, runner internals).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Test lifecycle hook for this project. Runs once before any suite (not a test itself).
|
|
3
|
-
* See @omega.js/
|
|
3
|
+
* See @omega.js/manager/docs/desktop/test-framework.md → "test/_init.js".
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
module.exports = ({ projectRoot }) => ({
|
package/dist/gulp/main.js
CHANGED
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
delete process.env.ELECTRON_RUN_AS_NODE;
|
|
4
4
|
|
|
5
5
|
// Libraries
|
|
6
|
-
const
|
|
7
|
-
const logger =
|
|
8
|
-
const argv =
|
|
6
|
+
const build = require('../build.js');
|
|
7
|
+
const logger = build.logger('main');
|
|
8
|
+
const argv = build.getArguments();
|
|
9
9
|
const { series, parallel } = require('gulp');
|
|
10
10
|
const path = require('path');
|
|
11
11
|
const glob = require('glob').globSync;
|
|
12
12
|
|
|
13
13
|
// Load packages
|
|
14
|
-
const package =
|
|
15
|
-
const project =
|
|
16
|
-
const projectRoot =
|
|
14
|
+
const package = build.getPackage('main');
|
|
15
|
+
const project = build.getPackage('project');
|
|
16
|
+
const projectRoot = build.getRootPath('project');
|
|
17
17
|
|
|
18
18
|
// Resolve the .env cascade from the project root (shell > app > brand > company)
|
|
19
19
|
// and derive the signing paths the brand's signing tree implies. gulp is its own
|
|
@@ -40,7 +40,7 @@ if (sanitizedSigningKeys.length) {
|
|
|
40
40
|
const attachLogFile = require('../utils/attach-log-file.js');
|
|
41
41
|
const logFileEnv = process.env.OMEGA_LOG_FILE;
|
|
42
42
|
if (logFileEnv !== 'false' && logFileEnv !== '0') {
|
|
43
|
-
const defaultName =
|
|
43
|
+
const defaultName = build.isBuildMode() ? 'build.log' : 'dev.log';
|
|
44
44
|
const logPath = (logFileEnv && logFileEnv !== 'true') ? logFileEnv : path.join(projectRoot, 'logs', defaultName);
|
|
45
45
|
attachLogFile(logPath);
|
|
46
46
|
logger.log(`Logs tee'd to ${logPath}`);
|
|
@@ -54,7 +54,7 @@ logger.log('Starting...', argv);
|
|
|
54
54
|
// Auto-load tasks from src/gulp/tasks/*.js
|
|
55
55
|
const tasks = glob('*.js', { cwd: `${__dirname}/tasks` });
|
|
56
56
|
|
|
57
|
-
// Globals (
|
|
57
|
+
// Globals (the same pair @omega.js/extension's gulp sets)
|
|
58
58
|
global.tasks = {};
|
|
59
59
|
global.websocket = null;
|
|
60
60
|
|
|
@@ -72,8 +72,7 @@ global.tasks = exports;
|
|
|
72
72
|
const runConsumerHook = require('../utils/run-consumer-hook.js');
|
|
73
73
|
function makeHookTask(name) {
|
|
74
74
|
const fn = async () => {
|
|
75
|
-
|
|
76
|
-
await runConsumerHook(name, { manager: Manager, projectRoot: process.cwd(), mode: process.env.OMEGA_BUILD_MODE === 'true' ? 'production' : 'development' });
|
|
75
|
+
await runConsumerHook(name, { build, projectRoot: process.cwd(), mode: process.env.OMEGA_BUILD_MODE === 'true' ? 'production' : 'development' });
|
|
77
76
|
};
|
|
78
77
|
// Set displayName for nicer gulp logs.
|
|
79
78
|
Object.defineProperty(fn, 'name', { value: `hook:${name.replace('/', ':')}` });
|
package/dist/gulp/tasks/audit.js
CHANGED
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
|
|
20
20
|
const path = require('path');
|
|
21
21
|
const jetpack = require('fs-jetpack');
|
|
22
|
-
const
|
|
22
|
+
const build = require('../../build.js');
|
|
23
23
|
const { validateConfig, releasesRepo, hasOmegaConfig, loadConfig } = require('../../vendor/config/index.js');
|
|
24
24
|
|
|
25
|
-
const logger =
|
|
25
|
+
const logger = build.logger('audit');
|
|
26
26
|
|
|
27
27
|
module.exports = function audit(done) {
|
|
28
28
|
const cwd = process.cwd();
|
|
29
|
-
const config =
|
|
29
|
+
const config = build.getConfig();
|
|
30
30
|
const errors = [];
|
|
31
31
|
const warnings = [];
|
|
32
32
|
|
|
@@ -38,18 +38,15 @@ module.exports = function audit(done) {
|
|
|
38
38
|
|
|
39
39
|
// 1. Schema-driven config validation. Single source of truth in @omega.js/config
|
|
40
40
|
// (shared schema + the desktop target refinements).
|
|
41
|
-
|
|
41
|
+
// build.getConfig() attaches `environment`, a build fact: the config is decorated
|
|
42
|
+
const { errors: schemaErrors } = validateConfig(config, { target: 'desktop', decorated: true });
|
|
42
43
|
errors.push(...schemaErrors);
|
|
43
44
|
|
|
44
|
-
// ...and the
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
// consumer has to see it at build time. They come off the LOAD, the same
|
|
48
|
-
// resolution `Manager.getConfig()` runs: loadConfig judges what the brand
|
|
49
|
-
// AUTHORED, before the loader fills its own resolved facts (`company.name`
|
|
50
|
-
// and friends) and before the build attaches `environment`.
|
|
45
|
+
// ...and the load's WARNINGS (an undeclared key is an ERROR, above). They
|
|
46
|
+
// come off the LOAD, the resolution `build.getConfig()` runs, which judges
|
|
47
|
+
// what the brand AUTHORED before the build attaches its own facts.
|
|
51
48
|
const { warnings: configWarnings } = hasOmegaConfig(cwd)
|
|
52
|
-
? loadConfig(cwd, 'desktop', { environment:
|
|
49
|
+
? loadConfig(cwd, 'desktop', { environment: build.getEnvironment() })
|
|
53
50
|
: { warnings: [] };
|
|
54
51
|
warnings.push(...configWarnings);
|
|
55
52
|
|
|
@@ -57,14 +54,14 @@ module.exports = function audit(done) {
|
|
|
57
54
|
// tied to the build pipeline, not the config shape).
|
|
58
55
|
fileMustExist('src/main.js', 'src/main.js');
|
|
59
56
|
fileMustExist('src/preload.js', 'src/preload.js');
|
|
60
|
-
if (
|
|
57
|
+
if (build.isPublishMode() || build.isBuildMode()) {
|
|
61
58
|
// Icon must exist when packaging — dev runs fine with the default Electron icon.
|
|
62
59
|
fileMustExist(config.brand.images?.icon, 'config.brand.images.icon');
|
|
63
60
|
}
|
|
64
61
|
// Publishing needs an ADDRESS for the releases repo, and no repo name is ever
|
|
65
62
|
// typed: @omega.js/config's releasesRepo derives `<brand.id>-releases` under
|
|
66
63
|
// the brand's org, so only a missing org (or brand.id) leaves it unaddressable.
|
|
67
|
-
if (
|
|
64
|
+
if (build.isPublishMode() && config.releases?.enabled !== false && !releasesRepo(config)) {
|
|
68
65
|
errors.push('the releases repo is unaddressable: set repo.org and brand.id. The repo is always "<brand.id>-releases" under that org');
|
|
69
66
|
}
|
|
70
67
|
|
|
@@ -15,12 +15,12 @@ const path = require('path');
|
|
|
15
15
|
const jetpack = require('fs-jetpack');
|
|
16
16
|
const yaml = require('js-yaml');
|
|
17
17
|
const { deepMerge, enabledFormats, desktopArtifactName, sanitizeProductName, releasesRepo } = require('../../vendor/config/index.js');
|
|
18
|
-
const
|
|
18
|
+
const build = require('../../build.js');
|
|
19
19
|
|
|
20
20
|
const { writeMacEntitlements } = require('../../lib/sign-helpers/entitlements.js');
|
|
21
21
|
const { resolveAndCopy } = require('../../lib/sign-helpers/resolve-icons.js');
|
|
22
22
|
|
|
23
|
-
const logger =
|
|
23
|
+
const logger = build.logger('build-config');
|
|
24
24
|
|
|
25
25
|
module.exports = function buildConfig(done) {
|
|
26
26
|
Promise.resolve().then(async () => {
|
|
@@ -28,7 +28,7 @@ module.exports = function buildConfig(done) {
|
|
|
28
28
|
const distRoot = require('../../utils/dist-root.js')(projectRoot);
|
|
29
29
|
const distPath = path.join(distRoot, 'electron-builder.yml');
|
|
30
30
|
|
|
31
|
-
const config =
|
|
31
|
+
const config = build.getConfig();
|
|
32
32
|
const startupMode = config.startup?.mode || 'normal';
|
|
33
33
|
|
|
34
34
|
// 1. Generate entitlements.mac.plist into dist/config/. Consumer overrides live at
|
|
@@ -51,7 +51,7 @@ module.exports = function buildConfig(done) {
|
|
|
51
51
|
// (the cp142 rehearsal catch). The framework resolves the INSTALLED
|
|
52
52
|
// electron from its own module context instead.
|
|
53
53
|
try {
|
|
54
|
-
builderConfig.electronVersion =
|
|
54
|
+
builderConfig.electronVersion = require('electron/package.json').version;
|
|
55
55
|
logger.log(`electronVersion → ${builderConfig.electronVersion} (resolved from the installed electron)`);
|
|
56
56
|
} catch (error) {
|
|
57
57
|
logger.log('electronVersion not injected (electron unresolved) — electron-builder falls back to its own detection');
|
|
@@ -160,11 +160,11 @@ function expandYear(str) {
|
|
|
160
160
|
// test assertions).
|
|
161
161
|
function baseConfig(config, extras = {}) {
|
|
162
162
|
// Seed `app` + `brand` so callers (including tests passing bare {}) can deref without
|
|
163
|
-
// optional-chaining at every site. Matches
|
|
163
|
+
// optional-chaining at every site. Matches build.getConfig()'s own seeding.
|
|
164
164
|
config.app = config.app || {};
|
|
165
165
|
config.brand = config.brand || {};
|
|
166
166
|
|
|
167
|
-
//
|
|
167
|
+
// build.getConfig() derives appId from the brand url/id; the literal here
|
|
168
168
|
// only backstops bare test configs. Copyright derives from the BRAND, never
|
|
169
169
|
// a hardcoded company (friction #18).
|
|
170
170
|
const appId = config.app.appId || 'app.omega.consumer';
|
|
@@ -444,13 +444,13 @@ function baseConfig(config, extras = {}) {
|
|
|
444
444
|
*
|
|
445
445
|
* @param {object} arch - The resolved per-platform arch lists (`{ mac, linux }`).
|
|
446
446
|
* @param {object} [options]
|
|
447
|
-
* @param {object} [options.mode] - The
|
|
447
|
+
* @param {object} [options.mode] - The build module's mode (`{ build, publish, … }`).
|
|
448
448
|
* @param {object} [options.logger] - Logger with `warn` (default: this task's).
|
|
449
449
|
* @throws {Error} in build/publish mode, naming the offending config key.
|
|
450
450
|
*/
|
|
451
451
|
function assertArchRules(arch, options) {
|
|
452
452
|
options = options || {};
|
|
453
|
-
const mode = options.mode ||
|
|
453
|
+
const mode = options.mode || build.getMode();
|
|
454
454
|
const warn = (options.logger || logger).warn.bind(options.logger || logger);
|
|
455
455
|
|
|
456
456
|
const violations = [];
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
// three entry shapes, the Electron platform/target pair, the externals, the
|
|
16
16
|
// renderer's Node-builtin shim, and the OMEGA_BUILD_JSON bake.
|
|
17
17
|
|
|
18
|
-
const
|
|
19
|
-
const logger =
|
|
18
|
+
const build = require('../../build.js');
|
|
19
|
+
const logger = build.logger('bundle');
|
|
20
20
|
const path = require('path');
|
|
21
21
|
const glob = require('glob').globSync;
|
|
22
22
|
const jetpack = require('fs-jetpack');
|
|
@@ -29,8 +29,8 @@ const buildJsonKit = require('../../vendor/devkit/build-json.js');
|
|
|
29
29
|
const { emptyModulesPlugin } = require('../../vendor/devkit/empty-modules-plugin.js');
|
|
30
30
|
const electronTargets = require('../../utils/electron-targets.js');
|
|
31
31
|
|
|
32
|
-
const projectRoot =
|
|
33
|
-
const frameworkRoot =
|
|
32
|
+
const projectRoot = build.getRootPath('project');
|
|
33
|
+
const frameworkRoot = build.getRootPath();
|
|
34
34
|
const outputRoot = require('../../utils/dist-root.js')(projectRoot);
|
|
35
35
|
|
|
36
36
|
// The renderer runs with contextIsolation on: a browser-like environment with
|
|
@@ -73,7 +73,7 @@ function buildFacts({ pkg, mode, dev }) {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
// The wrapper's `mode`, the same three keys on every OMEGA surface (#894).
|
|
76
|
-
// Desktop's own `server` verdict stays inside the
|
|
76
|
+
// Desktop's own `server` verdict stays inside the build module, which is the only
|
|
77
77
|
// thing that reads it: an artifact records what it WAS BUILT as.
|
|
78
78
|
function artifactMode(mode) {
|
|
79
79
|
return { environment: mode.environment, build: mode.build, publish: mode.publish };
|
|
@@ -118,9 +118,9 @@ function composeClientBuildJson({ config, facts, pkg, mode, license }) {
|
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
module.exports = function bundleTask(done) {
|
|
121
|
-
const mode =
|
|
121
|
+
const mode = build.getMode();
|
|
122
122
|
const isProd = mode.environment === 'production';
|
|
123
|
-
const config =
|
|
123
|
+
const config = build.getConfig();
|
|
124
124
|
|
|
125
125
|
// The renderer's @omega.js/client reads `config.dev` to reach the local
|
|
126
126
|
// stack (N7). A renderer has no env and no filesystem walk of its own, so
|
|
@@ -149,7 +149,7 @@ module.exports = function bundleTask(done) {
|
|
|
149
149
|
// license server (a key that cannot be answered for THROWS, which is what
|
|
150
150
|
// gates a bad-key release); a dev build is keyless by definition and never
|
|
151
151
|
// phones home. The answer is stamped into the build blob below.
|
|
152
|
-
const projectPackage =
|
|
152
|
+
const projectPackage = build.getPackage('project');
|
|
153
153
|
resolveLicenseStamp({ config, production: isProd })
|
|
154
154
|
.then((license) => {
|
|
155
155
|
// OMEGA_BUILD_JSON: frozen at build time. The NODE pair reads it as a
|
|
@@ -203,9 +203,9 @@ async function runBundles(buildJson, isProd) {
|
|
|
203
203
|
|
|
204
204
|
// esbuild rejects with every error already formatted, so a failed build
|
|
205
205
|
// surfaces through gulp's own callback rather than a hand-rolled reporter.
|
|
206
|
-
const results = await Promise.all(builds.map(async (
|
|
207
|
-
name:
|
|
208
|
-
result: await bundle(
|
|
206
|
+
const results = await Promise.all(builds.map(async (entry) => ({
|
|
207
|
+
name: entry.name,
|
|
208
|
+
result: await bundle(entry.options),
|
|
209
209
|
})));
|
|
210
210
|
|
|
211
211
|
// The metafile is what the wrapper turns on for exactly this: what each
|
|
@@ -225,7 +225,7 @@ async function runBundles(buildJson, isProd) {
|
|
|
225
225
|
// version they must compile for.
|
|
226
226
|
function resolveTargets() {
|
|
227
227
|
try {
|
|
228
|
-
return electronTargets(
|
|
228
|
+
return electronTargets(require('electron'), { logger });
|
|
229
229
|
} catch (e) {
|
|
230
230
|
logger.warn(`Could not resolve electron (${e.message}) — bundles compile with no syntax floor.`);
|
|
231
231
|
return { node: null, chrome: null, electron: null };
|
|
@@ -300,13 +300,13 @@ const BAKED_SOURCE_KEYS = bakeSourceKeys('desktop');
|
|
|
300
300
|
* @param {object} config - The target's resolved omega.json5 config.
|
|
301
301
|
* @param {object} env - The build env.
|
|
302
302
|
* @param {object} [options]
|
|
303
|
-
* @param {object} [options.mode] - The
|
|
303
|
+
* @param {object} [options.mode] - The build module's mode (`{ build, publish, … }`).
|
|
304
304
|
* @param {object} [options.logger] - Logger with `warn` (default: this task's).
|
|
305
305
|
* @throws {Error} in build/publish mode, naming every brand-level key and the config path that requires it.
|
|
306
306
|
*/
|
|
307
307
|
function assertBakeRules(config, env, options) {
|
|
308
308
|
options = options || {};
|
|
309
|
-
const mode = options.mode ||
|
|
309
|
+
const mode = options.mode || build.getMode();
|
|
310
310
|
const warn = (options.logger || logger).warn.bind(options.logger || logger);
|
|
311
311
|
|
|
312
312
|
const violations = checkEnvRules(config, env, { target: 'desktop' })
|
|
@@ -469,7 +469,7 @@ function rendererBundle(shared) {
|
|
|
469
469
|
format: 'iife',
|
|
470
470
|
target: shared.targets.chrome,
|
|
471
471
|
dev: shared.dev,
|
|
472
|
-
// Vendored core assets (#111) —
|
|
472
|
+
// Vendored core assets (#111) — the same alias extension and web use, so
|
|
473
473
|
// renderer code imports shared core modules by a stable name:
|
|
474
474
|
// import appShell from '__main_assets__/js/core/app-shell.js';
|
|
475
475
|
alias: {
|
|
@@ -504,7 +504,7 @@ function nativeExternals() {
|
|
|
504
504
|
'sqlite3',
|
|
505
505
|
];
|
|
506
506
|
|
|
507
|
-
const consumerPkg =
|
|
507
|
+
const consumerPkg = build.getPackage('project');
|
|
508
508
|
const declared = Object.assign({}, consumerPkg.dependencies || {}, consumerPkg.devDependencies || {});
|
|
509
509
|
|
|
510
510
|
return Object.keys(declared).filter((name) => NATIVE.includes(name));
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
// tree, the locality warning. Idempotent and quiet: a converged target writes
|
|
8
8
|
// nothing. The non-gulp verbs (`omega test`, `omega deploy`) call ensureTarget
|
|
9
9
|
// themselves.
|
|
10
|
-
const
|
|
11
|
-
const logger =
|
|
10
|
+
const build = require('../../build.js');
|
|
11
|
+
const logger = build.logger('defaults');
|
|
12
12
|
const { ensureTarget } = require('../../commands/lib/ensure-target.js');
|
|
13
13
|
|
|
14
14
|
module.exports = async function defaults() {
|
|
15
15
|
await ensureTarget({
|
|
16
|
-
projectDir:
|
|
16
|
+
projectDir: build.getRootPath('project'),
|
|
17
17
|
log: (line) => logger.log(line),
|
|
18
18
|
warn: (line) => logger.warn(line),
|
|
19
19
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// STUB — stage consumer src/ + @omega.js/desktop dist/ into .desktop-build/ for the `bundle` task to consume.
|
|
2
|
-
const
|
|
3
|
-
const logger =
|
|
2
|
+
const build = require('../../build.js');
|
|
3
|
+
const logger = build.logger('distribute');
|
|
4
4
|
|
|
5
5
|
module.exports = function distribute(done) {
|
|
6
6
|
logger.log('distribute (stub)');
|
package/dist/gulp/tasks/html.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// Page template is FRAMEWORK-INTERNAL (`<framework>/dist/config/page-template.html`). Consumers don't ship
|
|
5
5
|
// their own — every view goes through the same shell so the inset titlebar / draggable region /
|
|
6
6
|
// css/js wiring stay consistent. If a consumer needs a different template they can fork via
|
|
7
|
-
// `
|
|
7
|
+
// `omega.windows` config, but we no longer look at `<consumer>/config/page-template.html`.
|
|
8
8
|
//
|
|
9
9
|
// Body content is itself templated FIRST (so you can use {{ brand.name }} etc. inside the view),
|
|
10
10
|
// then the result is injected into the page template's `{{ content }}` slot.
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
// This lines up with the `bundle` task's entry naming so /assets/js/components/<page.name>.bundle.js
|
|
16
16
|
// and /assets/css/components/<page.name>.bundle.css resolve correctly.
|
|
17
17
|
|
|
18
|
-
const
|
|
19
|
-
const logger =
|
|
18
|
+
const build = require('../../build.js');
|
|
19
|
+
const logger = build.logger('html');
|
|
20
20
|
const path = require('path');
|
|
21
21
|
const jetpack = require('fs-jetpack');
|
|
22
22
|
|
|
23
|
-
const projectRoot =
|
|
24
|
-
const packageRoot =
|
|
23
|
+
const projectRoot = build.getRootPath('project');
|
|
24
|
+
const packageRoot = build.getRootPath('main');
|
|
25
25
|
const outputRoot = require('../../utils/dist-root.js')(projectRoot);
|
|
26
26
|
|
|
27
|
-
// We require the templating lib directly (rather than going through
|
|
28
|
-
// because gulp tasks run pre-Electron, with only the build
|
|
27
|
+
// We require the templating lib directly (rather than going through the omega instance)
|
|
28
|
+
// because gulp tasks run pre-Electron, with only the build module available.
|
|
29
29
|
const templating = require('../../lib/templating.js');
|
|
30
30
|
|
|
31
31
|
module.exports = function htmlTask(done) {
|
|
@@ -81,9 +81,9 @@ module.exports = function htmlTask(done) {
|
|
|
81
81
|
const bodyContent = jetpack.read(src);
|
|
82
82
|
|
|
83
83
|
// Two-pass render: first the body (so it can use {{ brand.name }} etc.), then the outer page.
|
|
84
|
-
const innerVars = templating.buildPageVars(pageName, { cacheBust },
|
|
84
|
+
const innerVars = templating.buildPageVars(pageName, { cacheBust }, build);
|
|
85
85
|
const renderedBody = templating.render(bodyContent, innerVars);
|
|
86
|
-
const outerVars = templating.buildPageVars(pageName, { cacheBust, content: renderedBody },
|
|
86
|
+
const outerVars = templating.buildPageVars(pageName, { cacheBust, content: renderedBody }, build);
|
|
87
87
|
const final = templating.render(pageTemplateContent, outerVars);
|
|
88
88
|
|
|
89
89
|
const dest = path.join(outputRoot, 'views', rel);
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
const path = require('path');
|
|
16
16
|
const jetpack = require('fs-jetpack');
|
|
17
17
|
const yaml = require('js-yaml');
|
|
18
|
-
const
|
|
18
|
+
const build = require('../../build.js');
|
|
19
19
|
|
|
20
|
-
const logger =
|
|
20
|
+
const logger = build.logger('package-quick');
|
|
21
21
|
|
|
22
22
|
module.exports = function packageQuick(done) {
|
|
23
23
|
const projectRoot = process.cwd();
|
|
@@ -29,7 +29,7 @@ module.exports = function packageQuick(done) {
|
|
|
29
29
|
|
|
30
30
|
let builder;
|
|
31
31
|
try {
|
|
32
|
-
builder =
|
|
32
|
+
builder = require('electron-builder');
|
|
33
33
|
} catch (e) {
|
|
34
34
|
return done(new Error(`Could not resolve electron-builder: ${e.message}`));
|
|
35
35
|
}
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
|
|
11
11
|
const path = require('path');
|
|
12
12
|
const jetpack = require('fs-jetpack');
|
|
13
|
-
const
|
|
13
|
+
const build = require('../../build.js');
|
|
14
14
|
|
|
15
|
-
const logger =
|
|
15
|
+
const logger = build.logger('package');
|
|
16
16
|
|
|
17
17
|
module.exports = function packageApp(done) {
|
|
18
18
|
const projectRoot = process.cwd();
|
|
@@ -25,7 +25,7 @@ module.exports = function packageApp(done) {
|
|
|
25
25
|
// Resolve electron-builder from the consumer's node_modules first, then @omega.js/desktop's bundled one.
|
|
26
26
|
let builder;
|
|
27
27
|
try {
|
|
28
|
-
builder =
|
|
28
|
+
builder = require('electron-builder');
|
|
29
29
|
} catch (e) {
|
|
30
30
|
return done(new Error(`Could not resolve electron-builder: ${e.message}. Run \`npm i -D electron-builder\` in the consumer.`));
|
|
31
31
|
}
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
|
|
15
15
|
const path = require('path');
|
|
16
16
|
const jetpack = require('fs-jetpack');
|
|
17
|
-
const
|
|
17
|
+
const build = require('../../build.js');
|
|
18
18
|
|
|
19
|
-
const logger =
|
|
19
|
+
const logger = build.logger('release');
|
|
20
20
|
|
|
21
21
|
// The two warnings electron-publish prints when it uploads nothing: one per
|
|
22
22
|
// release (`gitHubPublisher.getOrCreateRelease` returns null with its reason)
|
|
@@ -37,7 +37,7 @@ module.exports = function release(done) {
|
|
|
37
37
|
|
|
38
38
|
let builder;
|
|
39
39
|
try {
|
|
40
|
-
builder =
|
|
40
|
+
builder = require('electron-builder');
|
|
41
41
|
} catch (e) {
|
|
42
42
|
return done(new Error(`Could not resolve electron-builder: ${e.message}. Run \`npm i -D electron-builder\` in the consumer.`));
|
|
43
43
|
}
|
package/dist/gulp/tasks/sass.js
CHANGED
|
@@ -10,21 +10,21 @@
|
|
|
10
10
|
// - <output-root>/assets/scss → resolves bare 'brand' to the generated _brand.scss (#912)
|
|
11
11
|
// - <consumer>/src/assets/scss → consumer's own modules
|
|
12
12
|
|
|
13
|
-
const
|
|
14
|
-
const logger =
|
|
13
|
+
const build = require('../../build.js');
|
|
14
|
+
const logger = build.logger('sass');
|
|
15
15
|
const path = require('path');
|
|
16
16
|
const jetpack = require('fs-jetpack');
|
|
17
17
|
const sass = require('sass');
|
|
18
18
|
const { formatBytes } = require('../../vendor/devkit/bundle.js');
|
|
19
19
|
const { composeBrandTokens, renderBrandScss } = require('../../vendor/devkit/brand-tokens.js');
|
|
20
20
|
|
|
21
|
-
const projectRoot =
|
|
22
|
-
const packageRoot =
|
|
21
|
+
const projectRoot = build.getRootPath('project');
|
|
22
|
+
const packageRoot = build.getRootPath('main');
|
|
23
23
|
const outputRoot = require('../../utils/dist-root.js')(projectRoot);
|
|
24
24
|
|
|
25
25
|
module.exports = function sassTask(done) {
|
|
26
|
-
const isProd =
|
|
27
|
-
const config =
|
|
26
|
+
const isProd = build.getMode().environment === 'production';
|
|
27
|
+
const config = build.getConfig() || {};
|
|
28
28
|
const themeId = config.theme?.id || 'classy';
|
|
29
29
|
|
|
30
30
|
// The brand partial ([#912](https://github.com/Omega-JS-Stack/omega/issues/912)):
|
package/dist/gulp/tasks/serve.js
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
// Future passes will add: livereload websocket, watch + rebuild, renderer reload via webContents.reload(),
|
|
5
5
|
// main reload via app.relaunch().
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
const logger =
|
|
7
|
+
const build = require('../../build.js');
|
|
8
|
+
const logger = build.logger('serve');
|
|
9
9
|
const { spawn } = require('child_process');
|
|
10
10
|
const { watchEnvChain } = require('../../vendor/devkit/env-watch.js');
|
|
11
11
|
|
|
12
|
-
const projectRoot =
|
|
12
|
+
const projectRoot = build.getRootPath('project');
|
|
13
13
|
|
|
14
14
|
module.exports = function serve(done) {
|
|
15
15
|
// N7: resolve livereload (and CDP when requested) through the allocator —
|
|
@@ -22,7 +22,7 @@ module.exports = function serve(done) {
|
|
|
22
22
|
|
|
23
23
|
async function resolveServePorts() {
|
|
24
24
|
const { resolvePorts, envPort, CLASSIC_PORTS } = require('../../vendor/config/index.js');
|
|
25
|
-
const configPins =
|
|
25
|
+
const configPins = build.getConfig()?.ports || {};
|
|
26
26
|
|
|
27
27
|
const wanted = { livereload: envPort('livereload') || CLASSIC_PORTS.livereload };
|
|
28
28
|
const pins = {};
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
const fs = require('fs');
|
|
19
19
|
const path = require('path');
|
|
20
|
-
const Logger = require('../
|
|
20
|
+
const Logger = require('../vendor/devkit/logger.js');
|
|
21
21
|
const { submit, stapleAndProve, toolRunner } = require('./lib/notarize-tools.js');
|
|
22
22
|
|
|
23
23
|
const logger = new Logger('notarize-artifacts');
|
package/dist/hooks/notarize.js
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
const path = require('path');
|
|
30
30
|
const fs = require('fs');
|
|
31
31
|
const { execute } = require('node-powertools');
|
|
32
|
-
const Logger = require('../
|
|
32
|
+
const Logger = require('../vendor/devkit/logger.js');
|
|
33
33
|
const { stapleAndProve, toolRunner } = require('./lib/notarize-tools.js');
|
|
34
34
|
|
|
35
35
|
const logger = new Logger('notarize');
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
// Default export
|
|
2
|
-
//
|
|
1
|
+
// Default export: the build-time entry (version + the build module). Each Electron
|
|
2
|
+
// process imports its own ready-made instance from its subpath instead:
|
|
3
3
|
// require('@omega.js/desktop/main')
|
|
4
|
-
//
|
|
4
|
+
// import omega from '@omega.js/desktop/renderer'
|
|
5
5
|
// require('@omega.js/desktop/preload')
|
|
6
6
|
const package = require('../package.json');
|
|
7
7
|
|
|
8
8
|
module.exports = {
|
|
9
|
-
version:
|
|
10
|
-
|
|
11
|
-
Renderer: require('./renderer.js'),
|
|
12
|
-
Preload: require('./preload.js'),
|
|
13
|
-
Build: require('./build.js'),
|
|
9
|
+
version: package.version,
|
|
10
|
+
build: require('./build.js'),
|
|
14
11
|
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// The main process's environment and backend-URL surface: methods mixed into
|
|
2
|
+
// the `Omega` class (src/main.js) with `Object.assign(Omega.prototype, ...)`, so
|
|
3
|
+
// they stay `omega.getEnvironment()`, `omega.getApiUrl()`, ... on the instance.
|
|
4
|
+
|
|
5
|
+
const { getEnvironment, isDevelopment, isProduction, isTesting, getVersion } = require('../utils/mode-helpers.js');
|
|
6
|
+
const { getFunctionsUrl, getApiUrl, getWebsiteUrl, getAuthUrl } = require('../utils/url-helpers.js');
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
// The environment surface (#817): @omega.js/config's ONE implementation,
|
|
10
|
+
// reading the process's OMEGA_ENVIRONMENT, then this instance's baked
|
|
11
|
+
// `config.environment`
|
|
12
|
+
getEnvironment() {
|
|
13
|
+
return getEnvironment.call(this);
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
isDevelopment() {
|
|
17
|
+
return isDevelopment.call(this);
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
isProduction() {
|
|
21
|
+
return isProduction.call(this);
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
isTesting() {
|
|
25
|
+
return isTesting.call(this);
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
getVersion() {
|
|
29
|
+
return getVersion();
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
// The backend URL helpers (utils/url-helpers.js): local in development and
|
|
33
|
+
// testing, the brand's hosts in production. `environment` overrides the
|
|
34
|
+
// running one.
|
|
35
|
+
getFunctionsUrl(environment) {
|
|
36
|
+
return getFunctionsUrl(this, environment);
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
getApiUrl(environment) {
|
|
40
|
+
return getApiUrl(this, environment);
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
getWebsiteUrl(environment) {
|
|
44
|
+
return getWebsiteUrl(this, environment);
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
getAuthUrl(environment, returnUrl) {
|
|
48
|
+
return getAuthUrl(this, environment, returnUrl);
|
|
49
|
+
},
|
|
50
|
+
};
|