fix(storybook): make sure skipLibCheck is true (#18212)
This commit is contained in:
parent
c97a8ac63b
commit
d942e7b5fb
@ -23,6 +23,7 @@ import {
|
|||||||
configureTsSolutionConfig,
|
configureTsSolutionConfig,
|
||||||
createProjectStorybookDir,
|
createProjectStorybookDir,
|
||||||
createStorybookTsconfigFile,
|
createStorybookTsconfigFile,
|
||||||
|
editTsconfigBaseJson,
|
||||||
getE2EProjectName,
|
getE2EProjectName,
|
||||||
getViteConfigFilePath,
|
getViteConfigFilePath,
|
||||||
projectIsRootProjectInStandaloneWorkspace,
|
projectIsRootProjectInStandaloneWorkspace,
|
||||||
@ -128,6 +129,7 @@ export async function configurationGenerator(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
configureTsProjectConfig(tree, schema);
|
configureTsProjectConfig(tree, schema);
|
||||||
|
editTsconfigBaseJson(tree);
|
||||||
configureTsSolutionConfig(tree, schema);
|
configureTsSolutionConfig(tree, schema);
|
||||||
updateLintConfig(tree, schema);
|
updateLintConfig(tree, schema);
|
||||||
|
|
||||||
|
|||||||
@ -28,6 +28,7 @@ import {
|
|||||||
import { StorybookConfigureSchema } from '../schema';
|
import { StorybookConfigureSchema } from '../schema';
|
||||||
import { UiFramework7 } from '../../../utils/models';
|
import { UiFramework7 } from '../../../utils/models';
|
||||||
import { nxVersion } from '../../../utils/versions';
|
import { nxVersion } from '../../../utils/versions';
|
||||||
|
import ts = require('typescript');
|
||||||
|
|
||||||
const DEFAULT_PORT = 4400;
|
const DEFAULT_PORT = 4400;
|
||||||
|
|
||||||
@ -259,6 +260,23 @@ export function createStorybookTsconfigFile(
|
|||||||
writeJson(tree, storybookTsConfigPath, storybookTsConfig);
|
writeJson(tree, storybookTsConfigPath, storybookTsConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function editTsconfigBaseJson(tree: Tree) {
|
||||||
|
let tsconfigBasePath = 'tsconfig.base.json';
|
||||||
|
|
||||||
|
// standalone workspace maybe
|
||||||
|
if (!tree.exists(tsconfigBasePath)) tsconfigBasePath = 'tsconfig.json';
|
||||||
|
|
||||||
|
if (!tree.exists(tsconfigBasePath)) return;
|
||||||
|
|
||||||
|
const tsconfigBaseContent = readJson<TsConfig>(tree, tsconfigBasePath);
|
||||||
|
|
||||||
|
if (!tsconfigBaseContent.compilerOptions)
|
||||||
|
tsconfigBaseContent.compilerOptions = {};
|
||||||
|
tsconfigBaseContent.compilerOptions.skipLibCheck = true;
|
||||||
|
|
||||||
|
writeJson(tree, tsconfigBasePath, tsconfigBaseContent);
|
||||||
|
}
|
||||||
|
|
||||||
export function configureTsProjectConfig(
|
export function configureTsProjectConfig(
|
||||||
tree: Tree,
|
tree: Tree,
|
||||||
schema: StorybookConfigureSchema
|
schema: StorybookConfigureSchema
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user