GeezerVison is showing github.com — Enables passing `--declaration`, `--emitDeclarationOnly`, `--declarationMap`, `--soureMap` and `--inlineSourceMap` to `tsc --build` by sheetalkamat · Pull Request #51241 · microsoft/TypeScript
Conversation
This enables passing --declaration, --emitDeclarationOnly, --declarationMap, --soureMap and --inlineSourceMap to tsc --build.
As part of this change:
- tsbuildInfo stores these options so that we can check if we need to re-emit because of the flag changes,
- Changes to builder include, storing affectedFilesPendingEmit as has BuilderFileEmit which is flag of JS, Dts, DtsMap etc. determining what kind of emit is pending
- emit signatures for composite project encode if emit was done using
declrationMap options different from what the current compilerOptions are (eg if there are errors there wont be emit and emitSignature can go out of sync with options). This helps with checking if d.ts has changed or not irrespective of it being emitted with map
- Source file version also excludes sourceMappingUrl so that sourceFile version is independent of sourceMap. Both of these steps helps with avoidin unnecessary builds in downstream projects
- With --out we store all fileInfos and options so we can correctly calcualte the uptodateness and pending emit(js, dts or none)
- Enables the js only emit and handles --out bundling story when doing partial emit (keeping existing js or dts bundle information in buildInfo)
Fixes #51164
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Sheetal Nandi (sheetalkamat)
changed the title
[WIP] Some of the selected options of --build
Enables passing --declaration, --emitDeclarationOnly, --declarationMap, --soureMap and --inlineSourceMap to tsc --build
Nov 3, 2022
… sourceMap and inlineSourceMap on commandline of --build
…ggest emitting d.ts files as well
Uh oh!
There was an error while loading. Please reload this page.
sheetalkamat reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Hey Jake Bailey (@jakebailey), I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:
{
"devDependencies": {
"typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/137645/artifacts?artifactName=tgz&fileId=F047FEE07F98961F99E4D66E9BE280123DA2BEDF5528C75C0D43136275FB686E02&fileName=/typescript-5.0.0-insiders.20221104.tgz"
}
}
and then running npm install.
There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/[email protected]".;
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Tested it out, and it does appear to work, nice!
Not sure Andrew has had time to look at this quite yet, but it seems reasonable to me. Mostly test baseline changes.
|
sheetalkamat reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Should outDir be accepted as well?
e.g.
tsc --build src --emitDeclarationOnly --outDir dist
For now I got the following error: Compiler option '--outDir' may not be used with '--build'
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Should outDir be accepted as well?
all the path related options are per project specific so will not be part of --build because it's for building multiple projects.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|