watskeburt 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs-bundle.js +1 -1
- package/package.json +1 -1
- package/src/formatters/regex.mjs +10 -6
- package/src/version.mjs +1 -1
- package/src/.eslintrc.json +0 -47
package/dist/cjs-bundle.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var
|
1
|
+
var a=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var A=(e,t)=>{for(var n in t)a(e,n,{get:t[n],enumerable:!0})},_=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of E(t))!C.call(e,r)&&r!==n&&a(e,r,{get:()=>t[r],enumerable:!(o=y(t,r))||o.enumerable});return e};var R=e=>_(a({},"__esModule",{value:!0}),e);var H={};A(H,{getSHA:()=>w,list:()=>M});module.exports=R(H);var u=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]+))?$/,v={A:"added",C:"copied",D:"deleted",M:"modified",R:"renamed",T:"type changed",U:"unmerged",B:"pairing broken"," ":"unmodified","?":"untracked","!":"ignored"};function i(e){return v[e]||"unknown"}function O(e){let t=e.match(L),n={};if(t){let o=i(t.groups.stagedChangeType),r=i(t.groups.unStagedChangeType);n.changeType=o==="unmodified"?r:o,t.groups.newName?(n.name=t.groups.newName,n.oldName=t.groups.name):n.name=t.groups.name}return n}function U(e){let t=e.match(D),n={};return t&&(n.changeType=i(t.groups.changeType),t.groups.newName?(n.name=t.groups.newName,n.oldName=t.groups.name):n.name=t.groups.name),n}function m(e){return e.split(u.EOL).filter(Boolean).map(O).filter(({changeType:t})=>Boolean(t))}function g(e){return e.split(u.EOL).filter(Boolean).map(U).filter(({changeType:t})=>Boolean(t))}var s=require("child_process");function d(e){return e instanceof Buffer?e.toString("utf8"):e}function j(e){throw e.code==="ENOENT"?new Error("git executable not found"):new Error(`internal spawn error: ${e}`)}function c(e,t,n){let o=n("git",e,{cwd:process.cwd(),env:process.env});if(o.error&&j(o.error),o.status===0)return d(o.stdout);throw new Error(t[o.status]||`internal git error: ${o.status} (${d(o.stderr)})`)}function T(e=s.spawnSync){let t={129:`'${process.cwd()}' does not seem to be a git repository`};return c(["status","--porcelain"],t,e)}function h(e,t=s.spawnSync){let n={128:`revision '${e}' unknown `,129:`'${process.cwd()}' does not seem to be a git repository`};return c(["diff",e,"--name-status"],n,t)}function S(e=s.spawnSync){return c(["rev-parse","HEAD"],{},e).slice(0,40)}var N=require("path");function f(e,t=[".js",".mjs",".cjs",".json",".jsx",".ts",".tsx",".vue",".vuex",".svelte",".coffee",".litcoffee",".csx",".cjsx",".ls"],n=["modified","added","renamed","copied","untracked"]){return`^(${e.filter(r=>n.includes(r.changeType)).map(({name:r})=>r).filter(r=>t.includes((0,N.extname)(r))).join("|")})$`}function l(e){return JSON.stringify(e,null,2)}var $={regex:f,json:l,object:e=>e},B="object";function p(e,t){return $[t||B](e)}function w(){return S()}function M(e,t){let n=e||w(),o=g(h(n)),r=t||{};return r.trackedOnly||(o=o.concat(m(T()).filter(({changeType:x})=>x==="untracked"))),p(o,r.outputType)}0&&(module.exports={getSHA,list});
|
package/package.json
CHANGED
package/src/formatters/regex.mjs
CHANGED
@@ -11,24 +11,28 @@ export default function formatToRegex(
|
|
11
11
|
pChanges,
|
12
12
|
pExtensions = [
|
13
13
|
".js",
|
14
|
-
".jsx",
|
15
14
|
".mjs",
|
16
15
|
".cjs",
|
16
|
+
".json",
|
17
|
+
".jsx",
|
17
18
|
".ts",
|
18
19
|
".tsx",
|
19
20
|
".vue",
|
20
21
|
".vuex",
|
21
|
-
".
|
22
|
+
".svelte",
|
23
|
+
".coffee",
|
24
|
+
".litcoffee",
|
25
|
+
".csx",
|
26
|
+
".cjsx",
|
27
|
+
".ls",
|
22
28
|
],
|
23
29
|
pChangeTypes = ["modified", "added", "renamed", "copied", "untracked"]
|
24
30
|
) {
|
25
31
|
const lChanges = pChanges
|
26
32
|
.filter((pChange) => pChangeTypes.includes(pChange.changeType))
|
27
|
-
.map(
|
28
|
-
// .replace(/\./g, "\\\\.")
|
29
|
-
({ name }) => name
|
30
|
-
)
|
33
|
+
.map(({ name }) => name)
|
31
34
|
.filter((pName) => pExtensions.includes(extname(pName)))
|
35
|
+
// .replace(/\./g, "\\\\.")
|
32
36
|
.join("|");
|
33
37
|
return `^(${lChanges})$`;
|
34
38
|
}
|
package/src/version.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const VERSION = "0.
|
1
|
+
export const VERSION = "0.5.0";
|
package/src/.eslintrc.json
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"root": true,
|
3
|
-
"extends": ["moving-meadow"],
|
4
|
-
"overrides": [
|
5
|
-
{
|
6
|
-
"files": ["**/*.mjs"],
|
7
|
-
"rules": {
|
8
|
-
"unicorn/no-null": "off",
|
9
|
-
"unicorn/prefer-spread": "off",
|
10
|
-
"node/no-unsupported-features/es-syntax": "off",
|
11
|
-
"import/no-relative-parent-imports": "off",
|
12
|
-
"sort-imports": "off",
|
13
|
-
"unicorn/prefer-node-protocol": "error",
|
14
|
-
"unicorn/prefer-module": "error"
|
15
|
-
},
|
16
|
-
"parserOptions": {
|
17
|
-
"ecmaVersion": "latest"
|
18
|
-
}
|
19
|
-
},
|
20
|
-
{
|
21
|
-
"files": ["**/*.spec.mjs"],
|
22
|
-
"env": {
|
23
|
-
"mocha": true
|
24
|
-
},
|
25
|
-
"rules": {
|
26
|
-
"no-magic-numbers": "off",
|
27
|
-
"security/detect-non-literal-require": "off",
|
28
|
-
"security/detect-non-literal-fs-filename": "off",
|
29
|
-
"max-lines-per-function": "off",
|
30
|
-
"max-lines": "off",
|
31
|
-
"no-null": "off"
|
32
|
-
}
|
33
|
-
},
|
34
|
-
{
|
35
|
-
"files": ["types/*.ts"],
|
36
|
-
"plugins": ["@typescript-eslint"],
|
37
|
-
"extends": ["plugin:@typescript-eslint/recommended"],
|
38
|
-
"parser": "@typescript-eslint/parser",
|
39
|
-
"parserOptions": {
|
40
|
-
"ecmaVersion": "latest"
|
41
|
-
},
|
42
|
-
"rules": {
|
43
|
-
"node/no-unsupported-features/es-syntax": "off"
|
44
|
-
}
|
45
|
-
}
|
46
|
-
]
|
47
|
-
}
|