From 3d45123739aaba06689b323a87deec3d3a689dff Mon Sep 17 00:00:00 2001 From: David de Kloet Date: Fri, 5 Jun 2026 14:18:17 +0200 Subject: [PATCH] Allow FEED_ID_JSON in makeStub --- .github/workflows/main.yaml | 1 + scripts/generator-adapter/generators/app/index.ts | 8 +++++--- src/util/testing-utils.ts | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 2fbc5de7..f409200a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -94,3 +94,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} EXTERNAL_ADAPTER_GENERATOR_NO_INTERACTIVE: 'true' EXTERNAL_ADAPTER_GENERATOR_STANDALONE: 'true' + EXTERNAL_ADAPTER_GENERATOR_USE_LOCAL_FRAMEWORK_VERSION: 'true' diff --git a/scripts/generator-adapter/generators/app/index.ts b/scripts/generator-adapter/generators/app/index.ts index a55cf907..182f91e5 100644 --- a/scripts/generator-adapter/generators/app/index.ts +++ b/scripts/generator-adapter/generators/app/index.ts @@ -56,6 +56,7 @@ export default class extends Generator.default { // with the same content in the same directory and extend from it. Also, new packages and config files (jest, babel) will be added // to be able to run the tests standalone = process.env.EXTERNAL_ADAPTER_GENERATOR_STANDALONE === 'true' + useLocalFrameworkVersion = process.env.EXTERNAL_ADAPTER_GENERATOR_USE_LOCAL_FRAMEWORK_VERSION === 'true' constructor(args, opts) { super(args, opts, { customInstallTask: true }) @@ -96,11 +97,12 @@ export default class extends Generator.default { const endpointNames = Object.values(endpoints).map(e => e.normalizedEndpointName).join(', ') const includeComments = await this._promptConfirmation(adapterName, endpointNames) + const frameworkVersion = this.useLocalFrameworkVersion + ? 'file:../../dist/src' + : (await require('../../../package.json')).version this.props = { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - frameworkVersion: (await require('../../../package.json')).version, + frameworkVersion, adapterName, endpoints, endpointNames, diff --git a/src/util/testing-utils.ts b/src/util/testing-utils.ts index 4f25ee6b..452e459a 100644 --- a/src/util/testing-utils.ts +++ b/src/util/testing-utils.ts @@ -602,6 +602,7 @@ export const allowedUndefinedStubProps = [ 'toJSON', 'asymmetricMatch', 'then', + 'FEED_ID_JSON', ] const isStubPropAllowedUndefined = (prop: string | symbol) => {