From 49ff5d1bc26095fa1049060b224f9ea6f2949619 Mon Sep 17 00:00:00 2001 From: Sven <38101365+svenvoskamp@users.noreply.github.com> Date: Wed, 7 Feb 2024 16:45:00 +0100 Subject: [PATCH] auto update constantsutil version (#1881) --- dangerfile.ts | 5 ++--- packages/scaffold-utils/src/ConstantsUtil.ts | 4 +++- packages/scaffold-utils/tsconfig.json | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dangerfile.ts b/dangerfile.ts index 8259e9de9e..3ad6211f11 100644 --- a/dangerfile.ts +++ b/dangerfile.ts @@ -1,7 +1,7 @@ /* eslint-disable no-await-in-loop */ import { danger, fail, message, warn } from 'danger' import corePackageJson from './packages/core/package.json' assert { type: 'json' } -import { ConstantsUtil } from './packages/scaffold-utils/src/ConstantsUtil' +import coreScaffoldUtilsJson from './packages/scaffold-utils/package.json' assert { type: 'json' } // -- Constants --------------------------------------------------------------- const TYPE_COMMENT = `// -- Types --------------------------------------------- //` @@ -10,7 +10,6 @@ const CONTROLLER_COMMENT = `// -- Controller ----------------------------------- const RENDER_COMMENT = `// -- Render -------------------------------------------- //` const STATE_PROPERTIES_COMMENT = `// -- State & Properties -------------------------------- //` const PRIVATE_COMMENT = `// -- Private ------------------------------------------- //` -const PACKAGE_VERSION = ConstantsUtil.VERSION // -- Data -------------------------------------------------------------------- const { modified_files, created_files, deleted_files, diffForFile } = danger.git @@ -268,7 +267,7 @@ checkClientPackages() // -- Check sdkVersion ------------------------------------------------------------ function checkSdkVersion() { - if (PACKAGE_VERSION !== corePackageJson.version) { + if (coreScaffoldUtilsJson.version !== corePackageJson.version) { fail(`VERSION in utils/constants does't match core package.json version`) } } diff --git a/packages/scaffold-utils/src/ConstantsUtil.ts b/packages/scaffold-utils/src/ConstantsUtil.ts index a85cb6e2d0..2f32e1ec39 100644 --- a/packages/scaffold-utils/src/ConstantsUtil.ts +++ b/packages/scaffold-utils/src/ConstantsUtil.ts @@ -1,3 +1,5 @@ +import scaffoldUtilsPackageJson from '../package.json' assert { type: 'json' } + export const ConstantsUtil = { WALLET_CONNECT_CONNECTOR_ID: 'walletConnect', INJECTED_CONNECTOR_ID: 'injected', @@ -11,5 +13,5 @@ export const ConstantsUtil = { ADD_CHAIN_METHOD: 'wallet_addEthereumChain', EIP6963_ANNOUNCE_EVENT: 'eip6963:announceProvider', EIP6963_REQUEST_EVENT: 'eip6963:requestProvider', - VERSION: '4.0.0' + VERSION: scaffoldUtilsPackageJson.version } diff --git a/packages/scaffold-utils/tsconfig.json b/packages/scaffold-utils/tsconfig.json index 3d47bfed70..a233f65c7a 100644 --- a/packages/scaffold-utils/tsconfig.json +++ b/packages/scaffold-utils/tsconfig.json @@ -5,5 +5,5 @@ "declarationDir": "./dist/types" }, "extends": "../../tsconfig.json", - "include": ["exports", "src"] + "include": ["exports", "src", "package.json"] }