@visulima/vis 1.0.0-alpha.11 → 1.0.0-alpha.13

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 (116) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/LICENSE.md +559 -186
  3. package/README.md +18 -0
  4. package/dist/bin.js +1 -9
  5. package/dist/config/index.d.ts +477 -556
  6. package/dist/config/index.js +1 -2
  7. package/dist/generate/index.js +1 -3
  8. package/dist/packem_chunks/applyDefaults.js +2 -336
  9. package/dist/packem_chunks/bin.js +234 -9552
  10. package/dist/packem_chunks/doctor-probe.js +2 -112
  11. package/dist/packem_chunks/fix.js +11 -234
  12. package/dist/packem_chunks/handler.js +1 -99
  13. package/dist/packem_chunks/handler10.js +2 -53
  14. package/dist/packem_chunks/handler11.js +1 -32
  15. package/dist/packem_chunks/handler12.js +5 -100
  16. package/dist/packem_chunks/handler13.js +1 -25
  17. package/dist/packem_chunks/handler14.js +18 -916
  18. package/dist/packem_chunks/handler15.js +15 -201
  19. package/dist/packem_chunks/handler16.js +1 -124
  20. package/dist/packem_chunks/handler17.js +1 -13
  21. package/dist/packem_chunks/handler18.js +1 -106
  22. package/dist/packem_chunks/handler19.js +1 -19
  23. package/dist/packem_chunks/handler2.js +2 -75
  24. package/dist/packem_chunks/handler20.js +5 -29
  25. package/dist/packem_chunks/handler21.js +1 -222
  26. package/dist/packem_chunks/handler22.js +1 -237
  27. package/dist/packem_chunks/handler23.js +5 -101
  28. package/dist/packem_chunks/handler24.js +1 -110
  29. package/dist/packem_chunks/handler25.js +3 -402
  30. package/dist/packem_chunks/handler26.js +1 -13
  31. package/dist/packem_chunks/handler27.js +1 -63
  32. package/dist/packem_chunks/handler28.js +7 -34
  33. package/dist/packem_chunks/handler29.js +21 -456
  34. package/dist/packem_chunks/handler3.js +4 -95
  35. package/dist/packem_chunks/handler30.js +3 -170
  36. package/dist/packem_chunks/handler31.js +1 -530
  37. package/dist/packem_chunks/handler32.js +2 -214
  38. package/dist/packem_chunks/handler33.js +25 -119
  39. package/dist/packem_chunks/handler34.js +2 -630
  40. package/dist/packem_chunks/handler35.js +3 -283
  41. package/dist/packem_chunks/handler36.js +22 -542
  42. package/dist/packem_chunks/handler37.js +410 -744
  43. package/dist/packem_chunks/handler38.js +22 -989
  44. package/dist/packem_chunks/handler39.js +22 -574
  45. package/dist/packem_chunks/handler4.js +2 -90
  46. package/dist/packem_chunks/handler40.js +22 -1685
  47. package/dist/packem_chunks/handler41.js +6 -1088
  48. package/dist/packem_chunks/handler42.js +5 -797
  49. package/dist/packem_chunks/handler43.js +10 -2658
  50. package/dist/packem_chunks/handler44.js +51 -3784
  51. package/dist/packem_chunks/handler45.js +25 -2574
  52. package/dist/packem_chunks/handler46.js +3 -3769
  53. package/dist/packem_chunks/handler47.js +21 -1485
  54. package/dist/packem_chunks/handler48.js +42 -0
  55. package/dist/packem_chunks/handler5.js +8 -174
  56. package/dist/packem_chunks/handler6.js +1 -95
  57. package/dist/packem_chunks/handler7.js +1 -115
  58. package/dist/packem_chunks/handler8.js +1 -12
  59. package/dist/packem_chunks/handler9.js +1 -29
  60. package/dist/packem_chunks/heal-accept.js +10 -522
  61. package/dist/packem_chunks/heal.js +14 -673
  62. package/dist/packem_chunks/index.js +7 -873
  63. package/dist/packem_chunks/loader.js +1 -23
  64. package/dist/packem_chunks/tar.js +3 -0
  65. package/dist/packem_shared/ai-analysis-hm8d2W7z.js +67 -0
  66. package/dist/packem_shared/ai-cache-DoiF80AR.js +1 -0
  67. package/dist/packem_shared/ai-fix-nn4zOE95.js +43 -0
  68. package/dist/packem_shared/cache-directory-CwHlJhgx.js +1 -0
  69. package/dist/packem_shared/dependency-scan-COr5n63B.js +2 -0
  70. package/dist/packem_shared/docker-D6OGr5_S.js +2 -0
  71. package/dist/packem_shared/failure-log-iUVLf6ts.js +2 -0
  72. package/dist/packem_shared/flakiness-D9wf0t56.js +1 -0
  73. package/dist/packem_shared/giget-CcEy_Elm.js +2 -0
  74. package/dist/packem_shared/index-DH-5hsrC.js +1 -0
  75. package/dist/packem_shared/otel-DxDUPJJH.js +6 -0
  76. package/dist/packem_shared/otelPlugin-CQq6poq8.js +1 -0
  77. package/dist/packem_shared/registry-CkubDdiY.js +2 -0
  78. package/dist/packem_shared/run-summary-utils-BfBvjzhY.js +1 -0
  79. package/dist/packem_shared/runtime-check-BXZ43CBW.js +1 -0
  80. package/dist/packem_shared/selectors-BylODRiM.js +3 -0
  81. package/dist/packem_shared/symbols-CQmER5MT.js +1 -0
  82. package/dist/packem_shared/toolchain-BgBOUHII.js +5 -0
  83. package/dist/packem_shared/typosquats-CcZl99B1.js +1 -0
  84. package/dist/packem_shared/use-measured-height-DjYgUOKk.js +1 -0
  85. package/dist/packem_shared/utils-DrNg0XTR.js +1 -0
  86. package/dist/packem_shared/verify-Baj5mFJ7.js +1 -0
  87. package/dist/packem_shared/vis-update-app-D1jl0UZZ.js +1 -0
  88. package/dist/packem_shared/xxh3-DrAUNq4n.js +1 -0
  89. package/index.js +556 -727
  90. package/package.json +19 -29
  91. package/schemas/project.schema.json +739 -297
  92. package/schemas/vis-config.schema.json +3365 -384
  93. package/templates/buildkite-ci/template.yml +20 -20
  94. package/dist/packem_shared/VisUpdateApp-D-Yz_wvg.js +0 -1316
  95. package/dist/packem_shared/_commonjsHelpers-BqLXS_qQ.js +0 -5
  96. package/dist/packem_shared/ai-analysis-CHeB1joD.js +0 -367
  97. package/dist/packem_shared/ai-cache-Be_jexe4.js +0 -142
  98. package/dist/packem_shared/ai-fix-B9iQVcD2.js +0 -379
  99. package/dist/packem_shared/cache-directory-2qvs4goY.js +0 -98
  100. package/dist/packem_shared/catalog-BJTtyi-O.js +0 -1371
  101. package/dist/packem_shared/dependency-scan-A0KSklpG.js +0 -188
  102. package/dist/packem_shared/docker-2iZzc280.js +0 -181
  103. package/dist/packem_shared/failure-log-Cz3Z4SKL.js +0 -100
  104. package/dist/packem_shared/flakiness-goTxXuCX.js +0 -180
  105. package/dist/packem_shared/otel-DCvqCTz_.js +0 -158
  106. package/dist/packem_shared/otelPlugin-DFaLDvJf.js +0 -3
  107. package/dist/packem_shared/registry-CbqXI0rc.js +0 -272
  108. package/dist/packem_shared/run-summary-utils-PVMl4aIh.js +0 -130
  109. package/dist/packem_shared/runtime-check-Cobi3p6l.js +0 -127
  110. package/dist/packem_shared/selectors-SM69TfqC.js +0 -194
  111. package/dist/packem_shared/symbols-Ta7g2nU-.js +0 -14
  112. package/dist/packem_shared/toolchain-BdZd9eBi.js +0 -975
  113. package/dist/packem_shared/typosquats-C-bCh3PX.js +0 -1210
  114. package/dist/packem_shared/use-measured-height-CNP0vT4M.js +0 -20
  115. package/dist/packem_shared/utils-CthVdBPS.js +0 -40
  116. package/dist/packem_shared/xxh3-Ck8mXNg1.js +0 -239
package/index.js CHANGED
@@ -4,770 +4,599 @@
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
6
  import { createRequire } from 'node:module'
7
- const require = createRequire(import.meta.url);
8
- const __dirname = new URL(".", import.meta.url).pathname;
7
+ const require = createRequire(import.meta.url)
8
+ const __dirname = new URL('.', import.meta.url).pathname
9
9
 
10
- const { readFileSync } = require("node:fs");
11
- let nativeBinding = null;
12
- const loadErrors = [];
10
+ const { readFileSync } = require('node:fs')
11
+ let nativeBinding = null
12
+ const loadErrors = []
13
13
 
14
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
- }
15
+ let musl = false
16
+ if (process.platform === 'linux') {
17
+ musl = isMuslFromFilesystem()
18
+ if (musl === null) {
19
+ musl = isMuslFromReport()
24
20
  }
25
- return musl;
26
- };
21
+ if (musl === null) {
22
+ musl = isMuslFromChildProcess()
23
+ }
24
+ }
25
+ return musl
26
+ }
27
27
 
28
- const isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
28
+ const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')
29
29
 
30
30
  const isMuslFromFilesystem = () => {
31
- try {
32
- return readFileSync("/usr/bin/ldd", "utf-8").includes("musl");
33
- } catch {
34
- return null;
35
- }
36
- };
31
+ try {
32
+ return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')
33
+ } catch {
34
+ return null
35
+ }
36
+ }
37
37
 
