-
-
Notifications
You must be signed in to change notification settings - Fork 363
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
Add first class Javascript/Typescript support to the Mill build tool #4003
Conversation
- running - bundling of a Node CLI tool - type checking - testing
Each top-level bullet of the original bounty should be its own PR. For this PR, just focus on |
0cc206f
to
f8571ae
Compare
778db96
to
ab371d8
Compare
It's a start and good that tests pass, but the code in the various For reference, look at the equivalent |
- Abstract Jest Testing - Abstract React scripts
javascriptlib/src/mill/javascriptlib/CreateReactAppModule.scala
Outdated
Show resolved
Hide resolved
- allow for specification of compiler options
@jodersky could you give this a review when you have some time? Since your work on the Python side is very similar you may have ideas that are transferable to JS/TS |
refine TypeScriptModule: - user defined compiler options refine ReactScriptsModule: - user defined compiler options - user defined package options - user defined env options RsWithServeModule: - serve static html files via serve.js
- use `Task[(Option[Seq[String]], Option[Seq[String]])]` for computed arguments fix failing tests
Will do! |
- update default tsconfig - use ts-node to run - use esbuild script to compile ts - compilerOptions can be modified from calling object
- include declarations of module dependencies in paths - correct path to typescript
- add bundle flags
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 think this would be easier to review and improve if each example were its own pull request, starting with only the basic example.
A couple of things stand out to me:
-
I think that testing can be factored out into its own module, without having to subclass modules and have custom tasks. Eg. instead of defining the "main" module to be a
JestModule
withtestSources
etc, the test sources could become the normal sources of a nestedJestModule
which would extend something like `TestModule. This is how Mill's Java and Scala support does it, and is what I used for the Python support as well. -
It will also be easier to approach this by documentation to examples first, and also commenting what every task is supposed to do.
In general, I'd suggest to take a look at what we're doing with pythonlib
and use it as inspiration on how to approach this. The reason is that it's still fairly minimal and to-the-point, but it does strive to follow general tendencies and structure of the established javalib
and scalalib
.
the abstraction (TestModule) is done in another pr, as that extends beyond the scope of this task set (and many other things here really) I can open that next after this is done / move them here whichever you prefer @jodersky Separating into smaller pr's would be somewhat difficult, its length is due to the modifications made to TypescriptModule and creating the other two modules. I promise the other pr's would be much smaller. Also as there are different Test frame works I will be working with through the project, |
I think this looks in decent enough state to merge. It's not perfect, but it would be useful to get some of the follow on use cases in place first before polishing further. @monyedavid there's a test failure that needs to be fixed, then I'll merge this and close out the bounty |
export User interface from foo/bar/*
Merged this, thanks @monyedavid for bearing with all our review and feedback! I think the PR is in a great state now to build upon for later, and I expect follow-up PRs to be easier since you are now more familiar with the Mill tool, codebase, and coding conventions. Please send me your international bank transfer details over email and I will wire over the bounty |
Related Issues
#3927
Checklist