Skip to content

Commit

Permalink
feat(cli): support config persistence and local chart directory for f…
Browse files Browse the repository at this point in the history
…st charts (#535)

Signed-off-by: Lenin Mehedy <[email protected]>
Signed-off-by: Deepak Mishra <[email protected]>
Co-authored-by: Deepak Mishra <[email protected]>
  • Loading branch information
leninmehedy and deepak-swirlds authored Nov 15, 2023
1 parent 4c7c7be commit 73f7c1b
Show file tree
Hide file tree
Showing 43 changed files with 11,123 additions and 4,279 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
root: true
13 changes: 13 additions & 0 deletions fullstack-network-manager/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
env:
browser: true
es2021: true
extends: standard
parserOptions:
ecmaVersion: latest
sourceType: module
rules: {}
overrides:
- files: ["*.mjs"]
parserOptions:
ecmaVersion: latest
sourceType: module
37 changes: 21 additions & 16 deletions fullstack-network-manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
fullstack-network-manager is a CLI tool to manage and deploy a Hedera Network using Helm chart for local testing.

## Install
- Create or update `~/.npmrc` file and specify the Github package registry: `@hashgraph:registry=https://npm.pkg.github.com`

* Create or update `~/.npmrc` file and specify the GitHub package registry: `@hashgraph:registry=https://npm.pkg.github.com`

```
❯ cat ~/.npmrc
@hashgraph:registry=https://npm.pkg.github.com
```
- Run `npm install -g @hedera/fullstack-network-manager`

- Run `fsnetman` from a terminal as shown below
```
* Run `npm install -g @hedera/fullstack-network-manager`

* Run `fsnetman` from a terminal as shown below

```
❯ fsnetman
Usage:
fsnetman <command> [options]
Expand All @@ -29,16 +33,17 @@ Select a command
```

## Develop
- In order to support ES6 modules with `jest`, set an env variable `export NODE_OPTIONS=--experimental-vm-modules >> ~/.zshrc`
- If you are using Intellij and would like to use debugger tools, you will need to enable `--experimental-vm-modules` for `Jest`.
- `Run->Edit Configurations->Edit Configuration Templates->Jest` and then set `--experimental-vm-modules` in `Node Options`.
- Run `npm i` to install the required packages
- Run `npm link` to install `fsnetman` as the CLI
- Note: you need to do it once. If `fsnetman` already exists in your path, you will need to remove it first.
- Alternative way would be to run `npm run fsnetman -- <COMMAND> <ARGS>`
- Run `npm test` or `npm run test` to run the unit tests
- Run `npm run test-e2e` to run the long-running integration tests
- Run `fsnetman` to access the CLI as shown above.
- Note that debug logs are stored at `~/.fsnetman/logs/fst.log`. So you may use `tail -f ~/.fsnetman/logs/fst.log | jq
` in a separate terminal to keep an eye on the logs.

* In order to support ES6 modules with `jest`, set an env variable `export NODE_OPTIONS=--experimental-vm-modules >> ~/.zshrc`
* If you are using Intellij and would like to use debugger tools, you will need to enable `--experimental-vm-modules` for `Jest`.
* `Run->Edit Configurations->Edit Configuration Templates->Jest` and then set `--experimental-vm-modules` in `Node Options`.
* Run `npm i` to install the required packages
* Run `npm link` to install `fsnetman` as the CLI
* Note: you need to do it once. If `fsnetman` already exists in your path, you will need to remove it first.
* Alternative way would be to run `npm run fsnetman -- <COMMAND> <ARGS>`
* Run `npm test` or `npm run test` to run the unit tests
* Run `npm run test-e2e` to run the long-running integration tests
* Run `fsnetman` to access the CLI as shown above.
* Note that debug logs are stored at `~/.fsnetman/logs/fst.log`. So you may use `tail -f ~/.fsnetman/logs/fst.log | jq
` in a separate terminal to keep an eye on the logs.
* Before making a commit run `npm run format`
6 changes: 3 additions & 3 deletions fullstack-network-manager/fsnetman.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import * as fnm from './src/index.mjs'

// Check the value of the DEV_MODE environment variable, ignoring case
const devMode = process.env.DEV_MODE ? process.env.DEV_MODE.toLowerCase() === 'true' : false;
const devMode = process.env.DEV_MODE ? process.env.DEV_MODE.toLowerCase() === 'true' : false

// Disable stack traces if DEV_MODE is false
if (!devMode) {
Error.stackTraceLimit = 0;
Error.stackTraceLimit = 0
}

const cli = fnm.main(process.argv)
fnm.main(process.argv)
8 changes: 4 additions & 4 deletions fullstack-network-manager/jest.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const config = {
verbose: true,
transform: {},
};
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(mjs?)$',
moduleFileExtensions: ['js', 'mjs'],
verbose: true
}

export default config

Loading

0 comments on commit 73f7c1b

Please sign in to comment.