-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Remove lib folder (LKG) and use node_modules for building #52226
Conversation
scripts/produceLKG.mjs
Outdated
@@ -15,6 +15,7 @@ const dest = path.join(root, "lib"); | |||
|
|||
async function produceLKG() { | |||
console.log(`Building LKG from ${source} to ${dest}`); | |||
await fs.mkdirp(dest); |
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.
Seems weird that this is also on line 20 but maybe that's intentional; just observing.
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.
Probably the latter can go away; it has to at least come first because del
behaves poorly if the root doesn't exist. I'll test.
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.
Actually, this code is pointless now. I should just delete the dir and recreate it. It won't have a README either.
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.
Changed. This was probably a side effect of me hacking to make it work many months ago and then never coming back to it until now, now that this is apparently happening and in the iteration planning 😅
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.
All I really want is a type system for describing whether various make dir / delete dir / copy to dir functions fail/don't fail when the relevant target is already there / not there yet / already deleted 🫠
@typescript-bot pack this |
Heya @jakebailey, I've started to run the tarball bundle task on this PR at 8d71f47. You can monitor the build here. |
Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running There is also a playground for this build and an npm module you can use via |
Well, I've restored the status quo when it comes to package size testing. I'll test out some other options for later but now the PR should keep things going. |
Seems like it's Go Time. Thanks for reviewing this. |
Per #52199, this:
--lkg
,--built
, and no flag, with the default beingnode_modules
.--save-exact
, which is likely what we will want to use.Why?
typescript-eslint
, we have to have a copy innode_modules
; this version may differ from the LKG and cause differences whentypescript-eslint
runs the type checker again. The only things you can do are:node_modules
,lib
, and the built compiler.npm link
, you have to clean/restorelib
each time you need to switch commits, as the package is also inlib
and therefore is replaced onhereby lkg
.lib
onmain
, thinking it actually means something, but it doesn't; it's just whatever random version we are currently using to compile the compiler. It can be arbitrarily out of date. For example,lib
contained a copy of ~TS 4.4 for multiple releases.Downsides
node_modules
being out of date. Right now, this is already a reality for the core build system, but since LKG was checked in, at least the compiler would always run. Now, if crossing a threshold wherenode_modules
' copy of TypeScript changed, annpm ci
will be required.lib
is gitignored and we still want to check inlib
to release branches, we'll have to make sure to force add the dir there."type": "module"
in ourpackage.json
; we'll need to ensure that "typescript" when referenced in our repo still goes tonode_modules
and not ourselves.lib
. But this should only happen if you regularly runlkg
, which already would have left the tree dirty in a more annoying way.