Skip to content

Commit 3c4a5c3

Browse files
Merge pull request #93 from elek-io/add-field-definition-forms
Add all field definition forms for field types but dynamic
2 parents a13d8be + 70357ba commit 3c4a5c3

112 files changed

Lines changed: 13404 additions & 6477 deletions

File tree

Some content is hidden

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

.changeset/curvy-zod-aligns.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@elek-io/client': patch
3+
---
4+
5+
Adopt @elek-io/core 0.20.0 and align on a single zod 4.4.3. Core now declares zod as a peer dependency and re-exports z, so the app supplies the shared zod copy. This dedupes zod to one physical version and clears the zodResolver type errors.

.changeset/fair-forms-regroup.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@elek-io/client': patch
3+
---
4+
5+
Render field-definition groups and finish adapting the dynamic form system to @elek-io/core 0.20.0. Groups in a Collection's fieldDefinitions are shown as labeled fieldsets in the Entry form and Collection editor, field definitions are flattened where grouping is irrelevant, and a Project's commit history now comes from a dedicated projects.history query instead of the Project read. Form typing was reworked to infer react-hook-form types from the generated Zod schemas.

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Check out all text files with LF line endings on every platform.
2+
# Prettier enforces LF, and without this the default autocrlf setting on
3+
# Windows (including the GitHub Windows runners) converts files to CRLF at
4+
# checkout, failing the lint and format checks there.
5+
* text=auto eol=lf

.github/workflows/cd.yml

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,35 @@ on:
44
push:
55
branches:
66
- main
7+
concurrency: ${{ github.workflow }}-${{ github.ref }}
8+
9+
permissions:
10+
contents: write # Required for pushing commits via changesets action
11+
pull-requests: write # Required for creating release PRs via changesets action
712

813
jobs:
9-
release:
10-
name: Preparing new release on ${{ matrix.platform }} with Node.js ${{ matrix.node-version }}
11-
timeout-minutes: 20
12-
strategy:
13-
matrix:
14-
# @see https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
15-
# macos-13 = intel
16-
# macos-14+ = M1 (arm)
17-
platform: [ubuntu-24.04, macos-13, macos-15, windows-2025]
18-
node-version: [22]
19-
runs-on: ${{ matrix.platform }}
14+
changesets:
15+
name: Create or update release pull request
16+
timeout-minutes: 15
17+
runs-on: ubuntu-24.04
18+
outputs:
19+
hasChangesets: ${{ steps.changesets.outputs.hasChangesets }}
2020
steps:
2121
- name: Check out code
2222
uses: actions/checkout@v4
2323
with:
2424
fetch-depth: 1
2525
- name: Install pnpm
2626
uses: pnpm/action-setup@v4
27-
with:
28-
version: 10
29-
- name: Setup Node.js ${{ matrix.node-version }} environment
27+
- name: Setup Node.js environment
3028
uses: actions/setup-node@v4
3129
with:
32-
node-version: ${{ matrix.node-version }}
30+
node-version-file: '.node-version'
3331
cache: 'pnpm'
3432
- name: Install dependencies
3533
run: pnpm install --frozen-lockfile
36-
- name: Run linter
37-
run: pnpm run lint
34+
- name: Run lint, check types and formatting
35+
run: pnpm run lint && pnpm run check-types && pnpm run check-format
3836
- name: Create or update pull request
3937
id: changesets
4038
uses: changesets/action@v1
@@ -43,8 +41,34 @@ jobs:
4341
commit: Release new version
4442
env:
4543
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46-
- name: Publish
47-
if: steps.changesets.outputs.hasChangesets == 'false'
48-
run: pnpm run build
44+
45+
release:
46+
name: Releasing on ${{ matrix.platform }}
47+
needs: changesets
48+
# Only build once the release pull request has been merged
49+
if: needs.changesets.outputs.hasChangesets == 'false'
50+
timeout-minutes: 20
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
# Mirrors the platforms and Node.js version @elek-io/core tests on
55+
platform: [ubuntu-24.04, macos-15-intel, macos-15, windows-2025]
56+
runs-on: ${{ matrix.platform }}
57+
steps:
58+
- name: Check out code
59+
uses: actions/checkout@v4
60+
with:
61+
fetch-depth: 1
62+
- name: Install pnpm
63+
uses: pnpm/action-setup@v4
64+
- name: Setup Node.js environment
65+
uses: actions/setup-node@v4
66+
with:
67+
node-version-file: '.node-version'
68+
cache: 'pnpm'
69+
- name: Install dependencies
70+
run: pnpm install --frozen-lockfile
71+
- name: Build and upload to a draft GitHub Release
72+
run: pnpm run build --publish always
4973
env:
5074
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@ on:
55

