Skip to content

Commit df9cdd2

Browse files
author
Michael Hladky
committed
refactor: wip
1 parent c0385c4 commit df9cdd2

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

tools/zod2md-jsdocs/src/nx-plugin.cjs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
const path = require('node:path');
22

3+
const ZOD2MD_CONFIG_FILE = 'zod2md.config.ts';
4+
35
const createNodesV2 = [
4-
`**/zod2md.config.ts`,
6+
`**/${ZOD2MD_CONFIG_FILE}`,
57
async (zod2MdConfigurationFiles, createNodesOptions) => {
68
const options = createNodesOptions ?? {};
79
const targetName = options.targetName ?? 'generate-docs';
@@ -10,6 +12,8 @@ const createNodesV2 = [
1012
zod2MdConfigurationFiles.map(async zod2MdConfigurationFile => {
1113
const projectRoot = path.dirname(zod2MdConfigurationFile);
1214
const normalizedProjectRoot = projectRoot === '.' ? '' : projectRoot;
15+
const output = '{projectRoot}/docs/{projectName}-reference.md';
16+
const config = `{projectRoot}/${ZOD2MD_CONFIG_FILE}`;
1317
const result = {
1418
projects: {
1519
[normalizedProjectRoot]: {
@@ -18,20 +22,14 @@ const createNodesV2 = [
1822
executor: 'nx:run-commands',
1923
options: {
2024
commands: [
21-
'zod2md --config {args.config} --output {args.output}',
22-
'prettier --write {args.output}',
25+
`zod2md --config ${config} --output ${output}`,
26+
`prettier --write ${output}`,
2327
],
2428
parallel: false,
25-
config: '{projectRoot}/zod2md.config.ts',
26-
output: '{projectRoot}/docs/{projectName}-reference.md',
2729
},
2830
cache: true,
29-
inputs: [
30-
'production',
31-
'^production',
32-
'{projectRoot}/zod2md.config.ts',
33-
],
34-
outputs: ['{projectRoot}/docs/{projectName}-reference.md'],
31+
inputs: ['production', '^production', config],
32+
outputs: [output],
3533
},
3634
},
3735
},

0 commit comments

Comments
 (0)