Unit and integration tests have been failing due to failed logging of
`Error` objects. These were creating an issue where `mocha` was not
properly returning right exit codes, leading to test pipelines
incorrectly passing despite test failures.
- Fix runtime behavior of failing to retrieve error stacks.
- Add tests for error handling.
- Add more robust custom error handling.
Related issues: babel/babel#14273, vuejs/vue-cli#6994.
- Unify reading subtitle/slogan throughout the application.
- Refactor related unit tests for easier future changes.
- Add typed constants for Vue app environment variables.
Unify definition of aliases in single place.
Make TypeScript configuration file (`tsconfig.json`) source of truth
regarding aliases.
Both webpack (through `vue.config.js`) and ESLint (through
`.eslintrc.js`) now reads the alias configuration from `tsconfig.json`.
Remove using Webpack import syntax such as: `js-yaml-loader!@/..`. It's
a non-standard syntax that couples the code to Webpack.
Configure instead by specifying Webpack loader in Vue configuration
file.
Enable related ESLint rules.
Remove unused dependency `raw-loader` and refactor
`NoUnintendedInlining` test to load files using file system (dropping
webpack dependency).
Refactor to use `import type` for type imports to show the indent
clearly and satisfy failing ESLint rules.
This commit ensures that all dependencies in `node_modules` will be
transpiled by Babel.
Dependencies are not transpiled by babel as default. `babel-loader`
ignores all files inside `node_modules`.
Not using it may allow packages using newer JavaScript (such as ES6) to
cause unintended crashed on older browsers.
This configuration is the default in projects created by newer versions
of Vue CLI.
Major refactoring using ESLint with rules from AirBnb and Vue.
Enable most of the ESLint rules and do necessary linting in the code.
Also add more information for rules that are disabled to describe what
they are and why they are disabled.
Allow logging (`console.log`) in test files, and in development mode
(e.g. when working with `npm run serve`), but disable it when
environment is production (as pre-configured by Vue). Also add flag
(`--mode production`) in `lint:eslint` command so production linting is
executed earlier in lifecycle.
Disable rules that requires a separate work. Such as ESLint rules that
are broken in TypeScript: no-useless-constructor (eslint/eslint#14118)
and no-shadow (eslint/eslint#13014).
Upgrade to v5.x using `vue upgrade --next`.
Update `vue.config.js` to import and use `defineConfig`, because it
provides type safety and created by Vue CLI 5 as default.
Vue CLI 5.x upgrades from webpack 4 to 5. It causes some issues that this
commit attemps to fix:
1. Fail due to webpack resolving of Ace.
Third-party dependency (code editor) Ace uses legacy `file-loader`
for webpack resolving. It's not supported in webpack 5. So change it
with manual imports.
Refs: ajaxorg/ace-builds#211, ajaxorg/ace-builds#221.
2. Wehpack drops polyfilling node core modules (`path`, `fs`, etc.).
Webpack does not polyfill those modules by default anymore. This is
good because they did not need browser polyfilling as they are
used in desktop version only and resolved already by Electron.
To resolve errors (using webpack recommendations):
- Add typeof check around `process` variable.
- Tell webpack explicitly to ignore used node modules.
3. Fail due to legacy dependency of vue-cli-plugin-electron-builder.
This plugin is used for electron builds and development. It still
uses webpack 4 that leads to failed builds.
Downgrading `ts-loader` to latest version which has support for
`loader-utils` solves the problem (typestrong/ts-loader#1288).
Related issue: nklayman/vue-cli-plugin-electron-builder#1625
4. Compilation fails due to webpack loading of `fsevents` on macOS.
This happens only when running `vue-cli-service test:unit` command
(used in integration tests and unit tests). Other builds work fine.
Refs: yan-foto/electron-reload#71,
nklayman/vue-cli-plugin-electron-builder#712,
nklayman/vue-cli-plugin-electron-builder#1333
For fully automatic macOS updates, electron-updater requires:
1. Distributing macOS file as .zip (electron-userland/electron-builder#2199)
2. Code signing for the application
privacy.sexy as of today lacks both the distribution and code signing.
This commit introduces auto-updates through automatically checking for
updates, downloading them but requiring user to drag application icons
to Applications by opening dmg file.
This commit also fixes:
1. Progress state in update progress bar not being shown.
2. Downloading updates were being triggered even though it was not
desired as downloads are being handled using different based on OS and
user choice.
In the end it refactors the code for handling updates of two different
kinds, and making message dialog use enums for results instead of
response integers as well as setting default and cancel button behavior.
Refactorings make behaviors more explicit and extends the control.
Before we used native method from electron for updating and notifying
(`checkForUpdatesAndNotify`). It simply checked if there's an update,
downloaded it, applied in the background and showed OS notification.
The flow is now updated. Updates will be checked, user will be asked to
confirm about whether to download and apply the updates, then a UI with
progress bar will be shown and user will be asked to restart the
application.
This commit also moves electron related logic to `/electron/` folder (as
there are now multiple files) to keep them structured. Also the electon
entrypoint `background.ts` is renamed to `main.ts`. The reason it was
named `background.ts` by vue-cli-plugin-electron-builder was to remove
the confusion between `main.ts` of Vue itself. However, as they are
kept in different folders, but this is not the case for us.
Better than `checkForUpdatesAndNotify`.
Organizes electron desktop app logic in same folder to allow using
multiple files in a structured manner.
Alias would remove unnecessary repetitions and less relative paths make changes easier when moving around files. This commit cleans also up some relative paths ('../../../') by using the alias and orders imports. It updates both path alias in tsconfig and module alias in Vue CLI's bundler (vuejs/vue-cli#2398).
- Move most GUI related code to /presentation
- Move components to /components (separate from bootstrap and style)
- Move shared components helpers to /components/shared
- Rename Bootstrapping to bootstrapping to enforce same naming
convention in /presentation