Skip to content
Source
Sign inSign up
TanStack/cli
Open History to see the last commit

index.ts

33 lines917 Bytes

1#!/usr/bin/env node
2import { dirname, join } from 'node:path'
3import { fileURLToPath } from 'node:url'
4​
5import { cli } from '@tanstack/cta-cli'
6import { registerFramework, scanProjectDirectory } from '@tanstack/cta-engine'
7import { createFrameworkDefinition } from '@tanstack/cta-framework-react-cra'
8​
9const frameworkDefinition = createFrameworkDefinition()
10​
11frameworkDefinition.id = 'react'
12frameworkDefinition.name = 'react'
13frameworkDefinition.description = 'Customized React Setup'
14frameworkDefinition.version = '0.1.0'
15​
16const baseDirectory = dirname(dirname(fileURLToPath(import.meta.url)))
17const { files } = scanProjectDirectory(
18 join(baseDirectory, 'project'),
19 join(baseDirectory, 'project/base'),
21​
22frameworkDefinition.base = {
23 ...frameworkDefinition.base,
24 ...files,
26​
27registerFramework(frameworkDefinition)
28​
29cli({
30 name: 'customized-react-app',
31 appName: 'React',
32 defaultFramework: 'react',
33})