Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions recipes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ npm run create
```

This will overwrite all existing recipes. If you are happy with the changes, `git commit` them.

To recreate one or more named recipes rather than all of them use:
```bash
npm run create -- VanillaWebpack VanillaRspack
```
16 changes: 15 additions & 1 deletion recipes/src/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,21 @@ import * as allRecipes from './recipes/typescript';

const writers: Writer[] = [new BashWriter(), new ReadmeWriter()];

for (const cls of Object.values(allRecipes)) {
let recipeNames = Object.keys(allRecipes);
if (process.argv.length > 2) {
recipeNames = process.argv.slice(2).map((arg) => arg + 'Recipe');

const unknownNames = recipeNames.filter(name => !(name in allRecipes));
if (unknownNames.length > 0) {
console.error("Unknown recipe name(s):", unknownNames.join(', '));
process.exit(1)
}
}

console.log("Creating recipes for", recipeNames);

for (const recipeName of recipeNames) {
const cls = allRecipes[recipeName];
const recipe: Recipe = new (cls as any)();
console.log(`Recipe ${recipe.type} ${recipe.framework} ${recipe.bundler}`);

Expand Down