diff --git a/scripts/create-plugin.js b/scripts/create-plugin.js index 237d8c15b..b782ece2b 100755 --- a/scripts/create-plugin.js +++ b/scripts/create-plugin.js @@ -64,6 +64,31 @@ fs.writeFileSync('tsconfig.json', JSON.stringify(tsconfig, null, 2)) console.log('📄 adding empty toolkit config') fs.writeFileSync('.toolkitrc.yml', 'version: 2\n') +console.log('📖 adding simple README') +fs.writeFileSync( + 'readme.md', + `#dotcom-tool-kit/${name} + +## Installation & Usage + +With Tool Kit [already set up](https://github.com/financial-times/dotcom-tool-kit#installing-and-using-tool-kit), install this plugin as a dev dependency: + +\`\`\`sh +npm install --save-dev @dotcom-tool-kit/${name} +\`\`\` + +And add it to your repo's \`.toolkitrc.yml\`: + +\`\`\`yml +plugins: + - '@dotcom-tool-kit/${name}' +\`\`\` + + + +` +) + console.log('🔗 adding reference to root tsconfig') const rootTsconfig = JSON.parse(fs.readFileSync('../../tsconfig.json')) rootTsconfig.references.push({ path: directory })