38
38
  const isMuslFromReport = () => {
39
- let report = null;
40
- if (typeof process.report?.getReport === "function") {
41
- process.report.excludeNetwork = true;
42
- report = process.report.getReport();
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
43
53
  }
44
- if (!report) {
45
- return null;
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)
46
73
  }
47
- if (report.header && report.header.glibcVersionRuntime) {
48
- return false;
74
+ } else if (process.platform === 'android') {
75
+ if (process.arch === 'arm64') {
76
+ try {
77
+ return require('./vis-native.android-arm64.node')
78
+ } catch (e) {
79
+ loadErrors.push(e)
80
+ }
81
+ try {
82
+ const binding = require('@visulima/vis-binding-android-arm64')
83
+ const bindingPackageVersion = require('@visulima/vis-binding-android-arm64/package.json').version
84
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
85
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
86
+ }
87
+ return binding
88
+ } catch (e) {
89
+ loadErrors.push(e)
90
+ }
91
+ } else if (process.arch === 'arm') {
92
+ try {
93
+ return require('./vis-native.android-arm-eabi.node')
94
+ } catch (e) {
95
+ loadErrors.push(e)
96
+ }
97
+ try {
98
+ const binding = require('@visulima/vis-binding-android-arm-eabi')
99
+ const bindingPackageVersion = require('@visulima/vis-binding-android-arm-eabi/package.json').version
100
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
101
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
102
+ }
103
+ return binding
104
+ } catch (e) {
105
+ loadErrors.push(e)
106
+ }
107
+ } else {
108
+ loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
49
109
  }
50
- if (Array.isArray(report.sharedObjects)) {
51
- if (report.sharedObjects.some(isFileMusl)) {
52
- return true;
110
+ } else if (process.platform === 'win32') {
111
+ if (process.arch === 'x64') {
112
+ if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') {
113
+ try {
114
+ return require('./vis-native.win32-x64-gnu.node')
115
+ } catch (e) {
116
+ loadErrors.push(e)
117
+ }
118
+ try {
119
+ const binding = require('@visulima/vis-binding-win32-x64-gnu')
120
+ const bindingPackageVersion = require('@visulima/vis-binding-win32-x64-gnu/package.json').version
121
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
122
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
123
+ }
124
+ return binding
125
+ } catch (e) {
126
+ loadErrors.push(e)
127
+ }
128
+ } else {
129
+ try {
130
+ return require('./vis-native.win32-x64-msvc.node')
131
+ } catch (e) {
132
+ loadErrors.push(e)
133
+ }
134
+ try {
135
+ const binding = require('@visulima/vis-binding-win32-x64-msvc')
136
+ const bindingPackageVersion = require('@visulima/vis-binding-win32-x64-msvc/package.json').version
137
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
138
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
53
139
  }
140
+ return binding
141
+ } catch (e) {
142
+ loadErrors.push(e)
143
+ }
144
+ }
145
+ } else if (process.arch === 'ia32') {
146
+ try {
147
+ return require('./vis-native.win32-ia32-msvc.node')
148
+ } catch (e) {
149
+ loadErrors.push(e)
150
+ }
151
+ try {
152
+ const binding = require('@visulima/vis-binding-win32-ia32-msvc')
153
+ const bindingPackageVersion = require('@visulima/vis-binding-win32-ia32-msvc/package.json').version
154
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
155
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
156
+ }
157
+ return binding
158
+ } catch (e) {
159
+ loadErrors.push(e)
160
+ }
161
+ } else if (process.arch === 'arm64') {
162
+ try {
163
+ return require('./vis-native.win32-arm64-msvc.node')
164
+ } catch (e) {
165
+ loadErrors.push(e)
166
+ }
167
+ try {
168
+ const binding = require('@visulima/vis-binding-win32-arm64-msvc')
169
+ const bindingPackageVersion = require('@visulima/vis-binding-win32-arm64-msvc/package.json').version
170
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
171
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
172
+ }
173
+ return binding
174
+ } catch (e) {
175
+ loadErrors.push(e)
176
+ }
177
+ } else {
178
+ loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
54
179
  }
