Compare commits

...

13 Commits

Author SHA1 Message Date
zplata
e0f00174c8 chore: release 4.1.2 2023-08-05 16:29:45 +00:00
Zach Plata
200a86a6ba chore: bump rive-wasm to 2.1.2 2023-08-05 11:24:49 -05:00
zplata
26622596c8 chore: release 4.1.1 2023-08-03 13:44:49 +00:00
Zach Plata
ac789f0855 patch: bump rive-wasm to 2.1.1 2023-08-03 08:38:41 -05:00
zplata
6ecdc05aea chore: release 4.1.0 2023-07-31 19:07:05 +00:00
Slava Khanilo
f8aa50fa49 feature: expose RiveProps type from package 2023-07-31 13:52:14 -05:00
Zach Plata
b59bfdef84 feature: Add ability to get and set text via wasm runtime bump 2023-07-31 13:50:59 -05:00
luigi-rosso
948ded25f7 chore: release 4.0.0 2023-07-26 01:33:54 +00:00
Luigi Rosso
27f7f2b250 Bump to rive wasm 2.0.0 2023-07-25 18:29:22 -07:00
zplata
184ba2e110 chore: release 3.0.57 2023-07-25 20:18:00 +00:00
Zach Plata
f6d8db323b chore: remove dryrun from release it script 2023-07-25 15:11:10 -05:00
Gordon
301e58f390 docs: add awesome-rive 2023-07-25 14:57:42 -05:00
Zach Plata
4cce3067a7 chore: move to manual npm publish workflow 2023-07-25 14:52:52 -05:00
13 changed files with 202 additions and 127 deletions

View File

