generated from openmrs/openmrs-esm-template-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d51344e
Showing
69 changed files
with
22,633 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
end_of_line = lf | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
src/**/*.test.tsx | ||
**/*.d.tsx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"env": { | ||
"node": true | ||
}, | ||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint", "react-hooks"], | ||
"root": true, | ||
"rules": { | ||
"react-hooks/exhaustive-deps": "warn", | ||
"react-hooks/rules-of-hooks": "error", | ||
// 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", | ||
// Use `import type` instead of `import` for type imports https://typescript-eslint.io/blog/consistent-type-imports-and-exports-why-and-how | ||
"@typescript-eslint/consistent-type-imports": [ | ||
"error", | ||
{ | ||
"fixStyle": "inline-type-imports" | ||
} | ||
], | ||
"prefer-const": "off", | ||
"no-console": ["error", { "allow": ["warn", "error"] }], | ||
"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": [ | ||
{ | ||
"name": "lodash", | ||
"message": "Import specific methods from `lodash`. e.g. `import map from 'lodash/map'`" | ||
}, | ||
{ | ||
"name": "lodash-es", | ||
"importNames": ["default"], | ||
"message": "Import specific methods from `lodash-es`. e.g. `import { map } from 'lodash-es'`" | ||
}, | ||
{ | ||
"name": "carbon-components-react", | ||
"message": "Import from `@carbon/react` directly. e.g. `import { Toggle } from '@carbon/react'`" | ||
}, | ||
{ | ||
"name": "@carbon/icons-react", | ||
"message": "Import from `@carbon/react/icons`. e.g. `import { ChevronUp } from '@carbon/react/icons'`" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## Requirements | ||
- [ ] 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. | ||
|
||
#### For changes to apps | ||
- [ ] My work conforms to the [**OpenMRS 3.0 Styleguide**](https://om.rs/styleguide) and [**design documentation**](https://zeroheight.com/23a080e38/p/880723-introduction). | ||
|
||
#### If applicable | ||
- [ ] My work includes tests or is validated by existing tests. | ||
|
||
## Summary | ||
<!-- Please describe what problems your PR addresses. --> | ||
<!-- *None* --> | ||
|
||
## Screenshots | ||
<!-- Required if you are making UI changes. --> | ||
<!-- *None* --> | ||
|
||
## Related Issue | ||
<!-- Paste the link to the Jira ticket here if one exists. --> | ||
<!-- https://issues.openmrs.org/browse/O3- --> | ||
<!-- *None* --> | ||
|
||
## Other | ||
<!-- Anything not covered above --> | ||
<!-- *None* --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: E2E Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Copy test environment variables | ||
run: cp example.env .env | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "18" | ||
|
||
- name: Cache dependencies | ||
id: cache | ||
uses: actions/cache@v4 | ||
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: Install Playwright Browsers | ||
run: npx playwright install chromium --with-deps | ||
|
||
- name: Build apps | ||
run: yarn turbo build --concurrency=5 | ||
|
||
- name: Run dev server | ||
run: bash e2e/support/github/run-e2e-docker-env.sh | ||
|
||
- name: Wait for OpenMRS instance to start | ||
run: while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:8080/openmrs/login.htm)" != "200" ]]; do sleep 10; done | ||
|
||
- name: Run E2E tests | ||
run: yarn test-e2e | ||
|
||
- name: Stop dev server | ||
if: "!cancelled()" | ||
run: docker stop $(docker ps -a -q) | ||
|
||
- name: Upload report | ||
uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
name: Node.js CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
release: | ||
types: | ||
- created | ||
|
||
env: | ||
ESM_NAME: "@openmrs/esm-template-app" | ||
JS_NAME: "openmrs-esm-template-app.js" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "18" | ||
- run: yarn install --immutable | ||
- run: yarn verify | ||
- run: yarn build | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist | ||
path: | | ||
dist | ||
pre_release: | ||
runs-on: ubuntu-latest | ||
|
||
needs: build | ||
|
||
if: ${{ github.event_name == 'push' }} | ||
|
||
steps: | ||
- run: echo "Uncomment the lines below and delete this one." | ||
# - uses: actions/checkout@v4 | ||
# - name: Download Artifacts | ||
# uses: actions/download-artifact@v4 | ||
# - name: Use Node.js | ||
# uses: actions/setup-node@v4 | ||
# with: | ||
# node-version: "18" | ||
# registry-url: "https://registry.npmjs.org" | ||
# - run: yarn install --immutable | ||
# - run: yarn version "$(node -e "console.log(require('semver').inc(require('./package.json').version, 'patch'))")-pre.${{ github.run_number }}" | ||
# - run: yarn build | ||
# - run: git config user.email "[email protected]" && git config user.name "OpenMRS CI" | ||
# - run: git add . && git commit -m "Prerelease version" --no-verify | ||
# - 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@v4 | ||
# with: | ||
# name: dist | ||
# path: | | ||
# dist | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
|
||
needs: build | ||
|
||
if: ${{ github.event_name == 'release' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "18" | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: yarn install --immutable | ||
- 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@v1 | ||
# with: | ||
# url: https://ci.openmrs.org/rest/api/latest/queue/O3-BP | ||
# method: "POST" | ||
# customHeaders: '{ "Authorization": "Bearer ${{ secrets.BAMBOO_TOKEN }}" }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# OS files | ||
.DS_Store | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# next.js build output | ||
.next | ||
|
||
dist/ | ||
|
||
# Intellij integration | ||
*.iml | ||
.idea | ||
|
||
# ignores for Yarn v3 w/o PNP | ||
.pnp.* | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
|
||
# Turborepo | ||
.turbo | ||
|
||
# Playwright and e2e tests | ||
/test-results/ | ||
/playwright-report/ | ||
/playwright/.cache/ | ||
e2e/storageState.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
set -e # die on error | ||
|
||
npx lint-staged | ||
yarn turbo extract-translations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
set -e # die on error | ||
|
||
yarn verify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# directories | ||
.husky/ | ||
dist/ | ||
node_modules/ | ||
|
||
# dotfiles and generated | ||
.* | ||
yarn.lock | ||
|
||
# by file type | ||
**/*.css | ||
**/*.scss | ||
**/*.md | ||
**/*.json |
Oops, something went wrong.