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

devdock

v0.3.0

Published

Prototype utility that provides Dev environments built on top of Docker App

Downloads

4

Readme

DevDock

Docs and an example are coming soon!

This project is a prototype that builds on top of Docker App (yet another experimental tool) to make it easy to spin up local dev environments. The use case lies in applications that are composed of many services (backend, multiple frontends, etc.) and developing in one service needs the other components running.

Long term, it's likely this will be moved from Node to something like Go to prevent the need of having a Node runtime. But, since I'm more familiar with Node, decided to start there to flush out the idea.

Installation

npm install -g devdock

Docker App Configuration

In order to work, the Docker App you wish to use must have additional service metadata to indicate the service can be disabled and the name to be used in the interactive menus.

  • x-enabled - used by Docker App to actually disable and remove the service when being rendered
  • x-devdock-description - a human friendly name to be used in the interactive menus
  • x-devdock-setting-name - the name of the setting that must be false in order to disable the service

Example Docker App Compose File (truncated)

version: "3.7"
services:
  api:
    image: sample-api-image
    x-enabled: ${enable-api}
    x-devdock-description: API/Backend
    x-devdock-setting-name: enable-api
    ...
  frontend:
    image: sample-frontend-image
    x-enabled: ${enable-frontend}
    x-devdock-description: Browser Frontend
    x-devdock-setting-name: enable-frontend
    ...

Usage

To use the terminal menu to disable/enable services, simply run (notice no additional arguments):

devdock [PROJECT-NAME] [APP-IMAGE]
devdock voting-app mikesir87/votingapp.dockerapp:0.1.0

In addition, all Docker Compose commands are specified when added to the end. For example:

devdock [PROJECT-NAME] [APP-IMAGE] ps
devdock voting-app mikesir87/votingapp.dockerapp:0.1.0 ps

Image Variable Support

On our team, we make use of feature branches. Each feature branch has its own deployed Docker App. If the image contains {BRANCH}, the value will be replaced with the name of the current checked out branch. If no branch is detected, it falls back to master.

Example

# Imagine in a git repo on branch 3-test-something
devdock sample mikesir87/votingapp.dockerapp:{BRANCH} config
# This will end up pulling mikesir87/votingapp.dockerapp:3-test-something

Using Aliases

To make things simple, you can make aliases to wrap the command and provide a simple project-specific "cli tool". For example, if I were working on the Docker Voting App, I could simply add this to my ~/.bash_profile:

alias voting-app="devdock voting-app mikesir87/votingapp.dockerapp:0.1.0 $@"

Then, I can use any docker-compose command, but scoped to the project! So much easier for new developers on the team!

voting-app up -d
voting-app ps
voting-app down

Example

The mikesir87/devdock-demo repo contains a wrapped version of the Docker Voting App Example. The compose file has the additional metadata and can be used to test things out. So... give it a try!

Roadmap

There are a few things I'd like to see, as we already have use cases for them. Here are a few items...

  • When Docker App PR #418 is merged, we can drop the need for x-devdock-setting-name
  • Clean up code so it's not in one mega-file (still just a prototype right now)

License

This project is licensed using the MIT license. See LICENSE