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
36 changes: 24 additions & 12 deletions docs/community/contribute/first-time.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,38 @@ git remote add upstream https://github.com/OpenDataEnsemble/OpenDataEnsemble.git

### 2. Set Up Your Development Environment

Depending on which component you want to contribute to:
Depending on which component you want to contribute to.

ODE JavaScript packages use **pnpm** (not npm). Enable the pinned version once per machine:

```bash
corepack enable
corepack prepare pnpm@10.33.2 --activate
```

Build `@ode/tokens` before Formulus or Formplayer. See [Development Setup](/docs/development/setup#package-manager-pnpm).

**For mobile app (Formulus):**
```bash
cd packages/tokens && pnpm install && pnpm run build && cd ../..
cd formulus
npm install
npm run start
pnpm install
pnpm start
```

**For web app (Formplayer):**
```bash
cd formplayer
npm install
npm run start
cd packages/tokens && pnpm install && pnpm run build && cd ../..
cd formulus-formplayer
pnpm install
pnpm start
```

**For backend server (Synkronus):**
```bash
cd synkronus
go mod download
go run ./cmd/server
go run ./cmd/synkronus
```

For detailed setup instructions, see the relevant component's development guide:
Expand Down Expand Up @@ -109,8 +120,9 @@ Use conventional commit format:
If your change affects functionality, write tests:

```bash
# Run tests for your component
cd formulus && npm test
# Run tests for your component (from repo root)
cd formulus && pnpm run test --ci --coverage --watchAll=false
cd formulus-formplayer && pnpm run test run
cd synkronus && go test ./...
```

Expand Down Expand Up @@ -210,9 +222,9 @@ Once your PR is approved and merged, you're officially a contributor! Your code
- [Mobile Development](/docs/development/formulus-development)

**Contributing to Documentation:**
- Documentation uses Markdown and Docusaurus
- Edit files in `/docs` folder
- Run `npm run start` to preview changes
- Documentation lives in the separate [docs](https://github.com/OpenDataEnsemble/docs) repository (Markdown + Docusaurus)
- That site still uses **npm** for its own tooling (`npm install`, `npm start` in the docs repo)
- ODE application code in this monorepo uses **pnpm** (see above)
- Follow the same PR process for doc changes

### Common Tasks for First-Time Contributors
Expand Down
8 changes: 5 additions & 3 deletions docs/developer/developer-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ brew install node go postgresql git
```bash
sudo apt-get update
sudo apt-get install nodejs npm golang postgresql git
# Enable pnpm for the ODE monorepo (pinned in package.json files):
# corepack enable && corepack prepare pnpm@10.33.2 --activate
```

**Windows:**
Expand Down Expand Up @@ -288,13 +290,13 @@ ODE maintains high standards:
### JavaScript/TypeScript
```bash
# Run linter
npm run lint
pnpm run lint

# Auto-fix issues
npm run lint:fix
pnpm run lint:fix

# Format code
npm run format
pnpm run format
```

### Go
Expand Down
49 changes: 25 additions & 24 deletions docs/development/building-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ Build the React Native mobile application:

```bash
cd formulus
npm install
npm run android # For Android
npm run ios # For iOS (macOS only)
cd ../packages/tokens && pnpm install && pnpm run build && cd ../formulus
pnpm install
pnpm run android # For Android
pnpm run ios # For iOS (macOS only)
```

</TabItem>
Expand Down Expand Up @@ -54,18 +55,18 @@ Or build from Xcode:
Build the React web form renderer:

```bash
cd formulus-formplayer
npm install
npm run build
cd ../packages/tokens && pnpm install && pnpm run build && cd ../formulus-formplayer
pnpm install
pnpm run build
```

**Build for React Native:**
**Build and copy into Formulus (and Desktop):**

```bash
npm run build:rn
pnpm run build:copy
```

This builds and copies the output to the Formulus app.
This builds and copies the output to the Formulus app (and ODE Desktop when using the full pipeline).

### Synkronus

Expand Down Expand Up @@ -125,7 +126,7 @@ go build -o bin/synk ./cmd/synkronus

```bash
cd formulus
npm test
pnpm run test --ci --coverage --watchAll=false
```

Runs Jest tests with React Native Testing Library.
Expand All @@ -134,10 +135,10 @@ Runs Jest tests with React Native Testing Library.

```bash
cd formulus-formplayer
npm test
pnpm run test run
```

Runs Jest tests for React components.
Runs Vitest for React components.

### Backend Testing

Expand Down Expand Up @@ -187,13 +188,13 @@ E2E testing will be added as the testing infrastructure evolves.
```bash
# Formulus
cd formulus
npm run lint
npm run lint:fix
pnpm run lint
pnpm run lint:fix

# Formplayer
cd formulus-formplayer
npm run lint
npm run lint:fix
pnpm run lint
pnpm run lint:fix
```

**Backend:**
Expand All @@ -210,10 +211,10 @@ golangci-lint run # If configured

```bash
# Format code
npm run format
pnpm run format

# Check formatting
npm run format:check
pnpm run format:check
```

**Backend:**
Expand Down Expand Up @@ -250,8 +251,8 @@ Run CI checks locally:

```bash
# Frontend
cd formulus && npm run lint && npm run format:check && npm test
cd formulus-formplayer && npm run lint && npm run format:check && npm test
cd formulus && pnpm run lint && pnpm run format:check && pnpm run test --ci --coverage --watchAll=false
cd formulus-formplayer && pnpm run lint && pnpm run format:check && pnpm run test run

# Backend
cd synkronus && go test ./... && go fmt ./...
Expand Down Expand Up @@ -318,8 +319,8 @@ git push origin v1.0.0

```bash
# Clear and reinstall
rm -rf node_modules package-lock.json
npm install
rm -rf node_modules
pnpm install
```

### Go Module Issues
Expand All @@ -338,7 +339,7 @@ go mod tidy
cd android
./gradlew clean
cd ..
npm run android
pnpm run android
```

### iOS Build Issues
Expand All @@ -349,7 +350,7 @@ cd ios
rm -rf Pods Podfile.lock
bundle exec pod install
cd ..
npm run ios
pnpm run ios
```

## Related Documentation
Expand Down
17 changes: 8 additions & 9 deletions docs/development/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,12 @@ Use descriptive branch names:
### 5. Test Your Changes

```bash
# Frontend projects
npm test
npm run lint
npm run format:check
# Frontend projects (from each package directory; see Development Setup for pnpm)
cd formulus && pnpm run lint && pnpm run format:check && pnpm run test --ci --coverage --watchAll=false
cd formulus-formplayer && pnpm run lint && pnpm run format:check && pnpm run test run

# Go projects
go test ./...
cd synkronus && go test ./...
go fmt ./...
```

Expand Down Expand Up @@ -171,10 +170,10 @@ func (s *Service) GetUser(username string) (*User, error) {
Ensure your code passes all quality checks:

```bash
# Frontend
npm run lint
npm run format:check
npm test
# Frontend (pnpm, per package directory)
pnpm run lint
pnpm run format:check
pnpm run test

# Backend
go test ./...
Expand Down
40 changes: 24 additions & 16 deletions docs/development/formplayer-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,27 @@ Formplayer is a React web application that renders JSON Forms. It runs within We

## Prerequisites

- **Node.js** 18+ and npm
- **Node.js** 20+ and **pnpm** 10.33.2
- **React** development experience
- **`@ode/tokens` built** — from `packages/tokens`: `pnpm install && pnpm run build` (see [Development Setup](/docs/development/setup#package-manager-pnpm))

## Local Development

### Setup

```bash
cd packages/tokens && pnpm install && pnpm run build && cd ../..
cd formulus-formplayer
npm install
pnpm install
```

### Development Server

```bash
npm start
pnpm start
```

Opens at http://localhost:3000
Opens at http://localhost:3000 (or the port Vite prints).

### Development Features

Expand All @@ -40,25 +42,30 @@ Opens at http://localhost:3000

## Building

### Build for React Native

Build and copy to Formulus app:
### Build and copy to Formulus (and ODE Desktop)

```bash
npm run build:rn
pnpm run build:copy
```

This:
1. Builds the React app
2. Copies build to Formulus app directory
3. Updates WebView assets

### Build for Web
1. Syncs the Formulus interface definition
2. Builds the React app (`build/`)
3. Copies assets into Formulus Android/iOS formplayer directories
4. Copies assets into `desktop/public/formplayer_dist/` when building the full pipeline

Standard web build:
From **ODE Desktop** only (requires an existing `formulus-formplayer/build/`):

```bash
npm run build
cd desktop
pnpm copy:formplayer
```

### Build for Web only

```bash
pnpm run build
```

Output in `build/` directory.
Expand All @@ -82,14 +89,15 @@ Output in `build/` directory.
2. **Register in Formplayer:**
Add to Formplayer configuration when initialized by Formulus.

When you change `formulus/src/webview/FormulusInterfaceDefinition.ts`, run `pnpm run sync-interface` (or `pnpm run build`) in formulus-formplayer.

## Testing

```bash
npm test
pnpm run test run
```

## Related Documentation

- [Formplayer Reference](/reference/formplayer) - Component reference
- [Form Design Guide](/guides/form-design) - Creating forms

Loading
Loading