Giter Club home page Giter Club logo

Comments (5)

MKruschke avatar MKruschke commented on May 29, 2024

Hi @rafaelrozon,
thanks for reaching out and yes this sounds reasonable to me. What do you think about the PR #34 would that work for you?

from update-ts-references.

rafaelrozon avatar rafaelrozon commented on May 29, 2024

Yes, that works great. Thanks a lot for making the changes, @MKruschke

I'm now facing a different issue. I can create a new PR if you think it's a good idea to support it. I work on a project with multiple packages and kinds of Typescript config files. Some are used only for type checking in pipelines, others are used to exclude certain folders from the distributed files. What happens is that: 1) I have to use the update-ts-reference.yaml file because I'm using Rush, and 2) that file supports a single configuration set. There's no way for me to update the references for, let's say, tsconfig.json and tsconfig.typecheck.json` files.

I could generate that file on the fly or do some processing before run. But it would be nice if the library supported this.

A couple of approaches I can think of:

  1. the yaml supports multiple configuration
  2. all the options are supported via CLI so users can run the library with different options for different use cases

Again, happy to help.

from update-ts-references.

MKruschke avatar MKruschke commented on May 29, 2024

Hi @rafaelrozon,
did you tried to use extends (since a few versions you can add multiple files there) and move the project references to a dedicated file? But in general the idea/use-case would be fine for me esp if you want to configure different paths.

Ok let's talk about the options:

all the options are supported via CLI so users can run the library with different options for different use cases.

not my favourite here because of readability esp with the paths that you want to pass as array 😅 Alternatively we could think about pointing to a specific config filename via the cli so you can have multiple configs in your project. update-ts-references.yaml for the main use-case and update-ts-references-typecheck.yaml for the other.

the yaml supports multiple configuration

what do you think about some overwrites via a cli param you can choose which one you want to execute npx update-ts-references --use-config typecheck-usecase see below how the config could look like?

configName: 'tsconfig.json'
rootConfigName: 'tsconfig.json'
createPathMappings: true
packages:
  - 'apps/**'
  # exclude packages that are inside test directories
  - '!**/tests/**'
  - '!workspace-ignore'
overwrites:
  - typecheck-usecase:
    configName: 'tsconfig.typecheck.json'
    rootConfigName: 'tsconfig.typecheck.json'
  - cypress-e2e-usecase:
    configName: 'tsconfig.cy.json'
    rootConfigName: 'tsconfig.cy.json'
    packages:
      - 'e2e/**'
 

from update-ts-references.

rafaelrozon avatar rafaelrozon commented on May 29, 2024

Hi Mirko.

We do use the references field in the tsconfig.json files, but that one is not inherited by the Typescript compiler. That's why I would like the update-ts-references library to run with different configurations.

About the options, I prefer the option of passing the config file name from the cli. Personally, I would not go with the overrides option because when reading it I have to trace in the file what gets overwritten and what's stays the same. I prefer configuration files to be very explicit even if it has some duplication. But that's your call.

Thanks!

from update-ts-references.

MKruschke avatar MKruschke commented on May 29, 2024

@rafaelrozon just released a new version now you can use the --usecase param to point to a different yaml file

from update-ts-references.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.