Skip to content

Commit

Permalink
new: Add Tags view for moon console. (#62)
Browse files Browse the repository at this point in the history
* Add tag support.

* Update manifest.

* Bump version.

* Update readme.

* Collapse by default.
  • Loading branch information
milesj authored Jan 26, 2024
1 parent 1a28a99 commit e0f6cf7
Show file tree
Hide file tree
Showing 7 changed files with 195 additions and 72 deletions.
4 changes: 4 additions & 0 deletions packages/vscode-extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.9.0

- Added a "Tags" view for projects in the moon console sidebar.

## 0.8.0

- Added a `moon.logLevel` setting, to control the log level of all moon executed commands.
Expand Down
15 changes: 13 additions & 2 deletions packages/vscode-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ alt="Screenshot of projects view" width="300px" />

> This view is available in both the "Explorer" and "moon" sections.
### Tags view

Similar to the projects view, the tags view displays projects grouped by their `tags`.

<img
src="https://raw.githubusercontent.com/moonrepo/dev/master/packages/vscode-extension/images/tags-view.png"
alt="Screenshot of tags view" width="300px" />

> This view is only available in the "moon" section.
### Last run view

Information about the last ran task will be displayed in a beautiful table with detailed stats.
Expand All @@ -29,6 +39,8 @@ Information about the last ran task will be displayed in a beautiful table with
src="https://raw.githubusercontent.com/moonrepo/dev/master/packages/vscode-extension/images/last-run-view.png"
alt="Screenshot of last run view" width="300px" />

> This view is only available in the "moon" section.
### Control panel

To provide the best experience, all major features, enhancements, and integrations can be found
Expand Down Expand Up @@ -63,8 +75,6 @@ prefixed with "moon".

- **Open settings** - Opens the settings page and filters to all moon applicable settings.
- **Run task** - Prompts the user for a task(s) and runs it in the terminal.
- **Refresh projects** - Refreshes the projects view. _This happens automatically when
`.moon/workspace.yml` changes!_
- **View action graph** - Opens a panel that renders an interactive action graph visualization.
- **View project graph** - Opens a panel that renders an interactive project graph visualization.

Expand All @@ -76,6 +86,7 @@ prefixed with "moon".
- [x] Categorize tasks based on type
- [x] Run a task
- [x] Check a project
- [x] Tags view
- [x] Last run view
- [x] Commands and command palette
- [x] Watches and reacts to file system changes.
Expand Down
Binary file added packages/vscode-extension/images/tags-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion packages/vscode-extension/moon.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
type: 'library'
type: 'tool'
tags: ['extension']

project:
name: 'VS Code extension'
Expand Down
109 changes: 69 additions & 40 deletions packages/vscode-extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"version": "0.8.0",
"version": "0.9.0",
"name": "moon-console",
"publisher": "moonrepo",
"displayName": "moon console",
Expand Down Expand Up @@ -38,7 +38,8 @@
"directory": "packages/vscode-extension"
},
"activationEvents": [
"workspaceContains:moon.yml"
"workspaceContains:.moon",
"workspaceContains:**/moon.yml"
],
"main": "./lib/extension.js",
"contributes": {
Expand Down Expand Up @@ -75,62 +76,66 @@
"title": "moon: Open settings"
},
{
"command": "moon.refreshProjects",
"command": "moon.runTaskByInput",
"title": "moon: Run one or many tasks"
},
{
"command": "moon.viewActionGraph",
"title": "moon: View action graph",
"icon": "$(gather)"
},
{
"command": "moon.viewProjectGraph",
"title": "moon: View project graph",
"icon": "$(type-hierarchy-sub)"
},
{
"command": "moon.projectCategory.refreshProjects",
"title": "moon: Refresh projects",
"icon": "$(refresh)"
},
{
"command": "moon.checkProject",
"command": "moon.projectCategory.checkProject",
"title": "moon: Run all buildable and testable tasks for a project",
"icon": "$(run-all)"
},
{
"command": "moon.runTask",
"command": "moon.projectCategory.runTask",
"title": "moon: Run the task",
"icon": "$(run)"
},
{
"command": "moon.runTaskByInput",
"title": "moon: Run one or many tasks"
},
{
"command": "moon.viewProject",
"command": "moon.projectCategory.viewProject",
"title": "moon: View selected project",
"icon": "$(open-preview)"
},
{
"command": "moon.viewActionGraph",
"title": "moon: View action graph",
"icon": "$(gather)"
"command": "moon.projectTag.refreshProjects",
"title": "moon: Refresh projects",
"icon": "$(refresh)"
},
{
"command": "moon.viewProjectGraph",
"title": "moon: View project graph",
"icon": "$(type-hierarchy-sub)"
"command": "moon.projectTag.checkProject",
"title": "moon: Run all buildable and testable tasks for a project",
"icon": "$(run-all)"
},
{
"command": "moon.projectTag.runTask",
"title": "moon: Run the task",
"icon": "$(run)"
},
{
"command": "moon.projectTag.viewProject",
"title": "moon: View selected project",
"icon": "$(open-preview)"
}
],
"menus": {
"commandPalette": [
{
"command": "moon.refreshProjects",
"when": "moon.hasBinary"
},
{
"command": "moon.checkProject",
"when": "false"
},
{
"command": "moon.runTask",
"when": "false"
},
{
"command": "moon.runTaskByInput",
"when": "moon.hasBinary"
},
{
"command": "moon.viewProject",
"when": "false"
},
{
"command": "moon.viewActionGraph",
"when": "moon.hasBinary"
Expand All @@ -142,12 +147,17 @@
],
"view/title": [
{
"command": "moon.refreshProjects",
"command": "moon.projectTag.refreshProjects",
"when": "view == moonTags && moon.hasBinary",
"group": "navigation"
},
{
"command": "moon.projectCategory.refreshProjects",
"when": "view == moonProjects && moon.hasBinary",
"group": "navigation"
},
{
"command": "moon.refreshProjects",
"command": "moon.projectCategory.refreshProjects",
"when": "view == moonProjectsExternal && moon.hasBinary",
"group": "navigation"
},
Expand All @@ -174,32 +184,47 @@
],
"view/item/context": [
{
"command": "moon.runTask",
"command": "moon.projectTag.runTask",
"when": "view == moonTags && viewItem == projectTask",
"group": "inline"
},
{
"command": "moon.projectTag.viewProject",
"when": "view == moonTags && viewItem == project",
"group": "inline@0"
},
{
"command": "moon.projectTag.checkProject",
"when": "view == moonTags && viewItem == project",
"group": "inline@1"
},
{
"command": "moon.projectCategory.runTask",
"when": "view == moonProjects && viewItem == projectTask",
"group": "inline"
},
{
"command": "moon.viewProject",
"command": "moon.projectCategory.viewProject",
"when": "view == moonProjects && viewItem == project",
"group": "inline@0"
},
{
"command": "moon.checkProject",
"command": "moon.projectCategory.checkProject",
"when": "view == moonProjects && viewItem == project",
"group": "inline@1"
},
{
"command": "moon.runTask",
"command": "moon.projectCategory.runTask",
"when": "view == moonProjectsExternal && viewItem == projectTask",
"group": "inline"
},
{
"command": "moon.viewProject",
"command": "moon.projectCategory.viewProject",
"when": "view == moonProjectsExternal && viewItem == project",
"group": "inline@0"
},
{
"command": "moon.checkProject",
"command": "moon.projectCategory.checkProject",
"when": "view == moonProjectsExternal && viewItem == project",
"group": "inline@1"
}
Expand All @@ -226,6 +251,10 @@
"id": "moonProjects",
"name": "Projects"
},
{
"id": "moonTags",
"name": "Tags"
},
{
"id": "moonLastRun",
"name": "Last run",
Expand Down
23 changes: 13 additions & 10 deletions packages/vscode-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,22 @@ import { Workspace } from './workspace';

export function activate(context: vscode.ExtensionContext) {
const workspace = new Workspace();
const projectsProvider = new ProjectsProvider(context, workspace);
const projectsProvider = new ProjectsProvider(context, workspace, 'category');
const tagsProvider = new ProjectsProvider(context, workspace, 'tag');

context.subscriptions.push(
vscode.commands.registerCommand('moon.openSettings', () =>
vscode.commands.executeCommand('workbench.action.openSettings', '@ext:moonrepo.moon-console'),
),

// Create a "moon run <target>" task
// Create commands
vscode.commands.registerCommand('moon.runTaskByInput', () => runTaskByInput(workspace)),
vscode.commands.registerCommand('moon.viewActionGraph', () =>
viewActionGraph(context, workspace),
),
vscode.commands.registerCommand('moon.viewProjectGraph', () =>
viewProjectGraph(context, workspace),
),

// Create a tree view for all moon projects
vscode.window.createTreeView('moonProjects', {
Expand All @@ -25,14 +32,10 @@ export function activate(context: vscode.ExtensionContext) {
showCollapseAll: true,
treeDataProvider: projectsProvider,
}),

// Create graph visualizers
vscode.commands.registerCommand('moon.viewActionGraph', () =>
viewActionGraph(context, workspace),
),
vscode.commands.registerCommand('moon.viewProjectGraph', () =>
viewProjectGraph(context, workspace),
),
vscode.window.createTreeView('moonTags', {
showCollapseAll: true,
treeDataProvider: tagsProvider,
}),

// Create a webview for last run report
vscode.window.registerWebviewViewProvider(
Expand Down
Loading

0 comments on commit e0f6cf7

Please sign in to comment.