Skip to content

Commit cf16a92

Browse files
rbuissonusamaidrsk
authored andcommitted
Initial commit
0 parents  commit cf16a92

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+25215
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
end_of_line = lf
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src/**/*.test.tsx
2+
**/*.d.tsx

.eslintrc

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"env": {
3+
"node": true
4+
},
5+
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
6+
"parser": "@typescript-eslint/parser",
7+
"plugins": ["@typescript-eslint", "react-hooks"],
8+
"root": true,
9+
"rules": {
10+
"react-hooks/exhaustive-deps": "warn",
11+
"react-hooks/rules-of-hooks": "error",
12+
// Disabling these rules for now just to keep the diff small. I'll enable them in a future PR that fixes lint issues.
13+
"@typescript-eslint/no-explicit-any": "off",
14+
"@typescript-eslint/no-unused-vars": "off",
15+
"@typescript-eslint/no-var-requires": "off",
16+
"@typescript-eslint/ban-ts-comment": "off",
17+
"@typescript-eslint/ban-types": "off",
18+
// Use `import type` instead of `import` for type imports https://typescript-eslint.io/blog/consistent-type-imports-and-exports-why-and-how
19+
"@typescript-eslint/consistent-type-imports": [
20+
"error",
21+
{
22+
"fixStyle": "inline-type-imports"
23+
}
24+
],
25+
"prefer-const": "off",
26+
"no-console": ["error", { "allow": ["warn", "error"] }],
27+
"no-unsafe-optional-chaining": "off",
28+
"no-explicit-any": "off",
29+
"no-extra-boolean-cast": "off",
30+
"no-prototype-builtins": "off",
31+
"no-useless-escape": "off",
32+
"no-restricted-imports": [
33+
"error",
34+
{
35+
"paths": [
36+
{
37+
"name": "lodash",
38+
"message": "Import specific methods from `lodash`. e.g. `import map from 'lodash/map'`"
39+
},
40+
{
41+
"name": "lodash-es",
42+
"importNames": ["default"],
43+
"message": "Import specific methods from `lodash-es`. e.g. `import { map } from 'lodash-es'`"
44+
},
45+
{
46+
"name": "carbon-components-react",
47+
"message": "Import from `@carbon/react` directly. e.g. `import { Toggle } from '@carbon/react'`"
48+
},
49+
{
50+
"name": "@carbon/icons-react",
51+
"message": "Import from `@carbon/react/icons`. e.g. `import { ChevronUp } from '@carbon/react/icons'`"
52+
}
53+
]
54+
}
55+
]
56+
}
57+
}

.github/pull_request_template.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## Requirements
2+
- [ ] This PR has a title that briefly describes the work done including a [conventional commit](https://o3-dev.docs.openmrs.org/#/getting_started/contributing?id=your-pr-title-should-indicate-the-type-of-change-it-is) type prefix and a Jira ticket number if applicable. See existing PR titles for inspiration.
3+
4+
#### For changes to apps
5+
- [ ] My work conforms to the [**OpenMRS 3.0 Styleguide**](https://om.rs/styleguide) and [**design documentation**](https://zeroheight.com/23a080e38/p/880723-introduction).
6+
7+
#### If applicable
8+
- [ ] My work includes tests or is validated by existing tests.
9+
10+
## Summary
11+
<!-- Please describe what problems your PR addresses. -->
12+
<!-- *None* -->
13+
14+
## Screenshots
15+
<!-- Required if you are making UI changes. -->
16+
<!-- *None* -->
17+
18+
## Related Issue
19+
<!-- Paste the link to the Jira ticket here if one exists. -->
20+
<!-- https://issues.openmrs.org/browse/O3- -->
21+
<!-- *None* -->
22+
23+
## Other
24+
<!-- Anything not covered above -->
25+
<!-- *None* -->

.github/workflows/e2e.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: E2E Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
main:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 15
15+
steps:
16+
- name: Checkout repo
17+
uses: actions/checkout@v4
18+
19+
- name: Copy test environment variables
20+
run: cp example.env .env
21+
22+
- name: Setup node
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: "18"
26+
27+
- name: Cache dependencies
28+
id: cache
29+
uses: actions/cache@v4
30+
with:
31+
path: '**/node_modules'
32+
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
33+
34+
- name: Install dependencies
35+
if: steps.cache.outputs.cache-hit != 'true'
36+
run: yarn install --immutable
37+
38+
- name: Install Playwright Browsers
39+
run: npx playwright install chromium --with-deps
40+
41+
- name: Build apps
42+
run: yarn turbo build --concurrency=5
43+
44+
- name: Run dev server
45+
run: bash e2e/support/github/run-e2e-docker-env.sh
46+
47+
- name: Wait for OpenMRS instance to start
48+
run: while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:8080/openmrs/login.htm)" != "200" ]]; do sleep 10; done
49+
50+
- name: Run E2E tests
51+
run: yarn test-e2e
52+
53+
- name: Stop dev server
54+
if: "!cancelled()"
55+
run: docker stop $(docker ps -a -q)
56+
57+
- name: Upload report
58+
uses: actions/upload-artifact@v3
59+
if: always()
60+
with:
61+
name: playwright-report
62+
path: playwright-report/
63+
retention-days: 30

