@publier/native 0.0.0-stage → 0.2.0

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/index.js ADDED
@@ -0,0 +1,986 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+
4
+ const { readFileSync } = require('fs')
5
+ let nativeBinding = null
6
+ // Which artifact actually loaded. The WASI fallback chain overwrites it with
7
+ // the flavor it resolved; the late native retry below leaves it alone because
8
+ // it only runs while no WASI candidate has been loaded. The take-over check
9
+ // after the load-failure block can also set it.
10
+ let __napiLoadedBindingTarget = 'native'
11
+ // What this loader's own `requireNative()` calls returned. The check after
12
+ // the load-failure block compares it with `nativeBinding` to tell a binding
13
+ // this loader loaded from one that code outside it put in its place.
14
+ let __napiRequiredNativeBinding = null
15
+ const loadErrors = []
16
+
17
+ const isMusl = () => {
18
+ let musl = false
19
+ if (process.platform === 'linux') {
20
+ musl = isMuslFromFilesystem()
21
+ if (musl === null) {
22
+ musl = isMuslFromReport()
23
+ }
24
+ if (musl === null) {
25
+ musl = isMuslFromChildProcess()
26
+ }
27
+ }
28
+ return musl
29
+ }
30
+
31
+ const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')
32
+
33
+ const isMuslFromFilesystem = () => {
34
+ try {
35
+ return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')
36
+ } catch {
37
+ return null
38
+ }
39
+ }
40
+
41
+ const isMuslFromReport = () => {
42
+ let report = null
43
+ if (process.report && typeof process.report.getReport === 'function') {
44
+ process.report.excludeNetwork = true
45
+ report = process.report.getReport()
46
+ }
47
+ if (!report) {
48
+ return null
49
+ }
50
+ if (report.header && report.header.glibcVersionRuntime) {
51
+ return false
52
+ }
53
+ if (Array.isArray(report.sharedObjects)) {
54
+ if (report.sharedObjects.some(isFileMusl)) {
55
+ return true
56
+ }
57
+ }
58
+ return false
59
+ }
60
+
61
+ const isMuslFromChildProcess = () => {
62
+ try {
63
+ return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl')
64
+ } catch (e) {
65
+ // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
66
+ return false
67
+ }
68
+ }
69
+
70
+ function requireNative() {
71
+ if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
72
+ try {
73
+ const overrideBinding = require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)
74
+ // The override may be a generated WASI loader, which already reports its
75
+ // own flavor. Adopt it: `module.exports` aliases this object, so claiming
76
+ // 'native' would both misreport the artifact and overwrite the loader's
77
+ // marker through the alias.
78
+ __napiLoadedBindingTarget =
79
+ overrideBinding && typeof overrideBinding.__napiBindingTarget === 'string'
80
+ ? overrideBinding.__napiBindingTarget
81
+ : 'native'
82
+ return overrideBinding
83
+ } catch (err) {
84
+ loadErrors.push(err)
85
+ }
86
+ } else if (process.platform === 'android') {
87
+ if (process.arch === 'arm64') {
88
+ try {
89
+ return require('./publier-native.android-arm64.node')
90
+ } catch (e) {
91
+ loadErrors.push(e)
92
+ }
93
+ try {
94
+ const binding = require('@publier/native-android-arm64')
95
+ const bindingPackageVersion = require('@publier/native-android-arm64/package.json').version
96
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
98
+ }
99
+ return binding
100
+ } catch (e) {
101
+ loadErrors.push(e)
102
+ }
103
+ } else if (process.arch === 'arm') {
104
+ try {
105
+ return require('./publier-native.android-arm-eabi.node')
106
+ } catch (e) {
107
+ loadErrors.push(e)
108
+ }
109
+ try {
110
+ const binding = require('@publier/native-android-arm-eabi')
111
+ const bindingPackageVersion = require('@publier/native-android-arm-eabi/package.json').version
112
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
113
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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 && process.config.variables && process.config.variables.shlib_suffix === 'dll.a') || (process.config && process.config.variables && process.config.variables.node_target_type === 'shared_library')) {
125
+ try {
126
+ return require('./publier-native.win32-x64-gnu.node')
127
+ } catch (e) {
128
+ loadErrors.push(e)
129
+ }
130
+ try {
131
+ const binding = require('@publier/native-win32-x64-gnu')
132
+ const bindingPackageVersion = require('@publier/native-win32-x64-gnu/package.json').version
133
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
135
+ }
136
+ return binding
137
+ } catch (e) {
138
+ loadErrors.push(e)
139
+ }
140
+ } else {
141
+ try {
142
+ return require('./publier-native.win32-x64-msvc.node')
143
+ } catch (e) {
144
+ loadErrors.push(e)
145
+ }
146
+ try {
147
+ const binding = require('@publier/native-win32-x64-msvc')
148
+ const bindingPackageVersion = require('@publier/native-win32-x64-msvc/package.json').version
149
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
150
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
151
+ }
152
+ return binding
153
+ } catch (e) {
154
+ loadErrors.push(e)
155
+ }
156
+ }
157
+ } else if (process.arch === 'ia32') {
158
+ try {
159
+ return require('./publier-native.win32-ia32-msvc.node')
160
+ } catch (e) {
161
+ loadErrors.push(e)
162
+ }
163
+ try {
164
+ const binding = require('@publier/native-win32-ia32-msvc')
165
+ const bindingPackageVersion = require('@publier/native-win32-ia32-msvc/package.json').version
166
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
168
+ }
169
+ return binding
170
+ } catch (e) {
171
+ loadErrors.push(e)
172
+ }
173
+ } else if (process.arch === 'arm64') {
174
+ try {
175
+ return require('./publier-native.win32-arm64-msvc.node')
176
+ } catch (e) {
177
+ loadErrors.push(e)
178
+ }
179
+ try {
180
+ const binding = require('@publier/native-win32-arm64-msvc')
181
+ const bindingPackageVersion = require('@publier/native-win32-arm64-msvc/package.json').version
182
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
183
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
184
+ }
185
+ return binding
186
+ } catch (e) {
187
+ loadErrors.push(e)
188
+ }
189
+ } else {
190
+ loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
191
+ }
192
+ } else if (process.platform === 'darwin') {
193
+ try {
194
+ return require('./publier-native.darwin-universal.node')
195
+ } catch (e) {
196
+ loadErrors.push(e)
197
+ }
198
+ try {
199
+ const binding = require('@publier/native-darwin-universal')
200
+ const bindingPackageVersion = require('@publier/native-darwin-universal/package.json').version
201
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
203
+ }
204
+ return binding
205
+ } catch (e) {
206
+ loadErrors.push(e)
207
+ }
208
+ if (process.arch === 'x64') {
209
+ try {
210
+ return require('./publier-native.darwin-x64.node')
211
+ } catch (e) {
212
+ loadErrors.push(e)
213
+ }
214
+ try {
215
+ const binding = require('@publier/native-darwin-x64')
216
+ const bindingPackageVersion = require('@publier/native-darwin-x64/package.json').version
217
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
219
+ }
220
+ return binding
221
+ } catch (e) {
222
+ loadErrors.push(e)
223
+ }
224
+ } else if (process.arch === 'arm64') {
225
+ try {
226
+ return require('./publier-native.darwin-arm64.node')
227
+ } catch (e) {
228
+ loadErrors.push(e)
229
+ }
230
+ try {
231
+ const binding = require('@publier/native-darwin-arm64')
232
+ const bindingPackageVersion = require('@publier/native-darwin-arm64/package.json').version
233
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
234
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
235
+ }
236
+ return binding
237
+ } catch (e) {
238
+ loadErrors.push(e)
239
+ }
240
+ } else {
241
+ loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
242
+ }
243
+ } else if (process.platform === 'freebsd') {
244
+ if (process.arch === 'x64') {
245
+ try {
246
+ return require('./publier-native.freebsd-x64.node')
247
+ } catch (e) {
248
+ loadErrors.push(e)
249
+ }
250
+ try {
251
+ const binding = require('@publier/native-freebsd-x64')
252
+ const bindingPackageVersion = require('@publier/native-freebsd-x64/package.json').version
253
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
255
+ }
256
+ return binding
257
+ } catch (e) {
258
+ loadErrors.push(e)
259
+ }
260
+ } else if (process.arch === 'arm64') {
261
+ try {
262
+ return require('./publier-native.freebsd-arm64.node')
263
+ } catch (e) {
264
+ loadErrors.push(e)
265
+ }
266
+ try {
267
+ const binding = require('@publier/native-freebsd-arm64')
268
+ const bindingPackageVersion = require('@publier/native-freebsd-arm64/package.json').version
269
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
270
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
271
+ }
272
+ return binding
273
+ } catch (e) {
274
+ loadErrors.push(e)
275
+ }
276
+ } else if (process.arch === 'ppc64') {
277
+ try {
278
+ return require('./publier-native.freebsd-ppc64.node')
279
+ } catch (e) {
280
+ loadErrors.push(e)
281
+ }
282
+ try {
283
+ const binding = require('@publier/native-freebsd-ppc64')
284
+ const bindingPackageVersion = require('@publier/native-freebsd-ppc64/package.json').version
285
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
286
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
287
+ }
288
+ return binding
289
+ } catch (e) {
290
+ loadErrors.push(e)
291
+ }
292
+ } else {
293
+ loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
294
+ }
295
+ } else if (process.platform === 'linux') {
296
+ if (process.arch === 'x64') {
297
+ if (isMusl()) {
298
+ try {
299
+ return require('./publier-native.linux-x64-musl.node')
300
+ } catch (e) {
301
+ loadErrors.push(e)
302
+ }
303
+ try {
304
+ const binding = require('@publier/native-linux-x64-musl')
305
+ const bindingPackageVersion = require('@publier/native-linux-x64-musl/package.json').version
306
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
307
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
308
+ }
309
+ return binding
310
+ } catch (e) {
311
+ loadErrors.push(e)
312
+ }
313
+ } else {
314
+ try {
315
+ return require('./publier-native.linux-x64-gnu.node')
316
+ } catch (e) {
317
+ loadErrors.push(e)
318
+ }
319
+ try {
320
+ const binding = require('@publier/native-linux-x64-gnu')
321
+ const bindingPackageVersion = require('@publier/native-linux-x64-gnu/package.json').version
322
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
323
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
324
+ }
325
+ return binding
326
+ } catch (e) {
327
+ loadErrors.push(e)
328
+ }
329
+ }
330
+ } else if (process.arch === 'arm64') {
331
+ if (isMusl()) {
332
+ try {
333
+ return require('./publier-native.linux-arm64-musl.node')
334
+ } catch (e) {
335
+ loadErrors.push(e)
336
+ }
337
+ try {
338
+ const binding = require('@publier/native-linux-arm64-musl')
339
+ const bindingPackageVersion = require('@publier/native-linux-arm64-musl/package.json').version
340
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
341
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
342
+ }
343
+ return binding
344
+ } catch (e) {
345
+ loadErrors.push(e)
346
+ }
347
+ } else {
348
+ try {
349
+ return require('./publier-native.linux-arm64-gnu.node')
350
+ } catch (e) {
351
+ loadErrors.push(e)
352
+ }
353
+ try {
354
+ const binding = require('@publier/native-linux-arm64-gnu')
355
+ const bindingPackageVersion = require('@publier/native-linux-arm64-gnu/package.json').version
356
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
357
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
358
+ }
359
+ return binding
360
+ } catch (e) {
361
+ loadErrors.push(e)
362
+ }
363
+ }
364
+ } else if (process.arch === 'arm') {
365
+ if (isMusl()) {
366
+ try {
367
+ return require('./publier-native.linux-arm-musleabihf.node')
368
+ } catch (e) {
369
+ loadErrors.push(e)
370
+ }
371
+ try {
372
+ const binding = require('@publier/native-linux-arm-musleabihf')
373
+ const bindingPackageVersion = require('@publier/native-linux-arm-musleabihf/package.json').version
374
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
375
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
376
+ }
377
+ return binding
378
+ } catch (e) {
379
+ loadErrors.push(e)
380
+ }
381
+ } else {
382
+ try {
383
+ return require('./publier-native.linux-arm-gnueabihf.node')
384
+ } catch (e) {
385
+ loadErrors.push(e)
386
+ }
387
+ try {
388
+ const binding = require('@publier/native-linux-arm-gnueabihf')
389
+ const bindingPackageVersion = require('@publier/native-linux-arm-gnueabihf/package.json').version
390
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
391
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
392
+ }
393
+ return binding
394
+ } catch (e) {
395
+ loadErrors.push(e)
396
+ }
397
+ }
398
+ } else if (process.arch === 'loong64') {
399
+ if (isMusl()) {
400
+ try {
401
+ return require('./publier-native.linux-loong64-musl.node')
402
+ } catch (e) {
403
+ loadErrors.push(e)
404
+ }
405
+ try {
406
+ const binding = require('@publier/native-linux-loong64-musl')
407
+ const bindingPackageVersion = require('@publier/native-linux-loong64-musl/package.json').version
408
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
409
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
410
+ }
411
+ return binding
412
+ } catch (e) {
413
+ loadErrors.push(e)
414
+ }
415
+ } else {
416
+ try {
417
+ return require('./publier-native.linux-loong64-gnu.node')
418
+ } catch (e) {
419
+ loadErrors.push(e)
420
+ }
421
+ try {
422
+ const binding = require('@publier/native-linux-loong64-gnu')
423
+ const bindingPackageVersion = require('@publier/native-linux-loong64-gnu/package.json').version
424
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
425
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
426
+ }
427
+ return binding
428
+ } catch (e) {
429
+ loadErrors.push(e)
430
+ }
431
+ }
432
+ } else if (process.arch === 'riscv64') {
433
+ if (isMusl()) {
434
+ try {
435
+ return require('./publier-native.linux-riscv64-musl.node')
436
+ } catch (e) {
437
+ loadErrors.push(e)
438
+ }
439
+ try {
440
+ const binding = require('@publier/native-linux-riscv64-musl')
441
+ const bindingPackageVersion = require('@publier/native-linux-riscv64-musl/package.json').version
442
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
443
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
444
+ }
445
+ return binding
446
+ } catch (e) {
447
+ loadErrors.push(e)
448
+ }
449
+ } else {
450
+ try {
451
+ return require('./publier-native.linux-riscv64-gnu.node')
452
+ } catch (e) {
453
+ loadErrors.push(e)
454
+ }
455
+ try {
456
+ const binding = require('@publier/native-linux-riscv64-gnu')
457
+ const bindingPackageVersion = require('@publier/native-linux-riscv64-gnu/package.json').version
458
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
459
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
460
+ }
461
+ return binding
462
+ } catch (e) {
463
+ loadErrors.push(e)
464
+ }
465
+ }
466
+ } else if (process.arch === 'ppc64') {
467
+ try {
468
+ return require('./publier-native.linux-ppc64-gnu.node')
469
+ } catch (e) {
470
+ loadErrors.push(e)
471
+ }
472
+ try {
473
+ const binding = require('@publier/native-linux-ppc64-gnu')
474
+ const bindingPackageVersion = require('@publier/native-linux-ppc64-gnu/package.json').version
475
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
476
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
477
+ }
478
+ return binding
479
+ } catch (e) {
480
+ loadErrors.push(e)
481
+ }
482
+ } else if (process.arch === 's390x') {
483
+ try {
484
+ return require('./publier-native.linux-s390x-gnu.node')
485
+ } catch (e) {
486
+ loadErrors.push(e)
487
+ }
488
+ try {
489
+ const binding = require('@publier/native-linux-s390x-gnu')
490
+ const bindingPackageVersion = require('@publier/native-linux-s390x-gnu/package.json').version
491
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
492
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
493
+ }
494
+ return binding
495
+ } catch (e) {
496
+ loadErrors.push(e)
497
+ }
498
+ } else {
499
+ loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
500
+ }
501
+ } else if (process.platform === 'openharmony') {
502
+ if (process.arch === 'arm64') {
503
+ try {
504
+ return require('./publier-native.openharmony-arm64.node')
505
+ } catch (e) {
506
+ loadErrors.push(e)
507
+ }
508
+ try {
509
+ const binding = require('@publier/native-openharmony-arm64')
510
+ const bindingPackageVersion = require('@publier/native-openharmony-arm64/package.json').version
511
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
+ }
514
+ return binding
515
+ } catch (e) {
516
+ loadErrors.push(e)
517
+ }
518
+ } else if (process.arch === 'x64') {
519
+ try {
520
+ return require('./publier-native.openharmony-x64.node')
521
+ } catch (e) {
522
+ loadErrors.push(e)
523
+ }
524
+ try {
525
+ const binding = require('@publier/native-openharmony-x64')
526
+ const bindingPackageVersion = require('@publier/native-openharmony-x64/package.json').version
527
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
528
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
529
+ }
530
+ return binding
531
+ } catch (e) {
532
+ loadErrors.push(e)
533
+ }
534
+ } else if (process.arch === 'arm') {
535
+ try {
536
+ return require('./publier-native.openharmony-arm.node')
537
+ } catch (e) {
538
+ loadErrors.push(e)
539
+ }
540
+ try {
541
+ const binding = require('@publier/native-openharmony-arm')
542
+ const bindingPackageVersion = require('@publier/native-openharmony-arm/package.json').version
543
+ if (bindingPackageVersion !== '0.1.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
544
+ throw new Error(`Native binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
545
+ }
546
+ return binding
547
+ } catch (e) {
548
+ loadErrors.push(e)
549
+ }
550
+ } else {
551
+ loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`))
552
+ }
553
+ } else {
554
+ loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
555
+ }
556
+ }
557
+
558
+ function createLoadErrorChain(errors) {
559
+ return errors.reduce((previous, current) => {
560
+ let message
561
+ try {
562
+ message =
563
+ current && typeof current.message === 'string'
564
+ ? current.message
565
+ : String(current)
566
+ } catch {
567
+ message = 'Unknown error'
568
+ }
569
+ const error = new Error(message)
570
+ error.cause = previous
571
+ return error
572
+ }, null)
573
+ }
574
+
575
+ // NAPI_RS_FORCE_WASI is a tri-state flag:
576
+ // unset / any other value → native binding preferred, WASI is only a fallback
577
+ // 'true' → prefer WASI, but retain native as a lazy fallback
578
+ // 'error' → require WASI without initializing a native fallback
579
+ // Treating any non-empty string as truthy (the historical behavior) meant
580
+ // NAPI_RS_FORCE_WASI=false, NAPI_RS_FORCE_WASI=0, etc. inadvertently triggered
581
+ // the WASI path, causing ENOENT for packages shipped without a .wasi.cjs file.
582
+ //
583
+ // NAPI_RS_WASI_FLAVOR selects one exact generated flavor and implies strict
584
+ // WASI loading. It never crosses into another flavor or falls back to native.
585
+ const __napiWasiFlavors = ['wasm32-wasi']
586
+ const __napiWasiFlavor = process.env.NAPI_RS_WASI_FLAVOR
587
+ const __napiWasiFlavorRequested =
588
+ typeof __napiWasiFlavor === 'string' && __napiWasiFlavor.length > 0
589
+ if (
590
+ __napiWasiFlavorRequested &&
591
+ __napiWasiFlavors.indexOf(__napiWasiFlavor) === -1
592
+ ) {
593
+ throw new Error(
594
+ 'Unsupported WASI flavor "' +
595
+ __napiWasiFlavor +
596
+ '". Available flavors: ' +
597
+ __napiWasiFlavors.join(', '),
598
+ )
599
+ }
600
+ const forceWasiError = process.env.NAPI_RS_FORCE_WASI === 'error'
601
+ const forceWasi =
602
+ process.env.NAPI_RS_FORCE_WASI === 'true' ||
603
+ forceWasiError ||
604
+ __napiWasiFlavorRequested
605
+
606
+ if (!forceWasi) {
607
+ nativeBinding = requireNative()
608
+ __napiRequiredNativeBinding = nativeBinding
609
+ }
610
+
611
+ if (!nativeBinding || forceWasi) {
612
+ let wasiBinding = null
613
+ let wasiBindingLoaded = false
614
+ const wasiBindingErrors = []
615
+ const __napiWasiResolveCandidate = (specifier, isPackage, localArtifacts) => {
616
+ try {
617
+ require.resolve(specifier)
618
+ } catch (resolveError) {
619
+ if (!resolveError || resolveError.code !== 'MODULE_NOT_FOUND') {
620
+ throw resolveError
621
+ }
622
+ if (isPackage) {
623
+ try {
624
+ require.resolve(specifier + '/package.json')
625
+ } catch (packageError) {
626
+ if (packageError && packageError.code === 'MODULE_NOT_FOUND') {
627
+ return resolveError
628
+ }
629
+ // An exports restriction proves the package exists even when its
630
+ // package.json is not public. Preserve the root resolution failure.
631
+ throw resolveError
632
+ }
633
+ // The package exists but its main/export target is broken.
634
+ throw resolveError
635
+ }
636
+ return resolveError
637
+ }
638
+ if (localArtifacts) {
639
+ let artifactError = null
640
+ for (let i = 0; i < localArtifacts.length; i++) {
641
+ try {
642
+ require.resolve(localArtifacts[i])
643
+ return null
644
+ } catch (resolveError) {
645
+ if (!resolveError || resolveError.code !== 'MODULE_NOT_FOUND') {
646
+ throw resolveError
647
+ }
648
+ artifactError = resolveError
649
+ }
650
+ }
651
+ return artifactError
652
+ }
653
+ return null
654
+ }
655
+ if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === 'wasm32-wasi')) {
656
+ let candidateError = null
657
+ let candidateFailed = false
658
+ try {
659
+ candidateError = __napiWasiResolveCandidate('./publier-native.wasi.cjs', false, ['./publier-native.wasm32-wasi.debug.wasm', './publier-native.wasm32-wasi.wasm'])
660
+ candidateFailed = candidateError !== null
661
+ if (!candidateFailed) {
662
+ wasiBinding = require('./publier-native.wasi.cjs')
663
+ nativeBinding = wasiBinding
664
+ __napiLoadedBindingTarget = 'wasm32-wasi'
665
+ wasiBindingLoaded = true
666
+ }
667
+ } catch (err) {
668
+ candidateError = err
669
+ candidateFailed = true
670
+ }
671
+ if (candidateFailed) {
672
+ wasiBindingErrors.push(candidateError)
673
+ loadErrors.push(candidateError)
674
+ }
675
+ }
676
+ if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === 'wasm32-wasi')) {
677
+ let candidateError = null
678
+ let candidateFailed = false
679
+ try {
680
+ candidateError = __napiWasiResolveCandidate('@publier/native-wasm32-wasi', true, undefined)
681
+ candidateFailed = candidateError !== null
682
+ if (!candidateFailed) {
683
+ if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
684
+ const bindingPackageVersion = require('@publier/native-wasm32-wasi/package.json').version
685
+ if (bindingPackageVersion !== '0.1.1') {
686
+ throw new Error(`WASI binding package version mismatch, expected 0.1.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
687
+ }
688
+ }
689
+ wasiBinding = require('@publier/native-wasm32-wasi')
690
+ nativeBinding = wasiBinding
691
+ __napiLoadedBindingTarget = 'wasm32-wasi'
692
+ wasiBindingLoaded = true
693
+ }
694
+ } catch (err) {
695
+ candidateError = err
696
+ candidateFailed = true
697
+ }
698
+ if (candidateFailed) {
699
+ wasiBindingErrors.push(candidateError)
700
+ loadErrors.push(candidateError)
701
+ }
702
+ }
703
+ if (
704
+ !wasiBindingLoaded &&
705
+ forceWasi &&
706
+ !forceWasiError &&
707
+ !__napiWasiFlavorRequested
708
+ ) {
709
+ nativeBinding = requireNative()
710
+ __napiRequiredNativeBinding = nativeBinding
711
+ }
712
+ if ((forceWasiError || __napiWasiFlavorRequested) && !wasiBindingLoaded) {
713
+ const error = new Error(
714
+ __napiWasiFlavorRequested
715
+ ? 'WASI binding for flavor "' + __napiWasiFlavor + '" not found'
716
+ : 'WASI binding not found and NAPI_RS_FORCE_WASI is set to error',
717
+ )
718
+ error.cause = createLoadErrorChain(wasiBindingErrors)
719
+ throw error
720
+ }
721
+ }
722
+
723
+ if (!nativeBinding) {
724
+ if (loadErrors.length > 0) {
725
+ const error = new Error(
726
+ `Cannot find native binding. ` +
727
+ `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
728
+ 'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
729
+ )
730
+ // assign instead of the `new Error(message, { cause })` options form,
731
+ // which Node < 16.9 silently ignores
732
+ error.cause = createLoadErrorChain(loadErrors)
733
+ throw error
734
+ }
735
+ throw new Error(`Failed to load native binding`)
736
+ }
737
+
738
+ // A package can patch its own fallback in front of the load-failure check
739
+ // above, e.g. a WebContainer download through `napi-postinstall/fallback`.
740
+ // That fallback swaps `nativeBinding` for a generated WASI loader, which has
741
+ // already stamped its own flavor, while the target above still says 'native'.
742
+ // Take that flavor over, or the CommonJS stamp throws a conflict and the ESM
743
+ // export reports the wrong artifact. Three limits keep the conflict check:
744
+ // - only a binding this loader did not load itself, so a native addon whose
745
+ // `#[napi(module_exports)]` hook claims the name is still rejected;
746
+ // - only an own data property, read through its descriptor, so no addon
747
+ // getter runs here, and it must read back the same, as the stamp reads it;
748
+ // - only a flavor in `__napiWasiFlavors`, the ones this loader's own WASI
749
+ // chain can report ('wasm32-wasi' for a package without a WASI target).
750
+ // This is metadata and never fails a load: a throwing Proxy trap keeps 'native'.
751
+ if (
752
+ __napiLoadedBindingTarget === 'native' &&
753
+ nativeBinding !== __napiRequiredNativeBinding
754
+ ) {
755
+ try {
756
+ const __napiBindingTargetDescriptor = Object.getOwnPropertyDescriptor(
757
+ nativeBinding,
758
+ '__napiBindingTarget',
759
+ )
760
+ if (
761
+ __napiBindingTargetDescriptor &&
762
+ __napiWasiFlavors.indexOf(__napiBindingTargetDescriptor.value) !== -1 &&
763
+ nativeBinding.__napiBindingTarget === __napiBindingTargetDescriptor.value
764
+ ) {
765
+ __napiLoadedBindingTarget = __napiBindingTargetDescriptor.value
766
+ }
767
+ } catch {
768
+ // keep 'native'
769
+ }
770
+ }
771
+
772
+ function __napiStampBindingTarget(exportsObject, target) {
773
+ if (
774
+ Object.prototype.hasOwnProperty.call(exportsObject, '__napiBindingTarget')
775
+ ) {
776
+ if (exportsObject.__napiBindingTarget === target) {
777
+ // Already ours: the root entry aliases the object it loaded, so a WASI
778
+ // fallback candidate — or a `NAPI_RS_NATIVE_LIBRARY_PATH` override that
779
+ // is a generated loader — arrives already stamped with this same value.
780
+ return target
781
+ }
782
+ const error = new Error(
783
+ '`__napiBindingTarget` is reserved by the generated binding loader, but the loaded binding already exports it. Rename the export, e.g. #[napi(js_name = "...")].',
784
+ )
785
+ error.code = 'ERR_NAPI_BINDING_TARGET_CONFLICT'
786
+ throw error
787
+ }
788
+ if (!Object.isExtensible(exportsObject)) {
789
+ // A `#[napi(module_exports)]` hook may seal or freeze this object
790
+ // (`Object::seal` / `Object::freeze`). Reporting the artifact is metadata,
791
+ // never a reason to fail an otherwise successful load, so the stamp is
792
+ // skipped. What a consumer still sees then follows the entry point: the
793
+ // browser and deferred loaders declare `__napiBindingTarget` at module
794
+ // level and go on reporting it, while the CommonJS entries hand back this
795
+ // very object as `module.exports`, so there the value is absent.
796
+ return target
797
+ }
798
+ try {
799
+ // [[Define]], not [[Set]]: an ordinary assignment walks the prototype
800
+ // chain, so an inherited accessor could swallow the value or throw and
801
+ // fail an otherwise successful load. The descriptor is what a successful
802
+ // assignment would have produced.
803
+ Object.defineProperty(exportsObject, '__napiBindingTarget', {
804
+ configurable: true,
805
+ enumerable: true,
806
+ value: target,
807
+ writable: true,
808
+ })
809
+ } catch {
810
+ // Same rule as the non-extensible skip above: reporting the artifact is
811
+ // metadata, never a reason to fail an otherwise successful load. An exotic
812
+ // object (a Proxy whose defineProperty trap refuses) is skipped, not
813
+ // thrown over.
814
+ }
815
+ // The CommonJS loaders assign this return value so `cjs-module-lexer` — and
816
+ // therefore Node's CJS -> ESM named export detection — can see
817
+ // `__napiBindingTarget` statically.
818
+ return target
819
+ }
820
+ // Stamp before the alias, not after. The guard only reads `nativeBinding`
821
+ // (`hasOwnProperty` plus a comparison), which is safe against any addon
822
+ // accessor; an assignment is not, because a `#[napi(module_exports)]` hook can
823
+ // expose a getter reporting this very value and a setter that throws. So the
824
+ // assignment lands on the loader's own `module.exports`, still the original
825
+ // object here, and the alias below replaces it.
826
+ //
827
+ // The assignment is what keeps the marker a statically visible CommonJS export:
828
+ // `cjs-module-lexer` is Node's CJS -> ESM named export detection, it cannot see
829
+ // a bare call, and the later `module.exports = nativeBinding` does not undo the
830
+ // detection. The assignment itself always succeeds — its target is this
831
+ // loader's own, still extensible `module.exports` — and the alias below then
832
+ // discards the value it wrote. What a consumer reads is whatever the guard put
833
+ // on `nativeBinding`, so on a frozen binding, where the guard skips, the
834
+ // linked import resolves to `undefined`.
835
+ module.exports.__napiBindingTarget = __napiStampBindingTarget(nativeBinding, __napiLoadedBindingTarget)
836
+ module.exports = nativeBinding
837
+ module.exports.analyticsGenerateBodyScripts = nativeBinding.analyticsGenerateBodyScripts
838
+ module.exports.analyticsGenerateScripts = nativeBinding.analyticsGenerateScripts
839
+ module.exports.asyncapiSourceBuild = nativeBinding.asyncapiSourceBuild
840
+ module.exports.blogFilterByTag = nativeBinding.blogFilterByTag
841
+ module.exports.blogFilterPublished = nativeBinding.blogFilterPublished
842
+ module.exports.blogReadingTime = nativeBinding.blogReadingTime
843
+ module.exports.blogSortByDate = nativeBinding.blogSortByDate
844
+ module.exports.blogTagCounts = nativeBinding.blogTagCounts
845
+ module.exports.buildHook = nativeBinding.buildHook
846
+ module.exports.configResolvePublierConfig = nativeBinding.configResolvePublierConfig
847
+ module.exports.configResolveShellConfig = nativeBinding.configResolveShellConfig
848
+ module.exports.configShouldRenderPage = nativeBinding.configShouldRenderPage
849
+ module.exports.contentGenerateLlmsTxt = nativeBinding.contentGenerateLlmsTxt
850
+ module.exports.contentGenerateOgImageMarkup = nativeBinding.contentGenerateOgImageMarkup
851
+ module.exports.contentGenerateRobotsTxt = nativeBinding.contentGenerateRobotsTxt
852
+ module.exports.contentGenerateSkillMd = nativeBinding.contentGenerateSkillMd
853
+ module.exports.contentGenerateTwitterMeta = nativeBinding.contentGenerateTwitterMeta
854
+ module.exports.contentGetSlug = nativeBinding.contentGetSlug
855
+ module.exports.navigationActiveIndex = nativeBinding.navigationActiveIndex
856
+ module.exports.navigationBuildSidebar = nativeBinding.navigationBuildSidebar
857
+ module.exports.navigationMatchNavPath = nativeBinding.navigationMatchNavPath
858
+ module.exports.openapiBuildCustomSampleMap = nativeBinding.openapiBuildCustomSampleMap
859
+ module.exports.openapiBuildInstanceId = nativeBinding.openapiBuildInstanceId
860
+ module.exports.openapiDecodePlaceholders = nativeBinding.openapiDecodePlaceholders
861
+ module.exports.openapiExtractEndpoints = nativeBinding.openapiExtractEndpoints
862
+ module.exports.openapiGenerateFiles = nativeBinding.openapiGenerateFiles
863
+ module.exports.openapiGetMediaTypeExample = nativeBinding.openapiGetMediaTypeExample
864
+ module.exports.openapiGetSnippetClient = nativeBinding.openapiGetSnippetClient
865
+ module.exports.openapiHarFromOperation = nativeBinding.openapiHarFromOperation
866
+ module.exports.openapiMergeSpecs = nativeBinding.openapiMergeSpecs
867
+ module.exports.openapiNavigationBuild = nativeBinding.openapiNavigationBuild
868
+ module.exports.openapiParseAsyncApiSpec = nativeBinding.openapiParseAsyncApiSpec
869
+ module.exports.openapiParseOpenapiSpec = nativeBinding.openapiParseOpenapiSpec
870
+ module.exports.openapiRenderApiPage = nativeBinding.openapiRenderApiPage
871
+ module.exports.openapiRenderApiPlayground = nativeBinding.openapiRenderApiPlayground
872
+ module.exports.openapiRenderApiReference = nativeBinding.openapiRenderApiReference
873
+ module.exports.openapiRenderApiReferenceShell = nativeBinding.openapiRenderApiReferenceShell
874
+ module.exports.openapiRenderAsyncChannel = nativeBinding.openapiRenderAsyncChannel
875
+ module.exports.openapiRenderAsyncMessage = nativeBinding.openapiRenderAsyncMessage
876
+ module.exports.openapiRenderCodeSamples = nativeBinding.openapiRenderCodeSamples
877
+ module.exports.openapiRenderCollapsibleSection = nativeBinding.openapiRenderCollapsibleSection
878
+ module.exports.openapiRenderMethodBadge = nativeBinding.openapiRenderMethodBadge
879
+ module.exports.openapiRenderParamField = nativeBinding.openapiRenderParamField
880
+ module.exports.openapiRenderRequestExample = nativeBinding.openapiRenderRequestExample
881
+ module.exports.openapiRenderResponseExample = nativeBinding.openapiRenderResponseExample
882
+ module.exports.openapiRenderResponseField = nativeBinding.openapiRenderResponseField
883
+ module.exports.openapiRenderSchemaRow = nativeBinding.openapiRenderSchemaRow
884
+ module.exports.openapiRenderSchemaView = nativeBinding.openapiRenderSchemaView
885
+ module.exports.openapiResolveBaseUrl = nativeBinding.openapiResolveBaseUrl
886
+ module.exports.openapiResolveRefs = nativeBinding.openapiResolveRefs
887
+ module.exports.openapiSourceBuild = nativeBinding.openapiSourceBuild
888
+ module.exports.pluginHook = nativeBinding.pluginHook
889
+ module.exports.primitivesColorSwatchScript = nativeBinding.primitivesColorSwatchScript
890
+ module.exports.primitivesColorSwatchStyle = nativeBinding.primitivesColorSwatchStyle
891
+ module.exports.primitivesCopyButtonScript = nativeBinding.primitivesCopyButtonScript
892
+ module.exports.primitivesCopyButtonStyle = nativeBinding.primitivesCopyButtonStyle
893
+ module.exports.primitivesRenderAccordion = nativeBinding.primitivesRenderAccordion
894
+ module.exports.primitivesRenderAccordionItem = nativeBinding.primitivesRenderAccordionItem
895
+ module.exports.primitivesRenderColorSwatch = nativeBinding.primitivesRenderColorSwatch
896
+ module.exports.primitivesRenderCopyButton = nativeBinding.primitivesRenderCopyButton
897
+ module.exports.primitivesRenderImageZoom = nativeBinding.primitivesRenderImageZoom
898
+ module.exports.primitivesRenderTabPanel = nativeBinding.primitivesRenderTabPanel
899
+ module.exports.primitivesRenderTabs = nativeBinding.primitivesRenderTabs
900
+ module.exports.primitivesRenderTooltip = nativeBinding.primitivesRenderTooltip
901
+ module.exports.primitivesRenderViewAnimation = nativeBinding.primitivesRenderViewAnimation
902
+ module.exports.primitivesTabsScript = nativeBinding.primitivesTabsScript
903
+ module.exports.primitivesViewAnimationScript = nativeBinding.primitivesViewAnimationScript
904
+ module.exports.primitivesViewAnimationStyle = nativeBinding.primitivesViewAnimationStyle
905
+ module.exports.remarkCollectSections = nativeBinding.remarkCollectSections
906
+ module.exports.remarkResolveSnippet = nativeBinding.remarkResolveSnippet
907
+ module.exports.remarkTransformAsides = nativeBinding.remarkTransformAsides
908
+ module.exports.remarkVarsSubstitute = nativeBinding.remarkVarsSubstitute
909
+ module.exports.rssGenerateFeed = nativeBinding.rssGenerateFeed
910
+ module.exports.searchEntryToPage = nativeBinding.searchEntryToPage
911
+ module.exports.searchExtractStructuredData = nativeBinding.searchExtractStructuredData
912
+ module.exports.searchReadMetaYaml = nativeBinding.searchReadMetaYaml
913
+ module.exports.shellAnnouncementBannerScript = nativeBinding.shellAnnouncementBannerScript
914
+ module.exports.shellBuildBannerInitScript = nativeBinding.shellBuildBannerInitScript
915
+ module.exports.shellBuildGlobPattern = nativeBinding.shellBuildGlobPattern
916
+ module.exports.shellBuildHeaders = nativeBinding.shellBuildHeaders
917
+ module.exports.shellBuildLicenseErrorMessage = nativeBinding.shellBuildLicenseErrorMessage
918
+ module.exports.shellBuildThemeInitScript = nativeBinding.shellBuildThemeInitScript
919
+ module.exports.shellCacheControl = nativeBinding.shellCacheControl
920
+ module.exports.shellCollectTailwindClassTokens = nativeBinding.shellCollectTailwindClassTokens
921
+ module.exports.shellComposeTailwindEntry = nativeBinding.shellComposeTailwindEntry
922
+ module.exports.shellGenerateId = nativeBinding.shellGenerateId
923
+ module.exports.shellInjectBodyScripts = nativeBinding.shellInjectBodyScripts
924
+ module.exports.shellInjectHeadScripts = nativeBinding.shellInjectHeadScripts
925
+ module.exports.shellLazyUpgradeScript = nativeBinding.shellLazyUpgradeScript
926
+ module.exports.shellListThemes = nativeBinding.shellListThemes
927
+ module.exports.shellNavActiveUpdateScript = nativeBinding.shellNavActiveUpdateScript
928
+ module.exports.shellOpenInAiScript = nativeBinding.shellOpenInAiScript
929
+ module.exports.shellPlanDefaultRoutes = nativeBinding.shellPlanDefaultRoutes
930
+ module.exports.shellPlanDocsSlug = nativeBinding.shellPlanDocsSlug
931
+ module.exports.shellPlanRehypePlugins = nativeBinding.shellPlanRehypePlugins
932
+ module.exports.shellPlanRemarkPlugins = nativeBinding.shellPlanRemarkPlugins
933
+ module.exports.shellRenderAnnouncementBanner = nativeBinding.shellRenderAnnouncementBanner
934
+ module.exports.shellRenderAside = nativeBinding.shellRenderAside
935
+ module.exports.shellRenderBadge = nativeBinding.shellRenderBadge
936
+ module.exports.shellRenderBaseLayout = nativeBinding.shellRenderBaseLayout
937
+ module.exports.shellRenderBlogIndex = nativeBinding.shellRenderBlogIndex
938
+ module.exports.shellRenderBlogSlug = nativeBinding.shellRenderBlogSlug
939
+ module.exports.shellRenderBreadcrumbs = nativeBinding.shellRenderBreadcrumbs
940
+ module.exports.shellRenderCard = nativeBinding.shellRenderCard
941
+ module.exports.shellRenderCardGrid = nativeBinding.shellRenderCardGrid
942
+ module.exports.shellRenderChangelogEntry = nativeBinding.shellRenderChangelogEntry
943
+ module.exports.shellRenderChangelogFooter = nativeBinding.shellRenderChangelogFooter
944
+ module.exports.shellRenderChangelogHeader = nativeBinding.shellRenderChangelogHeader
945
+ module.exports.shellRenderCodeGroup = nativeBinding.shellRenderCodeGroup
946
+ module.exports.shellRenderColumns = nativeBinding.shellRenderColumns
947
+ module.exports.shellRenderDocsLayout = nativeBinding.shellRenderDocsLayout
948
+ module.exports.shellRenderDocsSlug = nativeBinding.shellRenderDocsSlug
949
+ module.exports.shellRenderFileTree = nativeBinding.shellRenderFileTree
950
+ module.exports.shellRenderFileTreeNode = nativeBinding.shellRenderFileTreeNode
951
+ module.exports.shellRenderIcon = nativeBinding.shellRenderIcon
952
+ module.exports.shellRenderLastModified = nativeBinding.shellRenderLastModified
953
+ module.exports.shellRenderLinkButton = nativeBinding.shellRenderLinkButton
954
+ module.exports.shellRenderLinkCard = nativeBinding.shellRenderLinkCard
955
+ module.exports.shellRenderNotFound = nativeBinding.shellRenderNotFound
956
+ module.exports.shellRenderOpenInAi = nativeBinding.shellRenderOpenInAi
957
+ module.exports.shellRenderPackageInstall = nativeBinding.shellRenderPackageInstall
958
+ module.exports.shellRenderPanels = nativeBinding.shellRenderPanels
959
+ module.exports.shellRenderSearchButton = nativeBinding.shellRenderSearchButton
960
+ module.exports.shellRenderSidebar = nativeBinding.shellRenderSidebar
961
+ module.exports.shellRenderSkipLink = nativeBinding.shellRenderSkipLink
962
+ module.exports.shellRenderSteps = nativeBinding.shellRenderSteps
963
+ module.exports.shellRenderTableOfContents = nativeBinding.shellRenderTableOfContents
964
+ module.exports.shellRenderTabs = nativeBinding.shellRenderTabs
965
+ module.exports.shellRenderThemeToggle = nativeBinding.shellRenderThemeToggle
966
+ module.exports.shellRenderTile = nativeBinding.shellRenderTile
967
+ module.exports.shellRenderTileGrid = nativeBinding.shellRenderTileGrid
968
+ module.exports.shellRenderTopNav = nativeBinding.shellRenderTopNav
969
+ module.exports.shellRenderTopNavMobile = nativeBinding.shellRenderTopNavMobile
970
+ module.exports.shellRenderUpdateBadge = nativeBinding.shellRenderUpdateBadge
971
+ module.exports.shellRenderVersionSwitcher = nativeBinding.shellRenderVersionSwitcher
972
+ module.exports.shellResolvePrefetch = nativeBinding.shellResolvePrefetch
973
+ module.exports.shellResolveSnippetsConfig = nativeBinding.shellResolveSnippetsConfig
974
+ module.exports.shellRewriteHead = nativeBinding.shellRewriteHead
975
+ module.exports.shellRewriteModulepreload = nativeBinding.shellRewriteModulepreload
976
+ module.exports.shellSearchButtonScript = nativeBinding.shellSearchButtonScript
977
+ module.exports.shellSearchDialogCss = nativeBinding.shellSearchDialogCss
978
+ module.exports.shellSearchDialogInnerHtml = nativeBinding.shellSearchDialogInnerHtml
979
+ module.exports.shellSearchDialogScript = nativeBinding.shellSearchDialogScript
980
+ module.exports.shellSidebarHeightInitScript = nativeBinding.shellSidebarHeightInitScript
981
+ module.exports.shellSidebarScrollInitScript = nativeBinding.shellSidebarScrollInitScript
982
+ module.exports.shellTableOfContentsScript = nativeBinding.shellTableOfContentsScript
983
+ module.exports.tailwindComposeThemeCss = nativeBinding.tailwindComposeThemeCss
984
+ module.exports.tailwindReadPresetCss = nativeBinding.tailwindReadPresetCss
985
+ module.exports.tailwindResolveTheme = nativeBinding.tailwindResolveTheme
986
+ module.exports.verifyLicense = nativeBinding.verifyLicense