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

@vuepress/plugin-git

Package Overview
Dependencies
Maintainers
7
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vuepress/plugin-git - npm Package Compare versions

Comparing version 2.0.0-alpha.20 to 2.0.0-alpha.21

lib/utils/getCreatedTime.d.ts

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [2.0.0-alpha.21](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.20...v2.0.0-alpha.21) (2021-02-05)
### Features
* **plugin-git:** collect page created time (close [#45](https://github.com/vuepress/vuepress-next/issues/45)) ([4045a8c](https://github.com/vuepress/vuepress-next/commit/4045a8c1ab591dbbb0303aa43c6d13bf248d995c))
# [2.0.0-alpha.20](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.19...v2.0.0-alpha.20) (2021-02-04)

@@ -8,0 +19,0 @@

4

lib/index.d.ts

@@ -9,2 +9,6 @@ import type { Plugin } from '@vuepress/core';

/**
* Whether to get the created time of a page
*/
createdTime?: boolean;
/**
* Whether to get the updated time of a page

@@ -11,0 +15,0 @@ */

5

lib/index.js

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

__exportStar(require("./utils"), exports);
const gitPlugin = ({ updatedTime, contributors }, app) => {
const gitPlugin = ({ createdTime, updatedTime, contributors }, app) => {
const cwd = app.dir.source();

@@ -28,2 +28,5 @@ const isGitRepoValid = utils_1.checkGitRepo(cwd);

}
if (createdTime !== false) {
git.createdTime = await utils_1.getCreatedTime(page.filePathRelative, cwd);
}
if (updatedTime !== false) {

@@ -30,0 +33,0 @@ git.updatedTime = await utils_1.getUpdatedTime(page.filePathRelative, cwd);

@@ -6,2 +6,6 @@ export interface GitPluginPageData {

/**
* Unix timestamp in milliseconds of the first commit
*/
createdTime?: number;
/**
* Unix timestamp in milliseconds of the last commit

@@ -8,0 +12,0 @@ */

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

const getUpdatedTime = async (filePath, cwd) => {
const { stdout } = await execa('git', ['log', '-1', '--format=%at', filePath], {
const { stdout } = await execa('git', ['--no-pager', 'log', '-1', '--format=%at', filePath], {
cwd,

@@ -12,0 +12,0 @@ });

export * from './checkGitRepo';
export * from './getContributors';
export * from './getCreatedTime';
export * from './getUpdatedTime';
//# sourceMappingURL=index.d.ts.map

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

__exportStar(require("./getContributors"), exports);
__exportStar(require("./getCreatedTime"), exports);
__exportStar(require("./getUpdatedTime"), exports);
//# sourceMappingURL=index.js.map
{
"name": "@vuepress/plugin-git",
"version": "2.0.0-alpha.20",
"version": "2.0.0-alpha.21",
"description": "VuePress plugin - git",

@@ -37,3 +37,3 @@ "keywords": [

},
"gitHead": "5c80ff3d24e4303734c87626b862ea04ff441ffa"
"gitHead": "a5c48b69899762d89f18d643c7ce899274b10c1f"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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