mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 07:21:17 +08:00
ignore some types issues, not generate types for create-storybook
This commit is contained in:
parent
14b609a00d
commit
96c4ab206e
@ -19,23 +19,12 @@
|
|||||||
"author": "Storybook Team",
|
"author": "Storybook Team",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
|
||||||
"import": "./dist/index.js"
|
|
||||||
},
|
|
||||||
"./bin/index.cjs": "./bin/index.cjs",
|
"./bin/index.cjs": "./bin/index.cjs",
|
||||||
"./package.json": "./package.json"
|
"./package.json": "./package.json"
|
||||||
},
|
},
|
||||||
"main": "dist/index.cjs",
|
"main": "dist/index.cjs",
|
||||||
"module": "dist/index.js",
|
"module": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
|
||||||
"typesVersions": {
|
|
||||||
"*": {
|
|
||||||
"*": [
|
|
||||||
"./dist/index.d.ts"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"bin": "./bin/index.cjs",
|
"bin": "./bin/index.cjs",
|
||||||
"files": [
|
"files": [
|
||||||
"bin/**/*",
|
"bin/**/*",
|
||||||
@ -86,7 +75,8 @@
|
|||||||
],
|
],
|
||||||
"formats": [
|
"formats": [
|
||||||
"node-esm"
|
"node-esm"
|
||||||
]
|
],
|
||||||
|
"types": false
|
||||||
},
|
},
|
||||||
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
|
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16"
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ const installStorybook = async <Project extends ProjectType>(
|
|||||||
skipInstall: options.skipInstall,
|
skipInstall: options.skipInstall,
|
||||||
};
|
};
|
||||||
|
|
||||||
const language = await detectLanguage(packageManager);
|
const language = await detectLanguage(packageManager as any);
|
||||||
const pnp = await detectPnp();
|
const pnp = await detectPnp();
|
||||||
|
|
||||||
const generatorOptions: GeneratorOptions = {
|
const generatorOptions: GeneratorOptions = {
|
||||||
@ -341,7 +341,7 @@ export async function doInitiate(options: CommandOptions): Promise<
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
projectType = (await detect(packageManager, options)) as ProjectType;
|
projectType = (await detect(packageManager as any, options)) as ProjectType;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
done(String(err));
|
done(String(err));
|
||||||
throw new HandledError(err);
|
throw new HandledError(err);
|
||||||
|
@ -26,6 +26,7 @@ type BundlerConfig = {
|
|||||||
pre: string;
|
pre: string;
|
||||||
post: string;
|
post: string;
|
||||||
formats: Formats[];
|
formats: Formats[];
|
||||||
|
types?: boolean;
|
||||||
};
|
};
|
||||||
type PackageJsonWithBundlerConfig = PackageJson & {
|
type PackageJsonWithBundlerConfig = PackageJson & {
|
||||||
bundler: BundlerConfig;
|
bundler: BundlerConfig;
|
||||||
@ -49,6 +50,7 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => {
|
|||||||
pre,
|
pre,
|
||||||
post,
|
post,
|
||||||
formats = ['esm', 'cjs'],
|
formats = ['esm', 'cjs'],
|
||||||
|
types = true,
|
||||||
},
|
},
|
||||||
} = (await fs.readJson(join(cwd, 'package.json'))) as PackageJsonWithBundlerConfig;
|
} = (await fs.readJson(join(cwd, 'package.json'))) as PackageJsonWithBundlerConfig;
|
||||||
|
|
||||||
@ -89,6 +91,7 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => {
|
|||||||
formats,
|
formats,
|
||||||
entries,
|
entries,
|
||||||
optimized,
|
optimized,
|
||||||
|
types,
|
||||||
});
|
});
|
||||||
|
|
||||||
/* preset files are always CJS only.
|
/* preset files are always CJS only.
|
||||||
@ -245,15 +248,17 @@ async function getDTSConfigs({
|
|||||||
formats,
|
formats,
|
||||||
entries,
|
entries,
|
||||||
optimized,
|
optimized,
|
||||||
|
types,
|
||||||
}: {
|
}: {
|
||||||
formats: Formats[];
|
formats: Formats[];
|
||||||
entries: string[];
|
entries: string[];
|
||||||
optimized: boolean;
|
optimized: boolean;
|
||||||
|
types: boolean;
|
||||||
}) {
|
}) {
|
||||||
const tsConfigPath = join(cwd, 'tsconfig.json');
|
const tsConfigPath = join(cwd, 'tsconfig.json');
|
||||||
const tsConfigExists = await fs.pathExists(tsConfigPath);
|
const tsConfigExists = await fs.pathExists(tsConfigPath);
|
||||||
|
|
||||||
const dtsBuild = optimized && formats[0] && tsConfigExists ? formats[0] : undefined;
|
const dtsBuild = types && optimized && formats[0] && tsConfigExists ? formats[0] : undefined;
|
||||||
|
|
||||||
const dtsConfig: DtsConfigSection = {
|
const dtsConfig: DtsConfigSection = {
|
||||||
tsconfig: tsConfigPath,
|
tsconfig: tsConfigPath,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user