New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@genesislcap/foundation-cli

Package Overview
Dependencies
Maintainers
0
Versions
1144
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@genesislcap/foundation-cli

Genesis Foundation CLI

  • 14.245.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.5K
increased by73.15%
Maintainers
0
Weekly downloads
 
Created
Source

Genesis Foundation UI CLI

This repo contains our foundation-cli tool for rapid code scaffolding that adheres to best practices.

lerna TypeScript

App Taks

Seeds can optionally define tasks in .genx/tasks.json.

A task contains one or more steps, which can execute various commands.

{
  "tasks": {
    "hello": {
      "name": "hello",
      "description": "Sample task",
      "steps": [
        {
          "say": "hello"
        }
      ]
    }
  }
}

Run foundation-cli app to see available tasks:

$ foundation-cli app

  $ foundation-cli app <task>

Apps: Apps are seed instances. Tasks are commands provided by a seed.

  $ foundation-cli app List all tasks
  $ foundation-cli app hello Sample task

Run foundation-cli app hello:

$ foundation-cli app hello
hello | hello

Executing commands

You can execute commands in a step as follows:

  • "exec": "gradle assemble" runs a program or a script
  • "spawn": "taskname" runs another task (see below)
  • "builtin": "hello" runs a builtin task provided by CLI. Available tasks are in tasks folder.
  • "say": "text" prints output

When using exec check that your command works on different platforms (Windows, Linux, OS X).

Directories

You can provide cwd option to set the working directory for a task or for an invidual task step.

{
  "tasks": {
    "build": {
      "name": "build",
      "description": "Build project",
      "cwd": ".genx/generated",
      "steps": [
        {
          "exec": "gradle assemble"
        },
        {
          "exec": "npm run build"
        },
        {
          "say": "all done"
        }
      ]
    }
  }
}

Environment variables

You can set environment variables for a task or for an individual step.

You can add requiredEnv array to a task to specify environment variables which must be set for it to run.

Note: in this example we could have simply done "exec": "git branch --show-current" instead - it just illustrates environment variable use.

{
  "tasks": {
    "env": {
      "name": "env",
      "description": "Print current branch",
      "env": {
        "BRANCH": "$(git branch --show-current)"
      },
      "steps": [
        {
          "exec": "node -e \"console.log(process.env.BRANCH)\""
        }
      ]
    }
  }
}
$ foundation-cli app env
env | node -e "console.log(process.env.BRANCH)"
master

Conditions

You can define a condition to determine whether a task should be executed. If it returns a zero exit code, steps will be executed, otherwise skipped.

{
  "tasks": {
    "diff": {
      "name": "diff",
      "description": "Detect changes",
      "steps": [
        {
          "exec": "echo 'working tree contains changes'"
        }
      ],
      "condition": "git diff --exit-code"
    }
  }
}

Note: we could have done git diff --exit-code > /dev/null to turn off Git output on Linux/OS X, but that's not supported on Windows.

Assuming we have some changes in the working directory, which haven't beedn added to Git yet:

$ foundation-cli app diff
diff | condition: git diff --exit-code
# ... git diff output
diff | condition exited with non-zero - skipping

After running Git add command:

$ foundation-cli app diff
diff | condition: git diff --exit-code
diff | echo 'working tree contains changes'
working tree contains changes

Dependent tasks

You can define dependent tasks:

{
  "tasks": {
    "first": {
      "name": "first",
      "description": "First task",
      "steps": [
        {
          "say": "first"
        }
      ]
    },
    "second": {
      "name": "second",
      "description": "Second task",
      "steps": [
        {
          "spawn": "first"
        },
        {
          "say": "second"
        }
      ]
    }
  }
}
$ foundation-cli app second
second » first | first
second | second

Installation

To enable this module in your application, follow the steps below.

  1. Add @genesislcap/foundation-cli as a dependency in your package.json file. Whenever you change the dependencies of your project, ensure you run the $ npm run bootstrap command again. You can find more information in the package.json basics page.
{
  ...
  "dependencies": {
    ...
    "@genesislcap/foundation-cli": "latest"
    ...
  },
  ...
}

API Docs

License

Note: this project provides front-end dependencies and uses licensed components listed in the next section; thus, licenses for those components are required during development. Contact Genesis Global for more details.

Licensed components

Genesis low-code platform

FAQs

Package last updated on 21 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc