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

chore: upgrade to vue 2.6 #1370

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/@vuepress/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@
"postcss-safe-parser": "^4.0.1",
"toml": "^3.0.0",
"url-loader": "^1.0.1",
"vue": "^2.5.16",
"vue-loader": "^15.2.4",
"vue": "^2.6.8",
"vue-loader": "^15.7.0",
"vue-router": "^3.0.2",
"vue-server-renderer": "^2.5.16",
"vue-template-compiler": "^2.5.16",
"vue-server-renderer": "^2.6.8",
"vue-template-compiler": "^2.6.8",
"vuepress-html-webpack-plugin": "^3.2.0",
"vuepress-plugin-container": "^2.0.0",
"webpack": "^4.8.1",
Expand Down
96 changes: 56 additions & 40 deletions packages/@vuepress/markdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ const tocPlugin = require('markdown-it-table-of-contents')
const {
slugify: _slugify,
parseHeaders,
logger, chalk, normalizeConfig,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you revert the changes about formatted code?

Copy link
Collaborator

Choose a reason for hiding this comment

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

it is a format from the code it should happen i think

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see any config for code format in the vuepress repos. In this case, I think we should not do changes about code formatting in PRs to avoid unnecessary changes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

i will revert that change yeah

logger,
chalk,
normalizeConfig,
moduleResolver: { getMarkdownItResolver }
} = require('@vuepress/shared-utils')

Expand All @@ -47,64 +49,76 @@ module.exports = (markdown = {}) => {
// using chainedAPI
const config = new Config()

config
.options
.html(true)
.highlight(highlight)
.end()
config.options
.html(true)
.highlight(highlight)
.end()

.plugin(PLUGINS.COMPONENT)
.use(componentPlugin)
.end()
.use(componentPlugin)
.end()

.plugin(PLUGINS.HIGHLIGHT_LINES)
.use(highlightLinesPlugin)
.end()
.use(highlightLinesPlugin)
.end()

.plugin(PLUGINS.PRE_WRAPPER)
.use(preWrapperPlugin)
.end()
.use(preWrapperPlugin)
.end()

.plugin(PLUGINS.SNIPPET)
.use(snippetPlugin)
.end()
.use(snippetPlugin)
.end()

.plugin(PLUGINS.CONVERT_ROUTER_LINK)
.use(convertRouterLinkPlugin, [Object.assign({
target: '_blank',
rel: 'noopener noreferrer'
}, externalLinks)])
.end()
.use(convertRouterLinkPlugin, [
Object.assign(
{
target: '_blank',
rel: 'noopener noreferrer'
},
externalLinks
)
])
.end()

.plugin(PLUGINS.HOIST_SCRIPT_STYLE)
.use(hoistScriptStylePlugin)
.end()
.use(hoistScriptStylePlugin)
.end()

.plugin(PLUGINS.EMOJI)
.use(emojiPlugin)
.end()
.use(emojiPlugin)
.end()

.plugin(PLUGINS.ANCHOR)
.use(anchorPlugin, [Object.assign({
slugify,
permalink: true,
permalinkBefore: true,
permalinkSymbol: '#'
}, anchor)])
.end()
.use(anchorPlugin, [
Object.assign(
{
slugify,
permalink: true,
permalinkBefore: true,
permalinkSymbol: '#'
},
anchor
)
])
.end()

.plugin(PLUGINS.TOC)
.use(tocPlugin, [Object.assign({
slugify,
includeLevel: [2, 3],
format: parseHeaders
}, toc)])
.end()
.use(tocPlugin, [
Object.assign(
{
slugify,
includeLevel: [2, 3],
format: parseHeaders
},
toc
)
])
.end()

if (lineNumbers) {
config
.plugin(PLUGINS.LINE_NUMBERS)
.use(lineNumbersPlugin)
config.plugin(PLUGINS.LINE_NUMBERS).use(lineNumbersPlugin)
}

beforeInstantiate && beforeInstantiate(config)
Expand Down Expand Up @@ -159,7 +173,9 @@ function isRequiredPlugin (plugin) {
}

function removePlugin (config, plugin) {
logger.debug(`Built-in markdown-it plugin ${chalk.green(plugin)} was removed.`)
logger.debug(
`Built-in markdown-it plugin ${chalk.green(plugin)} was removed.`
)
config.plugins.delete(plugin)
}

Expand Down
4 changes: 4 additions & 0 deletions packages/@vuepress/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"vue-jest": "^4.0.0-beta.1",
"vue-template-compiler": "^2.5.16"
},
"peerDependencies": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why now would we need these two dependencies as peerDependencies?

Copy link
Collaborator

Choose a reason for hiding this comment

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

in test utils we no mention of vuejs. It's just a protection to say i need at least vue 2x to work. It installing nothing

"vue": "^2.x",
"vue-template-compiler": "^2.x"
},
"author": "ULIVZ <[email protected]>",
"license": "MIT",
"bugs": {
Expand Down
13 changes: 13 additions & 0 deletions packages/@vuepress/theme-blog/layouts/Layout2.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<template>
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is this Layout2 component about?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah it seem useless... i didnt pay attention on it

<div class="container">
<header>
<Content #header/>
</header>
<main>
<Content/>
</main>
<footer>
<Content #footer/>
</footer>
</div>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default {
$themeLocaleConfig.sidebarDepth,
$themeConfig.sidebarDepth,
1
].find(depth => depth !== undefined);
].find(depth => depth !== undefined)

const displayAllHeaders = $themeLocaleConfig.displayAllHeaders
|| $themeConfig.displayAllHeaders
Expand Down
8 changes: 4 additions & 4 deletions packages/@vuepress/theme-default/layouts/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
>
<slot
name="sidebar-top"
slot="top"
#top
/>
<slot
name="sidebar-bottom"
slot="bottom"
#bottom
/>
</Sidebar>

Expand All @@ -37,11 +37,11 @@
>
<slot
name="page-top"
slot="top"
#top
/>
<slot
name="page-bottom"
slot="bottom"
#bottom
/>
</Page>
</div>
Expand Down
4 changes: 2 additions & 2 deletions packages/@vuepress/theme-vue/layouts/Layout.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<ParentLayout>
<CarbonAds slot="sidebar-top"/>
<BuySellAds slot="page-bottom"/>
<CarbonAds #sidebar-top/>
<BuySellAds #page-bottom/>
</ParentLayout>
</template>

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/plugin/official/plugin-pwa.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ First, you need to create a global component (e.g. `MySWUpdatePopup`) at `.vuepr
<template>
<SWUpdatePopup>
<div
slot-scope="{ enabled, reload, message, buttonText }"
v-slot="{ enabled, reload, message, buttonText }"
class="my-sw-update-popup">
{{ message }}<br>
<button @click="reload">{{ buttonText }}</button>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/theme/inheritance.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ You can use `@parent-theme` to access the root path of the parent theme. The fol
<!-- themePath/components/Foo.vue -->
<template>
<ParentLayout>
<Foo slot="foo"/>
<Foo #foo/>
</ParentLayout>
</template>

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/zh/plugin/official/plugin-pwa.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ module.exports = {
<template>
<SWUpdatePopup>
<div
slot-scope="{ enabled, reload, message, buttonText }"
v-slot="{ enabled, reload, message, buttonText }"
class="my-sw-update-popup">
{{ message }}<br>
<button @click="reload">{{ buttonText }}</button>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/zh/theme/inheritance.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ theme
<!-- themePath/components/Foo.vue -->
<template>
<ParentLayout>
<Foo slot="foo"/>
<Foo #foo/>
</ParentLayout>
</template>

Expand Down
Loading