remove Yeoman and switched to Oclif for the CLI#640
remove Yeoman and switched to Oclif for the CLI#640OsamaRab3 wants to merge 33 commits intohyperledger-labs:mainfrom
Conversation
|
To run and test it locally, please follow these steps |
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
| "bin": "ffablo", | ||
| "commands": "./generators/commands", | ||
| "dirname": "ffablo", |
There was a problem hiding this comment.
| "bin": "ffablo", | |
| "commands": "./generators/commands", | |
| "dirname": "ffablo", | |
| "bin": "fablo", | |
| "commands": "./generators/commands", | |
| "dirname": "fablo", |
There was a problem hiding this comment.
I believe we no longer need this file since we have migrated away from Yeoman. It does not seem to be used anywhere, so we can safely remove it.
| "postpack": "shx rm -f oclif.manifest.json", | ||
| "posttest": "npm run lint", | ||
| "prepack": "oclif manifest && oclif readme", |
There was a problem hiding this comment.
Do we need these scripts?
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
| } | ||
|
|
||
| executeOnFabloDocker() { | ||
| # set -x |
There was a problem hiding this comment.
yes, we can remove that line
| if [ -f /etc/passwd ]; then | ||
| fablo_workspace_params+=( | ||
| -v /etc/passwd:/etc/passwd:ro | ||
| ) | ||
| fi | ||
|
|
||
| if [ -f /etc/group ]; then | ||
| fablo_workspace_params+=( | ||
| -v /etc/group:/etc/group:ro | ||
| ) | ||
| fi | ||
|
|
There was a problem hiding this comment.
what does it do? do we need it?
|
|
||
| if [ -f "$FABLO_TARGET/fabric-docker.sh" ]; then | ||
| echo "Executing Fablo Docker command: $1" | ||
| chmod +x "$FABLO_TARGET/fabric-docker.sh" || true |
There was a problem hiding this comment.
that should not be required. We should grant x permission when the file is created
| "noEmit": true, | ||
| // "noEmit": true, | ||
| "rootDir": "./", | ||
| "outDir": "./generators", |
There was a problem hiding this comment.
ultimately we should change it to dist an update references
| networkUp() { | ||
| "$FABLO_HOME/fablo-build.sh" | ||
| (cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" init node dev) | ||
| (cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" init --node && cat "$TEST_TMP/fablo-config.json") |
There was a problem hiding this comment.
the test looks different because we were checking node/dev mode. Here we have no dev/ccaas mode
| RUN npm install --global --silent yo | ||
|
|
||
| # copy fablo files | ||
| COPY generators /fablo/generators |
| # Add a yeoman user because Yeoman freaks out and runs setuid(501). | ||
| # This was because less technical people would run Yeoman as root and cause problems. | ||
| # Setting uid to 501 here since it's already a random number being thrown around. | ||
| # @see https://github.com/yeoman/yeoman.github.io/issues/282 | ||
| # @see https://github.com/cthulhu666/docker-yeoman/blob/master/Dockerfile | ||
| # @see https://github.com/phase2/docker-yeoman/blob/master/Dockerfile | ||
| RUN adduser -D -u 501 yeoman && \ | ||
| echo "yeoman ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers |
There was a problem hiding this comment.
we don't need that weird user setup anymore
| if [ "$(id -u)" = 0 ]; then | ||
| # root user detected, running as yeoman user | ||
| sudo chown -R yeoman:yeoman "$yeoman_target_dir" | ||
| # root user detected, running as yeoman user (keeping for compatibility) | ||
| sudo chown -R yeoman:yeoman "$target_dir" | ||
| # shellcheck disable=SC2086 | ||
| (cd "$yeoman_target_dir" && sudo -E -u yeoman yo --no-insight $command_with_params) | ||
| sudo chown -R root:root "$yeoman_target_dir" | ||
| (cd "$target_dir" && sudo -E -u yeoman node --no-warnings /fablo/bin/run.mjs $command_with_params) | ||
| sudo chown -R root:root "$target_dir" | ||
| else | ||
| # shellcheck disable=SC2086 | ||
| (cd "$yeoman_target_dir" && yo --no-insight $command_with_params) | ||
| (cd "$target_dir" && node --no-warnings /fablo/bin/run.mjs $command_with_params) | ||
| fi |
There was a problem hiding this comment.
we probably don't need it anymore
Description
This PR introduces the initial setup for removing and fully migrating the CLI to Oclif.
The goal is to simplify the CLI implementation, remove the generator dependency, and make future features easier to maintain and extend.
Current Progress
Implemented so far
Basic usage examples
Run the network:
Important Note
ffabloto avoid conflicts with the existingfablocommand during development.Once the migration is complete and fully tested, the name will be switched back to
fabloOnce the new Oclif implementation is fully completed and fully tested, I will remove all legacy code.