Skip to content

Commit

Permalink
Merge branch 'release/2.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
vankeisb committed May 3, 2023
2 parents 3207ac5 + 6b32ebf commit 602dca0
Show file tree
Hide file tree
Showing 25 changed files with 650 additions and 302 deletions.
7 changes: 7 additions & 0 deletions .bomlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"@types/react": "^16.7.22",
"tea-cup-core": "2.3.0",
"react-tea-cup": "2.3.0",
"ts-jest": "^24.1.0",
"bomlint": "1.2.3"
}
35 changes: 33 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
version: 2
version: 2.1
orbs:
browser-tools: circleci/[email protected]

defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:erbium
- image: circleci/node:gallium

jobs:
build:
Expand All @@ -16,6 +18,31 @@ jobs:
root: ~/repo
paths: .

webtests:
working_directory: ~/repo
docker:
- image: circleci/openjdk:11-jdk-browsers
environment:
DISPLAY: :99

steps:
- run: sudo Xvfb :99 -screen 0 1920x1200x24 > /dev/null 2>&1 &
- attach_workspace:
at: ~/repo
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- run:
command: |
google-chrome --version
chromedriver --version
ps -efa | grep Xvfb
name: Check install
- run: cd webtests && export DISPLAY=:99 && mvn clean install -Dwebdriver.chrome.driver=/usr/local/bin/chromedriver
- store_artifacts:
path: ~/repo/webtests/target/surefire-reports
- store_artifacts:
path: ~/repo/webtests/target/videos

deploy:
<<: *defaults
steps:
Expand All @@ -34,9 +61,13 @@ workflows:
filters:
tags:
only: /\d+\.\d+\.\d+/
- webtests:
requires:
- build
- deploy:
requires:
- build
- webtests
filters:
tags:
only: /\d+\.\d+\.\d+/
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Changelog

## v2.2.2 (24/04/2023)

#### closed

