Skip to content

echarts: Public/Private files and a shorter New-UDEChart #169

Closed

Description

@eizedev

PowerShellUniversal.Component.ECharts.psm1 is still one file: 329 code lines, 7 functions. New-UDEChart has 193 code lines. Both are offenders in build/growth-baseline.json (limits: file 300, function 100).

AGENTS.md, "How we build", asks for one function per file in Public/ and Private/, with the .psm1 only loading them.

To do:

  • Split the module like the Pivot module (pivot: split the 4,948-line module into Public/Private files and small functions #163): Public/, Private/, and the loader that tells a source checkout from a built module by Private/SHARED.txt. build/Build-Module.ps1 already copies Public/ and Private/.
  • Break New-UDEChart into helpers with one job each. Pass inputs as parameters.
  • Keep commands, parameters, help and output identical. Compare Get-Command -Module with parameter sets and Get-Help -Full before and after, and the output of docs/site/Build-Site.ps1.
  • Lower the baseline with npm run growth -- --update.

Not affected: behaviour. It was left out of the Pivot pull request to keep one change per pull request and one module per CHANGELOG.

Activity

  1. eizedev commented on Nov 23, 2026

    @eizedev
    OwnerAuthor

    Done in #173 (merged as a26cc9f).

    • The ECharts module is split into Public/ and Private/, one function per file. The .psm1 only loads them, the same way as Pivot.
    • New-UDEChart now runs its steps through four helpers. It went from 193 to 121 code lines, 108 of them the param() block. The growth baseline is lowered.
    • These are identical before and after: Get-Command with parameter sets, Get-Help -Full and the exports (source and built module), the output of New-UDEChart for calls that use every parameter, and docs/site/generated.
    • New tests: every parameter arrives under its prop name, and the file tests (ModuleFiles.Tests.ps1) and the build test run for both split modules.

    Not tested on PSU: the ECharts split itself (asset registration in a real app, PSU's real Endpoint.Register, import time with 14 files). The Pivot split from #171 ran clean on a PSU test instance.

    New-UDEChart stays over the 100-line limit because of its 103 parameters. Getting under it would mean changing the command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions