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
3 changes: 2 additions & 1 deletion packages/express/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
]
},
"tasks": {
"check": "deno fmt --check && deno lint && deno check *.ts"
"check": "deno fmt --check && deno lint && deno check *.ts",
"test": "deno test --allow-all"
}
}
4 changes: 3 additions & 1 deletion packages/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
"build:self": "tsdown",
"build": "pnpm --filter @fedify/express... run build:self",
"prepack": "pnpm build",
"prepublish": "pnpm build"
"prepublish": "pnpm build",
"test": "node --experimental-transform-types --test",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

mapfile -t files < <(
  fd -HI -t f \
    -g 'package.json' \
    -g '.nvmrc' \
    -g '.node-version' \
    -g '.tool-versions' \
    -g '*.yml' \
    -g '*.yaml' \
    .
)

for file in "${files[@]}"; do
  rg -n '"engines"|"node"|node-version|setup-node|NODE_VERSION|experimental-transform-types' "$file" || true
done

Repository: fedify-dev/fedify

Length of output: 486


🏁 Script executed:

#!/bin/bash
set -eu pipefail

printf 'Repository files matching Node/version/test config names:\n'
git ls-files | grep -Ei '(^|/)(package\.json$|\.nvmrc$|\.node-version$|\.tool-versions$|\.node-versionrc$|\.nvvmrc$|\.yml$|\.yaml$|README(\.|$)|deno\.json$|bun\.lock$|pnpm-workspace\.yaml$)' | sort

printf '\nRelevant Node/version/test config references:\n'
git ls-files | grep -Ei '(^|/)(package\.json$|\.nvmrc$|\.node-version$|\.tool-versions$|\.node-versionrc$|\.nvvmrc$|\.yml$|\.yaml$|README(\.|$)|deno\.json$|bun\.lock$|pnpm-workspace\.yaml$)' | while IFS= read -r file; do
  if rg -n '"engines"|"node"|"nodejs"|node-version|nodeversion|setup-node|NODE_VERSION|experimental-transform-types|--experimental-transform-types|^test:|^test:' "$file" >/tmp/rgmatch 2>/dev/null; then
    printf '\n--- %s ---\n' "$file"
    cat /tmp/rgmatch
  fi
done

printf '\npackages/express/package.json relevant sections:\n'
python3 - <<'PY'
import json, pathlib
p=pathlib.Path('packages/express/package.json')
data=json.loads(p.read_text())
for key in ['name', 'engines', 'scripts']:
    print(f'{key}: {json.dumps(data.get(key, "<missing>"), indent=2)}')
PY

printf '\nRoot package.json engines/scripts context:\n'
python3 - <<'PY'
import json, pathlib
for p in [pathlib.Path('package.json'), pathlib.Path('pnpm-workspace.yaml'), pathlib.Path('.github/workflows')]
    pass
PY

# A minimal, focused search for any Node version declarations.
printf '\nFocused search for Node version declarations and transform flag:\n'
rg -n --glob '!**/.git/**' '(^|[^a-zA-Z0-9.])(node(\s*=>|-?[~^>=<][0-9]|@\d+)|NODE_VERSION|node-version|setup-node|engines|experimental-transform-types|--experimental-transform-types)' .

Repository: fedify-dev/fedify

Length of output: 9194


🌐 Web query:

Node.js --experimental-transform-types added removed version 22.7.0 26.0.0

💡 Result:

The --experimental-transform-types flag was added to Node.js in version 22.7.0 [1][2][3]. It was subsequently removed in version 26.0.0 [1][4]. The removal was implemented via pull request #61803, which was merged on February 27, 2026 [5][6].

Citations:


🏁 Script executed:

#!/bin/bash
set -e

printf 'Root package.json and express package metadata:\n'
python3 - <<'PY'
import json, pathlib
for p in ["package.json", "pnpm-workspace.yaml", "packages/express/package.json"]:
    path=pathlib.Path(p)
    print(f"\n--- {p} ---")
    if p.endswith(".json"):
        data=json.loads(path.read_text())
        for key in ["name", "type", "packageManager", "engines", "scripts"]:
            print(f"{key}: {json.dumps(data.get(key, "<missing>"), indent=2)}")
    else:
        print(path.read_text().strip())
PY

printf '\nGitHub workflow Node version pins:\n'
git ls-files '.github/workflows/*.yml' '.github/workflows/*.yaml' | sort | while IFS= read -r file; do
  echo "### $file"
  rg -n 'node-version:|setup-node|engines|actions/setup-node|uses: .*setup-node|matrix|nodejs|NODE_VERSION' "$file" || true
done

printf '\nAll Node declaration files excluding generated lock artifacts:\n'
git ls-files | grep -Ei '(^|/)(\.nvmrc$|\.node-version$|\.tool-versions$|package\.json$|pnpm-workspace\.yaml$)' | sort | while IFS= read -r file; do
  if rg -n '"engines"|"pnpm"|"volta"|node-version|NODE_VERSION|setup-node|experimental-transform-types' "$file" >/tmp/rgmatch; then
    echo "### $file"
    cat /tmp/rgmatch
  fi
