From 24d4b1d21b84e8879075e35234387b21a9b401ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Lenon?= Date: Wed, 9 Aug 2023 19:09:43 -0300 Subject: [PATCH 1/2] fix(types): export types --- package-lock.json | 18 +++++++++--------- package.json | 4 ++-- src/index.ts | 2 +- tests/unit/CleanTest.ts | 3 +-- tests/unit/CollectionTest.ts | 3 +-- tests/unit/ExceptionTest.ts | 3 +-- tests/unit/ExecTest.ts | 3 +-- tests/unit/FakeApiTest.ts | 3 +-- tests/unit/FileTest.ts | 3 +-- tests/unit/FolderTest.ts | 3 +-- tests/unit/HttpClientTest.ts | 3 +-- tests/unit/IsTest.ts | 3 +-- tests/unit/JsonTest.ts | 3 +-- tests/unit/ModuleTest.ts | 3 +-- tests/unit/NumberTest.ts | 3 +-- tests/unit/OptionsTest.ts | 3 +-- tests/unit/ParserTest.ts | 3 +-- tests/unit/PathTest.ts | 6 ++---- tests/unit/RouteTest.ts | 3 +-- tests/unit/StringTest.ts | 3 +-- tests/unit/UuidTest.ts | 3 +-- 21 files changed, 31 insertions(+), 50 deletions(-) diff --git a/package-lock.json b/package-lock.json index 68cc244..d4bf981 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@athenna/common", - "version": "4.4.0", + "version": "4.5.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@athenna/common", - "version": "4.4.0", + "version": "4.5.0", "license": "MIT", "dependencies": { "@fastify/formbody": "^7.4.0", @@ -33,7 +33,7 @@ "youch-terminal": "^2.2.1" }, "devDependencies": { - "@athenna/test": "^4.3.0", + "@athenna/test": "^4.4.0", "@types/bytes": "^3.1.1", "@types/callsite": "^1.0.31", "@types/debug": "^4.1.7", @@ -105,9 +105,9 @@ "dev": true }, "node_modules/@athenna/test": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@athenna/test/-/test-4.3.0.tgz", - "integrity": "sha512-q/lhmEffzgPM5O5b/IM8pORGpVNb0YsCMSu7nUa/9mC/bIugo+LJA4EKrHLoupV8MmNt2o1v1udim6ubtkGD7g==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@athenna/test/-/test-4.4.0.tgz", + "integrity": "sha512-cMWz2ws9YbHD0EUGgeQpivaOnQOUQa2vglNPHNPkWNaBJimPm1dpX2tq/af2hYybD2FGmEqND5BP21YSRjBxdw==", "dev": true, "dependencies": { "@japa/assert": "^1.4.1", @@ -9177,9 +9177,9 @@ "dev": true }, "@athenna/test": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@athenna/test/-/test-4.3.0.tgz", - "integrity": "sha512-q/lhmEffzgPM5O5b/IM8pORGpVNb0YsCMSu7nUa/9mC/bIugo+LJA4EKrHLoupV8MmNt2o1v1udim6ubtkGD7g==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@athenna/test/-/test-4.4.0.tgz", + "integrity": "sha512-cMWz2ws9YbHD0EUGgeQpivaOnQOUQa2vglNPHNPkWNaBJimPm1dpX2tq/af2hYybD2FGmEqND5BP21YSRjBxdw==", "dev": true, "requires": { "@japa/assert": "^1.4.1", diff --git a/package.json b/package.json index b42917e..439ccbb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@athenna/common", - "version": "4.4.0", + "version": "4.5.0", "description": "The Athenna common helpers to use in any Node.js ESM project.", "license": "MIT", "author": "João Lenon ", @@ -74,7 +74,7 @@ "youch-terminal": "^2.2.1" }, "devDependencies": { - "@athenna/test": "^4.3.0", + "@athenna/test": "^4.4.0", "@types/bytes": "^3.1.1", "@types/callsite": "^1.0.31", "@types/debug": "^4.1.7", diff --git a/src/index.ts b/src/index.ts index f5d0efb..cb159bf 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,7 +7,7 @@ * file that was distributed with this source code. */ -export * from '#src/types' +export * from './types/index.js' export * from '#src/globals/Path' export * from '#src/globals/Error' diff --git a/tests/unit/CleanTest.ts b/tests/unit/CleanTest.ts index 9b8a7cf..0486798 100644 --- a/tests/unit/CleanTest.ts +++ b/tests/unit/CleanTest.ts @@ -8,8 +8,7 @@ */ import { Clean } from '#src' -import { Test } from '@athenna/test' -import type { Context } from '@athenna/test/types' +import { Test, type Context } from '@athenna/test' export default class CleanTest { @Test() diff --git a/tests/unit/CollectionTest.ts b/tests/unit/CollectionTest.ts index 3a037a0..50f0d6b 100644 --- a/tests/unit/CollectionTest.ts +++ b/tests/unit/CollectionTest.ts @@ -8,8 +8,7 @@ */ import { Collection } from '#src' -import { Test } from '@athenna/test' -import type { Context } from '@athenna/test/types' +import { Test, type Context } from '@athenna/test' export default class CollectionTest { @Test() diff --git a/tests/unit/ExceptionTest.ts b/tests/unit/ExceptionTest.ts index d82df90..0cc2124 100644 --- a/tests/unit/ExceptionTest.ts +++ b/tests/unit/ExceptionTest.ts @@ -8,8 +8,7 @@ */ import { Exception } from '#src' -import { Test } from '@athenna/test' -import type { Context } from '@athenna/test/types' +import { Test, type Context } from '@athenna/test' export default class ExceptionTest { @Test() diff --git a/tests/unit/ExecTest.ts b/tests/unit/ExecTest.ts index d2ad18a..2acc8f4 100644 --- a/tests/unit/ExecTest.ts +++ b/tests/unit/ExecTest.ts @@ -7,8 +7,7 @@ * file that was distributed with this source code. */ -import { Test, BeforeEach } from '@athenna/test' -import type { Context } from '@athenna/test/types' +import { Test, BeforeEach, type Context } from '@athenna/test' import { Clean, Exec, File, Folder, Module, Path } from '#src' import { NodeCommandException } from '#src/exceptions/NodeCommandException' diff --git a/tests/unit/FakeApiTest.ts b/tests/unit/FakeApiTest.ts index e875de3..de4b20a 100644 --- a/tests/unit/FakeApiTest.ts +++ b/tests/unit/FakeApiTest.ts @@ -7,9 +7,8 @@ * file that was distributed with this source code. */ -import type { Context } from '@athenna/test/types' import { FakeApi, Folder, HttpClient, Path } from '#src' -import { Test, AfterAll, BeforeAll, AfterEach } from '@athenna/test' +import { Test, AfterAll, BeforeAll, AfterEach, type Context } from '@athenna/test' export default class FakeApiTest { @BeforeAll() diff --git a/tests/unit/FileTest.ts b/tests/unit/FileTest.ts index 8280cfa..f21f03c 100644 --- a/tests/unit/FileTest.ts +++ b/tests/unit/FileTest.ts @@ -9,8 +9,7 @@ import { sep } from 'node:path' import { File, Path, Folder } from '#src' -import type { Context } from '@athenna/test/types' -import { Test, AfterEach, BeforeEach } from '@athenna/test' +import { Test, AfterEach, BeforeEach, type Context } from '@athenna/test' import { NotFoundFileException } from '#src/exceptions/NotFoundFileException' export default class FileTest { diff --git a/tests/unit/FolderTest.ts b/tests/unit/FolderTest.ts index f3e9ce7..1035f9f 100644 --- a/tests/unit/FolderTest.ts +++ b/tests/unit/FolderTest.ts @@ -9,8 +9,7 @@ import { sep } from 'node:path' import { Path, File, Folder } from '#src' -import type { Context } from '@athenna/test/types' -import { Test, AfterEach, BeforeEach } from '@athenna/test' +import { Test, AfterEach, BeforeEach, type Context } from '@athenna/test' import { NotFoundFolderException } from '#src/exceptions/NotFoundFolderException' export default class FolderTest { diff --git a/tests/unit/HttpClientTest.ts b/tests/unit/HttpClientTest.ts index 5ca422b..f15ba3d 100644 --- a/tests/unit/HttpClientTest.ts +++ b/tests/unit/HttpClientTest.ts @@ -9,9 +9,8 @@ import { promisify } from 'node:util' import { pipeline } from 'node:stream' -import type { Context } from '@athenna/test/types' -import { Test, AfterAll, BeforeAll, BeforeEach } from '@athenna/test' import { File, Path, FakeApi, HttpClient, HttpClientBuilder } from '#src' +import { Test, AfterAll, BeforeAll, BeforeEach, type Context } from '@athenna/test' export default class HttpClientTest { private pipeline = promisify(pipeline) diff --git a/tests/unit/IsTest.ts b/tests/unit/IsTest.ts index 3cb012d..cf603d8 100644 --- a/tests/unit/IsTest.ts +++ b/tests/unit/IsTest.ts @@ -8,8 +8,7 @@ */ import { Is, Exception } from '#src' -import { Test } from '@athenna/test' -import type { Context } from '@athenna/test/types' +import { Test, type Context } from '@athenna/test' export default class IsTest { @Test() diff --git a/tests/unit/JsonTest.ts b/tests/unit/JsonTest.ts index a919e3b..4fb52dd 100644 --- a/tests/unit/JsonTest.ts +++ b/tests/unit/JsonTest.ts @@ -8,8 +8,7 @@ */ import { Exec, Json } from '#src' -import { Test } from '@athenna/test' -import type { Context } from '@athenna/test/types' +import { Test, type Context } from '@athenna/test' export default class JsonTest { @Test() diff --git a/tests/unit/ModuleTest.ts b/tests/unit/ModuleTest.ts index 558c0bf..955d93d 100644 --- a/tests/unit/ModuleTest.ts +++ b/tests/unit/ModuleTest.ts @@ -8,8 +8,7 @@ */ import { Module, Path } from '#src' -import { Test } from '@athenna/test' -import type { Context } from '@athenna/test/types' +import { Test, type Context } from '@athenna/test' import { NotFoundResolveException } from '#src/exceptions/NotFoundResolveException' export default class ModuleTest { diff --git a/tests/unit/NumberTest.ts b/tests/unit/NumberTest.ts index eb06209..2af18dc 100644 --- a/tests/unit/NumberTest.ts +++ b/tests/unit/NumberTest.ts @@ -8,8 +8,7 @@ */ import { Number } from '#src' -import { Test } from '@athenna/test' -import type { Context } from '@athenna/test/types' +import { Test, type Context } from '@athenna/test' export default class NumberTest { @Test() diff --git a/tests/unit/OptionsTest.ts b/tests/unit/OptionsTest.ts index 4b4bad5..78ba212 100644 --- a/tests/unit/OptionsTest.ts +++ b/tests/unit/OptionsTest.ts @@ -8,8 +8,7 @@ */ import { Options } from '#src' -import { Test } from '@athenna/test' -import type { Context } from '@athenna/test/types' +import { Test, type Context } from '@athenna/test' export default class OptionsTest { @Test() diff --git a/tests/unit/ParserTest.ts b/tests/unit/ParserTest.ts index d30173a..cc3668c 100644 --- a/tests/unit/ParserTest.ts +++ b/tests/unit/ParserTest.ts @@ -8,8 +8,7 @@ */ import { Parser } from '#src' -import { Test } from '@athenna/test' -import type { Context } from '@athenna/test/types' +import { Test, type Context } from '@athenna/test' import { InvalidNumberException } from '#src/exceptions/InvalidNumberException' export default class ParserTest { diff --git a/tests/unit/PathTest.ts b/tests/unit/PathTest.ts index dfc1b7a..ddc17ec 100644 --- a/tests/unit/PathTest.ts +++ b/tests/unit/PathTest.ts @@ -8,10 +8,8 @@ */ import { sep } from 'node:path' -import { Path, Json } from '#src' -import type { PathDirs } from '#src/types' -import { Test, BeforeEach } from '@athenna/test' -import type { Context } from '@athenna/test/types' +import { Path, Json, type PathDirs } from '#src' +import { Test, BeforeEach, type Context } from '@athenna/test' export default class PathTest { public defaultPathDirs: PathDirs = Json.copy(Path.dirs) diff --git a/tests/unit/RouteTest.ts b/tests/unit/RouteTest.ts index 461cf03..5f40c26 100644 --- a/tests/unit/RouteTest.ts +++ b/tests/unit/RouteTest.ts @@ -8,8 +8,7 @@ */ import { Route, Uuid } from '#src' -import { Test } from '@athenna/test' -import type { Context } from '@athenna/test/types' +import { Test, type Context } from '@athenna/test' import { RouteMatchException } from '#src/exceptions/RouteMatchException' export default class RouteTest { diff --git a/tests/unit/StringTest.ts b/tests/unit/StringTest.ts index 2281460..03986cc 100644 --- a/tests/unit/StringTest.ts +++ b/tests/unit/StringTest.ts @@ -8,8 +8,7 @@ */ import { String } from '#src' -import { Test } from '@athenna/test' -import type { Context } from '@athenna/test/types' +import { Test, type Context } from '@athenna/test' import { OrdinalNanException } from '#src/exceptions/OrdinalNanException' export default class StringTest { diff --git a/tests/unit/UuidTest.ts b/tests/unit/UuidTest.ts index e72af43..45889f9 100644 --- a/tests/unit/UuidTest.ts +++ b/tests/unit/UuidTest.ts @@ -9,8 +9,7 @@ import { v4 } from 'uuid' import { Uuid } from '#src' -import { Test } from '@athenna/test' -import type { Context } from '@athenna/test/types' +import { Test, type Context } from '@athenna/test' import { InvalidUuidException } from '#src/exceptions/InvalidUuidException' export default class UuidTest { From aa5ee7350c7881706feb6bb6d1eeeea84104e052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Lenon?= Date: Wed, 9 Aug 2023 19:15:02 -0300 Subject: [PATCH 2/2] fix(types): export types --- src/helpers/Color.ts | 3 +-- src/helpers/Path.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/helpers/Color.ts b/src/helpers/Color.ts index 6395cb5..903a90d 100644 --- a/src/helpers/Color.ts +++ b/src/helpers/Color.ts @@ -7,10 +7,9 @@ * file that was distributed with this source code. */ -import type { ChalkInstance } from 'chalk' -import { Chalk } from 'chalk' import { format } from 'node:util' import { Is } from '#src/helpers/Is' +import { Chalk, type ChalkInstance } from 'chalk' export class Color { /** diff --git a/src/helpers/Path.ts b/src/helpers/Path.ts index 19477d9..db62c08 100644 --- a/src/helpers/Path.ts +++ b/src/helpers/Path.ts @@ -11,8 +11,8 @@ import callSite from 'callsite' import { fileURLToPath } from 'node:url' import { homedir, tmpdir } from 'node:os' -import { sep, normalize, dirname } from 'node:path' import type { PathDirs } from '#src/types' +import { sep, normalize, dirname } from 'node:path' export class Path { public static dirs: PathDirs = {