# @luomus/laji-form-builder

> UI for building laji.fi forms

Latest version **1.1.11** (published 2026-04-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install @luomus/laji-form-builder
pnpm add @luomus/laji-form-builder
yarn add @luomus/laji-form-builder
bun add @luomus/laji-form-builder
```

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.1.11 |
| Published | 2026-04-09 |
| First published | 2023-11-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 19 |
| Unpacked size | 487 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Olli Raitio |
| Maintainers | olzraiti, mjlumme, merannis, blodir, rpulkka |
| Keywords | laji-form, laji.fi, FinBIF, luomus, react-jsonschema-form |

## Links

- npm: https://www.npmjs.com/package/@luomus/laji-form-builder
- Repository: https://github.com/luomus/laji-form-builder
- Homepage: https://github.com/luomus/laji-form-builder#readme
- Issues: https://github.com/luomus/laji-form-builder/issues
- npm.io page: https://npm.io/package/@luomus/laji-form-builder

## Dependencies (19)

- [react](https://npm.io/package/react.md) ^17.0.2
- [memoizee](https://npm.io/package/memoizee.md) ^0.4.14
- [deep-diff](https://npm.io/package/deep-diff.md) ^1.0.2
- [deepmerge](https://npm.io/package/deepmerge.md) ^4.2.2
- [react-dom](https://npm.io/package/react-dom.md) ^17.0.2
- [cross-fetch](https://npm.io/package/cross-fetch.md) ^3.1.5
- [json-schema](https://npm.io/package/json-schema.md) ^0.3.0
- [@types/react](https://npm.io/package/@types/react.md) ^16.14.14
- [react-spinner](https://npm.io/package/react-spinner.md) ^0.2.7
- [@types/memoizee](https://npm.io/package/@types/memoizee.md) ^0.4.3
- [fast-json-patch](https://npm.io/package/fast-json-patch.md) ^3.1.0
- [react-bootstrap](https://npm.io/package/react-bootstrap.md) ^0.33.1
- [@types/deep-diff](https://npm.io/package/@types/deep-diff.md) ^1.0.2
- [@types/react-dom](https://npm.io/package/@types/react-dom.md) ^17.0.9
- [react-tree-graph](https://npm.io/package/react-tree-graph.md) ^8.0.1
- [@luomus/laji-form](https://npm.io/package/@luomus/laji-form.md) ^15.1.103
- [@types/react-spinner](https://npm.io/package/@types/react-spinner.md) ^0.2.0
- [@types/react-bootstrap](https://npm.io/package/@types/react-bootstrap.md) ^0.32.25
- [@luomus/parse-prop-types](https://npm.io/package/@luomus/parse-prop-types.md) ^0.3.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.1.11 (latest) — 2026-04-09
- 1.1.10 — 2026-04-09
- 1.1.9 — 2026-01-15
- 1.1.8 — 2024-04-26
- 1.1.7 — 2024-04-22
- 1.1.5 — 2024-04-19
- 1.1.3 — 2024-01-16
- 1.1.2 — 2024-01-16
- 1.1.1 — 2024-01-16
- 1.1.0 — 2024-01-16
- 1.0.32 — 2024-01-11
- 1.0.31 — 2024-01-10
- 1.0.29 — 2023-11-03
- 1.0.28 — 2023-11-03

## README

# laji-form-builder

This repo is responsible for two things:
* the **server** aka form backend which runs at https://form.laji.fi
* the **client** which is a React component for editing forms. Available as an npm package [`laji-form-builder`](https://www.npmjs.com/package/laji-form-builder).

## Server API

* `/?{lang:fi | en | sv = fi}` UI for selecting/deleting a form
* `/:id?{lang:fi | en | sv = fi}` UI for editing a form

REST JSON API `/api`:
* `/api?{lang?: fi | en | sv}` list forms as JSON
* `/api/:id?{lang?: fi | en | sv, format: json | schema | schema-with-enums = json, expand: true | false = true}` list forms as JSON
* `/api` (`POST`) Create new form entry
* `/api/:id` (`PUT`) Update form entry
* `/api/:id` (`DELETE`) Delete form entry
* `/api/transform?{lang?: fi | en | sv}` (`POST`) Transform BODY from `json` format to `schema` format
* `/api/flush` flushes cache

## Client API

For documentation, see how the server uses the `Builder` component: https://github.com/luomus/laji-form-builder/blob/master/src/server/view/app.tsx

## Development

### Stack

* node
* TypeScript
* express
* React
* playwright (e2e tests)
* supertest (express tests)

Correct node version is selected with `volta` or `nvm use default`.

### Install dependencies
```
npm ci
```

### Configuration

Copy `config.json.example` to `config.json`, and fill the configuration file.

### Development

Start the development server (it's the same as the production server but with hot reload enabled so code changed are reflected upon file changes):
```
npm start
```

### Tests

#### Server

Server is tested without having to run the server. Just run:

```
npm run test:server
```

##### Env variables:

* `MOCK=true`: Field service test API requests are mocked by default.
* `CREATE_MOCKS=false`: Field service test API responses mock are recreated.

#### Client

Server can be running or or not. If it's not running, it will be automatically started.

```
npm run test:client
```

##### Dependencies

To run the tests, you might need to install playwright dependencies:

```
npx playwright install
```

If you run into issues with browser dependencies etc, there's also a dockerized runner:

```
# Run all tests (builds docker image & runs it)
npm run test:docker

# Or if you want to give playwright params, run certain tests etc:
npm run test:docker -- test/client/editor.ts --project chromium
```

### Build

#### Server

To build the server (compiles both `static` and `build`):
```
npm run build:server
```

In production, run the built server with:

```
npm run start:prod
````

#### npm package

To build the npm package (compiles `lib`):
```
npm run build:client
```

### Publishing to npm

Run `npm version {patch,minor,major}`. This will run the linting & front end tests (and halt if they fail), build the client and publish to npm. We follow [semantic versioning](https://docs.npmjs.com/about-semantic-versioning).

---
_Source: https://npm.io/package/@luomus/laji-form-builder · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
