From 86736e883a313e96b40e56807844546df9cd5a88 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Sun, 30 Sep 2018 00:15:11 +0800 Subject: [PATCH] feat($core): change style convention '.vuepress/style.styl' -> '.vuepress/styles/index.styl', i '.vuepress/palette.styl' -> '.vuepress/styles/palette.styl' --- .../core/lib/internal-plugins/palette/index.js | 2 +- .../core/lib/internal-plugins/style/index.js | 14 +++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/packages/@vuepress/core/lib/internal-plugins/palette/index.js b/packages/@vuepress/core/lib/internal-plugins/palette/index.js index 733264fd1c..b1b51b4db3 100644 --- a/packages/@vuepress/core/lib/internal-plugins/palette/index.js +++ b/packages/@vuepress/core/lib/internal-plugins/palette/index.js @@ -26,7 +26,7 @@ module.exports = (options, ctx) => ({ const themePalette = ctx.themePalette const { palette: userPalette } = ctx.siteConfig - const palettePath = path.resolve(sourceDir, '.vuepress/palette.styl') + const palettePath = path.resolve(sourceDir, '.vuepress/styles/palette.styl') const themePaletteContent = resolvePaletteContent(themePalette) const userPaletteContent = resolvePaletteContent(userPalette) diff --git a/packages/@vuepress/core/lib/internal-plugins/style/index.js b/packages/@vuepress/core/lib/internal-plugins/style/index.js index 8a8190ee3b..b28329e908 100644 --- a/packages/@vuepress/core/lib/internal-plugins/style/index.js +++ b/packages/@vuepress/core/lib/internal-plugins/style/index.js @@ -12,21 +12,13 @@ module.exports = (options, context) => ({ const hasUserOverride = fs.existsSync(overridePath) if (hasUserOverride) { - logger.tip(`${chalk.magenta('override.styl')} has been deprecated from v1.0.0, using ${chalk.cyan('config.palette')} instead.\n`) + logger.tip(`${chalk.magenta('override.styl')} has been deprecated from v1.0.0, using ${chalk.cyan('.vuepress/style/palette.styl')} instead.\n`) } // style.styl API. - const stylePath = path.resolve(sourceDir, '.vuepress/style.styl') + const stylePath = path.resolve(sourceDir, '.vuepress/styles/index.styl') const hasUserStyle = fs.existsSync(stylePath) - await writeTemp('style.styl', hasUserStyle ? `@import(${JSON.stringify(stylePath)})` : ``) - - // Temporary tip, will be removed at next release. - if (hasUserOverride && !hasUserStyle) { - logger.tip( - `${chalk.magenta('override.styl')} has been split into 2 APIs, we recommend you upgrade to continue.\n` + - ` See: ${chalk.magenta('https://vuepress.vuejs.org/default-theme-config/#simple-css-override')}` - ) - } + await writeTemp('style.styl', hasUserStyle ? `@import(${JSON.stringify(stylePath)})` : '') } })