Skip to content

javaabu/forms v2.0: Onu and Bootstrap 6, parity with @javaabu/forms, assets via manifest - #16

Open
n4ff4h wants to merge 17 commits into
mainfrom
next-gen
Open

n4ff4h wants to merge 17 commits into
mainfrom
next-gen

Conversation

@n4ff4h

@n4ff4h n4ff4h commented Nov 4, 2026

Copy link
Copy Markdown

javaabu/forms v2.0, the next-gen rework (epic #15). This PR is for review only; please don't merge until you're ready to release v2. main stays on 1.x until then.

What's in it

Upgrade notes

The full guide is docs/upgrading.md. The short version:

  • Requires PHP 8.4+ and Laravel 12+.
  • Component names and attributes are unchanged, but the markup is now Onu or Bootstrap 6. Apps on Bootstrap 5 or Material Admin should stay on ^1.71.
  • Config: framework defaults to onu, framework keys are snake_case, and icons move to one icons array (inline Lucide SVG; icon-font classes still work).
  • Assets load automatically through javaabu/manifest. Set FORMS_STYLES=false when your Tailwind build imports resources/css/onu.css. Google Maps and TinyMCE are still pushed to @stack('scripts').
  • Strings v1 hard-coded are now forms::strings. Arrays are joined with , , and bound dates use the picker's format.

Before releasing (for you)

  • Review the Dhivehi lines listed in docs/advanced-usage/translations-and-rtl.md (written by an AI).
  • Make sure CODECOV_TOKEN is set for the org, so coverage and the badge work (the upload step runs but can't authenticate without it).
  • Release javaabu/manifest first. After that, drop the VCS repository from composer.json and require javaabu/manifest:^1.0.
  • When @javaabu/i18n installs (Add a prepare script so GitHub installs (github:Javaabu/i18n#main) get dist/ i18n#3, or once it's on npm), swap the temporary __() in resources/js/lang.ts.
  • Register the docs with docs.javaabu.com (Register with Javaabu Docs (docs.javaabu.com) #14).
  • Bootstrap 6 support targets 6.0.0-alpha.1; re-check the views against later pre-releases.
  • Merge, tag v2.0.0 and update the branch alias as you prefer.

🤖 Generated with Claude Code

n4ff4h and others added 9 commits November 4, 2026 12:41
- Require PHP ^8.4, illuminate ^12 || ^13, Testbench ^10 || ^11, PHPUnit ^11.5.3 || ^12.5.8
- Branch alias dev-next-gen => 2.x-dev
- Javaabu codestyle with Pint (pint.json), applied to the codebase and checked in CI
- tests.yml: PHP 8.4/8.5 x Laravel 12/13 x lowest/stable, coverage to Codecov from one leg
- README badges for tests, Codecov, Packagist and licence on next-gen
- javaabu/settings becomes optional: defaults come from forms.defaults, then get_setting()

Closes #5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Remove the bootstrap-5 and material-admin-26 views and their tests
- New bootstrap-6 views targeting 6.0.0-alpha.1: .form-field layout,
  .form-control selects, .check/.radio inputs, btn-solid/btn-outline +
  .theme-*, native <dialog> modals, <details> accordions, menus,
  prefixed responsive classes (sm:col-3), aria-invalid on errors
- Framework-agnostic views move to forms::common and are used when a
  framework has no view of its own
- Framework class maps (Frameworks\Bootstrap6, Frameworks\Onu) for
  button colours, badges and alerts; Frameworks::register() for custom ones
- <x-forms::icon>: Lucide icons as inline SVG (generated by
  scripts/icons.mjs), or icon-font classes; one forms.icons config
- Snake_case framework config keys, translatable strings for
  Clear/Filter/Export/Apply/Select All/pagination
- Modal gets a size attribute
- Fix: errors lookup no longer needs a session; modal without a footer
- docs/upgrading.md

Closes #6
Closes #7

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ss-selector

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- resources/views/onu: every component, with the data-slot markup and
  class strings of the matching @javaabu/onu React component
- scripts/onu-classes.mjs server-renders Onu's components and writes
  resources/onu/classes.php; CI fails when it is out of date
- resources/css/onu.css for Tailwind apps (sources the views, styles native
  checkbox/radio/dialog/file inputs with Onu tokens); prebuilt dist/onu.css
  for apps without Tailwind, published with --tag=forms-assets
- onu is now the default framework
- Fix: paginator views no longer need component variables
- Smoke test renders every fixture view with every framework
- docs/frameworks/onu.md and bootstrap-6.md

Closes #8

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- New components: error-summary, pagination, formatted-value
- Every field: form-group-class, thaana (dir/lang/data-thaana like Onu)
- Textarea auto-resize, number decimals
- Button size, start-icon, end-icon, loading; link-button disabled
- Select2 clearable, min-chars, parent
- Modal description and md size; errors first-only; file multiple;
  accordion item disabled; per-page label, show-label, per-page
- Form summary, summary-title, focus-on-error, error-bag
- Icons use data-icon-name, like Onu
- String keys aligned with @javaabu/forms locales; NoItems strings translatable
- docs/parity.md (Blade side of the matrix), react-forms#18 for open questions

Closes #9

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assets (#10):
- Require javaabu/manifest (^1.0@dev, VCS). Assets::register() declares the
  package's assets; components declare what they need (DeclaresAssets) and
  manifest injects the tags once, in dependency order. JS alias:
  @javaabu/forms-blade (@javaabu/forms is the React package).
- resources/js (TypeScript, no jQuery): core behaviours (conditional display,
  select all, table sorting, submit spinner, focus on error, date clear,
  Thaana via @javaabu/onu/thaana, auto-resize, decimals, Onu dialog/tabs/
  alerts/menus), Tom Select selects with ajax and cascades, flatpickr dates
  (Dhivehi locale), file inputs and uploads, TinyMCE setup. Strings from
  lang/{en,dv} (temporary local __() until @javaabu/i18n is published).
- Vite build into dist/ with .vite/manifest.json (committed); Vitest suite;
  CI assets job runs lint, format, typecheck, tests with coverage, build diff.
- forms.assets (enabled, styles) and forms.wysiwyg.tinymce_url config.

Fixes:
- Textarea values are escaped; FormOpen/SearchForm pass framework correctly;
  table no-bulk works; empty-row colspan; form/row/infolist unbind their model
  after rendering; radios compare the bound value with their value (enums too)
- No duplicate value/id attributes; buttons without a type keep v1 behaviour
- Bound dates use the picker's format by default; time accepts date-format
- File max size works without javaabu/settings; image uploads pass max size
- Simple paginators; guests on conditional-link can; optional enable-value;
  Bootstrap 6 modal close button without a title; sort icons on headings
- Remove unreachable file-input partials

Closes #10

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Docusaurus docs: intro, requirements, installation, upgrading, parity,
  frameworks, a reference page per component, advanced usage (configuration,
  assets, customizing views, custom frameworks, translations and RTL), AI
  assistants
- llms.txt with the rules and an index of every page
- AGENTS.md and CLAUDE.md for agents working on the repo
- resources/boost: guideline and javaabu-forms skill, with a component
  attribute reference generated from the constructors (checked in CI)
- lang/dv aligned with @javaabu/forms' Dhivehi, spelling fixes, every key
  translated; lines for human review listed in the translations page
- Dhivehi rendering tests; v2 changelog

Closes #11
Closes #12
Closes #13

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@n4ff4h n4ff4h mentioned this pull request Nov 4, 2026
9 of 10 tasks
n4ff4h and others added 3 commits November 4, 2026 15:33
… table no-bulk

- File types, mime types, extensions and size limits ship in
  Support\MimeTypes (resources/data/mime-types.php, the same lists as
  javaabu/helpers). When javaabu/helpers is installed it's still used, so
  types apps register there keep working; MimeTypes::register() for apps
  without it. format_file_size() is ported with translated units.
- javaabu/helpers moves to suggest/require-dev; CI fails if javaabu/settings
  or javaabu/helpers appear in the production dependency tree.
- <x-forms::table no-bulk> rendered nothing: the bulk form's open and close
  tags were in separate @if blocks. The table markup is now a partial,
  included inside the bulk form or on its own. The bulk form uses the
  slot's method.
- docs/upgrading.md, requirements, file inputs and changelog updated

Closes #17
Closes #18

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ize()

Closes #19

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
settings v2 requires javaabu/forms and helpers v1 pins settings v1, so
require-dev no longer installs either. A get_setting() stand-in in
tests/TestSupport covers reading defaults from settings, and the file
tests set forms.defaults.max_upload_file_size instead of settings v1's
config key. The suggest entry names settings ^2.0.

Closes #20

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h and others added 2 commits November 6, 2026 05:00
Boost renders resources/boost/guidelines/*.blade.php with Blade (backticks
don't protect code), so @model … @endmodel compiled into an unclosed if and
the guideline was left out of apps' AGENTS.md. Write @@model, @@endmodel and
@{{ }} instead. BoostTest renders every Boost .blade.php file with Boost's
own RendersBladeGuidelines (laravel/boost in require-dev), and checks the
skill stays .md, which Boost copies without rendering.

Closes #21

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
laravel/boost before 2.10.x turns backticks into ___SINGLE_BACKTICK___
placeholders and has no escape handling, so `@@model` follows a word
character and Blade (\B@) still compiles @model. A verbatim block renders
as written on every Boost version; the prefer-lowest CI legs (boost
2.10.0) cover it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h and others added 3 commits November 6, 2026 06:01
…st#17)

forms registers no Inertia pages, and @javaabu/forms-blade imports are the
Blade scripts themselves, so nothing is pages-only and the React
@javaabu/forms was never needed. The assets scope keeps only what the
Blade scripts and styles import: tom-select, flatpickr, @javaabu/onu,
tailwindcss, and now react. @javaabu/onu/thaana also exports React hooks,
so building forms' sources without react failed to resolve it, while
manifest:check passed.

ManifestCheckTest runs manifest:check in a Blade-only app. CI builds the
Blade sources in an empty app with only the registered packages
(scripts/blade-app-build.sh). docs/requirements.md explains the split, and
the assets docs no longer ask for @javaabu/i18n, which nothing imports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every job downloaded each package's zipball from api.github.com, around
140 calls a job, which counts against the workflow token's hourly limit.
Each job now restores Composer's files cache, keyed by job, matrix entry
and composer.json/composer.lock, and falls back to the job's last cache
when those change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant