@visulima/task-runner 1.0.0-alpha.1 → 1.0.0-alpha.10

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 (140) hide show
  1. package/CHANGELOG.md +201 -0
  2. package/README.md +196 -52
  3. package/dist/index.d.ts +3166 -34
  4. package/dist/index.js +1 -20
  5. package/dist/packem_chunks/index.js +11 -0
  6. package/dist/packem_shared/Cache-C540ZPYk.js +2 -0
  7. package/dist/packem_shared/CompositeLifeCycle-D0zWvAXJ.js +1 -0
  8. package/dist/packem_shared/FileAccessTracker-DSNf03JW.js +47 -0
  9. package/dist/packem_shared/FingerprintManager-CYW2EwLc.js +2 -0
  10. package/dist/packem_shared/HttpRemoteCache-Ch-_9ejF.js +1 -0
  11. package/dist/packem_shared/INPUT_URI_SCHEMES-Csrd0tlg.js +1 -0
  12. package/dist/packem_shared/IncrementalFileHasher-jtLxMBKy.js +1 -0
  13. package/dist/packem_shared/LogReporter-BUPWiXAq.js +13 -0
  14. package/dist/packem_shared/ReapiRemoteCache-B3uQuVqP.js +251 -0
  15. package/dist/packem_shared/TaskOrchestrator-BgfOpjuB.js +2 -0
  16. package/dist/packem_shared/TerminalBuffer-BtZy7TpT.js +3 -0
  17. package/dist/packem_shared/TrackedTaskExecutor-D3-LNT_d.js +2 -0
  18. package/dist/packem_shared/V2_ROOT-injxWBrl.js +1 -0
  19. package/dist/packem_shared/actionDigestForTaskHash-BOL4fZ9v.js +1 -0
  20. package/dist/packem_shared/archive-CDfGy5Lm.js +1 -0
  21. package/dist/packem_shared/buildForwardDependencyMap-w1FVPFdv.js +3 -0
  22. package/dist/packem_shared/collectFiles-W4bnBRpb.js +1 -0
  23. package/dist/packem_shared/computeTaskHash-C2Iua2DL.js +1 -0
  24. package/dist/packem_shared/containsBlob-DBWgvkM_.js +1 -0
  25. package/dist/packem_shared/createInputHandler-CkDCpPYy.js +1 -0
  26. package/dist/packem_shared/createTaskGraph-CEYYI-DL.js +1 -0
  27. package/dist/packem_shared/defaultTaskRunner-CGbD4ahu.js +2 -0
  28. package/dist/packem_shared/detectFrameworks-WVZJOPgN.js +1 -0
  29. package/dist/packem_shared/detectScriptShell-CaTDk5cW.js +1 -0
  30. package/dist/packem_shared/digestBuffer-g11aCaDx.js +1 -0
  31. package/dist/packem_shared/enforceProjectConstraints-X49n3bVL.js +1 -0
  32. package/dist/packem_shared/expandArguments-4mab7-Ds.js +1 -0
  33. package/dist/packem_shared/expandShortcut-BErNHNXZ.js +1 -0
  34. package/dist/packem_shared/expandTokensInString-Cyx0qSFA.js +1 -0
  35. package/dist/packem_shared/expandWildcard-DE0dOOZF.js +1 -0
  36. package/dist/packem_shared/extractPackageName-BeL6Gc3a.js +1 -0
  37. package/dist/packem_shared/findCycle-BY8-jmzB.js +1 -0
  38. package/dist/packem_shared/formatTimingTable-CP3rsDwf.js +7 -0
  39. package/dist/packem_shared/generateRunSummary-ep21OCUT.js +1 -0
  40. package/dist/packem_shared/getCurrentBranch-D-qoZByx.js +1 -0
  41. package/dist/packem_shared/getMainWorktreeRoot-DRN_i8jA.js +1 -0
  42. package/dist/packem_shared/isNativeAvailable-BOavFPX1.js +1 -0
  43. package/dist/packem_shared/parseCommands-b1K2vIxj.js +1 -0
  44. package/dist/packem_shared/parsePartition-uzPNgtPp.js +1 -0
  45. package/dist/packem_shared/projectGraphToDot-K5A_CRoW.js +250 -0
  46. package/dist/packem_shared/resolveCacheMode-XhD7mg7G.js +1 -0
  47. package/dist/packem_shared/resolveOutputs-BBjdaraf.js +1 -0
  48. package/dist/packem_shared/runConcurrentFallback-CShJ7HUp.js +3 -0
  49. package/dist/packem_shared/runConcurrently-B471CUHO.js +1 -0
  50. package/dist/packem_shared/runTeardown-DBBpBAyb.js +1 -0
  51. package/dist/packem_shared/shell-quote-CksLqyXK.js +1 -0
  52. package/dist/packem_shared/stripQuotes-jkZb0CL9.js +1 -0
  53. package/dist/packem_shared/toChromeTrace-DxN5NQIU.js +1 -0
  54. package/dist/packem_shared/utils-BH2W5Wml.js +1 -0
  55. package/dist/packem_shared/withRestart-CWO6BKv_.js +1 -0
  56. package/index.js +775 -0
  57. package/package.json +30 -18
  58. package/binding.js +0 -204
  59. package/dist/affected.d.ts +0 -48
  60. package/dist/cache.d.ts +0 -103
  61. package/dist/default-task-runner.d.ts +0 -44
  62. package/dist/file-access-tracker.d.ts +0 -53
  63. package/dist/fingerprint.d.ts +0 -45
  64. package/dist/framework-inference.d.ts +0 -35
  65. package/dist/graph-visualizer.d.ts +0 -74
  66. package/dist/incremental-hasher.d.ts +0 -58
  67. package/dist/life-cycle.d.ts +0 -36
  68. package/dist/lockfile-hasher.d.ts +0 -73
  69. package/dist/native-binding.d.ts +0 -64
  70. package/dist/packem_shared/Cache-IYpTYVUC.js +0 -298
  71. package/dist/packem_shared/CompositeLifeCycle-7AtYw1dv.js +0 -112
  72. package/dist/packem_shared/FileAccessTracker-CrtBAt5D.js +0 -239
  73. package/dist/packem_shared/FingerprintManager-D6Y0erg-.js +0 -227
  74. package/dist/packem_shared/IncrementalFileHasher-Ds3J6dgb.js +0 -151
  75. package/dist/packem_shared/RemoteCache-BDqrnDEi.js +0 -179
  76. package/dist/packem_shared/TaskOrchestrator-BvYs3ONw.js +0 -342
  77. package/dist/packem_shared/TaskScheduler-CJilHDta.js +0 -111
  78. package/dist/packem_shared/TrackedTaskExecutor-BGUKFE-7.js +0 -164
  79. package/dist/packem_shared/collectFiles-ClXHnHhg.js +0 -22
  80. package/dist/packem_shared/computeTaskHash-BoCnnvIJ.js +0 -356
  81. package/dist/packem_shared/createTaskGraph-CcsFaSrz.js +0 -164
  82. package/dist/packem_shared/defaultTaskRunner-CrW4v5Ye.js +0 -79
  83. package/dist/packem_shared/detectFrameworks-CeFzKE6J.js +0 -101
  84. package/dist/packem_shared/extractPackageName-CbVNW-dr.js +0 -189
  85. package/dist/packem_shared/filterAffectedTasks-I-18zPg6.js +0 -135
  86. package/dist/packem_shared/findCycle-DF4_BRdO.js +0 -212
  87. package/dist/packem_shared/generateRunSummary-qn-_jKwt.js +0 -134
  88. package/dist/packem_shared/isNativeAvailable-BWhnZ4ES.js +0 -19
  89. package/dist/packem_shared/projectGraphToDot-VdTjHcVp.js +0 -202
  90. package/dist/packem_shared/utils-zO0ZRgtf.js +0 -390
  91. package/dist/remote-cache.d.ts +0 -55
  92. package/dist/run-summary.d.ts +0 -89
  93. package/dist/task-graph-utils.d.ts +0 -39
  94. package/dist/task-graph.d.ts +0 -22
  95. package/dist/task-hasher.d.ts +0 -67
  96. package/dist/task-orchestrator.d.ts +0 -38
  97. package/dist/task-scheduler.d.ts +0 -18
  98. package/dist/tracked-executor.d.ts +0 -46
  99. package/dist/types.d.ts +0 -385
  100. package/dist/utils.d.ts +0 -39
  101. package/npm/darwin-arm64/LICENSE.md +0 -21
  102. package/npm/darwin-arm64/node_modules/.bin/semantic-release +0 -21
  103. package/npm/darwin-arm64/package.json +0 -39
  104. package/npm/darwin-arm64/task-runner-native.darwin-arm64.node +0 -0
  105. package/npm/darwin-x64/LICENSE.md +0 -21
  106. package/npm/darwin-x64/node_modules/.bin/semantic-release +0 -21
  107. package/npm/darwin-x64/package.json +0 -39
  108. package/npm/darwin-x64/task-runner-native.darwin-x64.node +0 -0
  109. package/npm/linux-arm64-gnu/LICENSE.md +0 -21
  110. package/npm/linux-arm64-gnu/node_modules/.bin/semantic-release +0 -21
  111. package/npm/linux-arm64-gnu/package.json +0 -42
  112. package/npm/linux-arm64-gnu/task-runner-native.linux-arm64-gnu.node +0 -0
  113. package/npm/linux-arm64-musl/LICENSE.md +0 -21
  114. package/npm/linux-arm64-musl/node_modules/.bin/semantic-release +0 -21
  115. package/npm/linux-arm64-musl/package.json +0 -42
  116. package/npm/linux-arm64-musl/task-runner-native.linux-arm64-musl.node +0 -0
  117. package/npm/linux-x64-gnu/LICENSE.md +0 -21
  118. package/npm/linux-x64-gnu/node_modules/.bin/semantic-release +0 -21
  119. package/npm/linux-x64-gnu/package.json +0 -42
  120. package/npm/linux-x64-gnu/task-runner-native.linux-x64-gnu.node +0 -0
  121. package/npm/linux-x64-musl/LICENSE.md +0 -21
  122. package/npm/linux-x64-musl/node_modules/.bin/semantic-release +0 -21
  123. package/npm/linux-x64-musl/package.json +0 -42
  124. package/npm/linux-x64-musl/task-runner-native.linux-x64-musl.node +0 -0
  125. package/npm/win32-arm64-msvc/LICENSE.md +0 -21
  126. package/npm/win32-arm64-msvc/node_modules/.bin/semantic-release +0 -21
  127. package/npm/win32-arm64-msvc/package.json +0 -39
  128. package/npm/win32-arm64-msvc/task-runner-native.win32-arm64-msvc.node +0 -0
  129. package/npm/win32-x64-msvc/LICENSE.md +0 -21
  130. package/npm/win32-x64-msvc/node_modules/.bin/semantic-release +0 -21
  131. package/npm/win32-x64-msvc/package.json +0 -39
  132. package/npm/win32-x64-msvc/task-runner-native.win32-x64-msvc.node +0 -0
  133. package/task-runner-native.darwin-arm64.node +0 -0
  134. package/task-runner-native.darwin-x64.node +0 -0
  135. package/task-runner-native.linux-arm64-gnu.node +0 -0
  136. package/task-runner-native.linux-arm64-musl.node +0 -0
  137. package/task-runner-native.linux-x64-gnu.node +0 -0
  138. package/task-runner-native.linux-x64-musl.node +0 -0
  139. package/task-runner-native.win32-arm64-msvc.node +0 -0
  140. package/task-runner-native.win32-x64-msvc.node +0 -0
