Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): support config persistence and local chart directory for fst charts #535

Merged
merged 14 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`

Check warning on line 7 in fullstack-network-manager/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

fullstack-network-manager/README.md#L7

[list-item-indent] Incorrect list-item indent: add 2 spaces

```
❯ 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`

Check warning on line 14 in fullstack-network-manager/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

fullstack-network-manager/README.md#L14

[list-item-indent] Incorrect list-item indent: add 2 spaces

* Run `fsnetman` from a terminal as shown below

Check warning on line 16 in fullstack-network-manager/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

fullstack-network-manager/README.md#L16

[list-item-indent] Incorrect list-item indent: add 2 spaces

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

## 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>`

Check warning on line 43 in fullstack-network-manager/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

fullstack-network-manager/README.md#L43

[list-item-indent] Incorrect list-item indent: add 2 spaces
* Run `npm test` or `npm run test` to run the unit tests

Check warning on line 44 in fullstack-network-manager/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

fullstack-network-manager/README.md#L44

[list-item-indent] Incorrect list-item indent: add 2 spaces
* Run `npm run test-e2e` to run the long-running integration tests

Check warning on line 45 in fullstack-network-manager/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

fullstack-network-manager/README.md#L45

[list-item-indent] Incorrect list-item indent: add 2 spaces
* Run `fsnetman` to access the CLI as shown above.

Check warning on line 46 in fullstack-network-manager/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

fullstack-network-manager/README.md#L46

[list-item-indent] Incorrect list-item indent: add 2 spaces
* Note that debug logs are stored at `~/.fsnetman/logs/fst.log`. So you may use `tail -f ~/.fsnetman/logs/fst.log | jq

Check warning on line 47 in fullstack-network-manager/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

fullstack-network-manager/README.md#L47

[list-item-indent] Incorrect list-item indent: add 2 spaces
` in a separate terminal to keep an eye on the logs.
* Before making a commit run `npm run format`

Check warning on line 49 in fullstack-network-manager/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

fullstack-network-manager/README.md#L49

[list-item-indent] Incorrect list-item indent: add 2 spaces
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