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
9 changes: 9 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,15 @@ To be released.
`endpoints.uploadMedia` is not built with
`ctx.getMediaUploaderUri(identifier)`.

### @fedify/init

- Fixed `fedify init`'s hydration test validation to run `format` before
`format:check`, which previously caused the entire test suite to fail when
the package manager is `npm` or `pnpm`: [[#950]] [[#952]]

[#950]: https://github.com/fedify-dev/fedify/issues/950
[#952]: https://github.com/fedify-dev/fedify/pull/952


Version 2.3.3
-------------
Expand Down
20 changes: 5 additions & 15 deletions packages/init/src/test/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ async function validateDevToolScripts(
dir: string,
options: GeneratedType<ReturnType<typeof generateTestCases>>,
): Promise<boolean> {
const [webFramework, packageManager] = options as [
const [_, packageManager] = options as [
WebFramework,
PackageManager,
KvStore,
Expand All @@ -143,19 +143,7 @@ async function validateDevToolScripts(
if (packageManager === "deno") return true;
if (!(await hasInstalledNodeDependencies(dir))) return true;

if (webFramework === "astro") {
const format = await $`${[packageManager, "run", "format"]}`
.cwd(dir)
.stdin("null")
.stdout("piped")
.stderr("piped")
.noThrow()
.spawn();
await saveOutputs(dir, format);
if (format.code !== 0) return false;
}

for (const script of ["format:check", "lint"]) {
for (const script of ["format", "format:check", "lint"]) {
Comment thread
2chanhaeng marked this conversation as resolved.
Comment thread
Palcimer marked this conversation as resolved.
const result = await $`${[packageManager, "run", script]}`
.cwd(dir)
.stdin("null")
Expand All @@ -164,7 +152,9 @@ async function validateDevToolScripts(
.noThrow()
.spawn();
await saveOutputs(dir, result);
if (result.code !== 0) return false;
if (result.code !== 0) {
printMessage` Warning: ${script} failed, continuing anyway.`;
}
}
return true;
}
Expand Down
Loading