Skip to content

fix: dependency updates compatibility & code refactoring#59

Merged
this-is-tobi merged 4 commits intomainfrom
develop
Mar 11, 2026
Merged

fix: dependency updates compatibility & code refactoring#59
this-is-tobi merged 4 commits intomainfrom
develop

Conversation

@this-is-tobi
Copy link
Copy Markdown
Owner

@this-is-tobi this-is-tobi commented Mar 11, 2026

Description

This PR addresses several issues introduced by dependency updates and includes a minor code refactoring:

  1. CI not failing on VitePress build errors — the build command was catching errors and logging them but exiting with code 0, so dead links and other VitePress build failures were silently swallowed in CI/CD pipelines. Added process.exit(1) in the catch block.

  2. Lint errors after @antfu/eslint-config update — the new e18e/prefer-static-regex rule requires regex literals to be declared at module scope rather than inline. Moved all inline regex literals to module-scope constants across src/utils/regex.ts, src/utils/functions.ts, public/templates/theme/index.ts, and vite.config.ts.

  3. Test failures after vitest v4 update — vitest v4 changed how new mockFn() works: it now calls new implementation() internally, which fails for arrow functions. Updated Octokit constructor mocks in git.spec.ts to use regular function expressions. Also fixed a pre-existing bug where writeFileSync was called with a spread string ([...str1, ...str2]), which produced character arrays instead of concatenated strings.

  4. Regex centralisation refactoring — moved all regex constants into src/utils/regex.ts (pure constants, no fs logic) and moved replaceRelativePath / replaceReadmePath functions into src/utils/functions.ts to better separate concerns.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Other (please describe): dependency updates compatibility + code refactoring

How Has This Been Tested?

All existing unit tests were updated to reflect the changes and pass locally.

Test Configuration:

  • Node.js: 24.14.0
  • pnpm: 10.32.0
  • vitest: 4.0.18

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 11, 2026

🤖 Hey !

The security scan report for the current pull request is available here.

Comment thread Dockerfile Dismissed
@this-is-tobi this-is-tobi merged commit ace69b8 into main Mar 11, 2026
16 checks passed
@this-is-tobi this-is-tobi deleted the develop branch March 11, 2026 00:52
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.

2 participants