Skip to content

Commit

Permalink
Add instruction for local vsix share. (#1180)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tatsinnit authored Jan 17, 2025
1 parent c8788ff commit 0f02a14
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions docs/book/src/development/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,45 @@ Some scripts are invoked by other scripts or tools, so need not be run directly,
- `webpack-dev`: bundles the extension code in development mode. Since we currently have no conditional logic that depends on whether the extension is running in development or production, this may be redundant.
- `test-compile`: compiles the extension typescript (after building the `webview-ui` project) without webpacking it. This is a prerequisite to running automated tests. It _could_ be moved into `test`, but keeping it separate would allow it to be used in the future as a prelaunch task for debugging the extension without webpacking it.
- `watch`: not currently used as part of any workflow I'm aware of, but could potentially be useful for editing while debugging.

### **Local VSIX Sharing and How to Share via a GitHub Comment**

Follow these steps to modify the `package.json` version, generate a VSIX file, and prepare it for sharing as a renamed file in a GitHub comment:

### **Step 1: Update the `package.json` Version**
1. Open the **`package.json`** file in your project directory.
2. Find the `"version"` field.
3. Update it to a unique test version (e.g., `1.0.0-test.1` or include a timestamp for uniqueness).
Example:
```json
{
"name": "my-extension",
"version": "1.0.0-test.1",
"main": "extension.js"
}
```
4. Save your changes.

### **Step 2: Generate the VSIX File**
1. Open a terminal in your project directory.
2. Run the following command to package the extension: ([How to install `vsce`](https://www.npmjs.com/package/@vscode/vsce))
```bash
vsce package
```
3. A file like `my-extension-1.0.0-test.1.vsix` will be created in your project directory.

### **Step 3: Rename the File for Sharing**
1. **Rename the VSIX File:**
GitHub does not allow direct upload of files with the `.vsix` extension. To work around this:
- Rename the file by appending `.zip` to the original name.
Example:
Rename `filename.vsix` to `filename.vsix.zip`.

2. **Upload to GitHub:**
- Drag and drop the renamed file (`filename.vsix.zip`) into your GitHub comment or PR description.

### **Final Notes**
- This renaming approach avoids additional steps like zipping or compressing the file.
- The development team is typically familiar with this process, making it a quick and effective way to share test versions.

Happy coding! 🚀

0 comments on commit 0f02a14

Please sign in to comment.