refactor: centralize WhatsApp version to single source of truth
Instead of maintaining the version number in 3 separate files (baileys-version.json, index.ts, generics.ts), this change makes baileys-version.json the single source of truth. Other files now import the version from this JSON file. This follows the DRY principle and reduces: - Risk of version inconsistency across files - Maintenance burden (only 1 file to update) - PR diff size (3 files → 1 file for version updates) - Merge conflict probability Addresses inefficiency found in Baileys PR #2269.
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import { Boom } from '@hapi/boom'
|
||||
import { createHash, randomBytes } from 'crypto'
|
||||
import { proto } from '../../WAProto/index.js'
|
||||
const baileysVersion = [2, 3000, 1032141294]
|
||||
// Single source of truth for WhatsApp Web version - imported from JSON
|
||||
import baileysVersionData from '../Defaults/baileys-version.json'
|
||||
|
||||
const baileysVersion = baileysVersionData.version
|
||||
import type {
|
||||
BaileysEventEmitter,
|
||||
BaileysEventMap,
|
||||
|
||||
Reference in New Issue
Block a user