Skip to content

Commit

Permalink
chore: release @storylite/[email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
itsjavi committed Aug 11, 2023
1 parent 4c51edb commit 1885c64
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
26 changes: 20 additions & 6 deletions .changeset/commits.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,26 @@ function getAddMessage() {
return `docs(changeset): add new entries`
}

function getVersionMessage(releasePlan) {
const releasePlanTxt = String(releasePlan)
const parts = releasePlanTxt.split('@')
const versionParts = parts[parts.length - 1].split('\n')
const version = versionParts[0] ?? 'new version'
return `chore: release v${version}`
function getVersionMessage(releasePlan, ...rest) {
if (releasePlan.releases === undefined || !Array.isArray(releasePlan.releases)) {
throw new Error('releasePlan.releases is not an array')
}
if (releasePlan.releases.length === 0) {
throw new Error('Nothing to release: releasePlan.releases is empty')
}

const version = releasePlan.releases[0]?.newVersion

if (version === undefined) {
throw new Error('releasePlan.releases[0].newVersion is undefined')
}

const name = releasePlan.releases[0]?.name
if (name === undefined) {
throw new Error('releasePlan.releases[0].name is undefined')
}

return `chore: release ${name}@${version}`
}

module.exports = { getAddMessage, getVersionMessage }
5 changes: 0 additions & 5 deletions .changeset/lazy-crews-serve.md

This file was deleted.

6 changes: 6 additions & 0 deletions packages/storylite/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @storylite/storylite

## 0.2.3

### Patch Changes

- [`4c51edb`](https://github.com/itsjavi/storylite/commit/4c51edbbc2f1047e20ec7aaca9d7eca8a6854ee6) Thanks [@itsjavi](https://github.com/itsjavi)! - minor changes

## 0.2.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/storylite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storylite/storylite",
"version": "0.2.2",
"version": "0.2.3",
"description": "A lightweight alternative to StoryBook, built on top of Vite⚡️",
"license": "MIT",
"type": "module",
Expand Down

0 comments on commit 1885c64

Please sign in to comment.