Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
momentiris committed Sep 30, 2022
1 parent 6311d10 commit a777583
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 38 deletions.
35 changes: 0 additions & 35 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,3 @@
// https://github.com/marvinhagemeister/kolorist/blob/main/src/index.ts
import { blue, yellow, red, green } from 'kolorist';

import * as types from './types';

export const TEMPLATES_DIRECTORY = `${__dirname}/templates`;
export const RENAMABLE_FILES_MAP: { [key: string]: string } = {
_gitignore: '.gitignore',
};

export const TEMPLATES: types.Template[] = [
{
name: 'react',
color: yellow,
variants: [
{
color: yellow,
name: 'react',
display: 'React JavaScript',
},
{
color: blue,
name: 'react-ts',
display: 'React TypeScript',
},
{
color: red,
name: 'vite-vanilla',
display: 'Vite JavaScript',
},
{
color: green,
name: 'koa-ts',
display: 'Koa Typescript',
},
],
},
];
35 changes: 35 additions & 0 deletions src/prompts/create/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// https://github.com/marvinhagemeister/kolorist/blob/main/src/index.ts
import { blue, yellow, red, green } from 'kolorist';

import * as types from '../../types';

export const TEMPLATES_DIRECTORY = `${__dirname}/templates`;

export const TEMPLATES: Array<types.Template> = [
{
name: 'react',
color: yellow,
variants: [
{
color: yellow,
name: 'react',
display: 'React JavaScript',
},
{
color: blue,
name: 'react-ts',
display: 'React TypeScript',
},
{
color: red,
name: 'vite-vanilla',
display: 'Vite JavaScript',
},
{
color: green,
name: 'koa-ts',
display: 'Koa Typescript',
},
],
},
];
2 changes: 1 addition & 1 deletion src/prompts/create/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { lightGreen } from 'kolorist';
import * as helpers from '../../helpers';
import * as utils from '../../utils';

import { TEMPLATES_DIRECTORY } from '../../constants';
import { TEMPLATES_DIRECTORY } from './constants';

const cwd = process.cwd();

Expand Down
3 changes: 1 addition & 2 deletions src/prompts/create/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import p from 'prompts';
import fs from 'fs';
import { reset } from 'kolorist';

import * as utils from '../../utils';
import { TEMPLATES } from '../../constants';
import { TEMPLATES } from './constants';
import { makeTemplate } from './handlers';

export const create = () => p(steps).then(makeTemplate);
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import p from 'prompts';

export type Template = {
name: string;
color: (color: string | number) => string;
Expand Down

0 comments on commit a777583

Please sign in to comment.