31 lines
630 B
TypeScript
31 lines
630 B
TypeScript
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',
|
|
});
|
|
|
|
},
|
|
})
|