From ff362c19800c3c64f47273269ec2076de553e16a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 1 Dec 2024 00:43:11 +0300 Subject: [PATCH] fix: paths (#49) Co-authored-by: nikkeyl <131481562+nikkeyl@users.noreply.github.com> --- rollup.config.ts | 2 +- src/config/error.ts | 2 +- src/config/info.ts | 2 +- src/config/success.ts | 2 +- src/config/warning.ts | 2 +- src/utils/log-level/index.ts | 4 ++-- src/utils/notifier/index.ts | 4 +++- tsconfig.json | 25 ++++++++++++++++++++++++- tsconfig.node.json | 28 ---------------------------- 9 files changed, 34 insertions(+), 37 deletions(-) delete mode 100644 tsconfig.node.json diff --git a/rollup.config.ts b/rollup.config.ts index 580c88a..2975b28 100644 --- a/rollup.config.ts +++ b/rollup.config.ts @@ -22,7 +22,7 @@ const outputFile = `${fileName}.js`; export default defineConfig([ { - external: ['chalk', 'node-notifier'], + external: ['chalk', 'node-notifier', 'node:path'], plugins: [ copy({ targets: [{ src: iconsFolder, dest: destinationFolder }], diff --git a/src/config/error.ts b/src/config/error.ts index 5135d4f..1a7d229 100644 --- a/src/config/error.ts +++ b/src/config/error.ts @@ -1,4 +1,4 @@ -import { splitter } from '#features'; +import { splitter } from '#utils'; import type { Parameters } from '../data/index.ts'; import { LOG_LEVELS } from '../data/index.ts'; diff --git a/src/config/info.ts b/src/config/info.ts index 01109d8..9d83acf 100644 --- a/src/config/info.ts +++ b/src/config/info.ts @@ -1,4 +1,4 @@ -import { splitter } from '#features'; +import { splitter } from '#utils'; import type { Parameters } from '../data/index.ts'; import { LOG_LEVELS } from '../data/index.ts'; diff --git a/src/config/success.ts b/src/config/success.ts index 841428c..3ef276f 100644 --- a/src/config/success.ts +++ b/src/config/success.ts @@ -1,4 +1,4 @@ -import { splitter } from '#features'; +import { splitter } from '#utils'; import type { Parameters } from '../data/index.ts'; import { LOG_LEVELS } from '../data/index.ts'; diff --git a/src/config/warning.ts b/src/config/warning.ts index aaa46d8..1c77071 100644 --- a/src/config/warning.ts +++ b/src/config/warning.ts @@ -1,4 +1,4 @@ -import { splitter } from '#features'; +import { splitter } from '#utils'; import type { Parameters } from '../data/index.ts'; import { LOG_LEVELS } from '../data/index.ts'; diff --git a/src/utils/log-level/index.ts b/src/utils/log-level/index.ts index 6018bb2..2e024c2 100644 --- a/src/utils/log-level/index.ts +++ b/src/utils/log-level/index.ts @@ -19,10 +19,10 @@ const logLevel = async (parameters: Parameters) => { } if (title === LOG_LEVELS.SUCCESS) { - return console.log(chalk.green(notification)); + return console.info(chalk.green(notification)); } - return console.info(chalk.blue(notification)); + return console.log(chalk.blue(notification)); }; export { logLevel }; diff --git a/src/utils/notifier/index.ts b/src/utils/notifier/index.ts index 5c4bd70..2a299b9 100644 --- a/src/utils/notifier/index.ts +++ b/src/utils/notifier/index.ts @@ -1,3 +1,5 @@ +import { resolve } from 'node:path'; + import Notifier from 'node-notifier'; import { truncate } from '#helpers'; @@ -8,7 +10,7 @@ const notifier = async (parameters: Parameters) => { const { icon, message, title } = parameters; return Notifier.notify({ - icon: `dist/icons/${icon}.png`, + icon: resolve(`dist/icons/${icon}.png`), message: await truncate({ message }), title: title.toUpperCase(), }); diff --git a/tsconfig.json b/tsconfig.json index 74c402c..fdab0b6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,29 @@ { "compilerOptions": { + // Completeness + "skipLibCheck": true, + // Emit + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "dist", + // Language and Environment + "lib": ["DOM", "ESNext"], + "target": "ESNext", + // Modules + "allowImportingTsExtensions": true, + "module": "NodeNext", + "moduleResolution": "NodeNext", + "paths": { + "#config": ["./src/config/index.ts"], + "#utils": ["./src/utils/index.ts"], + "#generators": ["./src/utils/generators/index.ts"], + "#helpers": ["./src/utils/helpers/index.ts"], + "#data": ["./src/data/index.ts"] + }, + "rootDir": "src", + "types": ["chalk", "node", "vitest"], + // Projects + "disableReferencedProjectLoad": true, // Type Checking "allowUnreachableCode": false, "allowUnusedLabels": false, @@ -13,6 +37,5 @@ "strict": true }, "exclude": ["specs"], - "extends": ["./tsconfig.node.json"], "include": ["src"] } diff --git a/tsconfig.node.json b/tsconfig.node.json deleted file mode 100644 index 672f5c2..0000000 --- a/tsconfig.node.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "compilerOptions": { - // Completeness - "skipLibCheck": true, - // Emit - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "dist", - // Language and Environment - "lib": ["DOM", "ESNext"], - "target": "ESNext", - // Modules - "allowImportingTsExtensions": true, - "module": "NodeNext", - "moduleResolution": "NodeNext", - "paths": { - "#config": ["./src/config/index.ts"], - "#utils": ["./src/utils/index.ts"], - "#generators": ["./src/utils/generators/index.ts"], - "#helpers": ["./src/utils/helpers/index.ts"], - "#data": ["./src/data/index.ts"] - }, - "rootDir": "src", - "types": ["chalk", "node", "vitest"], - // Projects - "disableReferencedProjectLoad": true - } -}