Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const webOptions = {
platform: 'browser',
// Mark Node.js built-ins as external so they don't cause errors
// In the web version, we'll need to handle these differently
external: [...baseOptions.external, 'path', 'fs', 'https'],
external: [...baseOptions.external, 'path', 'fs', 'https', 'os'],
define: {
'process.env.IS_WEB': 'true',
},
Expand Down
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "elastic-docs-v3-utilities",
"displayName": "Elastic Docs Utilities",
"description": "Utilities for Elastic Docs authoring",
"version": "0.12.7",
"version": "0.12.8",
"publisher": "Elastic",
"repository": {
"type": "git",
Expand Down Expand Up @@ -51,6 +51,14 @@
{
"command": "elastic-docs-v3.refreshVersions",
"title": "Elastic Docs: Refresh Versions Cache"
},
{
"command": "elastic-docs-v3.checkValeUpdates",
"title": "Elastic Docs: Check for Vale Style Guide Updates"
},
{
"command": "elastic-docs-v3.testValeUpdateNotification",
"title": "Elastic Docs: Test Vale Update Notification"
}
]
},
Expand Down
32 changes: 32 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { SubstitutionCodeActionProvider } from './substitutionCodeActionProvider
import { UndefinedSubstitutionValidator } from './undefinedSubstitutionValidator';
import { substitutionCache, initializeSubstitutionsForWeb } from './substitutions';
import { VersionsCache } from './versionsCache';
import { ValeUpdateChecker } from './valeUpdateChecker';

import { outputChannel } from './logger';
import { performanceLogger } from './performanceLogger';
Expand Down Expand Up @@ -59,6 +60,12 @@ export function activate(context: vscode.ExtensionContext): void {
outputChannel.appendLine(`Failed to initialize substitutions for web: ${err}`);
});

// Check for Vale style guide updates (async, non-blocking)
const valeUpdateChecker = ValeUpdateChecker.getInstance();
valeUpdateChecker.checkForUpdates().catch(err => {
outputChannel.appendLine(`Failed to check for Vale updates: ${err}`);
});

// Apply color customizations programmatically
applyColorCustomizations();

Expand Down Expand Up @@ -336,6 +343,31 @@ export function activate(context: vscode.ExtensionContext): void {
})
);

// Register command to manually check for Vale style guide updates
context.subscriptions.push(
vscode.commands.registerCommand('elastic-docs-v3.checkValeUpdates', async () => {
try {
await vscode.window.withProgress({
location: vscode.ProgressLocation.Notification,
title: "Checking for Vale style guide updates...",
cancellable: false
}, async () => {
await valeUpdateChecker.checkForUpdates();
});
} catch (error) {
vscode.window.showErrorMessage(`Failed to check for Vale updates: ${error}`);
outputChannel.appendLine(`Error checking for Vale updates: ${error}`);
}
})
);

// Register command to test Vale update notification (for development/testing)
context.subscriptions.push(
vscode.commands.registerCommand('elastic-docs-v3.testValeUpdateNotification', async () => {
await valeUpdateChecker.simulateUpdateNotification();
})
);

// Periodically refresh versions cache (every hour)
const refreshInterval = setInterval(() => {
versionsCache.refreshIfNeeded().then(() => {
Expand Down
Loading