Skip to content

Commit

Permalink
Merge branch '958-update-yarn' into publish-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
peterMuriuki committed Apr 11, 2022
2 parents e9788e6 + b392bde commit 36169f0
Show file tree
Hide file tree
Showing 43 changed files with 3,564 additions and 3,252 deletions.
14 changes: 13 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
environment:
SKIP_PREFLIGHT_CHECK: 'true'
GENERATE_SOURCEMAP: 'false'
NODE_OPTIONS: '--max-old-space-size=4096'

working_directory: ~/web

Expand All @@ -25,14 +26,24 @@ jobs:
- web-{{ .Environment.CACHE_VERSION }}-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- web-{{ .Environment.CACHE_VERSION }}-dependencies-
- run:
command: |
while true; do
sleep 5
# NOTE: on MacOS, the f argument is not supported.
# In this case, you can drop the f argument instead.
ps auxwwf
echo "======"
done
background: true

- run:
name: Install dependencies
command: yarn install

- run:
name: build packages
command: yarn lerna:prepublish --concurrency=2
command: export NODE_OPTIONS="--max-old-space-size=8192" && yarn lerna:prepublish --concurrency=1

- save_cache:
paths:
Expand All @@ -50,3 +61,4 @@ jobs:
- run:
name: upload coverage to coveralls
command: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,11 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
546 changes: 546 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

1,260 changes: 630 additions & 630 deletions .yarn/releases/yarn-1.18.0.cjs

Large diffs are not rendered by default.

57 changes: 29 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,49 @@ The goal of OpenSRP Web is to be the default frontend for the [OpenSRP Server](h
the data collected on the server, configuration options as well as any
functionality provided by the API server.

The initial priorities are to support:
This repository is divided into 2 [workTrees](https://yarnpkg.com/features/workspaces), the first contains the actual react application workspace `app`, the second contain the different workspace packages that `app` consumes.

1. Authentication through Keycloak
2. User management - pull some functionality, not all, that currently can be achieved by Keycloak.
3. Team management
4. Jurisdiction/Location management: user or team assignment,
## Run the app

The hope is to build on the work done on other attempts so far.
```sh
# create a .env file in the repo/app folder, you can copy the .env.sample and then override its values
# cp app/.env.sample app/.env

This repository intends to be a monorepo of all components that you will use
to provide all the functionality for an OpenSRP frontend UI.
# Build the packages, this involves generating their type definitions and transpiling using babel to cjs
yarn lerna:prepublish

## Code
# start the react app
yarn start
```

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts
**Gotcha**

In the project directory, you can run:
<details>
<summary>Skip preflight check error on yarn start</summary>

** Error: **
If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.

### `yarn start`
** Fix **
Make sure you have added the .env file in the app folder, and has the SKIP_PREFLIGHT_CHECK=true env

Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
</details>

The page will reload if you make edits.<br />
You will also see any lint errors in the console.
You can get the list of all configurable envs, their descriptions and sane defaults in the [env docs file](docs/env.md)

### `yarn test`
## setting up with docker

Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
TBD

### `yarn build`
## Testing

Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.
```sh
yarn lerna:prepublish
yarn test
```

The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Contributing

Expand Down
19 changes: 11 additions & 8 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.10",
"private": true,
"dependencies": {
"@2fd/ant-design-icons": "^2.5.0",
"@ant-design/icons": "^4.2.2",
"@fortawesome/fontawesome-svg-core": "^1.2.30",
"@fortawesome/free-brands-svg-icons": "^5.14.0",
Expand All @@ -17,33 +18,36 @@
"@onaio/redux-reducer-registry": "^0.0.9",
"@onaio/session-reducer": "^0.0.12",
"@onaio/utils": "^0.0.1",
"@opensrp/ant-icons": "^0.0.1",
"@opensrp/card-support": "^0.0.9",
"@opensrp/error-boundary-fallback": "^0.0.7",
"@opensrp/fhir-care-team": "^0.0.1",
"@opensrp/fhir-group-management": "^0.0.5",
"@opensrp/fhir-healthcare-service": "^0.0.1",
"@opensrp/fhir-location-management": "^0.0.1",
"@opensrp/form-config-antd": "^0.0.4",
"@opensrp/fhir-views": "^0.0.0",
"@opensrp/fhir-quest-form": "^0.0.0",
"@opensrp/fhir-team-management": "^0.0.5",
"@opensrp/fhir-views": "^0.0.0",
"@opensrp/form-config-antd": "^0.0.4",
"@opensrp/inventory": "^0.0.9",
"@opensrp/keycloak-service": "^0.0.17",
"@opensrp/location-management": "^0.0.15",
"@opensrp/location-settings": "^0.0.1",
"@opensrp/notifications": "^0.0.5",
"@opensrp/pkg-config": "^0.0.9",
"@opensrp/plan-form": "^0.0.4",
"@opensrp/plan-form-core": "^0.0.4",
"@opensrp/plans": "^0.0.10",
"@opensrp/product-catalogue": "^0.0.9",
"@opensrp/react-utils": "^0.0.12",
"@opensrp/reducer-factory": "^0.0.13",
"@opensrp/server-logout": "^0.0.1",
"@opensrp/server-service": "^0.0.16",
"@opensrp/store": "^0.0.10",
"@opensrp/fhir-team-management": "^0.0.5",
"@opensrp/team-assignment": "^0.0.6",
"@opensrp/team-management": "^0.0.9",
"@opensrp/user-management": "^0.1.19",
"@opensrp/fhir-healthcare-service": "^0.0.1",
"@opensrp/fhir-group-management": "^0.0.5",
"@sentry/react": "^5.27.4",
"@smile-cdr/fhirts": "1.2.5",
"antd": "^4.6.3",
"bootstrap": "^4.5.2",
"client-oauth2": "^4.3.3",
Expand All @@ -57,9 +61,8 @@
"jsdom-global": "^3.0.2",
"lodash": "^4.17.20",
"react-i18next": "^11.8.10",
"@smile-cdr/fhirts": "1.2.5",
"react-query": "^3.15.1",
"react-scripts": "3.4.3",
"react-scripts": "4.0.3",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"reselect": "^4.0.0",
Expand Down
4 changes: 2 additions & 2 deletions app/src/routes.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { store } from '@opensrp/store';
import { authenticateUser } from '@onaio/session-reducer';
import { filterFalsyRoutes, getRoutes } from './routes';
import React from 'react';
import MapMarkerOutlineIcon from '@opensrp/ant-icons/lib/MapMarkerOutline';
import MapMarkerOutlineIcon from '@2fd/ant-design-icons/lib/MapMarkerOutline';
import { DashboardOutlined, IdcardOutlined } from '@ant-design/icons';
import ArchiveOutlineIcon from '@opensrp/ant-icons/lib/ArchiveOutline';
import ArchiveOutlineIcon from '@2fd/ant-design-icons/lib/ArchiveOutline';

jest.mock('./configs/env');

Expand Down
4 changes: 2 additions & 2 deletions app/src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
} from '@opensrp/plans';
import { isAuthorized } from '@opensrp/react-utils';
import { CATALOGUE_LIST_VIEW_URL } from '@opensrp/product-catalogue';
import ArchiveOutline from '@opensrp/ant-icons/lib/ArchiveOutline';
import MapMarkerOutline from '@opensrp/ant-icons/lib/MapMarkerOutline';
import ArchiveOutline from '@2fd/ant-design-icons/lib/ArchiveOutline';
import MapMarkerOutline from '@2fd/ant-design-icons/lib/MapMarkerOutline';
import {
ENABLE_PLANS,
ENABLE_INVENTORY,
Expand Down
13 changes: 10 additions & 3 deletions app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"compilerOptions": {
"target": "esnext",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
Expand All @@ -13,7 +17,10 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve"
"jsx": "react-jsx",
"noFallthroughCasesInSwitch": true
},
"include": ["src"]
"include": [
"src"
]
}
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@
"lerna": "^4.0.0",
"lint-staged": "^12.2.1",
"mockdate": "^3.0.5",
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0",
"prettier": "^2.5.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand All @@ -118,15 +120,12 @@
"redux-mock-store": "^1.5.4",
"redux-testkit": "^1.0.6",
"redux-thunk": "^2.4.1",
"tsd": "^0.19.1",
"typescript": "~4.5.4"
},
"workspaces": [
"app",
"packages/*"
],
"dependencies": {
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0",
"tsd": "^0.19.1"
}
"packageManager": "[email protected]"
}
14 changes: 9 additions & 5 deletions packages/card-support/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,22 @@
"@opensrp/store": "^0.0.10",
"antd": "^4.6.3",
"i18next": "^19.8.4",
"react": "^16.18.1"
"react": "^16.18.1",
"react-query": "^3.15.1",
"react-router": "^5.2.1",
"react-router-dom": "^5.2.1"
},
"dependencies": {
"@ant-design/icons": "^4.2.2",
"@onaio/redux-reducer-registry": "^0.0.9",
"@onaio/session-reducer": "^0.0.13",
"@onaio/utils": "^0.0.1",
"@opensrp/location-management": "^0.0.15",
"@opensrp/notifications": "^0.0.5",
"@opensrp/pkg-config": "^0.0.9",
"@opensrp/react-utils": "^0.0.12",
"@opensrp/reducer-factory": "^0.0.9",
"@opensrp/server-service": "^0.0.16",
"@opensrp/reducer-factory": "^0.0.13",
"@opensrp/server-service": "^0.0.17",
"papaparse": "^5.3.0",
"react-i18next": "^11.8.10"
},
Expand All @@ -56,6 +61,5 @@
"i18next-parser": "^3.5.0"
},
"author": "OpenSRP Engineering",
"license": "Apache-2.0",
"private": false
"license": "Apache-2.0"
}
4 changes: 2 additions & 2 deletions packages/error-boundary-fallback/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"react": "^16.13.1"
},
"dependencies": {
"@onaio/utils": "^0.0.1",
"@opensrp/pkg-config": "^0.0.9",
"@opensrp/react-utils": "^0.0.12",
"react-i18next": "^11.8.10"
Expand All @@ -43,6 +44,5 @@
"i18next-parser": "^3.5.0"
},
"author": "OpenSRP Engineering",
"license": "Apache-2.0",
"private": false
"license": "Apache-2.0"
}
12 changes: 9 additions & 3 deletions packages/fhir-care-team/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,31 @@
},
"author": "OpenSRP Engineering",
"license": "Apache-2.0",
"private": false,
"dependencies": {
"@ant-design/icons": "^4.7.0",
"@onaio/utils": "^0.0.1",
"@opensrp/notifications": "^0.0.4",
"@opensrp/pkg-config": "^0.0.9",
"@opensrp/react-utils": "^0.0.12",
"@smile-cdr/fhirts": "^1.2.5",
"antd": "^4.19.5",
"fhirclient": "^2.4.0",
"lodash": "^4.17.21",
"react-helmet": "^6.1.0",
"react-i18next": "^11.8.10",
"uuid": "^8.3.1"
},
"devDependencies": {
"@onaio/utils": "^0.0.1",
"@types/uuid": "8.3.0",
"i18next-parser": "^3.5.0",
"nock": "^13.0.6"
},
"peerDependencies": {
"i18next": "^19.8.4",
"react": "^16.13.1",
"react-query": "^3.15.1"
"react-query": "^3.15.1",
"react-redux": "^7.1.22",
"react-router": "^5.2.1",
"react-router-dom": "^5.2.1"
}
}
22 changes: 14 additions & 8 deletions packages/fhir-healthcare-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,29 @@
},
"author": "OpenSRP Engineering",
"license": "Apache-2.0",
"private": false,
"dependencies": {
"@ant-design/icons": "^4.7.0",
"@opensrp/fhir-team-management": "^0.0.5",
"@opensrp/notifications": "^0.0.5",
"@opensrp/react-utils": "^0.0.12",
"uuid": "^8.3.1",
"@opensrp/pkg-config": "^0.0.9",
"@opensrp/fhir-team-management": "^0.0.5"
"@opensrp/react-utils": "^0.0.12",
"react-helmet": "^6.1.0",
"uuid": "^8.3.1"
},
"devDependencies": {
"@smile-cdr/fhirts": "1.2.5",
"@types/antd": "^1.0.0",
"@types/uuid": "8.3.1",
"@smile-cdr/fhirts": "1.2.5"
"@types/uuid": "8.3.1"
},
"peerDependencies": {
"react-i18next": "^11.8.10",
"antd": "^4.6.3",
"i18next": "^19.8.4",
"react": "^16.13.1"
"lodash": "4.17.21",
"react": "^16.13.1",
"react-i18next": "^11.8.10",
"react-query": "^3.15.1",
"react-redux": "^7.1.22",
"react-router": "^5.2.1",
"react-router-dom": "^5.2.1"
}
}
Loading

0 comments on commit 36169f0

Please sign in to comment.