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

@pie-api/mru

v1.4.0

Published

mono repo utils - has strong opinions!

Downloads

17

Readme

mru

mono repo utils - has strong opinions!

You have a cloud funtion here: functions/my-fn, then mru my-fn will:

  1. bundles functions/my-fn/lib/index.ts
  2. creates zip file
  3. pushes zip to gcloud storage
  4. gcloud deploys w/ env vars + flags

mru my-container will:

  1. bundle containers/my-container/lib/index.ts
  2. docker builds w/ tag
  3. docker push tag
  4. gcloud deploys w/ env vars

mru.config.js

mru will read mru.config.js from the cwd. It can overrides the following properties. mru will also read in command line flags, these will take highest priority.

From the above we build a Config that has the following form:

export type Config = {

  envDir: string; // required 
  projectId: string; // required 
  region: string; // required 
  bucketPath: (projectId: string, region: string) => string;  // required
  dockerRegistry: string; // 'grc.io'
  containers: string; //'containers'
  functions: string; //'functions'
  dryRun: boolean; // false
  /**
   * All true by default set --no-bundle to disable bundle. 
   * same for the others
   */
  steps: {
    bundle: boolean;
    docker: boolean;
    deploy: boolean;
  };
  /** 
   * This is generated by mru - don't need to set it
   */
  git?: {
    hash: string;
  };
}

cloud config

mru will generate the deployment arguments for a container/function using 2 sources:

  1. the loaded env file loaded from $envDir/$projectId.yaml.
  2. the cloud map in the package's package.json

Example

{
  "name": "my-fn",
  "cloud": {
    "deployFlags": {
      "foo":  "$ENV_VAR"
    },
    "environment":{
      "ENV_VAR": "$ENV_VAR"
    }
  }
}

env:

ENV_VAR: bar

in the above:

  1. deployFlags.foo will be converted to --foo bar and passed to the appropriate gcloud command.
  2. the env vars will be set to --set-env-vars ENV_VAR=bar

By doing this, we can put all our env vars in 1 place, and each pkg will only pull what it needs.