55
- return false;
56
- };
57
-
58
- const isMuslFromChildProcess = () => {
180
+ } else if (process.platform === 'darwin') {
59
181
  try {
60
- return require("child_process").execSync("ldd --version", { encoding: "utf8" }).includes("musl");
182
+ return require('./vis-native.darwin-universal.node')
61
183
  } 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;
184
+ loadErrors.push(e)
64
185
  }
65
- };
66
-
67
- function requireNative() {
68
- if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
186
+ try {
187
+ const binding = require('@visulima/vis-binding-darwin-universal')
188
+ const bindingPackageVersion = require('@visulima/vis-binding-darwin-universal/package.json').version
189
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
190
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
191
+ }
192
+ return binding
193
+ } catch (e) {
194
+ loadErrors.push(e)
195
+ }
196
+ if (process.arch === 'x64') {
197
+ try {
198
+ return require('./vis-native.darwin-x64.node')
199
+ } catch (e) {
200
+ loadErrors.push(e)
201
+ }
202
+ try {
203
+ const binding = require('@visulima/vis-binding-darwin-x64')
204
+ const bindingPackageVersion = require('@visulima/vis-binding-darwin-x64/package.json').version
205
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
206
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
207
+ }
208
+ return binding
209
+ } catch (e) {
210
+ loadErrors.push(e)
211
+ }
212
+ } else if (process.arch === 'arm64') {
213
+ try {
214
+ return require('./vis-native.darwin-arm64.node')
215
+ } catch (e) {
216
+ loadErrors.push(e)
217
+ }
218
+ try {
219
+ const binding = require('@visulima/vis-binding-darwin-arm64')
220
+ const bindingPackageVersion = require('@visulima/vis-binding-darwin-arm64/package.json').version
221
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
222
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
223
+ }
224
+ return binding
225
+ } catch (e) {
226
+ loadErrors.push(e)
227
+ }
228
+ } else {
229
+ loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
230
+ }
231
+ } else if (process.platform === 'freebsd') {
232
+ if (process.arch === 'x64') {
233
+ try {
234
+ return require('./vis-native.freebsd-x64.node')
235
+ } catch (e) {
236
+ loadErrors.push(e)
237
+ }
238
+ try {
239
+ const binding = require('@visulima/vis-binding-freebsd-x64')
240
+ const bindingPackageVersion = require('@visulima/vis-binding-freebsd-x64/package.json').version
241
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
242
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
243
+ }
244
+ return binding
245
+ } catch (e) {
246
+ loadErrors.push(e)
247
+ }
248
+ } else if (process.arch === 'arm64') {
249
+ try {
250
+ return require('./vis-native.freebsd-arm64.node')
251
+ } catch (e) {
252
+ loadErrors.push(e)
253
+ }
254
+ try {
255
+ const binding = require('@visulima/vis-binding-freebsd-arm64')
256
+ const bindingPackageVersion = require('@visulima/vis-binding-freebsd-arm64/package.json').version
257
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
258
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
259
+ }
260
+ return binding
261
+ } catch (e) {
262
+ loadErrors.push(e)
263
+ }
264
+ } else {
265
+ loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
266
+ }
267
+ } else if (process.platform === 'linux') {
268
+ if (process.arch === 'x64') {
269
+ if (isMusl()) {
69
270
  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("./vis-native.android-arm64.node");
78
- } catch (e) {
79
- loadErrors.push(e);
80
- }
81
- try {
82
- const binding = require("@visulima/vis-binding-android-arm64");
83
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.android-arm-eabi.node");
100
- } catch (e) {
101
- loadErrors.push(e);
102
- }
103
- try {
104
- const binding = require("@visulima/vis-binding-android-arm-eabi");
105
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.win32-x64-gnu.node");
127
- } catch (e) {
128
- loadErrors.push(e);
129
- }
130
- try {
131
- const binding = require("@visulima/vis-binding-win32-x64-gnu");
132
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.win32-x64-msvc.node");
149
- } catch (e) {
150
- loadErrors.push(e);
151
- }
152
- try {
153
- const binding = require("@visulima/vis-binding-win32-x64-msvc");
154
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.win32-ia32-msvc.node");
172
- } catch (e) {
173
- loadErrors.push(e);
174
- }
175
- try {
176
- const binding = require("@visulima/vis-binding-win32-ia32-msvc");
177
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.win32-arm64-msvc.node");
194
- } catch (e) {
195
- loadErrors.push(e);
196
- }
197
- try {
198
- const binding = require("@visulima/vis-binding-win32-arm64-msvc");
199
- const bindingPackageVersion = require("@visulima/vis-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}`));
271
+ return require('./vis-native.linux-x64-musl.node')
272
+ } catch (e) {
273
+ loadErrors.push(e)
215
274
  }
216
- } else if (process.platform === "darwin") {
217
275
  try {
218
- return require("./vis-native.darwin-universal.node");
276
+ const binding = require('@visulima/vis-binding-linux-x64-musl')
277
+ const bindingPackageVersion = require('@visulima/vis-binding-linux-x64-musl/package.json').version
278
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
279
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
280
+ }
281
+ return binding
219
282
  } catch (e) {
220
- loadErrors.push(e);
283
+ loadErrors.push(e)
221
284
  }
285
+ } else {
222
286
  try {
223
- const binding = require("@visulima/vis-binding-darwin-universal");
224
- const bindingPackageVersion = require("@visulima/vis-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;
287
+ return require('./vis-native.linux-x64-gnu.node')
231
288
  } catch (e) {
232
- loadErrors.push(e);
233
- }
234
- if (process.arch === "x64") {
235
- try {
236
- return require("./vis-native.darwin-x64.node");
237
- } catch (e) {
238
- loadErrors.push(e);
239
- }
240
- try {
241
- const binding = require("@visulima/vis-binding-darwin-x64");
242
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.darwin-arm64.node");
259
- } catch (e) {
260
- loadErrors.push(e);
261
- }
262
- try {
263
- const binding = require("@visulima/vis-binding-darwin-arm64");
264
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.freebsd-x64.node");
285
- } catch (e) {
286
- loadErrors.push(e);
287
- }
288
- try {
289
- const binding = require("@visulima/vis-binding-freebsd-x64");
290
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.freebsd-arm64.node");
307
- } catch (e) {
308
- loadErrors.push(e);
309
- }
310
- try {
311
- const binding = require("@visulima/vis-binding-freebsd-arm64");
312
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.linux-x64-musl.node");
334
- } catch (e) {
335
- loadErrors.push(e);
336
- }
337
- try {
338
- const binding = require("@visulima/vis-binding-linux-x64-musl");
339
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.linux-x64-gnu.node");
356
- } catch (e) {
357
- loadErrors.push(e);
358
- }
359
- try {
360
- const binding = require("@visulima/vis-binding-linux-x64-gnu");
361
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.linux-arm64-musl.node");
380
- } catch (e) {
381
- loadErrors.push(e);
382
- }
383
- try {
384
- const binding = require("@visulima/vis-binding-linux-arm64-musl");
385
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.linux-arm64-gnu.node");
402
- } catch (e) {
403
- loadErrors.push(e);
404
- }
405
- try {
406
- const binding = require("@visulima/vis-binding-linux-arm64-gnu");
407
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.linux-arm-musleabihf.node");
426
- } catch (e) {
427
- loadErrors.push(e);
428
- }
429
- try {
430
- const binding = require("@visulima/vis-binding-linux-arm-musleabihf");
431
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.linux-arm-gnueabihf.node");
448
- } catch (e) {
449
- loadErrors.push(e);
450
- }
451
- try {
452
- const binding = require("@visulima/vis-binding-linux-arm-gnueabihf");
453
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.linux-loong64-musl.node");
472
- } catch (e) {
473
- loadErrors.push(e);
474
- }
475
- try {
476
- const binding = require("@visulima/vis-binding-linux-loong64-musl");
477
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.linux-loong64-gnu.node");
494
- } catch (e) {
495
- loadErrors.push(e);
496
- }
497
- try {
498
- const binding = require("@visulima/vis-binding-linux-loong64-gnu");
499
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.linux-riscv64-musl.node");
518
- } catch (e) {
519
- loadErrors.push(e);
520
- }
521
- try {
522
- const binding = require("@visulima/vis-binding-linux-riscv64-musl");
523
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.linux-riscv64-gnu.node");
540
- } catch (e) {
541
- loadErrors.push(e);
542
- }
543
- try {
544
- const binding = require("@visulima/vis-binding-linux-riscv64-gnu");
545
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.linux-ppc64-gnu.node");
563
- } catch (e) {
564
- loadErrors.push(e);
565
- }
566
- try {
567
- const binding = require("@visulima/vis-binding-linux-ppc64-gnu");
568
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.linux-s390x-gnu.node");
585
- } catch (e) {
586
- loadErrors.push(e);
587
- }
588
- try {
589
- const binding = require("@visulima/vis-binding-linux-s390x-gnu");
590
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.openharmony-arm64.node");
611
- } catch (e) {
612
- loadErrors.push(e);
613
- }
614
- try {
615
- const binding = require("@visulima/vis-binding-openharmony-arm64");
616
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.openharmony-x64.node");
633
- } catch (e) {
634
- loadErrors.push(e);
635
- }
636
- try {
637
- const binding = require("@visulima/vis-binding-openharmony-x64");
638
- const bindingPackageVersion = require("@visulima/vis-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("./vis-native.openharmony-arm.node");
655
- } catch (e) {
656
- loadErrors.push(e);
657
- }
658
- try {
659
- const binding = require("@visulima/vis-binding-openharmony-arm");
660
- const bindingPackageVersion = require("@visulima/vis-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}`));
289
+ loadErrors.push(e)
290
+ }
291
+ try {
292
+ const binding = require('@visulima/vis-binding-linux-x64-gnu')
293
+ const bindingPackageVersion = require('@visulima/vis-binding-linux-x64-gnu/package.json').version
294
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
295
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
296
+ }
297
+ return binding
298
+ } catch (e) {
299
+ loadErrors.push(e)
676
300
  }
301
+ }
302
+ } else if (process.arch === 'arm64') {
303
+ if (isMusl()) {
304
+ try {
305
+ return require('./vis-native.linux-arm64-musl.node')
306
+ } catch (e) {
307
+ loadErrors.push(e)
308
+ }
309
+ try {
310
+ const binding = require('@visulima/vis-binding-linux-arm64-musl')
311
+ const bindingPackageVersion = require('@visulima/vis-binding-linux-arm64-musl/package.json').version
312
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
313
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
314
+ }
315
+ return binding
316
+ } catch (e) {
317
+ loadErrors.push(e)
318
+ }
319
+ } else {
320
+ try {
321
+ return require('./vis-native.linux-arm64-gnu.node')
322
+ } catch (e) {
323
+ loadErrors.push(e)
324
+ }
325
+ try {
326
+ const binding = require('@visulima/vis-binding-linux-arm64-gnu')
327
+ const bindingPackageVersion = require('@visulima/vis-binding-linux-arm64-gnu/package.json').version
328
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
329
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
330
+ }
331
+ return binding
332
+ } catch (e) {
333
+ loadErrors.push(e)
334
+ }
335
+ }
336
+ } else if (process.arch === 'arm') {
337
+ if (isMusl()) {
338
+ try {
339
+ return require('./vis-native.linux-arm-musleabihf.node')
340
+ } catch (e) {
341
+ loadErrors.push(e)
342
+ }
343
+ try {
344
+ const binding = require('@visulima/vis-binding-linux-arm-musleabihf')
345
+ const bindingPackageVersion = require('@visulima/vis-binding-linux-arm-musleabihf/package.json').version
346
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
347
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
348
+ }
349
+ return binding
350
+ } catch (e) {
351
+ loadErrors.push(e)
352
+ }
353
+ } else {
354
+ try {
355
+ return require('./vis-native.linux-arm-gnueabihf.node')
356
+ } catch (e) {
357
+ loadErrors.push(e)
358
+ }
359
+ try {
360
+ const binding = require('@visulima/vis-binding-linux-arm-gnueabihf')
361
+ const bindingPackageVersion = require('@visulima/vis-binding-linux-arm-gnueabihf/package.json').version
362
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
363
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
364
+ }
365
+ return binding
366
+ } catch (e) {
367
+ loadErrors.push(e)
368
+ }
369
+ }
370
+ } else if (process.arch === 'loong64') {
371
+ if (isMusl()) {
372
+ try {
373
+ return require('./vis-native.linux-loong64-musl.node')
374
+ } catch (e) {
375
+ loadErrors.push(e)
376
+ }
377
+ try {
378
+ const binding = require('@visulima/vis-binding-linux-loong64-musl')
379
+ const bindingPackageVersion = require('@visulima/vis-binding-linux-loong64-musl/package.json').version
380
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
381
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
382
+ }
383
+ return binding
384
+ } catch (e) {
385
+ loadErrors.push(e)
386
+ }
387
+ } else {
388
+ try {
389
+ return require('./vis-native.linux-loong64-gnu.node')
390
+ } catch (e) {
391
+ loadErrors.push(e)
392
+ }
393
+ try {
394
+ const binding = require('@visulima/vis-binding-linux-loong64-gnu')
395
+ const bindingPackageVersion = require('@visulima/vis-binding-linux-loong64-gnu/package.json').version
396
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
397
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
398
+ }
399
+ return binding
400
+ } catch (e) {
401
+ loadErrors.push(e)
402
+ }
403
+ }
404
+ } else if (process.arch === 'riscv64') {
405
+ if (isMusl()) {
406
+ try {
407
+ return require('./vis-native.linux-riscv64-musl.node')
408
+ } catch (e) {
409
+ loadErrors.push(e)
410
+ }
411
+ try {
412
+ const binding = require('@visulima/vis-binding-linux-riscv64-musl')
413
+ const bindingPackageVersion = require('@visulima/vis-binding-linux-riscv64-musl/package.json').version
414
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
415
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
416
+ }
417
+ return binding
418
+ } catch (e) {
419
+ loadErrors.push(e)
420
+ }
421
+ } else {
422
+ try {
423
+ return require('./vis-native.linux-riscv64-gnu.node')
424
+ } catch (e) {
425
+ loadErrors.push(e)
426
+ }
427
+ try {
428
+ const binding = require('@visulima/vis-binding-linux-riscv64-gnu')
429
+ const bindingPackageVersion = require('@visulima/vis-binding-linux-riscv64-gnu/package.json').version
430
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
431
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
432
+ }
433
+ return binding
434
+ } catch (e) {
435
+ loadErrors.push(e)
436
+ }
437
+ }
438
+ } else if (process.arch === 'ppc64') {
439
+ try {
440
+ return require('./vis-native.linux-ppc64-gnu.node')
441
+ } catch (e) {
442
+ loadErrors.push(e)
443
+ }
444
+ try {
445
+ const binding = require('@visulima/vis-binding-linux-ppc64-gnu')
446
+ const bindingPackageVersion = require('@visulima/vis-binding-linux-ppc64-gnu/package.json').version
447
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
448
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
449
+ }
450
+ return binding
451
+ } catch (e) {
452
+ loadErrors.push(e)
453
+ }
454
+ } else if (process.arch === 's390x') {
455
+ try {
456
+ return require('./vis-native.linux-s390x-gnu.node')
457
+ } catch (e) {
458
+ loadErrors.push(e)
459
+ }
460
+ try {
461
+ const binding = require('@visulima/vis-binding-linux-s390x-gnu')
462
+ const bindingPackageVersion = require('@visulima/vis-binding-linux-s390x-gnu/package.json').version
463
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
464
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
465
+ }
466
+ return binding
467
+ } catch (e) {
468
+ loadErrors.push(e)
469
+ }
677
470
  } else {
678
- loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
471
+ loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
679
472
  }
