Skip to content

Commit

Permalink
Merge branch 'next' into revert_from_tarball
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni authored Jun 3, 2024
2 parents f08dd0a + 9ea81c2 commit 1bb7863
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 26 deletions.
22 changes: 11 additions & 11 deletions modelina-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ $ npm install -g @asyncapi/modelina-cli
$ modelina COMMAND
running command...
$ modelina (--version)
@asyncapi/modelina-cli/4.0.0-next.44 linux-x64 node-v18.20.3
@asyncapi/modelina-cli/4.0.0-next.45 linux-x64 node-v18.20.3
$ modelina --help [COMMAND]
USAGE
$ modelina COMMAND
Expand Down Expand Up @@ -204,7 +204,7 @@ DESCRIPTION
CLI config settings
```

_See code: [src/commands/config/index.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.44/modelina-cli/src/commands/config/index.ts)_
_See code: [src/commands/config/index.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.45/modelina-cli/src/commands/config/index.ts)_

## `modelina config context`

Expand All @@ -218,7 +218,7 @@ DESCRIPTION
Manage short aliases for full paths to inputs
```

_See code: [src/commands/config/context/index.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.44/modelina-cli/src/commands/config/context/index.ts)_
_See code: [src/commands/config/context/index.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.45/modelina-cli/src/commands/config/context/index.ts)_

## `modelina config context add CONTEXT-NAME SPEC-FILE-PATH`

Expand All @@ -240,7 +240,7 @@ DESCRIPTION
Add a context to the store
```

_See code: [src/commands/config/context/add.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.44/modelina-cli/src/commands/config/context/add.ts)_
_See code: [src/commands/config/context/add.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.45/modelina-cli/src/commands/config/context/add.ts)_

## `modelina config context current`

Expand All @@ -257,7 +257,7 @@ DESCRIPTION
Shows the current context that is being used
```

_See code: [src/commands/config/context/current.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.44/modelina-cli/src/commands/config/context/current.ts)_
_See code: [src/commands/config/context/current.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.45/modelina-cli/src/commands/config/context/current.ts)_

## `modelina config context edit CONTEXT-NAME NEW-SPEC-FILE-PATH`

Expand All @@ -278,7 +278,7 @@ DESCRIPTION
Edit a context in the store
```

_See code: [src/commands/config/context/edit.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.44/modelina-cli/src/commands/config/context/edit.ts)_
_See code: [src/commands/config/context/edit.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.45/modelina-cli/src/commands/config/context/edit.ts)_

## `modelina config context init [CONTEXT-FILE-PATH]`

Expand All @@ -301,7 +301,7 @@ DESCRIPTION
Initialize context
```

_See code: [src/commands/config/context/init.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.44/modelina-cli/src/commands/config/context/init.ts)_
_See code: [src/commands/config/context/init.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.45/modelina-cli/src/commands/config/context/init.ts)_

## `modelina config context list`

Expand All @@ -318,7 +318,7 @@ DESCRIPTION
List all the stored contexts in the store
```

_See code: [src/commands/config/context/list.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.44/modelina-cli/src/commands/config/context/list.ts)_
_See code: [src/commands/config/context/list.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.45/modelina-cli/src/commands/config/context/list.ts)_

## `modelina config context remove CONTEXT-NAME`

Expand All @@ -338,7 +338,7 @@ DESCRIPTION
Delete a context from the store
```

_See code: [src/commands/config/context/remove.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.44/modelina-cli/src/commands/config/context/remove.ts)_
_See code: [src/commands/config/context/remove.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.45/modelina-cli/src/commands/config/context/remove.ts)_

## `modelina config context use CONTEXT-NAME`

Expand All @@ -358,7 +358,7 @@ DESCRIPTION
Set a context as current
```

_See code: [src/commands/config/context/use.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.44/modelina-cli/src/commands/config/context/use.ts)_
_See code: [src/commands/config/context/use.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.45/modelina-cli/src/commands/config/context/use.ts)_

## `modelina generate LANGUAGE FILE`

Expand Down Expand Up @@ -416,5 +416,5 @@ DESCRIPTION
Generates typed models
```

_See code: [src/commands/generate.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.44/modelina-cli/src/commands/generate.ts)_
_See code: [src/commands/generate.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.45/modelina-cli/src/commands/generate.ts)_
<!-- commandsstop -->
19 changes: 17 additions & 2 deletions modelina-cli/bin/dev
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
import {execute} from '@oclif/core';
await execute({development: true, dir: import.meta.url});
#!/usr/bin/env nod

const oclif = require('@oclif/core')

const path = require('path')
const project = path.join(__dirname, '..', 'tsconfig.json')

// In dev mode -> use ts-node and dev plugins
process.env.NODE_ENV = 'development'

require('ts-node').register({project})

// In dev mode, always show stack traces
oclif.settings.debug = true;

// Start the CLI
oclif.run().then(oclif.flush).catch(oclif.Errors.handle)
12 changes: 10 additions & 2 deletions modelina-cli/bin/run
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/usr/bin/env node

import {execute} from '@oclif/core';
await execute({dir: import.meta.url});
process.env.NODE_ENV = 'development';

const oclif = require('@oclif/core');

oclif.run()
.then(require('@oclif/core/flush'))
.catch((err) => {
const oclifHandler = require('@oclif/core/handle');
return oclifHandler(err.message);
});
13 changes: 13 additions & 0 deletions modelina-cli/bin/run_bin
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env node

// Only the binary installed through NPM is considered production environment. See "bin" in package.json.
process.env.NODE_ENV = 'production';

const oclif = require('@oclif/core');

oclif.run()
.then(require('@oclif/core/flush'))
.catch((err) => {
const oclifHandler = require('@oclif/core/handle');
return oclifHandler(err.message);
});
3 changes: 3 additions & 0 deletions modelina-cli/bin/run_bin.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off

node "%~dp0\run_bin" %*
6 changes: 3 additions & 3 deletions modelina-cli/package-lock.json

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

4 changes: 2 additions & 2 deletions modelina-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@asyncapi/modelina-cli",
"description": "CLI to work with Modelina",
"version": "4.0.0-next.45",
"version": "4.0.0-next.46",
"bin": {
"modelina": "./bin/run"
"modelina": "./bin/run_bin"
},
"bugs": "https://github.com/asyncapi/modelina/issues",
"dependencies": {
Expand Down
2 changes: 0 additions & 2 deletions modelina-cli/src/commands/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,5 @@ ${model.result}
});
logger.info(`Successfully generated the following models: ${generatedModelsString.join('\n')}`);
}


}
}
2 changes: 1 addition & 1 deletion modelina-cli/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
"include": [
"src"
]
}
}
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@asyncapi/modelina",
"version": "4.0.0-next.45",
"version": "4.0.0-next.46",
"description": "Library for generating data models based on inputs such as AsyncAPI, OpenAPI, or JSON Schema documents",
"license": "Apache-2.0",
"homepage": "https://www.modelina.org",
Expand Down

0 comments on commit 1bb7863

Please sign in to comment.