.github/workflows/node.js.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Node.js CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
release:
9+
types:
10+
- created
11+
12+
env:
13+
ESM_NAME: "@openmrs/esm-template-app"
14+
JS_NAME: "openmrs-esm-template-app.js"
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Use Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: "18"
26+
- run: yarn install --immutable
27+
- run: yarn verify
28+
- run: yarn build
29+
- name: Upload Artifacts
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: dist
33+
path: |
34+
dist
35+
36+
pre_release:
37+
runs-on: ubuntu-latest
38+
39+
needs: build
40+
41+
if: ${{ github.event_name == 'push' }}
42+
43+
steps:
44+
- run: echo "Uncomment the lines below and delete this one."
45+
# - uses: actions/checkout@v4
46+
# - name: Download Artifacts
47+
# uses: actions/download-artifact@v4
48+
# - name: Use Node.js
49+
# uses: actions/setup-node@v4
50+
# with:
51+
# node-version: "18"
52+
# registry-url: "https://registry.npmjs.org"
53+
# - run: yarn install --immutable
54+
# - run: yarn version "$(node -e "console.log(require('semver').inc(require('./package.json').version, 'patch'))")-pre.${{ github.run_number }}"
55+
# - run: yarn build
56+
# - run: git config user.email "[email protected]" && git config user.name "OpenMRS CI"
57+
# - run: git add . && git commit -m "Prerelease version" --no-verify
58+
# - run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish --access public --tag next
59+
# env:
60+
# NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
61+
# - name: Upload Artifacts
62+
# uses: actions/upload-artifact@v4
63+
# with:
64+
# name: dist
65+
# path: |
66+
# dist
67+
68+
release:
69+
runs-on: ubuntu-latest
70+
71+
needs: build
72+
73+
if: ${{ github.event_name == 'release' }}
74+
75+
steps:
76+
- uses: actions/checkout@v4
77+
- name: Download Artifacts
78+
uses: actions/download-artifact@v4
79+
- name: Use Node.js
80+
uses: actions/setup-node@v4
81+
with:
82+
node-version: "18"
83+
registry-url: 'https://registry.npmjs.org'
84+
- run: yarn install --immutable
85+
- run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish
86+
env:
87+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
88+
89+
deploy:
90+
runs-on: ubuntu-latest
91+
92+
needs: pre_release
93+
94+
if: ${{ github.event_name == 'push' }}
95+
96+
steps:
97+
- run: echo "Uncomment the lines below and delete this one."
98+
# - name: Trigger RefApp Build
99+
# uses: fjogeleit/http-request-action@v1
100+
# with:
101+
# url: https://ci.openmrs.org/rest/api/latest/queue/O3-BP
102+
# method: "POST"
103+
# customHeaders: '{ "Authorization": "Bearer ${{ secrets.BAMBOO_TOKEN }}" }'

.gitignore

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# OS files
2+
.DS_Store
3+
4+
# Logs
5+
logs
6+
*.log
7+
npm-debug.log*
8+
yarn-debug.log*
9+
yarn-error.log*
10+
11+
# Runtime data
12+
pids
13+
*.pid
14+
*.seed
15+
*.pid.lock
16+
17+
# Directory for instrumented libs generated by jscoverage/JSCover
18+
lib-cov
19+
20+
# Coverage directory used by tools like istanbul
21+
coverage
22+
23+
# nyc test coverage
24+
.nyc_output
25+
26+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
27+
.grunt
28+
29+
# Bower dependency directory (https://bower.io/)
30+
bower_components
31+
32+
# node-waf configuration
33+
.lock-wscript
34+
35+
# Compiled binary addons (https://nodejs.org/api/addons.html)
36+
build/Release
37+
38+
# Dependency directories
39+
node_modules/
40+
jspm_packages/
41+
42+
# TypeScript v1 declaration files
43+
typings/
44+
45+
# Optional npm cache directory
46+
.npm
47+
48+
# Optional eslint cache
49+
.eslintcache
50+
51+
# Optional REPL history
52+
.node_repl_history
53+
54+
# Output of 'npm pack'
55+
*.tgz
56+
57+
# Yarn Integrity file
58+
.yarn-integrity
59+
60+
# dotenv environment variables file
61+
.env
62+
63+
# next.js build output
64+
.next
65+
66+
dist/
67+
68+
# Intellij integration
69+
*.iml
70+
.idea
71+
72+
# ignores for Yarn v3 w/o PNP
73+
.pnp.*
74+
.yarn/*
75+
!.yarn/patches
76+
!.yarn/plugins
77+
!.yarn/releases
78+
!.yarn/sdks
79+
!.yarn/versions
80+
81+
# Turborepo
82+
.turbo
83+
84+
# Playwright and e2e tests
85+
/test-results/
86+
/playwright-report/
87+
/playwright/.cache/
88+
e2e/storageState.json

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
set -e # die on error
5+
6+
npx lint-staged
7+
yarn turbo extract-translations

.husky/pre-push

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
set -e # die on error
5+
6+
yarn verify

0 commit comments

Comments
 (0)