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/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" } diff --git a/package-lock.json b/package-lock.json index c6455f3..d32abb4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,9 +1,12 @@ { - "name": "lerna-repro", + "name": "repro", "lockfileVersion": 2, "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" } 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(); 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/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'); +}; 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" +}