Skip to content
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
12 changes: 9 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ jobs:
PACKAGE_NAME=$(node -p "require('./package.json').name")
BASE_VERSION=$(node -p "require('./package.json').version")

if [[ ! "$GITHUB_REF_NAME" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "::error::Release tags must match vX.X.X, got $GITHUB_REF_NAME."
if [[ ! "$GITHUB_REF_NAME" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$ ]]; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep prereleases off the latest dist-tag

When a tag such as v0.16.0-beta.1 passes this newly widened check, the publish step runs npm publish without --tag; the npm publish documentation specifies that the tag defaults to latest and is added to the submitted package. Publishing this beta would therefore replace @rescript/react's latest version, causing ordinary unversioned installs to receive a prerelease that requires an alpha ReScript runtime; select an explicit non-latest dist-tag whenever PACKAGE_VERSION is a prerelease.

Useful? React with 👍 / 👎.

echo "::error::Release tags must match vX.X.X or vX.X.X-prerelease, got $GITHUB_REF_NAME."
exit 1
fi

Expand All @@ -71,6 +71,12 @@ jobs:
exit 1
fi

if [[ "$PACKAGE_VERSION" == *-* ]]; then
echo "npm_tag=next" >> "$GITHUB_OUTPUT"
else
echo "npm_tag=latest" >> "$GITHUB_OUTPUT"
fi

if npm view "$PACKAGE_NAME@$PACKAGE_VERSION" version >/dev/null 2>&1; then
echo "already_published=true" >> "$GITHUB_OUTPUT"
else
Expand All @@ -79,7 +85,7 @@ jobs:

- name: Publish package to npm
if: steps.release.outputs.already_published == 'false'
run: npm publish --provenance --access public
run: npm publish --provenance --access public --tag "${{ steps.release.outputs.npm_tag }}"

- name: Skip already published version
if: steps.release.outputs.already_published == 'true'
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,25 @@
> - :house: [Internal]
> - :nail_care: [Polish]

## 0.16.0-beta.1

#### :boom: Breaking Change

- Requires ReScript 13.0.0-alpha.5 or newer.
- Corrected the `ReactDOM.FormData.append`, `set`, and `has` signatures. The methods now receive the `FormData` value correctly, and `append` and `set` require the value being written. https://github.com/rescript-lang/rescript-react/pull/156
- Corrected `ReactDOM.useFormStatus` to represent non-pending `data`, `method`, and `action` values as nullable. Its action now accepts one `FormData` argument and preserves synchronous and asynchronous results. https://github.com/rescript-lang/rescript-react/pull/161
- Corrected `ReactDOMServer.resumeToPipeableStream` to synchronously return its `pipe` and `abort` controller instead of a promise. https://github.com/rescript-lang/rescript-react/pull/161

#### :bug: Bug Fix

- Use ReScript 13's `%component_identity` primitive for component conversion, fixing interface mismatches for components with generic prop types on ReScript 13.0.0-alpha.5 or newer. https://github.com/rescript-lang/rescript-react/pull/159
- Preserve the complete callback signature returned by `React.useEffectEvent`, including its arguments and return value. https://github.com/rescript-lang/rescript-react/pull/157
- Added the missing `onAllReady`, `onShellReady`, and `onShellError` options to `ReactDOMServer.resumeToPipeableStream`. https://github.com/rescript-lang/rescript-react/pull/161

#### :house: Internal

- Added automated preview-package publishing with pkg.pr.new and npm publishing for release tags. https://github.com/rescript-lang/rescript-react/pull/158 https://github.com/rescript-lang/rescript-react/pull/160

## 0.15.0

#### :boom: Breaking Change
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rescript/react",
"version": "0.16.0",
"version": "0.16.0-beta.1",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Allow prerelease tags for the beta package

When releasing this version with the matching v0.16.0-beta.1 tag, the Configure release step in .github/workflows/publish.yml rejects it because line 63 accepts only vX.X.X; conversely, a permitted v0.16.0 tag then fails the package-version equality check on line 69. Consequently, no release tag can publish this beta through the repository's npm workflow, so the tag validation needs to support prerelease suffixes.

Useful? React with 👍 / 👎.

"description": "React bindings for ReScript",
"files": [
"README.md",
Expand Down
Loading