Open jasonkuhrt opened 4 years ago
@jasonkuhrt is this just for typescript formatting? If so, dprint-plugin-typescript is MIT and you could integrate it without legal issue: https://crates.io/crates/dprint-plugin-typescript -- That's what Deno used for deno fmt
.
The CLI and json & markdown formatters aren't MIT though. The CLI also uses a lot of parallelization to speed things up in Rust, which wouldn't be possible in JS.
What's this feature? Nexus provides prettier for code formatting and that's distributed with Nexus? I don't see prettier as a dependency (only dev dependency).
Appreciate the input @dsherret. Yes we'd be primarily interested in TS formatting.
You're right prettier is not a dep yet. What could happen in the future though:
scaffolded nexus projects would be setup with autoformatting e.g. npm script
nexus generates some code, more in the future, would pass all code through prettier using the user's prettier settings first
going further: "$ nexus build" might optionally include a format step one day
really not sure about this but maybe a "$ nexus format" one day
Being able to format as much as possible seems nice, but TS is the overwhelming majority of code.
Once nexus supports JS then JS code too.
For example the GraphQL SDL generated by nexus would go through prettier.
Perceived Problem
prettier
to format codeIdeas / Proposed Solution(s)
dprint
solves those issuesdrpint
license might be a problem, need to talk with @dsherret more about what it would mean for Nexus to bundle it. For example would it just be a matter of users needing to buy the license if their app is commercial/private? Would it change the calculus at all ifdprint
were shipped as a Nexus plugin instead of inside Nexus core?prettier
should still be an option for users too. But we could for example default todprint
. Or vice-versa.