473
+ } else if (process.platform === 'openharmony') {
474
+ if (process.arch === 'arm64') {
475
+ try {
476
+ return require('./vis-native.openharmony-arm64.node')
477
+ } catch (e) {
478
+ loadErrors.push(e)
479
+ }
480
+ try {
481
+ const binding = require('@visulima/vis-binding-openharmony-arm64')
482
+ const bindingPackageVersion = require('@visulima/vis-binding-openharmony-arm64/package.json').version
483
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
484
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
485
+ }
486
+ return binding
487
+ } catch (e) {
488
+ loadErrors.push(e)
489
+ }
490
+ } else if (process.arch === 'x64') {
491
+ try {
492
+ return require('./vis-native.openharmony-x64.node')
493
+ } catch (e) {
494
+ loadErrors.push(e)
495
+ }
496
+ try {
497
+ const binding = require('@visulima/vis-binding-openharmony-x64')
498
+ const bindingPackageVersion = require('@visulima/vis-binding-openharmony-x64/package.json').version
499
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
500
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
501
+ }
502
+ return binding
503
+ } catch (e) {
504
+ loadErrors.push(e)
505
+ }
506
+ } else if (process.arch === 'arm') {
507
+ try {
508
+ return require('./vis-native.openharmony-arm.node')
509
+ } catch (e) {
510
+ loadErrors.push(e)
511
+ }
512
+ try {
513
+ const binding = require('@visulima/vis-binding-openharmony-arm')
514
+ const bindingPackageVersion = require('@visulima/vis-binding-openharmony-arm/package.json').version
515
+ if (bindingPackageVersion !== '1.0.0-alpha.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
516
+ throw new Error(`Native binding package version mismatch, expected 1.0.0-alpha.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
517
+ }
518
+ return binding
519
+ } catch (e) {
520
+ loadErrors.push(e)
521
+ }
522
+ } else {
523
+ loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`))
524
+ }
525
+ } else {
526
+ loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
527
+ }
680
528
  }
