Skip to content

Commit

Permalink
fix(publish): should publish from-package without needing --bump
Browse files Browse the repository at this point in the history
- Lerna should accept bump argument even whitout passing `--bump`  when it is provided as first argument (e.g.: `ws-roller publish from-git`)
  • Loading branch information
ghiscoding committed Feb 27, 2022
1 parent 391bca9 commit 48cffdd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
5 changes: 3 additions & 2 deletions .vscode/launch.json
Expand Up @@ -56,7 +56,8 @@
],
"args": [
"packages/cli/src/cli.ts",
"publish"
"publish",
"from-package"
],
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
Expand Down Expand Up @@ -91,4 +92,4 @@
]
}
]
}
}
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -83,7 +83,7 @@ Add the following NPM Scripts or simply run the following NodeJS command in your
// package.json / npm scripts
"scripts": {
"roll-version": "ws-roller version",
"roll-publish": "ws-roller publish --bump from-package"
"roll-publish": "ws-roller publish from-package"
}
```

Expand Down Expand Up @@ -117,7 +117,7 @@ npm install @lerna-lite/run
+ "roll-version": "ws-roller version",

- "roll-publish": "lerna publish from-package"
+ "roll-publish": "ws-roller publish --bump from-package"
+ "roll-publish": "ws-roller publish from-package"

- "build": "lerna run build"
+ "build": "ws-runner run build"
Expand Down
5 changes: 4 additions & 1 deletion lerna.json
Expand Up @@ -14,6 +14,9 @@
"noPrivate": true,
"message": "chore(release): publish new version %v",
"changelogHeaderMessage": "### Automate your Workspace Versions, Changelogs & Publish with [Lerna-Lite](https://github.com/ghiscoding/lerna-lite) 🚀"
},
"run": {
"runDryRun": false
}
}
}
}
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -10,11 +10,11 @@
"lint": "eslint packages/** --ext .ts",
"predist-roll-version": "npm run preroll-version",
"dist-roll-version": "node ./packages/cli/dist/cli.js version",
"dist-roll-publish": "node ./packages/cli/dist/cli.js publish --bump from-package",
"dist-roll-publish": "node ./packages/cli/dist/cli.js publish from-package",
"dist-pack-tarball": "node ./packages/run/dist/cli.js run pack-tarball",
"preroll-version": "echo \"⚠️ Make sure to run a Build & change cli.js line ending to LF before releasing a new version\"",
"roll-version": "ws-roller version",
"roll-publish": "ws-roller publish --bump from-package",
"roll-publish": "ws-roller publish from-package",
"pack-tarball": "ws-runner run pack-tarball",
"jest": "jest --runInBand --coverage=true --config ./jest/jest.config.js",
"jest:ci": "jest --runInBand --coverage=true --ci --config ./jest/jest.config.js",
Expand Down Expand Up @@ -60,4 +60,4 @@
"./packages/cli",
"./packages/run"
]
}
}
4 changes: 2 additions & 2 deletions packages/cli/src/cli.ts
Expand Up @@ -29,12 +29,12 @@ const cli = yargs(process.argv, process.cwd());
yargs(process.argv.slice(2))
.example('$0 version build -- --silent', '# `npm version build --silent` in all packages with a build script')
.command({
command: 'publish [script]',
command: 'publish [bump]',
describe: 'publish a new version',
handler: publishHandler,
})
.command({
command: 'version [script]',
command: 'version [bump]',
describe: 'roll a new version',
handler: versionHandler,
})
Expand Down

0 comments on commit 48cffdd

Please sign in to comment.