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

glitcheroo

v1.2.1

Published

A CLI tool to deploy an app to an existing Glitch project

Downloads

19

Readme

A CLI tool to deploy an app to an existing Glitch project. The contents of the existing Glitch project are completely replaced. Use carefully!

Basic usage

A target Glitch project must be setup to receive deployments before you can deploy an app with glitcheroo.

Deployment is initiated from the source project. The source may be another Glitch project or a project committed to a Git repository on your local device.

Node.js is required, version 8.2.0 or higher.

Step 1: Setup the target

Open a terminal in the root of the Glitch project that you want to deploy to. Run the following command to setup the target project:

npx glitcheroo setup-target

WARNING: This command allows the Glitch project to be completely overwritten via remote Git operations.

Step 2: Deploy the app

Open a terminal in the root of the project that you want to deploy. Run the following command to deploy the app:

npx glitcheroo deploy

The first time you run this command in a project it will prompt you to provide the Git URL of the target project. Find it in the "Tools > Import and Export" panel of the Glitch project editor.

And that's it! There is no step 3. Glitch will automatically detect the project change, reinstall the dependencies, and start the deployed app.

Installation

Installation is not required. Node.js already includes the npx tool, and the npx tool automatically downloads and runs the latest version of glitcheroo every time you use it to run the commands.

If you don't want npx to re-download glitcheroo every time you run the commands you can install the glitcheroo package as a devDependency of the project you are deploying:

npm install -D glitcheroo

You should continue to use npx to run glitcheroo after installing the package. The npx tool will find the version of glitcheroo installed in your project and use it instead of downloading the latest version.

Advanced usage

Remix

As a convenience, this tool lets you remix a Glitch project to your local device. The remixed project is configured to target the original Glitch project for deployment.

Remix a target Glitch project by running the following command:

npx glitcheroo remix

Provide the Git URL of the target project when prompted.

Status

The configuration status for a project may be retrieved by running the following command:

npx glitcheroo status

This prints whether the project has been configured as a source, a target, or both.

Reset

The configuration for a project may be reset by running the following command:

npx glitcheroo reset

This removes the Git configuration values added by the setup-target, deploy, and remix commands.

Evironment variables

The glitcheroo deploy command will read the Git URL of the target project from the GLITCHEROO_GIT_URL environment variable if it is set.

Implementation details

The glitcheroo tool works by configuring and using Git.

The setup-target command:

  • sets the receive.denyCurrentBranch config value to ignore so that the master branch can be pushed to
  • sets the receive.shallowUpdate config value to true so that shallow checkouts can be pushed
  • installs a post-receive hook that runs after deploy and refreshes the workspace and Glitch editor with the new changes

The deploy command:

  • adds a remote tracked repository named glitcheroo that points at the target
  • pushes +HEAD:master to the glitcheroo remote

The remix command:

  • clones the target Git repository
  • renames the default remote in the new repository from origin to glitcheroo

Acknowledgements

This project was inspired by Melissa McEwen's fascinating article Automating My Deploys From GitHub to Glitch, published on DEV on April 21, 2020.

Huge thanks to Glitch for providing a great service. This project is not affiliated with Glitch in any way.