- [**closed**] DocSub async dispatch [#93](https://github.com/vankeisb/react-tea-cup/pull/93)
- [**closed**] Fix model undef check, update README [#88](https://github.com/vankeisb/react-tea-cup/pull/88)

#### dependencies

- [**dependencies**] Bump decode-uri-component from 0.2.0 to 0.2.2 [#89](https://github.com/vankeisb/react-tea-cup/pull/89)
- [**dependencies**] Bump qs from 6.5.2 to 6.5.3 [#90](https://github.com/vankeisb/react-tea-cup/pull/90)
- [**dependencies**] Bump express from 4.17.1 to 4.18.2 [#91](https://github.com/vankeisb/react-tea-cup/pull/91)
- [**dependencies**] Bump json5 from 1.0.1 to 1.0.2 [#92](https://github.com/vankeisb/react-tea-cup/pull/92)
- [**dependencies**] Bump async from 2.6.3 to 2.6.4 [#80](https://github.com/vankeisb/react-tea-cup/pull/80)
- [**dependencies**] Bump minimist from 1.2.5 to 1.2.6 [#79](https://github.com/vankeisb/react-tea-cup/pull/79)
- [**dependencies**] Bump cross-fetch from 2.2.3 to 2.2.6 [#81](https://github.com/vankeisb/react-tea-cup/pull/81)
- [**dependencies**] Bump eventsource from 1.0.7 to 1.1.1 [#82](https://github.com/vankeisb/react-tea-cup/pull/82)
- [**dependencies**] Bump jsdom from 16.4.0 to 16.5.0 [#84](https://github.com/vankeisb/react-tea-cup/pull/84)
- [**dependencies**] Bump terser from 4.8.0 to 4.8.1 [#85](https://github.com/vankeisb/react-tea-cup/pull/85)

---

## v2.2.1 (02/09/2022)

#### closed
Expand Down
4 changes: 3 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
yarn install && \
yarn bomlint && \
cd core && \
./build.sh && \
cd ../tea-cup && \
./build.sh && \
cd ../samples && \
yarn test --watchAll=false
yarn test --watchAll=false && \
yarn build
27 changes: 13 additions & 14 deletions bump-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,25 @@ const fs = require('fs');

const VERSION = process.env.VERSION;

console.log("Bumping to " + VERSION);
console.log('Bumping to ' + VERSION);

function withJsonFile(name, callback) {
const text = fs.readFileSync(name);
const json = JSON.parse(text);
callback(json)
fs.writeFileSync(name, JSON.stringify(json, null, " "))
const text = fs.readFileSync(name);
const json = JSON.parse(text);
callback(json);
fs.writeFileSync(name, JSON.stringify(json, null, ' '));
}

withJsonFile("./core/package.json", j => {
j.version = VERSION;
withJsonFile('./core/package.json', (j) => {
j.version = VERSION;
});

withJsonFile("./tea-cup/package.json", j => {
j.version = VERSION;
j.peerDependencies['tea-cup-core'] = '^' + VERSION;
withJsonFile('./tea-cup/package.json', (j) => {
j.version = VERSION;
j.peerDependencies['tea-cup-core'] = VERSION;
});

withJsonFile('./samples/package.json', j => {
j.dependencies['tea-cup-core'] = VERSION;
j.dependencies['react-tea-cup'] = VERSION;
withJsonFile('./samples/package.json', (j) => {
j.dependencies['tea-cup-core'] = VERSION;
j.dependencies['react-tea-cup'] = VERSION;
});

2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tea-cup-core",
"version": "2.2.2",
"version": "2.3.0",
"description": "react-tea-cup core classes and utilities (Maybe etc)",
"author": "Rémi Van Keisbelck <[email protected]>",
"license": "MIT",
Expand Down
24 changes: 3 additions & 21 deletions core/src/TeaCup/Animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,6 @@

import { Sub } from './Sub';

let subs: Array<RafSub<any>> = [];

let ticking = false;

function tick() {
if (!ticking) {
ticking = true;
requestAnimationFrame((t: number) => {
subs.forEach((s) => s.trigger(t));
ticking = false;
});
}
}

class RafSub<M> extends Sub<M> {
readonly mapper: (t: number) => M;

Expand All @@ -49,13 +35,9 @@ class RafSub<M> extends Sub<M> {

protected onInit() {
super.onInit();
subs.push(this);
tick();
}

protected onRelease() {
super.onRelease();
subs = subs.filter((s) => s !== this);
setTimeout(() => {
this.isActive() && requestAnimationFrame((t) => this.trigger(t));
});
}

trigger(t: number) {
Expand Down
10 changes: 8 additions & 2 deletions core/src/TeaCup/Sub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { Dispatcher } from './Dispatcher';

export abstract class Sub<Msg> {
protected dispatcher: Dispatcher<Msg> | undefined;
private active: boolean = false;

static none<Msg>(): Sub<Msg> {
return new SubNone();
Expand All @@ -38,16 +39,21 @@ export abstract class Sub<Msg> {

init(dispatch: Dispatcher<Msg>): void {
this.dispatcher = dispatch;
this.active = true;
this.onInit();
}

release(): void {
this.dispatcher = undefined;
this.active = false;
this.onRelease();
}

isActive() {
return this.active;
}

protected dispatch(m: Msg): void {
this.dispatcher && this.dispatcher(m);
this.dispatcher?.(m);
}

protected onInit() {}
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
"jest": "24.9.0",
"prettier": "2.0.5",
"rimraf": "^2.6.3",
"ts-jest": "24.0.2",
"typescript": "~3.9.7"
"ts-jest": "^24.1.0",
"typescript": "~3.9.7",
"bomlint": "1.2.3"
},
"scripts": {
"release:gh": "gren release",
"release:changelog": "gren changelog --tags all --generate --override"
"release:changelog": "gren changelog --tags all --generate --override",
"bomlint": "bomlint --allow-conflicts react package.json ./core/package.json ./tea-cup/package.json ./samples/package.json"
}
}
9 changes: 4 additions & 5 deletions samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"proxy": "https://api.github.com",
"dependencies": {
"@types/node": "10.12.19",
"@types/react": "16.7.22",
"@types/react": "^16.7.22",
"@types/react-dom": "16.0.11",
"jest-enzyme": "^7.1.1",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"react-scripts": "3.4.3",
"react-tea-cup": "2.2.2",
"tea-cup-core": "2.2.2"
"react-tea-cup": "2.3.0",
"tea-cup-core": "2.3.0"
},
"scripts": {
"start": "react-scripts start",
Expand All @@ -36,7 +36,6 @@
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.15.1",
"enzyme-to-json": "^3.4.2",
"jest-fetch-mock": "^2.1.2",
"ts-jest": "^24.1.0"
"jest-fetch-mock": "^2.1.2"
}
}
Loading

0 comments on commit 602dca0

Please sign in to comment.