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

sdev.sh

v0.3.0

Published

Simple Development Scripting with docker-compose

Downloads

5

Readme

sdev.sh npm version codecov CircleCI

Simple declarative syntax for your projects tasks.

sdev.sh attempts to standardize and improve documentation on how projects are built and run when using docker-compose. It's a simple starting for someone new to a project.

Installation

npm install -g sdev.sh

Links

Usage

sdev.sh uses a declarative yaml file (.sdev.yml) in the root of your repository to understand what tasks are available inside your project.

Some common actions that probably show up on every project when using docker-compose are:

  • server (start the web development server)
  • build (building your application or library)
  • test (running your test suite)
  • bash (ssh in the docker container used as your runtime)

Those tasks are expressed with the following definition:

version: 1
name: My Cool App
description: This text should briefly mention what the application/library is about
docker:
  compose_file: docker/docker-compose.yml
tasks:
  - name: server
    description: Start the development server
    command: yarn start
    container: app
    ports:
      "8080:8080"

  - name: build
    description: This command will build the entire application and install dependencies
    command: yarn build
    container: app
    rm: true

  - name: test
    description: run unit test suite.
    command: yarn test
    container: app
    environment:
      - "NODE_ENV=test"

  - name: bash
    description: ssh in docker container
    command: /bin/bash
    container: app
    volumes:
      - "/npm/modules:/var/www/app/node_modules"

We can customize the tasks dependencies in terms of ports, volumes and environment variables.

The previous definition will generate the following output when calling sdev without any arguments:

➜  sdev.sh git:(improve-readme) ✗ sdev

  Usage: sdev [options] [command]

  This text should briefly mention what the application/library is about


  Options:

    -V, --version  output the version number
    -h, --help     output usage information


  Commands:

    build       This command will build the entire application and install dependencies
    test        run unit test suite.
    bash        ssh in docker container
    help [cmd]  display help for [cmd]

Documentation

The definition file should be straight forward and mimic docker-compose as much as possible. Generally, tasks should be simple commands that you run in the container with some ports, environment and volumes variations.

Note: docker-compose inovations will use the -p flag to scope containers to your project. This is very useful when you use a common docker folder for all your projects.

version (number)

The sdev file version. Always 1

name (string)

The name of your application/library. Not used at the moment but probably in the future.

description (string)

A brief description of your application/library. This is used when showing the help command.

docker (object)

compose_file (string)

Relative path to .sdev.yaml for docker-compose file.

tasks (object)

name (string)

The name of the task. This name will be used for invoking the command

description (string)

A brief description of what the task does.

command (string)

The run command and args to use

container (string)

The target container of the command

volumes (Array)

Array of volumes to attach when running

environment (Array)

Array of environment variables to use when running

ports (Array)

Array of ports to bind when running

rm (boolean)

Delete container after tasks ends

Contact