@ardatan/bob-the-bundler
Bob The Bundler!
Last updated 3 months ago by ardatan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @ardatan/bob-the-bundler 
SYNC missed versions from official npm registry.

Bob (The Bundler)

There's no documentation yet but you can check GraphQL Code Generator repository to see how to use Bob.

Requirements

  • Supports only scoped packages (same scope)
  • Yarn Workspaces
  • TypeScript with Paths
  • It's so strict you shouldn't use it!

Configuration

Bob only accepts bob.config.js in root directory:

module.exports = {
  scope: "@graphql-codegen", // Scope of organization
  ignore: ["@graphql-codegen/website", "@graphql-codegen/live-demo"], // ignored packages
  track: [
    // files in root that mark the entire workspace as dirty
    "bob.config.js", // we could include it in Bob itself but we decided to turn your life into hell :)
    "jest.config.js",
    "jest-project.js",
    "package.json",
    "tsconfig.json",
    // files in packages that mark the package as dirty
    "<project>/src/**",
    "<project>/jest.config.js",
    "<project>/package.json",
    "<project>/tsconfig.json",
  ],
  base: "origin/master", // we need to compare against something
  commands: {
    test: {
      track: ["<project>/tests/**"],
      run(affected) {
        // {
        //   paths: string[] <- ['packages/core', 'packages/cli']
        //   names: string[] <- ['@foo/core', '@foo/cli']
        // }

        // why such a weird syntax? We use spawn, so you have too
        return [`yarn`, ["test", ...affected.paths]];
      },
    },
    build: {
      run() {
        return [`yarn`, ["build"]];
      },
    },
  },
};

Build Options

In your <project>/package.json:

{
  "buildOptions": {
    "external": ["simple-git/promise"], // Marks nested imports as external
    "bin": {
      "cli": {
        "input": "src/cli.ts" // Entry point for `cli` command
      }
    }
  }
}

Support for Node ES Modules

In your <project>/package.json, just add "exports" like this:

{
  "main": "dist/index.cjs.js",
  "exports": {
    "require": "dist/index.cjs.js", // should match "main"
    "default": "dist/index.mjs" // should ends with ".mjs" extension
  }
}

Usage


$ bob affected test
$ bob affected build

$ bob build
$ bob prepack

Current Tags

  • 1.2.2                                ...           latest (3 months ago)

12 Versions

  • 1.2.2                                ...           3 months ago
  • 1.2.1                                ...           3 months ago
  • 1.2.0                                ...           3 months ago
  • 1.1.9                                ...           3 months ago
  • 1.1.8                                ...           3 months ago
  • 1.1.7                                ...           3 months ago
  • 1.1.6                                ...           3 months ago
  • 1.1.5                                ...           3 months ago
  • 1.1.4                                ...           3 months ago
  • 1.1.3                                ...           3 months ago
  • 1.1.2                                ...           3 months ago
  • 1.1.1                                ...           3 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 24
Last Day 0
Last Week 12
Last Month 12
Dependencies (16)
Dev Dependencies (10)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |