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 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
- "\n\n" +
12
+ `${EOL}${EOL}` +
13
13
  "-> When you don't pass a revision at all old-revision defaults to the current one."
14
14
  )
15
- .version(VERSION)
16
- .option("-T, --output-type <type>", "json,regex", "regex")
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.9.2";
1
+ export const VERSION = "0.10.0";
@@ -1 +1 @@
1
- "use strict";var i=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var N=(n,e)=>{for(var t in e)i(n,t,{get:e[t],enumerable:!0})},A=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of w(e))!x.call(n,o)&&o!==t&&i(n,o,{get:()=>e[o],enumerable:!(r=E(e,o))||r.enumerable});return n};var _=n=>A(i({},"__esModule",{value:!0}),n);var F={};N(F,{getSHASync:()=>j,listSync:()=>k});module.exports=_(F);var p=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 g(n){return O[n]??"unknown"}function B(n){let e=n.match(L),t={};if(e!=null&&e.groups){let r=g(e.groups.stagedChangeType),o=g(e.groups.unStagedChangeType);t.changeType=r==="unmodified"?o:r,e.groups.newName?(t.name=e.groups.newName,t.oldName=e.groups.name):t.name=e.groups.name}return t}function U(n){let e=n.match(D),t={};return e!=null&&e.groups&&(t.changeType=g(e.groups.changeType),e.groups.newName?(t.name=e.groups.newName,t.oldName=e.groups.name):t.name=e.groups.name),t}function l(n){return n.split(p.EOL).filter(Boolean).map(B).filter(({name:e,changeType:t})=>Boolean(e)&&Boolean(t))}function d(n){return n.split(p.EOL).filter(Boolean).map(U).filter(({name:e,changeType:t})=>Boolean(e)&&Boolean(t))}var a=require("child_process");function h(n){return n instanceof Buffer?n.toString("utf8"):n}function $(n){throw n.code==="ENOENT"?new Error("git executable not found"):new Error(`internal spawn error: ${n}`)}function u(n,e,t){let r=t("git",n,{cwd:process.cwd(),env:process.env});if(r.error&&$(r.error),r.status===0)return h(r.stdout);throw new Error(e[r.status??0]||`internal git error: ${r.status} (${h(r.stderr)})`)}function y(n=a.spawnSync){let e={129:`'${process.cwd()}' does not seem to be a git repository`};return u(["status","--porcelain"],e,n)}function S(n,e,t=a.spawnSync){let r={128:`revision '${n}' ${e?`(or '${e}') `:""}unknown`,129:`'${process.cwd()}' does not seem to be a git repository`};return u(e?["diff",n,e,"--name-status"]:["diff",n,"--name-status"],r,t)}function c(n=a.spawnSync){return u(["rev-parse","HEAD"],{},n).slice(0,40)}var C=require("path"),M=new Set([".cjs",".cjsx",".coffee",".csx",".cts",".js",".json",".jsx",".litcoffee",".ls",".mjs",".mts",".svelte",".ts",".tsx",".vue",".vuex"]),P=new Set(["modified","added","renamed","copied","untracked"]);function f(n,e=M,t=P){return`^(${n.filter(o=>t.has(o.changeType)).map(({name:o})=>o).filter(o=>e.has((0,C.extname)(o))).join("|")})$`}var R=2;function m(n){return JSON.stringify(n,null,R)}var v=n=>n,H=new Map([["regex",f],["json",m]]);function T(n,e){return(H.get(e??"unknown")||v)(n)}function j(){return c()}function k(n,e,t){let r=n||c(),o=t||{},s=d(S(r,e));return o.trackedOnly||(s=s.concat(l(y()).filter(({changeType:I})=>I==="untracked"))),T(s,o.outputType)}0&&(module.exports={getSHASync,listSync});
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});
@@ -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]+))?$/,E={A:"added",C:"copied",D:"deleted",M:"modified",R:"renamed",T:"type changed",U:"unmerged",B:"pairing broken"," ":"unmodified","?":"untracked","!":"ignored"};function s(n){return E[n]??"unknown"}function w(n){let e=n.match(I),t={};if(e!=null&&e.groups){let r=s(e.groups.stagedChangeType),o=s(e.groups.unStagedChangeType);t.changeType=r==="unmodified"?o:r,e.groups.newName?(t.name=e.groups.newName,t.oldName=e.groups.name):t.name=e.groups.name}return t}function x(n){let e=n.match(C),t={};return e!=null&&e.groups&&(t.changeType=s(e.groups.changeType),e.groups.newName?(t.name=e.groups.newName,t.oldName=e.groups.name):t.name=e.groups.name),t}function T(n){return n.split(m).filter(Boolean).map(w).filter(({name:e,changeType:t})=>Boolean(e)&&Boolean(t))}function l(n){return n.split(m).filter(Boolean).map(x).filter(({name:e,changeType:t})=>Boolean(e)&&Boolean(t))}import{spawnSync as i}from"child_process";function d(n){return n instanceof Buffer?n.toString("utf8"):n}function N(n){throw n.code==="ENOENT"?new Error("git executable not found"):new Error(`internal spawn error: ${n}`)}function g(n,e,t){let r=t("git",n,{cwd:process.cwd(),env:process.env});if(r.error&&N(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(n=i){let e={129:`'${process.cwd()}' does not seem to be a git repository`};return g(["status","--porcelain"],e,n)}function y(n,e,t=i){let r={128:`revision '${n}' ${e?`(or '${e}') `:""}unknown`,129:`'${process.cwd()}' does not seem to be a git repository`};return g(e?["diff",n,e,"--name-status"]:["diff",n,"--name-status"],r,t)}function p(n=i){return g(["rev-parse","HEAD"],{},n).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(n,e=_,t=D){return`^(${n.filter(o=>t.has(o.changeType)).map(({name:o})=>o).filter(o=>e.has(A(o))).join("|")})$`}var L=2;function c(n){return JSON.stringify(n,null,L)}var O=n=>n,B=new Map([["regex",u],["json",c]]);function f(n,e){return(B.get(e??"unknown")||O)(n)}function Y(){return p()}function V(n,e,t){let r=n||p(),o=t||{},a=l(y(r,e));return o.trackedOnly||(a=a.concat(T(h()).filter(({changeType:S})=>S==="untracked"))),f(a,o.outputType)}export{Y as getSHASync,V as listSync};
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.9.2",
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.13.0",
51
+ "@types/node": "18.14.0",
52
52
  "@typescript-eslint/eslint-plugin": "5.52.0",
53
- "c8": "7.12.0",
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.1"
71
+ "upem": "7.3.2"
72
72
  },
73
73
  "engines": {
74
74
  "node": "^14||^16||>=18"