Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: package and path resolving #1308

Merged
merged 12 commits into from Feb 21, 2024
Merged

Conversation

KermanX
Copy link
Member

@KermanX KermanX commented Feb 19, 2024

Overview

fixes #1238
fixes #1278

Previously, the resolving utilities were messed up, and not all the cases (like global installation and @/) are handled properly. This PR fixes that by refactoring the path-resolving utilities.

Changes

  • Refactor the path resolving utilities
    • Remove unnecessary/duplicate code
    • Move all these utilities to packages/slidev/node/resolver.ts
  • Fix the global installation path resolving
  • Make @/ work properly
  • Make the resolving logic of themes and addons consistent, and more robust
  • Noticeably improve the loading performance by avoiding unnecessary/duplicate path-resolving
  • Resolve userRoot, cliRoot, and clientRoot at module level. So that we don't need to pass them around anymore
  • Fix Monaco iframe builder

Test Plan

  • Reload when theme changed
  • Reload when config changed
  • Create new slides.md by CLI
  • Theme HMR
  • slidev
  • slidev build
  • slidev export / slidev export-notes
    • Slidev installed globally (NPM&PNPM) & Playwright installed globally
    • Slidev installed globally (NPM&PNPM) & Playwright installed locally
    • Slidev installed locally (NPM&YARN&PNPM) & Playwright installed globally
    • Slidev installed locally (NPM&YARN&PNPM) & Playwright installed locally
  • slidev format
  • slidev theme eject
    • Theme installed as global package
    • Theme installed as local package
    • Theme is a local folder

Todos

@KermanX KermanX marked this pull request as draft February 19, 2024 13:31
@KermanX KermanX marked this pull request as ready for review February 20, 2024 06:36
@antfu antfu merged commit b10d4c0 into slidevjs:main Feb 21, 2024
8 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.

Monaco is causing an infinite iframe recursion The request url is outside of Vite serving allow list. (x3)
2 participants