|
34 | 34 | .replace('file://', '') |
35 | 35 | } catch (e: any) { |
36 | 36 | if (e.code === 'ERR_MODULE_NOT_FOUND') { |
| 37 | + console.log('@patternfly/patternfly-doc-core not found, using current directory as astroRoot') |
37 | 38 | astroRoot = process.cwd() |
38 | 39 | } else { |
39 | 40 | console.error('Error resolving astroRoot', e) |
@@ -87,29 +88,6 @@ async function transformMDContentToMDX() { |
87 | 88 | } |
88 | 89 | } |
89 | 90 |
|
90 | | -async function updateTsConfigOutputDirPath(program: Command) { |
91 | | - const { verbose } = program.opts() |
92 | | - const tsConfigPath = join(astroRoot, 'tsconfig.json') |
93 | | - |
94 | | - try { |
95 | | - const tsConfigFile = await readFile(tsConfigPath, 'utf-8') |
96 | | - const tsConfig = JSON.parse(tsConfigFile) |
97 | | - const formattedOutputDir = join(absoluteOutputDir, '*') |
98 | | - |
99 | | - tsConfig.compilerOptions.paths['outputDir/*'] = [formattedOutputDir] |
100 | | - |
101 | | - await writeFile(tsConfigPath, JSON.stringify(tsConfig, null, 2)) |
102 | | - |
103 | | - if (verbose) { |
104 | | - console.log( |
105 | | - `Updated tsconfig.json with outputDir path: ${formattedOutputDir}`, |
106 | | - ) |
107 | | - } |
108 | | - } catch (e: any) { |
109 | | - console.error('Error updating tsconfig.json with outputDir path:', e) |
110 | | - } |
111 | | -} |
112 | | - |
113 | 91 | async function initializeApiIndex(program: Command) { |
114 | 92 | const { verbose } = program.opts() |
115 | 93 | const templateIndexPath = join(astroRoot, 'cli', 'templates', 'apiIndex.json') |
@@ -150,7 +128,6 @@ async function buildProject(program: Command): Promise<DocsConfig | undefined> { |
150 | 128 | ) |
151 | 129 | return config |
152 | 130 | } |
153 | | - await updateTsConfigOutputDirPath(program) |
154 | 131 | await updateContent(program) |
155 | 132 | await generateProps(program, true) |
156 | 133 | await initializeApiIndex(program) |
@@ -230,7 +207,6 @@ program.command('init').action(async () => { |
230 | 207 | }) |
231 | 208 |
|
232 | 209 | program.command('start').action(async () => { |
233 | | - await updateTsConfigOutputDirPath(program) |
234 | 210 | await updateContent(program) |
235 | 211 | await initializeApiIndex(program) |
236 | 212 |
|
|
0 commit comments