Skip to content

Commit b2c2e62

Browse files
fix: welcome view icons and edit template issue
1 parent adec1b4 commit b2c2e62

File tree

11 files changed

+66
-46
lines changed

11 files changed

+66
-46
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ dist
33
node_modules
44
.vscode-test/
55
*.vsix
6-
.scannerwork
6+
.scannerwork/

.vscodeignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ webpack.config.js
1414
node_modules/**
1515
!node_modules/lodash/**
1616
!node_modules/js-yaml/**
17+
!node_modules/@vscode/codicons/dist/**
1718
.eslintrc.json
1819
REFACTORING_SUMMARY.md
1920
IMPLEMENTATION_GUIDE.md
@@ -22,4 +23,5 @@ TEMPLATES_FEATURE.md
2223
PROJECT_STRUCTURE.md
2324
CHANGELOG.md
2425
.scannerwork/**
25-
.github/**
26+
.github/**
27+
.prettierignore

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to the "GitOps Tools for ArgoCD" extension will be documented in this file.
44

5+
## [0.0.2] - 2025-12-03
6+
7+
### Fixes
8+
9+
- Fix Welcome View icons
10+
- Edit Template issue
11+
512
## [0.0.2] - 2025-12-02
613

714
### Fixes

CONTRIBUTING.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Contributing to GitOps Tools for ArgoCD
22

3-
First off, thank you for considering contributing to GitOps Tools for ArgoCD! It's people like you that make this extension better for everyone.
3+
First off, thank you for considering contributing to GitOps Tools for ArgoCD! It's people like you that make this extension better for everyone. <br>
4+
Also consider best practics from [Angular Contributing Docs](https://github.com/angular/angular/blob/main/contributing-docs)
45

56
## 🌟 How Can I Contribute?
67

@@ -9,6 +10,7 @@ First off, thank you for considering contributing to GitOps Tools for ArgoCD! It
910
Before creating bug reports, please check the existing issues to avoid duplicates. When you create a bug report, include as many details as possible:
1011

1112
**Bug Report Template:**
13+
1214
- **Description**: Clear and concise description of the buga
1315
- **Steps to Reproduce**: Detailed steps to reproduce the behavior
1416
- **Expected Behavior**: What you expected to happen
@@ -53,6 +55,7 @@ Enhancement suggestions are welcome! Please include:
5355
### Development Workflow
5456

5557
1. **Start Watch Mode** (automatic compilation on file changes):
58+
5659
```bash
5760
npm run watch
5861
```
@@ -118,25 +121,31 @@ npm test -- --grep "pattern"
118121

119122
```markdown
120123
## Description
124+
121125
Brief description of changes
122126

123127
## Type of Change
128+
124129
- [ ] Bug fix
125130
- [ ] New feature
126131
- [ ] Breaking change
127132
- [ ] Documentation update
128133

129134
## Changes Made
135+
130136
- Change 1
131137
- Change 2
132138

133139
## Testing
140+
134141
How you tested the changes
135142

136143
## Screenshots
144+
137145
If applicable
138146

139147
## Related Issues
148+
140149
Fixes #123
141150
```
142151

@@ -147,4 +156,4 @@ Fixes #123
147156
3. Feedback provided (if needed)
148157
4. Approved and merged
149158

150-
**Thank you for contributing to GitOps Tools for ArgoCD!**
159+
**Thank you for contributing to GitOps Tools for ArgoCD!**

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ A powerful Visual Studio Code extension that brings ArgoCD GitOps workflows dire
55
[![VS Code](https://img.shields.io/badge/VS%20Code-1.105.0+-blue.svg)](https://code.visualstudio.com/)
66
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
77

8+
# Read latest documentation [here](https://paliwal999harsh.github.io/vscode-argocd)
9+
810
## Overview
911

1012
This extension provides comprehensive ArgoCD management capabilities within VS Code, allowing you to:
@@ -92,7 +94,7 @@ This extension requires the ArgoCD CLI to be installed on your system.
9294
### Install the Extension
9395

9496
- Search for "GitOps Tools for ArgoCD" in the VS Code Extensions Marketplace
95-
- Or install from `.vsix` file: `code --install-extension argocd-gitops-0.0.1.vsix`
97+
- Or install from `.vsix` file: `code --install-extension argocd-gitops-0.0.x.vsix`
9698

9799
### Configure ArgoCD Connection
98100

@@ -318,15 +320,15 @@ All commands are available in the Command Palette (`Ctrl+Shift+P`):
318320

319321
Configure the extension in VS Code Settings (`Ctrl+,`):
320322

321-
| Setting | Type | Default | Description |
322-
|---------|------|---------|-------------|
323-
| `argocd.showClusters` | boolean | `true` | Show Clusters view in sidebar |
324-
| `argocd.showRepositories` | boolean | `true` | Show Repositories view |
325-
| `argocd.showApplications` | boolean | `true` | Show Applications view |
326-
| `argocd.showTemplates` | boolean | `false` | Show Templates view |
327-
| `argocd.refreshInterval` | number | `30` | Auto-refresh interval (seconds, 0 to disable) |
328-
| `argocd.timeoutSeconds` | number | `60` | CLI command timeout (seconds) |
329-
| `argocd.logLevel` | string | `info` | Output log level (debug, info, warn, error) |
323+
| Setting | Type | Default | Description |
324+
| ------------------------- | ------- | ------- | --------------------------------------------- |
325+
| `argocd.showClusters` | boolean | `true` | Show Clusters view in sidebar |
326+
| `argocd.showRepositories` | boolean | `true` | Show Repositories view |
327+
| `argocd.showApplications` | boolean | `true` | Show Applications view |
328+
| `argocd.showTemplates` | boolean | `false` | Show Templates view |
329+
| `argocd.refreshInterval` | number | `30` | Auto-refresh interval (seconds, 0 to disable) |
330+
| `argocd.timeoutSeconds` | number | `60` | CLI command timeout (seconds) |
331+
| `argocd.logLevel` | string | `info` | Output log level (debug, info, warn, error) |
330332

331333
## Troubleshooting
332334

@@ -391,7 +393,7 @@ View logs:
391393

392394
## License
393395

394-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
396+
This project is licensed under the MIT License - see the [LICENSE](LICENSE.txt) file for details.
395397

396398
## Contributing
397399

@@ -414,8 +416,8 @@ Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for gui
414416

415417
Found a bug or have a feature request?
416418

417-
- [Report an issue](https://github.com/yourusername/argocd-vscode-extension/issues)
418-
- [Request a feature](https://github.com/yourusername/argocd-vscode-extension/issues/new?labels=enhancement)
419+
- [Report an issue](https://github.com/paliwal999harsh/vscode-argocd/issues)
420+
- [Request a feature](https://github.com/paliwal999harsh/vscode-argocd/issues/new?labels=enhancement)
419421

420422
### Clusters Management
421423

@@ -424,7 +426,7 @@ Found a bug or have a feature request?
424426
- **Cluster Details**: View cluster server information, version, and connection status
425427
- **Health Monitoring**: Real-time cluster health and connectivity status
426428

427-
### Repositories Management
429+
### Repositories Management
428430

429431
- **Repository Listing**: View all repositories connected to ArgoCD
430432
- **Multi-Type Support**: Support for Git, Helm, and OCI repositories
@@ -475,4 +477,4 @@ Found a bug or have a feature request?
475477
- **Real-time Updates**: Automatic refresh of tree views when configured
476478
- **Smart Refresh**: Only refresh when connected to ArgoCD server
477479

478-
**Made with ❤️ for the GitOps community** | [Report Issues](https://github.com/yourusername/argocd-vscode-extension/issues) | [Contribute](CONTRIBUTING.md)
480+
**Made with ❤️ for the GitOps community** | [Report Issues](https://github.com/paliwal999harsh/vscode-argocd/issues) | [Contribute](CONTRIBUTING.md)

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "argocd-gitops",
33
"displayName": "GitOps Tools for ArgoCD",
44
"description": "Manage Kubernetes Applications and Clusters using ArgoCD",
5-
"version": "0.0.2",
5+
"version": "0.0.3",
66
"author": {
77
"name": "Harsh Paliwal"
88
},
@@ -652,10 +652,10 @@
652652
}
653653
},
654654
"scripts": {
655-
"vscode:prepublish": "webpack --mode production",
655+
"vscode:prepublish": "webpack --mode production --devtool hidden-source-map",
656656
"compile": "webpack",
657657
"watch": "webpack --watch",
658-
"package": "webpack --mode production",
658+
"package": "webpack --mode production --devtool hidden-source-map",
659659
"compile-tests": "tsc -p . --outDir out",
660660
"watch-tests": "tsc -p . -w --outDir out",
661661
"pretest": "npm run compile-tests && npm run compile && npm run lint",

src/commands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,13 @@ export function registerCommands(context: ExtensionContext, services: CommandSer
210210
registerCommand(CommandId.EditApplication, editApplication(services, providers));
211211
registerCommand(CommandId.DeleteApplication, deleteApplication(services, providers));
212212
registerCommand(CommandId.CreateTemplateFromApplication, createTemplateFromApplication(services, providers));
213-
registerCommand(CommandId.ViewResourceManifest, viewResourceManifest(services.appService));
213+
registerCommand(CommandId.ViewResourceManifest, viewResourceManifest(services));
214214
registerCommand(CommandId.CreateApplicationFromFolder, createApplicationFromFolder(services));
215215

216216
// Template commands
217217
registerCommand(CommandId.RefreshTemplates, refreshTemplates(providers.templatesProvider));
218218
registerCommand(CommandId.AddTemplate, addTemplate(services, providers));
219-
registerCommand(CommandId.EditTemplate, editTemplate(_context, providers.templatesProvider));
219+
registerCommand(CommandId.EditTemplate, editTemplate(_context, services, providers));
220220
registerCommand(CommandId.CopyTemplate, copyTemplate(providers.templatesProvider));
221221
registerCommand(CommandId.CopyTemplateYaml, copyTemplateYaml(providers.templatesProvider));
222222
registerCommand(

src/commands/applications/viewResourceManifests.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { window, ProgressLocation, workspace } from 'vscode';
2-
import { AppService } from '../../services';
32
import * as yaml from 'js-yaml';
3+
import { CommandServices } from '../../commands';
44

55
/**
66
* View the manifest for a specific Kubernetes resource
77
* Manifests are fetched lazily on first resource click and cached in the ApplicationItem
88
*/
9-
export function viewResourceManifest(appService: AppService) {
9+
export function viewResourceManifest(services: CommandServices) {
1010
return async (item: any) => {
11+
const { appService } = services;
1112
if (!item?.resource) {
1213
return;
1314
}

src/commands/templates/addTemplate.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import path from 'node:path';
2-
import { ExtensionContext, Uri, window, workspace } from 'vscode';
3-
import { CommandServices, CommandProviders } from '../../commands';
2+
import { ExtensionContext, window, commands } from 'vscode';
3+
import { CommandServices, CommandProviders, CommandId } from '../../commands';
44
import * as fs from 'node:fs';
55

66
/**
77
* Add a new template
88
*/
99
export function addTemplate(services: CommandServices, providers: CommandProviders) {
1010
return async () => {
11+
const { outputChannel } = services;
1112
const { templatesProvider } = providers;
1213
const context = (globalThis as any).extensionContext as ExtensionContext;
1314

@@ -51,18 +52,10 @@ export function addTemplate(services: CommandServices, providers: CommandProvide
5152

5253
await templatesProvider.addTemplate(template);
5354
window.showInformationMessage(`Template "${templateName}" created successfully`);
54-
55-
const tempDir = path.join(context.globalStorageUri.fsPath, 'templates');
56-
if (!fs.existsSync(tempDir)) {
57-
fs.mkdirSync(tempDir, { recursive: true });
58-
}
59-
const tempFile = path.join(tempDir, `${template.id}.yaml`);
60-
const uri = Uri.file(tempFile);
61-
fs.writeFileSync(tempFile, template.template, 'utf-8');
62-
const doc = await workspace.openTextDocument(uri);
63-
await window.showTextDocument(doc);
55+
commands.executeCommand(CommandId.EditTemplate, { template });
6456
} catch (error) {
65-
window.showErrorMessage(`Failed to create template: ${error}`);
57+
window.showErrorMessage('Failed to create template');
58+
outputChannel.error('Failed to create template', error as Error);
6659
}
6760
};
6861
}

src/commands/templates/editTemplate.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
import path from 'path';
1+
import path from 'node:path';
22
import { ExtensionContext, Uri, workspace, window } from 'vscode';
3-
import { TemplatesProvider } from '../../views/providers';
4-
import * as fs from 'fs';
3+
import * as fs from 'node:fs';
4+
import { CommandProviders, CommandServices } from '../../commands';
55

66
/**
77
* Edit a template
88
*/
9-
export function editTemplate(context: ExtensionContext, templatesProvider: TemplatesProvider) {
9+
export function editTemplate(context: ExtensionContext, services: CommandServices, providers: CommandProviders) {
1010
return async (item: any) => {
11+
const { outputChannel } = services;
12+
const { templatesProvider } = providers;
1113
if (!item?.template) {
1214
return;
1315
}
@@ -18,9 +20,13 @@ export function editTemplate(context: ExtensionContext, templatesProvider: Templ
1820
if (!fs.existsSync(tempDir)) {
1921
fs.mkdirSync(tempDir, { recursive: true });
2022
}
21-
2223
const tempFile = path.join(tempDir, `${template.id}.yaml`);
2324

25+
if (!fs.existsSync(tempFile)) {
26+
const yamlContent = templatesProvider.getTemplateAsYaml(template);
27+
fs.writeFileSync(tempFile, yamlContent, 'utf-8');
28+
}
29+
2430
// Open the file
2531
const uri = Uri.file(tempFile);
2632
const doc = await workspace.openTextDocument(uri);
@@ -55,7 +61,7 @@ export function editTemplate(context: ExtensionContext, templatesProvider: Templ
5561
fs.unlinkSync(tempFile);
5662
}
5763
} catch (e) {
58-
// Ignore cleanup errors
64+
outputChannel.error(`Failed to delete temp file: ${e}`);
5965
}
6066
}
6167
});

0 commit comments

Comments
 (0)