binary-collections 2.0.7 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/dir-tree.cmd +7 -0
- package/bin/git-diff +4 -0
- package/bin/git-diff.cmd +5 -2
- package/bin/{git-fix-encoding → git-fix} +1 -4
- package/bin/git-fix.cmd +7 -0
- package/bin/nodekill +0 -0
- package/bin/nodekill.ps1 +0 -0
- package/bin/{submodule → submodule.txt} +0 -0
- package/lib/binary-collections-config.cjs +14 -0
- package/lib/binary-collections-config.d.mts +18 -0
- package/lib/binary-collections-config.d.ts +16 -0
- package/lib/binary-collections-config.js +39 -0
- package/lib/binary-collections-config.mjs +6 -0
- package/lib/binary-collections.cjs +123 -0
- package/lib/binary-collections.d.cts +2 -0
- package/lib/binary-collections.d.mts +137 -0
- package/lib/binary-collections.d.ts +137 -0
- package/lib/binary-collections.mjs +300 -0
- package/lib/changelog.cjs +328 -0
- package/lib/changelog.d.mts +2 -0
- package/lib/changelog.d.ts +1 -0
- package/lib/changelog.js +226 -0
- package/lib/changelog.mjs +199 -0
- package/lib/chunk-4BYBVEYC.mjs +30 -0
- package/lib/{chunk-FB6YIQYR.mjs → chunk-AASHBCRW.mjs} +17 -2
- package/lib/chunk-APBWENF6.mjs +135 -0
- package/lib/{chunk-4LEXWIIF.mjs → chunk-DPKAJKFO.mjs} +2 -4
- package/lib/chunk-EGSSKVDH.mjs +66 -0
- package/lib/{chunk-3LOB2P54.mjs → chunk-G3THLIDT.mjs} +3 -5
- package/lib/chunk-JGR2NW6D.mjs +187 -0
- package/lib/chunk-ONIBBBQ3.mjs +108 -0
- package/lib/chunk-SH3L6HHV.mjs +27 -0
- package/lib/chunk-VVEZVNIV.mjs +81 -0
- package/lib/{chunk-JL32QDSH.mjs → chunk-W3ENOM53.mjs} +2 -4
- package/lib/chunk-YV7DO3YV.mjs +48 -0
- package/lib/{chunk-BSD5CIRU.mjs → chunk-YX5U7XDR.mjs} +11 -5
- package/lib/chunk-ZYAQRPUL.mjs +28 -0
- package/lib/clean-github-actions-caches.cjs +162 -0
- package/lib/clean-github-actions-caches.d.cts +1 -0
- package/lib/clean-github-actions-caches.d.mts +169 -0
- package/lib/clean-github-actions-caches.d.ts +169 -0
- package/lib/clean-github-actions-caches.mjs +132 -0
- package/lib/del-gradle.cjs +87 -3
- package/lib/del-gradle.js +1 -1
- package/lib/del-gradle.mjs +4 -6
- package/lib/del-node-modules.cjs +86 -2
- package/lib/del-node-modules.mjs +3 -5
- package/lib/del-ps.cjs +89 -5
- package/lib/del-ps.js +2 -2
- package/lib/del-ps.mjs +6 -8
- package/lib/del-yarn-caches.cjs +86 -2
- package/lib/del-yarn-caches.mjs +3 -5
- package/lib/find-node-modules-cli.cjs +8 -0
- package/lib/find-node-modules-cli.mjs +2 -3
- package/lib/find-node-modules.cjs +8 -0
- package/lib/find-node-modules.d.mts +3 -0
- package/lib/find-node-modules.d.ts +3 -0
- package/lib/find-node-modules.js +12 -0
- package/lib/find-node-modules.mjs +2 -3
- package/lib/git/gitattributes.cjs +171 -0
- package/lib/git/gitattributes.d.mts +35 -0
- package/lib/git/gitattributes.d.ts +33 -0
- package/lib/git/gitattributes.js +223 -0
- package/lib/git/gitattributes.mjs +6 -0
- package/lib/git/line-endings.cjs +74 -0
- package/lib/git/line-endings.d.cts +7 -0
- package/lib/git/line-endings.d.mts +83 -0
- package/lib/git/line-endings.d.ts +83 -0
- package/lib/git/line-endings.mjs +8 -0
- package/lib/git/normalize.cjs +42 -0
- package/lib/git/normalize.d.cts +6 -0
- package/lib/git/normalize.d.mts +43 -0
- package/lib/git/normalize.d.ts +43 -0
- package/lib/git/normalize.mjs +6 -0
- package/lib/git/permissions.cjs +15 -0
- package/lib/git/permissions.d.cts +6 -0
- package/lib/git/permissions.d.mts +17 -0
- package/lib/git/permissions.d.ts +17 -0
- package/lib/git/permissions.mjs +7 -0
- package/lib/git/pull-strategy.cjs +13 -0
- package/lib/git/pull-strategy.d.cts +5 -0
- package/lib/git/pull-strategy.d.mts +15 -0
- package/lib/git/pull-strategy.d.ts +15 -0
- package/lib/git/pull-strategy.mjs +7 -0
- package/lib/git/user-config.cjs +100 -0
- package/lib/git/user-config.d.cts +10 -0
- package/lib/git/user-config.d.mts +105 -0
- package/lib/git/user-config.d.ts +105 -0
- package/lib/git/user-config.mjs +8 -0
- package/lib/git/utils.cjs +70 -0
- package/lib/git/utils.d.cts +20 -0
- package/lib/git/utils.d.mts +69 -0
- package/lib/git/utils.d.ts +69 -0
- package/lib/git/utils.mjs +6 -0
- package/lib/git-diff.cjs +23 -24
- package/lib/git-diff.d.mts +25 -28
- package/lib/git-diff.d.ts +25 -28
- package/lib/git-diff.mjs +32 -27
- package/lib/git-fix.cjs +129 -0
- package/lib/git-fix.d.cts +2 -0
- package/lib/git-fix.d.mts +141 -0
- package/lib/git-fix.d.ts +141 -0
- package/lib/git-fix.mjs +151 -0
- package/lib/git-purge.cjs +86 -2
- package/lib/git-purge.mjs +3 -5
- package/lib/index.cjs +8 -0
- package/lib/index.mjs +3 -5
- package/lib/npm-run-series.cjs +140 -1
- package/lib/npm-run-series.js +2 -1
- package/lib/npm-run-series.mjs +7 -5
- package/lib/package-resolutions-updater.cjs +447 -0
- package/lib/package-resolutions-updater.d.mts +1 -0
- package/lib/package-resolutions-updater.d.ts +352 -0
- package/lib/package-resolutions-updater.mjs +339 -0
- package/lib/print-directory-tree.cjs +241 -0
- package/lib/print-directory-tree.d.cts +1 -0
- package/lib/print-directory-tree.d.mts +234 -0
- package/lib/print-directory-tree.d.ts +234 -0
- package/lib/print-directory-tree.mjs +182 -0
- package/lib/ps/connected-domain.mjs +2 -3
- package/lib/ps/index.cjs +3 -3
- package/lib/ps/index.d.mjs +1 -2
- package/lib/ps/index.js +6 -3
- package/lib/ps/index.mjs +9 -11
- package/lib/ps/isWin.mjs +2 -3
- package/lib/ps/table-parser.mjs +3 -4
- package/lib/submodule-install.cjs +18 -35
- package/lib/submodule-install.d.mts +17 -37
- package/lib/submodule-install.d.ts +17 -37
- package/lib/submodule-install.mjs +21 -29
- package/lib/utils.cjs +86 -2
- package/lib/utils.d.mts +29 -9
- package/lib/utils.d.ts +28 -8
- package/lib/utils.js +139 -8
- package/lib/utils.mjs +2 -3
- package/lib/yarn-reinstall.cjs +9 -7
- package/lib/yarn-reinstall.d.mts +12 -8
- package/lib/yarn-reinstall.d.ts +12 -8
- package/lib/yarn-reinstall.mjs +14 -10
- package/package.json +109 -80
- package/readme.md +74 -11
- package/src/package-resolutions-updater.mjs +350 -0
- package/src/print-directory-tree.cjs +234 -0
- package/src/ps/index.js +4 -3
- package/src/yarn-reinstall.cjs +49 -0
- package/test-project/package.json +16 -0
- package/tmp/test-repo/package.json +7 -0
- package/bin/git-fix-encoding.cmd +0 -6
- package/lib/chunk-OKYLF2MU.mjs +0 -53
- package/lib/chunk-VXZQNLPU.mjs +0 -23
- package/lib/package-resolutions.cjs +0 -28
- package/lib/package-resolutions.d.mts +0 -25
- package/lib/package-resolutions.d.ts +0 -25
- package/lib/package-resolutions.mjs +0 -31
- /package/bin/{submodule-install → submodule-install.txt} +0 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
__commonJS,
|
|
4
|
+
__require,
|
|
5
|
+
init_esm_shims
|
|
6
|
+
} from "./chunk-AASHBCRW.mjs";
|
|
7
|
+
|
|
8
|
+
// src/git/utils.cjs
|
|
9
|
+
var require_utils = __commonJS({
|
|
10
|
+
"src/git/utils.cjs"(exports, module) {
|
|
11
|
+
init_esm_shims();
|
|
12
|
+
var { execSync, spawnSync } = __require("child_process");
|
|
13
|
+
function runGitCommand(args, description) {
|
|
14
|
+
try {
|
|
15
|
+
console.log(`[i] ${description}`);
|
|
16
|
+
const result = spawnSync("git", args, { encoding: "utf-8" });
|
|
17
|
+
if (result.status !== 0) {
|
|
18
|
+
console.error(`[\u2717] Failed: ${description}`);
|
|
19
|
+
console.error(`Error: ${result.stderr || result.stdout}`);
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
console.log(`[\u2713] ${description}`);
|
|
23
|
+
return true;
|
|
24
|
+
} catch (error) {
|
|
25
|
+
console.error(`[\u2717] Failed: ${description}`);
|
|
26
|
+
console.error(`Error: ${error.message}`);
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function isGitRepository(cwd) {
|
|
31
|
+
const dir = typeof cwd === "string" ? cwd : process.cwd();
|
|
32
|
+
try {
|
|
33
|
+
execSync("git rev-parse --git-dir", { stdio: "pipe", cwd: dir });
|
|
34
|
+
return true;
|
|
35
|
+
} catch {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function runGitCommandOutput(args, description) {
|
|
40
|
+
try {
|
|
41
|
+
console.log(`[i] ${description}`);
|
|
42
|
+
const result = spawnSync("git", args, { encoding: "utf-8" });
|
|
43
|
+
if (result.status !== 0) {
|
|
44
|
+
console.error(`[\u2717] Failed: ${description}`);
|
|
45
|
+
console.error(`Error: ${result.stderr || result.stdout}`);
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
console.log(`[\u2713] ${description}`);
|
|
49
|
+
return result.stdout.trim();
|
|
50
|
+
} catch (error) {
|
|
51
|
+
console.error(`[\u2717] Failed: ${description}`);
|
|
52
|
+
console.error(`Error: ${error.message}`);
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
module.exports = {
|
|
57
|
+
runGitCommand,
|
|
58
|
+
runGitCommandOutput,
|
|
59
|
+
isGitRepository
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
require_utils
|
|
66
|
+
};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
require_connected_domain
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DPKAJKFO.mjs";
|
|
5
5
|
import {
|
|
6
|
+
__commonJS,
|
|
6
7
|
init_esm_shims
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import {
|
|
9
|
-
__commonJS
|
|
10
|
-
} from "./chunk-FB6YIQYR.mjs";
|
|
8
|
+
} from "./chunk-AASHBCRW.mjs";
|
|
11
9
|
|
|
12
10
|
// src/ps/table-parser.js
|
|
13
11
|
var require_table_parser = __commonJS({
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
__commonJS,
|
|
4
|
+
__require,
|
|
5
|
+
init_esm_shims
|
|
6
|
+
} from "./chunk-AASHBCRW.mjs";
|
|
7
|
+
|
|
8
|
+
// src/git/gitattributes.js
|
|
9
|
+
var require_gitattributes = __commonJS({
|
|
10
|
+
"src/git/gitattributes.js"(exports, module) {
|
|
11
|
+
init_esm_shims();
|
|
12
|
+
var fs = __require("fs");
|
|
13
|
+
function parseGitAttributes(gitattributesPath) {
|
|
14
|
+
const rules = [];
|
|
15
|
+
if (!fs.existsSync(gitattributesPath)) {
|
|
16
|
+
return rules;
|
|
17
|
+
}
|
|
18
|
+
const content = fs.readFileSync(gitattributesPath, "utf8");
|
|
19
|
+
const lines = content.split("\n");
|
|
20
|
+
lines.forEach((line, index) => {
|
|
21
|
+
const trimmedLine = line.trim();
|
|
22
|
+
if (!trimmedLine || trimmedLine.startsWith("#")) {
|
|
23
|
+
rules.push({
|
|
24
|
+
type: trimmedLine.startsWith("#") ? "comment" : "empty",
|
|
25
|
+
content: line,
|
|
26
|
+
lineNumber: index + 1
|
|
27
|
+
});
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const parts = trimmedLine.split(/\s+/);
|
|
31
|
+
if (parts.length >= 2) {
|
|
32
|
+
const pattern = parts[0];
|
|
33
|
+
const attributes = parts.slice(1).join(" ");
|
|
34
|
+
rules.push({
|
|
35
|
+
type: "rule",
|
|
36
|
+
pattern,
|
|
37
|
+
attributes,
|
|
38
|
+
content: line,
|
|
39
|
+
lineNumber: index + 1
|
|
40
|
+
});
|
|
41
|
+
} else {
|
|
42
|
+
rules.push({
|
|
43
|
+
type: "invalid",
|
|
44
|
+
content: line,
|
|
45
|
+
lineNumber: index + 1
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
return rules;
|
|
50
|
+
}
|
|
51
|
+
function patternsConflict(pattern1, pattern2) {
|
|
52
|
+
if (pattern1 === pattern2) {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
if (pattern1 === "*" || pattern2 === "*") {
|
|
56
|
+
return pattern1 !== pattern2;
|
|
57
|
+
}
|
|
58
|
+
const normalize = (p) => p.replace(/\{[^}]+\}/g, "*").replace(/\*+/g, "*");
|
|
59
|
+
const norm1 = normalize(pattern1);
|
|
60
|
+
const norm2 = normalize(pattern2);
|
|
61
|
+
return norm1 === norm2;
|
|
62
|
+
}
|
|
63
|
+
function mergeGitAttributeRules(existingRules, desiredRules) {
|
|
64
|
+
let mergedRules;
|
|
65
|
+
if (existingRules.length === 0) {
|
|
66
|
+
mergedRules = desiredRules.map((desired, idx) => ({
|
|
67
|
+
type: "rule",
|
|
68
|
+
pattern: desired.pattern,
|
|
69
|
+
attributes: desired.attributes,
|
|
70
|
+
content: `${desired.pattern} ${desired.attributes}`,
|
|
71
|
+
lineNumber: idx + 1,
|
|
72
|
+
added: true
|
|
73
|
+
}));
|
|
74
|
+
return {
|
|
75
|
+
mergedRules,
|
|
76
|
+
conflicts: [],
|
|
77
|
+
changes: desiredRules.map((rule) => ({ action: "added", pattern: rule.pattern, attributes: rule.attributes }))
|
|
78
|
+
};
|
|
79
|
+
} else {
|
|
80
|
+
mergedRules = [...existingRules];
|
|
81
|
+
}
|
|
82
|
+
const conflicts = [];
|
|
83
|
+
const changes = [];
|
|
84
|
+
desiredRules.forEach((desired) => {
|
|
85
|
+
const existingIdx = mergedRules.findIndex((r) => r.type === "rule" && r.pattern === desired.pattern);
|
|
86
|
+
if (existingIdx !== -1) {
|
|
87
|
+
const existing = mergedRules[existingIdx];
|
|
88
|
+
if (existing.attributes === desired.attributes) {
|
|
89
|
+
conflicts.push({
|
|
90
|
+
pattern: desired.pattern,
|
|
91
|
+
existing: existing.attributes,
|
|
92
|
+
proposed: desired.attributes,
|
|
93
|
+
action: "kept existing (identical)"
|
|
94
|
+
});
|
|
95
|
+
} else if (desired.priority > (existing.priority || 0)) {
|
|
96
|
+
mergedRules[existingIdx] = {
|
|
97
|
+
type: "rule",
|
|
98
|
+
pattern: desired.pattern,
|
|
99
|
+
attributes: desired.attributes,
|
|
100
|
+
content: `${desired.pattern} ${desired.attributes}`,
|
|
101
|
+
lineNumber: existing.lineNumber,
|
|
102
|
+
replaced: true
|
|
103
|
+
};
|
|
104
|
+
conflicts.push({
|
|
105
|
+
pattern: desired.pattern,
|
|
106
|
+
existing: existing.attributes,
|
|
107
|
+
proposed: desired.attributes,
|
|
108
|
+
action: "replaced (higher priority)"
|
|
109
|
+
});
|
|
110
|
+
changes.push({
|
|
111
|
+
action: "replaced",
|
|
112
|
+
pattern: desired.pattern,
|
|
113
|
+
attributes: desired.attributes,
|
|
114
|
+
oldAttributes: existing.attributes
|
|
115
|
+
});
|
|
116
|
+
} else {
|
|
117
|
+
conflicts.push({
|
|
118
|
+
pattern: desired.pattern,
|
|
119
|
+
existing: existing.attributes,
|
|
120
|
+
proposed: desired.attributes,
|
|
121
|
+
action: "kept existing (lower priority)"
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
} else {
|
|
125
|
+
mergedRules.push({
|
|
126
|
+
type: "rule",
|
|
127
|
+
pattern: desired.pattern,
|
|
128
|
+
attributes: desired.attributes,
|
|
129
|
+
content: `${desired.pattern} ${desired.attributes}`,
|
|
130
|
+
lineNumber: mergedRules.length + 1,
|
|
131
|
+
added: true
|
|
132
|
+
});
|
|
133
|
+
changes.push({
|
|
134
|
+
action: "added",
|
|
135
|
+
pattern: desired.pattern,
|
|
136
|
+
attributes: desired.attributes
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
return { mergedRules, conflicts, changes };
|
|
141
|
+
}
|
|
142
|
+
function formatGitAttributes(rules) {
|
|
143
|
+
return rules.map((rule) => {
|
|
144
|
+
if (rule.type === "rule") {
|
|
145
|
+
return `${rule.pattern} ${rule.attributes}`;
|
|
146
|
+
}
|
|
147
|
+
return rule.content;
|
|
148
|
+
}).join("\n") + "\n";
|
|
149
|
+
}
|
|
150
|
+
function updateGitAttributes(gitattributesPath, desiredRules) {
|
|
151
|
+
try {
|
|
152
|
+
const existingRules = parseGitAttributes(gitattributesPath);
|
|
153
|
+
const { mergedRules, conflicts, changes } = mergeGitAttributeRules(existingRules, desiredRules);
|
|
154
|
+
let success = false;
|
|
155
|
+
if (changes.length > 0) {
|
|
156
|
+
const newContent = formatGitAttributes(mergedRules);
|
|
157
|
+
fs.writeFileSync(gitattributesPath, newContent);
|
|
158
|
+
success = true;
|
|
159
|
+
}
|
|
160
|
+
return {
|
|
161
|
+
success,
|
|
162
|
+
conflicts,
|
|
163
|
+
changes,
|
|
164
|
+
message: success ? `Updated .gitattributes with ${changes.length} changes` : "No changes needed - all rules already present"
|
|
165
|
+
};
|
|
166
|
+
} catch (error) {
|
|
167
|
+
return {
|
|
168
|
+
success: false,
|
|
169
|
+
error: error.message,
|
|
170
|
+
conflicts: [],
|
|
171
|
+
changes: []
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
module.exports = {
|
|
176
|
+
parseGitAttributes,
|
|
177
|
+
patternsConflict,
|
|
178
|
+
mergeGitAttributeRules,
|
|
179
|
+
formatGitAttributes,
|
|
180
|
+
updateGitAttributes
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
export {
|
|
186
|
+
require_gitattributes
|
|
187
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
require_utils as require_utils2
|
|
4
|
+
} from "./chunk-EGSSKVDH.mjs";
|
|
5
|
+
import {
|
|
6
|
+
require_utils
|
|
7
|
+
} from "./chunk-APBWENF6.mjs";
|
|
8
|
+
import {
|
|
9
|
+
__commonJS,
|
|
10
|
+
__require,
|
|
11
|
+
init_esm_shims
|
|
12
|
+
} from "./chunk-AASHBCRW.mjs";
|
|
13
|
+
|
|
14
|
+
// src/git/user-config.cjs
|
|
15
|
+
var require_user_config = __commonJS({
|
|
16
|
+
"src/git/user-config.cjs"(exports, module) {
|
|
17
|
+
init_esm_shims();
|
|
18
|
+
var gch = __require("git-command-helper");
|
|
19
|
+
var { runGitCommand, runGitCommandOutput } = require_utils2();
|
|
20
|
+
var { getArgs } = require_utils();
|
|
21
|
+
function configureGitUser(cliUser = null, cliEmail = null, options = {}) {
|
|
22
|
+
console.log("\n=== Configuring Git User ===");
|
|
23
|
+
let username, email;
|
|
24
|
+
if (cliUser && cliEmail) {
|
|
25
|
+
username = cliUser.trim();
|
|
26
|
+
email = cliEmail.trim();
|
|
27
|
+
console.log("[i] Using CLI-provided user configuration");
|
|
28
|
+
} else {
|
|
29
|
+
username = process.env.GITHUB_USER ? process.env.GITHUB_USER.trim() : void 0;
|
|
30
|
+
email = process.env.GITHUB_EMAIL ? process.env.GITHUB_EMAIL.trim() : void 0;
|
|
31
|
+
if (username || email) {
|
|
32
|
+
console.log("[i] Using environment variable user configuration");
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (!username && !email) {
|
|
36
|
+
console.log("[i] No Git user configuration needed (no CLI args or environment variables set)");
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (username) {
|
|
40
|
+
const success = runGitCommand(["config", "user.name", username], `Set Git username to "${username}"`);
|
|
41
|
+
if (!success) {
|
|
42
|
+
console.log("[i] Failed to set Git username, but continuing...");
|
|
43
|
+
}
|
|
44
|
+
} else {
|
|
45
|
+
console.log("[i] No username provided, skipping username configuration");
|
|
46
|
+
}
|
|
47
|
+
if (email) {
|
|
48
|
+
const success = runGitCommand(["config", "user.email", email], `Set Git email to "${email}"`);
|
|
49
|
+
if (!success) {
|
|
50
|
+
console.log("[i] Failed to set Git email, but continuing...");
|
|
51
|
+
}
|
|
52
|
+
} else {
|
|
53
|
+
console.log("[i] No email provided, skipping email configuration");
|
|
54
|
+
}
|
|
55
|
+
if (username || email) {
|
|
56
|
+
console.log("[\u2713] Git user configuration completed");
|
|
57
|
+
}
|
|
58
|
+
if (username) {
|
|
59
|
+
const remoteUrl = runGitCommandOutput(["remote", "get-url", "origin"], "Fetching remote URL for verification");
|
|
60
|
+
if (remoteUrl) {
|
|
61
|
+
console.log(`[i] Remote URL: ${remoteUrl}`);
|
|
62
|
+
const parsedUrl = gch.parseGitHubUrl(remoteUrl);
|
|
63
|
+
if (parsedUrl && parsedUrl.owner && username && parsedUrl.owner.toLowerCase() !== username.toLowerCase()) {
|
|
64
|
+
console.warn(
|
|
65
|
+
`
|
|
66
|
+
[!] The GitHub remote owner ("${parsedUrl.owner}") does not match the configured username ("${username}").`
|
|
67
|
+
);
|
|
68
|
+
console.warn(`[!] If this is not intentional, consider updating the remote URL to use your username.`);
|
|
69
|
+
console.warn(`[!] Example: git remote set-url origin https://github.com/${username}/<repo>.git
|
|
70
|
+
`);
|
|
71
|
+
const args = getArgs();
|
|
72
|
+
const updateRemote = options.updateRemote || args["update-remote"] === true;
|
|
73
|
+
if (updateRemote) {
|
|
74
|
+
let newUrl = remoteUrl;
|
|
75
|
+
if (/^https:\/\//.test(remoteUrl)) {
|
|
76
|
+
newUrl = remoteUrl.replace(/https:\/\/(?:[^@]+@)?github.com/, `https://${username}@github.com`);
|
|
77
|
+
} else if (/^git@github.com:/.test(remoteUrl)) {
|
|
78
|
+
console.warn(
|
|
79
|
+
`[!] For SSH remotes, set your SSH config or use HTTPS with username if you want to change authentication user.`
|
|
80
|
+
);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (newUrl !== remoteUrl) {
|
|
84
|
+
const updated = runGitCommand(["remote", "set-url", "origin", newUrl], `Set origin to ${newUrl}`);
|
|
85
|
+
if (updated) {
|
|
86
|
+
console.log(`[\u2713] Remote URL updated to: ${newUrl}`);
|
|
87
|
+
} else {
|
|
88
|
+
console.warn(`[!] Failed to update remote URL. Please update it manually if needed.`);
|
|
89
|
+
}
|
|
90
|
+
} else {
|
|
91
|
+
console.log(`[i] Remote URL does not use HTTPS or already contains the username.`);
|
|
92
|
+
}
|
|
93
|
+
} else {
|
|
94
|
+
console.log(`[i] Remote URL not changed. Use --update-remote to update automatically.`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
module.exports = {
|
|
101
|
+
configureGitUser
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
export {
|
|
107
|
+
require_user_config
|
|
108
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
require_utils
|
|
4
|
+
} from "./chunk-EGSSKVDH.mjs";
|
|
5
|
+
import {
|
|
6
|
+
__commonJS,
|
|
7
|
+
init_esm_shims
|
|
8
|
+
} from "./chunk-AASHBCRW.mjs";
|
|
9
|
+
|
|
10
|
+
// src/git/pull-strategy.cjs
|
|
11
|
+
var require_pull_strategy = __commonJS({
|
|
12
|
+
"src/git/pull-strategy.cjs"(exports, module) {
|
|
13
|
+
init_esm_shims();
|
|
14
|
+
var { runGitCommand } = require_utils();
|
|
15
|
+
function setPullStrategy() {
|
|
16
|
+
console.log("\n=== Configuring Pull Strategy ===");
|
|
17
|
+
runGitCommand(["config", "pull.rebase", "false"], "Disable automatic rebase on pull");
|
|
18
|
+
}
|
|
19
|
+
module.exports = {
|
|
20
|
+
setPullStrategy
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
require_pull_strategy
|
|
27
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
require_gitattributes
|
|
4
|
+
} from "./chunk-JGR2NW6D.mjs";
|
|
5
|
+
import {
|
|
6
|
+
require_utils
|
|
7
|
+
} from "./chunk-EGSSKVDH.mjs";
|
|
8
|
+
import {
|
|
9
|
+
__commonJS,
|
|
10
|
+
__require,
|
|
11
|
+
init_esm_shims
|
|
12
|
+
} from "./chunk-AASHBCRW.mjs";
|
|
13
|
+
|
|
14
|
+
// src/git/line-endings.cjs
|
|
15
|
+
var require_line_endings = __commonJS({
|
|
16
|
+
"src/git/line-endings.cjs"(exports, module) {
|
|
17
|
+
init_esm_shims();
|
|
18
|
+
var path = __require("upath");
|
|
19
|
+
var fs = __require("fs");
|
|
20
|
+
var { runGitCommand } = require_utils();
|
|
21
|
+
var { updateGitAttributes } = require_gitattributes();
|
|
22
|
+
function forceLfLineEndings() {
|
|
23
|
+
console.log("\n=== Configuring LF Line Endings ===");
|
|
24
|
+
runGitCommand(["config", "core.autocrlf", "false"], "Disable automatic CRLF conversion");
|
|
25
|
+
runGitCommand(["config", "core.eol", "lf"], "Set end-of-line to LF");
|
|
26
|
+
const gitattributesPath = path.join(process.cwd(), ".gitattributes");
|
|
27
|
+
if (fs.existsSync(gitattributesPath)) {
|
|
28
|
+
let content = fs.readFileSync(gitattributesPath, "utf8");
|
|
29
|
+
if (!/^\*\s+text=auto\s+eol=lf/m.test(content)) {
|
|
30
|
+
content = `* text=auto eol=lf
|
|
31
|
+
` + content;
|
|
32
|
+
fs.writeFileSync(gitattributesPath, content);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const desiredRules = [
|
|
36
|
+
{ pattern: "*", attributes: "text=auto eol=lf", priority: 1 },
|
|
37
|
+
{
|
|
38
|
+
pattern: "*.{cmd,bat,ps1,sh,cmd1,cmd2,bat1,bat2,vbs}",
|
|
39
|
+
attributes: "text eol=crlf",
|
|
40
|
+
priority: 2
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
pattern: "*.{png,jpg,jpeg,gif,ico,svg,bmp,webp,avif,tiff,tif,psd,ai,eps,raw}",
|
|
44
|
+
attributes: "binary",
|
|
45
|
+
priority: 3
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
pattern: "*.{zip,tar,gz,7z,rar,exe,dll,so,bin,jar,war,ear,apk,msi,deb,rpm,iso,img,dmg,pdf,mp3,mp4,mov,avi,mkv,flv,wmv,ogg,webm,wav,aac,m4a,otf,ttf,woff,woff2,eot}",
|
|
49
|
+
attributes: "binary",
|
|
50
|
+
priority: 3
|
|
51
|
+
}
|
|
52
|
+
];
|
|
53
|
+
const result = updateGitAttributes(gitattributesPath, desiredRules);
|
|
54
|
+
if (result.error) {
|
|
55
|
+
console.log(`[\u2717] Error updating .gitattributes: ${result.error}`);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (result.conflicts.length > 0) {
|
|
59
|
+
console.log("\n[!] Detected conflicts in .gitattributes:");
|
|
60
|
+
result.conflicts.forEach((conflict) => {
|
|
61
|
+
console.log(` ${conflict.pattern}: ${conflict.existing} -> ${conflict.proposed} (${conflict.action})`);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
if (result.success) {
|
|
65
|
+
console.log(`[\u2713] ${result.message}:`);
|
|
66
|
+
result.changes.forEach((change) => {
|
|
67
|
+
console.log(` ${change.action}: ${change.pattern} ${change.attributes}`);
|
|
68
|
+
});
|
|
69
|
+
} else {
|
|
70
|
+
console.log(`[i] ${result.message}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
module.exports = {
|
|
74
|
+
forceLfLineEndings
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
export {
|
|
80
|
+
require_line_endings
|
|
81
|
+
};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
|
+
__commonJS,
|
|
3
4
|
init_esm_shims
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
__commonJS
|
|
7
|
-
} from "./chunk-FB6YIQYR.mjs";
|
|
5
|
+
} from "./chunk-AASHBCRW.mjs";
|
|
8
6
|
|
|
9
7
|
// src/ps/isWin.js
|
|
10
8
|
var require_isWin = __commonJS({
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
__commonJS,
|
|
4
|
+
__require,
|
|
5
|
+
init_esm_shims
|
|
6
|
+
} from "./chunk-AASHBCRW.mjs";
|
|
7
|
+
|
|
8
|
+
// src/git/normalize.cjs
|
|
9
|
+
var require_normalize = __commonJS({
|
|
10
|
+
"src/git/normalize.cjs"(exports, module) {
|
|
11
|
+
init_esm_shims();
|
|
12
|
+
var { execSync } = __require("child_process");
|
|
13
|
+
function normalizeLineEndings() {
|
|
14
|
+
console.log("\n=== Normalizing Existing Files ===");
|
|
15
|
+
try {
|
|
16
|
+
const result = execSync("git ls-files", { encoding: "utf-8", stdio: "pipe" });
|
|
17
|
+
if (!result.trim()) {
|
|
18
|
+
console.log("[i] No tracked files to normalize");
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
console.log("[i] Refreshing index to detect line ending changes...");
|
|
22
|
+
execSync("git add --renormalize .", { stdio: "pipe" });
|
|
23
|
+
try {
|
|
24
|
+
const statusResult = execSync("git status --porcelain", { encoding: "utf-8", stdio: "pipe" });
|
|
25
|
+
if (statusResult.trim()) {
|
|
26
|
+
console.log("[\u2713] Line endings normalized for tracked files");
|
|
27
|
+
console.log("[i] Files with updated line endings are now staged");
|
|
28
|
+
console.log("[i] Run 'git status' to see the changes");
|
|
29
|
+
} else {
|
|
30
|
+
console.log("[\u2713] All files already have correct line endings");
|
|
31
|
+
}
|
|
32
|
+
} catch {
|
|
33
|
+
console.log("[\u2713] Line ending normalization completed");
|
|
34
|
+
}
|
|
35
|
+
} catch (error) {
|
|
36
|
+
console.error("[\u2717] Failed to normalize line endings");
|
|
37
|
+
console.error(`Error: ${error.message}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
module.exports = {
|
|
41
|
+
normalizeLineEndings
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
require_normalize
|
|
48
|
+
};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
init_esm_shims
|
|
4
|
-
} from "./chunk-VXZQNLPU.mjs";
|
|
5
2
|
import {
|
|
6
3
|
__commonJS,
|
|
7
|
-
__require
|
|
8
|
-
|
|
4
|
+
__require,
|
|
5
|
+
init_esm_shims
|
|
6
|
+
} from "./chunk-AASHBCRW.mjs";
|
|
9
7
|
|
|
10
8
|
// src/find-node-modules.js
|
|
11
9
|
var require_find_node_modules = __commonJS({
|
|
@@ -43,7 +41,15 @@ var require_find_node_modules = __commonJS({
|
|
|
43
41
|
});
|
|
44
42
|
});
|
|
45
43
|
}
|
|
44
|
+
if (typeof module !== "undefined" && __require.main === module) {
|
|
45
|
+
findNodeModules(null, console.log).then((dirs) => {
|
|
46
|
+
console.log(`Found ${dirs.length} node_modules directories.`);
|
|
47
|
+
}).catch((err) => {
|
|
48
|
+
console.error("Error finding node_modules directories:", err);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
46
51
|
module.exports = findNodeModules;
|
|
52
|
+
module.exports.default = findNodeModules;
|
|
47
53
|
}
|
|
48
54
|
});
|
|
49
55
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
require_utils
|
|
4
|
+
} from "./chunk-EGSSKVDH.mjs";
|
|
5
|
+
import {
|
|
6
|
+
__commonJS,
|
|
7
|
+
init_esm_shims
|
|
8
|
+
} from "./chunk-AASHBCRW.mjs";
|
|
9
|
+
|
|
10
|
+
// src/git/permissions.cjs
|
|
11
|
+
var require_permissions = __commonJS({
|
|
12
|
+
"src/git/permissions.cjs"(exports, module) {
|
|
13
|
+
init_esm_shims();
|
|
14
|
+
var { runGitCommand } = require_utils();
|
|
15
|
+
function ignoreFilePermissions() {
|
|
16
|
+
console.log("\n=== Configuring File Permissions ===");
|
|
17
|
+
runGitCommand(["config", "core.filemode", "false"], "Ignore file permission changes");
|
|
18
|
+
runGitCommand(["config", "diff.ignoreSubmodules", "dirty"], "Ignore submodule permission changes");
|
|
19
|
+
}
|
|
20
|
+
module.exports = {
|
|
21
|
+
ignoreFilePermissions
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
require_permissions
|
|
28
|
+
};
|