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

bouddha-monorepo

v1.0.8

Published

Bouddha Monorepo is an npm module for managing monorepos with frontend and backend projects.

Downloads

1

Readme

bouddha-monorepo is a Node.js utility for managing shared libraries across frontend and backend projects in a monorepo setup. It automates the process of copying and processing library files, ensuring that only the necessary parts are included in each type of project (frontend or backend). This monotrepo tool is designed to simplify the management of shared codebases and reduce the risk of backend-specific code leaking into frontend projects by copying libs ( directory should be ignored and then then in the CI bouddha-monorepo should be called ) in each package of the monorepo. This is made for project using React, NestJs and Typeorm.

Features

  • Automatic Library Management: Copies shared libraries to designated project folders based on project type.
  • Decorator and Import Cleaning: Removes backend-specific decorators and imports from frontend projects.
  • Configuration Validation: Ensures the configuration file is properly set up.
  • File Watching: Optionally watches the libs directory for changes and automatically reprocesses projects.

Installation

Install the module using npm:

npm install bouddha-monorepo --save-dev

Configuration

Create a .bouddha-monorepo file in the root of your project to configure the module. This file should be a JSON file with the following structure:

{
  "libsPath": "./libs",
  "packagesPath": "./apps",
  "packages": [
    {
      "name": "project-name",
      "libsPath": "src/libs",
      "type": "backend"
    }
  ],
  "libs": [
    {
      "name": "library-name",
      "type": "backend"
    }
  ]
}

Configuration Details

  • libsPath: The path to the shared libraries directory.
  • packagesPath: The path to the directory containing the individual projects.
  • packages: An array of objects, each describing a project.
    • name: The name of the project directory.
    • libsPath: The path within the project where the libraries should be copied.
    • type: The type of project (frontend or backend).
  • libs: An array of objects, each describing a library.
    • name: The name of the library directory.
    • type: The type of the library (frontend, backend, or agnostic).

Example Configuration

{
  "libsPath": "./libs",
  "packagesPath": "./apps",
  "packages": [
    { "name": "core-service", "libsPath": "src/libs", "type": "backend" },
    { "name": "react-web-front", "libsPath": "src/app/libs", "type": "frontend" }
  ],
  "libs": [
    { "name": "api", "type": "frontend" },
    { "name": "helpers", "type": "agnostic" },
    { "name": "helpers-backend", "type": "backend" },
    { "name": "helpers-frontend", "type": "frontend" }
  ]
}

Usage

After configuring the .bouddha-monorepo file, you can run the module using:

npx bouddha-monorepo

This command will read the configuration, copy the libraries, and process the files according to the project type.

Watching for Changes

By default, the tool watches the libs directory for changes and reprocesses the projects automatically. To disable watching, use the exec argument:

npx bouddha-monorepo exec

Important Considerations

  • Git Ignore Check: The tool checks if the libsPath specified in each package is present in .gitignore. This ensures that copied files do not accidentally get committed.
  • Configuration Validation: The tool validates the .bouddha-monorepo configuration file for required fields and correct structure. If any issues are found, the tool will exit with an error message.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

License

This project is licensed under the MIT License. See the LICENSE file for more details.


### Notes:
1. **Installation**: Instructs users on how to install the module.
2. **Configuration**: Details the configuration file structure and provides an example.
3. **Usage**: Explains how to run the module, including options for watching or running once.
4. **Considerations**: Highlights important checks like the `.gitignore` check.
5. **Contributing and License**: Standard sections for open-source projects.

Feel free to adjust any section to better fit your project's specifics or policies.