@eljs/template-npm-web
Version:
@eljs/template-npm-web
32 lines (26 loc) • 689 B
text/typescript
/* eslint-disable @typescript-eslint/naming-convention */
import { Api, defineConfig } from '@eljs/create'
export const config = defineConfig({})
export default async (api: Api) => {
api.onStart(() => {
api.extendPackage(() => {
const pkgJSON: Record<string, any> = {
'@testing-library/jest-dom': '^5.16.4',
'eslint-plugin-react-hooks': '^4.6.0',
}
return pkgJSON
})
})
api.onGenerateFiles(({ prompts }) => {
const { isMonorepo } = prompts
if (isMonorepo) {
api.render('./templates/monorepo', {
...prompts,
})
} else {
api.render('./templates/polyrepo', {
...prompts,
})
}
})
}