binary-collections 2.0.10 → 2.0.11
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/.puppeterrc.cjs +25 -0
- package/binaries/binary-executor.cjs +138 -3
- package/binaries/clean-nodemodule.cjs +138 -3
- package/binaries/clean-nodemodules.cjs +138 -3
- package/binaries/dev.cjs +138 -3
- package/binaries/empty.cjs +138 -3
- package/binaries/git-reduce-size.cjs +138 -3
- package/binaries/javakill.cjs +138 -3
- package/binaries/kill-night-crows.bat +7 -0
- package/binaries/kill-night-crows.ps1 +172 -0
- package/binaries/kill-process.cjs +138 -3
- package/binaries/nodekill.cjs +138 -3
- package/binaries/prod.cjs +138 -3
- package/binaries/py +111 -0
- package/binaries/py.cjs +178 -0
- package/binaries/py.cmd +49 -0
- package/binaries/rmfind.cjs +138 -3
- package/binaries/rmx.cjs +138 -3
- package/binaries/submodule-token.cjs +138 -3
- package/binaries/test-cjs +10 -0
- package/binaries/test-cjs.cjs +178 -0
- package/binaries/test-cjs.cmd +11 -0
- package/binaries/yarn-clean +32 -0
- package/binaries/yarn-clean.cjs +178 -0
- package/binaries/yarn-clean.cmd +30 -0
- package/binaries/yarn-clean.py +148 -0
- package/lib/binary-collections-config.cjs +1 -1
- package/lib/binary-collections-config.mjs +1 -1
- package/lib/binary-collections.cjs +167 -106
- package/lib/binary-collections.mjs +108 -94
- package/lib/changelog.cjs +61 -13
- package/lib/changelog.mjs +1 -1
- package/lib/{chunk-AI4CVPJ7.mjs → chunk-2CBJCW7E.mjs} +4 -4
- package/lib/chunk-34IQDTLZ.mjs +27 -0
- package/lib/chunk-3HFFECCI.mjs +27 -0
- package/lib/{chunk-SBNDSKG5.mjs → chunk-4UHL4WVN.mjs} +1 -1
- package/lib/chunk-7XTEJHOE.mjs +193 -0
- package/lib/chunk-AJDD5DZM.mjs +109 -0
- package/lib/chunk-BZWVHODJ.mjs +62 -0
- package/lib/{chunk-BEZKJ25G.mjs → chunk-FCDQGYBF.mjs} +5 -9
- package/lib/chunk-GEYA2USY.mjs +207 -0
- package/lib/chunk-ID2WBTE2.mjs +80 -0
- package/lib/chunk-JXFOHKDM.mjs +239 -0
- package/lib/{chunk-DI5MDPSN.mjs → chunk-N436BNBK.mjs} +192 -64
- package/lib/chunk-NCXAP7AA.mjs +31 -0
- package/lib/chunk-PDN26I7O.mjs +188 -0
- package/lib/{chunk-E6FDDAOO.mjs → chunk-RWLXRTYP.mjs} +1 -1
- package/lib/{chunk-BDCHCWHD.mjs → chunk-TOIVAQF7.mjs} +4 -4
- package/lib/chunk-V5SKYJUB.mjs +136 -0
- package/lib/{chunk-HMRMTYZM.mjs → chunk-WSRETQCA.mjs} +21 -2
- package/lib/chunk-XA3SNBPA.mjs +184 -0
- package/lib/chunk-YYLIQQKF.mjs +31 -0
- package/lib/{chunk-V3N3JEUF.mjs → chunk-Z6JLYU2J.mjs} +60 -13
- package/lib/{chunk-O6SWBEOQ.mjs → chunk-ZDMWBSYF.mjs} +2 -2
- package/lib/clean-github-actions-caches.cjs +63 -15
- package/lib/clean-github-actions-caches.mjs +3 -3
- package/lib/del-gradle.cjs +61 -13
- package/lib/del-gradle.js +1 -0
- package/lib/del-gradle.mjs +1 -1
- package/lib/del-node-modules.cjs +143 -148
- package/lib/del-node-modules.js +210 -14
- package/lib/del-node-modules.mjs +148 -17
- package/lib/del-ps.cjs +61 -13
- package/lib/del-ps.js +1 -0
- package/lib/del-ps.mjs +1 -1
- package/lib/del-yarn-caches.cjs +61 -13
- package/lib/del-yarn-caches.mjs +1 -1
- package/lib/find-node-modules-cli.js +1 -0
- package/lib/free-chatgpt.cjs +253 -47
- package/lib/free-chatgpt.mjs +2 -2
- package/lib/git/gitattributes.cjs +1 -0
- package/lib/git/gitattributes.d.cts +7 -2
- package/lib/git/gitattributes.mjs +1 -1
- package/lib/git/line-endings.cjs +2 -1
- package/lib/git/line-endings.mjs +2 -2
- package/lib/git/undo-commit-cli.cjs +110 -0
- package/lib/git/undo-commit-cli.d.ts +1 -0
- package/lib/git/undo-commit-cli.js +4 -0
- package/lib/git/undo-commit-cli.mjs +14 -0
- package/lib/git/undo-commit.cjs +81 -0
- package/lib/git/undo-commit.d.cts +1 -0
- package/lib/git/undo-commit.mjs +7 -0
- package/lib/git/undo-staged-cli.cjs +110 -0
- package/lib/git/undo-staged-cli.d.ts +1 -0
- package/lib/git/undo-staged-cli.js +4 -0
- package/lib/git/undo-staged-cli.mjs +14 -0
- package/lib/git/undo-staged.cjs +81 -0
- package/lib/git/undo-staged.d.cts +1 -0
- package/lib/git/undo-staged.mjs +7 -0
- package/lib/git/user-config.cjs +61 -14
- package/lib/git/user-config.mjs +2 -2
- package/lib/git-diff-cli.cjs +255 -49
- package/lib/git-diff-cli.d.ts +1 -0
- package/lib/git-diff-cli.js +1 -0
- package/lib/git-diff-cli.mjs +5 -4
- package/lib/git-diff.cjs +254 -49
- package/lib/git-diff.mjs +4 -4
- package/lib/git-fix.cjs +64 -16
- package/lib/git-fix.mjs +10 -10
- package/lib/git-purge.cjs +61 -13
- package/lib/git-purge.mjs +1 -1
- package/lib/kill-night-crows.cjs +87 -0
- package/lib/kill-night-crows.d.mts +1 -0
- package/lib/kill-night-crows.mjs +65 -0
- package/lib/npm-run-series.cjs +60 -13
- package/lib/npm-run-series.mjs +1 -1
- package/lib/package-resolutions-updater-cli.cjs +560 -0
- package/lib/package-resolutions-updater-cli.d.mts +1 -0
- package/lib/package-resolutions-updater-cli.mjs +124 -0
- package/lib/package-resolutions-updater.cjs +174 -154
- package/lib/package-resolutions-updater.d.mts +32 -1
- package/lib/package-resolutions-updater.mjs +16 -294
- package/lib/php-cs-fixer-staged.cjs +105 -0
- package/lib/php-cs-fixer-staged.d.cts +2 -0
- package/lib/php-cs-fixer-staged.mjs +117 -0
- package/lib/print-directory-tree.cjs +62 -14
- package/lib/print-directory-tree.mjs +2 -2
- package/lib/ps/connected-domain.d.ts +1 -1
- package/lib/ps/index.js +1 -0
- package/lib/remove-module.cjs +61 -13
- package/lib/remove-module.mjs +1 -1
- package/lib/rmpath.cjs +63 -15
- package/lib/rmpath.mjs +2 -2
- package/lib/submodule-install.cjs +62 -15
- package/lib/submodule-install.mjs +3 -3
- package/lib/submodule-remove-cli.cjs +5 -1
- package/lib/submodule-remove-cli.mjs +1 -1
- package/lib/submodule-remove.cjs +4 -1
- package/lib/submodule-remove.mjs +1 -1
- package/lib/utils/chatgpt.cjs +192 -34
- package/lib/utils/chatgpt.js +210 -43
- package/lib/utils/chatgpt.mjs +1 -1
- package/lib/utils/findEnvFiles.cjs +107 -0
- package/lib/utils/findEnvFiles.d.ts +8 -0
- package/lib/utils/findEnvFiles.js +121 -0
- package/lib/utils/findEnvFiles.mjs +8 -0
- package/lib/utils/findWorkspaceRoot.cjs +70 -0
- package/lib/utils/findWorkspaceRoot.d.ts +9 -0
- package/lib/utils/findWorkspaceRoot.js +57 -0
- package/lib/utils/findWorkspaceRoot.mjs +40 -0
- package/lib/utils/index.cjs +60 -13
- package/lib/utils/index.mjs +1 -1
- package/lib/utils/isGithubTokenValid.cjs +64 -0
- package/lib/utils/isGithubTokenValid.d.ts +7 -0
- package/lib/utils/isGithubTokenValid.js +48 -0
- package/lib/utils/isGithubTokenValid.mjs +36 -0
- package/lib/yarn-reinstall.cjs +61 -13
- package/lib/yarn-reinstall.mjs +1 -1
- package/package.json +107 -93
- package/readme.md +33 -34
- package/releases/readme.md +1 -1
- package/requirements.txt +1 -0
- package/lib/chunk-4EWQC6GZ.mjs +0 -382
- package/lib/chunk-4ZI7BQKQ.mjs +0 -381
- package/lib/chunk-5J2BEPY5.mjs +0 -83
- package/lib/chunk-AGZYRDC2.mjs +0 -323
- package/lib/chunk-HN52G2YL.mjs +0 -305
- package/lib/chunk-HO6GHCOB.mjs +0 -385
- package/lib/chunk-LEM5OMRP.mjs +0 -384
- package/lib/chunk-RCP7DHVY.mjs +0 -190
- package/lib/chunk-U6SO4QEV.mjs +0 -320
- package/lib/chunk-XD6BJK6Q.mjs +0 -351
- package/lib/chunk-YXSFGA2D.mjs +0 -383
- package/lib/git/gitattributes.d.ts +0 -33
- package/lib/git/gitattributes.js +0 -223
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
require_utils
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Z6JLYU2J.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__commonJS,
|
|
8
8
|
__dirname,
|
|
@@ -15,7 +15,7 @@ var require_package = __commonJS({
|
|
|
15
15
|
"package.json"(exports, module) {
|
|
16
16
|
module.exports = {
|
|
17
17
|
name: "binary-collections",
|
|
18
|
-
version: "2.0.
|
|
18
|
+
version: "2.0.11",
|
|
19
19
|
description: "Utility to clean any programming caches and more",
|
|
20
20
|
keywords: [
|
|
21
21
|
"cache",
|
|
@@ -53,57 +53,10 @@ var require_package = __commonJS({
|
|
|
53
53
|
"lib",
|
|
54
54
|
"package.json",
|
|
55
55
|
"docs-src/**/*.md",
|
|
56
|
-
"readme.md"
|
|
56
|
+
"readme.md",
|
|
57
|
+
".puppeterrc.*",
|
|
58
|
+
"requirements.txt"
|
|
57
59
|
],
|
|
58
|
-
bin: {
|
|
59
|
-
"binary-collections": "lib/binary-collections.cjs",
|
|
60
|
-
"binary-executor": "binaries/binary-executor.cjs",
|
|
61
|
-
changelog: "lib/changelog.cjs",
|
|
62
|
-
chatgpt: "lib/free-chatgpt.cjs",
|
|
63
|
-
"clean-github-actions-cache": "lib/clean-github-actions-caches.cjs",
|
|
64
|
-
"clean-github-actions-caches": "lib/clean-github-actions-caches.cjs",
|
|
65
|
-
"clean-nodemodule": "binaries/clean-nodemodule.cjs",
|
|
66
|
-
"clean-nodemodules": "binaries/clean-nodemodules.cjs",
|
|
67
|
-
"clear-gh-caches": "lib/clean-github-actions-caches.cjs",
|
|
68
|
-
"clear-github-actions-cache": "lib/clean-github-actions-caches.cjs",
|
|
69
|
-
"clear-github-actions-caches": "lib/clean-github-actions-caches.cjs",
|
|
70
|
-
"del-gradle": "lib/del-gradle.cjs",
|
|
71
|
-
"del-node-modules": "lib/del-node-modules.cjs",
|
|
72
|
-
"del-nodemodules": "lib/del-node-modules.cjs",
|
|
73
|
-
"del-ps": "lib/del-ps.cjs",
|
|
74
|
-
"del-yarn-caches": "lib/del-yarn-caches.cjs",
|
|
75
|
-
"del-yarncaches": "lib/del-yarn-caches.cjs",
|
|
76
|
-
dev: "binaries/dev.cjs",
|
|
77
|
-
"dir-tree": "lib/print-directory-tree.cjs",
|
|
78
|
-
empty: "binaries/empty.cjs",
|
|
79
|
-
"find-node-modules": "lib/find-node-modules-cli.cjs",
|
|
80
|
-
"free-chatgpt": "lib/free-chatgpt.cjs",
|
|
81
|
-
"git-diff": "lib/git-diff-cli.cjs",
|
|
82
|
-
"git-fix": "lib/git-fix.cjs",
|
|
83
|
-
"git-purge": "lib/git-purge.cjs",
|
|
84
|
-
"git-reduce-size": "binaries/git-reduce-size.cjs",
|
|
85
|
-
javakill: "binaries/javakill.cjs",
|
|
86
|
-
"kill-process": "binaries/kill-process.cjs",
|
|
87
|
-
nodekill: "binaries/nodekill.cjs",
|
|
88
|
-
"npm-run-series": "lib/npm-run-series.cjs",
|
|
89
|
-
nrs: "lib/npm-run-series.cjs",
|
|
90
|
-
"package-resolutions-updater": "lib/package-resolutions-updater.cjs",
|
|
91
|
-
"pkg-res-updater": "lib/package-resolutions-updater.cjs",
|
|
92
|
-
"pkg-resolutions-updater": "lib/package-resolutions-updater.cjs",
|
|
93
|
-
"print-directory-tree": "lib/print-directory-tree.cjs",
|
|
94
|
-
"print-tree": "lib/print-directory-tree.cjs",
|
|
95
|
-
prod: "binaries/prod.cjs",
|
|
96
|
-
"remove-module": "lib/remove-module.cjs",
|
|
97
|
-
rmfind: "binaries/rmfind.cjs",
|
|
98
|
-
rmpath: "lib/rmpath.cjs",
|
|
99
|
-
rmx: "binaries/rmx.cjs",
|
|
100
|
-
"run-s": "lib/npm-run-series.cjs",
|
|
101
|
-
"run-series": "lib/npm-run-series.cjs",
|
|
102
|
-
"submodule-install": "lib/submodule-install.cjs",
|
|
103
|
-
"submodule-remove": "lib/submodule-remove-cli.cjs",
|
|
104
|
-
"submodule-token": "binaries/submodule-token.cjs",
|
|
105
|
-
"yarn-reinstall": "lib/yarn-reinstall.cjs"
|
|
106
|
-
},
|
|
107
60
|
scripts: {
|
|
108
61
|
build: "tsc -b tsconfig.build.json && npm run build:tsup && npm run postbuild",
|
|
109
62
|
"build:packages": "yarn workspaces foreach --worktree --exclude=binary-collections --no-private run build",
|
|
@@ -119,76 +72,78 @@ var require_package = __commonJS({
|
|
|
119
72
|
"test:nrs": "npm test -- nrs build:**",
|
|
120
73
|
"test:watch": "npm test --watch",
|
|
121
74
|
"update:ncu": "npx npm-check-updates -u -x jsdom,chalk,hexo,deepmerge-ts --enginesNode --root",
|
|
122
|
-
"update:packer": "curl -L https://github.com/dimaslanjaka/nodejs-package-types/raw/main/packer.js > packer.cjs"
|
|
75
|
+
"update:packer": "curl -L https://github.com/dimaslanjaka/nodejs-package-types/raw/main/packer.js > packer.cjs",
|
|
76
|
+
"puppeteer:browser": "npx -y puppeteer browsers install chrome"
|
|
123
77
|
},
|
|
124
78
|
repository: {
|
|
125
79
|
type: "git",
|
|
126
80
|
url: "git+https://github.com/dimaslanjaka/bin"
|
|
127
81
|
},
|
|
128
82
|
dependencies: {
|
|
83
|
+
"@yarnpkg/core": "^4.7.0",
|
|
129
84
|
"ansi-colors": "^4.1.3",
|
|
130
|
-
axios: "^1.
|
|
131
|
-
dotenv: "^17.2
|
|
132
|
-
execa: "^9.6.
|
|
133
|
-
"fs-extra": "^11.3.
|
|
134
|
-
"git-command-helper": "
|
|
135
|
-
glob: "^
|
|
136
|
-
minimatch: "^10.
|
|
85
|
+
axios: "^1.15.2",
|
|
86
|
+
dotenv: "^17.4.2",
|
|
87
|
+
execa: "^9.6.1",
|
|
88
|
+
"fs-extra": "^11.3.4",
|
|
89
|
+
"git-command-helper": "https://github.com/dimaslanjaka/git-command-helper/raw/refs/heads/pre-release/release/git-command-helper.tgz",
|
|
90
|
+
glob: "^13.0.6",
|
|
91
|
+
minimatch: "^10.2.5",
|
|
137
92
|
minimist: "^1.2.8",
|
|
138
93
|
"ps-node": "^0.1.6",
|
|
139
|
-
puppeteer: "^24.
|
|
94
|
+
puppeteer: "^24.42.0",
|
|
140
95
|
"puppeteer-extra": "^3.3.6",
|
|
141
96
|
"puppeteer-extra-plugin-stealth": "^2.11.2",
|
|
142
97
|
remove: "^0.1.5",
|
|
143
|
-
"sbg-utility": "^2.0.
|
|
144
|
-
upath: "^
|
|
145
|
-
yaml: "^2.8.
|
|
98
|
+
"sbg-utility": "^2.0.11",
|
|
99
|
+
upath: "^3.0.7",
|
|
100
|
+
yaml: "^2.8.3",
|
|
146
101
|
yarn: "^1.22.22"
|
|
147
102
|
},
|
|
148
103
|
devDependencies: {
|
|
149
|
-
"@babel/core": "^7.
|
|
150
|
-
"@babel/preset-env": "^7.
|
|
151
|
-
"@babel/preset-typescript": "^7.
|
|
152
|
-
"@eslint/eslintrc": "^3.3.
|
|
153
|
-
"@eslint/js": "^
|
|
154
|
-
"@rollup/plugin-babel": "^
|
|
155
|
-
"@rollup/plugin-commonjs": "^
|
|
104
|
+
"@babel/core": "^7.29.0",
|
|
105
|
+
"@babel/preset-env": "^7.29.2",
|
|
106
|
+
"@babel/preset-typescript": "^7.28.5",
|
|
107
|
+
"@eslint/eslintrc": "^3.3.5",
|
|
108
|
+
"@eslint/js": "^10.0.1",
|
|
109
|
+
"@rollup/plugin-babel": "^7.0.0",
|
|
110
|
+
"@rollup/plugin-commonjs": "^29.0.2",
|
|
156
111
|
"@rollup/plugin-json": "^6.1.0",
|
|
157
|
-
"@rollup/plugin-node-resolve": "^16.0.
|
|
112
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
158
113
|
"@types/babel__core": "^7",
|
|
159
114
|
"@types/babel__preset-env": "^7",
|
|
160
115
|
"@types/eslint": "^9",
|
|
161
116
|
"@types/fs-extra": "^11",
|
|
162
117
|
"@types/jest": "^30.0.0",
|
|
163
118
|
"@types/minimist": "^1",
|
|
164
|
-
"@types/node": "^
|
|
119
|
+
"@types/node": "^25.6.0",
|
|
165
120
|
"@types/prettier": "^3",
|
|
166
121
|
"@types/ps-node": "^0",
|
|
167
122
|
"@types/yargs": "^17",
|
|
168
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
169
|
-
"@typescript-eslint/parser": "^8.
|
|
170
|
-
"babel-jest": "^30.
|
|
123
|
+
"@typescript-eslint/eslint-plugin": "^8.59.0",
|
|
124
|
+
"@typescript-eslint/parser": "^8.59.0",
|
|
125
|
+
"babel-jest": "^30.4.1",
|
|
171
126
|
"browser-sync": "^3.0.4",
|
|
172
|
-
"cross-env": "^10.
|
|
173
|
-
"cross-spawn": "https://github.com/dimaslanjaka/node-cross-spawn/raw/
|
|
174
|
-
eslint: "^
|
|
127
|
+
"cross-env": "^10.1.0",
|
|
128
|
+
"cross-spawn": "https://github.com/dimaslanjaka/node-cross-spawn/raw/80999ac7a7031a81e11ddb5fab0f8ba433041c98/release/cross-spawn.tgz",
|
|
129
|
+
eslint: "^10.2.1",
|
|
175
130
|
"eslint-config-prettier": "^10.1.8",
|
|
176
|
-
"eslint-plugin-prettier": "^5.5.
|
|
177
|
-
globals: "^
|
|
131
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
132
|
+
globals: "^17.5.0",
|
|
178
133
|
gulp: "^5.0.1",
|
|
179
134
|
husky: "^9.1.7",
|
|
180
|
-
jest: "^30.
|
|
181
|
-
"lint-staged": "^16.
|
|
182
|
-
marked: "^
|
|
183
|
-
prettier: "^3.
|
|
184
|
-
rimraf: "^6.
|
|
185
|
-
rollup: "^4.
|
|
186
|
-
"ts-jest": "^29.4.
|
|
135
|
+
jest: "^30.4.2",
|
|
136
|
+
"lint-staged": "^16.4.0",
|
|
137
|
+
marked: "^18.0.3",
|
|
138
|
+
prettier: "^3.8.3",
|
|
139
|
+
rimraf: "^6.1.3",
|
|
140
|
+
rollup: "^4.60.2",
|
|
141
|
+
"ts-jest": "^29.4.9",
|
|
187
142
|
"ts-node": "^10.9.2",
|
|
188
|
-
tsup: "^8.5.
|
|
189
|
-
typedoc: "^0.28.
|
|
190
|
-
"typedoc-plugin-ga": "^1.
|
|
191
|
-
typescript: "^
|
|
143
|
+
tsup: "^8.5.1",
|
|
144
|
+
typedoc: "^0.28.19",
|
|
145
|
+
"typedoc-plugin-ga": "^1.1.1",
|
|
146
|
+
typescript: "^6.0.3"
|
|
192
147
|
},
|
|
193
148
|
directories: {
|
|
194
149
|
lib: "lib",
|
|
@@ -200,8 +155,67 @@ var require_package = __commonJS({
|
|
|
200
155
|
packageManager: "yarn@4.9.2",
|
|
201
156
|
resolutions: {
|
|
202
157
|
"cross-spawn": "https://github.com/dimaslanjaka/node-cross-spawn/raw/80999ac7a7031a81e11ddb5fab0f8ba433041c98/release/cross-spawn.tgz",
|
|
203
|
-
"git-command-helper": "https://github.com/dimaslanjaka/git-command-helper/raw/
|
|
204
|
-
"sbg-utility": "https://github.com/dimaslanjaka/static-blog-generator/raw/
|
|
158
|
+
"git-command-helper": "https://github.com/dimaslanjaka/git-command-helper/raw/0ec870a451241af4f7e16acee5474afe38918c77/release/git-command-helper.tgz",
|
|
159
|
+
"sbg-utility": "https://github.com/dimaslanjaka/static-blog-generator/raw/1c6327117ab66a6ac7bac6df2b5c4f1cd9ef2785/packages/sbg-utility/release/sbg-utility.tgz"
|
|
160
|
+
},
|
|
161
|
+
bin: {
|
|
162
|
+
"binary-collections": "lib/binary-collections.cjs",
|
|
163
|
+
"binary-executor": "binaries/binary-executor.cjs",
|
|
164
|
+
changelog: "lib/changelog.cjs",
|
|
165
|
+
chatgpt: "lib/free-chatgpt.cjs",
|
|
166
|
+
"clean-github-actions-cache": "lib/clean-github-actions-caches.cjs",
|
|
167
|
+
"clean-github-actions-caches": "lib/clean-github-actions-caches.cjs",
|
|
168
|
+
"clean-nodemodule": "binaries/clean-nodemodule.cjs",
|
|
169
|
+
"clean-nodemodules": "binaries/clean-nodemodules.cjs",
|
|
170
|
+
"clear-gh-caches": "lib/clean-github-actions-caches.cjs",
|
|
171
|
+
"clear-github-actions-cache": "lib/clean-github-actions-caches.cjs",
|
|
172
|
+
"clear-github-actions-caches": "lib/clean-github-actions-caches.cjs",
|
|
173
|
+
"del-gradle": "lib/del-gradle.cjs",
|
|
174
|
+
"del-node-modules": "lib/del-node-modules.cjs",
|
|
175
|
+
"del-nodemodules": "lib/del-node-modules.cjs",
|
|
176
|
+
"del-ps": "lib/del-ps.cjs",
|
|
177
|
+
"del-yarn-caches": "lib/del-yarn-caches.cjs",
|
|
178
|
+
"del-yarncaches": "lib/del-yarn-caches.cjs",
|
|
179
|
+
dev: "binaries/dev.cjs",
|
|
180
|
+
"dir-tree": "lib/print-directory-tree.cjs",
|
|
181
|
+
empty: "binaries/empty.cjs",
|
|
182
|
+
"find-node-modules": "lib/find-node-modules-cli.cjs",
|
|
183
|
+
"free-chatgpt": "lib/free-chatgpt.cjs",
|
|
184
|
+
"git-diff": "lib/git-diff-cli.cjs",
|
|
185
|
+
"git-fix": "lib/git-fix.cjs",
|
|
186
|
+
"git-purge": "lib/git-purge.cjs",
|
|
187
|
+
"git-reduce-size": "binaries/git-reduce-size.cjs",
|
|
188
|
+
"git-undo-commit": "lib/git/undo-commit.cjs",
|
|
189
|
+
"git-undo-staged": "lib/git/undo-staged.cjs",
|
|
190
|
+
javakill: "binaries/javakill.cjs",
|
|
191
|
+
"kill-night-crows": "lib/kill-night-crows.cjs",
|
|
192
|
+
"kill-process": "binaries/kill-process.cjs",
|
|
193
|
+
nodekill: "binaries/nodekill.cjs",
|
|
194
|
+
"npm-run-series": "lib/npm-run-series.cjs",
|
|
195
|
+
nrs: "lib/npm-run-series.cjs",
|
|
196
|
+
"package-resolutions-updater": "lib/package-resolutions-updater-cli.cjs",
|
|
197
|
+
"php-cs-fixer-staged": "lib/php-cs-fixer-staged.cjs",
|
|
198
|
+
"pkg-res-updater": "lib/package-resolutions-updater-cli.cjs",
|
|
199
|
+
"pkg-resolutions-updater": "lib/package-resolutions-updater-cli.cjs",
|
|
200
|
+
"print-directory-tree": "lib/print-directory-tree.cjs",
|
|
201
|
+
"print-tree": "lib/print-directory-tree.cjs",
|
|
202
|
+
prod: "binaries/prod.cjs",
|
|
203
|
+
py: "binaries/py.cjs",
|
|
204
|
+
"remove-module": "lib/remove-module.cjs",
|
|
205
|
+
rmfind: "binaries/rmfind.cjs",
|
|
206
|
+
rmpath: "lib/rmpath.cjs",
|
|
207
|
+
rmx: "binaries/rmx.cjs",
|
|
208
|
+
"run-s": "lib/npm-run-series.cjs",
|
|
209
|
+
"run-series": "lib/npm-run-series.cjs",
|
|
210
|
+
"submodule-install": "lib/submodule-install.cjs",
|
|
211
|
+
"submodule-remove": "lib/submodule-remove-cli.cjs",
|
|
212
|
+
"submodule-token": "binaries/submodule-token.cjs",
|
|
213
|
+
"test-cjs": "binaries/test-cjs.cjs",
|
|
214
|
+
"undo-commit": "lib/git/undo-commit.cjs",
|
|
215
|
+
"undo-last-commit": "lib/git/undo-commit.cjs",
|
|
216
|
+
"undo-staged": "lib/git/undo-staged.cjs",
|
|
217
|
+
"yarn-clean": "binaries/yarn-clean.cjs",
|
|
218
|
+
"yarn-reinstall": "lib/yarn-reinstall.cjs"
|
|
205
219
|
}
|
|
206
220
|
};
|
|
207
221
|
}
|
package/lib/changelog.cjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
3
|
var __esm = (fn, res) => function __init() {
|
|
3
4
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
@@ -67,31 +68,78 @@ var require_utils = __commonJS({
|
|
|
67
68
|
}
|
|
68
69
|
module2.exports.getArgs = getArgs2;
|
|
69
70
|
function del(fullPath) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
try {
|
|
72
|
+
if (!fs2.existsSync(fullPath)) return;
|
|
73
|
+
const stat = fs2.lstatSync(fullPath);
|
|
74
|
+
if (stat.isSymbolicLink()) {
|
|
75
|
+
try {
|
|
76
|
+
fs2.unlinkSync(fullPath);
|
|
77
|
+
console.log("deleted symlink", fullPath);
|
|
78
|
+
} catch (e) {
|
|
79
|
+
console.log("failed delete symlink", fullPath, e && e.message);
|
|
80
|
+
}
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (stat.isDirectory()) {
|
|
84
|
+
const subdir = fs2.readdirSync(fullPath).map((dirPath) => path2.resolve(fullPath, dirPath));
|
|
85
|
+
for (let i = 0; i < subdir.length; i++) {
|
|
86
|
+
del(subdir[i]);
|
|
87
|
+
}
|
|
88
|
+
try {
|
|
89
|
+
fs2.rmdirSync(fullPath);
|
|
90
|
+
console.log("deleted", fullPath);
|
|
91
|
+
} catch (e) {
|
|
92
|
+
try {
|
|
93
|
+
fs2.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
|
|
94
|
+
console.log("deleted", fullPath);
|
|
95
|
+
} catch (ee) {
|
|
96
|
+
console.log("failed delete", fullPath, ee && ee.message);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return;
|
|
74
100
|
}
|
|
75
|
-
} else {
|
|
76
101
|
try {
|
|
77
|
-
fs2.
|
|
102
|
+
fs2.unlinkSync(fullPath);
|
|
78
103
|
console.log("deleted", fullPath);
|
|
79
|
-
} catch (
|
|
80
|
-
|
|
104
|
+
} catch (e) {
|
|
105
|
+
try {
|
|
106
|
+
fs2.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
|
|
107
|
+
console.log("deleted", fullPath);
|
|
108
|
+
} catch (ee) {
|
|
109
|
+
console.log("failed delete", fullPath, ee && ee.message);
|
|
110
|
+
}
|
|
81
111
|
}
|
|
112
|
+
} catch (err) {
|
|
113
|
+
console.log("failed delete", fullPath, err && err.message);
|
|
82
114
|
}
|
|
83
115
|
}
|
|
84
116
|
module2.exports.del = del;
|
|
85
117
|
function delStream(globStream) {
|
|
86
118
|
globStream.stream().on("data", (result) => {
|
|
87
119
|
const fullPath = path2.resolve(process.cwd(), result);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
120
|
+
try {
|
|
121
|
+
if (fs2.existsSync(fullPath)) {
|
|
122
|
+
const stat = fs2.lstatSync(fullPath);
|
|
123
|
+
if (stat.isSymbolicLink()) {
|
|
124
|
+
try {
|
|
125
|
+
fs2.unlinkSync(fullPath);
|
|
126
|
+
console.log("deleted symlink", fullPath);
|
|
127
|
+
} catch (e) {
|
|
128
|
+
console.log("failed delete symlink", fullPath, e && e.message);
|
|
129
|
+
}
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (stat.isDirectory()) {
|
|
133
|
+
const subdir = fs2.readdirSync(fullPath).map((dirPath) => path2.resolve(fullPath, dirPath));
|
|
134
|
+
for (let i = 0; i < subdir.length; i++) {
|
|
135
|
+
del(subdir[i]);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
92
138
|
}
|
|
139
|
+
del(fullPath);
|
|
140
|
+
} catch (err) {
|
|
141
|
+
console.log("failed processing", fullPath, err && err.message);
|
|
93
142
|
}
|
|
94
|
-
del(fullPath);
|
|
95
143
|
});
|
|
96
144
|
}
|
|
97
145
|
module2.exports.delStream = delStream;
|
package/lib/changelog.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
require_utils
|
|
4
|
-
} from "./chunk-A3VUZEJK.mjs";
|
|
5
2
|
import {
|
|
6
3
|
require_gitattributes
|
|
7
4
|
} from "./chunk-PDSXF5HY.mjs";
|
|
5
|
+
import {
|
|
6
|
+
require_utils
|
|
7
|
+
} from "./chunk-A3VUZEJK.mjs";
|
|
8
8
|
import {
|
|
9
9
|
__commonJS,
|
|
10
10
|
__require,
|
|
@@ -18,7 +18,7 @@ var require_line_endings = __commonJS({
|
|
|
18
18
|
var path = __require("upath");
|
|
19
19
|
var fs = __require("fs");
|
|
20
20
|
var { runGitCommand } = require_utils();
|
|
21
|
-
var { updateGitAttributes } = require_gitattributes()
|
|
21
|
+
var { updateGitAttributes } = require_gitattributes();
|
|
22
22
|
function forceLfLineEndings() {
|
|
23
23
|
console.log("\n=== Configuring LF Line Endings ===");
|
|
24
24
|
runGitCommand(["config", "core.autocrlf", "false"], "Disable automatic CRLF conversion");
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
require_utils
|
|
4
|
+
} from "./chunk-A3VUZEJK.mjs";
|
|
5
|
+
import {
|
|
6
|
+
__commonJS,
|
|
7
|
+
init_esm_shims
|
|
8
|
+
} from "./chunk-QQ4A6DLD.mjs";
|
|
9
|
+
|
|
10
|
+
// src/git/undo-commit.cjs
|
|
11
|
+
var require_undo_commit = __commonJS({
|
|
12
|
+
"src/git/undo-commit.cjs"(exports, module) {
|
|
13
|
+
init_esm_shims();
|
|
14
|
+
var { runGitCommand } = require_utils();
|
|
15
|
+
function undoLastCommit() {
|
|
16
|
+
console.log("\n=== Undoing Last Commit ===");
|
|
17
|
+
runGitCommand(["reset", "--soft", "HEAD~1"], "Undo last commit while keeping changes staged");
|
|
18
|
+
}
|
|
19
|
+
module.exports = {
|
|
20
|
+
undoLastCommit
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
require_undo_commit
|
|
27
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
require_utils
|
|
4
|
+
} from "./chunk-A3VUZEJK.mjs";
|
|
5
|
+
import {
|
|
6
|
+
__commonJS,
|
|
7
|
+
init_esm_shims
|
|
8
|
+
} from "./chunk-QQ4A6DLD.mjs";
|
|
9
|
+
|
|
10
|
+
// src/git/undo-staged.cjs
|
|
11
|
+
var require_undo_staged = __commonJS({
|
|
12
|
+
"src/git/undo-staged.cjs"(exports, module) {
|
|
13
|
+
init_esm_shims();
|
|
14
|
+
var { runGitCommand } = require_utils();
|
|
15
|
+
function undoStagedChanges() {
|
|
16
|
+
console.log("\n=== Undoing Staged Changes ===");
|
|
17
|
+
runGitCommand(["reset", "HEAD", "."], "Undo staged changes");
|
|
18
|
+
}
|
|
19
|
+
module.exports = {
|
|
20
|
+
undoStagedChanges
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
require_undo_staged
|
|
27
|
+
};
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
require_utils
|
|
4
|
+
} from "./chunk-Z6JLYU2J.mjs";
|
|
5
|
+
import {
|
|
6
|
+
__toESM,
|
|
7
|
+
init_esm_shims
|
|
8
|
+
} from "./chunk-QQ4A6DLD.mjs";
|
|
9
|
+
|
|
10
|
+
// src/package-resolutions-updater.mjs
|
|
11
|
+
init_esm_shims();
|
|
12
|
+
var utils = __toESM(require_utils(), 1);
|
|
13
|
+
import * as dotenv from "dotenv";
|
|
14
|
+
import fs from "fs";
|
|
15
|
+
import https from "https";
|
|
16
|
+
import os from "os";
|
|
17
|
+
import path from "path";
|
|
18
|
+
var projectDir = process.cwd();
|
|
19
|
+
var envPath = path.join(projectDir, ".env");
|
|
20
|
+
var args = utils.getArgs();
|
|
21
|
+
if (fs.existsSync(envPath)) dotenv.config({ path: envPath, quiet: true, override: true });
|
|
22
|
+
var ACCESS_TOKEN = process.env.GITHUB_TOKEN || process.env.ACCESS_TOKEN;
|
|
23
|
+
if (args.help || args.h) {
|
|
24
|
+
showHelp();
|
|
25
|
+
}
|
|
26
|
+
function showHelp() {
|
|
27
|
+
const helpText = `
|
|
28
|
+
GitHub Package Resolutions Updater
|
|
29
|
+
Usage:
|
|
30
|
+
node src/package-resolutions-updater.mjs [options]
|
|
31
|
+
Options:
|
|
32
|
+
--help, -h Show this help message
|
|
33
|
+
Description:
|
|
34
|
+
Updates the commit hashes in package.json's 'resolutions' field for GitHub tarball URLs to point to the latest commit SHA of the corresponding repository and branch.
|
|
35
|
+
Features:
|
|
36
|
+
- Parses GitHub URLs to extract repository owner, name, and branch.
|
|
37
|
+
- Fetches the latest commit SHA across all branches using GitHub's API.
|
|
38
|
+
- Replaces the old branch or commit in the URL with the latest SHA.
|
|
39
|
+
- Overwrites package.json with the updated URLs.
|
|
40
|
+
Requirements:
|
|
41
|
+
- GitHub Personal Access Token (GITHUB_TOKEN) via .env
|
|
42
|
+
- ESM support (type: "module" in package.json)
|
|
43
|
+
- Node.js v18+ recommended
|
|
44
|
+
Dependencies:
|
|
45
|
+
- ansi-colors \u2013 for styled terminal output
|
|
46
|
+
- dotenv \u2013 to load GitHub token from .env
|
|
47
|
+
Examples:
|
|
48
|
+
node src/package-resolutions-updater.mjs
|
|
49
|
+
node src/package-resolutions-updater.mjs --help
|
|
50
|
+
|
|
51
|
+
`;
|
|
52
|
+
console.log(helpText);
|
|
53
|
+
process.exit(0);
|
|
54
|
+
}
|
|
55
|
+
var GITHUB_USER_AGENTS = [
|
|
56
|
+
"octokit-rest.js/19.0.7",
|
|
57
|
+
"GitHub CLI/2.40.0",
|
|
58
|
+
"Mozilla/5.0 (compatible; GitHubCopilot/1.0)",
|
|
59
|
+
"PostmanRuntime/7.32.3",
|
|
60
|
+
"binary-collections-resolver/1.0 (+https://github.com/dimaslanjaka/bin)"
|
|
61
|
+
];
|
|
62
|
+
var userAgentDir = path.join(os.tmpdir(), "nodejs");
|
|
63
|
+
var userAgentFile = path.join(userAgentDir, "useragent.txt");
|
|
64
|
+
var selectedUserAgent;
|
|
65
|
+
try {
|
|
66
|
+
if (!fs.existsSync(userAgentDir)) fs.mkdirSync(userAgentDir, { recursive: true });
|
|
67
|
+
if (fs.existsSync(userAgentFile)) {
|
|
68
|
+
const fileAgent = fs.readFileSync(userAgentFile, "utf-8").trim();
|
|
69
|
+
if (GITHUB_USER_AGENTS.includes(fileAgent)) {
|
|
70
|
+
selectedUserAgent = fileAgent;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (!selectedUserAgent) {
|
|
74
|
+
selectedUserAgent = GITHUB_USER_AGENTS[Math.floor(Math.random() * GITHUB_USER_AGENTS.length)];
|
|
75
|
+
fs.writeFileSync(userAgentFile, selectedUserAgent, "utf-8");
|
|
76
|
+
}
|
|
77
|
+
} catch (_e) {
|
|
78
|
+
selectedUserAgent = GITHUB_USER_AGENTS[Math.floor(Math.random() * GITHUB_USER_AGENTS.length)];
|
|
79
|
+
}
|
|
80
|
+
function fetchJson(url) {
|
|
81
|
+
const headers = {
|
|
82
|
+
"User-Agent": selectedUserAgent,
|
|
83
|
+
Accept: "application/vnd.github.v3+json",
|
|
84
|
+
"X-GitHub-Api-Version": "2022-11-28",
|
|
85
|
+
...ACCESS_TOKEN ? { Authorization: `token ${ACCESS_TOKEN}` } : {}
|
|
86
|
+
};
|
|
87
|
+
return new Promise((resolve, reject) => {
|
|
88
|
+
https.get(url, { headers }, (res) => {
|
|
89
|
+
let data = "";
|
|
90
|
+
res.on("data", (chunk) => data += chunk);
|
|
91
|
+
res.on("end", () => {
|
|
92
|
+
try {
|
|
93
|
+
const json = JSON.parse(data);
|
|
94
|
+
if (res.statusCode < 200 || res.statusCode >= 300) {
|
|
95
|
+
return reject(
|
|
96
|
+
new Error(`GitHub API Error ${res.statusCode}: ${json.message || "Unknown error"}
|
|
97
|
+
URL: ${url}`)
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
resolve(json);
|
|
101
|
+
} catch {
|
|
102
|
+
reject(new Error(`Invalid JSON from: ${url}`));
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}).on("error", reject);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
async function getLatestCommit(owner, repo, branch = "main") {
|
|
109
|
+
var _a, _b, _c, _d;
|
|
110
|
+
const url = `https://api.github.com/repos/${owner}/${repo}/commits/${branch}`;
|
|
111
|
+
const json = await fetchJson(url);
|
|
112
|
+
const sha = json.sha;
|
|
113
|
+
const dateStr = ((_b = (_a = json.commit) == null ? void 0 : _a.committer) == null ? void 0 : _b.date) || ((_d = (_c = json.commit) == null ? void 0 : _c.author) == null ? void 0 : _d.date);
|
|
114
|
+
if (!sha || !dateStr) {
|
|
115
|
+
console.log(json);
|
|
116
|
+
throw new Error(`Missing SHA or date for ${owner}/${repo}@${branch}`);
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
owner,
|
|
120
|
+
repo,
|
|
121
|
+
branch,
|
|
122
|
+
sha,
|
|
123
|
+
date: new Date(dateStr).toISOString()
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
async function getLatestCommitAcrossBranches(owner, repo) {
|
|
127
|
+
const branches = await fetchJson(`https://api.github.com/repos/${owner}/${repo}/branches`);
|
|
128
|
+
const commits = await Promise.all(
|
|
129
|
+
branches.map(async ({ name, commit }) => {
|
|
130
|
+
var _a, _b, _c, _d;
|
|
131
|
+
const commitSha = commit == null ? void 0 : commit.sha;
|
|
132
|
+
if (!commitSha) {
|
|
133
|
+
console.warn(`No commit SHA for '${owner}/${repo}' branch: ${name}`);
|
|
134
|
+
return { branch: name, sha: "", date: /* @__PURE__ */ new Date(0) };
|
|
135
|
+
}
|
|
136
|
+
try {
|
|
137
|
+
const commitData = await fetchJson(`https://api.github.com/repos/${owner}/${repo}/commits/${commitSha}`);
|
|
138
|
+
const dateStr = ((_b = (_a = commitData.commit) == null ? void 0 : _a.committer) == null ? void 0 : _b.date) || ((_d = (_c = commitData.commit) == null ? void 0 : _c.author) == null ? void 0 : _d.date);
|
|
139
|
+
const date = dateStr ? new Date(dateStr) : /* @__PURE__ */ new Date(0);
|
|
140
|
+
return { branch: name, sha: commitData.sha, date };
|
|
141
|
+
} catch (e) {
|
|
142
|
+
console.warn(`Failed to fetch commit for ${name}: ${e.message}`);
|
|
143
|
+
return { branch: name, sha: commitSha, date: /* @__PURE__ */ new Date(0) };
|
|
144
|
+
}
|
|
145
|
+
})
|
|
146
|
+
);
|
|
147
|
+
const latest = commits.reduce((a, b) => a.date > b.date ? a : b, { date: /* @__PURE__ */ new Date(0) });
|
|
148
|
+
return {
|
|
149
|
+
owner,
|
|
150
|
+
repo,
|
|
151
|
+
branch: latest.branch,
|
|
152
|
+
sha: latest.sha,
|
|
153
|
+
date: latest.date.toISOString()
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
function replaceRawWithLatestHash(url, latestHash) {
|
|
157
|
+
const match = url.match(/^https:\/\/github\.com\/([^/]+)\/([^/]+)\/raw\/([^/]+)\/(.+)$/);
|
|
158
|
+
if (!match) throw new Error("Invalid GitHub raw URL");
|
|
159
|
+
const [, owner, repo, _oldHash, path2] = match;
|
|
160
|
+
return `https://github.com/${owner}/${repo}/raw/${latestHash}/${path2}`;
|
|
161
|
+
}
|
|
162
|
+
function parseGitHubUrl(url) {
|
|
163
|
+
const ghRepoRoot = /^https:\/\/github\.com\/([^/]+)\/([^/]+)\/?$/;
|
|
164
|
+
const ghTreeOrBlob = /^https:\/\/github\.com\/([^/]+)\/([^/]+)\/(tree|blob)\/([^/]+(?:\/[^/]+)*)/;
|
|
165
|
+
const ghRaw = /^https:\/\/raw\.githubusercontent\.com\/([^/]+)\/([^/]+)\/([^/]+)(\/.+)?$/;
|
|
166
|
+
const ghDotComRaw = /^https:\/\/github\.com\/([^/]+)\/([^/]+)\/raw\/([^/]+)\/.+/;
|
|
167
|
+
let match;
|
|
168
|
+
if (match = url.match(ghRaw)) {
|
|
169
|
+
const [, owner, repo, branch] = match;
|
|
170
|
+
return { owner, repo, branch, url };
|
|
171
|
+
}
|
|
172
|
+
if (match = url.match(ghDotComRaw)) {
|
|
173
|
+
const [, owner, repo, branch] = match;
|
|
174
|
+
return { owner, repo, branch, url };
|
|
175
|
+
}
|
|
176
|
+
if (match = url.match(ghTreeOrBlob)) {
|
|
177
|
+
const [, owner, repo, , branchPath] = match;
|
|
178
|
+
return { owner, repo, branch: branchPath, url };
|
|
179
|
+
}
|
|
180
|
+
if (match = url.match(ghRepoRoot)) {
|
|
181
|
+
const [, owner, repo] = match;
|
|
182
|
+
return { owner, repo, url };
|
|
183
|
+
}
|
|
184
|
+
throw new Error(`Unsupported GitHub URL: ${url}`);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export {
|
|
188
|
+
fetchJson,
|
|
189
|
+
getLatestCommit,
|
|
190
|
+
getLatestCommitAcrossBranches,
|
|
191
|
+
replaceRawWithLatestHash,
|
|
192
|
+
parseGitHubUrl
|
|
193
|
+
};
|