mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 12:53:03 -05:00
feat(generator): update generator
This commit is contained in:
@@ -23,7 +23,7 @@ If you would like to propose a challenge, this project is open source, so feel f
|
||||
|
||||
## Challenges
|
||||
|
||||
Check [all challenges](https://angular-challenges.vercel.app/)
|
||||
Check [all 35 challenges](https://angular-challenges.vercel.app/)
|
||||
|
||||
## Challenges (previous version)
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ hero:
|
||||
import { Card, CardGrid } from '@astrojs/starlight/components';
|
||||
|
||||
<CardGrid>
|
||||
<Card title="More than 30 Challenges">
|
||||
This repository gathers over 30 challenges related to <b>Angular</b>, <b>Nx</b>, <b>Ngrx</b>, <b>RxJS</b>, and <b>Ngrx</b>.
|
||||
<Card title="35 Challenges">
|
||||
This repository gathers 35 Challenges related to <b>Angular</b>, <b>Nx</b>, <b>Ngrx</b>, <b>RxJS</b>, and <b>Ngrx</b>.
|
||||
These challenges revolve around real-life issues or specific features to elevate your skills.
|
||||
</Card>
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
updateJson,
|
||||
} from '@nx/devkit';
|
||||
import { Linter } from '@nx/linter';
|
||||
import { readFile, writeFile } from 'fs';
|
||||
import { join } from 'path';
|
||||
import { getProjectDir } from '../../utils/normalize';
|
||||
import { Schema } from './schema';
|
||||
@@ -69,6 +70,39 @@ export async function appGenerator(tree: Tree, options: Schema) {
|
||||
});
|
||||
}
|
||||
|
||||
readFile('./README.md', 'utf-8', function (err, contents) {
|
||||
const regex = new RegExp(`all ${challengeNumber} challenges`);
|
||||
const replaced = contents.replace(
|
||||
regex,
|
||||
`all ${challengeNumber + 1} challenges`
|
||||
);
|
||||
|
||||
writeFile('./README.md', replaced, 'utf-8', function (err) {
|
||||
console.log(err);
|
||||
});
|
||||
});
|
||||
|
||||
readFile(
|
||||
'./docs/src/content/docs/index.mdx',
|
||||
'utf-8',
|
||||
function (err, contents) {
|
||||
const regex = new RegExp(`${challengeNumber} Challenges`, 'gi');
|
||||
const replaced = contents.replace(
|
||||
regex,
|
||||
`${challengeNumber + 1} Challenges`
|
||||
);
|
||||
|
||||
writeFile(
|
||||
'./docs/src/content/docs/index.mdx',
|
||||
replaced,
|
||||
'utf-8',
|
||||
function (err) {
|
||||
console.log(err);
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
updateJson(tree, challengeNumberPath, (json) => {
|
||||
json.total = json.total + 1;
|
||||
return json;
|
||||
|
||||
@@ -113,5 +113,5 @@
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": ["name", "title", "challengeNumber"]
|
||||
"required": ["name", "title", "challengeDifficulty", "docRepository"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user