feat: unified rebar3 nova gen dispatcher with template system#13
Closed
Taure wants to merge 32 commits into
Closed
feat: unified rebar3 nova gen dispatcher with template system#13Taure wants to merge 32 commits into
rebar3 nova gen dispatcher with template system#13Taure wants to merge 32 commits into
Conversation
Add 9 new provider modules and a shared utility module: Generators: - gen_controller: scaffold controller with CRUD stub functions - gen_router: scaffold router module with nova_router behaviour - gen_resource: scaffold controller + JSON schema + route hints - gen_test: scaffold Common Test suite for controller actions Introspection & security: - openapi: generate OpenAPI 3.0.3 spec from compiled routes - middleware: display per-route-group plugin/middleware chains - config: show Nova configuration with defaults - audit: check routes for security issues (unsecured mutations, wildcards) Release: - release: regenerate OpenAPI spec if schemas exist, then build release All providers registered in rebar3_nova:init/1. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Document all nova subcommands with usage examples, options, and expected output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Runs compile, dialyzer, and xref on OTP 28.0 / rebar3 3.26.0 for push and pull_request events. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ci: add build and test workflow
Include rebar in base_plt_apps so dialyzer can resolve rebar3 API types and functions used by the plugin (rebar_state, providers, etc). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rebar3 isn't a standard OTP app, so it can't be added to the PLT. Remove unknown warning class since rebar3 plugin APIs can't be resolved. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rebar3 plugin APIs can't be added to dialyzer PLT. Remove dialyzer from CI (keep compile + xref). Add no_unknown to local dialyzer config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rebar3 plugin APIs aren't available during standalone xref. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Function was removed in latest nova — needs code fix separately. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: add rebar to dialyzer base PLT
Configure rebar3_ex_doc for hexdocs generation. Add ex_doc step to CI workflow. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: add ex_doc config and docs CI step
Add generator, introspection, and release commands
The rebar3 new nova template always creates a router, so a separate generator is unnecessary. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Scaffolds a complete email/password authentication system into a Nova app: migration, schemas, accounts context, security callback, controllers, and CT test suite. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Both openapi.json and swagger.html now default to priv/assets/ relative to the app directory, making them easy to serve from a Nova static route. The swagger UI spec URL is now relative so it works from any serving path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The branch protection requires a check named "build" but the custom name field caused it to report as "OTP 28.0 / rebar3 3.26.0". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: remove gen_router, add gen_auth command
…sponses
Routes with `extra_state => #{json_schema => "./schemas/post.json"}` now
generate $ref links in the OpenAPI spec — requestBody for POST/PUT/PATCH
and response content schemas for all methods with a schema.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The primary_key/0 callback was removed from kura_schema (kura#26).
Generated schemas now use only #kura_field{primary_key = true}.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…-callback fix: remove primary_key/0 from gen_auth schema templates
* feat: add nova_fullstack project template Full-stack Nova project template with Arizona LiveView and Kura database. Scaffolds a complete project with liveview routing, PostgreSQL via Docker Compose, migrations, and a reactive counter demo. Usage: rebar3 new nova_fullstack name=myapp Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: correct arizona dep URL and add pubsub_scope config - Change arizona dep from Taure/arizona_core to arizona-framework/arizona (full framework needed for arizona_websocket) - Add pubsub_scope => nova_scope to arizona config in dev and prod Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: share template files between nova and nova_fullstack Deduplicate app.erl, sup.erl, vm.args.src, and .tool-versions by having nova_fullstack reference the shared files from nova/. Standardize on the cleaner formatting style. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: use arizona_nova instead of full arizona framework Update fullstack template to depend on arizona_nova (Nova-specific integration layer) instead of the full arizona framework. Updates sys.config, app.src, Makefile, and rebar.config deps accordingly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: migrate CI to Taure/erlang-ci reusable workflow * style: format codebase with erlfmt * fix: resolve dialyzer warnings in serve, audit, and openapi modules * chore: add .git-blame-ignore-revs for fmt commit * ci: disable dialyzer until upstream deps are fixed --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Replace the dated 2014-era CSS stars landing page with a clean, modern card-based design. Fixes broken animations, removes 25KB of hardcoded box-shadow coordinates, adds light/dark mode support, responsive layout, and zero external dependencies.
Single command replaces multiple templates with composable flags: rebar3 nova new myapp [--kura] [--pgo] [--arizona] [--lfe] [--ci] [--docker] [--otel] - --kura/--pgo mutually exclusive, all others freely combinable - Each flag conditionally adds deps, plugins, config, and source files - Adds write_file/2 and copy_priv_file/2 to rebar3_nova_utils - 11 CT tests covering all flags and combinations
Generates Arizona LiveView CRUD views, Kura schema, migration, and
test suite for a resource. Similar to Phoenix's phx.gen.live.
Usage:
rebar3 nova gen_live --name users --fields name:string,email:string
Generated files:
- src/views/{app}_{resource}_{action}_view.erl (index/show/new/edit)
- src/schemas/{app}_{resource}.erl (Kura schema)
- src/migrations/m{ts}_create_{table}.erl (Kura migration)
- test/{app}_{resource}_live_SUITE.erl (CT test suite)
Also fixes the home_view scaffold in `nova new --arizona` to use
the current Arizona API (arizona_view:new/3, arizona_template:from_html,
arizona_parse_transform).
Resolve merge conflicts in rebar.config and release.yml.
Restructure gen_* commands into a single `rebar3 nova gen <type> <name>` entry point with bbmustache templates for code generation. - Add rebar3_nova_gen.erl dispatcher routing to gen modules by type - Extract shared helpers to rebar3_nova_utils (singularize, pluralize, capitalize, timestamp, parse_fields, render_template) - Add run/1 and run/2 to each gen module; do/1 emits deprecation warning - Convert gen_controller, gen_test, gen_auth to mustache templates - Replace thoas:encode/decode with json:encode/decode in gen_auth - Name is now a positional arg: `rebar3 nova gen controller users` - Old gen_* commands still work for backward compatibility - Add rebar3_nova_gen_SUITE (12 tests) and integration suite (7 tests) - Integration suite scaffolds a project, runs all generators, validates syntax of 24 .erl files, and runs rebar3 compile end-to-end
Owner
Author
|
Moved to novaframework#63 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rebar3 nova gen <type> <name> [opts]entry point that dispatches to gen modulesrebar3_nova_utils(singularize, pluralize, capitalize, timestamp, parse_fields, render_template)priv/templates/gen/thoas:encode/decodewithjson:encode/decodein gen_authrebar3 nova gen controller usersgen_*commands still work but emit deprecation warnings.erlfiles, and compiles the project end-to-endTest plan
rebar3 fmt --checkpassesrebar3 xrefpassesrebar3 ct— all 40 tests pass (4 suites)rebar3 compilesucceedsrebar3 nova gen controller usersgenerates correct controllerrebar3 nova gen authgenerates 9 files withjson:encode(no thoas)rebar3 nova gen_controller --name usersstill works with deprecation warning