feat: add basic webui
This commit is contained in:
37
turbo/generators/config.ts
Normal file
37
turbo/generators/config.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { PlopTypes } from '@turbo/gen';
|
||||
|
||||
export default function generator(plop: PlopTypes.NodePlopAPI): void {
|
||||
plop.setGenerator('init', {
|
||||
description: 'Generate a new package for the Monorepo',
|
||||
prompts: [
|
||||
{
|
||||
type: 'input',
|
||||
name: 'name',
|
||||
message:
|
||||
'What is the name of the package? (You can skip the `@konobangu/` prefix)',
|
||||
},
|
||||
],
|
||||
actions: [
|
||||
(answers) => {
|
||||
if (
|
||||
'name' in answers &&
|
||||
typeof answers.name === 'string' &&
|
||||
answers.name.startsWith('@konobangu/')
|
||||
) {
|
||||
answers.name = answers.name.replace('@konobangu/', '');
|
||||
}
|
||||
return 'Config sanitized';
|
||||
},
|
||||
{
|
||||
type: 'add',
|
||||
path: 'packages/{{ name }}/package.json',
|
||||
templateFile: 'templates/package.json.hbs',
|
||||
},
|
||||
{
|
||||
type: 'add',
|
||||
path: 'packages/{{ name }}/tsconfig.json',
|
||||
templateFile: 'templates/tsconfig.json.hbs',
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
3
turbo/generators/package.json
Normal file
3
turbo/generators/package.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "commonjs"
|
||||
}
|
||||
9
turbo/generators/templates/package.json.hbs
Normal file
9
turbo/generators/templates/package.json.hbs
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "@konobangu/{{ name }}",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"clean": "git clean -xdf .cache .turbo dist node_modules",
|
||||
"typecheck": "tsc --noEmit --emitDeclarationOnly false"
|
||||
}
|
||||
}
|
||||
12
turbo/generators/templates/tsconfig.json.hbs
Normal file
12
turbo/generators/templates/tsconfig.json.hbs
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "@konobangu/typescript-config/react-library.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./*"],
|
||||
"@konobangu/*": ["../../packages/*"]
|
||||
}
|
||||
},
|
||||
"include": ["**/*.ts", "**/*.tsx"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
Reference in New Issue
Block a user