Skip to content

Commit

Permalink
Update dependencies (#313)
Browse files Browse the repository at this point in the history
* (chore) lint and deps updates
* (deps) bump pretty-quick dependency
* (deps) fix deps resolutions
* Update build.yml
* Update release.yml
* yarn lock update

---------

Co-authored-by: Jose Francisco <[email protected]>
Co-authored-by: Frédéric Deniger - ICRC <[email protected]>
Co-authored-by: Fred Deniger <[email protected]>
  • Loading branch information
4 people authored Oct 31, 2024
1 parent e061d38 commit b636d0d
Show file tree
Hide file tree
Showing 19 changed files with 8,700 additions and 7,703 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module.exports = {
"eslint:recommended",
"ts-react-important-stuff",
"plugin:prettier/recommended",
'react-app',
'plugin:@typescript-eslint/recommended',
],
"parser": "@typescript-eslint/parser",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18.x"
node-version: "21.x"
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18.x"
node-version: "21.x"
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'
registry-url: "https://registry.npmjs.org"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@ dist/
!.yarn/releases
!.yarn/sdks
!.yarn/versions
/.idea/
894 changes: 0 additions & 894 deletions .yarn/releases/yarn-4.2.2.cjs

This file was deleted.

934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.5.1.cjs

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ enableStrictSsl: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.2.2.cjs
yarnPath: .yarn/releases/yarn-4.5.1.cjs

enableTelemetry: false
90 changes: 48 additions & 42 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,17 @@
"url": "https://github.com/icrc/openmrs-esm-patient-grid-app/issues"
},
"resolutions": {
"ejs": "^3.1.7",
"ejs": "^3.1.10",
"jpeg-js": "^0.4.4",
"path-to-regexp": "6.3.0"
"path-to-regexp": "6.3.0",
"http-proxy-middleware": "2.0.7",
"rollup": "2.79.2",
"ws": "^8.18.0",
"semver": "^7.6.0",
"express": "^4.20.0",
"phin": "^3.7.1",
"axios": "^0.28.0",
"cookie": "^0.7.1"
},
"peerDependencies": {
"@carbon/react": "^1.9.0",
Expand All @@ -54,54 +62,52 @@
},
"devDependencies": {
"@carbon/react": "^1.9.0",
"@openmrs/esm-framework": "next",
"@swc/core": "^1.2.244",
"@swc/jest": "^0.2.22",
"@tanstack/react-table": "8.x",
"@testing-library/dom": "^8.20.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/jest": "^28.1.7",
"@types/lodash-es": "^4.17.6",
"@types/react-dom": "^18.0.6",
"@openmrs/esm-framework": "^5.8.2-pre.2430",
"@swc/core": "^1.7.40",
"@swc/jest": "^0.2.37",
"@tanstack/react-table": "^8.20.5",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.2",
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.14",
"@types/lodash-es": "^4.17.12",
"@types/react-dom": "^18.3.1",
"@types/react-router-dom": "^5.3.3",
"@types/testing-library__jest-dom": "^5.14.5",
"@types/webpack-env": "^1.16.0",
"@typescript-eslint/parser": "^5.14.0",
"babel-eslint": "^10.1.0",
"babel-preset-minify": "^0.5.1",
"concurrently": "^6.2.0",
"css-loader": "^6.8.1",
"eslint": "^8.20.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-react-app": "^7.0.1",
"@types/webpack-env": "^1.18.5",
"@typescript-eslint/eslint-plugin": "^8.12.2",
"@typescript-eslint/parser": "^8.12.2",
"babel-preset-minify": "^0.5.2",
"concurrently": "^9.0.1",
"css-loader": "^7.1.2",
"eslint": "8.57.0",
"eslint-config-prettier": "^8.10.0",
"eslint-config-ts-react-important-stuff": "^3.0.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.1",
"eslint-plugin-prettier": "^5.2.1",
"husky": "^9.1.6",
"identity-obj-proxy": "^3.0.0",
"jest": "^28.1.3",
"jest-cli": "^29.3.1",
"jest-environment-jsdom": "^29.4.0",
"jest": "^29.7.0",
"jest-cli": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lodash-es": "^4.17.21",
"openmrs": "next",
"prettier": "^2.3.0",
"pretty-quick": "^3.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "^11.18.4",
"react-router-dom": "^6.3.0",
"swc-loader": "^0.2.3",
"swr": "^1.3.0",
"openmrs": "^5.8.2-pre.2430",
"prettier": "^3.3.3",
"pretty-quick": "^4.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-i18next": "^15.1.0",
"react-router-dom": "^6.27.0",
"swc-loader": "^0.2.6",
"swr": "^2.2.5",
"typescript": "^4.8.2",
"webpack": "^5.94.0",
"webpack": "^5.95.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.2",
"webpack-dev-server": "^5.1.0",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.18.12/xlsx-0.18.12.tgz"
},
"packageManager": "yarn@4.2.2",
"packageManager": "yarn@4.5.1",
"dependencies": {
"i18next": "^21.10.0",
"i18next-parser": "^6.6.0"
"i18next": "^23.16.4",
"i18next-parser": "^9.0.2"
}
}
2 changes: 1 addition & 1 deletion src/api/concept.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { openmrsFetch, OpenmrsResource } from '@openmrs/esm-framework';
import useSWRImmutable from 'swr/immutable';
import { FetchAllResponse } from './shared';

