From 1dd1b55c51db34a538fbe3a663a3aec12d29c132 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Wed, 17 Oct 2018 14:21:13 +0800 Subject: [PATCH] fix: wrong import path (close: #937) --- packages/@vuepress/core/lib/prepare/Page.js | 3 +-- packages/@vuepress/markdown/__tests__/slugify.spec.js | 2 +- packages/@vuepress/markdown/lib/index.js | 3 +-- packages/@vuepress/markdown/package.json | 1 - packages/@vuepress/shared-utils/index.js | 1 + packages/@vuepress/{markdown => shared-utils}/lib/slugify.js | 0 packages/@vuepress/shared-utils/package.json | 3 ++- 7 files changed, 6 insertions(+), 7 deletions(-) rename packages/@vuepress/{markdown => shared-utils}/lib/slugify.js (100%) diff --git a/packages/@vuepress/core/lib/prepare/Page.js b/packages/@vuepress/core/lib/prepare/Page.js index cffd130e00..1a155e6f39 100644 --- a/packages/@vuepress/core/lib/prepare/Page.js +++ b/packages/@vuepress/core/lib/prepare/Page.js @@ -4,9 +4,8 @@ * Module dependencies. */ -const slugify = require('../../../markdown/lib/slugify') const { inferDate, DATE_RE } = require('../util/index') -const { extractHeaders, fs, path, fileToPath, parseFrontmatter, getPermalink, inferTitle } = require('@vuepress/shared-utils') +const { extractHeaders, fs, path, fileToPath, parseFrontmatter, getPermalink, inferTitle, slugify } = require('@vuepress/shared-utils') /** * Expose Page class. diff --git a/packages/@vuepress/markdown/__tests__/slugify.spec.js b/packages/@vuepress/markdown/__tests__/slugify.spec.js index 2c6a77b6c5..22525bec09 100644 --- a/packages/@vuepress/markdown/__tests__/slugify.spec.js +++ b/packages/@vuepress/markdown/__tests__/slugify.spec.js @@ -1,6 +1,6 @@ import { Md } from './util' import anchor from 'markdown-it-anchor' -import slugify from '../lib/slugify.js' +import slugify from '../../shared-utils/lib/slugify.js' const mdS = Md().use(anchor, { slugify, diff --git a/packages/@vuepress/markdown/lib/index.js b/packages/@vuepress/markdown/lib/index.js index d2577edb69..2b44e8c25d 100644 --- a/packages/@vuepress/markdown/lib/index.js +++ b/packages/@vuepress/markdown/lib/index.js @@ -17,8 +17,7 @@ const snippetPlugin = require('./snippet') const emojiPlugin = require('markdown-it-emoji') const anchorPlugin = require('markdown-it-anchor') const tocPlugin = require('markdown-it-table-of-contents') -const _slugify = require('./slugify') -const { parseHeaders } = require('@vuepress/shared-utils') +const { parseHeaders, slugify: _slugify } = require('@vuepress/shared-utils') /** * Create markdown by config. diff --git a/packages/@vuepress/markdown/package.json b/packages/@vuepress/markdown/package.json index 505bce1c9f..2ba51b411e 100644 --- a/packages/@vuepress/markdown/package.json +++ b/packages/@vuepress/markdown/package.json @@ -19,7 +19,6 @@ ], "dependencies": { "@vuepress/shared-utils": "^1.0.0-alpha.11", - "diacritics": "^1.3.0", "markdown-it": "^8.4.1", "markdown-it-anchor": "^5.0.2", "markdown-it-chain": "^1.2.1", diff --git a/packages/@vuepress/shared-utils/index.js b/packages/@vuepress/shared-utils/index.js index 11590320f0..c4dfe3a27f 100644 --- a/packages/@vuepress/shared-utils/index.js +++ b/packages/@vuepress/shared-utils/index.js @@ -31,3 +31,4 @@ exports.globby = require('globby') exports.hash = require('hash-sum') exports.fallback = require('./lib/fallback') +exports.slugify = require('./lib/slugify') diff --git a/packages/@vuepress/markdown/lib/slugify.js b/packages/@vuepress/shared-utils/lib/slugify.js similarity index 100% rename from packages/@vuepress/markdown/lib/slugify.js rename to packages/@vuepress/shared-utils/lib/slugify.js diff --git a/packages/@vuepress/shared-utils/package.json b/packages/@vuepress/shared-utils/package.json index 455389ec3b..c086a2d489 100644 --- a/packages/@vuepress/shared-utils/package.json +++ b/packages/@vuepress/shared-utils/package.json @@ -22,7 +22,8 @@ "fs-extra": "^5.0.0", "globby": "^8.0.1", "hash-sum": "^1.0.2", - "upath": "^1.1.0" + "upath": "^1.1.0", + "diacritics": "^1.3.0" }, "author": "ULIVZ ", "license": "MIT",