8.0.21 • Published 9 months ago

repo-cooker v8.0.21

Weekly downloads
4
License
MIT
Repository
github
Last release
9 months ago

repo-cooker

NPM version Build status

This is a tool for monorepo management and publishing, now with vscode extension support !

Repo-cooker helps running commands in all projects, linking binaries to run commands in directories and supports auto-semver versionning based on commits since last release (commitizen type).

There is no pre-required monorepo style or folder structure.

GETTING READY

Things to check before gettings started:

  1. Monorepo has correct 'repository' entry in package.json
  2. Names in individual packages package.json file is correct (matches glob path). For example, a package in 'packages/@foo/bar' should have '@foo/bar' as name.
  3. REPO_COOKER_GITHUB_TOKEN is set in the environment where the script runs.
  4. .npmrc has an authToken (npm login).
  5. git login if publishing release (see .travis.yml as example)
  6. 'latest' npm tag for packages already released use a semver version matching /^\d+.\d+. (any version with appe)

Usage examples

package.json

{
  "scripts": {
    // Creates a symlink from /[package path]/node-modules/.bin --> /node_modules/.bin
    // Creates a symlink from /node_modules/[package-name] --> [package path]
    "link": "repo-cooker --link",
    // Link on npm install.
    "install": "npm run link",
    // Build all modules, respecting cross-dependencies.
    "build": "repo-cooker --build",
    // Run the default release (semver, npm, github release)
    "release": "repo-cooker --release",
    "release:preview": "repo-cooker --dry-run --release --print-release",
    // Run the "test" script in all packages (if available).
    "test": "repo-cooker test"
    // If there is a ./repo-cooker/doThis.js file, run this
    // custom script otherwise, run the "doThis" script from
    // all packages.
    "doThis": "repo-cooker doThis",
  }
}

repo-cooker/index.js

This is the settings file.

import {Cooker} from 'repo-cooker'

// We need to pass process.argv as first argument so that we can set
// --dry-run or other options. For example:
// > npm run publish -- --dry-run
const cooker = Cooker(process.argv, {
  // Devtools settings
  devtools: {
    host: 'localhost:9797'
  },

  // Use devtools.
  // Same as command line option '--devtools'.
  useDevtools: true,

  // Do not execute any command, just show what would be run.
  // Same as command line option '--dry-run'.
  dryRun: true,

  // If your repo is located at some path other than
  // project root.
  path: '.',

  // Additional providers for the actions
  providers: []

  // For monorepo repositories with multiple packages, specify
  // the subpath to each package. A package should
  // then be in [path]/[packagesPath]/[packageName]
  packagesPath: 'packages/node_modules'
})

repo-cooker/publish.js

import { cooker } from './'

cooker.cook('publish', [
  cook.getLatestReleaseHash,
  cook.getHistoryFromHash,
  // ... and so on
  cook.fireworks
])

For now look at publish.test.js for a full example with comments.

8.0.9

10 months ago

8.0.8

10 months ago

8.0.5

10 months ago

8.0.4

10 months ago

8.0.7

10 months ago

8.0.6

10 months ago

8.0.10

10 months ago

8.0.12

10 months ago

8.0.11

10 months ago

8.0.14

9 months ago

8.0.13

9 months ago

8.0.16

9 months ago

8.0.15

9 months ago

8.0.18

9 months ago

8.0.17

9 months ago

8.0.19

9 months ago

8.0.21

9 months ago

8.0.20

9 months ago

8.0.1

10 months ago

8.0.0

11 months ago

8.0.3

10 months ago

8.0.2

10 months ago

7.4.0

2 years ago

7.3.1

3 years ago

7.3.0

3 years ago

7.2.0

3 years ago

7.1.0

3 years ago

7.0.0

3 years ago

6.4.0

3 years ago

6.3.3

3 years ago

6.3.2

3 years ago

6.3.1

5 years ago

6.3.0

5 years ago

6.2.7

6 years ago

6.2.6

6 years ago

6.2.5

6 years ago

6.2.4

6 years ago

6.2.3

6 years ago

6.2.2

6 years ago

6.2.1

6 years ago

6.2.0

6 years ago

6.1.0

6 years ago

6.0.0

6 years ago

5.0.0

6 years ago

4.1.0

6 years ago

4.0.0

6 years ago

3.2.0

6 years ago

3.1.1

7 years ago

3.1.0

7 years ago

3.0.0

7 years ago

2.2.2

7 years ago

2.2.1

7 years ago

2.2.0

7 years ago

2.1.0

7 years ago

2.0.8

7 years ago

2.0.7

7 years ago

2.0.6

7 years ago

2.0.5

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

0.0.0-next

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago