From db75e1ca0ce8b93629eec89b75ec1fd62bd2bd18 Mon Sep 17 00:00:00 2001 From: mark <34653278+bimbiltu@users.noreply.github.com> Date: Sat, 11 Jun 2022 12:49:07 -0400 Subject: [PATCH 1/5] initial commit --- package-lock.json | 2 +- packages/app/package.json | 12 ++++++++++++ packages/library/package.json | 12 ++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 packages/app/package.json create mode 100644 packages/library/package.json diff --git a/package-lock.json b/package-lock.json index c6455f3..e94835d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "lerna-repro", + "name": "repro", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/packages/app/package.json b/packages/app/package.json new file mode 100644 index 0000000..54977d8 --- /dev/null +++ b/packages/app/package.json @@ -0,0 +1,12 @@ +{ + "name": "app", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC" +} diff --git a/packages/library/package.json b/packages/library/package.json new file mode 100644 index 0000000..63f5449 --- /dev/null +++ b/packages/library/package.json @@ -0,0 +1,12 @@ +{ + "name": "library", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC" +} From aaa70b01dac6fecce00f8338142251559ca7f213 Mon Sep 17 00:00:00 2001 From: mark <34653278+bimbiltu@users.noreply.github.com> Date: Sat, 11 Jun 2022 12:49:21 -0400 Subject: [PATCH 2/5] v1.0.0 --- lerna.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lerna.json b/lerna.json index f08f257..2b3450d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,4 +1,6 @@ { - "packages": ["packages/*"], - "version": "0.0.0" + "packages": [ + "packages/*" + ], + "version": "1.0.0" } From 18a3f934934b989f2a2ed21a5705424f6a12f8cd Mon Sep 17 00:00:00 2001 From: mark <34653278+bimbiltu@users.noreply.github.com> Date: Sat, 11 Jun 2022 12:53:22 -0400 Subject: [PATCH 3/5] chore(package): add workspaces and update readme --- README.md | 12 ++++++++++++ package-lock.json | 25 +++++++++++++++++++++++++ package.json | 3 +++ 3 files changed, 40 insertions(+) diff --git a/README.md b/README.md index d847cf0..b036afb 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,15 @@ Please fork this repository (https://github.com/lerna/repro) and apply any chang Please include any additional instructions in the PR description, such as commands to run etc, and then reference the PR you have created in a bug report on the main repository: https://github.com/lerna/lerna + + +## Repo details + +This is a reproducer for https://github.com/lerna/lerna/issues/2060 + +To reproduce: + 1. `npm i` + 1. `npx lerna publish --canary` + +Notice that lerna only wants to publish `app => 1.0.1-alpha.2`, which will have a dependency on `library@1.0.0`. +This will result in a broken version of `app` being published as it depends on the unpublished change to library in commit `0639f4a`. diff --git a/package-lock.json b/package-lock.json index e94835d..d32abb4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,9 @@ "requires": true, "packages": { "": { + "workspaces": [ + "packages/*" + ], "devDependencies": { "lerna": "^5.0.0" } @@ -1825,6 +1828,10 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/app": { + "resolved": "packages/app", + "link": true + }, "node_modules/aproba": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", @@ -3977,6 +3984,10 @@ "node": ">=10" } }, + "node_modules/library": { + "resolved": "packages/library", + "link": true + }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -7188,6 +7199,14 @@ "engines": { "node": ">=10" } + }, + "packages/app": { + "version": "1.0.0", + "license": "ISC" + }, + "packages/library": { + "version": "1.0.0", + "license": "ISC" } }, "dependencies": { @@ -8686,6 +8705,9 @@ "color-convert": "^2.0.1" } }, + "app": { + "version": "file:packages/app" + }, "aproba": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", @@ -10409,6 +10431,9 @@ } } }, + "library": { + "version": "file:packages/library" + }, "lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", diff --git a/package.json b/package.json index d041225..df7342c 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,8 @@ { "private": true, + "workspaces": [ + "packages/*" + ], "devDependencies": { "lerna": "^5.0.0" } From af8096f6b2eac0b87b7ae641ca6ce17e609b61ed Mon Sep 17 00:00:00 2001 From: mark <34653278+bimbiltu@users.noreply.github.com> Date: Sat, 11 Jun 2022 12:50:21 -0400 Subject: [PATCH 4/5] feat(library): add helloWorld function --- packages/library/index.js | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 packages/library/index.js diff --git a/packages/library/index.js b/packages/library/index.js new file mode 100644 index 0000000..8eaf98e --- /dev/null +++ b/packages/library/index.js @@ -0,0 +1,3 @@ +module.exports.helloWorld = function() { + console.log('hello world'); +}; From 7608c2ef84ac44aee241a28274c202b692d01ecf Mon Sep 17 00:00:00 2001 From: mark <34653278+bimbiltu@users.noreply.github.com> Date: Sat, 11 Jun 2022 12:51:49 -0400 Subject: [PATCH 5/5] feat(app): add some console output --- packages/app/index.js | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 packages/app/index.js diff --git a/packages/app/index.js b/packages/app/index.js new file mode 100644 index 0000000..47088c2 --- /dev/null +++ b/packages/app/index.js @@ -0,0 +1,4 @@ +const {helloWorld} = require('library'); + +console.log('A message from the library:'); +helloWorld();