681
529
 
682
- nativeBinding = requireNative();
530
+ nativeBinding = requireNative()
683
531
 
684
532
  if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
685
- let wasiBinding = null;
686
- let wasiBindingError = null;
533
+ let wasiBinding = null
534
+ let wasiBindingError = null
535
+ try {
536
+ wasiBinding = require('./vis-native.wasi.cjs')
537
+ nativeBinding = wasiBinding
538
+ } catch (err) {
539
+ if (process.env.NAPI_RS_FORCE_WASI) {
540
+ wasiBindingError = err
541
+ }
542
+ }
543
+ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
687
544
  try {
688
- wasiBinding = require("./vis-native.wasi.cjs");
689
- nativeBinding = wasiBinding;
545
+ wasiBinding = require('@visulima/vis-binding-wasm32-wasi')
546
+ nativeBinding = wasiBinding
690
547
  } 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/vis-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
- }
548
+ if (process.env.NAPI_RS_FORCE_WASI) {
549
+ if (!wasiBindingError) {
550
+ wasiBindingError = err
551
+ } else {
552
+ wasiBindingError.cause = err
708
553
  }
554
+ loadErrors.push(err)
555
+ }
709
556
  }
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
- }
557
+ }
558
+ if (process.env.NAPI_RS_FORCE_WASI === 'error' && !wasiBinding) {
559
+ const error = new Error('WASI binding not found and NAPI_RS_FORCE_WASI is set to error')
560
+ error.cause = wasiBindingError
561
+ throw error
562
+ }
715
563
  }
