Skip to content

Commit

Permalink
chore: merge pull request #1396 from dhis2/alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
amcgee authored Dec 4, 2024
2 parents a76a9c7 + d3c024a commit 5075ec0
Show file tree
Hide file tree
Showing 44 changed files with 2,888 additions and 5,443 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dhis2-deploy-netlify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
if: "!github.event.push.repository.fork && github.actor != 'dependabot[bot]'"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: 14.x
node-version: 20.x

- uses: c-hive/gha-yarn-cache@v1
- run: yarn install --frozen-lockfile
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/dhis2-verify-lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: 14.x
node-version: 20.x

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
Expand All @@ -40,9 +40,9 @@ jobs:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: 14.x
node-version: 20.x

- uses: actions/cache@v2
id: yarn-cache
Expand All @@ -53,7 +53,7 @@ jobs:
- name: Build
run: yarn build

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: lib-build
path: |
Expand All @@ -67,17 +67,17 @@ jobs:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: 14.x
node-version: 20.x

- uses: actions/cache@v2
id: yarn-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: lib-build

Expand All @@ -94,17 +94,17 @@ jobs:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: 14.x
node-version: 20.x

- uses: actions/cache@v2
id: yarn-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: lib-build

Expand All @@ -119,11 +119,11 @@ jobs:
- uses: actions/checkout@v2
with:
token: ${{env.GH_TOKEN}}
- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: 14.x
node-version: 20.x

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: lib-build

Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# [3.12.0-alpha.2](https://github.com/dhis2/app-runtime/compare/v3.12.0-alpha.1...v3.12.0-alpha.2) (2024-12-03)


### Features

