0.1.0 • Published 9 months ago

cross-release-cli v0.1.0

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

Cross Release CLI

Usage

  1. install through package manager
pnpm i -D cross-release
  1. add a release script in your package.json
{
    "scripts": {
        "release": "cross-release"
    }
}
  1. run release script
pnpm run release

Command line

shortlongdescriptiondefault
-V--versionoutput the version numberfalse
-a--allAdd all changed files to stagedfalse
-c--config fileConfig fileauto detect
-D--dryDry runfalse
-d--debugEnable debug modefalse
-e--exclude dirFolders to exclude from search"node_modules",".git","target","build","dist"
-m--mainBase project language e.g. java, rust, javascript"javascript"
-r--recursiveRun the command for each project in the workspacefalse
-x--execute command...Execute the command[]
-y--yesAnswer yes to all promptsfalse
--cwd dirSet working directoryprocess.cwd()
-c--no-commitSkip committing changesfalse
-p--no-pushSkip pushingfalse
-t--no-tagSkip taggingfalse
-h--helpDisplay this messagefalse

Configuration

supportted file name:

  • cross-release.config.js
  • cross-release.config.cjs
  • cross-release.config.mjs
  • cross-release.config.ts
  • cross-release.config.cts
  • cross-release.config.mts
  • cross-release.config.json
  • package.json

Here are some examples that cover all the parameters:

export default {
    // ...
    "cross-release": {
        // "commit": false,
        commit: {
            // Whether to stage all un-staged files or stage only changed files
            stageAll: false,
            // the symbol '%s' will be replace to the version number that you specified
            template: "chore: release v%s",
            // Whether to invoke git pre-commit and commit-msg hook
            verify: true,
        },
        cwd: "/path/to/run",
        dry: false,
        // Your config will be append within default exclude folders
        excludes: ["path/to/exclude"],
        // "push": false,
        push: {
            branch: false,
            followTags: false,
        },
        recursive: false,
        // tag: false,
        tag: {
            template: "v%s",
        },
        version: "",
        yes: false,
    },
}

example for config in package.json

{
    // ...
    "cross-release": {
        "yes": true,
        "commit": true,
        "tag": {
            "template": "v%s",
        },
    }
}