Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion scripts/build-wordpress-plugin-zip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ import { assembleWordpressPluginZip } from "./lib/assemble-wordpress-plugin-zip.
const execFileAsync = promisify(execFile)
const repoRoot = resolve(import.meta.dirname, "..")

await execFileAsync("npm", ["run", "release:package"], {
const releasePackage = await execFileAsync("npm", ["run", "release:package"], {
cwd: repoRoot,
env: process.env,
maxBuffer: 1024 * 1024 * 20,
})
process.stdout.write(releasePackage.stdout)
process.stderr.write(releasePackage.stderr)

const outputZip = await assembleWordpressPluginZip(repoRoot)
console.log(`Built ${outputZip}`)
6 changes: 4 additions & 2 deletions tests/release-package-coverage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ await writeFile(staleDistPath, "export const staleBuild = true\n")

let stdout = ""
try {
({ stdout } = await execFileAsync("npm", ["run", "release:package"], {
({ stdout } = await execFileAsync("npm", ["run", "package:wordpress-plugin"], {
cwd: repositoryRoot,
env: {
...process.env,
Expand All @@ -53,7 +53,9 @@ try {
} finally {
await writeFile(staleDistPath, currentDist)
}
const artifacts = JSON.parse(stdout.trim().split("\n").at(-1) ?? "[]")
const artifactManifest = stdout.split("\n").find((line) => line.startsWith('[{"path":'))
assert.ok(artifactManifest, "production package command did not emit its artifact manifest")
const artifacts = JSON.parse(artifactManifest)
assert.equal(artifacts.length, 2, "release package emitted unexpected artifacts")
assert.deepEqual(artifacts.filter((artifact: { type: string }) => artifact.type === "wordpress-plugin-zip"), [
{ path: pluginArtifact, type: "wordpress-plugin-zip" },
Expand Down
Loading