From 3c9e45433ef693d722b54e06503cc9665ba8a531 Mon Sep 17 00:00:00 2001 From: Kara Brightwell Date: Wed, 24 Apr 2024 15:54:21 +0100 Subject: [PATCH] build: update and simplify create-plugin script --- scripts/create-plugin.js | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/scripts/create-plugin.js b/scripts/create-plugin.js index 2252d3277..f33e804ed 100755 --- a/scripts/create-plugin.js +++ b/scripts/create-plugin.js @@ -17,7 +17,7 @@ console.log('📦 initialising package') execSync('npm init -y --scope @dotcom-tool-kit') console.log('📥 installing dependencies') -execSync('npm install @dotcom-tool-kit/types') +execSync('npm install @dotcom-tool-kit/base') console.log('🔣 adding metadata to package.json') @@ -53,7 +53,7 @@ const tsconfig = { }, references: [ { - path: '../../lib/types' + path: '../../lib/base' } ], include: ['src/**/*'] @@ -62,7 +62,7 @@ const tsconfig = { fs.writeFileSync('tsconfig.json', JSON.stringify(tsconfig, null, 2)) console.log('📄 adding empty toolkit config') -fs.writeFileSync('.toolkitrc.yml', '') +fs.writeFileSync('.toolkitrc.yml', 'version: 2\n') console.log('🔗 adding reference to root tsconfig') const rootTsconfig = JSON.parse(fs.readFileSync('../../tsconfig.json')) @@ -70,30 +70,4 @@ rootTsconfig.references.push({ path: directory }) fs.writeFileSync('../../tsconfig.json', JSON.stringify(rootTsconfig, null, 2)) -console.log(`🏗 scaffolding task ${camelCaseName}`) -fs.mkdirSync('src/tasks', { recursive: true }) - -fs.writeFileSync( - `src/tasks/${name}.ts`, - `import { Task } from '@dotcom-tool-kit/types' - -export default class ${camelCaseName} extends Task { - static description = '' - - async run(): Promise { - - } -}` -) - -fs.writeFileSync( - 'src/index.ts', - `import ${camelCaseName} from './tasks/${name}' - -export const tasks = [ - ${camelCaseName} -] -` -) - console.log('🌊 byeee~')