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
|
## Challenges
|
||||||
|
|
||||||
Check [all challenges](https://angular-challenges.vercel.app/)
|
Check [all 35 challenges](https://angular-challenges.vercel.app/)
|
||||||
|
|
||||||
## Challenges (previous version)
|
## Challenges (previous version)
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ hero:
|
|||||||
import { Card, CardGrid } from '@astrojs/starlight/components';
|
import { Card, CardGrid } from '@astrojs/starlight/components';
|
||||||
|
|
||||||
<CardGrid>
|
<CardGrid>
|
||||||
<Card title="More than 30 Challenges">
|
<Card title="35 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>.
|
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.
|
These challenges revolve around real-life issues or specific features to elevate your skills.
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import {
|
|||||||
updateJson,
|
updateJson,
|
||||||
} from '@nx/devkit';
|
} from '@nx/devkit';
|
||||||
import { Linter } from '@nx/linter';
|
import { Linter } from '@nx/linter';
|
||||||
|
import { readFile, writeFile } from 'fs';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import { getProjectDir } from '../../utils/normalize';
|
import { getProjectDir } from '../../utils/normalize';
|
||||||
import { Schema } from './schema';
|
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) => {
|
updateJson(tree, challengeNumberPath, (json) => {
|
||||||
json.total = json.total + 1;
|
json.total = json.total + 1;
|
||||||
return json;
|
return json;
|
||||||
|
|||||||
@@ -113,5 +113,5 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"required": ["name", "title", "challengeNumber"]
|
"required": ["name", "title", "challengeDifficulty", "docRepository"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user