2.0.0-rc.2 • Published 1 month ago

@vuepress/utils v2.0.0-rc.2

Weekly downloads
216
License
MIT
Repository
github
Last release
1 month ago

vuepress-next

github check github docs license

Status: Alpha

The codebase has been completely refactored with TypeScript. Some major changes:

  • Fully migrated to Vue 3
  • Extract @vuepress/cli from vuepress package
  • Extract @vuepress/client from @vuepress/core package
  • Extract @vuepress/bundler-webpack from @vuepress/core package - other bundlers are also possible to be supported
  • Extract @vuepress/plugin-palette-stylus from @vuepress/core package - stylus is no longer the default CSS pre-processor, and the way of styles customization should be determined by theme

The documentation has not finished yet. For now you can check out the breaking changes list below as migration reference.

Contribution

See Contributing Guide.

TODO List

  • @vuepress/markdown

    • snippetsPlugin
  • Official plugins

    • @vuepress/plugin-pwa
  • Documentation

    • Guide
    • References
    • API
    • Migration Guide

Breaking Changes

Temporarily record some breaking changes here.

Core

User config

  • shouldPrefetch -> the default value is changed to false
  • patterns -> pagePatterns
  • extraWatchFiles -> removed
  • evergreen -> the default value is changed to true
  • markdown
    • markdown.lineNumbers -> markdown.code.lineNumbers, and the default value is changed to true
    • markdown.slugify -> removed
    • markdown.pageSuffix -> removed
    • markdown.externalLinks -> markdown.links.externalAttrs
    • markdown.toc -> changed
    • markdown.plugins -> removed
    • markdown.extendMarkdown -> removed
    • markdown.extractHeaders -> changed
  • All webpack related configs are moved to bundlerConfig (with @vuepress/bundler-webpack)
    • postcss -> bundlerConfig.postcss
    • stylus -> bundlerConfig.stylus
    • scss -> bundlerConfig.scss
    • sass -> bundlerConfig.sass
    • less -> bundlerConfig.less
    • chainWebpack -> bundlerConfig.chainWebpack
    • configureWebpack -> bundlerConfig.configureWebpack

Permalink patterns

  • :i_month -> removed
  • :i_day -> removed
  • :minutes -> removed (undocumented in 1.0)
  • :seconds -> removed (undocumented in 1.0)
  • :regular -> :raw

Stylus Palette system

The stylus palette system of Vuepress 1.0 (i.e. styles/palette.styl and styles/index.styl) will only work in default theme.

To make the stylus palette system reusable, it's extracted to @vuepress/plugin-palette-stylus.

Theme authors can use their own way for users to configure styles (not be limited with stylus).

Frontmatter

  • meta -> head, which uses the same type with siteConfig.head

    For example:

    head:
      - - meta
        - name: foo
          content: bar
      - - link
        - rel: canonical
          href: foobar
      - - script
        - {}
        - console.log('hello from frontmatter');

    Has the same structure with:

    // .vuepress/config.js
    module.exports = {
      // ...
      head: [
        ['meta', { name: 'foo', content: 'bar' }],
        ['link', { rel: 'canonical', href: 'foobar' }],
        ['script', {}, `console.log('hello from frontmatter');`],
      ],
      // ...
    }

Plugin API

  • ready -> onPrepared
  • updated -> removed
  • generated -> onGenerated
  • additionalPages -> removed, use app.pages.push(createPage()) in onInitialized hook
  • clientDynamicModules -> removed, use app.writeTemp() in onPrepared hook
  • enhanceAppFiles -> clientAppEnhanceFiles
  • globalUIComponents -> clientAppRootComponentFiles
  • clientRootMixin -> clientAppSetupFiles
  • extendMarkdown -> extendsMarkdown
  • extendPageData -> extendsPageData
  • extendsCli -> removed
  • configureWebpack -> removed
  • chainWebpack -> removed
  • beforeDevServer -> removed
  • afterDevServer -> removed

Theme API

  • extend -> extends

You can still inherit a parent theme with extends: 'parent-theme', which will extends the plugins, layouts, etc.

However, the @theme and @parent-theme aliases are not available now.

CLI

  • -c, --cache [cache] -> --cache <cache> - the shorthand -c is not for cache option, and the value of cache option is not optional
  • --no-cache -> --clean-cache

Default Theme

  • <CodeGroup>, <CodeBlock> -> <CodeGroup>, <CodeGroupItem>
  • Default theme config has changed a lot. Please checkout the types definition and our docs/.vuepress/config.ts as reference
@huan_kong/vuepress-theme-gungnir@iamtmoe/vuepress-theme-blog@starzkg/vuepress-plugin-github-cornervuepress-theme-lcxvuepress-plugin-edit-page-linkvuepress-plugin-copy-code-button@everything-registry/sub-chunk-995@dwspace/vuepress-plugin-rssvuepress-plugin-meilisearch2vuepress-plugin-menuvuepress-plugin-mermaid-nextvuepress-plugin-mermaid-wrappervuepress-plugin-mermaidjs-nextvuepress-plugin-netabare-switchvuepress-plugin-reactvuepress-plugin-locale-redirectvuepress-plugin-full-text-search2vuepress-plugin-giscusvuepress-plugin-google-adsense2vuepress-plugin-default-theme-mermaidvuepress-plugin-demo-block-editvuepress-plugin-i18nvuepress-plugin-dynamic-title2vuepress-plugin-issue-btnvuepress-plugin-demoblock-plusvuepress-theme-zpvuepress-theme-wayvuepress-theme-wenbinvuepress2-plugin-demo-block-editvuepress-plugin-readmore-popular-nextvuepress-plugin-redirect2vuepress-plugin-umami-analyticsvuepress-plugin-way-playervuepress-plugin-wibu-2dlivevuepress-plugin-yandex-metrikavuepress-theme-dumivuepress-theme-dumi2vuepress-theme-celestavuepress-theme-aliasingvuepress-theme-anemosvuepress-theme-fleetvuepress-theme-gungnirvuepress-plugin-code-switchervuepress-plugin-attrsvuepress-plugin-bgvuepress-plugin-alertvuepress-plugin-baidu-analyticsvuepress-plugin-baidu-seo-nextvuepress-plugin-code-block-nossrvuepress-plugin-code-enhancevuepress-plugin-chartvuepress-plugin-clarity-analyticsvuepressvuepress-mermaidvuepress-theme-junkvuepress-theme-kingvuepress-theme-teadocsvuepress-theme-mixvuepress-theme-stellatmx-theme-defaultzyl870138612vmihailenco-vuepress-theme-default@infinitebrahmanuniverse/nolb-_vueprui-plugin-md-enhance@libybai/vuepress-theme-libybai@lando/vuepress-theme-default-plus@mr-huang/vuepress-plugin-comment@galtproject/bundler-vite@galtproject/vuepress-bundler-vite@peteretelej/vuepress-plugin-fulltext-search@nesercode/vuepress-neser-back-to-top@nesercode/vuepress-neser-down-to-comment@nesercode/vuepress-plugin-up-and-down@nesercode/vuepress-theme-nesercodevuepress-theme-tzzvuepress-plugin-full-text-search-pageplugin-active-header-links-tj@pengzhanbo/vuepress-plugin-caniuse@pengzhanbo/vuepress-theme-plume@panzhiyue/vuepress-plugin-demo-block@panzhiyue/vuepress-theme-knowledge@qcyblm/vuepress-theme-vpx@nova-cbb/vuepress-theme@vuepress-denaro/vuepress-plugin-vue-preview@vuepress-persiliao/plugin-post@vuepress-plume/plugin-windicss@vuepress-plume/vuepress-plugin-baidu-tongji@vuepress-plume/vuepress-plugin-blog-data@vuepress-plume/vuepress-plugin-caniuse@vuepress-plume/vuepress-plugin-iconify@vuepress-plume/vuepress-plugin-netlify-functions@vuepress-plume/vuepress-plugin-notes-data@vuepress-plume/vuepress-plugin-windicss@vuepress-denaro/core@vuepress-plume/plugin-netlify-functions@vuepress-plume/vuepress-plugin-copy-code@vuepress-plume/vuepress-theme-plume@vuepress-reco/style-default@vpzk/plugin-treesitter@vmidoc/vuepress-theme-vmidoc
2.0.0-rc.9

1 month ago

2.0.0-rc.8

2 months ago

2.0.0-rc.7

3 months ago

2.0.0-rc.6

3 months ago

2.0.0-rc.5

3 months ago

2.0.0-rc.3

3 months ago

2.0.0-rc.4

3 months ago

2.0.0-rc.2

3 months ago

2.0.0-rc.1

3 months ago

2.0.0-beta.66

10 months ago

2.0.0-beta.65

10 months ago

2.0.0-beta.64

10 months ago

2.0.0-beta.68

6 months ago

2.0.0-beta.67

8 months ago

2.0.0-rc.0

5 months ago

2.0.0-beta.63

11 months ago

2.0.0-beta.62

12 months ago

2.0.0-beta.61

1 year ago

2.0.0-beta.60

1 year ago

2.0.0-beta.55

1 year ago

2.0.0-beta.54

1 year ago

2.0.0-beta.53

2 years ago

2.0.0-beta.52

2 years ago

2.0.0-beta.59

1 year ago

2.0.0-beta.58

1 year ago

2.0.0-beta.57

1 year ago

2.0.0-beta.56

1 year ago

2.0.0-beta.51

2 years ago

2.0.0-beta.50

2 years ago

2.0.0-beta.49

2 years ago

2.0.0-beta.48

2 years ago

2.0.0-beta.47

2 years ago

2.0.0-beta.40

2 years ago

2.0.0-beta.44

2 years ago

2.0.0-beta.43

2 years ago

2.0.0-beta.42

2 years ago

2.0.0-beta.41

2 years ago

2.0.0-beta.46

2 years ago

2.0.0-beta.45

2 years ago

2.0.0-beta.38

2 years ago

2.0.0-beta.37

2 years ago

2.0.0-beta.28

2 years ago

2.0.0-beta.33

2 years ago

2.0.0-beta.32

2 years ago

2.0.0-beta.35

2 years ago

2.0.0-beta.27

2 years ago

2.0.0-beta.25

3 years ago

2.0.0-beta.24

3 years ago

2.0.0-beta.23

3 years ago

2.0.0-beta.21

3 years ago

2.0.0-beta.20

3 years ago

2.0.0-beta.19

3 years ago

2.0.0-beta.15

3 years ago

2.0.0-beta.18

3 years ago

2.0.0-beta.11

3 years ago

2.0.0-beta.8

3 years ago

2.0.0-beta.7

3 years ago

2.0.0-beta.5

3 years ago

2.0.0-beta.4

3 years ago

2.0.0-beta.1

3 years ago

2.0.0-beta.0

3 years ago

2.0.0-alpha.25

3 years ago

2.0.0-alpha.24

3 years ago

2.0.0-alpha.20

3 years ago

2.0.0-alpha.19

3 years ago

2.0.0-alpha.18

3 years ago

2.0.0-alpha.15

3 years ago

2.0.0-alpha.13

3 years ago

2.0.0-alpha.6

3 years ago

2.0.0-alpha.7

3 years ago

2.0.0-alpha.4

3 years ago

2.0.0-alpha.1

3 years ago