Skip to content

WIP: feat: add first version for generate command #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"extends": [
"oclif",
"oclif-typescript"
]
],
"rules": {
"unicorn/prefer-module": 0
}
}
243 changes: 2 additions & 241 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $ npm install -g exception-generator
$ artus-exception-generator COMMAND
running command...
$ artus-exception-generator (--version)
exception-generator/0.0.0 darwin-x64 node-v16.17.1
exception-generator/0.0.1 darwin-x64 node-v16.17.1
$ artus-exception-generator --help [COMMAND]
USAGE
$ artus-exception-generator COMMAND
Expand All @@ -34,15 +34,6 @@ USAGE
* [`artus-exception-generator hello PERSON`](#artus-exception-generator-hello-person)
* [`artus-exception-generator hello world`](#artus-exception-generator-hello-world)
* [`artus-exception-generator help [COMMAND]`](#artus-exception-generator-help-command)
* [`artus-exception-generator plugins`](#artus-exception-generator-plugins)
* [`artus-exception-generator plugins:install PLUGIN...`](#artus-exception-generator-pluginsinstall-plugin)
* [`artus-exception-generator plugins:inspect PLUGIN...`](#artus-exception-generator-pluginsinspect-plugin)
* [`artus-exception-generator plugins:install PLUGIN...`](#artus-exception-generator-pluginsinstall-plugin-1)
* [`artus-exception-generator plugins:link PLUGIN`](#artus-exception-generator-pluginslink-plugin)
* [`artus-exception-generator plugins:uninstall PLUGIN...`](#artus-exception-generator-pluginsuninstall-plugin)
* [`artus-exception-generator plugins:uninstall PLUGIN...`](#artus-exception-generator-pluginsuninstall-plugin-1)
* [`artus-exception-generator plugins:uninstall PLUGIN...`](#artus-exception-generator-pluginsuninstall-plugin-2)
* [`artus-exception-generator plugins update`](#artus-exception-generator-plugins-update)

## `artus-exception-generator hello PERSON`

Expand All @@ -66,7 +57,7 @@ EXAMPLES
hello friend from oclif! (./src/commands/hello/index.ts)
```

_See code: [dist/commands/hello/index.ts](https://github.com/artusjs/exception-generator/blob/v0.0.0/dist/commands/hello/index.ts)_
_See code: [dist/commands/hello/index.ts](https://github.com/artusjs/exception-generator/blob/v0.0.1/dist/commands/hello/index.ts)_

## `artus-exception-generator hello world`

Expand Down Expand Up @@ -103,234 +94,4 @@ DESCRIPTION
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.15/src/commands/help.ts)_

## `artus-exception-generator plugins`

List installed plugins.

```
USAGE
$ artus-exception-generator plugins [--core]

FLAGS
--core Show core plugins.

DESCRIPTION
List installed plugins.

EXAMPLES
$ artus-exception-generator plugins
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.1.2/src/commands/plugins/index.ts)_

## `artus-exception-generator plugins:install PLUGIN...`

Installs a plugin into the CLI.

```
USAGE
$ artus-exception-generator plugins:install PLUGIN...

ARGUMENTS
PLUGIN Plugin to install.

FLAGS
-f, --force Run yarn install with force flag.
-h, --help Show CLI help.
-v, --verbose

DESCRIPTION
Installs a plugin into the CLI.
Can be installed from npm or a git url.

Installation of a user-installed plugin will override a core plugin.

e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
the CLI without the need to patch and update the whole CLI.


ALIASES
$ artus-exception-generator plugins add

EXAMPLES
$ artus-exception-generator plugins:install myplugin

$ artus-exception-generator plugins:install https://github.com/someuser/someplugin

$ artus-exception-generator plugins:install someuser/someplugin
```

## `artus-exception-generator plugins:inspect PLUGIN...`

Displays installation properties of a plugin.

```
USAGE
$ artus-exception-generator plugins:inspect PLUGIN...

ARGUMENTS
PLUGIN [default: .] Plugin to inspect.

FLAGS
-h, --help Show CLI help.
-v, --verbose

DESCRIPTION
Displays installation properties of a plugin.

EXAMPLES
$ artus-exception-generator plugins:inspect myplugin
```

## `artus-exception-generator plugins:install PLUGIN...`

Installs a plugin into the CLI.

```
USAGE
$ artus-exception-generator plugins:install PLUGIN...

ARGUMENTS
PLUGIN Plugin to install.

FLAGS
-f, --force Run yarn install with force flag.
-h, --help Show CLI help.
-v, --verbose

DESCRIPTION
Installs a plugin into the CLI.
Can be installed from npm or a git url.

Installation of a user-installed plugin will override a core plugin.

e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
the CLI without the need to patch and update the whole CLI.


ALIASES
$ artus-exception-generator plugins add

EXAMPLES
$ artus-exception-generator plugins:install myplugin

$ artus-exception-generator plugins:install https://github.com/someuser/someplugin

$ artus-exception-generator plugins:install someuser/someplugin
```

## `artus-exception-generator plugins:link PLUGIN`

Links a plugin into the CLI for development.

```
USAGE
$ artus-exception-generator plugins:link PLUGIN

ARGUMENTS
PATH [default: .] path to plugin

FLAGS
-h, --help Show CLI help.
-v, --verbose

DESCRIPTION
Links a plugin into the CLI for development.
Installation of a linked plugin will override a user-installed or core plugin.

e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
command will override the user-installed or core plugin implementation. This is useful for development work.


EXAMPLES
$ artus-exception-generator plugins:link myplugin
```

## `artus-exception-generator plugins:uninstall PLUGIN...`

Removes a plugin from the CLI.

```
USAGE
$ artus-exception-generator plugins:uninstall PLUGIN...

ARGUMENTS
PLUGIN plugin to uninstall

FLAGS
-h, --help Show CLI help.
-v, --verbose

DESCRIPTION
Removes a plugin from the CLI.

ALIASES
$ artus-exception-generator plugins unlink
$ artus-exception-generator plugins remove
```

## `artus-exception-generator plugins:uninstall PLUGIN...`

Removes a plugin from the CLI.

```
USAGE
$ artus-exception-generator plugins:uninstall PLUGIN...

ARGUMENTS
PLUGIN plugin to uninstall

FLAGS
-h, --help Show CLI help.
-v, --verbose

DESCRIPTION
Removes a plugin from the CLI.

ALIASES
$ artus-exception-generator plugins unlink
$ artus-exception-generator plugins remove
```

## `artus-exception-generator plugins:uninstall PLUGIN...`

Removes a plugin from the CLI.

```
USAGE
$ artus-exception-generator plugins:uninstall PLUGIN...

ARGUMENTS
PLUGIN plugin to uninstall

FLAGS
-h, --help Show CLI help.
-v, --verbose

DESCRIPTION
Removes a plugin from the CLI.

ALIASES
$ artus-exception-generator plugins unlink
$ artus-exception-generator plugins remove
```

## `artus-exception-generator plugins update`

Update installed plugins.

```
USAGE
$ artus-exception-generator plugins update [-h] [-v]

FLAGS
-h, --help Show CLI help.
-v, --verbose

DESCRIPTION
Update installed plugins.
```
<!-- commandsstop -->
5 changes: 5 additions & 0 deletions example/config/framework.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import path from 'node:path'

export default {
path: path.resolve(__dirname, '../framework'),
}
8 changes: 8 additions & 0 deletions example/config/plugin.default.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import path from 'node:path'

export default {
a: {
enable: true,
path: path.resolve(__dirname, '../plugin/a'),
},
}
6 changes: 6 additions & 0 deletions example/exception.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"APP:TEST": {
"desc": "This is a test error",
"detailUrl": "https://github.com/artusjs"
}
}
10 changes: 10 additions & 0 deletions example/exception/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// THIS FILE IS AUTO-GENERATED BY ARTUS EXCEPTION GENERATOR
import { ArtusStdError } from '@artus/core';

export class TestError extends ArtusStdError {
static code = 'APP:TEST';
name = 'TestError';
constructor() {
super(TestError.code);
}
}
10 changes: 10 additions & 0 deletions example/exception/framework.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// THIS FILE IS AUTO-GENERATED BY ARTUS EXCEPTION GENERATOR
import { ArtusStdError } from '@artus/core';

export class TestError extends ArtusStdError {
static code = 'FRAMEWORK:TEST';
name = 'TestError';
constructor() {
super(TestError.code);
}
}
10 changes: 10 additions & 0 deletions example/exception/pluginA.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// THIS FILE IS AUTO-GENERATED BY ARTUS EXCEPTION GENERATOR
import { ArtusStdError } from '@artus/core';

export class TestError extends ArtusStdError {
static code = 'PLUGIN_A:TEST';
name = 'TestError';
constructor() {
super(TestError.code);
}
}
10 changes: 10 additions & 0 deletions example/exception/pluginB.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// THIS FILE IS AUTO-GENERATED BY ARTUS EXCEPTION GENERATOR
import { ArtusStdError } from '@artus/core';

export class TestError extends ArtusStdError {
static code = 'PLUGIN_B:TEST';
name = 'TestError';
constructor() {
super(TestError.code);
}
}
8 changes: 8 additions & 0 deletions example/framework/config/plugin.default.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import path from 'node:path'

export default {
b: {
enable: true,
path: path.resolve(__dirname, '../../plugin/b'),
},
}
6 changes: 6 additions & 0 deletions example/framework/exception.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"FRAMEWORK:TEST": {
"desc": "This is a test error",
"detailUrl": "https://github.com/artusjs"
}
}
3 changes: 3 additions & 0 deletions example/framework/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "framework"
}
Loading