Revert "build: allow node package depends on workspace packages (#11892)"

This reverts commit c00671dd84.
This commit is contained in:
liuyi
2025-04-23 19:24:51 +08:00
parent c00671dd84
commit 5d9a3aac5b
28 changed files with 327 additions and 328 deletions

View File

@@ -1,21 +1,15 @@
/** @type {import('.')} */
let binding;
try {
binding = require('./server-native.node');
} catch {
binding =
process.arch === 'arm64'
? require('./server-native.arm64.node')
: process.arch === 'arm'
? require('./server-native.armv7.node')
: require('./server-native.x64.node');
}
import { createRequire } from 'node:module';
module.exports.mergeUpdatesInApplyWay = binding.mergeUpdatesInApplyWay;
module.exports.verifyChallengeResponse = binding.verifyChallengeResponse;
module.exports.mintChallengeResponse = binding.mintChallengeResponse;
module.exports.getMime = binding.getMime;
module.exports.Tokenizer = binding.Tokenizer;
module.exports.fromModelName = binding.fromModelName;
module.exports.htmlSanitize = binding.htmlSanitize;
module.exports.parseDoc = binding.parseDoc;
const require = createRequire(import.meta.url);
/** @type {import('.')} */
const binding = require('./server-native.node');
export const mergeUpdatesInApplyWay = binding.mergeUpdatesInApplyWay;
export const verifyChallengeResponse = binding.verifyChallengeResponse;
export const mintChallengeResponse = binding.mintChallengeResponse;
export const getMime = binding.getMime;
export const Tokenizer = binding.Tokenizer;
export const fromModelName = binding.fromModelName;
export const htmlSanitize = binding.htmlSanitize;
export const parseDoc = binding.parseDoc;

View File

@@ -4,6 +4,7 @@
"engines": {
"node": ">= 10.16.0 < 11 || >= 11.8.0"
},
"type": "module",
"main": "./index.js",
"module": "./index.js",
"types": "index.d.ts",