-
Notifications
You must be signed in to change notification settings - Fork 5
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
New project: Community-driven tsc
with extra flags.
#5
Comments
Sounds interesting. I know that the typedoc project has tried to wrap I'm not sure how typescript adding plugins fits into this. Do plugins reduce the need for CLI wrappers? |
grunt-ts is a wrapper to tsc and also essentially has its own version of tsconfig parsing; it effectively does much of what you have proposed in "a", minus the language service. You could certainly crib some stuff from there. I think your idea is a good one. TSC definitely has a handful of features that are not supported via tsconfig and vice versa. For example I have been honestly wanting something like what you've described for a while for grunt-ts. Even for the scenario of, for example, implementing the equivalent of |
@aciccarello Language service plugins don't run within
@nycdotnet thanks, I'll take a look at the grunt-ts code. Regarding features that are only supported in either tsconfig or tsc, I'd like this library to handle that as well.
And it will return:
*Callers can request that these items are omitted for performance We should eventually support discovering composite tsconfigs as well, but I'm not sure exactly how that should look. |
What are you referring to regarding “composite” tsconfig? The code in grunt-ts could use a refactor or two but at least it’s covered with tests and it supports merging a tsconfig with the arguments from the Gruntfile (though some recent switches aren’t natively supported yet because I am lazy). For a goof you might also want to check out csproj2ts which parses msbuild project files for TypeScript switches (though it has a rather poor implementation of the msbuild logic). Not sure if that would be useful to you except perhaps as more inspiration for parsing arguments or for some type definitions. Good luck! |
"Composite" refers to project references via If a project is configured to use I think this is a low priority feature, but still worth considering. |
my bad - been a while since I looked into this. Should have known! |
I finally made the first baby steps implementing this idea. If you're curious, I tried to explain the rationale in the README.md |
Replacement for TypeStrong/ts-node#770.
I have an idea for a new project that I think is a good TypeStrong candidate, and I'm hoping to solicit a second opinion.
tsc
is very compelling as a straightforward CLI interface to the compiler. For example, one of my coworkers -- not a TypeScript developer -- was curious what it could do for his project, so he didnpx typescript tsc --noEmit --allowJs --checkJs
. CLIs are great for accessibility. The TypeScript team talks about this in their 2019 roadmap, under "command-line experiences." Some really cool compiler features aren't exposed by the CLI:--pretty
-- as parse-able JSONI think the barrier to entry with a project like this, is there's no easy way (that I'm aware of) to do all the bootstrapping that
tsc
does. It discovers tsconfig, loads and parses "extend"ed tsconfigs, gets a list of source files, and creates a language service. Ideally there would be a single function call to: augment tsc with additional CLI flags to parse, perform the above tsconfig discovery, and get back a parsed config and a language service instance.I suppose I'm proposing 2 projects:
tsc
's bootstrapping, giving you a fully parsed tsconfig and a language service instance to do whatever you want.tsc
drop-in replacement with miscellaneous extra features, powered by (a).Am I reinventing the wheel? Is this a good candidate for TypeStrong? Is there prior art I can build off?
EDIT: cleaned up a few sentences
The text was updated successfully, but these errors were encountered: