Skip to content

Issue #44 : feat(cli): validate checks @widget routes and widgets/out HTML - #58

Open
Shreyavemana wants to merge 1 commit into
nitrocloudofficial:mainfrom
Shreyavemana:feat/validate-widgets
Open

Shreyavemana wants to merge 1 commit into
nitrocloudofficial:mainfrom
Shreyavemana:feat/validate-widgets

Conversation

@Shreyavemana

Copy link
Copy Markdown
Collaborator

Summary

nitrostack-py validate did not check widget routes or their HTML files, so missing or empty widgets/out/<route>.html went undetected after init.

Findings

  • validate_project in cli/validators.py only ran dependency, import, and module checks — no widget validation.
  • ensure_python_widgets in cli/main.py created widget HTML during init and generate, but nothing re‑checked files afterwards.

Proposal

  • Add validate_widgets to validate_project.
  • Collect @widget routes using the same patterns as ensure_python_widgets.
  • Print route → file → URI in warning messages.
  • Warn when a widget file is missing, empty, or has an invalid route.

Tests

  • 9 new tests in tests/test_validate_widgets.py cover missing, empty, valid, duplicate, invalid, vendored, and no‑widget cases.
  • Targeted run: 78 passed. Full suite: ~840 passed (Windows shows unrelated OAuth flake).

@Shreyavemana
Shreyavemana marked this pull request as ready for review October 19, 2026 12:09
@Shreyavemana Shreyavemana changed the title feat(cli): validate checks @widget routes and widgets/out HTML Issue #44 : feat(cli): validate checks @widget routes and widgets/out HTML Oct 19, 2026
@Shreyavemana

Shreyavemana commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator Author

Verification of the proposed fix (feat/validate-widgets, 9df0e74)

Changes: Added widget validation to detect missing or empty widget HTML files and flag invalid routes. Added 9 tests covering valid, invalid, missing, empty, duplicate, vendored, and no-widget cases.

Installation and test environment

Cloned the branch into a temporary directory, created a fresh virtual environment, and installed the package using pip install <repo>.

The checks were run against the installed package from outside the repository. The installed version was nitrostack 0.4.2, imported from the temporary virtual environment's site-packages\nitrostack directory, confirming that the CLI validation checks were tested against the installed package rather than the source checkout.

Results:

  • 78 targeted tests passed, covering test_validate_widgets.py and test_cli.py.
  • 840 tests passed in the full test suite.
  • 3 manual checks passed: Missing and empty widget files triggered warnings, while a valid file passed validation.
  • 0 errors reported. The only remaining warning was about the missing application class in the sample project.

Conclusion: The fix works as expected: the CLI detects missing or empty widget HTML files, and all targeted and full-suite tests passed on Windows.

@Shreyavemana
Shreyavemana force-pushed the feat/validate-widgets branch from 9df0e74 to fe7f0fd Compare October 21, 2026 15:06

This branch has not been deployed

No deployments
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