diff --git a/package.json b/package.json index 36461b7..42c26e1 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/playground/package.json b/playground/package.json index 91f7d8a..10b6198 100644 --- a/playground/package.json +++ b/playground/package.json @@ -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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1b0f70f..d27be23 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,13 +10,13 @@ importers: dependencies: '@antelopejs/interface-api': specifier: '>=0.0.11 <1.0.0' - version: 0.0.11(@antelopejs/interface-core@0.0.6) + version: 0.0.11(@antelopejs/interface-core@0.0.11) '@antelopejs/interface-api-util': specifier: ^0.1.1 - version: 0.1.1(@antelopejs/interface-api@0.0.11(@antelopejs/interface-core@0.0.6))(@antelopejs/interface-core@0.0.6) + version: 0.1.1(@antelopejs/interface-api@0.0.11(@antelopejs/interface-core@0.0.11))(@antelopejs/interface-core@0.0.11) '@antelopejs/interface-core': - specifier: ^0.0.6 - version: 0.0.6 + specifier: '>=0.0.6 <1.0.0' + version: 0.0.11 reflect-metadata: specifier: ^0.2.2 version: 0.2.2 @@ -59,13 +59,13 @@ importers: dependencies: '@antelopejs/interface-api': specifier: ^0.0.8 - version: 0.0.8(@antelopejs/interface-core@0.0.6) + version: 0.0.8(@antelopejs/interface-core@0.0.11) '@antelopejs/interface-api-util': specifier: ^0.1.1 - version: 0.1.1(@antelopejs/interface-api@0.0.8(@antelopejs/interface-core@0.0.6))(@antelopejs/interface-core@0.0.6) + version: 0.1.1(@antelopejs/interface-api@0.0.8(@antelopejs/interface-core@0.0.11))(@antelopejs/interface-core@0.0.11) '@antelopejs/interface-core': - specifier: ^0.0.6 - version: 0.0.6 + specifier: '>=0.0.6 <1.0.0' + version: 0.0.11 devDependencies: '@types/node': specifier: ^20.5.7 @@ -95,8 +95,8 @@ packages: peerDependencies: '@antelopejs/interface-core': '>=0.0.3 <1.0.0' - '@antelopejs/interface-core@0.0.6': - resolution: {integrity: sha512-OMna86iT/ylL6wJl6FCPw9ieddULXGs4jTmeiDBNEXYQ9acnVXjS/+SaN0UR0h7oY7WTD9VwKXVwG95qjNIA1w==} + '@antelopejs/interface-core@0.0.11': + resolution: {integrity: sha512-eKE3F9XY0eIzdLBXms8QAY4BHmA8+XXZnta0vZ411q9GiSbI2S1Q3lfYzmnXU4ZK9i+/SIYPplOsA02gIdxODg==} '@biomejs/biome@2.3.2': resolution: {integrity: sha512-8e9tzamuDycx7fdrcJ/F/GDZ8SYukc5ud6tDicjjFqURKYFSWMl0H0iXNXZEGmcmNUmABgGuHThPykcM41INgg==} @@ -1231,25 +1231,25 @@ packages: snapshots: - '@antelopejs/interface-api-util@0.1.1(@antelopejs/interface-api@0.0.11(@antelopejs/interface-core@0.0.6))(@antelopejs/interface-core@0.0.6)': + '@antelopejs/interface-api-util@0.1.1(@antelopejs/interface-api@0.0.11(@antelopejs/interface-core@0.0.11))(@antelopejs/interface-core@0.0.11)': dependencies: - '@antelopejs/interface-api': 0.0.11(@antelopejs/interface-core@0.0.6) - '@antelopejs/interface-core': 0.0.6 + '@antelopejs/interface-api': 0.0.11(@antelopejs/interface-core@0.0.11) + '@antelopejs/interface-core': 0.0.11 - '@antelopejs/interface-api-util@0.1.1(@antelopejs/interface-api@0.0.8(@antelopejs/interface-core@0.0.6))(@antelopejs/interface-core@0.0.6)': + '@antelopejs/interface-api-util@0.1.1(@antelopejs/interface-api@0.0.8(@antelopejs/interface-core@0.0.11))(@antelopejs/interface-core@0.0.11)': dependencies: - '@antelopejs/interface-api': 0.0.8(@antelopejs/interface-core@0.0.6) - '@antelopejs/interface-core': 0.0.6 + '@antelopejs/interface-api': 0.0.8(@antelopejs/interface-core@0.0.11) + '@antelopejs/interface-core': 0.0.11 - '@antelopejs/interface-api@0.0.11(@antelopejs/interface-core@0.0.6)': + '@antelopejs/interface-api@0.0.11(@antelopejs/interface-core@0.0.11)': dependencies: - '@antelopejs/interface-core': 0.0.6 + '@antelopejs/interface-core': 0.0.11 - '@antelopejs/interface-api@0.0.8(@antelopejs/interface-core@0.0.6)': + '@antelopejs/interface-api@0.0.8(@antelopejs/interface-core@0.0.11)': dependencies: - '@antelopejs/interface-core': 0.0.6 + '@antelopejs/interface-core': 0.0.11 - '@antelopejs/interface-core@0.0.6': + '@antelopejs/interface-core@0.0.11': dependencies: reflect-metadata: 0.2.2 diff --git a/src/implementations/api/index.ts b/src/implementations/api/index.ts index 404444b..d05e4cd 100644 --- a/src/implementations/api/index.ts +++ b/src/implementations/api/index.ts @@ -298,3 +298,5 @@ export const routesProxy = { return routes; }, }; + +export const internal = { routesProxy }; diff --git a/src/test/controller-resolution.test.ts b/src/test/controller-resolution.test.ts index ad7b304..a5dbb07 100644 --- a/src/test/controller-resolution.test.ts +++ b/src/test/controller-resolution.test.ts @@ -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, @@ -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 = {