Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

base-create-monorepo

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base-create-monorepo

Utility for npm init create-* scripts for monorepos.

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

base-create-monorepo

Utility for npm init create-* scripts for monorepos.

Based on base-create but for monorepos.

  • :sparkles: Auto-installs dependencies.
  • :sparkles: Auto-initializes lerna.
  • Baked-in .gitignore.

Note: If you want different options for different sub-packages, use base-create directly.

With an initializer package create-custom-babel-monorepo to create a monorepo project my-app with two nested packages my-first-package and my-second-package, pass a comma-delimited list of package names to the command after the project name:

$ npm init custom-babel-monorepo my-app my-first-package,my-second-package

Or if you wanted an npm scope @my-org on your package names (@my-org/my-app, @my-org/my-first-package, and @my-org/my-second-package), pass the org as an argument after the project name but before the package names:

$ npm init custom-babel-monorepo my-app @my-org my-first-package,my-second-package

Here is example source of such an initializer. Options at the root apply to the root package, and eachPackage defines options to apply to all sub-packages:

#!/usr/bin/env node

const createMonorepo = require("base-create-monorepo");

createMonorepo({
  package: {
    scripts: {
      start: "lerna run start",
      build: "lerna run build",
      "build:watch": "lerna run --parallel build:watch",
    },
  },
  eachPackage: {
    dependencies: ["@babel/runtime"],
    devDependencies: [
      "@babel/core",
      "@babel/cli",
      "@babel/node",
      "@babel/preset-env",
      "@babel/preset-typescript",
      "@babel/plugin-transform-runtime",
      "typescript",
    ],
    package: {
      scripts: {
        start: "node .",
        build: "babel -x .ts,.tsx src --out-dir dist",
        "build:watch": "npm run build -- --watch",
      },
    },
    files: ["src/index.ts"],
  },
  files: [
    {
      path: "babel.config.json",
      contents: {
        presets: ["@babel/preset-env", "@babel/preset-typescript"],
        plugins: ["@babel/plugin-transform-runtime"],
      },
    },
  ],
});

FAQs

Package last updated on 12 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc