@dvaji/cheerox 0.1.2 → 0.1.3
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/Cargo.lock +1 -1
- package/Cargo.toml +1 -1
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/cheerox.darwin-arm64.node +0 -0
- package/cheerox.darwin-x64.node +0 -0
- package/cheerox.linux-arm64-gnu.node +0 -0
- package/cheerox.linux-arm64-musl.node +0 -0
- package/cheerox.linux-x64-gnu.node +0 -0
- package/cheerox.linux-x64-musl.node +0 -0
- package/cheerox.win32-arm64-msvc.node +0 -0
- package/cheerox.win32-x64-msvc.node +0 -0
- package/dist/{cheerio-compat-DcnYK9OB.cjs → cheerio-compat-8HucV2qE.cjs} +9 -7
- package/dist/cheerio-compat-8HucV2qE.cjs.map +1 -0
- package/dist/{cheerio-compat-DRLPzBdX.d.mts → cheerio-compat-BM4_lqVU.d.mts} +3 -3
- package/dist/{cheerio-compat-DRsINTwV.d.ts → cheerio-compat-BnFvIIuE.d.cts} +3 -3
- package/dist/{cheerio-compat-DRsINTwV.d.cts → cheerio-compat-BnFvIIuE.d.ts} +3 -3
- package/dist/{cheerio-compat-BKkfJEAr.mjs → cheerio-compat-Dwarm-h8.mjs} +9 -7
- package/dist/cheerio-compat-Dwarm-h8.mjs.map +1 -0
- package/dist/cheerio-compat.cjs +1 -1
- package/dist/cheerio-compat.d.cts +1 -1
- package/dist/cheerio-compat.d.mts +1 -1
- package/dist/cheerio-compat.d.ts +1 -1
- package/dist/cheerio-compat.mjs +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/{modern-CvXcTn82.mjs → modern-BwcwZX6l.mjs} +2 -2
- package/dist/{modern-CvXcTn82.mjs.map → modern-BwcwZX6l.mjs.map} +1 -1
- package/dist/{modern-CHQGP0Yt.cjs → modern-DMcsyA4b.cjs} +2 -2
- package/dist/{modern-CHQGP0Yt.cjs.map → modern-DMcsyA4b.cjs.map} +1 -1
- package/dist/modern.cjs +2 -2
- package/dist/modern.mjs +2 -2
- package/dist/{nodes-jbWWhssj.cjs → nodes-Be5sB8rQ.cjs} +23 -15
- package/dist/nodes-Be5sB8rQ.cjs.map +1 -0
- package/dist/{nodes-sYxb5qyZ.mjs → nodes-C95i5k2P.mjs} +23 -15
- package/dist/nodes-C95i5k2P.mjs.map +1 -0
- package/dist/slim.cjs +1 -1
- package/dist/slim.mjs +1 -1
- package/native/src/lib.rs +507 -0
- package/package.json +1 -1
- package/src/cheerio-compat.ts +14 -4
- package/src/native.ts +23 -9
- package/dist/cheerio-compat-BKkfJEAr.mjs.map +0 -1
- package/dist/cheerio-compat-DcnYK9OB.cjs.map +0 -1
- package/dist/nodes-jbWWhssj.cjs.map +0 -1
- package/dist/nodes-sYxb5qyZ.mjs.map +0 -1
package/dist/modern.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_nodes = require("./nodes-
|
|
3
|
-
const require_modern = require("./modern-
|
|
2
|
+
const require_nodes = require("./nodes-Be5sB8rQ.cjs");
|
|
3
|
+
const require_modern = require("./modern-DMcsyA4b.cjs");
|
|
4
4
|
exports.configureWorkers = require_modern.configureWorkers;
|
|
5
5
|
exports.contains = require_modern.contains;
|
|
6
6
|
exports.createAPI = require_modern.createAPI;
|
package/dist/modern.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ft as nativeStatus } from "./nodes-
|
|
2
|
-
import { a as flattenOptions, c as loadAsync, d as fromURL, f as loadBuffer, h as workerPoolInfo, i as extractAll, l as merge, m as configureWorkers, n as createAPI, o as load, p as stringStream, r as dom, s as loadAll, t as contains, u as decodeStream } from "./modern-
|
|
1
|
+
import { ft as nativeStatus } from "./nodes-C95i5k2P.mjs";
|
|
2
|
+
import { a as flattenOptions, c as loadAsync, d as fromURL, f as loadBuffer, h as workerPoolInfo, i as extractAll, l as merge, m as configureWorkers, n as createAPI, o as load, p as stringStream, r as dom, s as loadAll, t as contains, u as decodeStream } from "./modern-BwcwZX6l.mjs";
|
|
3
3
|
export { configureWorkers, contains, createAPI, decodeStream, dom, extractAll, flattenOptions, fromURL, load, loadAll, loadAsync, loadBuffer, merge, nativeStatus, stringStream, workerPoolInfo };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
let node_module = require("node:module");
|
|
2
|
-
let node_fs = require("node:fs");
|
|
3
2
|
let node_path = require("node:path");
|
|
4
3
|
let node_url = require("node:url");
|
|
5
4
|
// src/codec.ts
|
|
@@ -262,6 +261,21 @@ let bindingError;
|
|
|
262
261
|
function packageDirectory() {
|
|
263
262
|
return typeof __dirname === "string" ? __dirname : (0, node_path.dirname)((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
|
|
264
263
|
}
|
|
264
|
+
/** The platform directory component used by binary names and companion packages. */
|
|
265
|
+
function platformComponent() {
|
|
266
|
+
const libc = process.platform === "linux" ? (process.report?.getReport())?.header?.glibcVersionRuntime ? "gnu" : "musl" : void 0;
|
|
267
|
+
return `${process.platform}-${process.arch}${libc ? `-${libc}` : process.platform === "win32" ? "-msvc" : ""}`;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Where the native addon may be found, most preferred first: the
|
|
271
|
+
* platform-specific companion package published alongside the main package
|
|
272
|
+
* (`@dvaji/cheerox-<platform>`), then the binaries bundled with the package
|
|
273
|
+
* (or present in a parent directory for source checkouts).
|
|
274
|
+
*/
|
|
275
|
+
function nativeBindingCandidates(platform, directories) {
|
|
276
|
+
const names = [`cheerox.${platform}.node`, "cheerox.node"];
|
|
277
|
+
return [`@dvaji/cheerox-${platform}`, ...new Set(directories.flatMap((directory) => names.map((name) => (0, node_path.join)(directory, name))))];
|
|
278
|
+
}
|
|
265
279
|
/** Resolve the native addon bundled with the npm package. */
|
|
266
280
|
function nativeBinding() {
|
|
267
281
|
if (attempted) return cached;
|
|
@@ -269,20 +283,14 @@ function nativeBinding() {
|
|
|
269
283
|
const moduleDirectory = packageDirectory();
|
|
270
284
|
const require$1 = (0, node_module.createRequire)((0, node_path.join)(moduleDirectory, "cheerox-loader.cjs"));
|
|
271
285
|
const directories = [moduleDirectory, (0, node_path.dirname)(moduleDirectory)];
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
try {
|
|
278
|
-
const loaded = require$1(candidate);
|
|
279
|
-
if (typeof loaded.NativeDocument === "function") {
|
|
280
|
-
cached = wrapNativeBinding(loaded);
|
|
281
|
-
return cached;
|
|
282
|
-
}
|
|
283
|
-
} catch (error) {
|
|
284
|
-
bindingError ??= error;
|
|
286
|
+
for (const candidate of nativeBindingCandidates(platformComponent(), directories)) try {
|
|
287
|
+
const loaded = require$1(candidate);
|
|
288
|
+
if (typeof loaded.NativeDocument === "function") {
|
|
289
|
+
cached = wrapNativeBinding(loaded);
|
|
290
|
+
return cached;
|
|
285
291
|
}
|
|
292
|
+
} catch (error) {
|
|
293
|
+
bindingError ??= error;
|
|
286
294
|
}
|
|
287
295
|
}
|
|
288
296
|
function requireNative() {
|
|
@@ -4207,4 +4215,4 @@ Object.defineProperty(exports, "writeCount", {
|
|
|
4207
4215
|
}
|
|
4208
4216
|
});
|
|
4209
4217
|
|
|
4210
|
-
//# sourceMappingURL=nodes-
|
|
4218
|
+
//# sourceMappingURL=nodes-Be5sB8rQ.cjs.map
|