Skip to content

Add theme installer and uninstall command for Hexo#526

Open
FloranceYeh wants to merge 2 commits into
hexojs:masterfrom
FloranceYeh:feat/theme-installer
Open

Add theme installer and uninstall command for Hexo#526
FloranceYeh wants to merge 2 commits into
hexojs:masterfrom
FloranceYeh:feat/theme-installer

Conversation

@FloranceYeh

Copy link
Copy Markdown

check list

  • Add test cases for the changes.
  • Passed the CI test.

What does it do?

This PR adds theme management commands to Hexo CLI:

  • Add hexo theme install <theme-name>

    • Find themes from the official Hexo theme registry

    • Clone the theme into themes/<theme-name>

    • Install production dependencies using the site's package manager

    • Copy the theme's _config.yml to _config.<theme-name>.yml

    • Preserve an existing root theme configuration

    • Add hexo theme uninstall <theme-name>

      • Remove the installed theme directory
      • Remove the corresponding _config.<theme-name>.yml
      • Avoid accessing the remote registry during uninstall

    No additional runtime dependencies are introduced.

Tests

  • Added tests for theme lookup and installation
  • Added tests for dependency installation and package manager selection
  • Added tests for theme configuration copying
  • Added tests for uninstall behavior and failure cases
  • Verified with npm test — 66 passing

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