Skip to content

Commit

Permalink
Ft/data entry statistics app (#1)
Browse files Browse the repository at this point in the history
* ft : add app dashboard header

* ft: add gitflow

* fix : build error
  • Loading branch information
Daphne210 authored Oct 4, 2023
1 parent 5e573c0 commit 188d70a
Show file tree
Hide file tree
Showing 11 changed files with 418 additions and 224 deletions.
132 changes: 62 additions & 70 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
name: Node.js CI
name: UgandaEMR CI

on:
workflow_dispatch: # enables the workflow to be triggered manually
push:
branches: [main]
pull_request:
branches: [main]
release:
types:
- created

env:
ESM_NAME: "@ugandaemr/esm-template-app"
JS_NAME: "esm-ugandaemr-template-app.js"

ESM_NAME: "@ugandaemr/esm-data-entry-statistics-app"
JS_NAME: "esm-data-entry-statistics-app.js"
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -30,10 +28,17 @@ jobs:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"

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

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --immutable

- name: Setup local cache server for Turborepo
uses: felixmosh/turborepo-gh-artifacts@v2
with:
Expand All @@ -58,55 +63,51 @@ jobs:
if: ${{ github.event_name == 'push' }}

steps:
- run: echo "Uncomment the lines below and delete this one."
# - uses: actions/checkout@v3

# - name: Download Artifacts
# uses: actions/download-artifact@v3

# - name: Setup Node.js
# uses: actions/setup-node@v3
# with:
# node-version: "18.x"
# registry-url: "https://registry.npmjs.org"

# - name: Cache dependencies
# id: cache
# uses: actions/cache@v3
# with:
# path: "**/node_modules"
# key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

# - name: Install dependencies
# if: steps.cache.outputs.cache-hit != 'true'
# run: yarn install --immutable
- uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"

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

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --immutable

# - name: Setup local cache server for Turborepo
# uses: felixmosh/turborepo-gh-artifacts@v2
# with:
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# server-token: ${{ secrets.TURBO_SERVER_TOKEN }}
- name: Setup local cache server for Turborepo
uses: felixmosh/turborepo-gh-artifacts@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
server-token: ${{ secrets.TURBO_SERVER_TOKEN }}

# - name: Version
# run: yarn version "$(node -e "console.log(require('semver').inc(require('./package.json').version, 'patch'))")-pre.${{ github.run_number }}"
- name: Version
run: yarn version "$(node -e "console.log(require('semver').inc(require('./package.json').version, 'patch'))")-pre.${{ github.run_number }}"

# - name: Build
# run: yarn turbo build --color --concurrency=5
- name: Build
run: yarn turbo build --color --concurrency=5

# - run: git config user.email "<>" && git config user.name "UgandaEMR CI"
# - run: git add . && git commit -m "Prerelease version" --no-verify
- run: git config user.email "<>" && git config user.name "UgandaEMR CI"
- run: git add . && git commit -m "Prerelease version" --no-verify

# - name: Pre-release
# run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish --access public --tag next
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Pre-release
run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish --access public --tag next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

# - name: Upload Artifacts
# uses: actions/upload-artifact@v3
# with:
# name: dist
# path: |
# dist
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: |
dist
release:
runs-on: ubuntu-latest
Expand All @@ -119,39 +120,30 @@ jobs:
- uses: actions/checkout@v3
- name: Download Artifacts
uses: actions/download-artifact@v3
- name: Use Node.js

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"
registry-url: 'https://registry.npmjs.org'
registry-url: "https://registry.npmjs.org"

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

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --immutable


- name: Setup local cache server for Turborepo
uses: felixmosh/turborepo-gh-artifacts@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
server-token: ${{ secrets.TURBO_SERVER_TOKEN }}

- run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

deploy:
runs-on: ubuntu-latest

needs: pre_release

if: ${{ github.event_name == 'push' }}

steps:
- run: echo "Uncomment the lines below and delete this one."
# - name: Trigger RefApp Build
# uses: fjogeleit/http-request-action@master
# with:
# url: https://ci.openmrs.org/rest/api/latest/queue/REFAPP-D3X
# method: "POST"
# customHeaders: '{ "Authorization": "Bearer ${{ secrets.BAMBOO_TOKEN }}" }'
204 changes: 102 additions & 102 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,104 +1,104 @@
{
"name": "@ugandaemr/esm-template-app",
"version": "1.0.0",
"license": "MPL-2.0",
"description": "A template for creating frontend modules for UgandaEMR",
"browser": "dist/esm-ugandaemr-template-app.js",
"main": "src/index.ts",
"source": true,
"scripts": {
"start": "openmrs develop",
"serve": "webpack serve --mode=development",
"build": "webpack --mode production",
"analyze": "webpack --mode=production --env analyze=true",
"lint": "TIMING=1 eslint src --ext js,jsx,ts,tsx",
"prettier": "prettier --write \"src/**/*.{ts,tsx}\"",
"typescript": "tsc",
"test": "jest --config jest.config.js --passWithNoTests",
"verify": "turbo lint typescript coverage",
"coverage": "yarn test --coverage",
"prepare": "husky install",
"extract-translations": "i18next 'src/**/*.component.tsx' --config ./i18next-parser.config.js"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged && yarn verify"
}
},
"browserslist": [
"extends browserslist-config-openmrs"
],
"keywords": [
"openmrs",
"microfrontends"
],
"repository": {
"type": "git",
"url": "git+https://github.com/mets-programme/esm-ugandaemr-template-app.git"
},
"homepage": "https://github.com/mets-programme/esm-ugandaemr-template-app#readme",
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/mets-programme/esm-ugandaemr-template-app/issues"
},
"dependencies": {
"@carbon/react": "^1.33.1",
"lodash-es": "^4.17.21",
"react-image-annotate": "^1.8.0"
},
"peerDependencies": {
"@openmrs/esm-framework": "*",
"dayjs": "1.x",
"react": "18.x",
"react-i18next": "11.x",
"react-router-dom": "6.x",
"rxjs": "6.x"
},
"devDependencies": {
"@openmrs/esm-framework": "next",
"@openmrs/esm-styleguide": "next",
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.68",
"@swc/jest": "^0.2.26",
"@testing-library/dom": "^8.20.1",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.4.3",
"@types/jest": "^28.1.8",
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"@types/webpack-env": "^1.18.1",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
"css-loader": "^6.8.1",
"eslint": "^8.44.0",
"eslint-config-prettier": "^8.8.0",
"eslint-config-ts-react-important-stuff": "^3.0.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.0",
"i18next": "^23.2.8",
"i18next-parser": "^8.0.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^28.1.3",
"jest-cli": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"openmrs": "next",
"prettier": "^2.8.8",
"pretty-quick": "^3.1.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "^11.18.6",
"react-router-dom": "^6.14.1",
"rxjs": "^6.6.7",
"swc-loader": "^0.2.3",
"turbo": "^1.10.7",
"typescript": "^4.9.5",
"webpack": "^5.88.1",
"webpack-cli": "^5.1.4"
},
"packageManager": "[email protected]"
"name": "@ugandaemr/esm-data-entry-statistics-app",
"version": "1.0.0",
"license": "MPL-2.0",
"description": "Frontend module for data entry statistics",
"browser": "dist/esm-ugandaemr-template-app.js",
"main": "src/index.ts",
"source": true,
"scripts": {
"start": "openmrs develop --backend http://167.71.32.250:8080/",
"serve": "webpack serve --mode=development",
"build": "webpack --mode production",
"analyze": "webpack --mode=production --env analyze=true",
"lint": "TIMING=1 eslint src --ext js,jsx,ts,tsx",
"prettier": "prettier --write \"src/**/*.{ts,tsx}\"",
"typescript": "tsc",
"test": "jest --config jest.config.js --passWithNoTests",
"verify": "turbo lint typescript coverage",
"coverage": "yarn test --coverage",
"prepare": "husky install",
"extract-translations": "i18next 'src/**/*.component.tsx' --config ./i18next-parser.config.js"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged && yarn verify"
}
},
"browserslist": [
"extends browserslist-config-openmrs"
],
"keywords": [
"openmrs",
"microfrontends"
],
"repository": {
"type": "git",
"url": "git+https://github.com/METS-Programme/esm-data-entry-statistics-app.git"
},
"homepage": "https://github.com/METS-Programme/esm-data-entry-statistics-app/blob/main/README.md",
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/METS-Programme/esm-data-entry-statistics-app/issues"
},
"dependencies": {
"@carbon/react": "^1.33.1",
"lodash-es": "^4.17.21",
"react-image-annotate": "^1.8.0"
},
"peerDependencies": {
"@openmrs/esm-framework": "*",
"dayjs": "1.x",
"react": "18.x",
"react-i18next": "11.x",
"react-router-dom": "6.x",
"rxjs": "6.x"
},
"devDependencies": {
"@openmrs/esm-framework": "next",
"@openmrs/esm-styleguide": "next",
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.68",
"@swc/jest": "^0.2.26",
"@testing-library/dom": "^8.20.1",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.4.3",
"@types/jest": "^28.1.8",
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"@types/webpack-env": "^1.18.1",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
"css-loader": "^6.8.1",
"eslint": "^8.44.0",
"eslint-config-prettier": "^8.8.0",
"eslint-config-ts-react-important-stuff": "^3.0.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.0",
"i18next": "^23.2.8",
"i18next-parser": "^8.0.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^28.1.3",
"jest-cli": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"openmrs": "next",
"prettier": "^2.8.8",
"pretty-quick": "^3.1.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "^11.18.6",
"react-router-dom": "^6.14.1",
"rxjs": "^6.6.7",
"swc-loader": "^0.2.3",
"turbo": "^1.10.7",
"typescript": "^4.9.5",
"webpack": "^5.88.1",
"webpack-cli": "^5.1.4"
},
"packageManager": "[email protected]"
}
Loading

0 comments on commit 188d70a

Please sign in to comment.