716
564
 
717
565
  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`);
566
+ if (loadErrors.length > 0) {
567
+ throw new Error(
568
+ `Cannot find native binding. ` +
569
+ `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
570
+ 'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
571
+ {
572
+ cause: loadErrors.reduce((err, cur) => {
573
+ cur.cause = err
574
+ return cur
575
+ }),
576
+ },
577
+ )
578
+ }
579
+ throw new Error(`Failed to load native binding`)
732
580
  }
733
581
 
734
- const {
735
- cleanWorkspace,
736
- detectPackageManager,
737
- execPmCommand,
738
- execPmCommandInteractive,
739
- NATIVE_BINDING_VERSION,
740
- resolveAdd,
741
- resolveDedupe,
742
- resolveDlx,
743
- resolveExec,
744
- resolveInstall,
745
- resolveLink,
746
- resolveOutdated,
747
- resolvePmCommand,
748
- resolveRemove,
749
- resolveUnlink,
750
- resolveWhy,
751
- sortPackageJsonString,
752
- sortPackageJsonStringWithOptions,
753
- whichBin,
754
- } = nativeBinding;
755
- export { cleanWorkspace };
756
- export { detectPackageManager };
757
- export { execPmCommand };
758
- export { execPmCommandInteractive };
759
- export { NATIVE_BINDING_VERSION };
760
- export { resolveAdd };
761
- export { resolveDedupe };
762
- export { resolveDlx };
763
- export { resolveExec };
764
- export { resolveInstall };
765
- export { resolveLink };
766
- export { resolveOutdated };
767
- export { resolvePmCommand };
768
- export { resolveRemove };
769
- export { resolveUnlink };
770
- export { resolveWhy };
771
- export { sortPackageJsonString };
772
- export { sortPackageJsonStringWithOptions };
773
- export { whichBin };
582
+ const { cleanWorkspace, detectPackageManager, execPmCommand, execPmCommandInteractive, NATIVE_BINDING_VERSION, resolveAdd, resolveDedupe, resolveDlx, resolveEditorconfigDefaults, resolveExec, resolveInstall, resolveLink, resolveOutdated, resolvePmCommand, resolveRemove, resolveUnlink, resolveWhy, sortPackageJsonString, sortPackageJsonStringWithOptions, whichBin } = nativeBinding
583
+ export { cleanWorkspace }
584
+ export { detectPackageManager }
585
+ export { execPmCommand }
586
+ export { execPmCommandInteractive }
587
+ export { NATIVE_BINDING_VERSION }
588
+ export { resolveAdd }
589
+ export { resolveDedupe }
590
+ export { resolveDlx }
591
+ export { resolveEditorconfigDefaults }
592
+ export { resolveExec }
593
+ export { resolveInstall }
594
+ export { resolveLink }
595
+ export { resolveOutdated }
596
+ export { resolvePmCommand }
597
+ export { resolveRemove }
598
+ export { resolveUnlink }
599
+ export { resolveWhy }
600
+ export { sortPackageJsonString }
601
+ export { sortPackageJsonStringWithOptions }
602
+ export { whichBin }