🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

buildstamp

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buildstamp - npm Package Compare versions

Comparing version

to
2.1.2

37

package.json
{
"name": "buildstamp",
"version": "2.1.1",
"version": "2.1.2",
"publishConfig": {

@@ -8,3 +8,3 @@ "access": "public"

"description": "Buildstamp",
"source": "src/main/ts/index.ts",
"type": "module",
"main": "target/es6/index.js",

@@ -19,3 +19,3 @@ "bin": "./target/es6/cli.js",

},
"./": "./"
"./*": "./*"
},

@@ -26,3 +26,2 @@ "types": "typings/index.d.ts",

},
"type": "module",
"scripts": {

@@ -32,3 +31,3 @@ "lint": "eslint src/**/*.ts",

"test": "yarn lint && yarn test:unit",
"test:unit": "NODE_OPTIONS='--experimental-vm-modules' jest -w 1 --config=jest.config.json",
"test:unit": "NODE_OPTIONS='--experimental-vm-modules' jest --config=jest.config.json",
"test:depcheck": "npm_config_yes=true npx -p depcheck -p @babel/parser@7.16.4 depcheck --ignores typedoc,tslib,eslint-config-*",

@@ -65,21 +64,21 @@ "clean": "rimraf target typings flow-typed buildcache",

"devDependencies": {
"@jest/globals": "^29.0.0",
"@jest/globals": "^29.5.0",
"@qiwi/libdefkit": "^5.0.0",
"@qiwi/license": "^1.4.4",
"@types/jest": "^29.0.0",
"@qiwi/license": "^2.0.0",
"@types/jest": "^29.5.2",
"@types/mkdirp": "^1.0.2",
"@types/node": "^18.7.18",
"@types/node": "^20.3.2",
"@types/rimraf": "^3.0.2",
"mkdirp": "^1.0.4",
"prettier": "^2.7.1",
"rimraf": "^3.0.2",
"terser": "^5.15.0",
"ts-jest": "^29.0.0",
"typedoc": "^0.23.15",
"typescript": "4.7.4"
"mkdirp": "^3.0.1",
"prettier": "^2.8.8",
"rimraf": "^5.0.1",
"terser": "^5.18.1",
"ts-jest": "^29.1.0",
"typedoc": "^0.24.8",
"typescript": "5.1.3"
},
"dependencies": {
"find-git-root": "^1.0.4",
"meow": "^11.0.0",
"tslib": "^2.4.0"
"@antongolub/git-root": "^1.5.13",
"meow": "^12.0.1",
"tslib": "^2.6.0"
},

@@ -86,0 +85,0 @@ "engines": {

import { TStampChunk } from '../interfaces.js';
export declare type TGitStamp = {
export type TGitStamp = {
commitId: string;

@@ -7,4 +7,4 @@ repoName: string;

};
export declare type TVcsInfoCreator = (cwd?: string) => TGitStamp;
export declare type IGitStampOptions = {
export type TVcsInfoCreator = (cwd?: string) => TGitStamp;
export type IGitStampOptions = {
git?: boolean;

@@ -11,0 +11,0 @@ };

@@ -1,11 +0,11 @@

import findGitRoot from 'find-git-root';
import { sep } from 'path';
import { gitRootSync } from '@antongolub/git-root';
import { sep, join } from 'node:path';
import { readFileToString } from '../utils.js';
export const getGitInfo = (argCwd) => {
const cwd = argCwd || process.cwd();
const gitFolder = findGitRoot(cwd);
const gitFolder = join(gitRootSync(cwd) + '', '.git');
const rev = readFileToString(`${gitFolder}${sep}HEAD`).trim();
const commitId = !rev.includes(':')
? rev
: readFileToString(`${gitFolder}${sep}` + rev.slice('ref: '.length)).trim();
const commitId = rev.includes(':')
? readFileToString(`${gitFolder}${sep}` + rev.slice('ref: '.length)).trim()
: rev;
const repoUrlRegexp = /\turl = (.+)$/;

@@ -12,0 +12,0 @@ const repoNameRegexp = /\turl =.+[/:]([\w-]+\/[\w-]+).*$/;

@@ -1,3 +0,3 @@

import fs from 'fs';
import { sep } from 'path';
import fs from 'node:fs';
import { sep } from 'node:path';
import { defaultJsonSpace, spaceTypes } from '../constants.js';

@@ -4,0 +4,0 @@ import { resolveFilePath } from '../output/pathResolver.js';

@@ -1,6 +0,6 @@

export declare type TEnv = Record<string, any>;
export declare type TDockerDetails = {
export type TEnv = Record<string, any>;
export type TDockerDetails = {
imageTag?: string;
};
export declare type TGitDetails = {
export type TGitDetails = {
commitId: string;

@@ -10,3 +10,3 @@ repoName: string;

};
export declare type TStamp = Record<string, any> & {
export type TStamp = Record<string, any> & {
date?: string | number;

@@ -16,11 +16,11 @@ docker?: TDockerDetails;

};
export declare type TOutputOptions = {
export type TOutputOptions = {
path: string;
jsonSeparator?: 'tab' | 'space' | 'double-space';
};
export declare type TDateOptions = {
export type TDateOptions = {
format: 'iso' | 'instant';
value?: string | number;
};
export declare type TStampOptions = Record<string, any> & {
export type TStampOptions = Record<string, any> & {
date?: TDateOptions;

@@ -31,3 +31,3 @@ docker?: TDockerDetails;

};
export declare type TChunkContext = {
export type TChunkContext = {
context?: TChunkContext;

@@ -39,5 +39,5 @@ stamp?: TStamp;

};
export declare type TStampChunk = {
export type TStampChunk = {
<T extends TChunkContext = TChunkContext>(ctx: T, env?: TEnv): T;
[key: string]: any;
};

@@ -1,3 +0,3 @@

import fs from 'fs';
import p from 'path';
import fs from 'node:fs';
import p from 'node:path';
import { defaultFilename } from '../constants.js';

@@ -4,0 +4,0 @@ import { hasTrailingSeparator } from '../utils.js';

@@ -1,2 +0,2 @@

import fs from 'fs';
import fs from 'node:fs';
export const readFileToString = (path) => fs.readFileSync(path, 'utf-8');

@@ -3,0 +3,0 @@ export const hasTrailingSeparator = (path, sep) => path.slice(-sep.length) === sep;

@@ -1,3 +0,3 @@

import findGitRoot from 'find-git-root'
import { sep } from 'path'
import { gitRootSync } from '@antongolub/git-root'
import { sep, join } from 'node:path'

@@ -21,9 +21,9 @@ import { TStampChunk } from '../interfaces'

const cwd = argCwd || process.cwd()
const gitFolder = findGitRoot(cwd)
const gitFolder = join(gitRootSync(cwd) + '', '.git')
const rev = readFileToString(`${gitFolder}${sep}HEAD`).trim()
const commitId = !rev.includes(':')
? rev
: readFileToString(`${gitFolder}${sep}` + rev.slice('ref: '.length)).trim()
const commitId = rev.includes(':')
? readFileToString(`${gitFolder}${sep}` + rev.slice('ref: '.length)).trim()
: rev

@@ -30,0 +30,0 @@ const repoUrlRegexp = /\turl = (.+)$/

@@ -1,3 +0,3 @@

import fs from 'fs'
import { sep } from 'path'
import fs from 'node:fs'
import { sep } from 'node:path'

@@ -4,0 +4,0 @@ import { defaultJsonSpace, spaceTypes } from '../constants'

@@ -1,3 +0,3 @@

import fs from 'fs'
import p from 'path'
import fs from 'node:fs'
import p from 'node:path'

@@ -4,0 +4,0 @@ import { defaultFilename } from '../constants'

@@ -1,2 +0,2 @@

import fs from 'fs'
import fs from 'node:fs'

@@ -3,0 +3,0 @@ export const readFileToString = (path: string): string => fs.readFileSync(path, 'utf-8')

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