Initial curated CertScope source from fe2bbe3ca5c98bf64be26a09c6c58ee805a7f87e
This commit is contained in:
commit
7348faf6c0
65 files changed
+12509
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { writeFile } from "node:fs/promises";
|
||||
|
||||
const npmArgs = [
|
||||
"sbom",
|
||||
"--package-lock-only",
|
||||
"--omit=dev",
|
||||
"--sbom-format=cyclonedx",
|
||||
"--sbom-type=application",
|
||||
];
|
||||
const command = process.platform === "win32" ? (process.env.ComSpec || "cmd.exe") : "npm";
|
||||
const commandArgs = process.platform === "win32" ? ["/d", "/s", "/c", "npm.cmd " + npmArgs.join(" ")] : npmArgs;
|
||||
const output = execFileSync(command, commandArgs, { encoding: "utf8", stdio: ["ignore", "pipe", "inherit"] });
|
||||
|
||||
await writeFile("certscope-sbom.cdx.json", output, "utf8");
|
||||
console.log("Wrote certscope-sbom.cdx.json");
|
||||
@@ -0,0 +1,19 @@
|
||||
import { cp, mkdir } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath, pathToFileURL } from "node:url";
|
||||
|
||||
const projectRoot = path.resolve(fileURLToPath(new URL("../", import.meta.url)));
|
||||
const standaloneRoot = path.join(projectRoot, ".next", "standalone");
|
||||
|
||||
await mkdir(path.join(standaloneRoot, ".next", "static"), { recursive: true });
|
||||
await cp(path.join(projectRoot, ".next", "static"), path.join(standaloneRoot, ".next", "static"), { recursive: true, force: true });
|
||||
|
||||
await mkdir(path.join(standaloneRoot, "public"), { recursive: true });
|
||||
try {
|
||||
await cp(path.join(projectRoot, "public"), path.join(standaloneRoot, "public"), { recursive: true, force: true });
|
||||
} catch (error) {
|
||||
if (error?.code !== "ENOENT") throw error;
|
||||
}
|
||||
|
||||
process.chdir(standaloneRoot);
|
||||
await import(pathToFileURL(path.join(standaloneRoot, "server.js")).href);
|
||||
Reference in new issue
Block a user