Skip to content

Commit

Permalink
(chore) Setup prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen committed Sep 6, 2023
1 parent fa458c6 commit ee8449a
Show file tree
Hide file tree
Showing 44 changed files with 1,117 additions and 1,007 deletions.
25 changes: 7 additions & 18 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*",
"**/*.spec.ts"
],
"ignorePatterns": ["projects/**/*", "**/*.spec.ts"],
"overrides": [
{
"files": [
"*.ts"
],
"files": ["*.ts"],
"parserOptions": {
"project": [
"tsconfig.json",
"e2e/tsconfig.json"
],
"project": ["tsconfig.json", "e2e/tsconfig.json"],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
"plugin:@angular-eslint/template/process-inline-templates",
"prettier"
],
"rules": {
"@angular-eslint/component-selector": [
Expand All @@ -44,12 +37,8 @@
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"files": ["*.html"],
"extends": ["plugin:@angular-eslint/template/recommended"],
"rules": {}
}
]
Expand Down
6 changes: 5 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
## Requirements
# Requirements

- [ ] This PR has a title that briefly describes the work done, including the ticket number if there is a ticket.
- [ ] My work conforms to the [OpenMRS 3.0 Styleguide](https://om.rs/styleguide) and [design documentation](https://zeroheight.com/23a080e38/p/880723-introduction).
- [ ] My work includes tests or is validated by existing tests.

## Summary

<!-- Please describe what problems your PR addresses. -->

## Screenshots

<!-- Required if you are making UI changes. -->

## Related Issue

<!-- Paste the link to the Jira ticket here if one exists. -->
<!-- https://issues.openmrs.org/browse/O3- -->

## Other

<!-- Anything not covered above -->
22 changes: 11 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Form Entry CI

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
release:
types:
- created
Expand All @@ -18,20 +18,20 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
cache: "npm"
node-version: '16'
cache: 'npm'
- run: yarn install --frozen-lockfile

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

- name: Run lint
run: yarn turbo lint --color --concurrency=5 --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}" --team="${{ github.repository_owner }}"

- name: Run tests
- name: Run tests
run: yarn turbo test --color --concurrency=5 --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}" --team="${{ github.repository_owner }}"

- name: Run build
Expand All @@ -47,11 +47,11 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
cache: "npm"
node-version: '16'
cache: 'npm'
- run: yarn install --frozen-lockfile
- run: export NEW_VERSION="$(node -e "console.log(require('semver').inc(require('./package.json').version, 'patch'))")-pre.${{ github.run_number }}" && yarn version --new-version $NEW_VERSION --no-git-tag-version && cd projects/ngx-formentry && yarn version --new-version $NEW_VERSION --no-git-tag-version
- run: yarn turbo build:lib --color --concurrency=5
- run: yarn turbo build:lib --color --concurrency=5
- 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 publish dist/ngx-formentry --tag next --access public
Expand All @@ -74,8 +74,8 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
cache: "npm"
node-version: '16'
cache: 'npm'
- run: yarn install --frozen-lockfile

- name: Build
Expand Down
4 changes: 2 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"trailingComma": "none",
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"semi": true
"trailingComma": "none"
}
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Which is should be fine if your are not working on custom components (Make sure

`$ git clone https://github.com/AMPATH/ngx-openmrs-formentry`

`$ cd ngx-openmrs-formentry `
`$ cd ngx-openmrs-formentry`

`$ yarn`

Expand All @@ -93,11 +93,12 @@ Which is should be fine if your are not working on custom components (Make sure
`$ yarn run build:lib`

### Linking ngx-formentry with form-entry-app in patient chart

While you have your patient chart and ngx-formentry repo open locally,
Build the ngx-formentry project by
Build the ngx-formentry project by
running `$yarn run build:lib`

Then cd into the `dist/ngx-formentry` directory created from the previous step.
Then cd into the `dist/ngx-formentry` directory created from the previous step.
Run `$ pwd | pbcopy` to copy that path.

On the patient chart repo cd into `esm-form-entry-app`
Expand Down
11 changes: 3 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"test": "ng test ngx-formentry --watch=false",
"test:watch": "ng test ngx-formentry",
"lint": "TIMING=1 ng lint",
"prettier": "prettier --config .prettierrc --write \"projects/**/*.{html,js,ts,css,scss}\" \"src/**/*.{html,js,ts,css,scss}\" --ignore-unknown",
"e2e": "ng e2e"
},
"peerDependencies": {
Expand Down Expand Up @@ -68,6 +69,7 @@
"@typescript-eslint/parser": "^4.26.0",
"browserslist-config-openmrs": "^1.0.1",
"eslint": "^7.6.0",
"eslint-config-prettier": "^9.0.0",
"husky": "^4.3.0",
"jasmine-core": "^3.8.0",
"jasmine-spec-reporter": "~5.0.0",
Expand All @@ -77,7 +79,6 @@
"karma-firefox-launcher": "^1.1.0",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.7.0",
"lint-staged": "^10.4.0",
"ng-packagr": "^12.2.7",
"prettier": "2.1.2",
"protractor": "~7.0.0",
Expand All @@ -91,14 +92,8 @@
],
"husky": {
"hooks": {
"pre-commit": "yarn run lint",
"pre-commit": "yarn run prettier && yarn run lint",
"pre-push": "yarn run test"
}
},
"lint-staged": {
"*.{ts,js,css,md}": [
"prettier --write",
"yarn run lint"
]
}
}
2 changes: 1 addition & 1 deletion projects/ngx-formentry/src/adult.json
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
"identifierType": "dfacd928-0370-4315-99d7-6ec1c9f7ae76"
}
},

{
"type": "obs",
"label": "If non-Ampath, specify:",
Expand Down
Loading

0 comments on commit ee8449a

Please sign in to comment.