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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

[Home](README.md)

All notable changes to this project will be documented in this file.

This file is intended to be generated and updated with `git-cliff`.
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# nicegui-builder

[Home](README.md)

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Python 3.10+](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue.svg)](pyproject.toml)
[![CI](https://github.com/onclefranck/nicegui-builder/actions/workflows/ci.yml/badge.svg)](https://github.com/onclefranck/nicegui-builder/actions/workflows/ci.yml)
Expand All @@ -8,6 +10,11 @@

`nicegui-builder` is a Python library for building NiceGUI interfaces from declarative layouts and schema-aware plugins.

> [!WARNING]
> This is an early pre-release published to invite discovery and feedback.
> The project is not presented as production-ready or fully stabilized yet.
> Expect API changes, rough edges, and evolving behavior while the library is still taking shape.

It currently provides three main entry points:

- `builder(layout)` for declarative NiceGUI rendering
Expand Down Expand Up @@ -37,7 +44,7 @@ nicegui-builder --help
## Stable API

Top-level imports from `nicegui_builder` are the supported stable public API.
See `docs/public-api.md` for the current stable surface.
See [`docs/public-api.md`](docs/public-api.md) for the current stable surface.

## Quick Start

Expand Down Expand Up @@ -319,7 +326,7 @@ The `pydantic` plugin resolves `field__...` nodes using:

- field type
- field constraints and metadata
- plugin-local widget mapping in `src/nicegui_builder/plugins/pydantic/pydantic-nicegui.yml`
- plugin-local widget mapping in [`src/nicegui_builder/plugins/pydantic/pydantic-nicegui.yml`](src/nicegui_builder/plugins/pydantic/pydantic-nicegui.yml)

Example:

Expand Down Expand Up @@ -351,8 +358,8 @@ Example:

## More Docs

- `docs/public-api.md`: stable public API
- `docs/plugin.md`: how to build a new plugin
- `docs/architecture.md`: architecture and class diagram
- `docs/publishing.md`: TestPyPI and PyPI publishing guide
- `docs/product-roadmap.md`: roadmap history
- [`docs/public-api.md`](docs/public-api.md): stable public API
- [`docs/plugin.md`](docs/plugin.md): how to build a new plugin
- [`docs/architecture.md`](docs/architecture.md): architecture and class diagram
- [`docs/publishing.md`](docs/publishing.md): TestPyPI and PyPI publishing guide
- [`docs/product-roadmap.md`](docs/product-roadmap.md): roadmap history
4 changes: 0 additions & 4 deletions cspell-project-words.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
dunder
fieldvalue
firstname
Honoré
Keir
lastname
nicegui
postalcode
pydantic
Québec
Starmer
12 changes: 8 additions & 4 deletions docs/architecture.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Architecture

[Home](../README.md)

[Previous: Plugin Development](plugin.md) | [Next: Public API](public-api.md)

This document describes the current architecture of `nicegui-builder` in a way that is meant to be readable by humans first.

The main idea is simple:
Expand Down Expand Up @@ -383,7 +387,7 @@ If someone is new to the project, the best order is:

## Related Documents

- `README.md` for using the library
- `docs/plugin.md` for writing plugins
- `docs/public-api.md` for the stable API surface
- `docs/examples.md` for the planned example set
- [`README.md`](../README.md) for using the library
- [`docs/plugin.md`](plugin.md) for writing plugins
- [`docs/public-api.md`](public-api.md) for the stable API surface
- [`docs/examples.md`](examples.md) for the planned example set
6 changes: 5 additions & 1 deletion docs/examples.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Examples Roadmap

[Home](../README.md)

[Previous: Public API](public-api.md) | [Next: Product Roadmap](product-roadmap.md)

This document proposes a progressive set of examples to document `nicegui-builder`.

The goal is to cover the public API in increasing order of complexity, while keeping each example focused and easy to understand.
Expand All @@ -18,7 +22,7 @@ Each example should ideally:

A ready-to-copy VS Code debug template lives at:

- `src/nicegui_builder/examples/vscode/launch.json`
- [`src/nicegui_builder/examples/vscode/launch.json`](../src/nicegui_builder/examples/vscode/launch.json)

Usage:

Expand Down
18 changes: 11 additions & 7 deletions docs/plugin.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Plugin Development

[Home](../README.md)

[Previous: Publishing](publishing.md) | [Next: Architecture](architecture.md)

This document explains how to add a new source plugin to `nicegui-builder`.

## Goal
Expand Down Expand Up @@ -43,7 +47,7 @@ They typically implement:
- `resolve_widget(spec, variant="std")`
- optional `render_form(source, flavor="")`

See `src/nicegui_builder/plugins/base.py`.
See [`src/nicegui_builder/plugins/base.py`](../src/nicegui_builder/plugins/base.py).

### Collection Plugins

Expand Down Expand Up @@ -135,11 +139,11 @@ The `pydantic` plugin is a good reference for form-oriented plugins.

Its code is organized under:

- `src/nicegui_builder/plugins/pydantic/inspect.py`
- `src/nicegui_builder/plugins/pydantic/mapping.py`
- `src/nicegui_builder/plugins/pydantic/resolve.py`
- `src/nicegui_builder/plugins/pydantic/plugin.py`
- `src/nicegui_builder/plugins/pydantic/pydantic-nicegui.yml`
- [`src/nicegui_builder/plugins/pydantic/inspect.py`](../src/nicegui_builder/plugins/pydantic/inspect.py)
- [`src/nicegui_builder/plugins/pydantic/mapping.py`](../src/nicegui_builder/plugins/pydantic/mapping.py)
- [`src/nicegui_builder/plugins/pydantic/resolve.py`](../src/nicegui_builder/plugins/pydantic/resolve.py)
- [`src/nicegui_builder/plugins/pydantic/plugin.py`](../src/nicegui_builder/plugins/pydantic/plugin.py)
- [`src/nicegui_builder/plugins/pydantic/pydantic-nicegui.yml`](../src/nicegui_builder/plugins/pydantic/pydantic-nicegui.yml)

The YAML file is plugin-local on purpose, so the plugin stays self-contained.

Expand Down Expand Up @@ -169,7 +173,7 @@ It shows how to:

See:

- `src/nicegui_builder/plugins/pandas/plugin.py`
- [`src/nicegui_builder/plugins/pandas/plugin.py`](../src/nicegui_builder/plugins/pandas/plugin.py)

## Testing Guidance

Expand Down
4 changes: 4 additions & 0 deletions docs/product-roadmap.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Product Roadmap

[Home](../README.md)

[Previous: Examples Roadmap](examples.md)

This roadmap tracks the next user-facing capabilities for `nicegui-builder`.

## 1. Rich Form Validation
Expand Down
4 changes: 4 additions & 0 deletions docs/public-api.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Public API

[Home](../README.md)

[Previous: Architecture](architecture.md) | [Next: Examples Roadmap](examples.md)

This document defines the supported public API surface for `nicegui-builder`.

## Stable
Expand Down
30 changes: 17 additions & 13 deletions docs/publishing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Publishing

[Home](../README.md)

[Next: Plugin Development](plugin.md)

This document explains how to publish `nicegui-builder` to TestPyPI and PyPI.

## Publishing Strategy
Expand Down Expand Up @@ -28,7 +32,7 @@ Important:
- every upload must use a new version
- TestPyPI also rejects re-uploading the same file/version combination

The version currently lives in `pyproject.toml`.
The version currently lives in [`pyproject.toml`](../pyproject.toml).

## One-Time Setup

Expand Down Expand Up @@ -112,11 +116,11 @@ Preview only the unreleased changes:
git-cliff --unreleased
```

If you later want GitHub-enriched metadata for a private repository, provide a token and disable offline mode in `cliff.toml`.
If you later want GitHub-enriched metadata for a private repository, provide a token and disable offline mode in [`cliff.toml`](../cliff.toml).

Recommended release habit:

1. update the version in `pyproject.toml`
1. update the version in [`pyproject.toml`](../pyproject.toml)
2. run `git-cliff -o CHANGELOG.md`
3. review the generated changelog
4. commit the version bump and changelog together
Expand All @@ -128,10 +132,10 @@ Use this for development and packaging validation.

### Recommended steps

1. update the version in `pyproject.toml` to a development version
1. update the version in [`pyproject.toml`](../pyproject.toml) to a development version
2. commit the change on `develop`
3. push the branch
4. trigger the `Publish TestPyPI` workflow manually in GitHub Actions
4. trigger the [`Publish TestPyPI`](../.github/workflows/publish-testpypi.yml) workflow manually in GitHub Actions
5. verify installation from TestPyPI

Example install:
Expand All @@ -147,11 +151,11 @@ Use this for stable releases only.
### Recommended steps

1. make sure tests pass
2. update the version in `pyproject.toml` to a stable version
2. update the version in [`pyproject.toml`](../pyproject.toml) to a stable version
3. commit the release version
4. merge the approved release PR into `main`
5. create and push a git tag like `v0.1.0` from `main`
6. let the `Publish PyPI` workflow publish the package
6. let the [`Publish PyPI`](../.github/workflows/publish-pypi.yml) workflow publish the package
7. verify installation from PyPI

Example:
Expand All @@ -171,13 +175,13 @@ pip install nicegui-builder

The repository now includes:

- package metadata in `pyproject.toml`
- package metadata in [`pyproject.toml`](../pyproject.toml)
- package-data inclusion for YAML files
- `MANIFEST.in` for source distribution completeness
- build tooling in `requirements-dev.txt`
- `git-cliff` configuration in `cliff.toml`
- `CHANGELOG.md`
- GitHub Actions workflows for TestPyPI and PyPI
- [`MANIFEST.in`](../MANIFEST.in) for source distribution completeness
- build tooling in [`requirements-dev.txt`](../requirements-dev.txt)
- `git-cliff` configuration in [`cliff.toml`](../cliff.toml)
- [`CHANGELOG.md`](../CHANGELOG.md)
- GitHub Actions workflows in [`publish-testpypi.yml`](../.github/workflows/publish-testpypi.yml) and [`publish-pypi.yml`](../.github/workflows/publish-pypi.yml)

## Practical Advice

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "nicegui-builder"
version = "0.0.0.dev2"
version = "0.0.0.dev3"
description = "Plugin-first NiceGUI builders for declarative layouts, forms, and tables"
readme = "README.md"
license = "MIT"
Expand Down
10 changes: 5 additions & 5 deletions src/nicegui_builder/examples/example_contact_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,35 @@ class ContactAddress(BaseModel):
default="",
title="Full name",
description="The full name",
examples=["Mark Carney", "Keir Starmer", "Alex Morgan"],
examples=["Jordan Lee", "Taylor Brooks", "Alex Morgan"],
)

address: str = Field(
default="",
title="Address line",
description="The door number, the street and the suite",
examples=["1 Sussex Drive", "10 Downing Street", "55 Orchard Avenue"],
examples=["142 Willow Crest Lane", "27 Maple Court, Suite 4B", "908 Harbor View Avenue"],
)

city: str = Field(
default="",
title="City",
description="The city",
examples=["Ottawa", "London", "Boston"],
examples=["North Briar", "Maple Glen", "Harbor Point"],
)

province: str = Field(
default="",
title="Province",
description="The province",
examples=["Quebec", "", ""],
examples=["Westfield", "Lake District", "North County"],
)

postalcode: str = Field(
default="",
title="Postal code",
description="The postal code",
examples=["K1A 0A1", "SW1A 2AA", "75008"],
examples=["WL3 8QT", "MC4 2LB", "HV7 1RN"],
)

country: str = Field(
Expand Down
Loading