-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(publish): add workspace support
Errors will make things stop altogether, dunno if we want to bikeshed that here or not PR-URL: #3231 Credit: @wraithgar Close: #3231 Reviewed-by: @ruyadorno
- Loading branch information
Showing
5 changed files
with
274 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,109 @@ npm publish [<folder>] | |
Options: | ||
[--tag <tag>] [--access <restricted|public>] [--dry-run] | ||
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]] | ||
[-ws|--workspaces] | ||
Run "npm help publish" for more info | ||
` | ||
|
||
exports[`test/lib/publish.js TAP workspaces all workspaces > should output all publishes 1`] = ` | ||
Array [ | ||
"+ [email protected]", | ||
"+ [email protected]", | ||
] | ||
` | ||
|
||
exports[`test/lib/publish.js TAP workspaces all workspaces > should publish all workspaces 1`] = ` | ||
Array [ | ||
Object { | ||
"_id": "[email protected]", | ||
"name": "workspace-a", | ||
"readme": "ERROR: No README data found!", | ||
"repository": Object { | ||
"type": "git", | ||
"url": "http://repo.workspace-a/", | ||
}, | ||
"version": "1.2.3-a", | ||
}, | ||
Object { | ||
"_id": "[email protected]", | ||
"bugs": Object { | ||
"url": "https://github.com/npm/workspace-b/issues", | ||
}, | ||
"homepage": "https://github.com/npm/workspace-b#readme", | ||
"name": "workspace-b", | ||
"readme": "ERROR: No README data found!", | ||
"repository": Object { | ||
"type": "git", | ||
"url": "git+https://github.com/npm/workspace-b.git", | ||
}, | ||
"version": "1.2.3-n", | ||
}, | ||
] | ||
` | ||
|
||
exports[`test/lib/publish.js TAP workspaces json > should output all publishes as json 1`] = ` | ||
Array [ | ||
String( | ||
{ | ||
"workspace-a": { | ||
"id": "[email protected]" | ||
}, | ||
"workspace-b": { | ||
"id": "[email protected]" | ||
} | ||
} | ||
), | ||
] | ||
` | ||
|
||
exports[`test/lib/publish.js TAP workspaces json > should publish all workspaces 1`] = ` | ||
Array [ | ||
Object { | ||
"_id": "[email protected]", | ||
"name": "workspace-a", | ||
"readme": "ERROR: No README data found!", | ||
"repository": Object { | ||
"type": "git", | ||
"url": "http://repo.workspace-a/", | ||
}, | ||
"version": "1.2.3-a", | ||
}, | ||
Object { | ||
"_id": "[email protected]", | ||
"bugs": Object { | ||
"url": "https://github.com/npm/workspace-b/issues", | ||
}, | ||
"homepage": "https://github.com/npm/workspace-b#readme", | ||
"name": "workspace-b", | ||
"readme": "ERROR: No README data found!", | ||
"repository": Object { | ||
"type": "git", | ||
"url": "git+https://github.com/npm/workspace-b.git", | ||
}, | ||
"version": "1.2.3-n", | ||
}, | ||
] | ||
` | ||
|
||
exports[`test/lib/publish.js TAP workspaces one workspace > should output one publish 1`] = ` | ||
Array [ | ||
"+ [email protected]", | ||
] | ||
` | ||
|
||
exports[`test/lib/publish.js TAP workspaces one workspace > should publish given workspace 1`] = ` | ||
Array [ | ||
Object { | ||
"_id": "[email protected]", | ||
"name": "workspace-a", | ||
"readme": "ERROR: No README data found!", | ||
"repository": Object { | ||
"type": "git", | ||
"url": "http://repo.workspace-a/", | ||
}, | ||
"version": "1.2.3-a", | ||
}, | ||
] | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.