mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 12:00:44 +00:00
fix(release): reject staged runtime deps in packs
This commit is contained in:
@@ -18,6 +18,7 @@ import { createConnection as createNetConnection, createServer as createNetServe
|
||||
import { tmpdir } from "node:os";
|
||||
import { dirname, join, resolve, win32 as pathWin32 } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { assertNoBundledRuntimeDepsStagingDebris } from "../src/infra/package-dist-inventory.ts";
|
||||
|
||||
const SCRIPT_PATH = fileURLToPath(import.meta.url);
|
||||
const PUBLISHED_INSTALLER_BASE_URL = "https://openclaw.ai";
|
||||
@@ -482,7 +483,8 @@ function isPackagedDistPath(relativePath) {
|
||||
return true;
|
||||
}
|
||||
|
||||
async function writePackageDistInventoryForCandidate(params) {
|
||||
export async function writePackageDistInventoryForCandidate(params) {
|
||||
await assertNoBundledRuntimeDepsStagingDebris(params.sourceDir);
|
||||
const dryRun = await runCommand(
|
||||
npmCommand(),
|
||||
["pack", "--dry-run", "--ignore-scripts", "--json"],
|
||||
|
||||
@@ -15,6 +15,7 @@ import { tmpdir } from "node:os";
|
||||
import { dirname, join, resolve } from "node:path";
|
||||
import { pathToFileURL } from "node:url";
|
||||
import {
|
||||
isBundledRuntimeDepsInstallStagePath,
|
||||
PACKAGE_DIST_INVENTORY_RELATIVE_PATH,
|
||||
writePackageDistInventory,
|
||||
} from "../src/infra/package-dist-inventory.ts";
|
||||
@@ -585,6 +586,7 @@ export function collectForbiddenPackPaths(paths: Iterable<string>): string[] {
|
||||
return [...paths]
|
||||
.filter(
|
||||
(path) =>
|
||||
isBundledRuntimeDepsInstallStagePath(path) ||
|
||||
forbiddenPrefixes.some((prefix) => path.startsWith(prefix)) ||
|
||||
/(^|\/)\.openclaw-runtime-deps-[^/]+(\/|$)/u.test(path) ||
|
||||
path.endsWith("/.openclaw-runtime-deps-stamp.json") ||
|
||||
|
||||
Reference in New Issue
Block a user