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

@vta/plugin-monorepo

v1.0.6

Published

plugin for menorepo that powered by lerna or yarn workspace

Downloads

22

Readme

@vta/plugin-monorepo

a vta plugin for menorepo that powered by lerna or yarn workspace

npm Build Status

Main Features

  • copy files to each package before building. detail
  • build source code for each package. detail
  • publish packages to npm. detail
  • delete all copied files after processed done. detail

Install

yarn add @vta/plugin-monorepo --dev

Usage

{
  "plugins": [["@vta/monorepo"]]
}

Options

export declare interface Options {
  packages?: string;
  filesToCopy?: FileToCopy[];
  publish?: boolean;
  version?: string;
  changelog?: boolean;
  release?: "github" | "gitlab";
  registry?: string;
}

packages

the packages directory. default packages

filesToCopy

the files that need to be copied to each package. default empty. detail

publish

if true, we will publish to npm. default true. detail

version

semver bump keyword. default patch. detail. you can also use --mono-version version_or_keyword to specific the bumped version.

changelog

if true, we will use the Conventional Commits Specification to generate CHANGELOG.md files. default true. detail

release

if specificed, we will create an official GitHub or GitLab release based on the changed packages, requires changelog to be true. default undefined. detail.

it need process.env.GH_TOKEN or process.env.GL_TOKEN. if you are using Windows, you can set it to your environment.

registry

the registry of packages to publish. default https://registry.npmjs.org

Registed Vta Feature

regist feature monorepo with a options that has a registBuilder function to regist source code builder

export declare type Builder = (pkg: Pkg, options?: { [key: string]: any }) => Promise<Error>;

export declare interface BuilderOptions {
  include?: RegExp | string;
  exclude?: RegExp | string;
  options?: { [key: string]: any };
}

export declare interface FeatureOptions {
  registBuilder(builder: Builder, options?: BuilderOptions): void;
}

Copy Files

export declare type FileToCopy =
  | string
  | {
      src: string;
      dest?: string | ((pkg: string) => string);
      include?: RegExp | string;
      exclude?: RegExp | string;
    };

you should specific the filesToCopy option to an array of FileToCopy. it can be a string or an object. if it is a string,we will use it as src of one object.

src

the file path that need to be copied from. relative to current working directory.

dest

the file path that need to be copied to. relative to package directory. default src. if this is a function, it will receive current package's directory pkg and should return a string file path.

include

the packages that need to be copied to. a RegExp or RegExp string. default true.

exclude

the packages that should not to be copied to. a RegExp or RegExp string. default false.

Build Source Code

firstly, you should install a monorepo-builder- plugin. it will use the registed vta feature to build your source code. you can specific the include,exclude,options of the builder's options. usage like below.

{
  "plugins": [
    ["@vta/monorepo", { "filesToCopy": ["LICENSE"] }],
    [
      "@vta/monorepo-builder-tsc",
      { "include": "ts-", "options": { "project": "tsconfig.build.json" } }
    ]
  ]
}

some builders

Publish Packages

if you want to publish your packages to npm or other registry. you must specific the publish option to true. we will use lerna publish command to publish all changed packages.

force publish

if some packages has published failed, you can use --mono-force-publish pkg1,pkg2 to force publish it. the pkg1 is the package's directory name.if omit the packages, we will force publish all of current packages.

Delete Copied Files

when app has processed done. we will automatically delete all copied files.

MIT License