/ src / commands / release-notes.ts
release-notes.ts
 1  import type { Command } from '../commands.js'
 2  import { RELEASE_NOTES } from '../constants/releaseNotes.js'
 3  
 4  const releaseNotes: Command = {
 5    description: 'Show release notes for the current or specified version',
 6    isEnabled: false,
 7    isHidden: false,
 8    name: 'release-notes',
 9    userFacingName() {
10      return 'release-notes'
11    },
12    type: 'local',
13    async call(args) {
14      const currentVersion = MACRO.VERSION
15  
16      // If a specific version is requested, show that version's notes
17      const requestedVersion = args ? args.trim() : currentVersion
18  
19      // Get the requested version's notes
20      const notes = RELEASE_NOTES[requestedVersion]
21  
22      if (!notes || notes.length === 0) {
23        return `No release notes available for version ${requestedVersion}.`
24      }
25  
26      const header = `Release notes for version ${requestedVersion}:`
27      const formattedNotes = notes.map(note => `• ${note}`).join('\n')
28  
29      return `${header}\n\n${formattedNotes}`
30    },
31  }
32  
33  export default releaseNotes