Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.

Commit

Permalink
+ impelemt type roots cli
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDeved committed Feb 24, 2020
1 parent 3c77f5d commit 963b537
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 21 deletions.
3 changes: 0 additions & 3 deletions cli/interfaces/ICommand.ts

This file was deleted.

3 changes: 0 additions & 3 deletions cli/interfaces/ILanguageOption.ts

This file was deleted.

4 changes: 0 additions & 4 deletions cli/interfaces/IQuestionOption.ts

This file was deleted.

2 changes: 0 additions & 2 deletions cli/questions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import inquirer from 'inquirer';
import IQuestionOption from './interfaces/IQuestionOption';
import ILanguageOption from './interfaces/ILanguageOption';

export const askCreateDireflowSetup = async (): Promise<IQuestionOption> => {
return createQuestions('Direflow Setup');
Expand Down
3 changes: 3 additions & 0 deletions cli/types/Command.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
interface ICommand {
[arg: string]: string;
}
3 changes: 3 additions & 0 deletions cli/types/LangageOption.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
interface ILanguageOption {
language: 'js' | 'ts';
}
4 changes: 2 additions & 2 deletions cli/interfaces/INames.ts → cli/types/Names.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default interface INames {
interface INames {
title: string;
pascal: string;
snake: string;
}
}
4 changes: 4 additions & 0 deletions cli/types/QuestionOption.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
interface IQuestionOption {
name: string;
description: string;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default interface ITemplateOption {
interface ITemplateOption {
projectName: string;
language: 'ts' | 'js';
}
}
1 change: 0 additions & 1 deletion cli/utils/copyTemplate.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { resolve } from 'path';
import ncp from 'ncp';
import mkdirp from 'mkdirp';
import ITemplateOption from '../interfaces/ITemplateOption';

const copyTemplate = async (options: ITemplateOption): Promise<string> => {
const currentDirectory = process.cwd();
Expand Down
1 change: 0 additions & 1 deletion cli/utils/nameFormat.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import to from 'to-case';
import INames from '../interfaces/INames';

export const getNameFormats = (name: string): INames => {
return {
Expand Down
2 changes: 1 addition & 1 deletion cli/utils/writeNames.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import fs from 'fs';
import handelbars from 'handlebars';
import path from 'path';
import INames from '../interfaces/INames';

const packageJson = require('../../package.json');

const { version } = packageJson;

interface IWriteNameOptions {
Expand Down
2 changes: 1 addition & 1 deletion declarations.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
declare module 'to-case';
declare module 'to-case';
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"strict": true,
"esModuleInterop": true,
"moduleResolution": "node",
"skipLibCheck": true
"skipLibCheck": true,
"typeRoots": ["cli/types"]
},
"exclude": [
"node_modules",
Expand Down

0 comments on commit 963b537

Please sign in to comment.