Skip to content

refactor: code refactor#1684

Open
Mister-Hope wants to merge 1 commit intomainfrom
refactor
Open

refactor: code refactor#1684
Mister-Hope wants to merge 1 commit intomainfrom
refactor

Conversation

@Mister-Hope
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings March 10, 2026 14:11
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR appears to be a broad “modernize / cleanup” sweep across the monorepo, updating code to newer JS/TS idioms, tightening types, and adjusting a few test and tooling patterns.

Changes:

  • Modernize string/array handling (e.g., replaceAll, slice, Set.has) and minor naming cleanups for clarity.
  • Update tests for clearer mocks/types (e.g., expectTypeOf, String.raw for Windows paths, vi.mock(import(...)) pattern).
  • Small tooling/config adjustments (tsconfig, ESLint override, chokidar watcher import style) and minor client DOM API tweaks.

Reviewed changes

Copilot reviewed 39 out of 40 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tsconfig.json Removes root baseUrl entry while keeping path mappings.
packages/utils/tests/module/isChildPath.spec.ts Uses String.raw for Windows path test cases to avoid escape issues.
packages/utils/tests/console/withSpinner.spec.ts Switches ora mock to vi.mock(import('ora'), ...).
packages/utils/src/module/transformPathToFileName.ts Uses replaceAll for slash replacement.
packages/utils/src/module/sanitizeFileName.ts Uses nullish coalescing (??) for drive letter fallback.
packages/utils/src/module/importFile.ts Renames callback param for readability (mmodule).
packages/utils/src/console/withSpinner.ts Renames caught error variable for clarity (eerr).
packages/shared/tests/typeGuards.spec.ts Uses function reference in describe for naming.
packages/shared/src/utils/routes/inferRoutePath.ts Uses slice with negative indices for cleaner suffix removal.
packages/shared/src/utils/resolveHeadIdentifier.ts Replaces arrays with Set for tag membership checks.
packages/shared/src/utils/omit.ts Improves generic naming (UKeys) for readability.
packages/markdown/tests/plugins/assetsPlugin.spec.ts Uses replaceAll in test expectations.
packages/markdown/src/plugins/assetsPlugin/assetsPlugin.ts Uses replaceAll for global regex replacements and descriptor normalization.
packages/core/tests/pluginApi/createHookQueue.spec.ts Simplifies async mocks (removes redundant Promise.resolve).
packages/core/tests/page/resolvePageContent.spec.ts Renames caught error variable (eerr).
packages/core/tests/page/renderPageToVue.spec.ts Uses function reference in describe for naming.
packages/core/tests/app/resolveAppWriteTemp.spec.ts Updates mock style to vi.mock(import(...)) and uses function reference in describe.
packages/core/tests/app/createDevApp.spec.ts Uses expectTypeOf(...).toBeFunction() for stronger type assertions.
packages/core/tests/app/createBuildApp.spec.ts Uses expectTypeOf(...).toBeFunction() for stronger type assertions.
packages/core/src/types/pluginApi/pluginApi.ts Renames mapped type key variable (KKey).
packages/core/src/types/pluginApi/hooks.ts Renames inferred generic variables for clarity (U/VReturn/Value) and mapped key var (KKey).
packages/core/src/types/app/options.ts Removes redundant @required JSDoc markers on required interface fields.
packages/core/src/pluginApi/createPluginApiRegisterHooks.ts Removes unused destructured fields.
packages/core/src/pluginApi/createHookQueue.ts Renames caught error variable (eerr).
packages/core/src/page/resolvePageContent.ts Renames caught error variable (eerr) and logs accordingly.
packages/core/src/app/resolveAppWriteTemp.ts Reorders item.current conditional for readability without changing behavior.
packages/client/src/setupUpdateHead.ts Uses textContent instead of innerText and append instead of appendChild.
packages/client/src/setupGlobalComputed.ts Simplifies async loader to return the value directly.
packages/client/src/components/RouteLink.ts Uses slice and adds an explicit empty rejection handler to silence navigation errors.
packages/client/src/components/Content.ts Renames callback param for readability (mmodule).
packages/cli/src/commands/dev/watchUserConfigFile.ts Switches to import { watch } from 'chokidar' and uses watch(...) directly.
packages/cli/src/commands/dev/watchPageFiles.ts Switches to import { watch } from 'chokidar' and uses watch(...) directly.
packages/bundler-webpack/src/build/renderPagePreloadLinks.ts Minor ternary refactor for readability.
packages/bundler-webpack/src/build/renderPagePrefetchLinks.ts Renames callback param for clarity in some(...).
packages/bundler-webpack/src/build/createClientPlugin.ts Renames variables for clarity and removes redundant array spread.
packages/bundler-webpack/src/build/createClientConfig.ts Renames callback param for clarity.
packages/bundler-vite/src/plugins/vuepressConfigPlugin.ts Minor refactor of alias return expression (no functional change).
packages/bundler-vite/src/build/renderPagePreloadLinks.ts Minor ternary refactor for readability.
eslint.config.ts Disables @typescript-eslint/require-await with explanatory comment.
e2e/docs/.vuepress/components/OnContentUpdated.vue Adds block scoping to switch cases (braces) for clarity/consistency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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