From 6e6267600bb6d9c6568d86967af356223f25ebb7 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Sat, 15 Jun 2024 23:16:27 +0800 Subject: [PATCH] chore(deps): replace dependency 'copy-template-dir' with '@tsbb/copy-template-dir' #229 --- package.json | 6 +++--- src/types/index.d.ts | 2 +- src/utils.ts | 2 +- test/index.test.ts | 5 +++++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index a339a85a..08811eb3 100644 --- a/package.json +++ b/package.json @@ -67,10 +67,10 @@ ] }, "dependencies": { + "@tsbb/copy-template-dir": "^1.4.0", "auto-config-loader": "^1.7.4", "cheerio": "~1.0.0-rc.12", "colors-cli": "~1.0.28", - "copy-template-dir": "~1.4.0", "del": "~6.1.0", "ejs": "~3.1.6", "fs-extra": "~11.2.0", @@ -88,11 +88,11 @@ "@types/cheerio": "~0.22.31", "@types/ejs": "~3.1.0", "@types/fs-extra": "^11.0.1", + "@types/svg2ttf": "~5.0.1", + "@types/svgicons2svgfont": "~10.0.1", "@types/ttf2eot": "~2.0.0", "@types/ttf2woff": "~2.0.2", "@types/ttf2woff2": "~2.0.0", - "@types/svg2ttf": "~5.0.1", - "@types/svgicons2svgfont": "~10.0.1", "tsbb": "^4.1.5" }, "peerDependencies": { diff --git a/src/types/index.d.ts b/src/types/index.d.ts index 61085955..d748de76 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -1,5 +1,5 @@ /// -declare module 'copy-template-dir' { +declare module '@tsbb/copy-template-dir' { export default function(templateDir: string, targetDir: string, options: Record, callback: (err: Error, createdFiles: string[]) => void): void; } diff --git a/src/utils.ts b/src/utils.ts index 1e89866f..1d796668 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -8,7 +8,7 @@ import svg2ttf from 'svg2ttf'; import ttf2eot from 'ttf2eot'; import ttf2woff from 'ttf2woff'; import ttf2woff2 from 'ttf2woff2'; -import copy from 'copy-template-dir'; +import copy from '@tsbb/copy-template-dir'; import del from 'del'; import moveFile from 'move-file'; import { SvgToFontOptions } from './'; diff --git a/test/index.test.ts b/test/index.test.ts index 6c7b4748..7d25165a 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -70,6 +70,7 @@ it('example test case.', async () => { 'font-class.html', 'index.html', 'react', + 'styles', 'svgtofont.css', 'svgtofont.d.ts', 'svgtofont.eot', @@ -101,6 +102,7 @@ it('example simple test case.', async () => { }); const fileNames = await fs.readdir(dist); expect(fileNames).toEqual([ + 'styles', 'svgtofont.css', 'svgtofont.d.ts', 'svgtofont.eot', @@ -129,6 +131,7 @@ it('templates simple test case.', async () => { }); const fileNames = await fs.readdir(dist); expect(fileNames).toEqual([ + 'styles', 'svgtofont.css', 'svgtofont.eot', 'svgtofont.less', @@ -161,6 +164,7 @@ it('example simple test case for useNameAsUnicode.', async () => { }); const fileNames = await fs.readdir(dist); expect(fileNames).toEqual([ + 'ligature-styles', 'nameAsUnicode.css', 'nameAsUnicode.d.ts', 'nameAsUnicode.eot', @@ -200,6 +204,7 @@ it('example .svgtofontrc.js test case for useNameAsUnicode', async () => { }); const fileNames = await fs.readdir(dist); expect(fileNames).toEqual([ + 'ligature-styles', 'nameAsUnicode.css', 'nameAsUnicode.d.ts', 'nameAsUnicode.eot',