binary-collections 2.0.5 → 2.0.7

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.
Files changed (126) hide show
  1. package/bin/bash-dummy +7 -2
  2. package/bin/clean-nodemodule +7 -2
  3. package/bin/clean-nodemodules +7 -2
  4. package/bin/dev +7 -2
  5. package/bin/empty +7 -2
  6. package/bin/git-diff.cmd +4 -0
  7. package/bin/git-fix-encoding +7 -2
  8. package/bin/git-fix-encoding.cmd +0 -0
  9. package/bin/git-reduce-size +7 -2
  10. package/bin/kill-process +7 -2
  11. package/bin/nodekill +7 -2
  12. package/bin/nodekill.cmd +0 -0
  13. package/bin/nodekill.ps1 +0 -0
  14. package/bin/prod +7 -2
  15. package/bin/rmfind +7 -2
  16. package/bin/rmpath +7 -2
  17. package/bin/rmx +9 -3
  18. package/bin/submodule +13 -2
  19. package/bin/submodule-install +7 -2
  20. package/bin/submodule-remove +7 -2
  21. package/lib/chunk-3LOB2P54.mjs +202 -0
  22. package/lib/chunk-4LEXWIIF.mjs +173 -0
  23. package/lib/chunk-BSD5CIRU.mjs +52 -0
  24. package/lib/chunk-FB6YIQYR.mjs +42 -0
  25. package/lib/chunk-JL32QDSH.mjs +20 -0
  26. package/lib/chunk-OKYLF2MU.mjs +53 -0
  27. package/lib/chunk-VXZQNLPU.mjs +23 -0
  28. package/lib/del-gradle.cjs +72 -0
  29. package/lib/del-gradle.d.mts +2 -0
  30. package/lib/del-gradle.d.ts +1 -0
  31. package/lib/del-gradle.js +15 -0
  32. package/lib/del-gradle.mjs +28 -0
  33. package/lib/del-node-modules.cjs +72 -0
  34. package/lib/del-node-modules.d.mts +2 -0
  35. package/lib/del-node-modules.d.ts +1 -0
  36. package/lib/del-node-modules.js +11 -15
  37. package/lib/del-node-modules.mjs +28 -0
  38. package/lib/del-ps.cjs +93 -0
  39. package/lib/del-ps.d.mts +2 -0
  40. package/lib/del-ps.d.ts +1 -0
  41. package/lib/del-ps.js +31 -0
  42. package/lib/del-ps.mjs +43 -0
  43. package/lib/del-yarn-caches.cjs +65 -0
  44. package/lib/del-yarn-caches.d.mts +2 -0
  45. package/lib/del-yarn-caches.d.ts +1 -0
  46. package/lib/del-yarn-caches.js +6 -9
  47. package/lib/del-yarn-caches.mjs +21 -0
  48. package/lib/find-node-modules-cli.cjs +59 -0
  49. package/lib/find-node-modules-cli.d.mts +1 -0
  50. package/lib/find-node-modules-cli.d.ts +2 -0
  51. package/lib/find-node-modules-cli.js +3 -0
  52. package/lib/find-node-modules-cli.mjs +14 -0
  53. package/lib/find-node-modules.cjs +34 -0
  54. package/lib/find-node-modules.d.mts +10 -0
  55. package/lib/find-node-modules.d.ts +9 -0
  56. package/lib/find-node-modules.js +41 -13
  57. package/lib/find-node-modules.mjs +7 -0
  58. package/lib/git-diff.cjs +74 -0
  59. package/lib/git-diff.d.cts +2 -0
  60. package/lib/git-diff.d.mts +87 -0
  61. package/lib/git-diff.d.ts +87 -0
  62. package/lib/git-diff.mjs +83 -0
  63. package/lib/git-purge.cjs +91 -0
  64. package/lib/git-purge.d.mts +2 -0
  65. package/lib/git-purge.d.ts +1 -0
  66. package/lib/git-purge.js +59 -0
  67. package/lib/git-purge.mjs +47 -0
  68. package/lib/index.cjs +92 -0
  69. package/lib/index.d.mts +1 -0
  70. package/lib/index.d.ts +2 -0
  71. package/lib/index.js +8 -0
  72. package/lib/index.mjs +18 -0
  73. package/lib/npm-run-series.cjs +61 -0
  74. package/lib/npm-run-series.d.mts +1 -0
  75. package/lib/npm-run-series.d.ts +2 -0
  76. package/lib/npm-run-series.js +80 -39
  77. package/lib/npm-run-series.mjs +47 -0
  78. package/lib/package-resolutions.cjs +28 -0
  79. package/lib/package-resolutions.d.mts +25 -0
  80. package/lib/package-resolutions.d.ts +25 -0
  81. package/lib/package-resolutions.mjs +31 -0
  82. package/lib/ps/connected-domain.cjs +156 -0
  83. package/lib/ps/connected-domain.d.mts +3 -0
  84. package/lib/ps/connected-domain.d.ts +2 -0
  85. package/lib/ps/connected-domain.js +202 -0
  86. package/lib/ps/connected-domain.mjs +7 -0
  87. package/lib/ps/index.cjs +555 -0
  88. package/lib/ps/index.d.cjs +17 -0
  89. package/lib/ps/index.d.d.mts +26 -0
  90. package/lib/ps/index.d.d.ts +26 -0
  91. package/lib/ps/index.d.mjs +8 -0
  92. package/lib/ps/index.d.mts +26 -0
  93. package/lib/ps/index.d.ts +2 -0
  94. package/lib/ps/index.js +250 -0
  95. package/lib/ps/index.mjs +203 -0
  96. package/lib/ps/isWin.cjs +3 -0
  97. package/lib/ps/isWin.d.mts +3 -0
  98. package/lib/ps/isWin.d.ts +2 -0
  99. package/lib/ps/isWin.js +2 -0
  100. package/lib/ps/isWin.mjs +7 -0
  101. package/lib/ps/table-parser.cjs +359 -0
  102. package/lib/ps/table-parser.d.mts +3 -0
  103. package/lib/ps/table-parser.d.ts +1 -0
  104. package/lib/ps/table-parser.js +268 -0
  105. package/lib/ps/table-parser.mjs +8 -0
  106. package/lib/submodule-install.cjs +118 -0
  107. package/lib/submodule-install.d.cts +2 -0
  108. package/lib/submodule-install.d.mts +141 -0
  109. package/lib/submodule-install.d.ts +141 -0
  110. package/lib/submodule-install.mjs +116 -0
  111. package/lib/utils.cjs +35 -0
  112. package/lib/utils.d.mts +20 -0
  113. package/lib/utils.d.ts +16 -0
  114. package/lib/utils.js +42 -28
  115. package/lib/utils.mjs +7 -0
  116. package/lib/yarn-reinstall.cjs +42 -0
  117. package/lib/yarn-reinstall.d.cts +1 -0
  118. package/lib/yarn-reinstall.d.mts +45 -0
  119. package/lib/yarn-reinstall.d.ts +45 -0
  120. package/lib/yarn-reinstall.mjs +50 -0
  121. package/package.json +80 -38
  122. package/readme.md +188 -40
  123. package/src/ps/index.js +285 -0
  124. package/test/package.json +19 -0
  125. package/index.js +0 -1
  126. package/lib/package-resolutions.json +0 -22
