From 8e89d64c426824cb0deb090f07e9688130e12596 Mon Sep 17 00:00:00 2001 From: rakannimer Date: Tue, 17 Dec 2019 12:06:02 +0200 Subject: [PATCH] feat(docz-core): introduce gatsbyRoot to use for fs sourcing --- core/docz-core/src/config/argv.ts | 7 ++++++- core/docz-core/src/config/docz.ts | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/core/docz-core/src/config/argv.ts b/core/docz-core/src/config/argv.ts index 567bde8bf..13135904e 100644 --- a/core/docz-core/src/config/argv.ts +++ b/core/docz-core/src/config/argv.ts @@ -43,6 +43,7 @@ export interface Argv { root: string base: string src: string + gatsbyRoot: string | string[] files: string | string[] ignore: any[] watchIgnore: string @@ -94,7 +95,11 @@ export const setArgs = (yargs: Yargs) => { .option('source', { alias: 'src', type: 'string', - default: getEnv('docz.source', './'), + default: getEnv('docz.source', doczRcBaseConfig.src), + }) + .option('gatsbyRoot', { + type: 'string', + default: getEnv('docz.gatsbyRoot', doczRcBaseConfig.gatsbyRoot), }) .option('files', { type: 'string', diff --git a/core/docz-core/src/config/docz.ts b/core/docz-core/src/config/docz.ts index 635ac2b1d..c6abbfdae 100644 --- a/core/docz-core/src/config/docz.ts +++ b/core/docz-core/src/config/docz.ts @@ -13,6 +13,8 @@ const toOmit = ['_', '$0', 'version', 'help'] export const doczRcBaseConfig = { typescript: fs.existsSync(paths.appTsConfig), themeConfig: {}, + src: './', + gatsbyRoot: './', themesDir: 'src', mdxExtensions: ['.md', '.mdx'], docgenConfig: {},