@eljs/create-preset-structure
Version:
Project structure template powered by @eljs/create.
31 lines (25 loc) • 811 B
text/typescript
/* eslint-disable @typescript-eslint/naming-convention */
import type { Api } from '@eljs/create'
import { camelCase, pascalCase } from '@eljs/utils'
export default async (api: Api) => {
api.describe({
key: 'presetStructurePrompts',
})
api.modifyPrompts(memo => {
const isMonorepo = memo.repositoryType === 'monorepo'
const isPolyrepo = memo.repositoryType === 'polyrepo'
const unscopedName = api.appData.projectName.replace(/^@[\s\S]+\//, '')
// const svgrDts = `export const ReactComponent: React.FunctionComponent<
// React.SVGAttributes<SVGElement>
// >`
return {
...memo,
unscopedName,
camelCaseName: camelCase(unscopedName),
pascalCaseName: pascalCase(unscopedName),
isMonorepo,
isPolyrepo,
tsx: 'tsx',
}
})
}