Files
templates/scaffold.js
2025-03-31 10:04:55 +03:00

52 lines
1.0 KiB
JavaScript

// @ts-check
const BASE = 'gen/react'
/**
* @param {string} folder
* @returns import('simple-scaffold').ScaffoldConfig
*/
const reactComp = (folder) => {
return {
templates: [`${BASE}/component`],
output: `src/components/${folder}`,
data: {
element: 'div',
},
}
}
/** @type {import('simple-scaffold').ScaffoldConfigFile} */
module.exports = {
editorfile: {
templates: ['gen/editorfile'],
output: '.',
name: '-',
},
'typescript.lints': {
templates: ['gen/ts-lints'],
output: '.',
name: '-',
},
github: {
templates: ['gen/github'],
output: '.',
name: '-',
},
'github.pnpm': {
templates: ['gen/github-pnpm'],
output: '.',
name: '-',
},
'react.atom': reactComp('atoms'),
'react.molecule': reactComp('molecules'),
'react.organism': reactComp('organisms'),
'react.page': {
templates: [`${BASE}/page`],
output: `src/pages`,
},
'react.utils': {
templates: [`${BASE}/utils`],
output: `src/utils`,
name: '<utils>',
},
}