npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@genesislcap/foundation-cli

v14.214.4

Published

Genesis Foundation CLI

Downloads

4,868

Readme

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