-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preparations to use javascript modules and other small fixes #1050
Merged
araujoarthur0
merged 12 commits into
thamara:main
from
araujoarthur0:renaming-extensions
Jan 8, 2024
Merged
Preparations to use javascript modules and other small fixes #1050
araujoarthur0
merged 12 commits into
thamara:main
from
araujoarthur0:renaming-extensions
Jan 8, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1050 +/- ##
==========================================
- Coverage 79.89% 79.36% -0.53%
==========================================
Files 21 19 -2
Lines 1278 1231 -47
Branches 190 183 -7
==========================================
- Hits 1021 977 -44
+ Misses 257 254 -3 ☔ View full report in Codecov by Sentry. |
araujoarthur0
force-pushed
the
renaming-extensions
branch
from
January 8, 2024 00:25
ddb799c
to
01d7fab
Compare
araujoarthur0
force-pushed
the
renaming-extensions
branch
from
January 8, 2024 00:30
01d7fab
to
5a3f644
Compare
thamara
approved these changes
Jan 8, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related issue
This helps #1037
Context / Background
The new electron 28 changes things by providing main electron imports through JS modules. That means we'll be able to use
import
syntax rather than node'srequire()
, and no longer need theesm
module to use both notations.The
require()
notation will still be available, making it the best of both worlds for other imports that haven't migrated yet - date-holidays for example.I'm separating a few of the changes that will need to be made for a simpler review. These changes here still work in electron 27 and will clear the field for a larger patch.
What change is being introduced by this PR?
Using the .cjs extension for files that will be using only node modules
Commit: Renaming window-aux and app-config to .cjs
Updating pre-commit script
Script was trying to format deleted files. It also had to be updated to format .cjs and .mjs files
Commit: Preparing commit hook to accept mjs and cjs files, avoiding deleted files
Commit: Adding all 3 js extensions to eslint target
Cleanups
Commit: Adding 'use strict' to all files
Commit: Export section to have commas and be sorted, last line at end
Switching imports to
import
keyword rather thanrequire()
Commit: Updating renderer electron imports
Commit: Switching 'fs' import to use import
Commit: Switching 'electron-store' import to use import
Commit: Switching notification.js to use export
Commit: Switching 'path' import to use import
Commit: Switching 'electron' to use import
How will this be tested?
Testsuite works fine.