mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-03 01:29:56 +00:00
fix(release): recognize Bun built-in modules (#143436)
This commit is contained in:
parent
e4a6d50073
commit
2178c8eafc
3 changed files with 23 additions and 0 deletions
|
|
@ -26,6 +26,7 @@ export function packageNameFromSpecifier(specifier: string) {
|
|||
typeof specifier !== "string" ||
|
||||
specifier.startsWith(".") ||
|
||||
specifier.startsWith("/") ||
|
||||
specifier.startsWith("bun:") ||
|
||||
specifier.startsWith("node:") ||
|
||||
specifier.startsWith("#")
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -1151,6 +1151,27 @@ describe("collectInstalledRootDependencyManifestErrors", () => {
|
|||
}
|
||||
});
|
||||
|
||||
it("accepts Bun built-in modules without npm dependency declarations", () => {
|
||||
const packageRoot = makeInstalledPackageRoot();
|
||||
|
||||
try {
|
||||
writePackageFile(packageRoot, "package.json", {
|
||||
version: "2026.9.9",
|
||||
dependencies: {},
|
||||
});
|
||||
mkdirSync(join(packageRoot, "dist"), { recursive: true });
|
||||
writeFileSync(
|
||||
join(packageRoot, "dist", "bun-sqlite-library.js"),
|
||||
'import { Database } from "bun:sqlite";\nconst { dlopen } = require("bun:ffi");\nexport { Database, dlopen };\n',
|
||||
"utf8",
|
||||
);
|
||||
|
||||
expect(collectInstalledRootDependencyManifestErrors(packageRoot)).toStrictEqual([]);
|
||||
} finally {
|
||||
rmSync(packageRoot, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
const companionSource = 'const voice = require("@discordjs/voice");\nexport { voice };\n';
|
||||
const companionOwnership = {
|
||||
chunks: {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ describe("scripts/lib/plugin-package-dependencies.mts", () => {
|
|||
expect(packageNameFromSpecifier("plain-pkg/subpath")).toBe("plain-pkg");
|
||||
expect(packageNameFromSpecifier("@scope")).toBeNull();
|
||||
expect(packageNameFromSpecifier("@scope/")).toBeNull();
|
||||
expect(packageNameFromSpecifier("bun:sqlite")).toBeNull();
|
||||
expect(packageNameFromSpecifier("node:fs")).toBeNull();
|
||||
expect(packageNameFromSpecifier("./local")).toBeNull();
|
||||
expect(packageNameFromSpecifier("/absolute")).toBeNull();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue