Skip to content

Commit

Permalink
Merge branch 'master' into support_protobuf
Browse files Browse the repository at this point in the history
  • Loading branch information
derberg authored Sep 12, 2023
2 parents bed52db + 385842d commit f2a3dbb
Show file tree
Hide file tree
Showing 43 changed files with 469 additions and 198 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ dist
lib
/test/commands/generate/models/
test/helpers
/test/minimaltemplate
/test/fixtures/minimaltemplate
create-glee-app
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@
!assets/examples/default-example.yaml
!assets/examples/tutorial.yml
node_modules
/test/commands/generate/models/
/test/integration/generate/models/
asyncapi.json
asyncapi.yml
test/minimaltemplate/__transpiled
test/fixtures/minimaltemplate/__transpiled
.vscode


oclif.manifest.json
spec-examples.zip
spec-examples.zip

# Coverage for testing

coverage
309 changes: 280 additions & 29 deletions assets/create-glee-app/templates/default/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/create-glee-app/templates/default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"homepage": "https://github.com/asyncapi/glee-hello-world#readme",
"dependencies": {
"@asyncapi/glee": "^0.26.2"
"@asyncapi/glee": "^0.26.3"
},
"devDependencies": {
"@types/node": "^20.5.9"
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ asyncapi/cli [COMMAND HERE]
# Example that you can run inside the cli directory after cloning this repository. First, you specify the mount in the location of your AsyncAPI specification file and then you mount it in the directory where the generation result should be saved.
docker run --rm -it \
--user=root \
-v ${PWD}/test/fixtures/asyncapi_v1.yml:/app/asyncapi.yml \
-v ${PWD}/test/integration/fixtures/asyncapi_v1.yml:/app/asyncapi.yml \
-v ${PWD}/output:/app/output \
asyncapi/cli generate fromTemplate -o /app/output /app/asyncapi.yml @asyncapi/html-template --force-write
```
Expand Down
20 changes: 10 additions & 10 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ $ npm install -g @asyncapi/cli
$ asyncapi COMMAND
running command...
$ asyncapi (--version)
@asyncapi/cli/0.54.5 linux-x64 node-v18.17.1
@asyncapi/cli/0.54.7 linux-x64 node-v18.17.1
$ asyncapi --help [COMMAND]
USAGE
$ asyncapi COMMAND
Expand Down Expand Up @@ -93,7 +93,7 @@ EXAMPLES
$ asyncapi bundle ./asyncapi.yaml ./features.yaml --base ./asyncapi.yaml --reference-into-components
```

_See code: [src/commands/bundle.ts](https://github.com/asyncapi/cli/blob/v0.54.5/src/commands/bundle.ts)_
_See code: [src/commands/bundle.ts](https://github.com/asyncapi/cli/blob/v0.54.7/src/commands/bundle.ts)_

## `asyncapi config`

Expand All @@ -107,7 +107,7 @@ DESCRIPTION
CLI config settings
```

_See code: [src/commands/config/index.ts](https://github.com/asyncapi/cli/blob/v0.54.5/src/commands/config/index.ts)_
_See code: [src/commands/config/index.ts](https://github.com/asyncapi/cli/blob/v0.54.7/src/commands/config/index.ts)_

## `asyncapi config context`

Expand Down Expand Up @@ -282,7 +282,7 @@ DESCRIPTION
Convert asyncapi documents older to newer versions
```

_See code: [src/commands/convert.ts](https://github.com/asyncapi/cli/blob/v0.54.5/src/commands/convert.ts)_
_See code: [src/commands/convert.ts](https://github.com/asyncapi/cli/blob/v0.54.7/src/commands/convert.ts)_

## `asyncapi diff OLD NEW`

Expand Down Expand Up @@ -337,7 +337,7 @@ DESCRIPTION
Find diff between two asyncapi files
```

_See code: [src/commands/diff.ts](https://github.com/asyncapi/cli/blob/v0.54.5/src/commands/diff.ts)_
_See code: [src/commands/diff.ts](https://github.com/asyncapi/cli/blob/v0.54.7/src/commands/diff.ts)_

## `asyncapi generate`

Expand All @@ -351,7 +351,7 @@ DESCRIPTION
Generate typed models or other things like clients, applications or docs using AsyncAPI Generator templates.
```

_See code: [src/commands/generate/index.ts](https://github.com/asyncapi/cli/blob/v0.54.5/src/commands/generate/index.ts)_
_See code: [src/commands/generate/index.ts](https://github.com/asyncapi/cli/blob/v0.54.7/src/commands/generate/index.ts)_

## `asyncapi generate fromTemplate ASYNCAPI TEMPLATE`

Expand Down Expand Up @@ -513,7 +513,7 @@ EXAMPLES
$ asyncapi new --file-name=my-asyncapi.yml --example=default-example.yml --no-tty - create a new file with a specific name, using one of the examples and without interactive mode
```

_See code: [src/commands/new/index.ts](https://github.com/asyncapi/cli/blob/v0.54.5/src/commands/new/index.ts)_
_See code: [src/commands/new/index.ts](https://github.com/asyncapi/cli/blob/v0.54.7/src/commands/new/index.ts)_

## `asyncapi new file`

Expand Down Expand Up @@ -634,7 +634,7 @@ EXAMPLES
$ asyncapi optimize ./asyncapi.yaml --optimization=remove-components,reuse-components,move-to-components --output=terminal --no-tty
```

_See code: [src/commands/optimize.ts](https://github.com/asyncapi/cli/blob/v0.54.5/src/commands/optimize.ts)_
_See code: [src/commands/optimize.ts](https://github.com/asyncapi/cli/blob/v0.54.7/src/commands/optimize.ts)_

## `asyncapi start`

Expand All @@ -648,7 +648,7 @@ DESCRIPTION
Start asyncapi studio
```

_See code: [src/commands/start/index.ts](https://github.com/asyncapi/cli/blob/v0.54.5/src/commands/start/index.ts)_
_See code: [src/commands/start/index.ts](https://github.com/asyncapi/cli/blob/v0.54.7/src/commands/start/index.ts)_

## `asyncapi start studio`

Expand Down Expand Up @@ -692,5 +692,5 @@ DESCRIPTION
validate asyncapi file
```

_See code: [src/commands/validate.ts](https://github.com/asyncapi/cli/blob/v0.54.5/src/commands/validate.ts)_
_See code: [src/commands/validate.ts](https://github.com/asyncapi/cli/blob/v0.54.7/src/commands/validate.ts)_
<!-- commandsstop -->
3 changes: 2 additions & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import type { Config } from '@jest/types';

const config: Config.InitialOptions = {
coverageReporters: [
'text'
'text',
'html'
],
transform: {
'^.+\\.(t|j)sx?$': '@swc/jest',
Expand Down
31 changes: 19 additions & 12 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@asyncapi/cli",
"description": "All in one CLI for all AsyncAPI tools",
"version": "0.54.6",
"version": "0.54.8",
"author": "@asyncapi",
"bin": {
"asyncapi": "./bin/run"
Expand All @@ -12,7 +12,7 @@
"@asyncapi/bundler": "^0.3.8",
"@asyncapi/converter": "^1.3.1",
"@asyncapi/diff": "^0.4.1",
"@asyncapi/generator": "^1.10.14",
"@asyncapi/generator": "^1.11.0",
"@asyncapi/modelina": "^1.9.0",
"@asyncapi/openapi-schema-parser": "^3.0.3",
"@asyncapi/optimizer": "^0.2.1",
Expand Down Expand Up @@ -44,7 +44,7 @@
"ws": "^8.2.3"
},
"devDependencies": {
"@asyncapi/minimaltemplate": "./test/minimaltemplate",
"@asyncapi/minimaltemplate": "./test/fixtures/minimaltemplate",
"@babel/core": "^7.19.3",
"@jest/types": "^29.1.0",
"@oclif/test": "^2",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"description": "Custom version to be used"
},
"mode": {
"description": "developement or production"
"description": "development or production"
}
}
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions test/testHelper.ts → test/helpers/index.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { existsSync, writeFileSync, unlinkSync, rmSync, mkdirSync , promises as fs } from 'fs';
import * as path from 'path';
import { IContextFile, CONTEXT_FILE_PATH } from '../src/models/Context';
import SpecificationFile from '../src/models/SpecificationFile';
import { IContextFile, CONTEXT_FILE_PATH } from '../../src/models/Context';
import SpecificationFile from '../../src/models/SpecificationFile';
import http from 'http';

const ASYNCAPI_FILE_PATH = path.resolve(process.cwd(), 'specification.yaml');
const SERVER_DIRECTORY= path.join(__dirname, 'dummyspec');
const SERVER_DIRECTORY= path.join(__dirname, '../fixtures/dummyspec');
export const PROJECT_DIRECTORY_PATH = path.join(process.cwd(), 'test-project');

let server: http.Server;

export default class ContextTestingHelper {
private _context: IContextFile;
constructor() {
const homeSpecFile = new SpecificationFile(path.resolve(__dirname, 'specification.yml'));
const homeSpecFile = new SpecificationFile(path.resolve(__dirname, '../fixtures/specification.yml'));

const codeSpecFile = new SpecificationFile(path.resolve(__dirname, 'specification.yml'));
const codeSpecFile = new SpecificationFile(path.resolve(__dirname, '../fixtures/specification.yml'));
this._context = {
current: 'home',
store: {
Expand Down
Loading

0 comments on commit f2a3dbb

Please sign in to comment.