Skip to content

Commit 6b25087

Browse files
jsonifyclaude
andauthored
Fix extension release notes showing old version (#126)
* fix: Update changelog fallback to show v1.43.14 features Fixed issue where extension changelog was showing old v1.43.12 content instead of the latest v1.43.14 features for users installing from marketplace. ## Problem When users install the extension from VS Code marketplace, they don't have the git repository, so the changelog system falls back to hardcoded content. This fallback was still showing v1.43.12 (PR #123) instead of v1.43.14 (PR #125). ## Solution Updated getFallbackRelease() function with: - Version number: 1.43.12 → 1.43.14 - PR number: #123#125 - Feature description: Hierarchical note naming and organization - Added comprehensive feature highlights for the new hierarchical notes system ## Changes - Updated fallback version in getFallbackRelease() (line 91) - Updated fallback version in getLatestRelease() (line 60) - Updated fallback version in showChangelogView() (line 139) - Replaced PR #123 content with PR #125 hierarchical notes feature details Users will now see the correct "What's New" content showing the new hierarchical notes feature when opening the changelog popup. * refactor: Externalize fallback release data to JSON file Addressed code review feedback to improve maintainability by moving hardcoded fallback release information to an external JSON file. ## Changes **New File: src/version/fallback-release.json** - Centralized all fallback release data (version, date, title, description, PR info) - Single source of truth for release information - Easy to update for future releases **Updated: src/version/changelogView.ts** - Import fallback data from JSON file - Replace all hardcoded version strings with `fallbackReleaseData.version` - Simplified getFallbackRelease() to just return imported data - Eliminated duplication across 3 locations (lines 60, 91, 139) **Configuration Updates:** - tsconfig.json: Added `resolveJsonModule: true` for JSON imports - esbuild.js: Added JSON loader configuration ## Benefits - ✅ No more version string duplication - ✅ Easier future updates (just edit JSON file) - ✅ Reduced risk of inconsistencies - ✅ Better separation of data and code - ✅ More maintainable codebase Future releases only need to update the JSON file - no code changes required! --------- Co-authored-by: Claude <[email protected]>
1 parent 37cdb34 commit 6b25087

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

esbuild.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ async function main() {
5757
],
5858
// Bundle all dependencies except those in VS Code's runtime
5959
packages: 'bundle',
60+
// Enable JSON module imports
61+
loader: {
62+
'.json': 'json',
63+
},
6064
});
6165

6266
if (watch) {

src/version/changelogView.ts

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as vscode from 'vscode';
22
import * as path from 'path';
33
import * as fs from 'fs';
44
import { execSync } from 'child_process';
5+
import fallbackReleaseData from './fallback-release.json';
56

67
// Latest release information
78
export interface LatestRelease {
@@ -57,7 +58,7 @@ export function getLatestRelease(): LatestRelease {
5758
const dateString = date.toISOString().split('T')[0]; // YYYY-MM-DD
5859

5960
// Get version from package.json
60-
let version = '1.43.12'; // fallback
61+
let version = fallbackReleaseData.version;
6162
try {
6263
const packageJsonPath = path.join(
6364
vscode.workspace.workspaceFolders?.[0]?.uri.fsPath || '',
@@ -85,24 +86,10 @@ export function getLatestRelease(): LatestRelease {
8586

8687
/**
8788
* Fallback release info when Git parsing fails
89+
* Reads from fallback-release.json to centralize release data
8890
*/
8991
function getFallbackRelease(): LatestRelease {
90-
return {
91-
version: '1.43.12',
92-
date: '2025-11-19',
93-
prTitle: 'Check supported file types in MyNotes panel',
94-
prDescription: `Extended SUPPORTED_EXTENSIONS to include common programming language file types, enabling users to store and view scripts in the MyNotes panel.
95-
96-
**Added support for:**
97-
- Web development: HTML, CSS, JS/TS, JSON, YAML, XML
98-
- Programming languages: Python, Java, C/C++, Go, Rust, Ruby, PHP, Swift, Kotlin, R, etc.
99-
- Shell/scripting: Bash, PowerShell, Windows batch
100-
- Data/config: SQL, TOML, INI, ENV files
101-
102-
Resolves issue where users could only see .md and .txt files in the panel.`,
103-
prNumber: 123,
104-
prUrl: 'https://github.com/jsonify/noted/pull/123'
105-
};
92+
return fallbackReleaseData;
10693
}
10794

10895
/**
@@ -124,7 +111,7 @@ export async function showChangelogView(
124111
// Get the current version from package.json
125112
const extensionPath = context.extensionPath;
126113
const packageJsonPath = path.join(extensionPath, 'package.json');
127-
let currentVersion = '1.43.12'; // fallback
114+
let currentVersion = fallbackReleaseData.version;
128115

129116
try {
130117
const packageJson = JSON.parse(await fs.promises.readFile(packageJsonPath, 'utf8'));

src/version/fallback-release.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"version": "1.43.14",
3+
"date": "2025-11-20",
4+
"prTitle": "Implement hierarchical note naming and organization",
5+
"prDescription": "Add comprehensive support for Dendron-style hierarchical note organization using dot-delimited naming (e.g., project.design.frontend.md).\n\n**Core Features:**\n- **Dot-delimited hierarchies**: Notes like work.meetings.standup.md are organized into visual tree structures\n- **Virtual hierarchy nodes**: Tree view displays hierarchy without requiring actual folder structure\n- **Flexible organization**: Notes stored as flat files in Hierarchical Notes folder, displayed as hierarchical tree\n- **Full validation**: Strict format validation with helpful error messages\n\n**New Commands:**\n- Create Hierarchical Note - Create new hierarchical note with template selection\n- Open Hierarchical Note - Quick picker with existing hierarchy suggestions\n- Search Hierarchical Notes - Find hierarchical notes by path prefix\n\n**Configuration:**\n- Enable/disable hierarchical notes (default: enabled)\n- Configure separator character (. or /)\n- Set maximum depth limit (default: 10 levels)\n- Choose validation level (strict/relaxed)\n\n**Backwards Compatibility:**\nAll existing features work seamlessly with hierarchical notes - wiki links, search, backlinks, tags, graph view, and more!",
6+
"prNumber": 125,
7+
"prUrl": "https://github.com/jsonify/noted/pull/125"
8+
}

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"rootDir": "src",
1313
"strict": true,
1414
"esModuleInterop": true,
15+
"resolveJsonModule": true,
1516
"types": ["node", "mocha", "chai"]
1617
},
1718
"exclude": ["node_modules", ".vscode-test", "scripts"]

0 commit comments

Comments
 (0)