-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
refactor: TypeScript rewrite #1593
Conversation
07443bd
to
456e681
Compare
d47c5bb
to
cd844b5
Compare
74e88c6
to
c3dd70d
Compare
c4864a2
to
2649717
Compare
Codecov Report
@@ Coverage Diff @@
## main #1593 +/- ##
===========================================
- Coverage 95.65% 84.42% -11.24%
===========================================
Files 15 16 +1
Lines 783 828 +45
Branches 0 163 +163
===========================================
- Hits 749 699 -50
- Misses 34 94 +60
- Partials 0 35 +35
📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
9924874
to
ffb30cc
Compare
5b35113
to
1644eb0
Compare
@@ -1,5 +1,5 @@ | |||
import { normalizePath, warning } from './common'; | |||
import galactus from 'galactus'; | |||
import { DestroyerOfModules, DepType, Module, ModuleMap } from 'galactus'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The names will always be funny to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave this whole PR one solid read - and even though it's massive and I think I should have found one place to provide constructive feedback, this seems mostly pretty good to me.
The one thing we should make double-and-triple sure before merging is that nobody can actually rely on electron-packager/hooks
- and if they could, that we maybe just keep it and cut it in a later PR.
"main": "src/index.js", | ||
"types": "src/index.d.ts", | ||
"main": "dist/index.js", | ||
"types": "dist/types.d.ts", | ||
"bin": { | ||
"electron-packager": "bin/electron-packager.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: I'm pretty sure you'll need to update this file. (Although I don't know if I'd necessarily convert it to TypeScript, since it's basically a Node.js-version-checking shim for src/cli
.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're still shipping the bin
directory to npm, so the path here is fine — I did forgot to update a require
in that file from src
to dist
though 😅
That being said, do we really need this file? Like, if the user has e.g. Node 10 and we require Node 16, the package manager should prevent packager
from being installed (unless they're using --ignore-engines
, but then the user should be aware that things can break)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'd be surprised how many issues were filed back in the day about why there were SyntaxErrors even though the minimum engine has been specified for a very long time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I happened to find a relatively new instance of this with Electron Forge in the Discord server: the user was using Node.js 12 when Forge requires Node.js 16, and Forge definitely has engine constraints in its various package.json files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, now I see why the validation is there, we shouldn't trust engines
at all. Adding a proper validation to the ~40 packages in the Forge monorepo is gonna be fun 😟
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just add it to the two CLI-facing packages: create-electron-app
and @electron-forge/cli
.
83bf2ce
to
5ccd8d1
Compare
Something to watch out for, there's at least one usage in Forge that directly reaches into |
5ccd8d1
to
47e4006
Compare
d9ada2e
to
437471a
Compare
early draft so I don't forget it: electron/forge@c9da714 |
@erikian, couple of conflicts due to other PRs landing. |
…ewrite # Conflicts: # package.json # yarn.lock
7795430
to
48a47a3
Compare
🎉 This PR is included in version 18.1.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summarize your changes: