Skip to content

Commit

Permalink
Merge pull request #190 from AthennaIO/develop
Browse files Browse the repository at this point in the history
chore(npm): update dependencies
  • Loading branch information
jlenon7 authored Mar 3, 2024
2 parents 79fd3ce + 0ac7624 commit 14e7e4e
Show file tree
Hide file tree
Showing 22 changed files with 186 additions and 53 deletions.
54 changes: 27 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,18 @@
"columnify": "^1.6.0",
"commander": "^9.5.0",
"figlet": "^1.7.0",
"inquirer": "^9.2.13",
"inquirer": "^9.2.14",
"log-update": "^5.0.1",
"ora": "^6.3.1"
},
"devDependencies": {
"@athenna/common": "^4.34.0",
"@athenna/config": "^4.16.0",
"@athenna/ioc": "^4.16.0",
"@athenna/logger": "^4.17.0",
"@athenna/common": "^4.35.0",
"@athenna/config": "^4.18.0",
"@athenna/ioc": "^4.18.0",
"@athenna/logger": "^4.18.0",
"@athenna/test": "^4.22.0",
"@athenna/tsconfig": "^4.12.0",
"@athenna/view": "^4.18.0",
"@athenna/view": "^4.20.0",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"commitizen": "^4.2.6",
Expand Down
14 changes: 12 additions & 2 deletions src/artisan/BaseCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import { Rc } from '@athenna/config'
import { Color } from '@athenna/common'
import { Npm } from '#src/helpers/command/Npm'
import { Prompt } from '#src/helpers/command/Prompt'
import { Logger } from '#src/helpers/command/Logger'
import { Annotation } from '#src/helpers/Annotation'
Expand Down Expand Up @@ -73,12 +74,21 @@ export abstract class BaseCommand {

/**
* The generator used to make files. The generator uses the
* athenna/view package to generate files from templates. A
* `@athenna/view` package to generate files from templates. A
* briefly knowledge about how to setup templates inside
* athenna/view is very good to use this helper.
* `@athenna/view` is very good to use this helper.
*/
public generator = new Generator()

/**
* Use the npm helper to perform operations inside child
* processes for linking and installing dependencies using
* any kind of registry. The npm registry will always be the
* default registry, but you can change it setting the registry
* in options.
*/
public npm = new Npm()

/**
* Execute the command setting args and options in the class
*/
Expand Down
14 changes: 12 additions & 2 deletions src/artisan/BaseConfigurer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import { Rc } from '@athenna/config'
import { Color } from '@athenna/common'
import { parse, resolve } from 'node:path'
import { Npm } from '#src/helpers/command/Npm'
import { Prompt } from '#src/helpers/command/Prompt'
import { Logger } from '#src/helpers/command/Logger'
import { Generator } from '#src/helpers/command/Generator'
Expand Down Expand Up @@ -60,12 +61,21 @@ export abstract class BaseConfigurer {

/**
* The generator used to make files. The generator uses the
* athenna/view package to generate files from templates. A
* `@athenna/view` package to generate files from templates. A
* briefly knowledge about how to setup templates inside
* athenna/view is very good to use this helper.
* `@athenna/view` is very good to use this helper.
*/
public generator = new Generator()

/**
* Use the npm helper to perform operations inside child
* processes for linking and installing dependencies using
* any kind of registry. The npm registry will always be the
* default registry, but you can change it setting the registry
* in options.
*/
public npm = new Npm()

/**
* Set the path of the configurer.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/commands/ConfigureCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import { extname, resolve } from 'node:path'
import { Argument, BaseCommand } from '#src'
import { File, Module } from '@athenna/common'
import { Path, File, Module } from '@athenna/common'
import { NotFoundLibraryException } from '#src/exceptions/NotFoundLibraryException'
import { NotFoundConfigurerException } from '#src/exceptions/NotFoundConfigurerException'

Expand Down
2 changes: 1 addition & 1 deletion src/commands/TemplateCustomizeCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { BaseCommand } from '#src'
import { Exec, File } from '@athenna/common'
import { Path, Exec, File } from '@athenna/common'
import { resolve, relative, isAbsolute } from 'node:path'

export class TemplateCustomizeCommand extends BaseCommand {
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/command/Generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { View } from '@athenna/view'
import { File, String } from '@athenna/common'
import { Path, File, String } from '@athenna/common'
import { sep, resolve, isAbsolute } from 'node:path'
import { AlreadyExistFileException } from '#src/exceptions/AlreadyExistFileException'

Expand Down
46 changes: 46 additions & 0 deletions src/helpers/command/Npm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* @athenna/artisan
*
* (c) João Lenon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

import {
Exec,
type LinkPackageOptions,
type InstallPackageOptions
} from '@athenna/common'

export class Npm {
/**
* Run `npm link` command inside a child process.
*
* @example
* ```ts
* await this.npm.link('@athenna/common')
* ```
*
* By default the registry used will be `npm`, but you
* can change it by adding your registry in options:
*
* @example
* ```ts
* await this.npm.link('@athenna/common', { registry: 'yarn' })
* ```
*/
public async link(
libraries: string | string[],
options?: LinkPackageOptions
) {
return Exec.link(libraries, options)
}

public async install(
libraries: string | string[],
options?: InstallPackageOptions
) {
return Exec.install(libraries, options)
}
}
2 changes: 1 addition & 1 deletion src/kernels/ConsoleKernel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { sep, isAbsolute, resolve } from 'node:path'
import { Exec, File, Is, Module } from '@athenna/common'
import { Path, Exec, File, Is, Module } from '@athenna/common'
import { Artisan, CommanderHandler, ConsoleExceptionHandler } from '#src'

export class ConsoleKernel {
Expand Down
4 changes: 2 additions & 2 deletions src/testing/plugins/command/TestCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

import { Artisan } from '#src'
import { Assert } from '@japa/assert'
import type { CommandOutput } from '@athenna/common'
import { Path, type CommandOutput } from '@athenna/common'
import { TestOutput } from '#src/testing/plugins/command/TestOutput'
import type { CallInChildOptions } from '#src/types/CallInChildOptions'

export class TestCommand {
/**
* The Artisan file path that will be used to run commands.
*
* @default 'Path.bootstrap(`console.${Path.ext()}`)'
* @default Path.bootstrap(`console.${Path.ext()}`)
*/
public static artisanPath = Path.bootstrap(`console.${Path.ext()}`)

Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/consoles/base-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* file that was distributed with this source code.
*/

import { Path } from '@athenna/common'
import { Config, Rc } from '@athenna/config'
import { ViewProvider } from '@athenna/view'
import { Artisan, ArtisanProvider } from '#src'
Expand Down
6 changes: 3 additions & 3 deletions tests/fixtures/consoles/console-mock-dest-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
* file that was distributed with this source code.
*/

import { Artisan, ArtisanProvider } from '#src'

import { Config, Rc } from '@athenna/config'
import { Path } from '@athenna/common'
import { ViewProvider } from '@athenna/view'
import { Config, Rc } from '@athenna/config'
import { Artisan, ArtisanProvider } from '#src'
import { ListCommand } from '#src/commands/ListCommand'
import { ConfigureCommand } from '#src/commands/ConfigureCommand'
import { MakeCommandCommand } from '#src/commands/MakeCommandCommand'
Expand Down
5 changes: 2 additions & 3 deletions tests/fixtures/consoles/console-mock-library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
*/

import { Mock } from '@athenna/test'
import { BaseConfigurer, Artisan, ArtisanProvider } from '#src'
import { File, Module } from '@athenna/common'

import { Config, Rc } from '@athenna/config'
import { ViewProvider } from '@athenna/view'
import { Path, File, Module } from '@athenna/common'
import { ListCommand } from '#src/commands/ListCommand'
import { BaseConfigurer, Artisan, ArtisanProvider } from '#src'
import { ConfigureCommand } from '#src/commands/ConfigureCommand'
import { MakeCommandCommand } from '#src/commands/MakeCommandCommand'
import { TemplateCustomizeCommand } from '#src/commands/TemplateCustomizeCommand'
Expand Down
12 changes: 10 additions & 2 deletions tests/fixtures/consoles/console-mock-test-template.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import { File, Path } from '@athenna/common'
import { Artisan, ArtisanProvider } from '#src'
/**
* @athenna/artisan
*
* (c) João Lenon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

import { Config, Rc } from '@athenna/config'
import { File, Path } from '@athenna/common'
import { ViewProvider } from '@athenna/view'
import { Artisan, ArtisanProvider } from '#src'
import { ListCommand } from '#src/commands/ListCommand'
import { ConfigureCommand } from '#src/commands/ConfigureCommand'
import { MakeCommandCommand } from '#src/commands/MakeCommandCommand'
Expand Down
9 changes: 9 additions & 0 deletions tests/fixtures/routes/console.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* @athenna/artisan
*
* (c) João Lenon <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

import { Artisan } from '#src'

Artisan.route('test:one', async function () {})
Expand Down
1 change: 1 addition & 0 deletions tests/unit/artisan/ArtisanTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* file that was distributed with this source code.
*/

import { Path } from '@athenna/common'
import { BaseTest } from '#tests/helpers/BaseTest'
import { Test, type Context, Mock } from '@athenna/test'
import { Annotation, Artisan, CommanderHandler } from '#src'
Expand Down
1 change: 1 addition & 0 deletions tests/unit/commands/ConfigureCommandTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* file that was distributed with this source code.
*/

import { Path } from '@athenna/common'
import { BaseTest } from '#tests/helpers/BaseTest'
import { Test, type Context } from '@athenna/test'

Expand Down
Loading

0 comments on commit 14e7e4e

Please sign in to comment.