done

Repository: fedify-dev/fedify

Length of output: 385


🌐 Web query:

fedify-dev fedify package.json packageManager package.json engines node pnpm-workspace.yaml fedify

💡 Result:

Fedify is a TypeScript-based framework designed for building federated server applications, supporting multiple runtimes (Node.js, Deno, Bun) and various package managers [1][2][3]. The technical configuration details regarding the requested files are as follows: pnpm-workspace.yaml The Fedify repository is a monorepo that utilizes pnpm workspaces to manage its various packages (e.g., core, web framework integrations, CLI) [1][4][5]. The pnpm-workspace.yaml file defines the packages included in the workspace and employs the pnpm catalog feature to manage dependencies centrally [4][6]. When adding a new package or updating existing ones, dependencies in individual package.json files reference these catalog versions using the catalog: protocol rather than hardcoded version numbers [6]. package.json and packageManager Fedify's CLI includes a fedify init command that scaffolds new projects [2]. This command allows users to specify a package manager (options include deno, pnpm, bun, yarn, or npm) [7][8]. The scaffolder generates a package.json file for Node.js-based projects, which includes essential metadata such as "type": "module" and project-specific npm scripts [9]. While the CLI dynamically manages dependency installation based on the chosen runtime and package manager, it does not mandate a specific packageManager field in the generated package.json [10][9]. Historically, issues regarding the CLI's detection of local package managers (e.g., pnpm) have been addressed in maintenance updates [11]. engines node Fedify-based projects are generally compatible with standard Node.js environments. For example, specific implementations, such as the federated microblog example, require Node.js 20.0.0 or later [3]. While developers may define an engines field in their project-level package.json to enforce Node.js version compatibility, this is standard practice for Node.js projects rather than a specific requirement enforced by the Fedify framework itself. Overall, Fedify is designed to be runtime-agnostic and modular, allowing users to integrate it into their preferred Node.js frameworks (e.g., Express, Fastify, Next.js) using the appropriate integration package [12][2].

Citations:


Scope the Node command to a supported runtime.

This package does not declare Node version support, while --experimental-transform-types exists only for Node 22.7.0 through 25. Add engines.node for the supported range or use a Node configuration that is compatible with the declared support baseline.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/express/package.json` at line 62, Add an engines.node declaration in
packages/express/package.json covering the Node versions that support
--experimental-transform-types, or replace that flag with a test command
compatible with the package’s declared Node support baseline. Keep the test
script’s behavior unchanged for supported runtimes.

"test:bun": "bun test src/"
}
}
95 changes: 95 additions & 0 deletions packages/express/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import type { Request as ERequest, Response as EResponse } from "express";
import { strict as assert } from "node:assert";
import { describe, test } from "node:test";
import { integrateFederation } from "./index.ts";

interface MockFederation {
fetch(request: Request, options: unknown): Promise<Response>;
}

function createMockRequest(): ERequest {
return {
protocol: "http",
host: "localhost",
url: "/",
method: "GET",
headers: {},
} as unknown as ERequest;
}

function createMockResponse(): {
response: EResponse;
ended: Promise<void>;
getBody(): string;
} {
let body = "";
let resolveEnded: () => void;
const ended = new Promise<void>((resolve) => {
resolveEnded = resolve;
});
const response = {
statusCode: 200,
status(code: number) {
response.statusCode = code;
return response;
},
setHeader() {
return response;
},
write(chunk: Buffer | string) {
body += chunk.toString();
return true;
},
end() {
resolveEnded();
return response;
},
};
return {
response: response as unknown as EResponse,
ended,
getBody: () => body,
};
}

describe("integrateFederation()", () => {
test("waits for an async contextDataFactory and passes the resolved value to federation.fetch()", async () => {
let resolveContextData!: (value: string) => void;
let fetchCalled = false;

const mockFederation: MockFederation = {
fetch(_request, options) {
fetchCalled = true;
const { contextData } = options as { contextData: unknown };
return Promise.resolve(new Response(String(contextData)));
},
};

const contextDataFactory = () =>
new Promise<string>((resolve) => {
resolveContextData = resolve;
});

const middleware = integrateFederation(
mockFederation as never,
contextDataFactory,
);

const req = createMockRequest();
const { response, ended, getBody } = createMockResponse();
let nextCalled = false;

middleware(req, response, () => {
nextCalled = true;
});

await Promise.resolve();
assert.strictEqual(fetchCalled, false);

resolveContextData("Hello World");
await ended;

assert.strictEqual(nextCalled, false);
assert.strictEqual(getBody(), "Hello World");
Comment thread
coderabbitai[bot] marked this conversation as resolved.
});
});