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

@dragon-syndicate/dotenv-mono

v1.2.1

Published

Simplify and consolidate the .env files used by a mono repo

Downloads

32

Readme

dotenv-mono

Semantic Release

Initial Setup

  1. Install Node.js.
  2. Install pnpm.
  3. Run the command pnpm install.

Architecture

Environment variables are loaded from multiple folders, starting with the current working directory (cwd) and moving up the directory tree until the max depth is reached. The root directory is considered to be the directory at the top of the directory tree, based on the max depth. The environment variables will be loaded starting with the .env files in the root directory and then moving down the directory tree until the cwd is reached.

Variables are processed from the .env file into Environment variables based on when they are loaded. Variable interpolation is supported for all variables loaded from the .env files. If a variable has not already been loaded into the Environment variables and is referenced using interpolation, it will result in an empty string.

A variable defined in multiple .env files will be overwritten by the last .env file that is loaded. This means that the .env file in the cwd will overwrite any variables that are defined in the .env files in the parent directories.

ENV and an extension can be added to the .env files to load additional variables based on the extension. The .env files are loaded in the following order in each directory:

  1. .env
  2. .env.local
  3. .env.<ENV>
  4. .env.<ENV>.local
  5. .env.<extension>
  6. .env.<extension>.local
  7. .env.<extension>.<ENV>
  8. .env.<extension>.<ENV>.local

Release Process

  • The package will build all its files to the root dist folder to be published to npmjs
    • Semantic versioning and Changelog is implement via GitHub Actions
    • Deployment is implemented via GitHub Actions
    • Published Package only contains: - minified code - README.md - LICENSE.md - package.json (with private packages removed) - changelog

Development

  • Run command (Serves the application local on the developers machine):
    pnpm run dev
  • Test command (Executes the unit tests against the developers local copy of the repository):
    pnpm run test
  • Build command (Builds the application for deployment):
    pnpm run build
  • Clean command (Removes all build artifacts build dependencies):
    pnpm run clean

Additional Information

To locally test the release process you will need to run the command in the root directory cd dist && npx semantic-release --dry-run.

NOTE: This command will only work if you have already logged in to npmjs via the command npm login.