Skip to content

Chore/maintenance fixes#20

Merged
sn merged 2 commits into
mainfrom
chore/maintenance-fixes
May 17, 2026
Merged

Chore/maintenance fixes#20
sn merged 2 commits into
mainfrom
chore/maintenance-fixes

Conversation

@sn
Copy link
Copy Markdown
Contributor

@sn sn commented May 17, 2026

This pull request introduces several improvements and minor refactors to the Nitro CLI static site generator. The main changes include enhancements to asset fingerprinting for better cache busting, improved handling of configuration and source directories, and code refactors for clarity and maintainability. Additionally, the version number is bumped to 1.0.17.

Asset fingerprinting and manifest improvements:

  • Increased asset fingerprint/hash length from 8 to 12 characters for more robust cache busting, and updated the related regex pattern and code accordingly. (src/nitro/core/bundler.py) (F9675e7cL213R213, F9675e7cL229R229, F9675e7cL243R243)
  • Ensured asset references in HTML are more reliably updated by refining the matching logic for asset paths. (src/nitro/core/bundler.py) (F9675e7cL270R270)

Configuration and directory handling:

  • Improved config loading fallback: now uses a default Config() object if nitro.config.py is missing, and always uses config.source_dir for the source directory. (src/nitro/commands/check.py, src/nitro/commands/routes.py) [1] [2]
  • Refactored build.py to use generator.config directly instead of reloading config from disk, and streamlined sitemap metadata passing. (src/nitro/commands/build.py) [1] [2]

Hot module reloading and file watching:

  • Improved file change detection in the development server: now uses a helper to check if a changed file is within specific source subdirectories, and handles config, page, component, style, and public asset changes more robustly. (src/nitro/commands/serve.py) [1] [2]

Code clarity and maintainability:

  • Removed redundant comments and simplified logic in several core files, especially in the generator and bundler modules, for better readability. (src/nitro/core/generator.py, src/nitro/core/bundler.py) (F6bfb974L94R94, F6bfb974L114R114, F6bfb974L130R130, F6bfb974L168R168, F6bfb974L193R193, F6bfb974L206R206, F6bfb974L225R225, F6bfb974L229R229)

Version updates:

  • Bumped project version to 1.0.17 in both pyproject.toml and src/nitro/__init__.py. [1] [2]

@sn sn self-assigned this May 17, 2026
@sn sn merged commit cb3cbc0 into main May 17, 2026
6 checks passed
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