66
jobs:
77
test:
8-
name: Testing on ${{ matrix.platform }} with Node.js ${{ matrix.node-version }}
8+
name: Testing on ${{ matrix.platform }}
99
timeout-minutes: 20
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
# @see https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
14-
# macos-13 = intel
15-
# macos-14+ = M1 (arm)
16-
platform: [ubuntu-24.04, macos-13, macos-15, windows-2025]
17-
node-version: [22]
13+
# Mirrors the platforms and Node.js version @elek-io/core tests on
14+
platform: [ubuntu-24.04, macos-15-intel, macos-15, windows-2025]
1815
runs-on: ${{ matrix.platform }}
1916
steps:
2017
- name: Check out code
@@ -23,19 +20,15 @@ jobs:
2320
fetch-depth: 1
2421
- name: Install pnpm
2522
uses: pnpm/action-setup@v4
26-
with:
27-
version: 10
28-
- name: Setup Node.js ${{ matrix.node-version }} environment
23+
- name: Setup Node.js environment
2924
uses: actions/setup-node@v4
3025
with:
31-
node-version: ${{ matrix.node-version }}
26+
node-version-file: '.node-version'
3227
cache: 'pnpm'
3328
- name: Install dependencies
3429
run: pnpm install --frozen-lockfile
35-
- name: Run linter
36-
run: pnpm run lint
37-
# - name: Run typecheck
38-
# run: pnpm run check-types
30+
- name: Run lint, check types and formatting
31+
run: pnpm run lint && pnpm run check-types && pnpm run check-format
3932
# - name: Identify misconfigurations and security anti-patterns
4033
# uses: doyensec/electronegativity-action@v2
4134
# - name: Upload report

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

