Repository navigation
Conversation
…ts, cache, stencil forms - PHP ^8.4, Laravel 12/13, Testbench 10/11. Drops javaabu/helpers, javaabu/settings and maatwebsite/excel; javaabu/forms ^2. Branch alias dev-next-gen: 2.x-dev. - Date grouping for MySQL, MariaDB, PostgreSQL and SQLite. Weeks are keyed by the date they start on; months by YYYY-MM; hourly keys now match the SQL. - CSV exports without a dependency; a plain date_to covers the whole day. - Route::stats() / Route::statsApi(), configurable controllers, a StatsPolicy and view_stats through javaabu/permissions, any guard. - Chart builders (TimeSeriesChart, CategoryChart, PieChart, Sparkline, StatTile) serialised for Onu and drawn as SVG in Blade; several stats or periods on a plot. - StatsCache with versioned keys and TTLs, Stats::warm(), stats:warm and the WarmStatsCache job, the InvalidatesStats model trait. - Stats forms defined with stencil; javaabu/filters filters via StatsFilter::from(). - Pint, CI matrix (PHP 8.4/8.5 x Laravel 12/13 x lowest/stable), MySQL, MariaDB and PostgreSQL jobs, a job without optional packages, the JS job, Codecov, badges. Refs #1, #2, #3, #4, #5, #6, #7 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ests - @javaabu/stats (resources/js, through javaabu/manifest): StatsChart draws any chart from PHP with Onu's TimeSeriesChart, CategoryChart, PieChart, Sparkline or StatTile; StatsTile; the stats::TimeSeries/Index and stats::Categorical/Index pages with StencilForm and the CSV download. Typed props, Vitest tests on fixtures generated from PHP. - Blade: <x-stats::chart>, time-series-chart, category-chart, pie-chart, sparkline, stat-tile and stat-tiles as accessible SVG figures with Onu's tokens, a summary, a View as table toggle, and mirroring in RTL locales. - Chart step labels in the app's locale; Inertia pages get errors and a CSRF token. Refs #2, #3, #4, #11 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… logical CSS Refs #10 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and chart recomputation
- Exports read form filter values from the request body.
- Pages pass the current route's parameters to their export and category URLs,
so a prefix like users/{user}/stats works.
- Filter values 0, '0' and false are applied; only missing values are skipped.
- Downloads check the policy's export ability (the stat's canView() by default).
- Category search paging links keep filter[metric].
- stats:time-series refuses unknown types.
- Charts compute again when an option changes after reading them; a tile's link,
icon and texts aren't part of its cache key. React tiles show the period.
Refs #2, #5, #7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes #8 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The date range contracts, HasDateRange, ExactDateRange, PresetDateRanges, TimeSeriesModes, TimeSeriesSteps and the stats requests type-hinted the mutable Carbon\Carbon but built dates with now(), so every stat threw a TypeError in apps on Laravel's starter kits. They now type-hint CarbonInterface (DateTimeInterface for setters) and make dates with the Date factory, so they are whichever class the app uses. No code relied on mutating a date in place. STATS_IMMUTABLE_DATES=1 runs the suite with CarbonImmutable, and a new CI job does so; ImmutableDatesTest always does. Upgrade guide, docs, Boost skill, llms.txt and AGENTS.md cover the new hints. Closes #14 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The chart styles are the only registered asset and import nothing, so @javaabu/forms, @javaabu/onu, recharts, react, react-dom and @inertiajs/react are only needed by the Inertia pages and @javaabu/stats imports. Declaring them with npm(..., for: 'pages') (Javaabu/manifest#17) stops `manifest:check` asking Blade apps to install React packages. Tested with manifest:check in a Blade app and an Inertia app. 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>
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.
javaabu/stats v2
The next-gen major of stats, built on the fork
n4ff4h/stats(next-gen); tracking epic n4ff4h#13. Stat definitions from v1 keep working; the front end, dependencies, routes and database support are new.What's in it
dev-next-gen: 2.x-dev.Date::use(CarbonImmutable::class), as Laravel's starter kits do: dates areCarbonInterface, made with theDatefactory. CI runs the whole suite withCarbonImmutabletoo (Stats fail when the app uses CarbonImmutable (Laravel 13 starter kit default) n4ff4h/stats#14).TimeSeriesChart,CategoryChart,PieChart,SparklineandStatTiledescribe a chart in PHP:<StatsChart>,@javaabu/statsthrough javaabu/manifest). Their npm packages are declared for manifest's pages scope, somanifest:checkdoesn't ask Blade apps for React packages;<x-stats::chart>and friends), mirrored in RTL.Stats::forget()/flush(), theInvalidatesStatsmodel trait,Stats::warm()withstats:warmand theWarmStatsCachejob.Route::stats()gives time series and categorical pages in Blade or Inertia React:StatsFilter::from(), and CSV export;Route::statsApi()keeps the v1 JSON API.view_statsthrough javaabu/permissions and an overridableStatsPolicy.llms.txt, a Laravel Boost guideline and thejavaabu-statsskill.Upgrade notes
See
docs/upgrading.md. The main breaks:<x-stats::time-series>/<x-stats::categorical>components are removed. Use the pages, charts, or a page per model (extend the controller'sfilters()).YYYY-MM. Hourly keys now match the SQL.date_tocovers the whole day.CarbonInterfaceinstead ofCarbon; overrides ofsetDateFrom(),setDateTo(),getMaxDate()andgetMinDate()must widen their parameters.Route::stats()/Route::statsApi().Before releasing
docs/advanced-usage/dhivehi-and-rtl.md#translations-to-review.composer.json, and move@javaabu/formsto npm.🤖 Generated with Claude Code