mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 12:53:03 -05:00
feat: update generator
This commit is contained in:
@@ -3,13 +3,7 @@ import {
|
|||||||
E2eTestRunner,
|
E2eTestRunner,
|
||||||
UnitTestRunner,
|
UnitTestRunner,
|
||||||
} from '@nx/angular/generators';
|
} from '@nx/angular/generators';
|
||||||
import {
|
import { formatFiles, generateFiles, Tree, updateJson } from '@nx/devkit';
|
||||||
formatFiles,
|
|
||||||
generateFiles,
|
|
||||||
names,
|
|
||||||
Tree,
|
|
||||||
updateJson,
|
|
||||||
} from '@nx/devkit';
|
|
||||||
import { Linter } from '@nx/eslint';
|
import { Linter } from '@nx/eslint';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import { getProjectDir } from '../../utils/normalize';
|
import { getProjectDir } from '../../utils/normalize';
|
||||||
@@ -81,7 +75,7 @@ export async function challengeGenerator(tree: Tree, options: Schema) {
|
|||||||
|
|
||||||
generateFiles(tree, join(__dirname, 'files', 'readme'), appDirectory, {
|
generateFiles(tree, join(__dirname, 'files', 'readme'), appDirectory, {
|
||||||
tmpl: '',
|
tmpl: '',
|
||||||
projectName: names(name).name,
|
projectName: name,
|
||||||
appProjectName,
|
appProjectName,
|
||||||
title: options.title,
|
title: options.title,
|
||||||
challengeNumber,
|
challengeNumber,
|
||||||
@@ -94,7 +88,7 @@ export async function challengeGenerator(tree: Tree, options: Schema) {
|
|||||||
`./docs/src/content/docs/challenges/${options.category}`,
|
`./docs/src/content/docs/challenges/${options.category}`,
|
||||||
{
|
{
|
||||||
tmpl: '',
|
tmpl: '',
|
||||||
projectName: names(name).name,
|
projectName: name,
|
||||||
appProjectName,
|
appProjectName,
|
||||||
author: options.author,
|
author: options.author,
|
||||||
title: options.title,
|
title: options.title,
|
||||||
@@ -142,9 +136,7 @@ export async function challengeGenerator(tree: Tree, options: Schema) {
|
|||||||
);
|
);
|
||||||
const replacedLink = replaced.replace(
|
const replacedLink = replaced.replace(
|
||||||
linkRegex,
|
linkRegex,
|
||||||
`link: /${lang}/challenges/${options.category}/${challengeNumber}-${
|
`link: /${lang}/challenges/${options.category}/${challengeNumber}-${name}/\n`,
|
||||||
names(name).name
|
|
||||||
}/\n`,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
tree.write(
|
tree.write(
|
||||||
|
|||||||
@@ -87,6 +87,10 @@
|
|||||||
{
|
{
|
||||||
"value": "forms",
|
"value": "forms",
|
||||||
"label": "Forms"
|
"label": "Forms"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "signal",
|
||||||
|
"label": "Signal"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -112,5 +116,5 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"required": ["name", "title", "author", "challengeDifficulty", "category"]
|
"required": ["title", "author", "challengeDifficulty", "category"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user