@@ -1,43 +1,28 @@
name: Publish to NPM
on:
pull_request:
types: [closed]
branches:
- main
workflow_dispatch:
inputs:
major:
description: 'Major'
type: boolean
default: false
minor:
description: 'Minor'
type: boolean
default: false
jobs:
determine_version:
name: Determine the next build version
if: github.event.pull_request.merged == true
publish_job:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.echo_version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: npm install
working-directory: ./
- name: Git config
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Git config
run: |
git config --local user.email 'hello@rive.app'
git config --local user.name ${{ github.actor }}
- name: Authenticate with registry
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
- id: determine_version
name: Get Version
run: npm run release -- --ci --release-version | tail -n 1 > RELEASE_VERSION
working-directory: ./
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
- id: echo_version
run: echo "::set-output name=version::$(cat ./RELEASE_VERSION)"
merge_job:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
needs: [determine_version]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.x'
@@ -50,30 +35,24 @@ jobs:
run: npm run lint
- name: Run Tests
run: npm test
- name: Build main dist
run: npm run build
- name: Copy separated builds
run: ./scripts/build.sh
- name: Copy package jsons to separate react outputs
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: ./scripts/setup_all_packages.sh
- name: Bump Versions of react outputs
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
RELEASE_VERSION: ${{ needs.determine_version.outputs.version }}
run: ./scripts/bump_all_versions.sh
- name: Git config
run: |
git config --local user.email 'hello@rive.app'
git config --local user.name ${{ github.actor }}
- name: Authenticate with registry
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
- name: Release rive-react
- if: ${{ inputs.major == true }}
name: Major Release - Bump version number, update changelog, push and tag
run: npm run release:major
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
run: npm run release -- --ci
- name: Release @rive-app/react-* variants
PAT_GITHUB: ${{ secrets.PAT_GITHUB }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- if: ${{inputs.major == false && inputs.minor == true}}
name: Minor release - Bump version number, update changelog, push and tag
run: npm run release:minor
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
run: ./scripts/publish_all.sh
PAT_GITHUB: ${{ secrets.PAT_GITHUB }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- if: ${{inputs.major == false && inputs.minor == false}}
name: Patch release - Bump version number, update changelog, push and tag
run: npm run release:patch
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
PAT_GITHUB: ${{ secrets.PAT_GITHUB }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

View File

@@ -1,5 +1,7 @@
{
"git": {
"addUntrackedFiles": true,
"requireCleanWorkingDir": false,
"commitMessage": "chore: release ${version}",
"tagName": "v${version}",
"changelog": "npx auto-changelog --stdout --commit-limit false --unreleased --template https://raw.githubusercontent.com/release-it/release-it/master/templates/changelog-compact.hbs"
@@ -12,6 +14,12 @@
"releaseName": "${version}"
},
"hooks": {
"after:bump": ["npx auto-changelog -p", "git add ./CHANGELOG.md"]
"after:version:bump": [
"npm run build",
"npm run setup-builds",
"npm run setup-packages",
"npx auto-changelog -p",
"npm run publish:all"
]
}
}

View File

@@ -4,10 +4,61 @@ All notable changes to this project will be documented in this file. Dates are d
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
#### [v3.0.56](https://github.com/rive-app/rive-react/compare/v3.0.53...v3.0.56)
#### [v4.1.2](https://github.com/rive-app/rive-react/compare/v4.1.1...v4.1.2)
- chore: bump rive-wasm to 2.1.2 [`200a86a`](https://github.com/rive-app/rive-react/commit/200a86a6bab5cd0e8a31c211df90b9dbf8e7d1be)
#### [v4.1.1](https://github.com/rive-app/rive-react/compare/v4.1.0...v4.1.1)
> 3 August 2023
- chore: release 4.1.1 [`2662259`](https://github.com/rive-app/rive-react/commit/26622596c8a41b2c5cc5b83bb8db42de3e9dcac7)
- patch: bump rive-wasm to 2.1.1 [`ac789f0`](https://github.com/rive-app/rive-react/commit/ac789f0855eaada115d84fd35da0030aad6b80e1)
#### [v4.1.0](https://github.com/rive-app/rive-react/compare/v4.0.0...v4.1.0)
> 31 July 2023
- chore: release 4.1.0 [`6ecdc05`](https://github.com/rive-app/rive-react/commit/6ecdc05aea05277557c352601b535b3d16361435)
- feature: expose RiveProps type from package [`f8aa50f`](https://github.com/rive-app/rive-react/commit/f8aa50fa498493428a81a169f36daa0e331b4da5)
- feature: Add ability to get and set text via wasm runtime bump [`b59bfde`](https://github.com/rive-app/rive-react/commit/b59bfdef8425df26cf14e4e384b60bba812eaeef)
### [v4.0.0](https://github.com/rive-app/rive-react/compare/v3.0.57...v4.0.0)
> 26 July 2023
- chore: release 4.0.0 [`948ded2`](https://github.com/rive-app/rive-react/commit/948ded25f7e0bbfb3a2c4553cc1e73555e3e092f)
- Bump to rive wasm 2.0.0 [`27f7f2b`](https://github.com/rive-app/rive-react/commit/27f7f2b250c23f4de3c49c491ea2348534e6e2d9)
#### [v3.0.57](https://github.com/rive-app/rive-react/compare/v3.0.56...v3.0.57)
> 25 July 2023
- chore: move to manual npm publish workflow [`4cce306`](https://github.com/rive-app/rive-react/commit/4cce3067a7bce0d66a17b0347c4d87a9d090da0b)
- chore: release 3.0.57 [`184ba2e`](https://github.com/rive-app/rive-react/commit/184ba2e110e055a2923b885f5c627ab30cf1d3d2)
- chore: remove dryrun from release it script [`f6d8db3`](https://github.com/rive-app/rive-react/commit/f6d8db323bc57235d1cdce505bb86cb8d05e38fa)
#### [v3.0.56](https://github.com/rive-app/rive-react/compare/v3.0.55...v3.0.56)
> 24 July 2023
- chore: release 3.0.56 [`4496eff`](https://github.com/rive-app/rive-react/commit/4496eff59845a8a30a8dbe26436d4e325629762c)
- patch: bump rive-wasm for follow-path patch [`5e98586`](https://github.com/rive-app/rive-react/commit/5e98586354849006152ef25a8b30fe781ef0cca6)
#### [v3.0.55](https://github.com/rive-app/rive-react/compare/v3.0.54...v3.0.55)
> 19 July 2023
- chore: release 3.0.55 [`f19295f`](https://github.com/rive-app/rive-react/commit/f19295f9a5a379a3e8a7c8491f5ccadba6598a28)
- feature: add onAdvance callback through wasm bump too 1.2.2 [`7054630`](https://github.com/rive-app/rive-react/commit/70546308b44718e04f5295f60b99f0fc7bbe8172)
#### [v3.0.54](https://github.com/rive-app/rive-react/compare/v3.0.53...v3.0.54)
> 26 June 2023
- chore: release 3.0.54 [`62a425f`](https://github.com/rive-app/rive-react/commit/62a425f30e4e6d6ff7bfd76326fbb93b2241d306)
- patch: Bump WASM runtimes for interpolation on states [`4a554dd`](https://github.com/rive-app/rive-react/commit/4a554dd1ad951b17c405096f0a6bcb9ae0600a4f)
#### [v3.0.53](https://github.com/rive-app/rive-react/compare/v3.0.52...v3.0.53)
> 9 June 2023
@@ -289,13 +340,20 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- chore: release 3.0.15 [`8175c4a`](https://github.com/rive-app/rive-react/commit/8175c4a4d406ac80703a6df346f3b5562d2e9311)
- Patch: Bump js runtime dependencies for nested artboard display patch [`795ee53`](https://github.com/rive-app/rive-react/commit/795ee533405ec98457db074d11730849e1be5c88)
#### [v3.0.14](https://github.com/rive-app/rive-react/compare/v3.0.12...v3.0.14)
#### [v3.0.14](https://github.com/rive-app/rive-react/compare/v3.0.13...v3.0.14)
> 28 June 2022
- Deploying to main from @ 3477afdef166251f35f1778a3143ff6c6efecc58 🚀 [`7aee5cf`](https://github.com/rive-app/rive-react/commit/7aee5cfab4eaca1fc9369742639507a770c4f756)
- Fix: Intake JS runtime patches for starting animation frames [`3477afd`](https://github.com/rive-app/rive-react/commit/3477afdef166251f35f1778a3143ff6c6efecc58)
- chore: release 3.0.14 [`04353db`](https://github.com/rive-app/rive-react/commit/04353db43266f6dcf40f4ef7f3be23afa13c2e0d)
- Fix: Bump version because of race condition again [`1f0e511`](https://github.com/rive-app/rive-react/commit/1f0e511f6e047d05ca2783a56c2924a9c1af432a)
#### [v3.0.13](https://github.com/rive-app/rive-react/compare/v3.0.12...v3.0.13)
> 27 June 2022
- Fix: Intake JS runtime patches for starting animation frames [`3477afd`](https://github.com/rive-app/rive-react/commit/3477afdef166251f35f1778a3143ff6c6efecc58)
- chore: release 3.0.13 [`3695dd9`](https://github.com/rive-app/rive-react/commit/3695dd99504a05818563b6ba9c89db77a38ff305)
#### [v3.0.12](https://github.com/rive-app/rive-react/compare/v3.0.11...v3.0.12)
@@ -312,12 +370,19 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- chore: release 3.0.11 [`aee7407`](https://github.com/rive-app/rive-react/commit/aee7407f7921c515f3c1d9aabf87387baddb4064)
- Docs: Code snippets update to use new React package structure [`b48de9d`](https://github.com/rive-app/rive-react/commit/b48de9db8496be35f29bea87273a7a9fceefdafc)
#### [v3.0.10](https://github.com/rive-app/rive-react/compare/v3.0.8...v3.0.10)
#### [v3.0.10](https://github.com/rive-app/rive-react/compare/v3.0.9...v3.0.10)
> 20 June 2022
- Deploying to main from @ 5ad5a957a6e8f10abedc23f46033d4792e29dfe5 🚀 [`802648e`](https://github.com/rive-app/rive-react/commit/802648eda8fa0e5a0a35c66af06e476eac59fe9e)
- chore: release 3.0.10 [`6772f16`](https://github.com/rive-app/rive-react/commit/6772f166b7f3e4747ae508a54e2533bb3ea49878)
- Maint: roll canvas and webgl dependencies to include updates for rounded corners [`314d7c1`](https://github.com/rive-app/rive-react/commit/314d7c19cc727ad86114f968fa79fbd0be4074af)
#### [v3.0.9](https://github.com/rive-app/rive-react/compare/v3.0.8...v3.0.9)
> 9 June 2022
- chore: release 3.0.9 [`1909218`](https://github.com/rive-app/rive-react/commit/19092189a7253dc38ab0707c1e98de2b31da6306)
- Maint: Update docs for storybook link [`5ad5a95`](https://github.com/rive-app/rive-react/commit/5ad5a957a6e8f10abedc23f46033d4792e29dfe5)
#### [v3.0.8](https://github.com/rive-app/rive-react/compare/v3.0.7...v3.0.8)
@@ -572,13 +637,26 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- chore: release 0.0.15 [`f0b1aeb`](https://github.com/rive-app/rive-react/commit/f0b1aeb7d850103b61310c9251a827f835fadf58)
- update rive-js with support for distance and transform constraints [`8612e0b`](https://github.com/rive-app/rive-react/commit/8612e0b15f6c93d4e5c276c95e7f36543466e4d6)
#### [v0.0.14](https://github.com/rive-app/rive-react/compare/v0.0.11...v0.0.14)
#### [v0.0.14](https://github.com/rive-app/rive-react/compare/v0.0.13...v0.0.14)
> 21 July 2021
- chore: release 0.0.14 [`d7f7eab`](https://github.com/rive-app/rive-react/commit/d7f7eab65577732fa1e9f792bc14f10d89c0ccaf)
- chore: bump to 0.0.13 [`29bd502`](https://github.com/rive-app/rive-react/commit/29bd502208efa6928ffb47f06b5e548f071a8ade)
#### [v0.0.13](https://github.com/rive-app/rive-react/compare/v0.0.12...v0.0.13)
> 21 July 2021
- chore: release 0.0.13 [`4b06d2d`](https://github.com/rive-app/rive-react/commit/4b06d2d8f5c12b0bdff58d9c14d5e41df0a41b48)
- chore: bump to 0.0.12 [`7266fc5`](https://github.com/rive-app/rive-react/commit/7266fc5d2fc0404362031ea3d3c760309f6927e6)
#### [v0.0.12](https://github.com/rive-app/rive-react/compare/v0.0.11...v0.0.12)
> 21 July 2021
- Bump rive-js to 0.7.19 with support for IK constraints [`6c80c53`](https://github.com/rive-app/rive-react/commit/6c80c5311e99ee47e9f4fc3c5f35ab908ddfa326)
- chore: release 0.0.14 [`d7f7eab`](https://github.com/rive-app/rive-react/commit/d7f7eab65577732fa1e9f792bc14f10d89c0ccaf)
- chore: bump to 0.0.13 [`29bd502`](https://github.com/rive-app/rive-react/commit/29bd502208efa6928ffb47f06b5e548f071a8ade)
- chore: release 0.0.12 [`6212844`](https://github.com/rive-app/rive-react/commit/621284482538d6b5a4cb16cf845c53528208b0bb)
#### [v0.0.11](https://github.com/rive-app/rive-react/compare/v0.0.10...v0.0.11)

View File

@@ -52,6 +52,10 @@ Check out our Storybook instance that shows how to use the library in small exam
- [Mouse tracking](https://codesandbox.io/s/rive-mouse-track-test-t0y965?file=/src/App.js)
- [Accessibility concerns](https://rive.app/blog/accesible-web-animations-aria-live-regions)
### Awesome Rive
For even more examples and resources on using Rive at runtime or in other tools, checkout the [awesome-rive](https://github.com/rive-app/awesome-rive) repo.
## Migration Guides
Using an older version of the runtime and need to learn how to upgrade to the latest version? Check out the migration guides below in our help center that help guide you through version bumps; breaking changes and all!

View File

@@ -0,0 +1,26 @@
{
"name": "@rive-app/react-canvas",
"version": "4.1.2",
"description": "React wrapper around the @rive-app/canvas library",
"main": "dist/index.js",
"typings": "dist/types/index.d.ts",
"files": [
"dist/**"
],
"repository": {
"type": "git",
"url": "git+https://github.com/rive-app/rive-react.git"
},
"author": "",
"license": "MIT",
"bugs": {
"url": "https://github.com/rive-app/rive-react/issues"
},
"homepage": "https://github.com/rive-app/rive-react#readme",
"dependencies": {
"@rive-app/canvas": "2.1.2"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
}
}

View File

@@ -0,0 +1,26 @@
{
"name": "@rive-app/react-webgl",
"version": "4.1.2",
"description": "React wrapper around the @rive-app/webgl library",
"main": "dist/index.js",
"typings": "dist/types/index.d.ts",
"files": [
"dist/**"
],
"repository": {
"type": "git",
"url": "git+https://github.com/rive-app/rive-react.git"
},
"author": "",
"license": "MIT",
"bugs": {
"url": "https://github.com/rive-app/rive-react/issues"
},
"homepage": "https://github.com/rive-app/rive-react#readme",
"dependencies": {
"@rive-app/webgl": "2.1.2"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "rive-react",
"version": "3.0.56",
"version": "4.1.2",
"description": "React wrapper around the rive-js library",
"main": "dist/index.js",
"typings": "dist/types/index.d.ts",
@@ -16,7 +16,14 @@
"types:check": "tsc --noEmit",
"release": "release-it",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook -o docs-build"
"build-storybook": "build-storybook -o docs-build",
"release:patch": "npm run release -- --ci",
"release:minor": "npm run release -- minor --ci",
"release:major": "npm run release -- major --ci",
"setup-builds": "./scripts/build.sh",
"setup-packages": "./scripts/setup_all_packages.sh",
"bump-versions": "./scripts/bump_all_versions.sh $npm_package_version",
"publish:all": "./scripts/publish_all.sh --access public"
},
"repository": {
"type": "git",
@@ -29,8 +36,8 @@
},
"homepage": "https://github.com/rive-app/rive-react#readme",
"dependencies": {
"@rive-app/canvas": "1.2.4",
"@rive-app/webgl": "1.2.4"
"@rive-app/canvas": "2.1.2",
"@rive-app/webgl": "2.1.2"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"

View File

@@ -1,11 +0,0 @@
#!/bin/bash
set -e
# Bump the version number of every npm module in the npm folder.
for dir in ./npm/*; do
pushd $dir > /dev/null
repo_name=`echo $dir | sed 's:.*/::' | sed 's/_/-/g'`
echo Bumping version of $repo_name
../../scripts/bump_version.sh $repo_name $RELEASE_VERSION
popd > /dev/null
done

View File

@@ -1,12 +0,0 @@
#!/bin/bash
# Bumps the version of a single npm module found in the current working
# directory. Call bump_version.sh from the path with package.json in it.
set -e
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# RELEASE_VERSION will come from an env variable passed in from the GH action workflow
node $SCRIPT_DIR/nextVersion.js "$RELEASE_VERSION" `pwd`
# Replace the dist package json with the newly trimmed one
cp -f ./package.json ./dist/package.json

View File

@@ -1,33 +0,0 @@
const fs = require('fs');
const path = process.argv[3];
const package = require(path + '/package.json');
const currentVersion = package.version;
const nextVersion = process.argv[2].trim().replace(/\'/g, '"');
if (!nextVersion || nextVersion === currentVersion) {
throw new Error('Next version is not defined or is a version that already exists');
}
// Returns -1 if first is less than second, 1 if first is greater than second, otherwise 0 if equal.
function compareVersion(first, second) {
// Assumption: only numbers in our versions.
const firstParts = first.split('.').map((value) => parseInt(value));
const secondParts = second.split('.').map((value) => parseInt(value));
for (let i = 0; i < Math.max(firstParts.length, secondParts.length); i++) {
const first = i < firstParts.length ? firstParts[i] : 0;
const second = i < secondParts.length ? secondParts[i] : 0;
if (first < second) {
return -1;
}
if (second < first) {
return 1;
}
}
return 0;
}
if (compareVersion(currentVersion, nextVersion) <= 0) {
package.version = nextVersion;
fs.writeFileSync(path + '/package.json', JSON.stringify(package, null, 2));
}

View File

@@ -5,6 +5,6 @@ set -e
for dir in ./npm/*; do
pushd $dir > /dev/null
echo Publishing `echo $dir | sed 's:.*/::'`
npm publish --access public
npm publish $@
popd > /dev/null
done

View File

@@ -3,14 +3,17 @@ set -e
echo "Copying package.json to rive-react npm package folders"
cp package.json npm/react-canvas
cp package.json npm/react-webgl
# Bump the version number of every npm module in the npm folder.
for dir in ./npm/*; do
echo $dir
pushd $dir > /dev/null
echo $dir
if [ -f "./package.json" ]; then
echo "Removing existing package.json..."
rm "./package.json"
echo "package.json deleted from $dir"
fi
cp ../../package.json ./
repo_name=`echo $dir | sed 's:.*/::' | sed 's/_/-/g'`
echo Setting package.json on npm packages
echo $repo_name

View File

@@ -1,9 +1,9 @@
import Rive from './components/Rive';
import Rive, { RiveProps } from './components/Rive';
import useRive from './hooks/useRive';
import useStateMachineInput from './hooks/useStateMachineInput';
import useResizeCanvas from './hooks/useResizeCanvas';
export default Rive;
export { useRive, useStateMachineInput, useResizeCanvas };
export { useRive, useStateMachineInput, useResizeCanvas, RiveProps };
export { RiveState, UseRiveParameters, UseRiveOptions } from './types';
export * from '@rive-app/canvas';