@@ -0,0 +1,173 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ init_esm_shims
4
+ } from "./chunk-VXZQNLPU.mjs";
5
+ import {
6
+ __commonJS
7
+ } from "./chunk-FB6YIQYR.mjs";
8
+
9
+ // src/ps/connected-domain.js
10
+ var require_connected_domain = __commonJS({
11
+ "src/ps/connected-domain.js"(exports, module) {
12
+ init_esm_shims();
13
+ module.exports = function(tdArray, indicator, hardlink) {
14
+ hardlink = hardlink || false;
15
+ if (!tdArray) {
16
+ throw new Error("tdArray must be provided");
17
+ }
18
+ if (!indicator) {
19
+ throw new Error("indicator must be provided");
20
+ }
21
+ tdArray = JSON.parse(JSON.stringify(tdArray));
22
+ var domains = {};
23
+ var domainUUID = 0;
24
+ var pointsHash = {};
25
+ tdArray.forEach(function(row, y) {
26
+ row.forEach(function(colItem, x) {
27
+ var identifier2 = indicator(colItem, x, y);
28
+ var neighbours = [];
29
+ if (tdArray[y - 1] && tdArray[y - 1][x] !== void 0) {
30
+ neighbours.push(pointsHash[x + "_" + (y - 1)]);
31
+ }
32
+ if (row[x - 1] !== void 0) {
33
+ neighbours.push(pointsHash[x - 1 + "_" + y]);
34
+ }
35
+ if (!hardlink) {
36
+ if (tdArray[y - 1] && tdArray[y - 1][x - 1] !== void 0) {
37
+ neighbours.push(pointsHash[x - 1 + "_" + (y - 1)]);
38
+ }
39
+ if (tdArray[y - 1] && tdArray[y - 1][x + 1] !== void 0) {
40
+ neighbours.push(pointsHash[x + 1 + "_" + (y - 1)]);
41
+ }
42
+ }
43
+ if (neighbours.length) {
44
+ var matched = false;
45
+ neighbours.forEach(function(neighbour) {
46
+ if (neighbour.identifier == identifier2) {
47
+ if (!matched) {
48
+ addPointToDomain(colItem, x, y, neighbour.domainId);
49
+ matched = true;
50
+ } else {
51
+ var colItemPoint = pointsHash[x + "_" + y];
52
+ if (neighbour.domainId != colItemPoint.domainId) {
53
+ mergeDomains(neighbour.domainId, colItemPoint.domainId);
54
+ }
55
+ }
56
+ }
57
+ });
58
+ if (!matched) {
59
+ addNewDomain(colItem, x, y, identifier2);
60
+ }
61
+ } else {
62
+ addNewDomain(colItem, x, y, identifier2);
63
+ }
64
+ });
65
+ });
66
+ var result = {
67
+ domains: [],
68
+ totalDomains: 0,
69
+ groupByIdentifier: {},
70
+ totalIdentifiers: 0
71
+ };
72
+ var domainId = null;
73
+ var identifier = null;
74
+ var domain = null;
75
+ for (domainId in domains) {
76
+ domain = domains[domainId];
77
+ domain.bounding = calculateBounding(domain.points);
78
+ identifier = domain.identifier;
79
+ result.domains.push(domain);
80
+ result.totalDomains++;
81
+ if (!(identifier in result.groupByIdentifier)) {
82
+ result.groupByIdentifier[identifier] = [];
83
+ result.totalIdentifiers++;
84
+ }
85
+ result.groupByIdentifier[identifier].push(domain);
86
+ }
87
+ function calculateBounding(points) {
88
+ var minX = null;
89
+ var minY = null;
90
+ var maxX = null;
91
+ var maxY = null;
92
+ points.forEach(function(point) {
93
+ if (minX === null || point.x < minX) {
94
+ minX = point.x;
95
+ }
96
+ if (minY === null || point.y < minY) {
97
+ minY = point.y;
98
+ }
99
+ if (maxX === null || point.x > maxX) {
100
+ maxX = point.x;
101
+ }
102
+ if (maxY === null || point.y > maxY) {
103
+ maxY = point.y;
104
+ }
105
+ });
106
+ var w = maxX - minX;
107
+ var h = maxY - minY;
108
+ return {
109
+ x: minX,
110
+ y: minY,
111
+ w,
112
+ h
113
+ };
114
+ }
115
+ function addNewDomain(point, x, y, identifier2) {
116
+ var newDomain = {
117
+ identifier: identifier2,
118
+ domainId: ++domainUUID,
119
+ bounding: {},
120
+ points: []
121
+ };
122
+ var newPoint = {
123
+ value: point,
124
+ x,
125
+ y,
126
+ identifier: identifier2,
127
+ domainId: newDomain.domainId
128
+ };
129
+ pointsHash[x + "_" + y] = {
130
+ value: point,
131
+ identifier: identifier2,
132
+ domainId: newDomain.domainId
133
+ };
134
+ newDomain.points.push(newPoint);
135
+ domains[newDomain.domainId] = newDomain;
136
+ }
137
+ function addPointToDomain(point, x, y, domainId2) {
138
+ var domain2 = domains[domainId2];
139
+ var newPoint = {
140
+ value: point,
141
+ x,
142
+ y,
143
+ identifier: domain2.identifier,
144
+ domainId: domainId2
145
+ };
146
+ pointsHash[x + "_" + y] = {
147
+ value: point,
148
+ identifier: domain2.identifier,
149
+ domainId: domainId2
150
+ };
151
+ domain2.points.push(newPoint);
152
+ }
153
+ function mergeDomains(domainAId, domainBId) {
154
+ var domainA = domains[domainAId];
155
+ var domainB = domains[domainBId];
156
+ if (domainA.identifier == domainB.identifier) {
157
+ domainB.domainId = domainA.domainId;
158
+ domainB.points.forEach(function(point) {
159
+ point.domainId = domainA.domainId;
160
+ pointsHash[point.x + "_" + point.y].domainId = domainA.domainId;
161
+ });
162
+ domainA.points = domainA.points.concat(domainB.points);
163
+ delete domains[domainBId];
164
+ }
165
+ }
166
+ return result;
167
+ };
168
+ }
169
+ });
170
+
171
+ export {
172
+ require_connected_domain
173
+ };
@@ -0,0 +1,52 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ init_esm_shims
4
+ } from "./chunk-VXZQNLPU.mjs";
5
+ import {
6
+ __commonJS,
7
+ __require
8
+ } from "./chunk-FB6YIQYR.mjs";
9
+
10
+ // src/find-node-modules.js
11
+ var require_find_node_modules = __commonJS({
12
+ "src/find-node-modules.js"(exports, module) {
13
+ init_esm_shims();
14
+ var glob = __require("glob");
15
+ var path = __require("path");
16
+ function findNodeModules(dir = process.cwd(), callback = null) {
17
+ const finalDir = typeof dir === "string" ? dir : process.cwd();
18
+ return new Promise((resolve, reject) => {
19
+ const results = [];
20
+ const g3 = new glob.Glob("**/node_modules", {
21
+ withFileTypes: false,
22
+ cwd: finalDir,
23
+ ignore: ["**/.git*", "**/vendor/**"]
24
+ });
25
+ const stream = g3.stream();
26
+ stream.on("data", (result) => {
27
+ const fullPath = path.resolve(finalDir, result);
28
+ if (typeof callback === "function") {
29
+ try {
30
+ callback(fullPath);
31
+ } catch (err) {
32
+ console.error("findNodeModules callback error:", err);
33
+ }
34
+ }
35
+ results.push(fullPath);
36
+ });
37
+ stream.on("error", (err) => reject(err));
38
+ stream.on("end", () => {
39
+ if (results.length === 0) {
40
+ console.log("No node_modules directories found.");
41
+ }
42
+ resolve(results);
43
+ });
44
+ });
45
+ }
46
+ module.exports = findNodeModules;
47
+ }
48
+ });
49
+
50
+ export {
51
+ require_find_node_modules
52
+ };
@@ -0,0 +1,42 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
9
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
10
+ }) : x)(function(x) {
11
+ if (typeof require !== "undefined") return require.apply(this, arguments);
12
+ throw Error('Dynamic require of "' + x + '" is not supported');
13
+ });
14
+ var __esm = (fn, res) => function __init() {
15
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
16
+ };
17
+ var __commonJS = (cb, mod) => function __require2() {
18
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
19
+ };
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from === "object" || typeof from === "function") {
22
+ for (let key of __getOwnPropNames(from))
23
+ if (!__hasOwnProp.call(to, key) && key !== except)
24
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
+ // If the importer is in node compatibility mode or this is not an ESM
30
+ // file that has been converted to a CommonJS file using a Babel-
31
+ // compatible transform (i.e. "__esModule" has not been set), then set
32
+ // "default" to the CommonJS "module.exports" for node compatibility.
33
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
+ mod
35
+ ));
36
+
37
+ export {
38
+ __require,
39
+ __esm,
40
+ __commonJS,
41
+ __toESM
42
+ };
@@ -0,0 +1,20 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ init_esm_shims
4
+ } from "./chunk-VXZQNLPU.mjs";
5
+ import {
6
+ __commonJS
7
+ } from "./chunk-FB6YIQYR.mjs";
8
+
9
+ // src/ps/isWin.js
10
+ var require_isWin = __commonJS({
11
+ "src/ps/isWin.js"(exports, module) {
12
+ init_esm_shims();
13
+ var isWin = process.platform === "win32";
14
+ module.exports = isWin;
15
+ }
16
+ });
17
+
18
+ export {
19
+ require_isWin
20
+ };
@@ -0,0 +1,53 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ init_esm_shims
4
+ } from "./chunk-VXZQNLPU.mjs";
5
+ import {
6
+ __commonJS,
7
+ __require
8
+ } from "./chunk-FB6YIQYR.mjs";
9
+
10
+ // src/utils.js
11
+ var require_utils = __commonJS({
12
+ "src/utils.js"(exports, module) {
13
+ init_esm_shims();
14
+ var { fs, path } = __require("sbg-utility");
15
+ var argv = __require("minimist")(process.argv.slice(2));
16
+ function getArgs() {
17
+ return argv;
18
+ }
19
+ function del(fullPath) {
20
+ if (fs.statSync(fullPath).isDirectory()) {
21
+ const subdir = fs.readdirSync(fullPath).map((dirPath) => path.resolve(fullPath, dirPath));
22
+ for (let i = 0; i < subdir.length; i++) {
23
+ del(subdir[i]);
24
+ }
25
+ } else {
26
+ try {
27
+ fs.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
28
+ console.log("deleted", fullPath);
29
+ } catch (_) {
30
+ console.log("failed delete", fullPath);
31
+ }
32
+ }
33
+ }
34
+ function delStream(globStream) {
35
+ globStream.stream().on("data", (result) => {
36
+ const fullPath = path.resolve(process.cwd(), result);
37
+ if (fs.statSync(fullPath).isDirectory()) {
38
+ const subdir = fs.readdirSync(fullPath).map((dirPath) => path.resolve(fullPath, dirPath));
39
+ for (let i = 0; i < subdir.length; i++) {
40
+ del(subdir[i]);
41
+ }
42
+ }
43
+ del(fullPath);
44
+ });
45
+ }
46
+ var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
47
+ module.exports = { del, delStream, getArgs, delay };
48
+ }
49
+ });
50
+
51
+ export {
52
+ require_utils
53
+ };
@@ -0,0 +1,23 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ __esm
4
+ } from "./chunk-FB6YIQYR.mjs";
5
+
6
+ // node_modules/tsup/assets/esm_shims.js
7
+ import path from "path";
8
+ import { fileURLToPath } from "url";
9
+ var getFilename, getDirname, __dirname, __filename;
10
+ var init_esm_shims = __esm({
11
+ "node_modules/tsup/assets/esm_shims.js"() {
12
+ getFilename = () => fileURLToPath(import.meta.url);
13
+ getDirname = () => path.dirname(getFilename());
14
+ __dirname = /* @__PURE__ */ getDirname();
15
+ __filename = /* @__PURE__ */ getFilename();
16
+ }
17
+ });
18
+
19
+ export {
20
+ __dirname,
21
+ __filename,
22
+ init_esm_shims
23
+ };
@@ -0,0 +1,72 @@
1
+ var __getOwnPropNames = Object.getOwnPropertyNames;
2
+ var __esm = (fn, res) => function __init() {
3
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
4
+ };
5
+ var __commonJS = (cb, mod) => function __require() {
6
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
7
+ };
8
+
9
+ // node_modules/tsup/assets/cjs_shims.js
10
+ var init_cjs_shims = __esm({
11
+ "node_modules/tsup/assets/cjs_shims.js"() {
12
+ }
13
+ });
14
+
15
+ // src/utils.js
16
+ var require_utils = __commonJS({
17
+ "src/utils.js"(exports2, module2) {
18
+ init_cjs_shims();
19
+ var { fs, path: path2 } = require("sbg-utility");
20
+ var argv = require("minimist")(process.argv.slice(2));
21
+ function getArgs() {
22
+ return argv;
23
+ }
24
+ function del2(fullPath) {
25
+ if (fs.statSync(fullPath).isDirectory()) {
26
+ const subdir = fs.readdirSync(fullPath).map((dirPath) => path2.resolve(fullPath, dirPath));
27
+ for (let i = 0; i < subdir.length; i++) {
28
+ del2(subdir[i]);
29
+ }
30
+ } else {
31
+ try {
32
+ fs.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
33
+ console.log("deleted", fullPath);
34
+ } catch (_) {
35
+ console.log("failed delete", fullPath);
36
+ }
37
+ }
38
+ }
39
+ function delStream(globStream2) {
40
+ globStream2.stream().on("data", (result) => {
41
+ const fullPath = path2.resolve(process.cwd(), result);
42
+ if (fs.statSync(fullPath).isDirectory()) {
43
+ const subdir = fs.readdirSync(fullPath).map((dirPath) => path2.resolve(fullPath, dirPath));
44
+ for (let i = 0; i < subdir.length; i++) {
45
+ del2(subdir[i]);
46
+ }
47
+ }
48
+ del2(fullPath);
49
+ });
50
+ }
51
+ var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
52
+ module2.exports = { del: del2, delStream, getArgs, delay };
53
+ }
54
+ });
55
+
56
+ // src/del-gradle.js
57
+ init_cjs_shims();
58
+ var glob = require("glob");
59
+ var { path } = require("sbg-utility");
60
+ var { del } = require_utils();
61
+ var globStream = new glob.Glob(["**/build.gradle"], {
62
+ withFileTypes: false,
63
+ cwd: process.cwd(),
64
+ ignore: ["**/node_modules/**", "**/vendor/**"]
65
+ });
66
+ globStream.stream().on("data", (result) => {
67
+ const fullPath = path.resolve(process.cwd(), result);
68
+ const base = path.dirname(fullPath);
69
+ const buildFolder = path.join(base, "build");
70
+ console.log("delete build folder", buildFolder);
71
+ del(buildFolder);
72
+ });
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ const glob = require("glob");
2
+ const { path } = require("sbg-utility");
3
+ const { del } = require("./utils");
4
+ const globStream = new glob.Glob(["**/build.gradle"], {
5
+ withFileTypes: false,
6
+ cwd: process.cwd(),
7
+ ignore: ["**/node_modules/**", "**/vendor/**"]
8
+ });
9
+ globStream.stream().on("data", (result) => {
10
+ const fullPath = path.resolve(process.cwd(), result);
11
+ const base = path.dirname(fullPath);
12
+ const buildFolder = path.join(base, "build");
13
+ console.log("delete build folder", buildFolder);
14
+ del(buildFolder);
15
+ });
@@ -0,0 +1,28 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ require_utils
4
+ } from "./chunk-OKYLF2MU.mjs";
5
+ import {
6
+ init_esm_shims
7
+ } from "./chunk-VXZQNLPU.mjs";
8
+ import {
9
+ __require
10
+ } from "./chunk-FB6YIQYR.mjs";
11
+
12
+ // src/del-gradle.js
13
+ init_esm_shims();
14
+ var glob = __require("glob");
15
+ var { path } = __require("sbg-utility");
16
+ var { del } = require_utils();
17
+ var globStream = new glob.Glob(["**/build.gradle"], {
18
+ withFileTypes: false,
19
+ cwd: process.cwd(),
20
+ ignore: ["**/node_modules/**", "**/vendor/**"]
21
+ });
22
+ globStream.stream().on("data", (result) => {
23
+ const fullPath = path.resolve(process.cwd(), result);
24
+ const base = path.dirname(fullPath);
25
+ const buildFolder = path.join(base, "build");
26
+ console.log("delete build folder", buildFolder);
27
+ del(buildFolder);
28
+ });
@@ -0,0 +1,72 @@
1
+ var __getOwnPropNames = Object.getOwnPropertyNames;
2
+ var __esm = (fn, res) => function __init() {
3
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
4
+ };
5
+ var __commonJS = (cb, mod) => function __require() {
6
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
7
+ };
8
+
9
+ // node_modules/tsup/assets/cjs_shims.js
10
+ var init_cjs_shims = __esm({
11
+ "node_modules/tsup/assets/cjs_shims.js"() {
12
+ }
13
+ });
14
+
15
+ // src/utils.js
16
+ var require_utils = __commonJS({
17
+ "src/utils.js"(exports2, module2) {
18
+ init_cjs_shims();
19
+ var { fs, path } = require("sbg-utility");
20
+ var argv = require("minimist")(process.argv.slice(2));
21
+ function getArgs() {
22
+ return argv;
23
+ }
24
+ function del(fullPath) {
25
+ if (fs.statSync(fullPath).isDirectory()) {
26
+ const subdir = fs.readdirSync(fullPath).map((dirPath) => path.resolve(fullPath, dirPath));
27
+ for (let i = 0; i < subdir.length; i++) {
28
+ del(subdir[i]);
29
+ }
30
+ } else {
31
+ try {
32
+ fs.rmSync(fullPath, { recursive: true, force: true, retryDelay: 7e3 });
33
+ console.log("deleted", fullPath);
34
+ } catch (_) {
35
+ console.log("failed delete", fullPath);
36
+ }
37
+ }
38
+ }
39
+ function delStream2(globStream) {
40
+ globStream.stream().on("data", (result) => {
41
+ const fullPath = path.resolve(process.cwd(), result);
42
+ if (fs.statSync(fullPath).isDirectory()) {
43
+ const subdir = fs.readdirSync(fullPath).map((dirPath) => path.resolve(fullPath, dirPath));
44
+ for (let i = 0; i < subdir.length; i++) {
45
+ del(subdir[i]);
46
+ }
47
+ }
48
+ del(fullPath);
49
+ });
50
+ }
51
+ var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
52
+ module2.exports = { del, delStream: delStream2, getArgs, delay };
53
+ }
54
+ });
55
+
56
+ // src/del-node-modules.js
57
+ init_cjs_shims();
58
+ var glob = require("glob");
59
+ var { delStream } = require_utils();
60
+ var globalIgnore = [
61
+ // ignore .git .github folder
62
+ "**/.git*",
63
+ // ignore composer folder
64
+ "**/vendor/**"
65
+ ];
66
+ console.log("cleaning node_modules in", process.cwd());
67
+ var g3 = new glob.Glob("**/node_modules", {
68
+ withFileTypes: false,
69
+ cwd: process.cwd(),
70
+ ignore: globalIgnore
71
+ });
72
+ delStream(g3);
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,19 +1,15 @@
1
- const glob = require('glob');
2
- const { delStream } = require('./utils');
3
- // process.cwd = () => path.resolve(__dirname + '/../../../Repositories');
4
-
1
+ const glob = require("glob");
2
+ const { delStream } = require("./utils");
5
3
  const globalIgnore = [
6
- // ignore .git .github folder
7
- '**/.git*',
8
- // ignore composer folder
9
- '**/vendor/**'
4
+ // ignore .git .github folder
5
+ "**/.git*",
6
+ // ignore composer folder
7
+ "**/vendor/**"
10
8
  ];
