Skip to content
Open
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.2
-------------
Expand Down
16 changes: 2 additions & 14 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commands are not necessary, so wrapping the code with try { /* ... */ } catch { /* pass */ } can prevent unnecessary exits.

const result = await $`${[packageManager, "run", script]}`
.cwd(dir)
.stdin("null")
Expand Down
Loading