// eslint-disable-next-line @typescript-eslint/no-empty-interface
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export interface ConceptGet extends OpenmrsResource {}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/api/useMergedSwr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ export function useMergedSwr<T>(
const error = swrResponses.find((res) => res.error);
const mutate = () => Promise.all(swrResponses.map((res) => res.mutate())).then(mergeRef.current);
const isValidating = swrResponses.some((res) => res.isValidating);

const isLoading = isValidating;
return {
data,
error,
mutate,
isValidating,
isLoading,
};
}, [mergeRef, ...swrResponses.flatMap((res) => [res.data, res.error, res.isValidating]), ...deps]);
}
4 changes: 2 additions & 2 deletions src/grid-utils/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function getPatientGridDownloadReportData(
groups.forEach((group) => {
const encountersData: Array<Array<string>> = [];
result.push({ header: group.header, data: encountersData });
group.sections.forEach((section, sectionIndex) => {
group.sections.forEach((section) => {
section.columns.forEach((column, columnIndex) => {
encountersData[0] = encountersData[0] || [];
encountersData[0].push(columnIndex === 0 ? section.header : '');
Expand Down Expand Up @@ -271,7 +271,7 @@ function getGroups(
section.columns.push(column);
}

filteredEncounters.forEach((thisColumnEncounter, index) => {
filteredEncounters.forEach((thisColumnEncounter) => {
if (question.type === 'encounterDatetime') {
const date = thisColumnEncounter[getFormDateColumnName(form)];
column.values.push(formatDate(new Date(date)));
Expand Down
2 changes: 1 addition & 1 deletion src/patient-grid-details/PatientGridDetailsHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function PatientGridDetailsHeader({
title={
<h1 className={styles.title}>
{patientGrid ? (
patientGrid?.description ?? patientGrid?.name ?? t('patientGridDetailsHeaderTitleFallback', '--')
(patientGrid?.description ?? patientGrid?.name ?? t('patientGridDetailsHeaderTitleFallback', '--'))
) : (
<SkeletonText width="30%" />
)}
Expand Down
2 changes: 1 addition & 1 deletion src/patient-grid-details/PatientGridFiltersHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface PatientGridFiltersHeaderProps {
refreshGrid(): void;
}

export function PatientGridFiltersHeader({ patientGridId, patientGrid, refreshGrid }: PatientGridFiltersHeaderProps) {
export function PatientGridFiltersHeader({ refreshGrid }: PatientGridFiltersHeaderProps) {
const { t } = useTranslation();
// const { data: columnNameToHeaderLabelMap } = useColumnNameToHeaderLabelMap();
const { filters, saveChanges } = useContext(InlinePatientGridEditingContext);
Expand Down
2 changes: 1 addition & 1 deletion src/patient-grid-details/useHistoricEncountersGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ function obsToDisplayString(obs: PastEncounterObsGet[]) {
const valuesArray = obs.map((obs) => obs.value);
return valuesArray
.filter((value) => value !== null && value !== undefined)
.map((value) => (typeof value === 'object' ? value.display ?? '' : `${value}`))
.map((value) => (typeof value === 'object' ? (value.display ?? '') : `${value}`))
.join(', ');
}
3 changes: 2 additions & 1 deletion src/patient-grid-details/usePatientGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import {
getAllReportColumnNames,
LocalFilter,
} from '../grid-utils';
import { TFunction, useTranslation } from 'react-i18next';
import { useTranslation } from 'react-i18next';
import { TFunction } from 'i18next';
import { getLocallyFilteredReportRows } from '../grid-utils/localRowFiltering';
import { formatDate, useConfig } from '@openmrs/esm-framework';
import { Config } from '../config-schema';
Expand Down
8 changes: 2 additions & 6 deletions src/patient-grids-overview/PatientGridBuilderFiltersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ export function PatientGridBuilderFiltersPage({ page, pages, goToPrevious, state
}))
}>
<SelectItem value="" text={t('patientGridDetailsCountryPlaceholder', 'Country')} />
{countryLocations?.map(({ id, name }) => (
<SelectItem key={id} value={id} text={name} />
))}
{countryLocations?.map(({ id, name }) => <SelectItem key={id} value={id} text={name} />)}
</Select>
) : (
<SelectSkeleton />
Expand All @@ -120,9 +118,7 @@ export function PatientGridBuilderFiltersPage({ page, pages, goToPrevious, state
}))
}>
<SelectItem value="" text={t('patientGridDetailsStructurePlaceholder', 'Structure')} />
{structureLocations?.map(({ id, name }) => (
<SelectItem key={id} value={id} text={name} />
))}
{structureLocations?.map(({ id, name }) => <SelectItem key={id} value={id} text={name} />)}
</Select>
) : (
<SelectSkeleton />
Expand Down
2 changes: 1 addition & 1 deletion src/setup-tests.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import '@testing-library/jest-dom/extend-expect';
import '@testing-library/jest-dom';
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"es2015.promise",
"es2016.array.include",
"es2018",
"es2020"
"es2020",
"es2022"
],
"resolveJsonModule": true,
"noEmit": true,
Expand Down
Loading

0 comments on commit b636d0d

Please sign in to comment.