watskeburt 0.9.2 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/cli.mjs +9 -5
- package/bin/version.mjs +1 -1
- package/dist/cjs-bundle.cjs +1 -1
- package/dist/esm-bundle.mjs +1 -1
- package/package.json +4 -4
package/bin/cli.mjs
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
2
|
/* eslint-disable no-console */
|
3
|
-
|
4
|
-
import { program } from "commander";
|
3
|
+
import { EOL } from "node:os";
|
4
|
+
import { Option, program } from "commander";
|
5
5
|
import { listSync } from "../dist/esm-bundle.mjs";
|
6
6
|
import { VERSION } from "./version.mjs";
|
7
7
|
|
@@ -9,13 +9,17 @@ program
|
|
9
9
|
.description(
|
10
10
|
"lists files & their statuses since [old-revision] " +
|
11
11
|
"or between [old-revision] and [new-revision]." +
|
12
|
-
|
12
|
+
`${EOL}${EOL}` +
|
13
13
|
"-> When you don't pass a revision at all old-revision defaults to the current one."
|
14
14
|
)
|
15
|
-
.
|
16
|
-
|
15
|
+
.addOption(
|
16
|
+
new Option("-T, --output-type <type>", "what format to emit")
|
17
|
+
.choices(["json", "regex"])
|
18
|
+
.default("regex")
|
19
|
+
)
|
17
20
|
.option("--tracked-only", "only take tracked files into account", false)
|
18
21
|
.arguments("[old-revision] [new-revision]")
|
22
|
+
.version(VERSION)
|
19
23
|
.parse(process.argv);
|
20
24
|
|
21
25
|
try {
|
package/bin/version.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const VERSION = "0.
|
1
|
+
export const VERSION = "0.10.0";
|
package/dist/cjs-bundle.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var i=Object.defineProperty;var
|
1
|
+
"use strict";var i=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var x=(t,e)=>{for(var n in e)i(t,n,{get:e[n],enumerable:!0})},A=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of E(e))!N.call(t,o)&&o!==n&&i(t,o,{get:()=>e[o],enumerable:!(r=w(e,o))||r.enumerable});return t};var _=t=>A(i({},"__esModule",{value:!0}),t);var H={};x(H,{getSHASync:()=>R,listSync:()=>v});module.exports=_(H);var g=require("os"),D=/^(?<changeType>[ACDMRTUXB])(?<similarity>[0-9]{3})?[ \t]+(?<name>[^ \t]+)[ \t]*(?<newName>[^ \t]+)?$/,L=/^(?<stagedChangeType>[ ACDMRTUXB?!])(?<unStagedChangeType>[ ACDMRTUXB?!])[ \t]+(?<name>[^ \t]+)(( -> )(?<newName>[^ \t]+))?$/,O={A:"added",C:"copied",D:"deleted",M:"modified",R:"renamed",T:"type changed",U:"unmerged",B:"pairing broken"," ":"unmodified","?":"untracked","!":"ignored"};function p(t){return O[t]??"unknown"}function k(t){let e=t.match(L),n={};if(e!=null&&e.groups){let r=p(e.groups.stagedChangeType),o=p(e.groups.unStagedChangeType);n.changeType=r==="unmodified"?o:r,e.groups.newName?(n.name=e.groups.newName,n.oldName=e.groups.name):n.name=e.groups.name}return n}function B(t){let e=t.match(D),n={};return e!=null&&e.groups&&(n.changeType=p(e.groups.changeType),e.groups.newName?(n.name=e.groups.newName,n.oldName=e.groups.name):n.name=e.groups.name),n}function y(t){return t.split(g.EOL).filter(Boolean).map(k).filter(({name:e,changeType:n})=>Boolean(e)&&Boolean(n))}function l(t){return t.split(g.EOL).filter(Boolean).map(B).filter(({name:e,changeType:n})=>Boolean(e)&&Boolean(n))}var a=require("child_process");function d(t){return t instanceof Buffer?t.toString("utf8"):t}function U(t){throw t.code==="ENOENT"?new Error("git executable not found"):new Error(`internal spawn error: ${t}`)}function u(t,e,n){let r=n("git",t,{cwd:process.cwd(),env:process.env});if(r.error&&U(r.error),r.status===0)return d(r.stdout);throw new Error(e[r.status??0]||`internal git error: ${r.status} (${d(r.stderr)})`)}function h(t=a.spawnSync){let e={129:`'${process.cwd()}' does not seem to be a git repository`};return u(["status","--porcelain"],e,t)}function S(t,e,n=a.spawnSync){let r={128:`revision '${t}' ${e?`(or '${e}') `:""}unknown`,129:`'${process.cwd()}' does not seem to be a git repository`};return u(e?["diff",t,e,"--name-status"]:["diff",t,"--name-status"],r,n)}function c(t=a.spawnSync){return u(["rev-parse","HEAD"],{},t).slice(0,40)}var C=require("path"),$=new Set([".cjs",".cjsx",".coffee",".csx",".cts",".js",".json",".jsx",".litcoffee",".ls",".mjs",".mts",".svelte",".ts",".tsx",".vue",".vuex"]),b=new Set(["modified","added","renamed","copied","untracked"]);function f(t,e=$,n=b){return`^(${t.filter(o=>n.has(o.changeType)).map(({name:o})=>o).filter(o=>e.has((0,C.extname)(o))).join("|")})$`}function m(t){return JSON.stringify(t,null,2)}var M=t=>t,P=new Map([["regex",f],["json",m]]);function T(t,e){return(P.get(e??"unknown")||M)(t)}function R(){return c()}function v(t,e,n){let r=t||c(),o=n||{},s=l(S(r,e));return o.trackedOnly||(s=s.concat(y(h()).filter(({changeType:I})=>I==="untracked"))),T(s,o.outputType)}0&&(module.exports={getSHASync,listSync});
|
package/dist/esm-bundle.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{EOL as m}from"os";var C=/^(?<changeType>[ACDMRTUXB])(?<similarity>[0-9]{3})?[ \t]+(?<name>[^ \t]+)[ \t]*(?<newName>[^ \t]+)?$/,I=/^(?<stagedChangeType>[ ACDMRTUXB?!])(?<unStagedChangeType>[ ACDMRTUXB?!])[ \t]+(?<name>[^ \t]+)(( -> )(?<newName>[^ \t]+))?$/,
|
1
|
+
import{EOL as m}from"os";var C=/^(?<changeType>[ACDMRTUXB])(?<similarity>[0-9]{3})?[ \t]+(?<name>[^ \t]+)[ \t]*(?<newName>[^ \t]+)?$/,I=/^(?<stagedChangeType>[ ACDMRTUXB?!])(?<unStagedChangeType>[ ACDMRTUXB?!])[ \t]+(?<name>[^ \t]+)(( -> )(?<newName>[^ \t]+))?$/,w={A:"added",C:"copied",D:"deleted",M:"modified",R:"renamed",T:"type changed",U:"unmerged",B:"pairing broken"," ":"unmodified","?":"untracked","!":"ignored"};function s(t){return w[t]??"unknown"}function E(t){let e=t.match(I),n={};if(e!=null&&e.groups){let r=s(e.groups.stagedChangeType),o=s(e.groups.unStagedChangeType);n.changeType=r==="unmodified"?o:r,e.groups.newName?(n.name=e.groups.newName,n.oldName=e.groups.name):n.name=e.groups.name}return n}function N(t){let e=t.match(C),n={};return e!=null&&e.groups&&(n.changeType=s(e.groups.changeType),e.groups.newName?(n.name=e.groups.newName,n.oldName=e.groups.name):n.name=e.groups.name),n}function T(t){return t.split(m).filter(Boolean).map(E).filter(({name:e,changeType:n})=>Boolean(e)&&Boolean(n))}function y(t){return t.split(m).filter(Boolean).map(N).filter(({name:e,changeType:n})=>Boolean(e)&&Boolean(n))}import{spawnSync as i}from"child_process";function l(t){return t instanceof Buffer?t.toString("utf8"):t}function x(t){throw t.code==="ENOENT"?new Error("git executable not found"):new Error(`internal spawn error: ${t}`)}function p(t,e,n){let r=n("git",t,{cwd:process.cwd(),env:process.env});if(r.error&&x(r.error),r.status===0)return l(r.stdout);throw new Error(e[r.status??0]||`internal git error: ${r.status} (${l(r.stderr)})`)}function d(t=i){let e={129:`'${process.cwd()}' does not seem to be a git repository`};return p(["status","--porcelain"],e,t)}function h(t,e,n=i){let r={128:`revision '${t}' ${e?`(or '${e}') `:""}unknown`,129:`'${process.cwd()}' does not seem to be a git repository`};return p(e?["diff",t,e,"--name-status"]:["diff",t,"--name-status"],r,n)}function g(t=i){return p(["rev-parse","HEAD"],{},t).slice(0,40)}import{extname as A}from"path";var _=new Set([".cjs",".cjsx",".coffee",".csx",".cts",".js",".json",".jsx",".litcoffee",".ls",".mjs",".mts",".svelte",".ts",".tsx",".vue",".vuex"]),D=new Set(["modified","added","renamed","copied","untracked"]);function u(t,e=_,n=D){return`^(${t.filter(o=>n.has(o.changeType)).map(({name:o})=>o).filter(o=>e.has(A(o))).join("|")})$`}function c(t){return JSON.stringify(t,null,2)}var L=t=>t,O=new Map([["regex",u],["json",c]]);function f(t,e){return(O.get(e??"unknown")||L)(t)}function J(){return g()}function Y(t,e,n){let r=t||g(),o=n||{},a=y(h(r,e));return o.trackedOnly||(a=a.concat(T(d()).filter(({changeType:S})=>S==="untracked"))),f(a,o.outputType)}export{J as getSHASync,Y as listSync};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "watskeburt",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.10.0",
|
4
4
|
"description": "List files changed since a git revision",
|
5
5
|
"keywords": [
|
6
6
|
"git",
|
@@ -48,9 +48,9 @@
|
|
48
48
|
},
|
49
49
|
"devDependencies": {
|
50
50
|
"@types/mocha": "10.0.1",
|
51
|
-
"@types/node": "18.
|
51
|
+
"@types/node": "18.14.0",
|
52
52
|
"@typescript-eslint/eslint-plugin": "5.52.0",
|
53
|
-
"c8": "7.
|
53
|
+
"c8": "7.13.0",
|
54
54
|
"dependency-cruiser": "12.9.0",
|
55
55
|
"esbuild": "0.17.8",
|
56
56
|
"eslint": "8.34.0",
|
@@ -68,7 +68,7 @@
|
|
68
68
|
"prettier": "2.8.4",
|
69
69
|
"ts-node": "10.9.1",
|
70
70
|
"typescript": "4.9.5",
|
71
|
-
"upem": "7.3.
|
71
|
+
"upem": "7.3.2"
|
72
72
|
},
|
73
73
|
"engines": {
|
74
74
|
"node": "^14||^16||>=18"
|