mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-31 09:57:03 +02:00
refactor: make each tsconfig explicitly declare module and include/exclude (#7443)
This commit is contained in:
parent
a0b0477dee
commit
a555fd1dcb
45 changed files with 223 additions and 47 deletions
|
@ -62,7 +62,9 @@ describe('packages', () => {
|
||||||
const packageJsonFiles = await getPackagesJsonFiles();
|
const packageJsonFiles = await getPackagesJsonFiles();
|
||||||
|
|
||||||
packageJsonFiles
|
packageJsonFiles
|
||||||
.filter((packageJsonFile) => packageJsonFile.content.name.startsWith('@'))
|
.filter((packageJsonFile) =>
|
||||||
|
packageJsonFile.content.name?.startsWith('@'),
|
||||||
|
)
|
||||||
.forEach((packageJsonFile) => {
|
.forEach((packageJsonFile) => {
|
||||||
if (packageJsonFile) {
|
if (packageJsonFile) {
|
||||||
// Unfortunately jest custom message do not exist in loops,
|
// Unfortunately jest custom message do not exist in loops,
|
||||||
|
|
66
__tests__/validate-tsconfig.test.ts
Normal file
66
__tests__/validate-tsconfig.test.ts
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
/**
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import fs from 'fs-extra';
|
||||||
|
import {Globby} from '@docusaurus/utils';
|
||||||
|
import {Joi} from '@docusaurus/utils-validation';
|
||||||
|
|
||||||
|
type TsconfigFile = {
|
||||||
|
file: string;
|
||||||
|
content: {
|
||||||
|
extends?: string;
|
||||||
|
compilerOptions: {
|
||||||
|
[key: string]: unknown;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
async function getTsconfigFiles(): Promise<TsconfigFile[]> {
|
||||||
|
const files = await Globby('packages/*/tsconfig.*');
|
||||||
|
return Promise.all(
|
||||||
|
files.map((file) => fs.readJSON(file).then((content) => ({file, content}))),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const tsconfigSchema = Joi.object({
|
||||||
|
extends: '../../tsconfig.json',
|
||||||
|
compilerOptions: Joi.alternatives().conditional(
|
||||||
|
Joi.object({noEmit: true}).unknown(),
|
||||||
|
{
|
||||||
|
then: Joi.object({
|
||||||
|
noEmit: Joi.valid(true).required(),
|
||||||
|
incremental: Joi.forbidden(),
|
||||||
|
tsBuildInfoFile: Joi.forbidden(),
|
||||||
|
outDir: Joi.forbidden(),
|
||||||
|
module: Joi.valid('commonjs', 'es2020', 'esnext').required(),
|
||||||
|
}).unknown(),
|
||||||
|
otherwise: Joi.object({
|
||||||
|
noEmit: Joi.valid(false).required(),
|
||||||
|
incremental: Joi.valid(true).required(),
|
||||||
|
rootDir: Joi.valid('src').required(),
|
||||||
|
outDir: Joi.valid('lib').required(),
|
||||||
|
module: Joi.valid('commonjs', 'es2020', 'esnext').required(),
|
||||||
|
}).unknown(),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
}).unknown();
|
||||||
|
|
||||||
|
describe('tsconfig files', () => {
|
||||||
|
it('contain all required fields', async () => {
|
||||||
|
const tsconfigFiles = await getTsconfigFiles();
|
||||||
|
tsconfigFiles.forEach((file) => {
|
||||||
|
try {
|
||||||
|
Joi.attempt(file.content, tsconfigSchema);
|
||||||
|
} catch (e) {
|
||||||
|
(
|
||||||
|
e as Error
|
||||||
|
).message += `\n${file.file} does not match the required schema.`;
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"module": "es2020",
|
"module": "es2020",
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
|
@ -8,6 +9,6 @@
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
"include": ["src/"],
|
"include": ["src"],
|
||||||
"exclude": ["templates/"]
|
"exclude": ["templates/", "**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,5 +7,6 @@
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"rootDir": "."
|
"rootDir": "."
|
||||||
},
|
},
|
||||||
"include": ["bin"]
|
"include": ["bin"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
|
"module": "commonjs",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
}
|
},
|
||||||
|
"include": ["src"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"declarationMap": true,
|
"declarationMap": true,
|
||||||
|
"module": "commonjs",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
}
|
},
|
||||||
|
"include": ["src"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"declarationMap": true,
|
"declarationMap": true,
|
||||||
|
"module": "commonjs",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
"include": ["src"]
|
"include": ["src"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
|
"module": "commonjs",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
"include": ["src"]
|
"include": ["src"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,5 +7,6 @@
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"rootDir": "."
|
"rootDir": "."
|
||||||
},
|
},
|
||||||
"include": ["bin"]
|
"include": ["bin"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
|
"module": "commonjs",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib",
|
"outDir": "lib"
|
||||||
"typeRoots": ["./types", "./node_modules/@types"]
|
},
|
||||||
}
|
"include": ["src"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
|
"module": "commonjs",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
}
|
},
|
||||||
|
"include": ["src"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo-client",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo-client",
|
||||||
|
@ -9,5 +10,6 @@
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
"include": ["src/client", "src/*.d.ts"]
|
"include": ["src/client", "src/*.d.ts"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"references": [{"path": "./tsconfig.client.json"}],
|
"references": [{"path": "./tsconfig.client.json"}],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
|
"module": "commonjs",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
}
|
},
|
||||||
|
"include": ["src"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo-client",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo-client",
|
||||||
|
@ -9,5 +10,6 @@
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
"include": ["src/theme", "src/*.d.ts"]
|
"include": ["src/theme", "src/*.d.ts"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"references": [{"path": "./tsconfig.client.json"}],
|
"references": [{"path": "./tsconfig.client.json"}],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
|
@ -9,5 +10,5 @@
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
"include": ["src"],
|
"include": ["src"],
|
||||||
"exclude": ["src/theme"]
|
"exclude": ["src/theme", "**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo-client",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo-client",
|
||||||
|
@ -9,5 +10,6 @@
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
"include": ["src/analytics.ts", "src/*.d.ts"]
|
"include": ["src/analytics.ts", "src/*.d.ts"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"references": [{"path": "./tsconfig.client.json"}],
|
"references": [{"path": "./tsconfig.client.json"}],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
|
@ -9,5 +10,5 @@
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
"include": ["src"],
|
"include": ["src"],
|
||||||
"exclude": ["src/analytics.ts"]
|
"exclude": ["src/analytics.ts", "**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo-client",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo-client",
|
||||||
|
@ -9,5 +10,6 @@
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
"include": ["src/gtag.ts", "src/options.ts", "src/*.d.ts"]
|
"include": ["src/gtag.ts", "src/options.ts", "src/*.d.ts"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"references": [{"path": "./tsconfig.client.json"}],
|
"references": [{"path": "./tsconfig.client.json"}],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
|
@ -9,5 +10,5 @@
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
"include": ["src"],
|
"include": ["src"],
|
||||||
"exclude": ["src/gtag.ts"]
|
"exclude": ["src/gtag.ts", "**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo-client",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo-client",
|
||||||
|
@ -9,5 +10,6 @@
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
"include": ["src/theme", "src/*.d.ts"]
|
"include": ["src/theme", "src/*.d.ts"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"references": [{"path": "./tsconfig.client.json"}],
|
"references": [{"path": "./tsconfig.client.json"}],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
|
@ -9,5 +10,5 @@
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
"include": ["src"],
|
"include": ["src"],
|
||||||
"exclude": ["src/theme"]
|
"exclude": ["src/theme", "**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo-client",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo-client",
|
||||||
|
@ -14,5 +15,6 @@
|
||||||
"src/*.d.ts",
|
"src/*.d.ts",
|
||||||
"src/registerSw.ts",
|
"src/registerSw.ts",
|
||||||
"src/renderReloadPopup.tsx"
|
"src/renderReloadPopup.tsx"
|
||||||
]
|
],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,11 +2,18 @@
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"references": [{"path": "./tsconfig.client.json"}],
|
"references": [{"path": "./tsconfig.client.json"}],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
|
"module": "commonjs",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
"include": ["src"],
|
"include": ["src"],
|
||||||
"exclude": ["src/theme/", "src/registerSw.ts", "src/renderReloadPopup.tsx"]
|
"exclude": [
|
||||||
|
"src/theme/",
|
||||||
|
"src/registerSw.ts",
|
||||||
|
"src/renderReloadPopup.tsx",
|
||||||
|
"**/__tests__/**"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
|
"module": "commonjs",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
}
|
},
|
||||||
|
"include": ["src"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
|
"module": "commonjs",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
}
|
},
|
||||||
|
"include": ["src"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"declarationMap": true,
|
"declarationMap": true,
|
||||||
|
"module": "commonjs",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
}
|
},
|
||||||
|
"include": ["src"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,5 +5,6 @@
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"noEmit": true
|
"noEmit": true
|
||||||
},
|
},
|
||||||
"include": ["src/"]
|
"include": ["src/"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
|
@ -10,5 +11,6 @@
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
"include": ["src"]
|
"include": ["src"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo-client",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo-client",
|
||||||
|
@ -9,5 +10,6 @@
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"target": "esnext"
|
"target": "esnext"
|
||||||
},
|
},
|
||||||
"include": ["src/theme", "src/*.d.ts", "src/custom-buble.ts"]
|
"include": ["src/theme", "src/*.d.ts", "src/custom-buble.ts"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"references": [{"path": "./tsconfig.client.json"}],
|
"references": [{"path": "./tsconfig.client.json"}],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
|
"module": "commonjs",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo-client",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo-client",
|
||||||
|
@ -9,5 +10,6 @@
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"target": "esnext"
|
"target": "esnext"
|
||||||
},
|
},
|
||||||
"include": ["src/theme", "src/client", "src/*.d.ts"]
|
"include": ["src/theme", "src/client", "src/*.d.ts"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"references": [{"path": "./tsconfig.client.json"}],
|
"references": [{"path": "./tsconfig.client.json"}],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
|
"module": "commonjs",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"declarationMap": true,
|
"declarationMap": true,
|
||||||
|
"module": "commonjs",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
}
|
},
|
||||||
|
"include": ["src"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,9 +12,6 @@
|
||||||
"directory": "packages/docusaurus-types"
|
"directory": "packages/docusaurus-types"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
|
||||||
"test": "tsc -p ."
|
|
||||||
},
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"commander": "^5.1.0",
|
"commander": "^5.1.0",
|
||||||
"history": "^4.9.0",
|
"history": "^4.9.0",
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"declarationMap": true,
|
"declarationMap": true,
|
||||||
|
"module": "commonjs",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib",
|
"outDir": "lib",
|
||||||
"noEmitHelpers": false
|
"noEmitHelpers": false
|
||||||
}
|
},
|
||||||
|
"include": ["src"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"declarationMap": true,
|
"declarationMap": true,
|
||||||
|
"module": "commonjs",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
}
|
},
|
||||||
|
"include": ["src"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"declarationMap": true,
|
"declarationMap": true,
|
||||||
|
"module": "commonjs",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
}
|
},
|
||||||
|
"include": ["src"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo-client",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo-client",
|
||||||
|
@ -9,5 +10,6 @@
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
"include": ["src/client", "src/*.d.ts"]
|
"include": ["src/client", "src/*.d.ts"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,5 +11,6 @@
|
||||||
"rootDir": ".",
|
"rootDir": ".",
|
||||||
"module": "esnext"
|
"module": "esnext"
|
||||||
},
|
},
|
||||||
"include": ["bin"]
|
"include": ["bin"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
|
"module": "commonjs",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
}
|
},
|
||||||
|
"include": ["src"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
|
"module": "commonjs",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
}
|
},
|
||||||
|
"include": ["src"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"noEmit": false,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||||
|
"module": "commonjs",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
}
|
},
|
||||||
|
"include": ["src"],
|
||||||
|
"exclude": ["**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,13 +2,17 @@
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
/* Emit */
|
/* Emit */
|
||||||
"target": "ES2020",
|
"target": "ES2020",
|
||||||
"module": "commonjs",
|
"lib": ["ESNext"],
|
||||||
"lib": ["ESNext", "DOM"],
|
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
|
// These two options will be selectively overridden in each project.
|
||||||
|
// Utility libraries will have source maps on, but plugins will not.
|
||||||
"declarationMap": false,
|
"declarationMap": false,
|
||||||
|
"sourceMap": false,
|
||||||
"jsx": "react-native",
|
"jsx": "react-native",
|
||||||
"importHelpers": true,
|
"importHelpers": true,
|
||||||
"noEmitHelpers": true,
|
"noEmitHelpers": true,
|
||||||
|
// Avoid accidentally using this config to build
|
||||||
|
"noEmit": true,
|
||||||
|
|
||||||
/* Strict Type-Checking Options */
|
/* Strict Type-Checking Options */
|
||||||
"allowUnreachableCode": false,
|
"allowUnreachableCode": false,
|
||||||
|
@ -44,5 +48,5 @@
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"skipLibCheck": true // @types/webpack and webpack/types.d.ts are not the same thing
|
"skipLibCheck": true // @types/webpack and webpack/types.d.ts are not the same thing
|
||||||
},
|
},
|
||||||
"exclude": ["node_modules", "**/__tests__/**", "**/lib/**/*"]
|
"exclude": ["node_modules", "**/lib/**/*"]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue