Skip to content

Commit

Permalink
feat(deps): refactor node-workspace plugin to drop lerna-lite/core (#…
Browse files Browse the repository at this point in the history
…2117)

* test: refactor tests to run updaters from fixtures

* test: add snapshot for package.json updates

test: fix test

* feat: PackageJson updater can update dependencies

* feat(deps): refactor node-workspace plugin to drop lerna-lite/core

Use the internal workspace-plugin graph/dependency logic and built-in
package.json updaters to update the content.
  • Loading branch information
chingor13 authored Nov 10, 2023
1 parent 0e2305b commit 65fa72e
Show file tree
Hide file tree
Showing 11 changed files with 405 additions and 222 deletions.
31 changes: 31 additions & 0 deletions __snapshots__/node-workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,37 @@ Release notes for path: ., releaseType: node
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
`

exports['NodeWorkspace plugin run combines node packages 2'] = `
{
"name": "@here/root",
"version": "5.5.6",
"dependencies": {
"@here/pkgA": "^3.3.4",
"@here/pkgD": "^4.4.5"
}
}
`

exports['NodeWorkspace plugin run combines node packages 3'] = `
{
"name": "@here/pkgA",
"version": "3.3.4",
"dependencies": {
"anotherExternal": "^4.3.1"
}
}
`

exports['NodeWorkspace plugin run combines node packages 4'] = `
{
"name": "@here/pkgD",
"version": "4.4.5",
"dependencies": {
"anotherExternal": "^4.3.1"
}
}
`

exports['NodeWorkspace plugin run handles a single node package 1'] = `
:robot: I have created a release *beep* *boop*
---
Expand Down
56 changes: 56 additions & 0 deletions __snapshots__/package-json.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
exports['PackageJson updateContent updates dependency versions 1'] = `
{
\t"name": "yargs-parser",
\t"version": "14.0.0",
\t"description": "the mighty option parser used by yargs",
\t"main": "index.js",
\t"scripts": {
\t\t"test": "nyc mocha test/*.js",
\t\t"posttest": "standard",
\t\t"coverage": "nyc report --reporter=text-lcov | coveralls",
\t\t"release": "standard-version"
\t},
\t"repository": {
\t\t"url": "git@github.com:yargs/yargs-parser.git"
\t},
\t"keywords": [
\t\t"argument",
\t\t"parser",
\t\t"yargs",
\t\t"command",
\t\t"cli",
\t\t"parsing",
\t\t"option",
\t\t"args",
\t\t"argument"
\t],
\t"author": "Ben Coe <ben@npmjs.com>",
\t"license": "ISC",
\t"devDependencies": {
\t\t"chai": "^4.2.1",
\t\t"coveralls": "^3.0.2",
\t\t"mocha": "^5.2.0",
\t\t"nyc": "^13.0.1",
\t\t"standard": "^12.0.1"
\t},
\t"dependencies": {
\t\t"camelcase": "^6.0.0",
\t\t"decamelize": "^1.2.0"
\t},
\t"optionalDependencies": {
\t\t"foo": "~0.1.0"
\t},
\t"peerDependencies": {
\t\t"bar": ">2.3.4"
\t},
\t"files": [
\t\t"lib",
\t\t"index.js"
\t],
\t"engine": {
\t\t"node": ">=6"
\t}
}
`

exports['PackageJson updateContent updates the package version 1'] = `
{
\t"name": "yargs-parser",
Expand Down
25 changes: 1 addition & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"@conventional-commits/parser": "^0.4.1",
"@google-automations/git-file-utils": "^1.2.5",
"@iarna/toml": "^3.0.0",
"@lerna-lite/core": "1.17.0",
"@octokit/graphql": "^5.0.0",
"@octokit/request": "^6.0.0",
"@octokit/request-error": "^3.0.0",
Expand Down
Loading

0 comments on commit 65fa72e

Please sign in to comment.