Skip to content

Commit 6d19569

Browse files
authored
Initial commit
0 parents  commit 6d19569

78 files changed

Lines changed: 34165 additions & 0 deletions

Some content is hidden

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

.eslintignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
ios
3+
android
4+
*.d.ts
5+
src/services/initialize.ts
6+
htmlcov
7+
contrib/

.eslintrc.cjs

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2020: true,
5+
serviceworker: true,
6+
},
7+
globals: {
8+
HTMLButtonElement: 'readonly',
9+
JSX: true,
10+
},
11+
root: true,
12+
extends: [
13+
'eslint:recommended',
14+
'plugin:react/recommended',
15+
'plugin:react-hooks/recommended',
16+
'plugin:import/recommended',
17+
'plugin:@typescript-eslint/recommended',
18+
'plugin:storybook/recommended',
19+
'eslint-config-prettier',
20+
],
21+
parser: '@typescript-eslint/parser',
22+
parserOptions: {
23+
project: 'tsconfig.json',
24+
ecmaVersion: 'latest',
25+
sourceType: 'module',
26+
},
27+
ignorePatterns: ['.eslintrc.cjs'],
28+
plugins: ['react', '@typescript-eslint', 'react-refresh', 'prettier', 'import', 'string-to-lingui'],
29+
settings: {
30+
'import/parsers': {
31+
'@typescript-eslint/parser': ['.ts', '.tsx'],
32+
},
33+
'import/resolver': {
34+
typescript: {
35+
project: 'src',
36+
37+
project: 'tsconfig.json',
38+
},
39+
},
40+
},
41+
rules: {
42+
'react-refresh/only-export-components': 'warn',
43+
'@typescript-eslint/no-explicit-any': 'warn',
44+
'react/jsx-uses-react': 'off',
45+
'react/react-in-jsx-scope': 'off',
46+
'@typescript-eslint/no-non-null-assertion': 'off',
47+
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
48+
'@typescript-eslint/ban-ts-comment': 'off',
49+
'string-to-lingui/t-call-in-function': 2,
50+
'import/default': 'off',
51+
'import/named': 'off',
52+
'import/no-named-as-default': 'off',
53+
'import/no-named-as-default-member': 'off',
54+
'import/no-unresolved': [
55+
2,
56+
{
57+
ignore: ['fhir/r4b'], // Fixes error: Unable to resolve path to module 'fhir/r4b'.
58+
},
59+
],
60+
'no-restricted-imports': [
61+
'error',
62+
{
63+
patterns: [
64+
{
65+
group: ['**/contrib/aidbox-types'],
66+
message: 'Please use @beda.software/aidbox-types',
67+
},
68+
{
69+
group: ['**/contrib/fhir-emr'],
70+
message: 'Please use @beda.software/emr',
71+
},
72+
{
73+
group: ['**/contrib/emr-config'],
74+
message: 'Please use @beda.software/emr-config',
75+
},
76+
],
77+
},
78+
],
79+
'import/order': [
80+
'error',
81+
{
82+
groups: ['builtin', 'external', 'internal', ['index', 'sibling', 'parent']],
83+
'newlines-between': 'always',
84+
pathGroupsExcludedImportTypes: ['builtin'],
85+
pathGroups: [
86+
{
87+
pattern: 'aidbox-react/**',
88+
group: 'external',
89+
position: 'after',
90+
},
91+
{
92+
pattern: '@beda.software/**',
93+
group: 'external',
94+
position: 'after',
95+
},
96+
{
97+
pattern: 'src/**',
98+
group: 'internal',
99+
position: 'after',
100+
},
101+
],
102+
alphabetize: { order: 'asc', caseInsensitive: true },
103+
},
104+
],
105+
}
106+
};

