Repository navigation
ci: growth guards for PowerShell, JavaScript, duplication and docs - #166
Merged
Merged
Conversation
build/growth.js checks four ratchets against build/growth-baseline.json, one CI step each: code lines per PowerShell file and function (parsed with the PowerShell AST in build/Measure-PowerShellSize.ps1), lines and complexity per JavaScript function (ESLint), duplicated JavaScript (jscpd, fixed threshold) and lines per docs page and README by kind. A new or grown offender fails, a smaller one fails until the baseline is lowered in the same pull request. Mirrors scripts/growth.js of eizedev/pivotkit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Named JavaScript functions are keyed by name, so a move to another file keeps the entry, as for PowerShell. - Every grown guard says how to raise the baseline when the growth is right; the docs advice covers the total. - The guard steps run when an earlier step failed. - Measure-PowerShellSize.ps1 measures hidden folders on every platform and leaves out class methods. - Tests for the command's exit codes and --update, filters, class methods and hidden folders. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 22, 2026
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
TL;DR: CI now fails when a PowerShell file or function, a JavaScript function, duplicated JavaScript or a docs page grows past its limit. Today's offenders are in
build/growth-baseline.jsonand may only shrink.npm run growthrunsbuild/growth.js. It works likescripts/growth.jsin eizedev/pivotkit. Each guard is its own step in thejavascriptjob.powershell.ps1/.psm1and per function, with the PowerShell parser (build/Measure-PowerShellSize.ps1)javascriptmodules/*/Componentsandshared/js, with ESLintduplicationdocsRules:
node build/growth.js --updatelowers the baseline in the same pull request.--update --accept-growthraises an entry. The pull request then says why.Public/(pivot: split the 4,948-line module into Public/Private files and small functions #163) or another file keeps its entry.eslint-disablecomment cannot hide a function.Baseline:
Pivot.psm12731,PivotReport.Tests.ps11409, EChartsShowcase.ps11331,PivotTemplates.Tests.ps1728,Pivot.Tests.ps1530,docs/site/examples.ps1510,ECharts.psm1329, PivotShowcase.ps1305.New-UDPivotReport267,New-UDEChart193,Invoke-UDPivotTemplateStore158,Invoke-UDPivotReport150.cartesian337,EChart277 and an arrow function in it 127,PsuPivotReport260,Perspective139.cartesian46,PsuPivotReport39,responsive38, an arrow function inbuildOption.js35,histogram27,formatter26.pivot/templates.md548,pivot/reports.md416,pivot/index.md264,pivot/views.md238,pivot/server-rows.md208,README.md105; total 4134.buildOption.js(lines 1293 and 1775).What to know:
docs/site/generated/do not count.--update.eslint10.15.0,jscpd5.4.3 (the versions pivotkit uses).Found on the way: #165. The bundle folder
public/collides withPublic/of the split on macOS and Windows.Places checked: AGENTS.md (Layout, Commands), CONTRIBUTING.md (links to AGENTS.md), docs/development, README. No module changes, so no CHANGELOG entry.
Refs #163
Test plan
npm test(JavaScript), withtests/js/growth.test.jsInvoke-Pester -Path tests/powershell, withtests/powershell/Growth.Tests.ps1node build/growth.js: all four ok; one line added to a page fails, one line removed fails until--update(also covered bytests/js/growth.test.js)./build/Build-Module.ps1 -Module <Module>builds: no module changedCHANGELOG.mdof the module updated: no module changed🤖 Generated with Claude Code