chore: import upstream snapshot with attribution
Deploy (to testing) and Test Playground Preview Worker / Deploy Playground Preview Worker (testing) (push) Has been skipped
Deploy Workers Shared Staging / Deploy Workers Shared Staging (push) Failing after 0s
Prerelease / build (push) Has been skipped
Handle Changesets / Handle Changesets (push) Has been cancelled
Semgrep OSS scan / semgrep-oss (push) Has been cancelled
Deploy (to testing) and Test Playground Preview Worker / Deploy Playground Preview Worker (testing) (push) Has been skipped
Deploy Workers Shared Staging / Deploy Workers Shared Staging (push) Failing after 0s
Prerelease / build (push) Has been skipped
Handle Changesets / Handle Changesets (push) Has been cancelled
Semgrep OSS scan / semgrep-oss (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
import { execSync, spawnSync } from "node:child_process";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const projectRoot = path.resolve(__dirname, "../..");
|
||||
|
||||
function getPackagePaths() {
|
||||
const stdout = execSync(
|
||||
'pnpm list --filter="./packages/*" --recursive --depth=-1 --parseable',
|
||||
{ cwd: projectRoot, encoding: "utf8" }
|
||||
);
|
||||
return stdout.split("\n").filter((pkgPath) => path.isAbsolute(pkgPath));
|
||||
}
|
||||
|
||||
function getPackage(pkgPath) {
|
||||
const json = fs.readFileSync(path.join(pkgPath, "package.json"), "utf8");
|
||||
return {
|
||||
path: pkgPath,
|
||||
json: JSON.parse(json),
|
||||
};
|
||||
}
|
||||
|
||||
function getPackages() {
|
||||
return getPackagePaths().map(getPackage);
|
||||
}
|
||||
|
||||
export function getPackagesForPrerelease() {
|
||||
return getPackages().filter((pkg) => pkg.json["workers-sdk"]?.prerelease);
|
||||
}
|
||||
|
||||
const pkgs = getPackagesForPrerelease();
|
||||
|
||||
spawnSync(
|
||||
"pnpm",
|
||||
[
|
||||
"dlx",
|
||||
"pkg-pr-new",
|
||||
"publish",
|
||||
"--pnpm",
|
||||
"--compact",
|
||||
"--no-template",
|
||||
...pkgs.map((pkg) => pkg.path),
|
||||
],
|
||||
{
|
||||
stdio: "inherit",
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user