diff --git a/src/bin/svg-to-ts.ts b/src/bin/svg-to-ts.ts index 0f72abc..d630f43 100755 --- a/src/bin/svg-to-ts.ts +++ b/src/bin/svg-to-ts.ts @@ -1,8 +1,8 @@ #!/usr/bin/env node import * as packgeJSON from '../../package.json'; import commander from 'commander'; -import { convert } from '../lib/convert'; import { Delimiter } from '../lib/generators/generators'; +import { convertToSingleFile } from '../lib/converters/single-file.converter'; export interface ConvertionOptions { delimiter: Delimiter; @@ -61,4 +61,5 @@ const convertionOptions = { srcFiles, outputDirectory }; -convert(convertionOptions); + +convertToSingleFile(convertionOptions); diff --git a/src/lib/convert.ts b/src/lib/converters/single-file.converter.ts similarity index 83% rename from src/lib/convert.ts rename to src/lib/converters/single-file.converter.ts index f7f5f48..ca00409 100644 --- a/src/lib/convert.ts +++ b/src/lib/converters/single-file.converter.ts @@ -1,6 +1,6 @@ import chalk from 'chalk'; import * as path from 'path'; -import { svgo } from './svgo'; +import { svgo } from '../svgo'; import { generateInterfaceDefinition, @@ -8,14 +8,14 @@ import { generateTypeDefinition, generateTypeName, generateVariableName -} from './generators/generators'; -import { getFilePathsFromRegex } from './regex-helpers'; -import { extractSvgContent, writeIconsFile } from './file-helpers'; -import { ConvertionOptions } from '../bin/svg-to-ts'; +} from '../generators/generators'; +import { getFilePathsFromRegex } from '../regex-helpers'; +import { extractSvgContent, writeIconsFile } from '../file-helpers'; +import { ConvertionOptions } from '../../bin/svg-to-ts'; const typesDelimitor = ' | '; -export const convert = async (convertionOptions: ConvertionOptions): Promise => { +export const convertToSingleFile = async (convertionOptions: ConvertionOptions): Promise => { const { typeName, prefix, delimiter, interfaceName, outputDirectory, srcFiles } = convertionOptions; let svgConstants = ''; let types = generateTypeDefinition(typeName);