buildstamp
Advanced tools
Comparing version 2.1.1 to 2.1.2
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
43480
2
+ Added@antongolub/git-root@^1.5.13
+ Addedmeow@12.1.1(transitive)
- Removedfind-git-root@^1.0.4
- Removed@babel/code-frame@7.26.2(transitive)
- Removed@babel/helper-validator-identifier@7.25.9(transitive)
- Removed@types/minimist@1.2.5(transitive)
- Removed@types/normalize-package-data@2.4.4(transitive)
- Removedarrify@1.0.1(transitive)
- Removedcamelcase@7.0.1(transitive)
- Removedcamelcase-keys@8.0.2(transitive)
- Removeddecamelize@1.2.06.0.0(transitive)
- Removeddecamelize-keys@1.1.1(transitive)
- Removederror-ex@1.3.2(transitive)
- Removedfind-git-root@1.0.4(transitive)
- Removedfind-up@6.3.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedhard-rejection@2.1.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhosted-git-info@4.1.05.2.1(transitive)
- Removedindent-string@5.0.0(transitive)
- Removedis-arrayish@0.2.1(transitive)
- Removedis-core-module@2.15.1(transitive)
- Removedis-plain-obj@1.1.0(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedjson-parse-even-better-errors@2.3.1(transitive)
- Removedkind-of@6.0.3(transitive)
- Removedlines-and-columns@1.2.4(transitive)
- Removedlocate-path@7.2.0(transitive)
- Removedlru-cache@6.0.07.18.3(transitive)
- Removedmap-obj@1.0.14.3.0(transitive)
- Removedmeow@11.0.0(transitive)
- Removedmin-indent@1.0.1(transitive)
- Removedminimist-options@4.1.0(transitive)
- Removednormalize-package-data@3.0.34.0.1(transitive)
- Removedp-limit@4.0.0(transitive)
- Removedp-locate@6.0.0(transitive)
- Removedparse-json@5.2.0(transitive)
- Removedpath-exists@5.0.0(transitive)
- Removedpicocolors@1.1.1(transitive)
- Removedquick-lru@6.1.2(transitive)
- Removedread-pkg@7.1.0(transitive)
- Removedread-pkg-up@9.1.0(transitive)
- Removedredent@4.0.0(transitive)
- Removedsemver@7.6.3(transitive)
- Removedspdx-correct@3.2.0(transitive)
- Removedspdx-exceptions@2.5.0(transitive)
- Removedspdx-expression-parse@3.0.1(transitive)
- Removedspdx-license-ids@3.0.20(transitive)
- Removedstrip-indent@4.0.0(transitive)
- Removedtrim-newlines@4.1.1(transitive)
- Removedtype-fest@2.19.03.13.1(transitive)
- Removedvalidate-npm-package-license@3.0.4(transitive)
- Removedyallist@4.0.0(transitive)
- Removedyargs-parser@21.1.1(transitive)
- Removedyocto-queue@1.1.1(transitive)
Updatedmeow@^12.0.1
Updatedtslib@^2.6.0