Skip to content

Commit

Permalink
feat: lightdash cli tool (lightdash#1970)
Browse files Browse the repository at this point in the history
* src

* version and dbt

* version and dbt

* update readme

* update readme

* better version

* better version

* empty commit

* empty commit

* comment: remove

* add cli to lint-staged

* add to lint-staged

* update lint

* update release.config

* cli lint
  • Loading branch information
rephus authored May 4, 2022
1 parent 0bf5edd commit 014c476
Show file tree
Hide file tree
Showing 14 changed files with 2,096 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# logs
/packages/backend/logs
/packages/backend/src/database/logs
/packages/cli/logs

# development
lightdash_dev.yml
Expand All @@ -22,6 +23,7 @@ lightdash_dev.yml
/packages/frontend/build
/packages/common/dist
/packages/backend/dist
/packages/cli/dist

# misc
.DS_Store
Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@
"e2e-run": "yarn workspace e2e cypress:run",
"e2e-lint": "yarn workspace e2e lint",
"e2e-format": "yarn workspace e2e format",
"lint": "run-s common-lint backend-lint frontend-lint e2e-lint",
"format": "run-s common-format backend-format frontend-format e2e-format",
"cli-lint": "yarn workspace @lightdash/cli lint",
"cli-format": "yarn workspace @lightdash/cli format",
"lint": "run-s common-lint backend-lint frontend-lint e2e-lint cli-lint",
"format": "run-s common-format backend-format frontend-format e2e-format cli-format",
"test": "run-s backend-test",
"dev": "npm-run-all common-build --parallel backend-dev frontend-dev",
"build": "run-s common-build frontend-build backend-build",
Expand All @@ -58,6 +60,10 @@
"packages/e2e/cypress/**/*.(ts|json)": [
"yarn workspace e2e prettier --write --ignore-unknown",
"yarn workspace e2e eslint --fix"
],
"packages/cli/src/**/*.(ts|tsx|json)": [
"yarn workspace @lightdash/cli prettier --write --ignore-unknown",
"yarn workspace @lightdash/cli eslint --fix"
]
}
}
16 changes: 16 additions & 0 deletions packages/cli/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": [
"eslint:recommended",
"airbnb-base",
"airbnb-typescript/base",
"prettier",
"plugin:json/recommended"
],
"plugins": ["@typescript-eslint"],
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"no-console": "off"
}
}
3 changes: 3 additions & 0 deletions packages/cli/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
coverage
5 changes: 5 additions & 0 deletions packages/cli/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "all",
"tabWidth": 4
}
24 changes: 24 additions & 0 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Lightdash CLI

Lightash CLI tool

## How to install

`npm i -g @lightdash/cli`

## Usage

```
Usage: lightdash [options] [command]
Options:
-h, --help display help for command
Commands:
version output the version number
[dbt_command] runs dbt
help [command] display help for command
```

eg: `ligthdash test` Runs `dbt test`

6 changes: 6 additions & 0 deletions packages/cli/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
automock: false,
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
};
Loading

0 comments on commit 014c476

Please sign in to comment.