* upgrade react query to v4 ([#1395](https://github.com/dhis2/app-runtime/issues/1395)) ([8b02fdf](https://github.com/dhis2/app-runtime/commit/8b02fdff62c175a115a68863be456db117c3ea5e))

# [3.12.0-alpha.1](https://github.com/dhis2/app-runtime/compare/v3.11.3...v3.12.0-alpha.1) (2024-11-27)


### Bug Fixes

* **cacheable-section:** synchronously flush recording state for UI consistency ([#1394](https://github.com/dhis2/app-runtime/issues/1394)) ([50d216c](https://github.com/dhis2/app-runtime/commit/50d216cb4b7a98995b327cb997bcf6bbd873ea18))
* **deps:** remove cli-app-scripts peer dep ([7764439](https://github.com/dhis2/app-runtime/commit/776443957cf7bce70d644459b946dc9382dd9103))
* **deps:** update cli-app-scripts for package/types race condition ([7980364](https://github.com/dhis2/app-runtime/commit/79803646c152a805277b123250124a272f178d99))


### Features

* upgrade app-runtime React version to v18 ([#1387](https://github.com/dhis2/app-runtime/issues/1387)) ([0e4a3d5](https://github.com/dhis2/app-runtime/commit/0e4a3d5c0e9cf8884c1a46f32fa0876234b6d765))

## [3.11.3](https://github.com/dhis2/app-runtime/compare/v3.11.2...v3.11.3) (2024-11-19)


Expand Down
7 changes: 4 additions & 3 deletions examples/cra/src/App.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from 'react'
import ReactDOM from 'react-dom'
import { createRoot } from 'react-dom/client'
import App from './App'

it('renders without crashing', () => {
const div = document.createElement('div')
ReactDOM.render(<App />, div)
ReactDOM.unmountComponentAtNode(div)
const root = createRoot(div)
root.render(<App />, div)
root.unmount()
})
6 changes: 4 additions & 2 deletions examples/cra/src/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import React from 'react'
import ReactDOM from 'react-dom'
import { createRoot } from 'react-dom/client'
import './index.css'
import App from './App'
import * as serviceWorker from './serviceWorker'

ReactDOM.render(<App />, document.getElementById('root'))
const root = createRoot(document.getElementById('root'))

root.render(<App />)

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
Expand Down
29 changes: 19 additions & 10 deletions examples/query-playground/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1820,24 +1820,33 @@
"@dhis2/app-service-offline" "3.10.6"
"@dhis2/app-service-plugin" "3.10.6"

"@dhis2/[email protected]", "@dhis2/app-service-alerts@file:../../services/alerts":
version "3.10.6"
"@dhis2/app-runtime@^2.2.2", "@dhis2/app-runtime@file:../../runtime":
version "3.10.4-alpha.1"
dependencies:
"@dhis2/app-service-alerts" "3.10.4-alpha.1"
"@dhis2/app-service-config" "3.10.4-alpha.1"
"@dhis2/app-service-data" "3.10.4-alpha.1"
"@dhis2/app-service-offline" "3.10.4-alpha.1"
"@dhis2/app-service-plugin" "3.10.4-alpha.1"

"@dhis2/app-service-config@3.10.6", "@dhis2/app-service-config@file:../../services/config":
version "3.10.6"
"@dhis2/app-service-alerts@3.10.4-alpha.1", "@dhis2/app-service-[email protected]", "@dhis2/app-service-alerts@file:../../services/alerts":
version "3.10.4-alpha.1"

"@dhis2/[email protected]", "@dhis2/app-service-data@file:../../services/data":
version "3.10.6"
"@dhis2/[email protected]", "@dhis2/[email protected]", "@dhis2/app-service-config@file:../../services/config":
version "3.10.4-alpha.1"

"@dhis2/[email protected]", "@dhis2/[email protected]", "@dhis2/app-service-data@file:../../services/data":
version "3.10.4-alpha.1"
dependencies:
react-query "^3.13.11"

"@dhis2/[email protected].6", "@dhis2/app-service-offline@file:../../services/offline":
version "3.10.6"
"@dhis2/[email protected].4-alpha.1", "@dhis2/[email protected]", "@dhis2/app-service-offline@file:../../services/offline":
version "3.10.4-alpha.1"
dependencies:
lodash "^4.17.21"

"@dhis2/[email protected].6", "@dhis2/app-service-plugin@file:../../services/plugin":
version "3.10.6"
"@dhis2/[email protected].4-alpha.1", "@dhis2/app-service-plugin@file:../../services/plugin":
version "3.10.4-alpha.1"
dependencies:
post-robot "^10.0.46"

Expand Down
23 changes: 10 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.11.3",
"version": "3.12.0-alpha.2",
"description": "A singular runtime dependency for applications on the DHIS2 platform",
"repository": "https://github.com/dhis2/app-runtime.git",
"author": "Austin McGee <[email protected]>",
Expand All @@ -10,18 +10,16 @@
"services/*"
],
"devDependencies": {
"@dhis2/cli-app-scripts": "^10.2.0",
"@dhis2/cli-style": "^10.4.3",
"@dhis2/cli-app-scripts": "^12.0.0-alpha.25",
"@dhis2/cli-style": "10.4.3",
"@dhis2/cli-utils-docsite": "^2.0.3",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@testing-library/react-hooks": "^7.0.1",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.0.1",
"@types/jest": "^24.9.0",
"@types/lodash": "^4.14.171",
"@types/node": "^13.1.8",
"@types/react": "^16.9.18",
"@types/react-dom": "^16.9.5",
"@types/testing-library__dom": "^7.5.0",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@typescript-eslint/eslint-plugin": "^5.47.0",
"@typescript-eslint/parser": "^5.47.0",
"concurrently": "^5.0.2",
Expand All @@ -31,11 +29,10 @@
"idb": "^6.1.3",
"loop": "^3.3.4",
"prop-types": "^15.7.2",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-test-renderer": "^16.12",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"rimraf": "^3.0.0",
"typescript": "^4.0.5"
"typescript": "^4.9.5"
},
"scripts": {
"install:examples": "loop \"yarn install --force --check-files\" --cwd ./examples --exit-on-aggregate-error",
Expand Down
16 changes: 8 additions & 8 deletions runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@dhis2/app-runtime",
"description": "A singular runtime dependency for applications on the DHIS2 platform",
"version": "3.11.3",
"version": "3.12.0-alpha.2",
"main": "./build/cjs/index.js",
"module": "./build/es/index.js",
"types": "./build/types/index.d.ts",
Expand Down Expand Up @@ -29,16 +29,16 @@
"build/**"
],
"dependencies": {
"@dhis2/app-service-config": "3.11.3",
"@dhis2/app-service-data": "3.11.3",
"@dhis2/app-service-alerts": "3.11.3",
"@dhis2/app-service-offline": "3.11.3",
"@dhis2/app-service-plugin": "3.11.3"
"@dhis2/app-service-config": "3.12.0-alpha.2",
"@dhis2/app-service-data": "3.12.0-alpha.2",
"@dhis2/app-service-alerts": "3.12.0-alpha.2",
"@dhis2/app-service-offline": "3.12.0-alpha.2",
"@dhis2/app-service-plugin": "3.12.0-alpha.2"
},
"peerDependencies": {
"prop-types": "^15.7.2",
"react": "^16.8.6",
"react-dom": "^16.8.6"
"react": "^16.8.6 || ^18",
"react-dom": "^16.8.6 || ^18"
},
"scripts": {
"build:types": "tsc --emitDeclarationOnly --outDir ./build/types",
Expand Down
6 changes: 3 additions & 3 deletions services/alerts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2/app-service-alerts",
"version": "3.11.3",
"version": "3.12.0-alpha.2",
"main": "./build/cjs/index.js",
"module": "./build/es/index.js",
"types": "./build/types/index.d.ts",
Expand All @@ -23,8 +23,8 @@
],
"peerDependencies": {
"prop-types": "^15.7.2",
"react": "^16.8.6",
"react-dom": "^16.8.6"
"react": "^16.8.6 || ^18",
"react-dom": "^16.8.6 || ^18"
},
"scripts": {
"clean": "rimraf ./build/*",
Expand Down
2 changes: 1 addition & 1 deletion services/alerts/src/__tests__/integration.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { renderHook, act } from '@testing-library/react-hooks'
import { renderHook, act } from '@testing-library/react'
import React, { ReactNode } from 'react'
import { AlertsProvider, useAlerts, useAlert } from '../index'

Expand Down
2 changes: 1 addition & 1 deletion services/alerts/src/__tests__/useAlert.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { renderHook } from '@testing-library/react-hooks'
import { renderHook } from '@testing-library/react'
import React, { ReactNode } from 'react'
import { AlertsProvider, useAlert } from '../index'

Expand Down
2 changes: 1 addition & 1 deletion services/alerts/src/__tests__/useAlerts.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { renderHook } from '@testing-library/react-hooks'
import { renderHook } from '@testing-library/react'
import React, { ReactNode } from 'react'
import { AlertsProvider, useAlerts } from '../index'

Expand Down
2 changes: 1 addition & 1 deletion services/alerts/src/setupRTL.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '@testing-library/jest-dom/extend-expect'
import '@testing-library/jest-dom'

process.on('unhandledRejection', (err) => {
throw err
Expand Down
2 changes: 1 addition & 1 deletion services/alerts/src/useAlert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const useAlert = (
const alertRef = useRef(<Alert | null>null)

const show = useCallback(
(props?) => {
(props?: any) => {
const resolvedMessage = String(
typeof message === 'function' ? message(props) : message
)
Expand Down
6 changes: 3 additions & 3 deletions services/config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2/app-service-config",
"version": "3.11.3",
"version": "3.12.0-alpha.2",
"main": "./build/cjs/index.js",
"module": "./build/es/index.js",
"types": "build/types/index.d.ts",
Expand All @@ -23,8 +23,8 @@
],
"peerDependencies": {
"prop-types": "^15.7.2",
"react": "^16.8.6",
"react-dom": "^16.8.6"
"react": "^16.8.6 || ^18",
"react-dom": "^16.8.6 || ^18"
},
"scripts": {
"clean": "rimraf ./build/*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { renderHook } from '@testing-library/react-hooks'
import { renderHook } from '@testing-library/react'
import React, { ReactNode } from 'react'
import { ConfigProvider, useTimeZoneConversion } from '../index'

Expand Down
2 changes: 1 addition & 1 deletion services/config/src/setupRTL.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '@testing-library/jest-dom/extend-expect'
import '@testing-library/jest-dom'

process.on('unhandledRejection', (err) => {
throw err
Expand Down
2 changes: 1 addition & 1 deletion services/config/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export type Version = {
tag?: string
}

export type DateInput = string | Date | number | null
export type DateInput = string | Date | number | null | undefined

interface SystemInfo {
version: string
Expand Down
4 changes: 2 additions & 2 deletions services/config/src/useTimeZoneConversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export const useTimeZoneConversion = (): {
)

const fromServerDate = useCallback(
(date) => {
(date: DateInput) => {
const jsServerDate = date ? new Date(date) : new Date(Date.now())
const offset = shouldCalculateOffset
? calculateOffset(jsServerDate, serverTimezone)
Expand All @@ -146,7 +146,7 @@ export const useTimeZoneConversion = (): {
)

const fromClientDate = useCallback(
(date) => {
(date: DateInput) => {
const jsClientDate = date ? new Date(date) : new Date(Date.now())
const offset = shouldCalculateOffset
? calculateOffset(jsClientDate, serverTimezone)
Expand Down
Loading

0 comments on commit 5075ec0

Please sign in to comment.