MCPcopy Create free account
hub / github.com/formkit/formkit / createTheme

Function createTheme

packages/cli/src/createTheme.ts:17–38  ·  view source on GitHub ↗
(
  name: string,
  initialOptions: Partial<CreateThemeOptions>
)

Source from the content-addressed store, hash-verified

15}
16
17export async function createTheme(
18 name: string,
19 initialOptions: Partial<CreateThemeOptions>
20) {
21 // Do some stuff here
22 const settings = await completeOptions(name, initialOptions)
23 const spinner = ora(`Downloading starter theme...`).start()
24 await downloadTemplate('github:formkit/theme-starter', {
25 dir: settings.dir,
26 })
27 spinner.text = `Customizing package.json...`
28 await customizePackageJson(settings)
29 spinner.text = `Writing LICENSE.txt...`
30 await writeLicense(settings)
31 spinner.text = `Updating theme meta...`
32 await updateMeta(settings)
33 spinner.stop()
34 green('Theme scaffolded successfully!')
35 info(
36 'Next steps:\n1. cd into your theme directory\n2. Run `pnpm install`\n3. Run `pnpm dev`'
37 )
38}
39
40async function customizePackageJson(options: CreateThemeOptions) {
41 const packageJson = await readPackageJSON(options.dir)

Callers 1

localTheme.tsFile · 0.85

Calls 6

greenFunction · 0.90
infoFunction · 0.90
completeOptionsFunction · 0.85
customizePackageJsonFunction · 0.85
writeLicenseFunction · 0.85
updateMetaFunction · 0.85

Tested by

no test coverage detected