Skip to content

Commit

Permalink
Merge branch 'master' into use-node-20
Browse files Browse the repository at this point in the history
  • Loading branch information
askoufis authored Feb 8, 2024
2 parents a742c83 + 6630c9f commit 16ef174
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/curvy-kangaroos-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'changesets-snapshot': patch
---

Fix publish to use semver-compatible version names
24 changes: 12 additions & 12 deletions src/__snapshots__/publish.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ exports[`command output for npm: logger.log 1`] = `

exports[`command output for npm: run 1`] = `
[
"node /__mocked_node_modules__/@changesets/cli/bin.js version --snapshot feature_123-branch",
"node /__mocked_node_modules__/@changesets/cli/bin.js version --snapshot feature-123-branch",
]
`;

exports[`command output for npm: runPublish 1`] = `
[
"node /__mocked_node_modules__/@changesets/cli/bin.js publish --tag feature_123-branch",
"node /__mocked_node_modules__/@changesets/cli/bin.js publish --tag feature-123-branch",
]
`;

Expand Down Expand Up @@ -49,10 +49,10 @@ exports[`command output for npm: summary 2`] = `
exports[`command output for npm: summary 3`] = `
[
[
"npm i @multiple/package1@feature_123-branch",
"npm i @multiple/package1@feature-123-branch",
],
[
"npm i @multiple/package-two@feature_123-branch",
"npm i @multiple/package-two@feature-123-branch",
],
]
`;
Expand All @@ -67,13 +67,13 @@ exports[`command output for pnpm: logger.log 1`] = `

exports[`command output for pnpm: run 1`] = `
[
"node /__mocked_node_modules__/@changesets/cli/bin.js version --snapshot feature_123-branch",
"node /__mocked_node_modules__/@changesets/cli/bin.js version --snapshot feature-123-branch",
]
`;

exports[`command output for pnpm: runPublish 1`] = `
[
"node /__mocked_node_modules__/@changesets/cli/bin.js publish --tag feature_123-branch",
"node /__mocked_node_modules__/@changesets/cli/bin.js publish --tag feature-123-branch",
]
`;

Expand Down Expand Up @@ -106,10 +106,10 @@ exports[`command output for pnpm: summary 2`] = `
exports[`command output for pnpm: summary 3`] = `
[
[
"pnpm add @multiple/package1@feature_123-branch",
"pnpm add @multiple/package1@feature-123-branch",
],
[
"pnpm add @multiple/package-two@feature_123-branch",
"pnpm add @multiple/package-two@feature-123-branch",
],
]
`;
Expand All @@ -124,13 +124,13 @@ exports[`command output for yarn: logger.log 1`] = `

exports[`command output for yarn: run 1`] = `
[
"node /__mocked_node_modules__/@changesets/cli/bin.js version --snapshot feature_123-branch",
"node /__mocked_node_modules__/@changesets/cli/bin.js version --snapshot feature-123-branch",
]
`;

exports[`command output for yarn: runPublish 1`] = `
[
"node /__mocked_node_modules__/@changesets/cli/bin.js publish --tag feature_123-branch",
"node /__mocked_node_modules__/@changesets/cli/bin.js publish --tag feature-123-branch",
]
`;

Expand Down Expand Up @@ -163,10 +163,10 @@ exports[`command output for yarn: summary 2`] = `
exports[`command output for yarn: summary 3`] = `
[
[
"yarn add @multiple/package1@feature_123-branch",
"yarn add @multiple/package1@feature-123-branch",
],
[
"yarn add @multiple/package-two@feature_123-branch",
"yarn add @multiple/package-two@feature-123-branch",
],
]
`;
Expand Down
2 changes: 1 addition & 1 deletion src/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const publishSnapshot = async () => {
ensureNpmrc(npmToken);

const branch = github.context.ref.replace('refs/heads/', '');
const cleansedBranchName = branch.replace(/\//g, '_');
const cleansedBranchName = branch.replace(/\//g, '-');
const changesetsCli = resolveFrom(cwd, '@changesets/cli/bin.js');

// Run the snapshot version
Expand Down

0 comments on commit 16ef174

Please sign in to comment.