AGENTS.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# AGENTS.md
2+
3+
Guidance for AI agents and contributors working on `@elek-io/client`.
4+
5+
`@elek-io/core` handles file IO and git version control for elek.io Projects, a headless, git-backed CMS. It is published as a TypeScript library with Node, Browser, Astro and CLI entry points.
6+
7+
`@elek-io/client` uses `@elek-io/core` and provides a UI on top of that business logic, packaged with Electron as a cross-platform desktop application.
8+
9+
## Documentation
10+
11+
Documentation is split by what you are working on:
12+
13+
- [`contributing/`](./contributing/) - contributor and design docs for the client: the Electron process architecture, the IPC security model, TanStack Query data loading, and the dynamic form system. Start at [`contributing/README.md`](./contributing/README.md). The client ships as a packaged desktop app, not an npm package, so these docs are never shipped and may link anywhere.
14+
- **Core's behavior** is documented inside the `@elek-io/core` package itself. After `pnpm install`, read it under [`node_modules/@elek-io/core/docs/`](./node_modules/@elek-io/core/docs/index.md) (content export, the local API, API client generation, fields, storage layout, and more). This is the reference for anything the client delegates to Core.
15+
- To **contribute to Core** itself, use the [`@elek-io/core` repository](https://github.com/elek-io/core). Core's own contributor docs are not part of its published package, so they live only there.
16+
17+
Two rules follow:
18+
19+
- **Read before you change.** Before working on an area, read its doc first so you change behavior on purpose, not by guesswork. For client behavior that is the matching doc in `contributing/`; for behavior that comes from Core, read Core's docs in the package.
20+
- **Write after you change.** When you change client behavior a user or contributor should know about, update the matching doc in `contributing/` in the same change. Changes to Core itself do not belong in this repo - make them in the separate [`@elek-io/core`](https://github.com/elek-io/core) repository and document them there.
21+
22+
## Commands
23+
24+
- `pnpm install` - install dependencies (use pnpm, not npm)
25+
- `pnpm dev` - start the app in development with HMR (electron-vite)
26+
- `pnpm start` - preview the built app (electron-vite preview)
27+
- `pnpm build` - clean, build and package for the current platform (electron-vite then electron-builder)
28+
- `pnpm build:unpack` - build without packaging, faster for local testing
29+
- `pnpm build:win` / `pnpm build:mac` / `pnpm build:linux` - package for a specific platform
30+
- `pnpm check-types` - type-check both processes with tsc, no emit (`check-types:node` and `check-types:web` cover one process each)
31+
- `pnpm lint` - run eslint
32+
- `pnpm format` - format with prettier
33+
34+
## Conventions
35+
36+
- Prefer a library's built-in feature over hand-rolled code.
37+
- Avoid type casts. Shape the types so a cast is not needed.
38+
- Keep comments short and put deeper detail in the docs. Avoid em-dashes and semicolons, use simple sentences for readability.
39+
40+
## Testing notes
41+
42+
- The client has no automated test runner configured yet, so there are no existing tests to follow. Until one is set up, verify a change by running the app with `pnpm dev` telling the user to exercise the affected flows, and make sure `pnpm check-types` and `pnpm lint` pass before considering it done.
43+
- All Core file and git operations run in the main process and are reached from the renderer only through `window.ipc`. Exercise them through the running app, not in isolation.

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@AGENTS.md

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
> A modern, offline-first content management system (CMS) and digital asset manager (DAM).
44
5-
[![Version](https://img.shields.io/badge/version-0.3.2-blue.svg)](https://github.com/elek-io/client/releases)
65
[![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey.svg)](https://github.com/elek-io/client)
7-
[![License](https://img.shields.io/badge/license-todo-red.svg)](LICENSE)
86

97
> [!IMPORTANT]
108
> elek.io Client is under active development and not yet ready for production usage! Feel free to check it out and make suggestions.
@@ -21,7 +19,7 @@ elek.io Client solves these problems by being an offline-first desktop applicati
2119
- **Cross-Platform**: Desktop apps for Windows, macOS, and Linux
2220
- **Version Control**: Every Project is a Git repository with full version history
2321
- **Easy backups & collaboration (optional)**: Synchronize to any Git hosting service (GitHub, GitLab, Bitbucket etc.) to work together with others and have a backup if needed
24-
- **Multi-Language**: Built-in support for 25 languages
22+
- **Multi-Language**: Built-in support for 24 languages
2523
- **Structured Content**: Define custom content types (Collections) with field definitions
2624
- **Developer-Friendly**: Local read-only OpenAPI REST API with optional typesafe TS/JS API Client generation and JSON file exports for programmatic access to your content e.g. to use with static site generators
2725

@@ -33,11 +31,11 @@ Download the latest version for your platform:
3331

3432
- **Windows**: [Download installer](https://github.com/elek-io/client/releases)
3533
- **macOS**: [Download DMG](https://github.com/elek-io/client/releases)
36-
- **Linux**: Download [AppImage](https://github.com/elek-io/client/releases) / [Snap](https://snapcraft.io/) / [DEB](https://github.com/elek-io/client/releases)
34+
- **Linux**: Download [AppImage](https://github.com/elek-io/client/releases) / [Snap](https://github.com/elek-io/client/releases) / [DEB](https://github.com/elek-io/client/releases)
3735

3836
### System Requirements
3937

40-
Altough elek.io Client might run on older hard and software than listed below, the following is the recommended minimum:
38+
Although elek.io Client might run on older hard and software than listed below, the following is the recommended minimum:
4139

4240
- **Windows**: Windows 10 or later
4341
- **macOS**: macOS 13.7.6 (Ventura) or later
@@ -47,4 +45,4 @@ Altough elek.io Client might run on older hard and software than listed below, t
4745

4846
## For Developers
4947

50-
For insight on how elek.io Client works, please refer to the [documentation folder](documentation/overview.md).
48+
For insight on how elek.io Client works, please refer to the [contributing folder](contributing/README.md).
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Welcome to the elek.io Client developer documentation. This guide will help you understand the codebase architecture and development patterns.
44

55
> [!NOTE]
6-
> If your main interest is using Projects content inside your own applications, you can skip to the [Consuming Content Locally](./consuming-content-locally.md) section.
6+
> This folder documents how to **contribute to** elek.io Client. If instead you want to consume your Projects' content inside your own applications, see the [@elek-io/core documentation](https://github.com/elek-io/core). Core ships its full guides (content export, local API, API client generation) both in its repository and in the package's `docs` folder.
77
88
## Prerequisites
99

@@ -18,9 +18,16 @@ Welcome to the elek.io Client developer documentation. This guide will help you
1818

1919
Then proceed to the specific topics based on your interests or contribution goals:
2020

21+
- **[Routing](./renderer/routing.md)** - File-based routing, layout routes, hash history, and why data is fetched in components rather than route guards
2122
- **[Loading and Updating Data](./renderer/loading-and-updating-data.md)** - TanStack Query patterns for data fetching and mutations
22-
- **[Dynamic Form Generation](./renderer/dynamic-form-field-generation.md)** - How user-defined forms work with field definitions
23+
- **[Dynamic Form Field Generation](./renderer/dynamic-form-field-generation.md)** - How user-defined forms work with field definitions
24+
- **[Markdown Editor](./renderer/markdown-editor.md)** - The Milkdown based mdast editor for markdown fields: the tree bridge, feature gating, and reference nodes
2325
- **[Breadcrumb Navigation](./renderer/breadcrumb-navigation.md)** - Route-based breadcrumb system for hierarchical navigation
26+
- **[Theming and Styling](./renderer/theming-and-styling.md)** - shadcn/ui components, Tailwind v4 CSS configuration, and dark mode
27+
- **[Internationalization](./renderer/internationalization.md)** - translations, datetime locales, and multi-language form state
28+
- **[Releasing](./releasing.md)** - versioning with changesets and how CD publishes draft GitHub Releases
29+
30+
For a running list of things Core supports but the client cannot use yet, see **[Not Yet Implemented](./not-yet-implemented.md)**. Add to it whenever you find such a gap.
2431

2532
## Contributing
2633

@@ -29,7 +36,6 @@ When updating these docs:
2936
- Keep code examples up-to-date with actual implementation
3037
- Include file references with line numbers where relevant
3138
- Add practical examples for complex concepts
32-
- Update the "Last Updated" date at the bottom of each document
3339

3440
## Additional Resources
3541

@@ -38,7 +44,3 @@ When updating these docs:
3844
- [React Hook Form Documentation](https://react-hook-form.com/get-started)
3945
- [shadcn/ui Documentation](https://ui.shadcn.com/docs)
4046
- [@elek-io/core Repository](https://github.com/elek-io/core)
41-
42-
---
43-
44-
**Last Updated:** 2025-12-04

0 commit comments

Comments
 (0)