.github/workflows/main.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build image and restart services
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
Release:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
packages: write
12+
env:
13+
REGISTRY: ghcr.io
14+
IMAGE_NAME: ${{ github.repository }}
15+
DISABLE_ESLINT_PLUGIN: true
16+
NODE_OPTIONS: --max-old-space-size=4096
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
submodules: recursive
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
- name: Prepare config
25+
run: cp contrib/emr-config/config.production.js contrib/emr-config/config.js
26+
- name: Install deps
27+
run: yarn install --network-concurrency 1
28+
- run: yarn extract
29+
- run: yarn compile
30+
- run: yarn build
31+
- name: Setup QEMU
32+
uses: docker/setup-qemu-action@v3
33+
- name: Setup Docker builder
34+
uses: docker/setup-buildx-action@v3
35+
- run: docker run --rm --privileged tonistiigi/binfmt --install all
36+
- name: Login to Docker registry
37+
uses: docker/login-action@v3
38+
with:
39+
registry: ${{ env.REGISTRY }}
40+
username: ${{ github.actor }}
41+
password: ${{ secrets.GITHUB_TOKEN }}
42+
- name: Build and push the Docker image
43+
uses: docker/build-push-action@v5
44+
with:
45+
context: .
46+
platforms: linux/amd64,linux/arm64
47+
push: true
48+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest

.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Logs
2+
logs
3+
*.log
4+
.history
5+
npm-debug.log*
6+
yarn-debug.log*
7+
yarn-error.log*
8+
pnpm-debug.log*
9+
lerna-debug.log*
10+
11+
node_modules
12+
dist
13+
dist-ssr
14+
*.local
15+
16+
# Editor directories and files
17+
.vscode/*
18+
!.vscode/extensions.json
19+
.idea
20+
.DS_Store
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw?
26+
src/locale/*/*.ts
27+
build/
28+
tsconfig.node.tsbuildinfo
29+
vite.config.d.ts
30+
vite.config.js
31+
32+
contrib/emr-config/config.js
33+
34+
*storybook.log
35+
storybook-static

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "contrib/fhir-emr"]
2+
path = contrib/fhir-emr
3+
url = git@github.com:beda-software/fhir-emr.git

.husky/pre-commit

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
if [ "$HUSKY" = "0" ]; then
3+
debug "HUSKY env variable is set to 0, skipping hook"
4+
exit 0
5+
fi
6+
7+
. "$(dirname "$0")/_/husky.sh"
8+
9+
yarn run typecheck
10+
yarn run lint-staged

.lintstagedrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"*.{js,jsx,ts,tsx}": ["eslint --fix", "prettier --write"]
3+
}

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
build
3+
ios
4+
android
5+
*.d.ts

.prettierrc.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"bracketSpacing": true,
3+
"jsxBracketSameLine": false,
4+
"singleQuote": true,
5+
"trailingComma": "all",
6+
"tabWidth": 4,
7+
"arrowParens": "always",
8+
"printWidth": 120,
9+
"jsxSingleQuote": false,
10+
"overrides": [
11+
{
12+
"files": ["*.yaml", "*.yml"],
13+
"options": {
14+
"tabWidth": 2,
15+
"singleQuote": false
16+
}
17+
}
18+
]
19+
}

.storybook/main.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { dirname, join } from "path";
2+
import type { StorybookConfig } from '@storybook/react-vite';
3+
4+
const config: StorybookConfig = {
5+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
6+
7+
addons: [
8+
getAbsolutePath("@storybook/addon-onboarding"),
9+
getAbsolutePath("@storybook/addon-links"),
10+
getAbsolutePath("@storybook/addon-essentials"),
11+
getAbsolutePath("@chromatic-com/storybook"),
12+
getAbsolutePath("@storybook/addon-interactions"),
13+
],
14+
15+
framework: {
16+
name: getAbsolutePath("@storybook/react-vite"),
17+
options: {},
18+
},
19+
20+
typescript: {
21+
reactDocgen: "react-docgen-typescript"
22+
}
23+
};
24+
export default config;
25+
26+
function getAbsolutePath(value: string): any {
27+
return dirname(require.resolve(join(value, "package.json")));
28+
}

0 commit comments

Comments
 (0)