• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vuepress / vuepress-next / 7163313360

11 Dec 2023 05:25AM CUT coverage: 67.837% (-1.3%) from 69.176%
7163313360

Pull #1449

github

web-flow
Merge 4941993a9 into b82d48e1e
Pull Request #1449: feat: remove vuepress-vite and vuepress-webpack package and support --bundler option, close #1446

325 of 462 branches covered (0.0%)

Branch coverage included in aggregate %.

2 of 26 new or added lines in 4 files covered. (7.69%)

1 existing line in 1 file now uncovered.

641 of 962 relevant lines covered (66.63%)

47.76 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

8.33
/packages/cli/src/commands/dev/handlePageUnlink.ts
1
import {
2
  preparePagesComponents,
3
  preparePagesData,
4
  preparePagesRoutes,
5
} from '@vuepress/core'
6
import type { App, Page } from '@vuepress/core'
7

8
/**
9
 * Event handler for page unlink event
10
 *
11
 * Returns the removed page
12
 */
13
export const handlePageUnlink = async (
3✔
14
  app: App,
15
  filePath: string,
16
): Promise<Page | null> => {
17
  // check if the unlinked page is existed
18
  const pageIndex = app.pages.findIndex((page) => page.filePath === filePath)
×
19
  if (pageIndex === -1) {
×
20
    return null
×
21
  }
22

23
  const page = app.pages[pageIndex]
×
24

25
  // remove the old page
26
  app.pages.splice(pageIndex, 1)
×
27

28
  // re-prepare page files
29
  await preparePagesComponents(app)
×
30
  await preparePagesData(app)
×
31
  await preparePagesRoutes(app)
×
32

33
  return page
×
34
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc