mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-02 00:09:48 +02:00
refactor: make JS executables included in the tsconfig for editor hints (#6861)
* refactor: make JS executables included in the tsconfig for editor hints * oops
This commit is contained in:
parent
a6e72192fa
commit
44d73f7230
11 changed files with 94 additions and 64 deletions
|
@ -245,34 +245,33 @@ cli.arguments('<command>').action((cmd) => {
|
|||
});
|
||||
|
||||
/**
|
||||
* @param {string} command
|
||||
* @param {string | undefined} command
|
||||
*/
|
||||
function isInternalCommand(command) {
|
||||
return [
|
||||
'start',
|
||||
'build',
|
||||
'swizzle',
|
||||
'deploy',
|
||||
'serve',
|
||||
'clear',
|
||||
'write-translations',
|
||||
'write-heading-ids',
|
||||
].includes(command);
|
||||
return (
|
||||
command &&
|
||||
[
|
||||
'start',
|
||||
'build',
|
||||
'swizzle',
|
||||
'deploy',
|
||||
'serve',
|
||||
'clear',
|
||||
'write-translations',
|
||||
'write-heading-ids',
|
||||
].includes(command)
|
||||
);
|
||||
}
|
||||
|
||||
async function run() {
|
||||
if (!isInternalCommand(process.argv.slice(2)[0])) {
|
||||
await externalCommand(cli, await resolveDir('.'));
|
||||
}
|
||||
|
||||
cli.parse(process.argv);
|
||||
|
||||
if (!process.argv.slice(2).length) {
|
||||
cli.outputHelp();
|
||||
}
|
||||
if (!isInternalCommand(process.argv.slice(2)[0])) {
|
||||
await externalCommand(cli, await resolveDir('.'));
|
||||
}
|
||||
|
||||
run();
|
||||
if (!process.argv.slice(2).length) {
|
||||
cli.outputHelp();
|
||||
}
|
||||
|
||||
cli.parse(process.argv);
|
||||
|
||||
process.on('unhandledRejection', (err) => {
|
||||
logger.error(err);
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
"docusaurus": "bin/docusaurus.mjs"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc && tsc -p tsconfig.client.json && node copyUntypedFiles.mjs",
|
||||
"watch": "node copyUntypedFiles.mjs && concurrently -n \"server,client\" --kill-others \"tsc --watch\" \"tsc -p tsconfig.client.json --watch\""
|
||||
"build": "tsc -p tsconfig.server.json && tsc -p tsconfig.client.json && node copyUntypedFiles.mjs",
|
||||
"watch": "node copyUntypedFiles.mjs && concurrently -n \"server,client\" --kill-others \"tsc -p tsconfig.server.json --watch\" \"tsc -p tsconfig.client.json --watch\""
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/facebook/docusaurus/issues"
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
// For editor typechecking; includes bin
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "./tsconfig.server.json",
|
||||
"compilerOptions": {
|
||||
"incremental": true,
|
||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||
"rootDir": "src",
|
||||
"outDir": "lib",
|
||||
"allowJs": true
|
||||
"noEmit": true,
|
||||
"rootDir": ".",
|
||||
"module": "esnext"
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": ["**/__tests__/**/*", "src/client"]
|
||||
"include": ["src", "bin"]
|
||||
}
|
||||
|
|
12
packages/docusaurus/tsconfig.server.json
Normal file
12
packages/docusaurus/tsconfig.server.json
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"incremental": true,
|
||||
"tsBuildInfoFile": "./lib/.tsbuildinfo",
|
||||
"rootDir": "src",
|
||||
"outDir": "lib",
|
||||
"allowJs": true
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": ["**/__tests__/**/*", "src/client"]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue