• 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

7.14
/packages/cli/src/commands/dev/handlePageAdd.ts
1
import {
2
  createPage,
3
  preparePageComponent,
4
  preparePageData,
5
  preparePagesComponents,
6
  preparePagesData,
7
  preparePagesRoutes,
8
} from '@vuepress/core'
9
import type { App, Page } from '@vuepress/core'
10

11
/**
12
 * Event handler for page add event
13
 *
14
 * Returns the added page
15
 */
16
export const handlePageAdd = async (
3✔
17
  app: App,
18
  filePath: string,
19
): Promise<Page | null> => {
20
  // check if the added page is duplicated
21
  const pageIndex = app.pages.findIndex((page) => page.filePath === filePath)
×
22
  if (pageIndex !== -1) {
×
23
    return null
×
24
  }
25

26
  // create page
27
  const page = await createPage(app, {
×
28
    filePath,
29
  })
30

31
  // add the new page
32
  app.pages.push(page)
×
33

34
  // prepare page files
35
  await preparePageComponent(app, page)
×
36
  await preparePageData(app, page)
×
37

38
  // prepare pages entry
39
  await preparePagesComponents(app)
×
40
  await preparePagesData(app)
×
41
  await preparePagesRoutes(app)
×
42

43
  return page
×
44
}
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