Skip to content

Commit b20a8e6

Browse files
committed
Clean ugandaemr app routes, align exports, and package routes.json for release
1 parent df19ffa commit b20a8e6

5 files changed

Lines changed: 350 additions & 390 deletions

File tree

.github/workflows/node.js.yml

Lines changed: 61 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,18 @@ jobs:
2020

2121
steps:
2222
- uses: actions/checkout@v4
23+
2324
- name: 🟢 Use Node.js
2425
uses: actions/setup-node@v4
2526
with:
2627
node-version: 20
2728
registry-url: "https://registry.npmjs.org"
2829

30+
- name: Enable Corepack
31+
run: |
32+
corepack enable
33+
corepack prepare yarn@4.9.2 --activate
34+
2935
- name: 💾 Cache dependencies
3036
id: cache
3137
uses: actions/cache@v4
@@ -43,8 +49,11 @@ jobs:
4349
repo-token: ${{ secrets.GITHUB_TOKEN }}
4450
server-token: ${{ env.TURBO_TOKEN }}
4551

46-
- run: yarn verify
47-
- run: yarn turbo run build --color --concurrency=5
52+
- name: ✅ Verify
53+
run: yarn verify
54+
55+
- name: 🛠️ Build
56+
run: yarn turbo run build --color --concurrency=5
4857

4958
- name: 📤 Upload Artifacts
5059
uses: actions/upload-artifact@v4
@@ -56,9 +65,7 @@ jobs:
5665

5766
pre_release:
5867
runs-on: ubuntu-latest
59-
6068
needs: build
61-
6269
if: ${{ github.event_name == 'push' }}
6370

6471
steps:
@@ -73,6 +80,11 @@ jobs:
7380
node-version: 20
7481
registry-url: "https://registry.npmjs.org"
7582

83+
- name: Enable Corepack
84+
run: |
85+
corepack enable
86+
corepack prepare yarn@4.9.2 --activate
87+
7688
- name: 💾 Cache dependencies
7789
id: cache
7890
uses: actions/cache@v4
@@ -96,12 +108,28 @@ jobs:
96108
- name: 🛠️ Build
97109
run: yarn turbo run build --color --concurrency=5
98110

99-
- run: git config user.email "<>" && git config user.name "UgandaEMR CI"
100-
- run: git add . && git commit -m "Prerelease version" --no-verify
101-
102-
- run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish --access public --tag next
111+
- name: ✅ Verify package contains routes.json
112+
run: |
113+
yarn pack --out package.tgz
114+
tar -tf package.tgz | grep -E '^package/routes.json$' || (echo "root routes.json missing from tarball" && exit 1)
115+
116+
- name: Commit prerelease version
117+
run: |
118+
git config user.email "<>"
119+
git config user.name "UgandaEMR CI"
120+
git add .
121+
git commit -m "Prerelease version" --no-verify
122+
123+
- name: 🚢 Publish prerelease
124+
run: |
125+
yarn config set npmAuthToken "${NPM_AUTH_TOKEN}"
126+
yarn npm publish --access public --tag next
103127
env:
104-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
128+
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
129+
130+
- name: Cleanup tarball
131+
if: always()
132+
run: rm -f package.tgz
105133

106134
- name: 📤 Upload Artifacts
107135
uses: actions/upload-artifact@v4
@@ -115,16 +143,24 @@ jobs:
115143
runs-on: ubuntu-latest
116144
needs: build
117145
if: ${{ github.event_name == 'release' }}
146+
118147
steps:
119148
- uses: actions/checkout@v4
149+
120150
- name: 📥 Download Artifacts
121151
uses: actions/download-artifact@v4
152+
122153
- name: 🟢 Use Node.js
123154
uses: actions/setup-node@v4
124155
with:
125156
node-version: 20
126157
registry-url: "https://registry.npmjs.org"
127158

159+
- name: Enable Corepack
160+
run: |
161+
corepack enable
162+
corepack prepare yarn@4.9.2 --activate
163+
128164
- name: 💾 Cache dependencies
129165
id: cache
130166
uses: actions/cache@v4
@@ -136,11 +172,24 @@ jobs:
136172
if: steps.cache.outputs.cache-hit != 'true'
137173
run: yarn install --immutable
138174

139-
- run: yarn turbo run build --color
175+
- name: 🛠️ Build
176+
run: yarn turbo run build --color
177+
178+
- name: ✅ Verify package contains routes.json
179+
run: |
180+
yarn pack --out package.tgz
181+
tar -tf package.tgz | grep -E '^package/routes.json$' || (echo "root routes.json missing from tarball" && exit 1)
182+
140183
- name: 🚢 Publish to NPM
141-
run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish --access public
184+
run: |
185+
yarn config set npmAuthToken "${NPM_AUTH_TOKEN}"
186+
yarn npm publish --access public
142187
env:
143-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
188+
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
189+
190+
- name: Cleanup tarball
191+
if: always()
192+
run: rm -f package.tgz
144193

145194
- name: 📤 Upload Artifacts
146195
uses: actions/upload-artifact@v4

.yarn/install-state.gz

192 KB
Binary file not shown.

package.json

Lines changed: 123 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,125 @@
11
{
2-
"name": "@ugandaemr/esm-ugandaemr-app",
3-
"version": "1.0.3",
4-
"license": "MPL-2.0",
5-
"description": "UgandaEMR microfrontend built on top of OpenMRS 3.x and OHRI",
6-
"browser": "dist/esm-ugandaemr-app.js",
7-
"main": "src/index.ts",
8-
"source": true,
9-
"scripts": {
10-
"start": "openmrs develop ",
11-
"serve": "webpack serve --mode=development",
12-
"debug": "npm run serve",
13-
"build": "webpack --mode production",
14-
"analyze": "webpack --mode=production --env.analyze=true",
15-
"lint": "eslint src --ext tsx,ts --fix --max-warnings=0",
16-
"verify": "turbo run lint && turbo run typescript",
17-
"prettier": "prettier --config prettier.config.js --write \"src/**/*.{ts,tsx,css,scss}\"",
18-
"test": "cross-env TZ=UTC jest --config jest.config.json --verbose false --passWithNoTests",
19-
"typescript": "tsc",
20-
"extract-translations": "i18next 'src/**/*.component.tsx' --config ../../tools/i18next-parser.config.js"
21-
},
22-
"browserslist": [
23-
"extends browserslist-config-openmrs"
24-
],
25-
"keywords": [
26-
"openmrs",
27-
"microfrontends",
28-
"ugandaEMR",
29-
"ugandaemr"
30-
],
31-
"repository": {
32-
"type": "git",
33-
"url": "git+https://github.com/METS-Programme/esm-ugandaemr-core.git"
34-
},
35-
"homepage": "https://github.com/METS-Programme/esm-ugandaemr-core#readme",
36-
"publishConfig": {
37-
"access": "public"
38-
},
39-
"bugs": {
40-
"url": "https://github.com/METS-Programme/esm-ugandaemr-core/issues"
41-
},
42-
"dependencies": {
43-
"@hookform/resolvers": "^3.3.4",
44-
"@types/base-64": "^1.0.0",
45-
"axios": "^1.4.0",
46-
"base-64": "^1.0.0",
47-
"buffer": "^6.0.3",
48-
"dayjs": "^1.11.6",
49-
"react-full-screen": "^1.1.1",
50-
"react-grid-layout": "^1.3.4",
51-
"react-hook-form": "^7.51.0",
52-
"react-to-print": "^2.14.13",
53-
"recharts": "^2.7.2",
54-
"swr": "^2.1.1",
55-
"zod": "^3.23.8"
56-
},
57-
"peerDependencies": {
58-
"@openmrs/esm-framework": "9.x",
59-
"@openmrs/esm-patient-common-lib": "12.x",
60-
"i18next": "25.x",
61-
"react": "18.x",
62-
"react-i18next": "16.x"
63-
},
64-
"devDependencies": {
65-
"@carbon/react": "^1.83.0",
66-
"@openmrs/esm-form-engine-lib": "next",
67-
"@openmrs/esm-framework": "next",
68-
"@openmrs/esm-patient-common-lib": "next",
69-
"@openmrs/esm-styleguide": "next",
70-
"@swc/cli": "^0.1.57",
71-
"@swc/core": "^1.3.6",
72-
"@swc/jest": "^0.2.23",
73-
"@testing-library/dom": "^8.20.1",
74-
"@testing-library/jest-dom": "^5.16.5",
75-
"@testing-library/react": "^13.4.0",
76-
"@testing-library/user-event": "^14.4.3",
77-
"@types/jest": "^28.1.8",
78-
"@types/lodash-es": "^4.17.3",
79-
"@types/react": "^18.3.2",
80-
"@types/react-dom": "^18.3.0",
81-
"@types/testing-library__jest-dom": "^5.14.1",
82-
"@types/webpack-env": "^1.18.8",
83-
"@typescript-eslint/eslint-plugin": "^6.7.3",
84-
"@typescript-eslint/parser": "^6.7.3",
85-
"concurrently": "^8.2.1",
86-
"cross-env": "^7.0.3",
87-
"css-loader": "^6.8.1",
88-
"eslint": "^8.50.0",
89-
"eslint-config-prettier": "^8.8.0",
90-
"eslint-config-ts-react-important-stuff": "^3.0.0",
91-
"eslint-plugin-import": "^2.32.0",
92-
"eslint-plugin-prettier": "^5.1.3",
93-
"eslint-plugin-testing-library": "^7.16.0",
94-
"husky": "^8.0.3",
95-
"i18next": "^25.0.0",
96-
"i18next-parser": "^9.3.0",
97-
"identity-obj-proxy": "^3.0.0",
98-
"install-peers": "^1.0.4",
99-
"jest": "^29.7.0",
100-
"jest-cli": "^29.7.0",
101-
"jest-environment-jsdom": "^29.7.0",
102-
"lerna": "^5.6.1",
103-
"lodash": "^4.17.21",
104-
"openmrs": "next",
105-
"prettier": "^3.0.3",
106-
"pretty-quick": "^3.1.3",
107-
"react": "^18.3.1",
108-
"react-dom": "^18.3.1",
109-
"react-i18next": "^16.0.0",
110-
"react-router-dom": "^6.14.1",
111-
"rxjs": "^6.6.7",
112-
"sass": "^1.54.3",
113-
"swc-loader": "^0.2.3",
114-
"systemjs-webpack-interop": "^2.3.7",
115-
"turbo": "^2.5.2",
116-
"typescript": "^5.0.2",
117-
"webpack-bundle-analyzer": "^4.4.0"
118-
},
119-
"packageManager": "yarn@4.9.2"
2+
"name": "@ugandaemr/esm-ugandaemr-app",
3+
"version": "1.0.3",
4+
"license": "MPL-2.0",
5+
"description": "UgandaEMR microfrontend built on top of OpenMRS 3.x and OHRI",
6+
"browser": "dist/esm-ugandaemr-app.js",
7+
"main": "src/index.ts",
8+
"source": true,
9+
"files": [
10+
"*"
11+
],
12+
"scripts": {
13+
"start": "openmrs develop",
14+
"serve": "webpack serve --mode=development",
15+
"debug": "npm run serve",
16+
"build": "webpack --mode production",
17+
"analyze": "webpack --mode=production --env.analyze=true",
18+
"lint": "eslint src --ext tsx,ts --fix --max-warnings=0",
19+
"verify": "turbo run lint && turbo run typescript",
20+
"prettier": "prettier --config prettier.config.js --write \"src/**/*.{ts,tsx,css,scss}\"",
21+
"test": "cross-env TZ=UTC jest --config jest.config.json --verbose false --passWithNoTests",
22+
"typescript": "tsc",
23+
"extract-translations": "i18next 'src/**/*.component.tsx' --config ../../tools/i18next-parser.config.js",
24+
"prepack": "cp src/routes.json routes.json",
25+
"postpack": "rm -f routes.json"
26+
},
27+
"browserslist": [
28+
"extends browserslist-config-openmrs"
29+
],
30+
"keywords": [
31+
"openmrs",
32+
"microfrontends",
33+
"ugandaEMR",
34+
"ugandaemr"
35+
],
36+
"repository": {
37+
"type": "git",
38+
"url": "git+https://github.com/METS-Programme/esm-ugandaemr-core.git"
39+
},
40+
"homepage": "https://github.com/METS-Programme/esm-ugandaemr-core#readme",
41+
"publishConfig": {
42+
"access": "public"
43+
},
44+
"bugs": {
45+
"url": "https://github.com/METS-Programme/esm-ugandaemr-core/issues"
46+
},
47+
"dependencies": {
48+
"@hookform/resolvers": "^3.3.4",
49+
"@types/base-64": "^1.0.0",
50+
"axios": "^1.4.0",
51+
"base-64": "^1.0.0",
52+
"buffer": "^6.0.3",
53+
"dayjs": "^1.11.6",
54+
"react-full-screen": "^1.1.1",
55+
"react-grid-layout": "^1.3.4",
56+
"react-hook-form": "^7.51.0",
57+
"react-to-print": "^2.14.13",
58+
"recharts": "^2.7.2",
59+
"swr": "^2.1.1",
60+
"zod": "^3.23.8"
61+
},
62+
"peerDependencies": {
63+
"@openmrs/esm-framework": "9.x",
64+
"@openmrs/esm-patient-common-lib": "12.x",
65+
"i18next": "25.x",
66+
"react": "18.x",
67+
"react-i18next": "16.x"
68+
},
69+
"devDependencies": {
70+
"@carbon/react": "^1.83.0",
71+
"@openmrs/esm-form-engine-lib": "next",
72+
"@openmrs/esm-framework": "next",
73+
"@openmrs/esm-patient-common-lib": "next",
74+
"@openmrs/esm-styleguide": "next",
75+
"@swc/cli": "^0.1.57",
76+
"@swc/core": "^1.3.6",
77+
"@swc/jest": "^0.2.23",
78+
"@testing-library/dom": "^8.20.1",
79+
"@testing-library/jest-dom": "^5.16.5",
80+
"@testing-library/react": "^13.4.0",
81+
"@testing-library/user-event": "^14.4.3",
82+
"@types/jest": "^28.1.8",
83+
"@types/lodash-es": "^4.17.3",
84+
"@types/react": "^18.3.2",
85+
"@types/react-dom": "^18.3.0",
86+
"@types/testing-library__jest-dom": "^5.14.1",
87+
"@types/webpack-env": "^1.18.8",
88+
"@typescript-eslint/eslint-plugin": "^6.7.3",
89+
"@typescript-eslint/parser": "^6.7.3",
90+
"concurrently": "^8.2.1",
91+
"cross-env": "^7.0.3",
92+
"css-loader": "^6.8.1",
93+
"eslint": "^8.50.0",
94+
"eslint-config-prettier": "^8.8.0",
95+
"eslint-config-ts-react-important-stuff": "^3.0.0",
96+
"eslint-plugin-import": "^2.32.0",
97+
"eslint-plugin-prettier": "^5.1.3",
98+
"eslint-plugin-testing-library": "^7.16.0",
99+
"husky": "^8.0.3",
100+
"i18next": "^25.0.0",
101+
"i18next-parser": "^9.3.0",
102+
"identity-obj-proxy": "^3.0.0",
103+
"install-peers": "^1.0.4",
104+
"jest": "^29.7.0",
105+
"jest-cli": "^29.7.0",
106+
"jest-environment-jsdom": "^29.7.0",
107+
"lerna": "^5.6.1",
108+
"lodash": "^4.17.21",
109+
"openmrs": "next",
110+
"prettier": "^3.0.3",
111+
"pretty-quick": "^3.1.3",
112+
"react": "^18.3.1",
113+
"react-dom": "^18.3.1",
114+
"react-i18next": "^16.0.0",
115+
"react-router-dom": "^6.14.1",
116+
"rxjs": "^6.6.7",
117+
"sass": "^1.54.3",
118+
"swc-loader": "^0.2.3",
119+
"systemjs-webpack-interop": "^2.3.7",
120+
"turbo": "^2.5.2",
121+
"typescript": "^5.0.2",
122+
"webpack-bundle-analyzer": "^4.4.0"
123+
},
124+
"packageManager": "yarn@4.9.2"
120125
}

0 commit comments

Comments
 (0)