package/index.js ADDED
@@ -0,0 +1,775 @@
1
+ // prettier-ignore
2
+ /* eslint-disable */
3
+ // @ts-nocheck
4
+ /* auto-generated by NAPI-RS */
5
+
6
+ import { createRequire } from 'node:module'
7
+ const require = createRequire(import.meta.url);
8
+ const __dirname = new URL(".", import.meta.url).pathname;
9
+
10
+ const { readFileSync } = require("node:fs");
11
+ let nativeBinding = null;
12
+ const loadErrors = [];
13
+
14
+ const isMusl = () => {
15
+ let musl = false;
16
+ if (process.platform === "linux") {
17
+ musl = isMuslFromFilesystem();
18
+ if (musl === null) {
19
+ musl = isMuslFromReport();
20
+ }
21
+ if (musl === null) {
22
+ musl = isMuslFromChildProcess();
23
+ }
24
+ }
25
+ return musl;
26
+ };
27
+
28
+ const isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
29
+
30
+ const isMuslFromFilesystem = () => {
31
+ try {
32
+ return readFileSync("/usr/bin/ldd", "utf-8").includes("musl");
33
+ } catch {
34
+ return null;
35
+ }
36
+ };
37
+
38
+ const isMuslFromReport = () => {
39
+ let report = null;
40
+ if (typeof process.report?.getReport === "function") {
41
+ process.report.excludeNetwork = true;
42
+ report = process.report.getReport();
43
+ }
44
+ if (!report) {
45
+ return null;
46
+ }
47
+ if (report.header && report.header.glibcVersionRuntime) {
48
+ return false;
49
+ }
50
+ if (Array.isArray(report.sharedObjects)) {
51
+ if (report.sharedObjects.some(isFileMusl)) {
52
+ return true;
53
+ }
54
+ }
55
+ return false;
56
+ };
57
+
58
+ const isMuslFromChildProcess = () => {
59
+ try {
60
+ return require("child_process").execSync("ldd --version", { encoding: "utf8" }).includes("musl");
61
+ } catch (e) {
62
+ // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
63
+ return false;
64
+ }
65
+ };
66
+
67
+ function requireNative() {
68
+ if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
69
+ try {
70
+ return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
71
+ } catch (err) {
72
+ loadErrors.push(err);
73
+ }
74
+ } else if (process.platform === "android") {
75
+ if (process.arch === "arm64") {
76
+ try {
77
+ return require("./task-runner-native.android-arm64.node");
78
+ } catch (e) {
79
+ loadErrors.push(e);
80
+ }
81
+ try {
82
+ const binding = require("@visulima/task-runner-binding-android-arm64");
83
+ const bindingPackageVersion = require("@visulima/task-runner-binding-android-arm64/package.json").version;
84
+ if (
85
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
86
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
87
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
88
+ ) {
89
+ throw new Error(
90
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
91
+ );
92
+ }
93
+ return binding;
94
+ } catch (e) {
95
+ loadErrors.push(e);
96
+ }
97
+ } else if (process.arch === "arm") {
98
+ try {
99
+ return require("./task-runner-native.android-arm-eabi.node");
100
+ } catch (e) {
101
+ loadErrors.push(e);
102
+ }
103
+ try {
104
+ const binding = require("@visulima/task-runner-binding-android-arm-eabi");
105
+ const bindingPackageVersion = require("@visulima/task-runner-binding-android-arm-eabi/package.json").version;
106
+ if (
107
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
108
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
109
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
110
+ ) {
111
+ throw new Error(
112
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
113
+ );
114
+ }
115
+ return binding;
116
+ } catch (e) {
117
+ loadErrors.push(e);
118
+ }
119
+ } else {
120
+ loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`));
121
+ }
122
+ } else if (process.platform === "win32") {
123
+ if (process.arch === "x64") {
124
+ if (process.config?.variables?.shlib_suffix === "dll.a" || process.config?.variables?.node_target_type === "shared_library") {
125
+ try {
126
+ return require("./task-runner-native.win32-x64-gnu.node");
127
+ } catch (e) {
128
+ loadErrors.push(e);
129
+ }
130
+ try {
131
+ const binding = require("@visulima/task-runner-binding-win32-x64-gnu");
132
+ const bindingPackageVersion = require("@visulima/task-runner-binding-win32-x64-gnu/package.json").version;
133
+ if (
134
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
135
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
136
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
137
+ ) {
138
+ throw new Error(
139
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
140
+ );
141
+ }
142
+ return binding;
143
+ } catch (e) {
144
+ loadErrors.push(e);
145
+ }
146
+ } else {
147
+ try {
148
+ return require("./task-runner-native.win32-x64-msvc.node");
149
+ } catch (e) {
150
+ loadErrors.push(e);
151
+ }
152
+ try {
153
+ const binding = require("@visulima/task-runner-binding-win32-x64-msvc");
154
+ const bindingPackageVersion = require("@visulima/task-runner-binding-win32-x64-msvc/package.json").version;
155
+ if (
156
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
157
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
158
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
159
+ ) {
160
+ throw new Error(
161
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
162
+ );
163
+ }
164
+ return binding;
165
+ } catch (e) {
166
+ loadErrors.push(e);
167
+ }
168
+ }
169
+ } else if (process.arch === "ia32") {
170
+ try {
171
+ return require("./task-runner-native.win32-ia32-msvc.node");
172
+ } catch (e) {
173
+ loadErrors.push(e);
174
+ }
175
+ try {
176
+ const binding = require("@visulima/task-runner-binding-win32-ia32-msvc");
177
+ const bindingPackageVersion = require("@visulima/task-runner-binding-win32-ia32-msvc/package.json").version;
178
+ if (
179
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
180
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
181
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
182
+ ) {
183
+ throw new Error(
184
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
185
+ );
186
+ }
187
+ return binding;
188
+ } catch (e) {
189
+ loadErrors.push(e);
190
+ }
191
+ } else if (process.arch === "arm64") {
192
+ try {
193
+ return require("./task-runner-native.win32-arm64-msvc.node");
194
+ } catch (e) {
195
+ loadErrors.push(e);
196
+ }
197
+ try {
198
+ const binding = require("@visulima/task-runner-binding-win32-arm64-msvc");
199
+ const bindingPackageVersion = require("@visulima/task-runner-binding-win32-arm64-msvc/package.json").version;
200
+ if (
201
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
202
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
203
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
204
+ ) {
205
+ throw new Error(
206
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
207
+ );
208
+ }
209
+ return binding;
210
+ } catch (e) {
211
+ loadErrors.push(e);
212
+ }
213
+ } else {
214
+ loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));
215
+ }
216
+ } else if (process.platform === "darwin") {
217
+ try {
218
+ return require("./task-runner-native.darwin-universal.node");
219
+ } catch (e) {
220
+ loadErrors.push(e);
221
+ }
222
+ try {
223
+ const binding = require("@visulima/task-runner-binding-darwin-universal");
224
+ const bindingPackageVersion = require("@visulima/task-runner-binding-darwin-universal/package.json").version;
225
+ if (bindingPackageVersion !== "1.0.0-alpha.8" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
226
+ throw new Error(
227
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
228
+ );
229
+ }
230
+ return binding;
231
+ } catch (e) {
232
+ loadErrors.push(e);
233
+ }
234
+ if (process.arch === "x64") {
235
+ try {
236
+ return require("./task-runner-native.darwin-x64.node");
237
+ } catch (e) {
238
+ loadErrors.push(e);
239
+ }
240
+ try {
241
+ const binding = require("@visulima/task-runner-binding-darwin-x64");
242
+ const bindingPackageVersion = require("@visulima/task-runner-binding-darwin-x64/package.json").version;
243
+ if (
244
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
245
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
246
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
247
+ ) {
248
+ throw new Error(
249
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
250
+ );
251
+ }
252
+ return binding;
253
+ } catch (e) {
254
+ loadErrors.push(e);
255
+ }
256
+ } else if (process.arch === "arm64") {
257
+ try {
258
+ return require("./task-runner-native.darwin-arm64.node");
259
+ } catch (e) {
260
+ loadErrors.push(e);
261
+ }
262
+ try {
263
+ const binding = require("@visulima/task-runner-binding-darwin-arm64");
264
+ const bindingPackageVersion = require("@visulima/task-runner-binding-darwin-arm64/package.json").version;
265
+ if (
266
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
267
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
268
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
269
+ ) {
270
+ throw new Error(
271
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
272
+ );
273
+ }
274
+ return binding;
275
+ } catch (e) {
276
+ loadErrors.push(e);
277
+ }
278
+ } else {
279
+ loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`));
280
+ }
281
+ } else if (process.platform === "freebsd") {
282
+ if (process.arch === "x64") {
283
+ try {
284
+ return require("./task-runner-native.freebsd-x64.node");
285
+ } catch (e) {
286
+ loadErrors.push(e);
287
+ }
288
+ try {
289
+ const binding = require("@visulima/task-runner-binding-freebsd-x64");
290
+ const bindingPackageVersion = require("@visulima/task-runner-binding-freebsd-x64/package.json").version;
291
+ if (
292
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
293
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
294
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
295
+ ) {
296
+ throw new Error(
297
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
298
+ );
299
+ }
300
+ return binding;
301
+ } catch (e) {
302
+ loadErrors.push(e);
303
+ }
304
+ } else if (process.arch === "arm64") {
305
+ try {
306
+ return require("./task-runner-native.freebsd-arm64.node");
307
+ } catch (e) {
308
+ loadErrors.push(e);
309
+ }
310
+ try {
311
+ const binding = require("@visulima/task-runner-binding-freebsd-arm64");
312
+ const bindingPackageVersion = require("@visulima/task-runner-binding-freebsd-arm64/package.json").version;
313
+ if (
314
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
315
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
316
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
317
+ ) {
318
+ throw new Error(
319
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
320
+ );
321
+ }
322
+ return binding;
323
+ } catch (e) {
324
+ loadErrors.push(e);
325
+ }
326
+ } else {
327
+ loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
328
+ }
329
+ } else if (process.platform === "linux") {
330
+ if (process.arch === "x64") {
331
+ if (isMusl()) {
332
+ try {
333
+ return require("./task-runner-native.linux-x64-musl.node");
334
+ } catch (e) {
335
+ loadErrors.push(e);
336
+ }
337
+ try {
338
+ const binding = require("@visulima/task-runner-binding-linux-x64-musl");
339
+ const bindingPackageVersion = require("@visulima/task-runner-binding-linux-x64-musl/package.json").version;
340
+ if (
341
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
342
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
343
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
344
+ ) {
345
+ throw new Error(
346
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
347
+ );
348
+ }
349
+ return binding;
350
+ } catch (e) {
351
+ loadErrors.push(e);
352
+ }
353
+ } else {
354
+ try {
355
+ return require("./task-runner-native.linux-x64-gnu.node");
356
+ } catch (e) {
357
+ loadErrors.push(e);
358
+ }
359
+ try {
360
+ const binding = require("@visulima/task-runner-binding-linux-x64-gnu");
361
+ const bindingPackageVersion = require("@visulima/task-runner-binding-linux-x64-gnu/package.json").version;
362
+ if (
363
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
364
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
365
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
366
+ ) {
367
+ throw new Error(
368
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
369
+ );
370
+ }
371
+ return binding;
372
+ } catch (e) {
373
+ loadErrors.push(e);
374
+ }
375
+ }
376
+ } else if (process.arch === "arm64") {
377
+ if (isMusl()) {
378
+ try {
379
+ return require("./task-runner-native.linux-arm64-musl.node");
380
+ } catch (e) {
381
+ loadErrors.push(e);
382
+ }
383
+ try {
384
+ const binding = require("@visulima/task-runner-binding-linux-arm64-musl");
385
+ const bindingPackageVersion = require("@visulima/task-runner-binding-linux-arm64-musl/package.json").version;
386
+ if (
387
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
388
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
389
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
390
+ ) {
391
+ throw new Error(
392
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
393
+ );
394
+ }
395
+ return binding;
396
+ } catch (e) {
397
+ loadErrors.push(e);
398
+ }
399
+ } else {
400
+ try {
401
+ return require("./task-runner-native.linux-arm64-gnu.node");
402
+ } catch (e) {
403
+ loadErrors.push(e);
404
+ }
405
+ try {
406
+ const binding = require("@visulima/task-runner-binding-linux-arm64-gnu");
407
+ const bindingPackageVersion = require("@visulima/task-runner-binding-linux-arm64-gnu/package.json").version;
408
+ if (
409
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
410
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
411
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
412
+ ) {
413
+ throw new Error(
414
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
415
+ );
416
+ }
417
+ return binding;
418
+ } catch (e) {
419
+ loadErrors.push(e);
420
+ }
421
+ }
422
+ } else if (process.arch === "arm") {
423
+ if (isMusl()) {
424
+ try {
425
+ return require("./task-runner-native.linux-arm-musleabihf.node");
426
+ } catch (e) {
427
+ loadErrors.push(e);
428
+ }
429
+ try {
430
+ const binding = require("@visulima/task-runner-binding-linux-arm-musleabihf");
431
+ const bindingPackageVersion = require("@visulima/task-runner-binding-linux-arm-musleabihf/package.json").version;
432
+ if (
433
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
434
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
435
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
436
+ ) {
437
+ throw new Error(
438
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
439
+ );
440
+ }
441
+ return binding;
442
+ } catch (e) {
443
+ loadErrors.push(e);
444
+ }
445
+ } else {
446
+ try {
447
+ return require("./task-runner-native.linux-arm-gnueabihf.node");
448
+ } catch (e) {
449
+ loadErrors.push(e);
450
+ }
451
+ try {
452
+ const binding = require("@visulima/task-runner-binding-linux-arm-gnueabihf");
453
+ const bindingPackageVersion = require("@visulima/task-runner-binding-linux-arm-gnueabihf/package.json").version;
454
+ if (
455
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
456
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
457
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
458
+ ) {
459
+ throw new Error(
460
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
461
+ );
462
+ }
463
+ return binding;
464
+ } catch (e) {
465
+ loadErrors.push(e);
466
+ }
467
+ }
468
+ } else if (process.arch === "loong64") {
469
+ if (isMusl()) {
470
+ try {
471
+ return require("./task-runner-native.linux-loong64-musl.node");
472
+ } catch (e) {
473
+ loadErrors.push(e);
474
+ }
475
+ try {
476
+ const binding = require("@visulima/task-runner-binding-linux-loong64-musl");
477
+ const bindingPackageVersion = require("@visulima/task-runner-binding-linux-loong64-musl/package.json").version;
478
+ if (
479
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
480
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
481
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
482
+ ) {
483
+ throw new Error(
484
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
485
+ );
486
+ }
487
+ return binding;
488
+ } catch (e) {
489
+ loadErrors.push(e);
490
+ }
491
+ } else {
492
+ try {
493
+ return require("./task-runner-native.linux-loong64-gnu.node");
494
+ } catch (e) {
495
+ loadErrors.push(e);
496
+ }
497
+ try {
498
+ const binding = require("@visulima/task-runner-binding-linux-loong64-gnu");
499
+ const bindingPackageVersion = require("@visulima/task-runner-binding-linux-loong64-gnu/package.json").version;
500
+ if (
501
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
502
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
503
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
504
+ ) {
505
+ throw new Error(
506
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
507
+ );
508
+ }
509
+ return binding;
510
+ } catch (e) {
511
+ loadErrors.push(e);
512
+ }
513
+ }
514
+ } else if (process.arch === "riscv64") {
515
+ if (isMusl()) {
516
+ try {
517
+ return require("./task-runner-native.linux-riscv64-musl.node");
518
+ } catch (e) {
519
+ loadErrors.push(e);
520
+ }
521
+ try {
522
+ const binding = require("@visulima/task-runner-binding-linux-riscv64-musl");
523
+ const bindingPackageVersion = require("@visulima/task-runner-binding-linux-riscv64-musl/package.json").version;
524
+ if (
525
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
526
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
527
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
528
+ ) {
529
+ throw new Error(
530
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
531
+ );
532
+ }
533
+ return binding;
534
+ } catch (e) {
535
+ loadErrors.push(e);
536
+ }
537
+ } else {
538
+ try {
539
+ return require("./task-runner-native.linux-riscv64-gnu.node");
540
+ } catch (e) {
541
+ loadErrors.push(e);
542
+ }
543
+ try {
544
+ const binding = require("@visulima/task-runner-binding-linux-riscv64-gnu");
545
+ const bindingPackageVersion = require("@visulima/task-runner-binding-linux-riscv64-gnu/package.json").version;
546
+ if (
547
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
548
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
549
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
550
+ ) {
551
+ throw new Error(
552
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
553
+ );
554
+ }
555
+ return binding;
556
+ } catch (e) {
557
+ loadErrors.push(e);
558
+ }
559
+ }
560
+ } else if (process.arch === "ppc64") {
561
+ try {
562
+ return require("./task-runner-native.linux-ppc64-gnu.node");
563
+ } catch (e) {
564
+ loadErrors.push(e);
565
+ }
566
+ try {
567
+ const binding = require("@visulima/task-runner-binding-linux-ppc64-gnu");
568
+ const bindingPackageVersion = require("@visulima/task-runner-binding-linux-ppc64-gnu/package.json").version;
569
+ if (
570
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
571
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
572
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
573
+ ) {
574
+ throw new Error(
575
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
576
+ );
577
+ }
578
+ return binding;
579
+ } catch (e) {
580
+ loadErrors.push(e);
581
+ }
582
+ } else if (process.arch === "s390x") {
583
+ try {
584
+ return require("./task-runner-native.linux-s390x-gnu.node");
585
+ } catch (e) {
586
+ loadErrors.push(e);
587
+ }
588
+ try {
589
+ const binding = require("@visulima/task-runner-binding-linux-s390x-gnu");
590
+ const bindingPackageVersion = require("@visulima/task-runner-binding-linux-s390x-gnu/package.json").version;
591
+ if (
592
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
593
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
594
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
595
+ ) {
596
+ throw new Error(
597
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
598
+ );
599
+ }
600
+ return binding;
601
+ } catch (e) {
602
+ loadErrors.push(e);
603
+ }
604
+ } else {
605
+ loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));
606
+ }
607
+ } else if (process.platform === "openharmony") {
608
+ if (process.arch === "arm64") {
609
+ try {
610
+ return require("./task-runner-native.openharmony-arm64.node");
611
+ } catch (e) {
612
+ loadErrors.push(e);
613
+ }
614
+ try {
615
+ const binding = require("@visulima/task-runner-binding-openharmony-arm64");
616
+ const bindingPackageVersion = require("@visulima/task-runner-binding-openharmony-arm64/package.json").version;
617
+ if (
618
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
619
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
620
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
621
+ ) {
622
+ throw new Error(
623
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
624
+ );
625
+ }
626
+ return binding;
627
+ } catch (e) {
628
+ loadErrors.push(e);
629
+ }
630
+ } else if (process.arch === "x64") {
631
+ try {
632
+ return require("./task-runner-native.openharmony-x64.node");
633
+ } catch (e) {
634
+ loadErrors.push(e);
635
+ }
636
+ try {
637
+ const binding = require("@visulima/task-runner-binding-openharmony-x64");
638
+ const bindingPackageVersion = require("@visulima/task-runner-binding-openharmony-x64/package.json").version;
639
+ if (
640
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
641
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
642
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
643
+ ) {
644
+ throw new Error(
645
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
646
+ );
647
+ }
648
+ return binding;
649
+ } catch (e) {
650
+ loadErrors.push(e);
651
+ }
652
+ } else if (process.arch === "arm") {
653
+ try {
654
+ return require("./task-runner-native.openharmony-arm.node");
655
+ } catch (e) {
656
+ loadErrors.push(e);
657
+ }
658
+ try {
659
+ const binding = require("@visulima/task-runner-binding-openharmony-arm");
660
+ const bindingPackageVersion = require("@visulima/task-runner-binding-openharmony-arm/package.json").version;
661
+ if (
662
+ bindingPackageVersion !== "1.0.0-alpha.8" &&
663
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
664
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
665
+ ) {
666
+ throw new Error(
667
+ `Native binding package version mismatch, expected 1.0.0-alpha.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
668
+ );
669
+ }
670
+ return binding;
671
+ } catch (e) {
672
+ loadErrors.push(e);
673
+ }
674
+ } else {
675
+ loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
676
+ }
677
+ } else {
678
+ loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
679
+ }
680
+ }
681
+
682
+ nativeBinding = requireNative();
683
+
684
+ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
685
+ let wasiBinding = null;
686
+ let wasiBindingError = null;
687
+ try {
688
+ wasiBinding = require("./task-runner-native.wasi.cjs");
689
+ nativeBinding = wasiBinding;
690
+ } catch (err) {
691
+ if (process.env.NAPI_RS_FORCE_WASI) {
692
+ wasiBindingError = err;
693
+ }
694
+ }
695
+ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
696
+ try {
697
+ wasiBinding = require("@visulima/task-runner-binding-wasm32-wasi");
698
+ nativeBinding = wasiBinding;
699
+ } catch (err) {
700
+ if (process.env.NAPI_RS_FORCE_WASI) {
701
+ if (!wasiBindingError) {
702
+ wasiBindingError = err;
703
+ } else {
704
+ wasiBindingError.cause = err;
705
+ }
706
+ loadErrors.push(err);
707
+ }
708
+ }
709
+ }
710
+ if (process.env.NAPI_RS_FORCE_WASI === "error" && !wasiBinding) {
711
+ const error = new Error("WASI binding not found and NAPI_RS_FORCE_WASI is set to error");
712
+ error.cause = wasiBindingError;
713
+ throw error;
714
+ }
715
+ }
716
+
717
+ if (!nativeBinding) {
718
+ if (loadErrors.length > 0) {
719
+ throw new Error(
720
+ `Cannot find native binding. ` +
721
+ `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
722
+ "Please try `npm i` again after removing both package-lock.json and node_modules directory.",
723
+ {
724
+ cause: loadErrors.reduce((err, cur) => {
725
+ cur.cause = err;
726
+ return cur;
727
+ }),
728
+ },
729
+ );
730
+ }
731
+ throw new Error(`Failed to load native binding`);
732
+ }
733
+
734
+ const {
735
+ collectFiles,
736
+ computeTaskHash,
737
+ findAllCycles,
738
+ findBackEdges,
739
+ findCycle,
740
+ getDependentTasks,
741
+ getMainWorktreeRoot,
742
+ getTransitiveDeps,
743
+ hashCommand,
744
+ hashEnvVar,
745
+ hashFile,
746
+ hashFilesBatch,
747
+ hashFilesInDirectory,
748
+ hashString,
749
+ hashStrings,
750
+ isLinkedWorktree,
751
+ resetWorktreeCache,
752
+ runConcurrent,
753
+ runConcurrentBatch,
754
+ topologicalSort,
755
+ } = nativeBinding;
756
+ export { collectFiles };
757
+ export { computeTaskHash };
758
+ export { findAllCycles };
759
+ export { findBackEdges };
760
+ export { findCycle };
761
+ export { getDependentTasks };
762
+ export { getMainWorktreeRoot };
763
+ export { getTransitiveDeps };
764
+ export { hashCommand };
765
+ export { hashEnvVar };
766
+ export { hashFile };
767
+ export { hashFilesBatch };
768
+ export { hashFilesInDirectory };
769
+ export { hashString };
770
+ export { hashStrings };
771
+ export { isLinkedWorktree };
772
+ export { resetWorktreeCache };
773
+ export { runConcurrent };
774
+ export { runConcurrentBatch };
775
+ export { topologicalSort };