Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vuepress/core

Package Overview
Dependencies
Maintainers
6
Versions
192
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vuepress/core - npm Package Compare versions

Comparing version 2.0.0-beta.47 to 2.0.0-beta.48

3

lib/app/prepare/preparePageData.js

@@ -23,3 +23,4 @@ "use strict";

// page data file content
let content = `export const data = ${JSON.stringify(page.data, null, 2)}\n`;
let content = `export const data = JSON.parse(${JSON.stringify(JSON.stringify(page.data))})
`;
// inject HMR code

@@ -26,0 +27,0 @@ if (app.env.isDev) {

@@ -6,5 +6,5 @@ "use strict";

/**
* Transform a page object to a route item
* Resolve page route item
*/
const transformPageToRouteItem = ({ key, path, pathInferred, filePathRelative, routeMeta, }) => {
const resolvePageRouteItem = ({ key, path, pathInferred, filePathRelative, routeMeta, }) => {
// paths that should redirect to this page, use set to dedupe

@@ -41,34 +41,7 @@ const redirectsSet = new Set();

const preparePagesRoutes = async (app) => {
const routeItems = app.pages.map(transformPageToRouteItem);
const routeItems = app.pages.map(resolvePageRouteItem);
const content = `\
import { Vuepress } from '@vuepress/client'
const routeItems = [\
export const pagesRoutes = [\
${routeItems.map((routeItem) => `\n ${JSON.stringify(routeItem)},`).join('')}
]
export const pagesRoutes = routeItems.reduce(
(result, [name, path, meta, redirects]) => {
result.push(
{
name,
path,
component: Vuepress,
meta,
},
...redirects.map((item) => ({
path: item,
redirect: path,
}))
)
return result
},
[
{
name: '404',
path: '/:catchAll(.*)',
component: Vuepress,
}
]
)
`;

@@ -75,0 +48,0 @@ await app.writeTemp('internal/pagesRoutes.js', content);

@@ -23,3 +23,3 @@ "use strict";

let content = `\
export const siteData = ${JSON.stringify(app.siteData, null, 2)}
export const siteData = JSON.parse(${JSON.stringify(JSON.stringify(app.siteData))})
`;

@@ -26,0 +26,0 @@ // inject HMR code

{
"name": "@vuepress/core",
"version": "2.0.0-beta.47",
"version": "2.0.0-beta.48",
"description": "Core package of VuePress",

@@ -25,6 +25,6 @@ "keywords": [

"dependencies": {
"@vuepress/client": "2.0.0-beta.47",
"@vuepress/markdown": "2.0.0-beta.47",
"@vuepress/shared": "2.0.0-beta.47",
"@vuepress/utils": "2.0.0-beta.47",
"@vuepress/client": "2.0.0-beta.48",
"@vuepress/markdown": "2.0.0-beta.48",
"@vuepress/shared": "2.0.0-beta.48",
"@vuepress/utils": "2.0.0-beta.48",
"gray-matter": "^4.0.3",

@@ -31,0 +31,0 @@ "toml": "^3.0.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc