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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"dependencies": {
"@antelopejs/interface-api": ">=0.0.11 <1.0.0",
"@antelopejs/interface-api-util": "^0.1.1",
"@antelopejs/interface-core": "^0.0.6",
"@antelopejs/interface-core": ">=0.0.6 <1.0.0",
"reflect-metadata": "^0.2.2",
"ws": "^8.20.0"
},
Expand Down
2 changes: 1 addition & 1 deletion playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"dependencies": {
"@antelopejs/interface-api": "^0.0.8",
"@antelopejs/interface-api-util": "^0.1.1",
"@antelopejs/interface-core": "^0.0.6"
"@antelopejs/interface-core": ">=0.0.6 <1.0.0"
},
"devDependencies": {
"@types/node": "^20.5.7",
Expand Down
42 changes: 21 additions & 21 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/implementations/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,3 +298,5 @@ export const routesProxy = {
return routes;
},
};

export const internal = { routesProxy };
19 changes: 19 additions & 0 deletions src/test/controller-resolution.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import assert from "node:assert";
import { spawnSync } from "node:child_process";
import { createServer, type Server } from "node:http";
import { resolve } from "node:path";
import {
type ComputedParameter,
ControllerMeta,
Expand Down Expand Up @@ -114,6 +116,23 @@ describe("Controller resolution", () => {
await close(server);
});

it("attaches the full implementation through the nested interface contract", () => {
const result = spawnSync(
process.execPath,
[
"-e",
`const { ImplementInterface } = require("@antelopejs/interface-core");
ImplementInterface(
require("@antelopejs/interface-api"),
require("./dist/implementations/api"),
);`,
],
{ cwd: resolve(__dirname, "../.."), encoding: "utf8" },
);

assert.equal(result.status, 0, result.stderr);
});

it("isolates computed properties across concurrent requests", async () => {
const Controller = createController();
const properties = {
Expand Down
Loading