Skip to content

Commit

Permalink
build: added linting, updated docs, updated license
Browse files Browse the repository at this point in the history
- added eslint for dev and github automation
- added donations to metadata.json
- updated license to be less permissive
- updated docs to reflect the project better
- add some todo items to extensions
  • Loading branch information
ZanzyTHEbar committed Jun 26, 2024
1 parent 4956ee5 commit 10ef0d8
Show file tree
Hide file tree
Showing 7 changed files with 824 additions and 28 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Lint

on:
push:
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["main"]

jobs:
eslint:
name: Run eslint scanning
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install ESLint
run: |
npm ci
npm install @microsoft/[email protected]
- name: Run ESLint
run: npm run lint --
--format @microsoft/eslint-formatter-sarif
--output-file eslint-results.sarif
continue-on-error: true

- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: eslint-results.sarif
wait-for-processing: true
695 changes: 674 additions & 21 deletions LICENSE

Large diffs are not rendered by default.

61 changes: 59 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,40 @@
# VSCode Nautilus Extension

This repo provides a GNOME Shell extension for accessing visual studio code/codium recently opened workspaces/directories.
![GitHub License](https://img.shields.io/github/license/ZanzyTHEbar/vscode-nautilus)
[![Lint](https://github.com/ZanzyTHEbar/vscode-nautilus)/actions/workflows/eslint.yml/badge.svg)](https://github.com/ZanzyTHEbar/vscode-nautilus)/actions/workflows/eslint.yml)
![GNOME Extensions download](https://img.shields.io/badge/dynamic/xml?url=https%3A%2F%2Fextensions.gnome.org%2Fextension%2F6976%2Fvscode-search-provider%2F&query=%2Fhtml%2Fbody%2Fdiv%5B2%5D%2Fdiv%2Fdiv%5B2%5D%2Fdiv%5B1%5D%2Fspan%5B3%5D&logo=gnome&label=GNOME%20extensions&cacheSeconds=86400)

Provided are two other extension, for Nautilus.
## Description

<!-- ![screenshot.png](screenshot.png) -->

VSCode Nautilus Extension is a project that provides a GNOME Shell extension for accessing visual studio code/codium recently opened workspaces/directories.

With workspace support, you can open a workspace in Visual Studio Code with a single click.

Provided are two other, optional, extensions for Nautilus.

The first, `vscode_nautilus_workspaces.py`, adds a right-click context menu to select from a list of recently accessed workspaces or directories and open in Visual Studio Code.

The second, `vscode_nautilus_open.py`, adds a right-click context menu to open a folder or file in Visual Studio Code.

## Features

- Supports GNOME Shell 45 - 46
- List all your local VSCode workspaces
- List all your remote VSCode projects
- Add a custom workspace by path
- Supports both Visual Studio Code and Codium
- Nautilus extensions for opening folders and files in Visual Studio Code

## Install Extension

### Install from GNOME Extensions

[<img alt="" height="100" src="https://raw.githubusercontent.com/andyholmes/gnome-shell-extensions-badge/master/get-it-on-ego.svg?sanitize=true">]()

### Install from Source

```bash
bash <(wget -qO- https://raw.githubusercontent.com/ZanzyTHEbar/vscode-nautilus/main/install.sh)
```
Expand Down Expand Up @@ -49,3 +74,35 @@ To open a recent folder or workspace, right-click on an empty space in Nautilus
To open a recent folder or workspace, click on the Visual Studio Code icon in the top bar and select a recent folder or workspace.

You also have various options to configure the extension in the GNOME Tweaks application.

Integrates well with the [VSCode Search Provider](https://extensions.gnome.org/extension/6976/vscode-search-provider/).

## Development

The latest development version requires `git`, `node`, and `make`.

I use `pnpm`, but you can use `npm` or `yarn` if you prefer. It is up to you to modify the scripts to use your preferred package manager.

Navigate to your desired directory and execute following commands in the terminal:

### GNOME 45+

```bash
git clone https://github.com/ZanzyTHEbar/vscode-nautilus.git
cd vscode-nautilus/vscode-workspaces-gnome

make && make pack && make install
```

You can run `make help` to see all available commands.

### Enabling the extension

After installation you need to enable the extension.

- First restart GNOME Shell (`ALt` + `F2`, `r`, `Enter`, or Log-Out/Log-In if you use Wayland)
- Now you should see the _VSCode W_ extension in the _Extensions_ application (reopen the app if needed to load new data), where you can enable it.

### Contributing

If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome :smile:
11 changes: 11 additions & 0 deletions vscode-workspaces-gnome/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import eslintPluginPrettier from "eslint-plugin-prettier/recommended";

export default [
{ languageOptions: { globals: globals.node } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
eslintPluginPrettier,
];
10 changes: 7 additions & 3 deletions vscode-workspaces-gnome/metadata.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{
"name": "VSCode GNOME Extension",
"name": "VSCode Workspaces GNOME",
"description": "A VSCode/Codium Workspace management tool-set for GNOME",
"uuid": "[email protected]",
"url": "https://github.com/ZanzyTHEbar/vscode-nautilus",
"settings-schema": "org.gnome.shell.extensions.vscode-workspaces-gnome",
"shell-version": [
"45"
]
"45",
"46"
],
"donations": {
"github": "ZanzyTHEbar"
}
}
31 changes: 29 additions & 2 deletions vscode-workspaces-gnome/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,39 @@
"type": "module",
"private": true,
"author": "ZanzyTHEbar <[email protected]>",
"license": "MIT",
"license": "LGPL-3.0-or-later",
"sideEffects": false,
"scripts": {
"lint": "eslint . -c eslint.config.js",
"lint:fix": "eslint --fix . -c eslint.config.js",
"format": "prettier --check .",
"format:fix": "prettier --write .",
"prepare": "simple-git-hooks"
},
"simple-git-hooks": {
"pre-commit": "npx lint-staged",
"pre-push": "npm run format"
},
"lint-staged": {
"*": "eslint --fix"
},
"devDependencies": {
"eslint": "^9.5.0",
"@eslint/js": "^9.5.0",
"eslint-plugin-jsdoc": "^48.2.15",
"typescript": "^5.5.2"
"typescript": "^5.5.2",
"@types/node": "^20.14.2",
"esbuild": "^0.21.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"globals": "^15.2.0",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"semantic-release": "^23.1.1",
"simple-git-hooks": "^2.11.1",
"tsm": "^2.3.0",
"typescript-eslint": "^7.8.0",
"uvu": "^0.5.6"
},
"dependencies": {
"@girs/gjs": "^3.3.0",
Expand Down
7 changes: 7 additions & 0 deletions vscode-workspaces-gnome/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js';
import * as MessageTray from 'resource:///org/gnome/shell/ui/messageTray.js';
import { FileChooserDialog } from './fileChooser.js';


// TODO: Support remote files and folders and docker containers

// TODO: Implement support for codium, insiders, snap, and flatpak installations

// TODO: Implement support for custom cmd args

interface Workspace {
uri: string,
storeDir: Gio.File | null,
Expand Down

0 comments on commit 10ef0d8

Please sign in to comment.