GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Enables passing `--declaration`, `--emitDeclarationOnly`, `--declarationMap`, `--soureMap` and `--inlineSourceMap` to `tsc --build` by sheetalkamat · Pull Request #51241 · microsoft/TypeScript

Conversation

@sheetalkamat

@sheetalkamat Sheetal Nandi (sheetalkamat) commented Oct 20, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This enables passing --declaration, --emitDeclarationOnly, --declarationMap, --soureMap and --inlineSourceMap to tsc --build.
As part of this change:

  1. tsbuildInfo stores these options so that we can check if we need to re-emit because of the flag changes,
  2. Changes to builder include, storing affectedFilesPendingEmit as has BuilderFileEmit which is flag of JS, Dts, DtsMap etc. determining what kind of emit is pending
  3. 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
  4. 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
  5. With --out we store all fileInfos and options so we can correctly calcualte the uptodateness and pending emit(js, dts or none)
  6. 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.

All reactions
jakebailey
Jake Bailey (jakebailey) reviewed Oct 20, 2022
View reviewed changes
Comment thread tests/baselines/reference/config/initTSConfig/Default initialized TSConfig/tsconfig.json Resolved

Uh oh!

There was an error while loading. Please reload this page.

@sheetalkamat
Sheetal Nandi (sheetalkamat) force-pushed the commandLineBuildSelected branch 4 times, most recently from 648ce65 to 35994b1 Compare October 21, 2022 22:11
@typescript-bot TypeScript Bot (typescript-bot) assigned Sheetal Nandi (sheetalkamat) Oct 21, 2022
@typescript-bot TypeScript Bot (typescript-bot) added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Oct 21, 2022
@sheetalkamat
Sheetal Nandi (sheetalkamat) force-pushed the commandLineBuildSelected branch 4 times, most recently from 32921e8 to 0efa044 Compare October 21, 2022 23:34
@sheetalkamat
Sheetal Nandi (sheetalkamat) force-pushed the commandLineBuildSelected branch 13 times, most recently from e5a439f to a1390a0 Compare November 3, 2022 21:30
@sheetalkamat
Sheetal Nandi (sheetalkamat) marked this pull request as ready for review November 3, 2022 21:40
@sheetalkamat 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
@sheetalkamat
Sheetal Nandi (sheetalkamat) requested review from Andrew Branch (andrewbranch) and Jake Bailey (jakebailey) November 3, 2022 21:41
@sheetalkamat
Add different tests for baselining before behavior
0b7d853
Sheetal Nandi (sheetalkamat) added 10 commits November 3, 2022 15:32
@sheetalkamat
Fix assert for first project output
a2904e1
@sheetalkamat
Add ability to pass declaration, declarationMap, emitDeclarationOnly,…
c0c3416
… sourceMap and inlineSourceMap on commandline of --build
@sheetalkamat
Store these options in --out scenario
98f0e8d
@sheetalkamat
Store buildInfo program for --out even if not composite
b67235e
@sheetalkamat
Changes to make these commanline options work
9b27e34
@sheetalkamat
Do not include sourceMapUrl text in the sourceFile version
9950d25
@sheetalkamat
Emit complete program in --out scenario as well since we need to dete…
b6519ce
…rmine uptodate ness
@sheetalkamat
Copy js or dts bundle from old build if emitting only js or dts files
fdba2d3
@sheetalkamat
Dont emit dts if we want to emit only js files even though options su…
cdcae30
…ggest emitting d.ts files as well
@sheetalkamat
Adding comments and refactoring some of the code
34e5ec2
@sheetalkamat
Sheetal Nandi (sheetalkamat) force-pushed the commandLineBuildSelected branch from a1390a0 to 34e5ec2 Compare November 3, 2022 22:32
jakebailey
Jake Bailey (jakebailey) reviewed Nov 4, 2022
View reviewed changes
Comment thread tests/baselines/reference/config/initTSConfig/Default initialized TSConfig/tsconfig.json Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jakebailey

Jake Bailey (jakebailey) commented Nov 4, 2022

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) pack this

Going to try this on the module branch.

sheetalkamat reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Nov 4, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Heya Jake Bailey (@jakebailey), I've started to run the tarball bundle task on this PR at 34e5ec2. You can monitor the build here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Nov 4, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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]".;

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jakebailey

Jake Bailey (jakebailey) commented Nov 5, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sheetalkamat
Merge branch 'main' into commandLineBuildSelected
0929a46
@typescript-bot TypeScript Bot (typescript-bot) added For Milestone Bug PRs that fix a bug with a specific milestone and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Nov 7, 2022
andrewbranch
Andrew Branch (andrewbranch) approved these changes Nov 7, 2022
View reviewed changes
@sheetalkamat
Sheetal Nandi (sheetalkamat) merged commit eac566b into main Nov 7, 2022
@sheetalkamat
Sheetal Nandi (sheetalkamat) deleted the commandLineBuildSelected branch November 7, 2022 18:53
@erickzhao Erick Zhao (erickzhao) mentioned this pull request Nov 23, 2022
build: use a single top-level tsc -b for all packages electron/forge#3090
Merged
@Conaclos

Victorien Elvinger (Conaclos) commented Jan 27, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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'

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sheetalkamat

Sheetal Nandi (sheetalkamat) commented Jan 27, 2023

Copy link
Copy Markdown
Member Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@jakebailey Jake Bailey (jakebailey) jakebailey left review comments
@andrewbranch Andrew Branch (andrewbranch) andrewbranch approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@sheetalkamat Sheetal Nandi (sheetalkamat)

Labels

Author: Team For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Allow --emitDeclarationOnly flag to be passed in --build

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@sheetalkamat @jakebailey @typescript-bot @Conaclos @andrewbranch
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.