Skip to content

Commit

Permalink
fix(storybook): path on Win for tsconfig location in angular.json
Browse files Browse the repository at this point in the history
ISSUES CLOSED: #3956
  • Loading branch information
juristr committed Nov 13, 2020
1 parent da77047 commit 1bf5bf4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Expand Up @@ -168,7 +168,7 @@ describe('Update 10-3-0', () => {
\\"path\\": \\"./tsconfig.spec.json\\"
},
{
\\"path\\": \\"./.storybook/tsconfig.json\\"
\\"path\\": \\".storybook/tsconfig.json\\"
}
]
}
Expand Down Expand Up @@ -220,7 +220,7 @@ describe('Update 10-3-0', () => {
\\"path\\": \\"./tsconfig.spec.json\\"
},
{
\\"path\\": \\"./.storybook/tsconfig.json\\"
\\"path\\": \\".storybook/tsconfig.json\\"
}
]
}
Expand Down
10 changes: 6 additions & 4 deletions packages/storybook/src/migrations/update-10-3-0/update-10-3-0.ts
Expand Up @@ -13,6 +13,7 @@ import {
} from '@nrwl/workspace';

import { getTsConfigContent, isFramework } from '../../utils/utils';
import { normalize } from '@angular-devkit/core';

interface ProjectDefinition {
root: string;
Expand Down Expand Up @@ -55,9 +56,8 @@ function updateLintTarget(
const paths = {
tsConfig: path.join(options.projectConfig.root, 'tsconfig.json'),
tsConfigLib: path.join(options.projectConfig.root, 'tsconfig.lib.json'),
tsConfigStorybook: path.join(
options.projectConfig.root,
'.storybook/tsconfig.json'
tsConfigStorybook: normalize(
path.join(options.projectConfig.root, '.storybook/tsconfig.json')
),
};

Expand Down Expand Up @@ -102,7 +102,9 @@ function updateLintTarget(
(ref) => ref.path !== './.storybook/tsconfig.json'
)
) {
tsConfig.main.references.push({ path: './.storybook/tsconfig.json' });
tsConfig.main.references.push({
path: normalize('./.storybook/tsconfig.json'),
});
tree.overwrite(paths.tsConfig, serializeJson(tsConfig.main));
}

Expand Down

0 comments on commit 1bf5bf4

Please sign in to comment.