Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 76 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup Bun
uses: oven-sh/setup-bun@v2
Expand All @@ -35,7 +35,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup Bun
uses: oven-sh/setup-bun@v2
Expand All @@ -48,16 +48,43 @@ jobs:
- name: Run security audit
run: bun audit

build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Build and pack
run: |
bun install --frozen-lockfile
bun run build
bun pm pack

- name: Upload tarball
uses: actions/upload-artifact@v5
with:
name: package-tarball
path: "*.tgz"

package-managers:
runs-on: ubuntu-latest
needs: build

strategy:
fail-fast: false
matrix:
package-manager: [bun, npm, pnpm]

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download tarball
uses: actions/download-artifact@v5
with:
name: package-tarball

- name: Setup Bun
if: matrix.package-manager == 'bun'
Expand All @@ -67,44 +94,67 @@ jobs:

- name: Setup Node.js
if: matrix.package-manager != 'bun'
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: "20"

- name: Setup pnpm
if: matrix.package-manager == 'pnpm'
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@v5
with:
version: latest

- name: Install dependencies (bun)
if: matrix.package-manager == 'bun'
run: bun install

- name: Install dependencies (npm)
if: matrix.package-manager == 'npm'
run: npm install
- name: Install package
run: |
TARBALL=$(ls *.tgz)
mkdir /tmp/test-install && cd /tmp/test-install
echo '{}' > package.json

- name: Install dependencies (pnpm)
if: matrix.package-manager == 'pnpm'
run: pnpm install
if [ "${{ matrix.package-manager }}" == "bun" ]; then
bun add "$OLDPWD/$TARBALL"
elif [ "${{ matrix.package-manager }}" == "npm" ]; then
npm install "$OLDPWD/$TARBALL"
else
pnpm add "$OLDPWD/$TARBALL"
fi

- name: Run codegen for FHIR R4
- name: Generate FHIR R4 type tree
working-directory: /tmp/test-install
run: |
cat > generate.ts <<'SCRIPT'
import { APIBuilder } from "@atomic-ehr/codegen";

const generate = async () => {
const builder = new APIBuilder()
.fromPackage("hl7.fhir.r4.core", "4.0.1")
.introspection({ typeTree: "./type-tree.json" })
.outputTo("./output");

const report = await builder.generate();

if (!report.success) {
console.error("Generation failed");
process.exit(1);
}

console.log("OK: type tree generated");
};

generate();
SCRIPT

if [ "${{ matrix.package-manager }}" == "bun" ]; then
bun run examples/python/generate.ts
bun generate.ts
elif [ "${{ matrix.package-manager }}" == "npm" ]; then
npx tsx examples/python/generate.ts
npx tsx generate.ts
else
pnpm dlx tsx examples/python/generate.ts
pnpm dlx tsx generate.ts
fi

- name: Verify output exists
- name: Verify output
run: |
if [ -d examples/python/fhir_types ]; then
echo "Output directory generated successfully"
ls -la examples/python/fhir_types
else
echo "Output directory not found"
if [ ! -f /tmp/test-install/output/type-tree.json ]; then
echo "type-tree.json not found"
exit 1
fi
echo "type-tree.json exists ($(wc -c < /tmp/test-install/output/type-tree.json) bytes)"
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup Bun
uses: oven-sh/setup-bun@v1
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2));
"

- uses: actions/setup-node@v4
- uses: actions/setup-node@v5
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
Expand All @@ -77,10 +77,10 @@ jobs:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup Bun
uses: oven-sh/setup-bun@v1
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

Expand All @@ -96,7 +96,7 @@ jobs:
- name: Build
run: bun run build

- uses: actions/setup-node@v4
- uses: actions/setup-node@v5
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
Expand All @@ -108,7 +108,7 @@ jobs:
run: npm publish --tag latest --access public

- name: Create Github Release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ github.ref }}
name: ${{ github.ref_name }}
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/sdk-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ jobs:
dotnet-version: [8.0.x]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ matrix.bun-version }}

- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ matrix.dotnet-version }}

Expand Down Expand Up @@ -57,10 +57,10 @@ jobs:
bun-version: [latest]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup Bun
uses: oven-sh/setup-bun@v2
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
bun-version: [latest]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Setup Bun
uses: oven-sh/setup-bun@v2
Expand Down Expand Up @@ -129,10 +129,10 @@ jobs:
bun-version: [latest]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup Bun
uses: oven-sh/setup-bun@v2
Expand All @@ -154,7 +154,7 @@ jobs:
python-version: [ "3.13" ]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Setup Bun
uses: oven-sh/setup-bun@v2
Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:
python-version: [ "3.13" ]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Setup Bun
uses: oven-sh/setup-bun@v2
Expand Down Expand Up @@ -236,15 +236,15 @@ jobs:
java-version: [21, 25]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ matrix.bun-version }}

- name: Setup Java
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
java-version: ${{ matrix.java-version }}
distribution: "temurin"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ A powerful, extensible code generation toolkit for FHIR ([Fast Healthcare Intero
| Feature | TypeScript | Python | C# | Mustache |
|-----------------------------------|------------|---------|------|----------|
| Resources & Complex Types | yes | yes | yes | template |
| Polymorphic container `Bundle<T>` | yes | no | no | no |
| Polymorphic container `Bundle<T>` | yes | yes | no | no |
| Value Set Bindings | inline | limited | enum | template |
| Primitive Extensions | yes | no | no | no |
| Profiles | yes | no | no | no |
Expand Down
8 changes: 4 additions & 4 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
},
"homepage": "https://github.com/atomic-ehr/codegen#readme",
"dependencies": {
"@atomic-ehr/fhir-canonical-manager": "^0.0.21",
"@atomic-ehr/fhirschema": "0.0.10",
"@atomic-ehr/fhir-canonical-manager": "0.0.22",
"@atomic-ehr/fhirschema": "0.0.11",
"mustache": "^4.2.0",
"picocolors": "^1.1.1",
"yaml": "^2.8.3",
Expand Down
Loading