Skip to content

Commit

Permalink
(chore) Bump dependencies and update lint tooling (#1374)
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen authored Sep 28, 2023
1 parent 28ecc51 commit c42d21c
Show file tree
Hide file tree
Showing 62 changed files with 4,849 additions and 3,929 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
src/**/*.test.tsx
src/**/*.spec.tsx
**/*.d.ts
**/node_modules/**/*
**/node_modules/**/*
__mocks__/*
23 changes: 19 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
{
"env": {
"node": true
},
"extends": ["eslint:recommended", "plugin:prettier/recommended", "plugin:@typescript-eslint/recommended", "prettier"],
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": ["ts-react-important-stuff", "plugin:prettier/recommended"],
"plugins": ["@typescript-eslint"],
"rules": {
// Disabling these rules for now just to keep the diff small. I'll enable them in a future PR that fixes lint issues.
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-types": "off",
"prefer-const": "off",
"no-unsafe-optional-chaining": "off",
"no-explicit-any": "off",
"no-extra-boolean-cast": "off",
"no-prototype-builtins": "off",
"no-useless-escape": "off",
"no-restricted-imports": [
"error",
{
"paths": [
// These two rules ensure that we're importing lodash and lodash-es correctly. Not doing so can bloat our bundle size significantly.
{
"name": "lodash",
"message": "Import specific methods from `lodash`. e.g. `import map from 'lodash/map'`"
Expand All @@ -18,6 +32,7 @@
"importNames": ["default"],
"message": "Import specific methods from `lodash-es`. e.g. `import { map } from 'lodash-es'`"
},
// These two rules ensure that we're importing Carbon components and icons from the correct packages (after v10). May be removed in the future.
{
"name": "carbon-components-react",
"message": "Import from `@carbon/react` directly. e.g. `import { Toggle } from '@carbon/react'`"
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@

set -e # die on error

yarn prettier && npx lint-staged
yarn turbo run extract-translations
1 change: 0 additions & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@

set -e # die on error

yarn pretty-quick --staged
yarn verify
402 changes: 201 additions & 201 deletions .yarn/releases/yarn-3.6.1.cjs → .yarn/releases/yarn-3.6.3.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

yarnPath: .yarn/releases/yarn-3.6.1.cjs
yarnPath: .yarn/releases/yarn-3.6.3.cjs
6 changes: 2 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/**
* @returns {Promise<import('jest').Config>}
*/

/** @type {import('jest').Config} */
// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require('path');

module.exports = {
Expand Down
84 changes: 44 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,74 +9,78 @@
"ci:publish": "lerna publish from-package --yes",
"ci:prepublish": "lerna publish from-package --no-git-reset --yes --dist-tag next",
"release": "lerna version --no-git-tag-version",
"verify": "turbo lint && turbo typescript && turbo test --color --concurrency=5",
"verify": "turbo lint typescript test --color --concurrency=5",
"prettier": "prettier --config prettier.config.js --write \"packages/**/*.{ts,tsx,css,scss}\" \"e2e/**/*.ts\"",
"postinstall": "husky install",
"ci:bump-form-engine-lib": "yarn up @openmrs/openmrs-form-engine-lib@next",
"test-e2e": "playwright test"
},
"devDependencies": {
"@openmrs/esm-framework": "next",
"@playwright/test": "^1.30.0",
"@swc/cli": "^0.1.57",
"@swc/core": "^1.2.165",
"@swc/jest": "^0.2.21",
"@testing-library/dom": "^8.16.0",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^14.2.1",
"@types/jest": "^28.1.4",
"@types/lodash-es": "^4.17.3",
"@types/react": "^18.0.14",
"@types/react-dom": "^18.0.5",
"@types/testing-library__jest-dom": "^5.14.1",
"@types/webpack-env": "^1.16.0",
"@typescript-eslint/eslint-plugin": "^4.15.1",
"@typescript-eslint/parser": "^5.18.0",
"babel-preset-minify": "^0.5.1",
"concurrently": "^6.5.1",
"@playwright/test": "^1.38.1",
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.89",
"@swc/jest": "^0.2.29",
"@testing-library/dom": "^9.3.3",
"@testing-library/jest-dom": "^6.1.3",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.5.1",
"@types/fhir": "^0.0.31",
"@types/jest": "^29.5.5",
"@types/lodash-es": "^4.17.9",
"@types/react": "^18.2.22",
"@types/react-dom": "^18.2.7",
"@types/webpack-env": "^1.18.2",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"babel-preset-minify": "^0.5.2",
"concurrently": "^8.2.1",
"cross-env": "^7.0.3",
"css-loader": "^6.6.0",
"d3-selection": "^3.0.0",
"dayjs": "^1.8.36",
"dotenv": "^16.0.3",
"eslint": "^7.20.0",
"eslint-config-prettier": "^8.2.0",
"dayjs": "^1.11.10",
"dotenv": "^16.3.1",
"eslint": "^8.50.0",
"eslint-config-prettier": "^9.0.0",
"eslint-config-ts-react-important-stuff": "^3.0.0",
"eslint-plugin-prettier": "^3.3.1",
"husky": "^8.0.1",
"eslint-plugin-playwright": "^0.16.0",
"eslint-plugin-prettier": "^5.0.0",
"husky": "^8.0.3",
"i18next": "^19.7.0",
"i18next-parser": "^5.4.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^28.1.2",
"jest-cli": "^28.1.2",
"jest-environment-jsdom": "^28.1.2",
"lerna": "^4.0.0",
"jest": "^29.7.0",
"jest-cli": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lerna": "^7.3.0",
"lint-staged": "^14.0.1",
"lodash": "^4.17.21",
"openmrs": "next",
"prettier": "^2.2.1",
"pretty-quick": "^2.0.2",
"prettier": "^3.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "^11.18.6",
"react-router-dom": "^6.3.0",
"rxjs": "^6.6.3",
"react-router-dom": "^6.16.0",
"rxjs": "^6.6.7",
"sass": "^1.54.3",
"swc-loader": "^0.2.3",
"swr": "^2.2.1",
"turbo": "^1.5.5",
"swr": "^2.2.4",
"turbo": "^1.10.14",
"typescript": "^4.0.3",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.10.1"
"webpack-dev-server": "^4.15.1"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": "eslint --cache --fix"
},
"resolutions": {
"sass": "^1.54.3"
},
"packageManager": "[email protected].1",
"packageManager": "[email protected].3",
"dependencies": {
"@hookform/resolvers": "^3.1.1",
"react-hook-form": "^7.45.1",
"@hookform/resolvers": "^3.3.1",
"react-hook-form": "^7.46.2",
"react-to-print": "^2.14.13",
"zod": "^3.21.4"
"zod": "^3.22.2"
}
}
8 changes: 4 additions & 4 deletions packages/esm-form-engine-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "openmrs develop",
"serve": "webpack serve --mode=development",
"debug": "npm run serve",
"build": "webpack --mode production",
"build": "webpack --mode production --color",
"analyze": "webpack --mode=production --env analyze=true",
"lint": "cross-env TIMING=1 eslint src --ext tsx,ts --fix --max-warnings=0",
"test": "cross-env TZ=UTC jest --config jest.config.js --verbose false --passWithNoTests --color",
Expand Down Expand Up @@ -39,8 +39,8 @@
"dependencies": {
"@carbon/react": "^1.12.0",
"@openmrs/openmrs-form-engine-lib": "next",
"lodash-es": "^4.17.15",
"react-error-boundary": "^4.0.3"
"lodash-es": "^4.17.21",
"react-error-boundary": "^4.0.11"
},
"peerDependencies": {
"@openmrs/esm-framework": "5.x",
Expand All @@ -51,6 +51,6 @@
"react-router-dom": "6.x"
},
"devDependencies": {
"webpack": "^5.74.0"
"webpack": "^5.88.2"
}
}
34 changes: 17 additions & 17 deletions packages/esm-form-entry-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@
},
"dependencies": {
"@angular-extensions/elements": "12.6.0",
"@angular/animations": "~12.2.16",
"@angular/animations": "~12.2.17",
"@angular/cdk": "~12.2.13",
"@angular/common": "~12.2.16",
"@angular/compiler": "~12.2.16",
"@angular/core": "~12.2.16",
"@angular/forms": "~12.2.16",
"@angular/platform-browser": "~12.2.16",
"@angular/platform-browser-dynamic": "~12.2.16",
"@angular/router": "~12.2.16",
"@angular/common": "~12.2.17",
"@angular/compiler": "~12.2.17",
"@angular/core": "~12.2.17",
"@angular/forms": "~12.2.17",
"@angular/platform-browser": "~12.2.17",
"@angular/platform-browser-dynamic": "~12.2.17",
"@angular/router": "~12.2.17",
"@carbon/styles": "~1.14.0",
"@ng-select/ng-select": "^6.1.0",
"@ngx-translate/core": "^13.0.0",
"@openmrs/ngx-formentry": "next",
"hammerjs": "^2.0.8",
"jspdf": "^1.5.3",
"moment": "^2.17.1",
"moment": "^2.29.4",
"ngx-bootstrap": "^6.0.0",
"ngx-file-uploader-openmrs": "^1.0.1",
"ngx-webcam": "^0.3.2",
Expand All @@ -70,17 +70,17 @@
"single-spa": "5.x"
},
"devDependencies": {
"@angular-architects/module-federation": "^12.5.0",
"@angular-architects/module-federation": "^12.5.3",
"@angular-devkit/build-angular": "~12.2.18",
"@angular/cli": "~12.2.18",
"@angular/compiler-cli": "~12.2.16",
"@angular/language-service": "~12.2.16",
"@angular/localize": "~12.2.16",
"@angular/compiler-cli": "~12.2.17",
"@angular/language-service": "~12.2.17",
"@angular/localize": "~12.2.17",
"@openmrs/esm-framework": "next",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/webpack-env": "^1.17.0",
"codelyzer": "^6.0.0",
"@types/webpack-env": "^1.18.2",
"codelyzer": "^6.0.2",
"copy-webpack-plugin": "^11.0.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
Expand All @@ -91,8 +91,8 @@
"karma-jasmine-html-reporter": "^1.5.0",
"openmrs": "^5.1.0",
"protractor": "~7.0.0",
"rxjs": "6",
"rxjs": "6.6.7",
"style-loader": "2.x",
"webpack": "~5.76.0"
"webpack": "~5.76.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import { TranslateService } from '@ngx-translate/core';

@Injectable()
export class FormSchemaService {
constructor(private formsResourceService: FormResourceService, private translateService: TranslateService) {}
constructor(
private formsResourceService: FormResourceService,
private translateService: TranslateService,
) {}

public getFormSchemaByUuid(formUuid: string, language = 'en'): Observable<FormSchema> {
return forkJoin({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import { WindowRef } from '../window-ref';
export class ConceptResourceService {
public v = 'custom:(uuid,name,conceptClass,setMembers)';

constructor(protected http: HttpClient, protected windowRef: WindowRef) {}
constructor(
protected http: HttpClient,
protected windowRef: WindowRef,
) {}

public getUrl(): string {
return this.windowRef.openmrsRestBase + 'concept';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export class EncounterResourceService {
',visitType:(uuid,name)),' +
'location:ref,encounterType:ref,encounterProviders:(uuid,display,provider:(uuid,display)))';

constructor(protected http: HttpClient, protected windoRef: WindowRef) {}
constructor(
protected http: HttpClient,
protected windoRef: WindowRef,
) {}

public getUrl(): string {
return this.windoRef.openmrsRestBase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import { FormMetadataObject } from '../types';

@Injectable()
export class FormResourceService {
constructor(private http: HttpClient, private windowRef: WindowRef) {}
constructor(
private http: HttpClient,
private windowRef: WindowRef,
) {}
public getFormSchemaByFormUid(uuid: string, v: string = null): Observable<any> {
const url = `${this.windowRef.openmrsRestBase}o3/forms/${uuid}`;
const params: HttpParams = new HttpParams().set('v', v && v.length > 0 ? v : 'default');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ import { Location, ListResult } from '../types';
export class LocationResourceService {
private static readonly v = 'custom:(uuid,display)';

constructor(protected http: HttpClient, protected windowRef: WindowRef) {}
constructor(
protected http: HttpClient,
protected windowRef: WindowRef,
) {}

public getLocationByUuid(uuid: string): Observable<Location | undefined> {
const url = this.getUrl(uuid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import { Person, PersonUpdate } from '../types';
export class PersonResourceService {
public v = 'full';

constructor(protected http: HttpClient, private windowRef: WindowRef) {}
constructor(
protected http: HttpClient,
private windowRef: WindowRef,
) {}

public getUrl(): string {
return this.windowRef.openmrsRestBase + 'person';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ interface ProgramEnrollmentPayload {

@Injectable()
export class ProgramResourceService {
constructor(private httpClient: HttpClient, protected windowRef: WindowRef) {}
constructor(
private httpClient: HttpClient,
protected windowRef: WindowRef,
) {}

private getBaseProgramsUrl(): string {
return `${this.windowRef.nativeWindow.openmrsBase}/ws/rest/v1/programenrollment`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import { Visit } from '../types';
export class VisitResourceService {
public v = 'full';

constructor(protected http: HttpClient, private windowRef: WindowRef) {}
constructor(
protected http: HttpClient,
private windowRef: WindowRef,
) {}

public getUrl(): string {
return this.windowRef.openmrsRestBase + 'visit';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ export class ConceptService {
accept: 'application/json',
});

constructor(private http: HttpClient, private windowRef: WindowRef) {}
constructor(
private http: HttpClient,
private windowRef: WindowRef,
) {}

public searchConceptsByIdentifiers(conceptIdentifiers: Array<string>) {
return of(ConceptService.getConceptReferenceUrls(conceptIdentifiers))
Expand Down
Loading

0 comments on commit c42d21c

Please sign in to comment.