|
1 | | -# Welcome to your VS Code Extension |
| 1 | +# Famous Dev Theme - VS Code Extension Development Guide |
2 | 2 |
|
3 | | -## What's in the folder |
| 3 | +## Overview |
4 | 4 |
|
5 | | -* This folder contains all of the files necessary for your color theme extension. |
6 | | -* `package.json` - this is the manifest file that defines the location of the theme file and specifies the base theme of the theme. |
7 | | -* `themes/famous-dev-theme-color-theme.json` - the color theme definition file. |
| 5 | +This guide will help you understand, develop, and publish the Famous Dev Theme extension. The extension includes three premium themes optimized for long coding sessions: |
8 | 6 |
|
9 | | -## Get up and running straight away |
| 7 | +- **Famous Dev Dark**: Premium dark mode with balanced contrast |
| 8 | +- **Famous Dev Midnight**: Focus-oriented darker theme with dimmed accents |
| 9 | +- **Famous Dev Light**: Clean, minimal light theme for daylight conditions |
10 | 10 |
|
11 | | -* Press `F5` to open a new window with your extension loaded. |
12 | | -* Open `File > Preferences > Color Themes` and pick your color theme. |
13 | | -* Open a file that has a language associated. The languages' configured grammar will tokenize the text and assign 'scopes' to the tokens. To examine these scopes, invoke the `Developer: Inspect Editor Tokens and Scopes` command from the Command Palette (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac). |
| 11 | +## Prerequisites |
14 | 12 |
|
15 | | -## Make changes |
| 13 | +Before you begin working with this extension, make sure you have: |
16 | 14 |
|
17 | | -* Changes to the theme file are automatically applied to the Extension Development Host window. |
| 15 | +- Visual Studio Code installed |
| 16 | +- Node.js and npm installed |
| 17 | +- VSCE (Visual Studio Code Extension Manager) installed globally: `npm install -g vsce` |
| 18 | +- A GitHub account for repository management |
| 19 | +- A Visual Studio Marketplace publisher account (for publishing) |
18 | 20 |
|
19 | | -## Adopt your theme to Visual Studio Code |
| 21 | +## Getting Started |
20 | 22 |
|
21 | | -* The token colorization is done based on standard TextMate themes. Colors are matched against one or more scopes. |
| 23 | +### 1. Clone the Repository |
22 | 24 |
|
23 | | -To learn more about scopes and how they're used, check out the [color theme](https://code.visualstudio.com/api/extension-guides/color-theme) documentation. |
| 25 | +```bash |
| 26 | +git clone https://github.com/GausAlMunirTushar/famous-dev-theme.git |
| 27 | +cd famous-dev-theme |
| 28 | +``` |
24 | 29 |
|
25 | | -## Install your extension |
| 30 | +### 2. Install Dependencies |
26 | 31 |
|
27 | | -* To start using your extension with Visual Studio Code copy it into the `<user home>/.vscode/extensions` folder and restart Code. |
28 | | -* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension. |
| 32 | +```bash |
| 33 | +npm install |
| 34 | +``` |
| 35 | + |
| 36 | +### 3. Open in VS Code |
| 37 | + |
| 38 | +```bash |
| 39 | +code . |
| 40 | +``` |
| 41 | + |
| 42 | +## Development |
| 43 | + |
| 44 | +### Understanding the Structure |
| 45 | + |
| 46 | +``` |
| 47 | +famous-dev-theme/ |
| 48 | +├── package.json # Extension manifest |
| 49 | +├── README.md # Public documentation |
| 50 | +├── CHANGELOG.md # Release history |
| 51 | +├── LICENSE.md # License information |
| 52 | +├── themes/ # Theme files |
| 53 | +│ ├── famous-dev-dark.json |
| 54 | +│ ├── famous-dev-midnight.json |
| 55 | +│ └── famous-dev-light.json |
| 56 | +├── screenshots/ # Theme preview images |
| 57 | +├── .github/ # GitHub configuration |
| 58 | +│ ├── workflows/ # CI/CD workflows |
| 59 | +│ └── ISSUE_TEMPLATE/ # Issue templates |
| 60 | +└── vsc-extension-quickstart.md # This file |
| 61 | +``` |
| 62 | + |
| 63 | +### Working with Themes |
| 64 | + |
| 65 | +Each theme is defined as a JSON file in the `themes/` folder: |
| 66 | + |
| 67 | +- **Color definitions**: Define UI colors for VS Code components |
| 68 | +- **Token colors**: Define syntax highlighting for code elements |
| 69 | +- **File associations**: Define how different file types appear |
| 70 | + |
| 71 | +## Testing the Extension |
| 72 | + |
| 73 | +### 1. Launch Extension |
| 74 | + |
| 75 | +1. Open the extension folder in VS Code |
| 76 | +2. Press `F5` to open a new window with the extension loaded |
| 77 | +3. Go to File > Preferences > Color Theme and select one of the Famous Dev themes |
| 78 | + |
| 79 | +### 2. Debug Console |
| 80 | + |
| 81 | +- Check the Debug Console for any errors during theme loading |
| 82 | +- Use Developer Tools (Help > Toggle Developer Tools) to inspect theme application |
| 83 | + |
| 84 | +## Publishing to Visual Studio Marketplace |
| 85 | + |
| 86 | +### 1. Prerequisites for Publishing |
| 87 | + |
| 88 | +Before publishing, you need: |
| 89 | +- A publisher account on the Visual Studio Marketplace |
| 90 | +- A Personal Access Token (PAT) with Marketplace permissions |
| 91 | + |
| 92 | +#### Creating a Publisher Account: |
| 93 | +1. Go to [Visual Studio Marketplace](https://marketplace.visualstudio.com/) |
| 94 | +2. Sign in with your Microsoft account |
| 95 | +3. Navigate to the "Publish Extensions" section |
| 96 | +4. Create a new publisher account |
| 97 | +5. Note your publisher name for later use |
| 98 | + |
| 99 | +#### Creating a Personal Access Token: |
| 100 | +1. Go to [Azure DevOps Tokens](https://dev.azure.com/) |
| 101 | +2. Generate a new Personal Access Token |
| 102 | +3. Select Marketplace as the scope |
| 103 | +4. Set permissions to 'Manage' for publishing |
| 104 | +5. Copy the token for use below |
| 105 | + |
| 106 | +### 2. Preparing for Publication |
| 107 | + |
| 108 | +1. **Update version**: Increment the version in `package.json` |
| 109 | + ```json |
| 110 | + { |
| 111 | + "version": "1.0.1" // Increment before publishing |
| 112 | + } |
| 113 | + ``` |
| 114 | + |
| 115 | +2. **Update CHANGELOG.md**: Add your release notes |
| 116 | + |
| 117 | +3. **Verify package.json**: Ensure all required fields are correct: |
| 118 | + - `name`, `displayName`, `description` |
| 119 | + - `publisher` (your publisher name) |
| 120 | + - `engines.vscode` version |
| 121 | + - `categories` includes "Themes" |
| 122 | + - `contributes.themes` points to correct files |
| 123 | + |
| 124 | +4. **Test locally**: Make sure all themes work properly |
| 125 | + |
| 126 | +5. **Update screenshots**: Ensure screenshots directory has current theme previews |
| 127 | + |
| 128 | +### 3. Publishing Process |
| 129 | + |
| 130 | +#### Method 1: Manual Publishing |
| 131 | + |
| 132 | +1. **Install vsce globally** (if not done): |
| 133 | + ```bash |
| 134 | + npm install -g vsce |
| 135 | + ``` |
| 136 | + |
| 137 | +2. **Package the extension**: |
| 138 | + ```bash |
| 139 | + vsce package |
| 140 | + ``` |
| 141 | + This creates a `.vsix` file in your project directory |
| 142 | + |
| 143 | +3. **Publish to marketplace**: |
| 144 | + ```bash |
| 145 | + vsce publish -p <your-personal-access-token> |
| 146 | + ``` |
| 147 | + Replace `<your-personal-access-token>` with your actual PAT |
| 148 | + |
| 149 | +4. **Verify publication**: Visit your extension page on the marketplace |
| 150 | + |
| 151 | +#### Method 2: Automated Publishing (Recommended) |
| 152 | + |
| 153 | +The project includes a GitHub Actions workflow for automated publishing: |
| 154 | + |
| 155 | +1. **Set up GitHub repository** and push your code |
| 156 | + |
| 157 | +2. **Add your PAT to GitHub Secrets**: |
| 158 | + - Go to your GitHub repository Settings |
| 159 | + - Navigate to Secrets and Variables > Actions |
| 160 | + - Add a new secret named `VSCE_PAT` with your Personal Access Token |
| 161 | + |
| 162 | +3. **Create and publish a release**: |
| 163 | + - Create a new tag in your repository (e.g., `v1.0.1`) |
| 164 | + - Create a GitHub release for that tag |
| 165 | + - The workflow will automatically publish it to the marketplace |
| 166 | + |
| 167 | +### 4. Post-Publication Steps |
| 168 | + |
| 169 | +1. **Verify on marketplace**: Check that your extension appears correctly |
| 170 | +2. **Test the published version**: Install from marketplace and verify functionality |
| 171 | +3. **Update documentation**: If needed, update README with new features |
| 172 | +4. **Monitor feedback**: Check for user reviews and issues |
| 173 | + |
| 174 | +## Troubleshooting Publishing Issues |
| 175 | + |
| 176 | +### Common Problems: |
| 177 | + |
| 178 | +- **"Unauthorized" errors**: Verify your personal access token has correct permissions |
| 179 | +- **"Name already exists"**: Ensure your extension name is unique |
| 180 | +- **Validation failures**: Check that all required fields in package.json are present |
| 181 | +- **Token not found**: Make sure to use the correct format when publishing |
| 182 | + |
| 183 | +### Useful Commands: |
| 184 | + |
| 185 | +- `vsce validate`: Check if your extension is valid |
| 186 | +- `vsce package`: Create a .vsix file for manual testing |
| 187 | +- `vsce publish --pre-release`: Publish as pre-release |
| 188 | + |
| 189 | +## Maintaining the Extension |
| 190 | + |
| 191 | +### Regular Updates: |
| 192 | +- Address user feedback and bug reports |
| 193 | +- Add support for new syntax highlighting based on user requests |
| 194 | +- Update themes based on accessibility best practices |
| 195 | +- Keep dependencies up-to-date when applicable |
| 196 | + |
| 197 | +### Versioning Strategy: |
| 198 | +- Follow semantic versioning (MAJOR.MINOR.PATCH) |
| 199 | +- Major: Breaking changes to theme structure |
| 200 | +- Minor: New themes, features, or syntax highlighting |
| 201 | +- Patch: Bug fixes and small improvements |
| 202 | + |
| 203 | +## Resources |
| 204 | + |
| 205 | +- [VS Code Theme Guide](https://code.visualstudio.com/api/references/theme-color) |
| 206 | +- [TextMate Theme Reference](https://macromates.com/manual/en/language_grammars) |
| 207 | +- [VSCE Documentation](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) |
| 208 | +- [Marketplace Publishing Guide](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) |
0 commit comments