Skip to content

Commit

Permalink
Merge pull request #53 from nilzona/fix-publish
Browse files Browse the repository at this point in the history
fix: add `./` to relative path on publish
  • Loading branch information
rwjblue authored Apr 19, 2021
2 parents ca3c386 + 6963ea7 commit a6167e0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
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

0 comments on commit a6167e0

Please sign in to comment.