mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
fix(docker): support .mjs entrypoints in images and e2e
This commit is contained in:
@@ -7,9 +7,9 @@ import { join, resolve } from "node:path";
|
||||
type PackFile = { path: string };
|
||||
type PackResult = { files?: PackFile[] };
|
||||
|
||||
const requiredPaths = [
|
||||
"dist/index.js",
|
||||
"dist/entry.js",
|
||||
const requiredPathGroups = [
|
||||
["dist/index.js", "dist/index.mjs"],
|
||||
["dist/entry.js", "dist/entry.mjs"],
|
||||
"dist/plugin-sdk/index.js",
|
||||
"dist/plugin-sdk/index.d.ts",
|
||||
"dist/build-info.json",
|
||||
@@ -82,7 +82,14 @@ function main() {
|
||||
const files = results.flatMap((entry) => entry.files ?? []);
|
||||
const paths = new Set(files.map((file) => file.path));
|
||||
|
||||
const missing = requiredPaths.filter((path) => !paths.has(path));
|
||||
const missing = requiredPathGroups
|
||||
.flatMap((group) => {
|
||||
if (Array.isArray(group)) {
|
||||
return group.some((path) => paths.has(path)) ? [] : [group.join(" or ")];
|
||||
}
|
||||
return paths.has(group) ? [] : [group];
|
||||
})
|
||||
.toSorted();
|
||||
const forbidden = [...paths].filter((path) =>
|
||||
forbiddenPrefixes.some((prefix) => path.startsWith(prefix)),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user