Skip to content

Commit

Permalink
fix: build (#70)
Browse files Browse the repository at this point in the history
Co-authored-by: nikkeyl <[email protected]>
  • Loading branch information
github-actions[bot] and nikkeyl authored Jan 10, 2025
1 parent df24824 commit 6c31dc7
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions specs/error.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, describe, it, mock } from 'bun:test';
import { error } from '#config/error.ts';
import { LOG_LEVELS } from '#constants/log-levels.ts';
import { LOG_LEVEL } from '#constants/log-level.ts';
import type { NotificationMode } from '#types/notification-mode.ts';
import type { TestCaseTypes } from './types/test-case.ts';

Expand All @@ -12,8 +12,8 @@ describe('error function', () => {
const defaultParams = {
hasTime: true,
notificationMode: 'console' as NotificationMode,
icon: LOG_LEVELS.ERROR,
title: LOG_LEVELS.ERROR,
icon: LOG_LEVEL.ERROR,
title: LOG_LEVEL.ERROR,
};

const testCases: TestCaseTypes[] = [
Expand Down
6 changes: 3 additions & 3 deletions specs/info.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, describe, it, mock } from 'bun:test';
import { info } from '#config/info.ts';
import { LOG_LEVELS } from '#constants/log-levels.ts';
import { LOG_LEVEL } from '#constants/log-level.ts';
import type { NotificationMode } from '#types/notification-mode.ts';
import type { TestCaseTypes } from './types/test-case.ts';

Expand All @@ -12,8 +12,8 @@ describe('info function', () => {
const defaultParams = {
hasTime: true,
notificationMode: 'console' as NotificationMode,
icon: LOG_LEVELS.INFO,
title: LOG_LEVELS.INFO,
icon: LOG_LEVEL.INFO,
title: LOG_LEVEL.INFO,
};

const testCases: TestCaseTypes[] = [
Expand Down
6 changes: 3 additions & 3 deletions specs/success.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, describe, it, mock } from 'bun:test';
import { success } from '#config/success.ts';
import { LOG_LEVELS } from '#constants/log-levels.ts';
import { LOG_LEVEL } from '#constants/log-level.ts';
import type { NotificationMode } from '#types/notification-mode.ts';
import type { TestCaseTypes } from './types/test-case.ts';

Expand All @@ -12,8 +12,8 @@ describe('success function', () => {
const defaultParams = {
hasTime: true,
notificationMode: 'console' as NotificationMode,
icon: LOG_LEVELS.SUCCESS,
title: LOG_LEVELS.SUCCESS,
icon: LOG_LEVEL.SUCCESS,
title: LOG_LEVEL.SUCCESS,
};

const testCases: TestCaseTypes[] = [
Expand Down
6 changes: 3 additions & 3 deletions specs/warning.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, describe, it, mock } from 'bun:test';
import { LOG_LEVELS } from '#constants/log-levels.ts';
import { LOG_LEVEL } from '#constants/log-level.ts';
import { warning } from '#config/warning.ts';
import type { NotificationMode } from '#types/notification-mode.ts';
import type { TestCaseTypes } from './types/test-case.ts';
Expand All @@ -12,8 +12,8 @@ describe('warning function', () => {
const defaultParams = {
hasTime: true,
notificationMode: 'console' as NotificationMode,
icon: LOG_LEVELS.WARNING,
title: LOG_LEVELS.WARNING,
icon: LOG_LEVEL.WARNING,
title: LOG_LEVEL.WARNING,
};

const testCases: TestCaseTypes[] = [
Expand Down
4 changes: 2 additions & 2 deletions src/config/error.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { LOG_LEVELS } from '#constants/log-levels.ts';
import { LOG_LEVEL } from '#constants/log-level.ts';
import type { Parameters } from '#types/parameters.ts';
import { splitter } from '#utils/splitter/splitter.ts';

const error = async (parameters: Parameters) => {
const { message, hasTime = true, notificationMode = 'console' } = parameters;

const LABEL = LOG_LEVELS.ERROR;
const LABEL = LOG_LEVEL.ERROR;

return splitter({
message,
Expand Down
4 changes: 2 additions & 2 deletions src/config/info.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { LOG_LEVELS } from '#constants/log-levels.ts';
import { LOG_LEVEL } from '#constants/log-level.ts';
import type { Parameters } from '#types/parameters.ts';
import { splitter } from '#utils/splitter/splitter.ts';

const info = async (parameters: Parameters) => {
const { message, hasTime = true, notificationMode = 'console' } = parameters;

const LABEL = LOG_LEVELS.INFO;
const LABEL = LOG_LEVEL.INFO;

return splitter({
message,
Expand Down
4 changes: 2 additions & 2 deletions src/config/success.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { LOG_LEVELS } from '#constants/log-levels.ts';
import { LOG_LEVEL } from '#constants/log-level.ts';
import type { Parameters } from '#types/parameters.ts';
import { splitter } from '#utils/splitter/splitter.ts';

const success = async (parameters: Parameters) => {
const { message, hasTime = true, notificationMode = 'console' } = parameters;

const LABEL = LOG_LEVELS.SUCCESS;
const LABEL = LOG_LEVEL.SUCCESS;

return splitter({
message,
Expand Down
4 changes: 2 additions & 2 deletions src/config/warning.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { LOG_LEVELS } from '#constants/log-levels.ts';
import { LOG_LEVEL } from '#constants/log-level.ts';
import type { Parameters } from '#types/parameters.ts';
import { splitter } from '#utils/splitter/splitter.ts';

const warning = async (parameters: Parameters) => {
const { message, hasTime = true, notificationMode = 'console' } = parameters;

const LABEL = LOG_LEVELS.WARNING;
const LABEL = LOG_LEVEL.WARNING;

return splitter({
message,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const LOG_LEVELS = {
const LOG_LEVEL = {
ERROR: 'error',
WARNING: 'warning',
SUCCESS: 'success',
INFO: 'info',
};

export { LOG_LEVELS };
export { LOG_LEVEL };
8 changes: 4 additions & 4 deletions src/utils/console-log/console-log.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import chalk from 'chalk';

import { LOG_LEVELS } from '#constants/log-levels.ts';
import { LOG_LEVEL } from '#constants/log-level.ts';
import { notification } from '#utils/notification/notification.ts';

import type { Parameters } from './parameters.ts';
Expand All @@ -10,15 +10,15 @@ const consoleLog = async (parameters: Parameters) => {

const info = await notification({ message, title, hasTime });

if (title === LOG_LEVELS.ERROR) {
if (title === LOG_LEVEL.ERROR) {
return console.error(chalk.red(info));
}

if (title === LOG_LEVELS.WARNING) {
if (title === LOG_LEVEL.WARNING) {
return console.warn(chalk.yellow(info));
}

if (title === LOG_LEVELS.SUCCESS) {
if (title === LOG_LEVEL.SUCCESS) {
return console.info(chalk.green(info));
}

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"#utils/*": ["./src/utils/*"]
},
"rootDir": "src",
"types": ["chalk", "node", "vitest"],
"types": ["chalk", "node"],
// Projects
"disableReferencedProjectLoad": true,
// Type Checking
Expand Down

0 comments on commit 6c31dc7

Please sign in to comment.