adventofcode/preset/year/preset.ts

31 lines
630 B
TypeScript
Raw Permalink Normal View History

2023-11-30 17:43:56 +00:00
import path from 'path';
//import { definePreset } from '@preset/core';
export default definePreset({
name: 'year',
options: {
// ...
},
handler: async(context) => {
await extractTemplates();
await editFiles({
files: [
'package.json',
'Taskfile.yaml',
],
operations: [ {type: 'replace-variables',
variables: {
year: context.prompts.year
}}]
});
await installPackages({
for: 'node',
packages: [ 'vitest' ],
packageManager: 'pnpm',
});
},
})