Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the full relative path when npm publishing (fixes an issue with npm@7 publishing) #53

Merged
merged 1 commit into from
Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions __tests__/plugin-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,14 @@ describe('release-it-yarn-workspaces', () => {
"options": Object {},
},
Object {
"command": "npm publish packages/bar --tag latest",
"command": "npm publish ./packages/bar --tag latest",
"operationType": "command",
"options": Object {
"write": false,
},
},
Object {
"command": "npm publish packages/foo --tag latest",
"command": "npm publish ./packages/foo --tag latest",
"operationType": "command",
"options": Object {
"write": false,
Expand Down Expand Up @@ -368,7 +368,7 @@ describe('release-it-yarn-workspaces', () => {

let plugin = buildPlugin();

plugin.commandResponses['npm publish packages/@scope-name/bar --tag latest'] = [
plugin.commandResponses['npm publish ./packages/@scope-name/bar --tag latest'] = [
{
reject: true,
value:
Expand All @@ -395,21 +395,21 @@ describe('release-it-yarn-workspaces', () => {
"options": Object {},
},
Object {
"command": "npm publish packages/@scope-name/bar --tag latest",
"command": "npm publish ./packages/@scope-name/bar --tag latest",
"operationType": "command",
"options": Object {
"write": false,
},
},
Object {
"command": "npm publish packages/@scope-name/bar --tag latest --access public",
"command": "npm publish ./packages/@scope-name/bar --tag latest --access public",
"operationType": "command",
"options": Object {
"write": false,
},
},
Object {
"command": "npm publish packages/@scope-name/foo --tag latest",
"command": "npm publish ./packages/@scope-name/foo --tag latest",
"operationType": "command",
"options": Object {
"write": false,
Expand Down Expand Up @@ -473,14 +473,14 @@ describe('release-it-yarn-workspaces', () => {
"options": Object {},
},
Object {
"command": "npm publish dist/packages/qux --tag latest",
"command": "npm publish ./dist/packages/qux --tag latest",
"operationType": "command",
"options": Object {
"write": false,
},
},
Object {
"command": "npm publish dist/packages/zorp --tag latest",
"command": "npm publish ./dist/packages/zorp --tag latest",
"operationType": "command",
"options": Object {
"write": false,
Expand Down Expand Up @@ -520,14 +520,14 @@ describe('release-it-yarn-workspaces', () => {
"options": Object {},
},
Object {
"command": "npm publish packages/bar --tag foo",
"command": "npm publish ./packages/bar --tag foo",
"operationType": "command",
"options": Object {
"write": false,
},
},
Object {
"command": "npm publish packages/foo --tag foo",
"command": "npm publish ./packages/foo --tag foo",
"operationType": "command",
"options": Object {
"write": false,
Expand Down Expand Up @@ -557,14 +557,14 @@ describe('release-it-yarn-workspaces', () => {
expect(plugin.operations).toMatchInlineSnapshot(`
Array [
Object {
"command": "npm publish packages/bar --tag latest",
"command": "npm publish ./packages/bar --tag latest",
"operationType": "command",
"options": Object {
"write": false,
},
},
Object {
"command": "npm publish packages/foo --tag latest",
"command": "npm publish ./packages/foo --tag latest",
"operationType": "command",
"options": Object {
"write": false,
Expand Down Expand Up @@ -606,14 +606,14 @@ describe('release-it-yarn-workspaces', () => {
"options": Object {},
},
Object {
"command": "npm publish packages/bar --tag beta",
"command": "npm publish ./packages/bar --tag beta",
"operationType": "command",
"options": Object {
"write": false,
},
},
Object {
"command": "npm publish packages/foo --tag beta",
"command": "npm publish ./packages/foo --tag beta",
"operationType": "command",
"options": Object {
"write": false,
Expand Down Expand Up @@ -666,14 +666,14 @@ describe('release-it-yarn-workspaces', () => {
"options": Object {},
},
Object {
"command": "npm publish packages/bar --tag latest",
"command": "npm publish ./packages/bar --tag latest",
"operationType": "command",
"options": Object {
"write": false,
},
},
Object {
"command": "npm publish packages/foo --tag latest",
"command": "npm publish ./packages/foo --tag latest",
"operationType": "command",
"options": Object {
"write": false,
Expand Down Expand Up @@ -773,14 +773,14 @@ describe('release-it-yarn-workspaces', () => {
"options": Object {},
},
Object {
"command": "npm publish dist/@glimmer/interfaces --tag latest",
"command": "npm publish ./dist/@glimmer/interfaces --tag latest",
"operationType": "command",
"options": Object {
"write": false,
},
},
Object {
"command": "npm publish dist/@glimmer/runtime --tag latest",
"command": "npm publish ./dist/@glimmer/runtime --tag latest",
"operationType": "command",
"options": Object {
"write": false,
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ module.exports = class YarnWorkspacesPlugin extends Plugin {

try {
await this.exec(
`npm publish ${workspaceInfo.relativeRoot} --tag ${tag}${accessArg}${otpArg}${dryRunArg}`,
`npm publish ./${workspaceInfo.relativeRoot} --tag ${tag}${accessArg}${otpArg}${dryRunArg}`,
{
options,
}
Expand Down