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

@tailor-platform/dev-cli

v0.3.0

Published

Tailor Platform CLI for frontend devs

Downloads

7,325

Readme

@tailor-platform/dev-cli

With Tailor Platform dev CLI, you can:

  • install required dependencies for building your own Tailor Platform apps
  • start local devlopment stack, apply your manifest on it

Table of Contents

Installation

npm install -D @tailor-platform/dev-cli@preview

Once after your installation, tailordev command will be available.

$ npx tailordev --help
Usage: tailordev [options] [command]

CLI for Tailor Platform application devs

Options:
  -V, --version                output the version number
  -h, --help                   display help for command

Commands:
  reset [options]              reset local environment
  start [options]              start local development environment
  apply [options]              apply manifest onto local environment
  import [options] <paths...>  import seed manifest (this needs minitailor running by `start` command)
  install:deps [options]       install required dependencies (tailorctl, cuelang)
  uninstall:deps               uninstall dependencies
  help [command]               display help for command

Usage

tailordev CLI expects the following directory structure for example:

yourapp
├── pacakge.json
├── .tailordevenv.json
└── manifest
    └── config
        └── template
            ├── gateway.cue
            ├── pipelines.cue
            ├── stateflow.cue
            └── tailordb.cue

1. Configuration

In this case you will need to have .tailordevenv.json with the following content:

{
  // The project name
  "name": "stock-api",

  // The directory path where contains the files specified by the following `target` array
  "manifest": "manifest/config/template",

  // File names to run cuelang on and apply
  "target": ["gateway.cue", "pipelines.cue", "tailordb.cue", "stateflow.cue"]
}

This is the initial point to start out.

2. Install dependencies

Run npx tailordev install:deps will install required binaries on your local. Those will be placed under ~/.local/share/tailordev.

It is recommended to run this command as postinstall in your package.json. You can remove those downloaded files by npx tailordev uninstall:deps.

3. Spin up local environment

Run npx tailordev start to start your local development envrionment. This needs docker-compose currently under the hood, so make sure it is installed and up on your machine.

start command generates .tailordev directory which has files generated by tailordev CLI. Those files will be generated every time in starting so can be ignored from your VCS.

You can also use --only-file option to generate compose.yml in .tailordev directory. This options is useful if you would like to run docker-compose manually.

4. Apply your manifest

Run npx tailordev apply to apply your application manifest onto your local dev environment next.

This also runs Cuelang evaluation (same as cue eval), and the evaluated files will be generated in .tailordev/generated with the same directory structure as the one you specified in manifest field in .tailordevrc.json.

apply command supports --env <value> option to switch your manifest in evaluation. This internally works as attributes in Cuelang, so you will be able to switch values in manifest files with @if(<value>).

If you would just like to evaluate and generate manifest under .tailordev/generated, you can use --only-eval option that skips applying manifests onto local development environment.

Use as npm scripts

As tailordev CLI is built with Node.js, it will be good fit to have it in your package.json scripts as well as other tools like Next.js.

{
  "name": "yourapp",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint",
    "start:backend": "tailordev start",
    "apply": "tailordev apply",
    "reset": "tailordev reset",
    "postinstall": "tailordev install:deps"
  }
}