11
-
12
- console.log('cleaning node_modules in', process.cwd());
13
-
14
- const g3 = new glob.Glob('**/node_modules', {
15
- withFileTypes: false,
16
- cwd: process.cwd(),
17
- ignore: globalIgnore
9
+ console.log("cleaning node_modules in", process.cwd());
10
+ const g3 = new glob.Glob("**/node_modules", {
11
+ withFileTypes: false,
12
+ cwd: process.cwd(),
13
+ ignore: globalIgnore
18
14
  });
19
15
  delStream(g3);
@@ -0,0 +1,28 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import {
3
+ require_utils
4
+ } from "./chunk-OKYLF2MU.mjs";
5
+ import {
6
+ init_esm_shims
7
+ } from "./chunk-VXZQNLPU.mjs";
8
+ import {
9
+ __require
10
+ } from "./chunk-FB6YIQYR.mjs";
11
+
12
+ // src/del-node-modules.js
13
+ init_esm_shims();
14
+ var glob = __require("glob");
15
+ var { delStream } = require_utils();
16
+ var globalIgnore = [
17
+ // ignore .git .github folder
18
+ "**/.git*",
19
+ // ignore composer folder
20
+ "**/vendor/**"
21
+ ];
22
+ console.log("cleaning node_modules in", process.cwd());
23
+ var g3 = new glob.Glob("**/node_modules", {
24
+ withFileTypes: false,
25
+ cwd: process.cwd(),
26
+ ignore: globalIgnore
27
+ });
28
+ delStream(g3);