-
Notifications
You must be signed in to change notification settings - Fork 3
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 6a9d4b9
Showing
75 changed files
with
36,819 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,7 @@ | ||
node_modules | ||
ios | ||
android | ||
*.d.ts | ||
src/services/initialize.ts | ||
htmlcov | ||
contrib/ |
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,106 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2020: true, | ||
serviceworker: true, | ||
}, | ||
globals: { | ||
HTMLButtonElement: 'readonly', | ||
JSX: true, | ||
}, | ||
root: true, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:react/recommended', | ||
'plugin:react-hooks/recommended', | ||
'plugin:import/recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:storybook/recommended', | ||
'eslint-config-prettier', | ||
], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: 'tsconfig.json', | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
}, | ||
ignorePatterns: ['.eslintrc.cjs'], | ||
plugins: ['react', '@typescript-eslint', 'react-refresh', 'prettier', 'import', 'string-to-lingui'], | ||
settings: { | ||
'import/parsers': { | ||
'@typescript-eslint/parser': ['.ts', '.tsx'], | ||
}, | ||
'import/resolver': { | ||
typescript: { | ||
project: 'src', | ||
|
||
project: 'tsconfig.json', | ||
}, | ||
}, | ||
}, | ||
rules: { | ||
'react-refresh/only-export-components': 'warn', | ||
'@typescript-eslint/no-explicit-any': 'warn', | ||
'react/jsx-uses-react': 'off', | ||
'react/react-in-jsx-scope': 'off', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off', | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
'string-to-lingui/t-call-in-function': 2, | ||
'import/default': 'off', | ||
'import/named': 'off', | ||
'import/no-named-as-default': 'off', | ||
'import/no-named-as-default-member': 'off', | ||
'import/no-unresolved': [ | ||
2, | ||
{ | ||
ignore: ['fhir/r4b'], // Fixes error: Unable to resolve path to module 'fhir/r4b'. | ||
}, | ||
], | ||
'no-restricted-imports': [ | ||
'error', | ||
{ | ||
patterns: [ | ||
{ | ||
group: ['**/contrib/aidbox-types'], | ||
message: 'Please use @beda.software/aidbox-types', | ||
}, | ||
{ | ||
group: ['**/contrib/fhir-emr'], | ||
message: 'Please use @beda.software/emr', | ||
}, | ||
{ | ||
group: ['**/contrib/emr-config'], | ||
message: 'Please use @beda.software/emr-config', | ||
}, | ||
], | ||
}, | ||
], | ||
'import/order': [ | ||
'error', | ||
{ | ||
groups: ['builtin', 'external', 'internal', ['index', 'sibling', 'parent']], | ||
'newlines-between': 'always', | ||
pathGroupsExcludedImportTypes: ['builtin'], | ||
pathGroups: [ | ||
{ | ||
pattern: 'aidbox-react/**', | ||
group: 'external', | ||
position: 'after', | ||
}, | ||
{ | ||
pattern: '@beda.software/**', | ||
group: 'external', | ||
position: 'after', | ||
}, | ||
{ | ||
pattern: 'src/**', | ||
group: 'internal', | ||
position: 'after', | ||
}, | ||
], | ||
alphabetize: { order: 'asc', caseInsensitive: true }, | ||
}, | ||
], | ||
} | ||
}; |
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,58 @@ | ||
name: Build image and restart services | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
Release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
DISABLE_ESLINT_PLUGIN: true | ||
NODE_OPTIONS: --max-old-space-size=4096 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
- name: Prepare config | ||
run: cp config/config.production.ts contrib/fhir-emr/shared/src/config.ts | ||
- name: Install deps | ||
run: yarn install --network-concurrency 1 | ||
- run: yarn extract | ||
- run: yarn compile | ||
- run: yarn build | ||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Setup Docker builder | ||
uses: docker/setup-buildx-action@v3 | ||
- run: docker run --rm --privileged tonistiigi/binfmt --install all | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push the Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | ||
- name: Restart app | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{secrets.SSH_HOST}} | ||
username: ${{secrets.SSH_USER}} | ||
key: ${{secrets.SSH_PRIVATE_KEY}} | ||
script_stop: true | ||
script: | | ||
cd rsdue-services/ | ||
make restart |
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,35 @@ | ||
# Logs | ||
logs | ||
*.log | ||
.history | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
src/locale/ | ||
build/ | ||
tsconfig.node.tsbuildinfo | ||
vite.config.d.ts | ||
vite.config.js | ||
|
||
contrib/emr-config/config.js | ||
|
||
*storybook.log | ||
storybook-static |
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,3 @@ | ||
[submodule "contrib/fhir-emr"] | ||
path = contrib/fhir-emr | ||
url = [email protected]:beda-software/fhir-emr.git |
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,10 @@ | ||
#!/bin/sh | ||
if [ "$HUSKY" = "0" ]; then | ||
debug "HUSKY env variable is set to 0, skipping hook" | ||
exit 0 | ||
fi | ||
|
||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn run typecheck | ||
yarn run lint-staged |
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,3 @@ | ||
{ | ||
"*.{js,jsx,ts,tsx}": ["eslint --fix", "prettier --write"] | ||
} |
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,5 @@ | ||
node_modules | ||
build | ||
ios | ||
android | ||
*.d.ts |
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,19 @@ | ||
{ | ||
"bracketSpacing": true, | ||
"jsxBracketSameLine": false, | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"tabWidth": 4, | ||
"arrowParens": "always", | ||
"printWidth": 120, | ||
"jsxSingleQuote": false, | ||
"overrides": [ | ||
{ | ||
"files": ["*.yaml", "*.yml"], | ||
"options": { | ||
"tabWidth": 2, | ||
"singleQuote": 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,28 @@ | ||
import { dirname, join } from "path"; | ||
import type { StorybookConfig } from '@storybook/react-vite'; | ||
|
||
const config: StorybookConfig = { | ||
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], | ||
|
||
addons: [ | ||
getAbsolutePath("@storybook/addon-onboarding"), | ||
getAbsolutePath("@storybook/addon-links"), | ||
getAbsolutePath("@storybook/addon-essentials"), | ||
getAbsolutePath("@chromatic-com/storybook"), | ||
getAbsolutePath("@storybook/addon-interactions"), | ||
], | ||
|
||
framework: { | ||
name: getAbsolutePath("@storybook/react-vite"), | ||
options: {}, | ||
}, | ||
|
||
typescript: { | ||
reactDocgen: "react-docgen-typescript" | ||
} | ||
}; | ||
export default config; | ||
|
||
function getAbsolutePath(value: string): any { | ||
return dirname(require.resolve(join(value, "package.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,19 @@ | ||
import type { Preview } from '@storybook/react'; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
options: { | ||
storySort: { | ||
order: ['Get started', '*'], | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
Oops, something went wrong.