@visulima/vis 1.0.0-alpha.4 → 1.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +164 -75
- package/README.md +144 -14
- package/dist/ai-analysis.d.ts +3 -17
- package/dist/ai-cache.d.ts +1 -1
- package/dist/ai-types.d.ts +16 -0
- package/dist/bin.js +353 -215
- package/dist/cache-directory.d.ts +73 -0
- package/dist/catalog.d.ts +22 -4
- package/dist/codeowners.d.ts +30 -0
- package/dist/commands/action-graph.d.ts +8 -0
- package/dist/commands/audit.d.ts +3 -3
- package/dist/commands/cache.d.ts +86 -0
- package/dist/commands/ci.d.ts +19 -0
- package/dist/commands/docker.d.ts +22 -0
- package/dist/commands/generate.d.ts +10 -0
- package/dist/commands/ignore-helpers.d.ts +157 -0
- package/dist/commands/ignore.d.ts +17 -0
- package/dist/commands/info.d.ts +3 -0
- package/dist/commands/list.d.ts +3 -0
- package/dist/commands/migrate/backup.d.ts +8 -0
- package/dist/commands/migrate/constants.d.ts +6 -2
- package/dist/commands/migrate/gitleaks.d.ts +29 -0
- package/dist/commands/migrate/json.d.ts +4 -2
- package/dist/commands/migrate/kingfisher.d.ts +14 -0
- package/dist/commands/migrate/moon.d.ts +5 -0
- package/dist/commands/migrate/nano-staged.d.ts +30 -0
- package/dist/commands/migrate/nx.d.ts +12 -0
- package/dist/commands/migrate/prompt.d.ts +2 -0
- package/dist/commands/migrate/secretlint.d.ts +14 -0
- package/dist/commands/migrate/shared.d.ts +29 -0
- package/dist/commands/migrate/turborepo.d.ts +11 -0
- package/dist/commands/migrate/types.d.ts +8 -1
- package/dist/commands/migrate/verify.d.ts +12 -0
- package/dist/commands/run.d.ts +13 -0
- package/dist/commands/sbom.d.ts +10 -0
- package/dist/commands/secrets.d.ts +3 -0
- package/dist/commands/staged.d.ts +7 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/sync.d.ts +16 -0
- package/dist/commands/task-why.d.ts +3 -0
- package/dist/config.d.ts +18 -3
- package/dist/config.js +1 -1
- package/dist/docker.d.ts +73 -0
- package/dist/flakiness.d.ts +40 -0
- package/dist/generate/discover.d.ts +29 -0
- package/dist/generate/index.d.ts +32 -0
- package/dist/generate/index.js +1 -0
- package/dist/generate/loader.d.ts +15 -0
- package/dist/generate/moon-adapter/filename-interp.d.ts +42 -0
- package/dist/generate/moon-adapter/filters.d.ts +22 -0
- package/dist/generate/moon-adapter/frontmatter.d.ts +39 -0
- package/dist/generate/moon-adapter/index.d.ts +19 -0
- package/dist/generate/moon-adapter/tera-subset.d.ts +85 -0
- package/dist/generate/moon-adapter/util.d.ts +14 -0
- package/dist/generate/prompts.d.ts +25 -0
- package/dist/generate/remote.d.ts +43 -0
- package/dist/generate/runner.d.ts +37 -0
- package/dist/generate/types.d.ts +152 -0
- package/dist/hooks.d.ts +118 -0
- package/dist/native-binding.d.ts +8 -1
- package/dist/packem_chunks/index.js +7 -0
- package/dist/packem_chunks/loader.js +1 -0
- package/dist/packem_shared/otelPlugin-CJLkguJ8.js +1 -0
- package/dist/plugins/otel.d.ts +63 -0
- package/dist/pm-runner.d.ts +24 -3
- package/dist/run-report.d.ts +40 -0
- package/dist/runtime-check.d.ts +27 -0
- package/dist/sbom/cyclonedx.d.ts +39 -0
- package/dist/sbom/installed-package.d.ts +49 -0
- package/dist/sbom/license.d.ts +31 -0
- package/dist/sbom/lockfile.d.ts +34 -0
- package/dist/sbom/purl.d.ts +25 -0
- package/dist/sbom/resolve-specifier.d.ts +24 -0
- package/dist/sbom/types.d.ts +196 -0
- package/dist/secrets/baseline.d.ts +20 -0
- package/dist/secrets/format.d.ts +14 -0
- package/dist/secrets/git.d.ts +6 -0
- package/dist/secrets/spinner.d.ts +9 -0
- package/dist/selectors.d.ts +81 -0
- package/dist/shell-history.d.ts +16 -0
- package/dist/staged/cli-parse.d.ts +18 -0
- package/dist/staged/config.d.ts +14 -0
- package/dist/staged/errors/apply-empty-commit-error.d.ts +4 -0
- package/dist/staged/errors/config-error.d.ts +4 -0
- package/dist/staged/errors/get-backup-stash-error.d.ts +4 -0
- package/dist/staged/errors/git-error.d.ts +6 -0
- package/dist/staged/errors/index.d.ts +12 -0
- package/dist/staged/errors/restore-original-state-error.d.ts +4 -0
- package/dist/staged/errors/staged-error.d.ts +8 -0
- package/dist/staged/errors/task-error.d.ts +6 -0
- package/dist/staged/git/diff.d.ts +76 -0
- package/dist/staged/git/exec.d.ts +43 -0
- package/dist/staged/git/index.d.ts +77 -0
- package/dist/staged/git/stash.d.ts +37 -0
- package/dist/staged/index.d.ts +13 -0
- package/dist/staged/match.d.ts +12 -0
- package/dist/staged/renderer/index.d.ts +9 -0
- package/dist/staged/renderer/ink/index.d.ts +4 -0
- package/dist/staged/renderer/plain.d.ts +12 -0
- package/dist/staged/tasks/build.d.ts +13 -0
- package/dist/staged/tasks/exec.d.ts +56 -0
- package/dist/staged/tasks/run.d.ts +26 -0
- package/dist/staged/types.d.ts +173 -0
- package/dist/target-discovery.d.ts +59 -0
- package/dist/target-options.d.ts +261 -0
- package/dist/tui/components/OutputPanel.d.ts +2 -1
- package/dist/tui/components/TaskListPanel.d.ts +1 -1
- package/dist/tui/components/TaskStore.d.ts +1 -1
- package/dist/tui/components/devcontainer/DevcontainerStore.d.ts +1 -1
- package/dist/tui/components/devcontainer/catalogs/mount-suggestions.d.ts +1 -1
- package/dist/tui/components/devcontainer/sections/GeneralSection.d.ts +1 -1
- package/dist/tui/components/devcontainer/sections/PreviewPanel.d.ts +1 -1
- package/dist/tui/components/devcontainer/types.d.ts +4 -4
- package/dist/tui/components/graph/GraphStore.d.ts +1 -1
- package/dist/tui/components/graph/ProjectDetailPanel.d.ts +1 -1
- package/dist/tui/components/optimize/OptimizeDetailPanel.d.ts +1 -1
- package/dist/tui/components/optimize/OptimizeStore.d.ts +1 -1
- package/dist/tui/components/update/PackageDetailPanel.d.ts +1 -1
- package/dist/tui/components/update/PackageListPanel.d.ts +4 -1
- package/dist/tui/components/update/UpdateStore.d.ts +1 -1
- package/dist/tui/components/update/VisUpdateApp.d.ts +8 -1
- package/dist/tui/dynamic-life-cycle.d.ts +2 -1
- package/dist/tui/static-life-cycle.d.ts +7 -1
- package/dist/watch.d.ts +65 -0
- package/dist/workspace.d.ts +366 -6
- package/index.js +727 -554
- package/package.json +38 -33
- package/schemas/project.schema.json +344 -0
- package/schemas/vis-config.schema.json +331 -0
package/index.js
CHANGED
|
@@ -4,597 +4,770 @@
|
|
|
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(
|
|
7
|
+
const require = createRequire(import.meta.url);
|
|
8
|
+
const __dirname = new URL(".", import.meta.url).pathname;
|
|
9
9
|
|
|
10
|
-
const { readFileSync } = require(
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
+
}
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
25
|
+
return musl;
|
|
26
|
+
};
|
|
27
27
|
|
|
28
|
-
const isFileMusl = (f) => f.includes(
|
|
28
|
+
const isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
|
|
29
29
|
|
|
30
30
|
const isMuslFromFilesystem = () => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
|
39
|
+
let report = null;
|
|
40
|
+
if (typeof process.report?.getReport === "function") {
|
|
41
|
+
process.report.excludeNetwork = true;
|
|
42
|
+
report = process.report.getReport();
|
|
53
43
|
}
|
|
54
|
-
|
|
55
|
-
|
|
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)
|
|
44
|
+
if (!report) {
|
|
45
|
+
return null;
|
|
73
46
|
}
|
|
74
|
-
|
|
75
|
-
|
|
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.3' && 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.3 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.3' && 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.3 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}`))
|
|
47
|
+
if (report.header && report.header.glibcVersionRuntime) {
|
|
48
|
+
return false;
|
|
109
49
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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.3' && 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.3 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.3' && 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.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
50
|
+
if (Array.isArray(report.sharedObjects)) {
|
|
51
|
+
if (report.sharedObjects.some(isFileMusl)) {
|
|
52
|
+
return true;
|
|
139
53
|
}
|
|
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.3' && 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.3 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.3' && 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.3 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}`))
|
|
179
|
-
}
|
|
180
|
-
} else if (process.platform === 'darwin') {
|
|
181
|
-
try {
|
|
182
|
-
return require('./vis-native.darwin-universal.node')
|
|
183
|
-
} catch (e) {
|
|
184
|
-
loadErrors.push(e)
|
|
185
54
|
}
|
|
55
|
+
return false;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const isMuslFromChildProcess = () => {
|
|
186
59
|
try {
|
|
187
|
-
|
|
188
|
-
const bindingPackageVersion = require('@visulima/vis-binding-darwin-universal/package.json').version
|
|
189
|
-
if (bindingPackageVersion !== '1.0.0-alpha.3' && 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.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
191
|
-
}
|
|
192
|
-
return binding
|
|
60
|
+
return require("child_process").execSync("ldd --version", { encoding: "utf8" }).includes("musl");
|
|
193
61
|
} catch (e) {
|
|
194
|
-
|
|
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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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}`))
|
|
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;
|
|
266
64
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
return require('./vis-native.linux-x64-musl.node')
|
|
272
|
-
} catch (e) {
|
|
273
|
-
loadErrors.push(e)
|
|
274
|
-
}
|
|
275
|
-
try {
|
|
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.3' && 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.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
280
|
-
}
|
|
281
|
-
return binding
|
|
282
|
-
} catch (e) {
|
|
283
|
-
loadErrors.push(e)
|
|
284
|
-
}
|
|
285
|
-
} else {
|
|
286
|
-
try {
|
|
287
|
-
return require('./vis-native.linux-x64-gnu.node')
|
|
288
|
-
} catch (e) {
|
|
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.3' && 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.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
296
|
-
}
|
|
297
|
-
return binding
|
|
298
|
-
} catch (e) {
|
|
299
|
-
loadErrors.push(e)
|
|
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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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.3' && 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.3 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
|
-
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
function requireNative() {
|
|
68
|
+
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
|
|
411
69
|
try {
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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}`));
|
|
420
215
|
}
|
|
421
|
-
|
|
216
|
+
} else if (process.platform === "darwin") {
|
|
422
217
|
try {
|
|
423
|
-
|
|
218
|
+
return require("./vis-native.darwin-universal.node");
|
|
424
219
|
} catch (e) {
|
|
425
|
-
|
|
220
|
+
loadErrors.push(e);
|
|
426
221
|
}
|
|
427
222
|
try {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
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.5" && 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.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
return binding;
|
|
434
231
|
} catch (e) {
|
|
435
|
-
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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.5" &&
|
|
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.5 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}`));
|
|
517
676
|
}
|
|
518
|
-
return binding
|
|
519
|
-
} catch (e) {
|
|
520
|
-
loadErrors.push(e)
|
|
521
|
-
}
|
|
522
677
|
} else {
|
|
523
|
-
|
|
678
|
+
loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
|
|
524
679
|
}
|
|
525
|
-
} else {
|
|
526
|
-
loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
|
|
527
|
-
}
|
|
528
680
|
}
|
|
529
681
|
|
|
530
|
-
nativeBinding = requireNative()
|
|
682
|
+
nativeBinding = requireNative();
|
|
531
683
|
|
|
532
684
|
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
533
|
-
|
|
534
|
-
|
|
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) {
|
|
685
|
+
let wasiBinding = null;
|
|
686
|
+
let wasiBindingError = null;
|
|
544
687
|
try {
|
|
545
|
-
|
|
546
|
-
|
|
688
|
+
wasiBinding = require("./vis-native.wasi.cjs");
|
|
689
|
+
nativeBinding = wasiBinding;
|
|
547
690
|
} catch (err) {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
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
|
+
}
|
|
553
708
|
}
|
|
554
|
-
loadErrors.push(err)
|
|
555
|
-
}
|
|
556
709
|
}
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
}
|
|
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
|
+
}
|
|
563
715
|
}
|
|
564
716
|
|
|
565
717
|
if (!nativeBinding) {
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
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`);
|
|
580
732
|
}
|
|
581
733
|
|
|
582
|
-
const {
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
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 };
|