watskeburt
Advanced tools
Comparing version 0.10.1 to 0.10.2
// generated by tools/get-version.ts - edits will be overwritten | ||
export const VERSION = "0.10.1"; | ||
export const VERSION = "0.10.2"; |
@@ -22,3 +22,3 @@ import { spawnSync } from "node:child_process"; | ||
*/ | ||
function getGitResult(pArguments, pErrorMap, pSpawnFunction) { | ||
function getGitResultSync(pArguments, pErrorMap, pSpawnFunction) { | ||
const lGitResult = pSpawnFunction("git", pArguments, { | ||
@@ -43,7 +43,7 @@ cwd: process.cwd(), | ||
*/ | ||
export function getStatusShort(pSpawnFunction = spawnSync) { | ||
export function getStatusShortSync(pSpawnFunction = spawnSync) { | ||
const lErrorMap = { | ||
129: `'${process.cwd()}' does not seem to be a git repository`, | ||
}; | ||
return getGitResult(["status", "--porcelain"], lErrorMap, pSpawnFunction); | ||
return getGitResultSync(["status", "--porcelain"], lErrorMap, pSpawnFunction); | ||
} | ||
@@ -54,3 +54,3 @@ /** | ||
*/ | ||
export function getDiffLines(pOldRevision, pNewRevision, pSpawnFunction = spawnSync) { | ||
export function getDiffLinesSync(pOldRevision, pNewRevision, pSpawnFunction = spawnSync) { | ||
const lErrorMap = { | ||
@@ -60,9 +60,9 @@ 128: `revision '${pOldRevision}' ${pNewRevision ? `(or '${pNewRevision}') ` : ""}unknown`, | ||
}; | ||
return getGitResult(pNewRevision | ||
return getGitResultSync(pNewRevision | ||
? ["diff", pOldRevision, pNewRevision, "--name-status"] | ||
: ["diff", pOldRevision, "--name-status"], lErrorMap, pSpawnFunction); | ||
} | ||
export function getSHA1(pSpawnFunction = spawnSync) { | ||
export function getSHASync(pSpawnFunction = spawnSync) { | ||
const lSha1Length = 40; | ||
return getGitResult(["rev-parse", "HEAD"], {}, pSpawnFunction).slice(0, lSha1Length); | ||
return getGitResultSync(["rev-parse", "HEAD"], {}, pSpawnFunction).slice(0, lSha1Length); | ||
} |
import { convertDiffLines, convertStatusLines, } from "./convert-to-change-object.js"; | ||
import { getDiffLines, getSHA1, getStatusShort } from "./git-primitives.js"; | ||
import { getDiffLinesSync, getSHASync, getStatusShortSync, } from "./git-primitives.js"; | ||
import format from "./formatters/format.js"; | ||
export function getSHASync() { | ||
return getSHA1(); | ||
} | ||
export function listSync(pOldRevision, pNewRevision, pOptions) { | ||
const lOldRevision = pOldRevision || getSHA1(); | ||
const lOldRevision = pOldRevision || getSHASync(); | ||
const lOptions = pOptions || {}; | ||
let lChanges = convertDiffLines(getDiffLines(lOldRevision, pNewRevision)); | ||
let lChanges = convertDiffLines(getDiffLinesSync(lOldRevision, pNewRevision)); | ||
if (!lOptions.trackedOnly) { | ||
lChanges = lChanges.concat(convertStatusLines(getStatusShort()).filter(({ changeType }) => changeType === "untracked")); | ||
lChanges = lChanges.concat(convertStatusLines(getStatusShortSync()).filter(({ changeType }) => changeType === "untracked")); | ||
} | ||
return format(lChanges, lOptions.outputType); | ||
} | ||
export { getSHASync } from "./git-primitives.js"; |
{ | ||
"name": "watskeburt", | ||
"version": "0.10.1", | ||
"version": "0.10.2", | ||
"description": "List files changed since a git revision", | ||
@@ -51,10 +51,10 @@ "keywords": [ | ||
"@types/mocha": "10.0.1", | ||
"@types/node": "18.15.3", | ||
"@typescript-eslint/eslint-plugin": "5.55.0", | ||
"@types/node": "18.15.11", | ||
"@typescript-eslint/eslint-plugin": "5.58.0", | ||
"c8": "7.13.0", | ||
"dependency-cruiser": "12.10.2", | ||
"esbuild": "0.17.12", | ||
"eslint": "8.36.0", | ||
"dependency-cruiser": "13.0.0-beta-1", | ||
"esbuild": "0.17.16", | ||
"eslint": "8.38.0", | ||
"eslint-config-moving-meadow": "4.0.2", | ||
"eslint-config-prettier": "8.7.0", | ||
"eslint-config-prettier": "8.8.0", | ||
"eslint-plugin-budapestian": "5.0.1", | ||
@@ -69,7 +69,16 @@ "eslint-plugin-eslint-comments": "3.2.0", | ||
"npm-run-all": "4.1.5", | ||
"prettier": "2.8.4", | ||
"prettier": "2.8.7", | ||
"ts-node": "10.9.1", | ||
"typescript": "5.0.2", | ||
"typescript": "5.0.4", | ||
"upem": "7.3.2" | ||
}, | ||
"upem": { | ||
"policies": [ | ||
{ | ||
"package": "dependency-cruiser", | ||
"policy": "wanted", | ||
"because": "we're beta testing v13 & policy 'latest' would downgraded it back to v12 again" | ||
} | ||
] | ||
}, | ||
"engines": { | ||
@@ -89,12 +98,12 @@ "node": "^14||^16||>=18" | ||
"test:cover": "NODE_OPTIONS=--no-warnings c8 mocha", | ||
"depcruise": "depcruise bin dist src types --config --output-type err", | ||
"depcruise:graph": "depcruise bin src types --include-only '^(bin|dist|src|types)' --config --output-type dot | dot -T svg | tee docs/dependency-graph.svg | depcruise-wrap-stream-in-html > docs/dependency-graph.html", | ||
"depcruise:graph:archi": "depcruise bin src --include-only '^(bin|dist|src|types)' --config --output-type archi | dot -T svg | depcruise-wrap-stream-in-html > docs/high-level-dependency-graph.html", | ||
"depcruise:graph:dev": "depcruise bin dist src types --include-only '^(bin|dist|src|types)' --prefix vscode://file/$(pwd)/ --config --output-type dot | dot -T svg | depcruise-wrap-stream-in-html | browser", | ||
"depcruise:graph:diff:dev": "depcruise bin dist src types --include-only '^(bin|dist|src|types)' --highlight \"$(node bin/cli.js main -T regex)\" --prefix vscode://file/$(pwd)/ --config --output-type dot | dot -T svg | depcruise-wrap-stream-in-html | browser", | ||
"depcruise:graph:diff:mermaid": "depcruise bin dist src types --include-only '^(bin|dist|src|types)' --config --output-type mermaid --output-to - --highlight \"$(node bin/cli.js $SHA -T regex)\"", | ||
"depcruise:html": "depcruise bin src types --progress --config --output-type err-html --output-to dependency-violation-report.html", | ||
"depcruise:text": "depcruise bin src types --progress --config --output-type text", | ||
"depcruise:focus": "depcruise bin src types --progress --config --output-type text --focus", | ||
"depcruise:reaches": "depcruise bin src types --progress --config --output-type text --reaches", | ||
"depcruise": "depcruise bin dist src types", | ||
"depcruise:graph": "depcruise bin src types --include-only '^(bin|dist|src|types)' --output-type dot | dot -T svg | tee docs/dependency-graph.svg | depcruise-wrap-stream-in-html > docs/dependency-graph.html", | ||
"depcruise:graph:archi": "depcruise bin src --include-only '^(bin|dist|src|types)' --output-type archi | dot -T svg | depcruise-wrap-stream-in-html > docs/high-level-dependency-graph.html", | ||
"depcruise:graph:dev": "depcruise bin dist src types --include-only '^(bin|dist|src|types)' --prefix vscode://file/$(pwd)/ --output-type dot | dot -T svg | depcruise-wrap-stream-in-html | browser", | ||
"depcruise:graph:diff:dev": "depcruise bin dist src types --include-only '^(bin|dist|src|types)' --highlight \"$(node bin/cli.js main -T regex)\" --prefix vscode://file/$(pwd)/ --output-type dot | dot -T svg | depcruise-wrap-stream-in-html | browser", | ||
"depcruise:graph:diff:mermaid": "depcruise bin dist src types --include-only '^(bin|dist|src|types)' --output-type mermaid --output-to - --highlight \"$(node bin/cli.js $SHA -T regex)\"", | ||
"depcruise:html": "depcruise bin src types --progress --output-type err-html --output-to dependency-violation-report.html", | ||
"depcruise:text": "depcruise bin src types --progress --output-type text", | ||
"depcruise:focus": "depcruise bin src types --progress --output-type text --focus", | ||
"depcruise:reaches": "depcruise bin src types --progress --output-type text --reaches", | ||
"format": "prettier --write \"{bin,src,tools}/**/*.{js,ts}\" \"types/**/*.ts\" \"*.{json,yml,md,js}\"", | ||
@@ -101,0 +110,0 @@ "format:check": "prettier --loglevel warn --check \"{bin,src,tools}/**/*.ts\" \"types/**/*.ts\" \"*.{json,yml,md,js}\"", |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
22720
1
307