Skip to content
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

feat(schematics): create local project tsconfigs for typings #922

Merged
merged 1 commit into from
Nov 25, 2018

Conversation

FrozenPandaz
Copy link
Collaborator

Current Behavior

Typings conflict and get overwritten when jest or cypress are used.

The only tsconfig.json (Which is the only filename IDEs/ tsserver will recognize) is in the root directory meaning the whole workspace is subject to the same configuration within the IDE.

Expected Behavior

Local tsconfig.json files are created in every project root and define the appropriate types for each project. These files extend the root tsconfig.json and are mainly responsible for typings.

tsconfig.(app|lib|spec|e2e).json files will extend off of the local tsconfig

A migration is written which will update existing tsconfigs and create new ones.

I am drafting a wiki page here: https://github.com/FrozenPandaz/nx/wiki/Workspace-Organization#tsconfigs

Issue

Fixes #816

Copy link
Member

@vsavkin vsavkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good except one small change.

types = types.concat(
...getTsConfigs(project).map(tsconfigPath => {
const tsconfig = readJsonInTree(host, tsconfigPath);
return tsconfig.compilerOptions.types || [];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the right thing to do is to set the whole thing to undefined if any of the files have it set to undefined.

@vsavkin vsavkin merged commit cd2e311 into nrwl:master Nov 25, 2018
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editors are unable to properly locate types for spec files
2 participants