Skip to content

Design Meeting Notes, 2/2/2022 #47728

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

Closed
DanielRosenwasser opened this issue Feb 3, 2022 · 1 comment
Closed

Design Meeting Notes, 2/2/2022 #47728

DanielRosenwasser opened this issue Feb 3, 2022 · 1 comment
Labels
Design Notes Notes from our design meetings

Comments

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Feb 3, 2022

Project References and Multiple Externally-Controlled outDirs

#37378

  • "Workspace/monorepo model"

    projects/
    ├── foo/
    │   ├── src
    |   |   └── tsconfig.json
    │   └── out
    ├── bar/
    │   ├── src
    |   |   └── tsconfig.json
    │   └── out
    └── baz/
        ├── src
        |   └── tsconfig.json
        └── out
    
    • When building these, TypeScript looks up from the output directory of each tsconfig.json based on composite projects.
  • People putting everything into the same place

    • "Stone soup"? "Melting pot"?
    projects/
    ├── src/
    │   ├── foo
    │   |   └── tsconfig.json
    │   ├── bar
    │   |   └── tsconfig.json
    │   └── baz
    │       └── tsconfig.json
    └── out/
        ├── foo
        ├── bar
        └── baz
    
  • Then another iteration on this - the idea that you have multiple output targets.

    projects/
    ├── src/
    │   ├── foo
    │   |   └── tsconfig.json
    │   ├── bar
    │   |   └── tsconfig.json
    │   └── baz
    │       └── tsconfig.json
    ├── win-out/
    │   ├── foo
    │   ├── bar
    │   └── baz
    ├── mac-out/
    │   ├── foo
    │   ├── bar
    │   └── baz
    └── linux-out/
        ├── foo
        ├── bar
        └── baz
    
  • Composite projects don't work well here when you have multiple output targets.

    • Need to resolve relative to --outDir
    • So idea: a new flag for this?
  • Is this the right way to do this?

    • Feels like a legitimate setup.
  • How do these build tools work with symlinks?

  • Ideas:

    • Relative locations of tsconfigs are used in conjunction with relative locations of outDirs.
      • Compute relative path from app's tsconfig to library's tsconfig. Then you assume that library's output path is always accessible from the same relative paths.
  • How does this work with outFile?

    • Can say this doesn't work with outFile.
  • What's the general solution here?

    • Fairly narrow problem - is there something broader to consider?
    • Part of this comes down to the issue that there's no true idea of solution-specific settings.
      • Tangent, don't we already have a solution-style tsconfig.json?
        • Yes
        • And projects inherit all their settings from that?
        • No, they all have to extend from the same base tsconfig.
  • What is the usual tsconfig.json usually going to specify for outDir?

  • What's the flag name?

@DanielRosenwasser DanielRosenwasser added the Design Notes Notes from our design meetings label Feb 3, 2022
@alexeagle
Copy link
Contributor

note, as I explained here #37378 (comment)
we can't always assume there is a pair of tsconfig.json files to derive the relative path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Notes Notes from our design meetings
Projects
None yet
Development

No branches or pull requests

2 participants