Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v3.1.0 #102

Merged
merged 17 commits into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ trim_trailing_whitespace = false

# windows shell scripts
[*.{cmd,bat,ps1}]
end_of_line = crlf
end_of_line = crlf
6 changes: 6 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Workflow Description:
# - Patches the `CHANGELOG.md` into the `.jar` for updated release notes
# - Builds the `.jar`
# - Publishes to the JetBrains Marketplace
# - Creates a draft release on GitHub for maintainers with the new `.jar` to manually review and release

name: Publish

on:
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

### Changed

- (UI): Highlight text in accented buttons as `crust` instead of `surface1` for increased contrast
- (UI)(Latte): Use `crust` instead of `base` for darker borders and increased contrast.
- (SDL, Logcat, Jade): Improve syntax highlighting

### Deprecated

### Removed
Expand All @@ -14,6 +18,11 @@

### Fixed

- (Rust): Highlight variables as `text` instead of `peach`
- (Editor): Highlight first row of code completion popup
- (UI): Sync button background with panel background
- (UI)(Latte): Darken checkboxes to make radio buttons visible

### Security

## 3.0.0 - 2023-10-16
Expand Down
82 changes: 82 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Contributing

First, thank you for wanting to contribute! Make sure to read the
organisation-wide [CONTRIBUTING.md](https://github.com/catppuccin/.github/blob/main/CONTRIBUTING.md) first!

This document details the file structure, optimal development workflow and general notes that are useful
for contributors.

> [!IMPORTANT]
> Please read the JetBrains [theming documentation](https://plugins.jetbrains.com/docs/intellij/developing-themes.html)
> which will answer any questions surrounding creating, running and deploying a JetBrains theme.

## File Structure

- `.github/workflows/` - CI/CD workflows for building and distributing `.jar` files
- `.run/` - Collection of useful Intellij run configuration tasks that ease the development process
- `generateFlavours/` - Typescript code that generates all 4 Catppuccin flavours into JetBrains format.
- `editor.xml` - Highlights for everything contained within the [editor]()
- `ui.theme.json` - Highlights for everything contained within the [user interface]()
- `main.ts` - Responsible for parsing the `editor.xml` and `ui.theme.json` and generating the themes
in `src/main/resources/themes`.
- `src/main/resources/META-INF` - Contains metadata that is shipped with the built `.jar` including the logo, id, name,
and description
- `build.gradle.kts` - Standard gradle build file defining custom build tasks
- `gradle.properties` - Properties that define the theme. E.g. name, supported version(s) and type of IDE to build
locally for testing, etc
- `settings.gradle.kts` - Contains the root project name

## Development Workflow

### Requirements

- Deno v1.27+ with [Deno plugin](https://plugins.jetbrains.com/plugin/14382-deno)

### Debugging Tools

JetBrains provide internal debugging tools to aid with theme creation. Please refer to the documentation below:

- [Internal Actions Menu](https://plugins.jetbrains.com/docs/intellij/internal-actions-intro.html)
- [UI Inspector](https://plugins.jetbrains.com/docs/intellij/internal-ui-inspector.html)
- [LaF Defaults](https://plugins.jetbrains.com/docs/intellij/internal-ui-laf-defaults.html)

### Task Configuration

The `.run` directory contains all the tasks required to generate the flavours, build the plugin and run the plugin.
However, these settings are not always imported correctly. I have included my personal configuration as a reference
point if you find that your tasks are not working properly.

> [!NOTE]
> The configuration in the screenshots below contain hardcoded paths based on my personal system. Please tweak your
> configuration to suit your system setup.
>
> ~ Hammy

#### Generate All Flavours

`Generate All Flavours`
![deno-configuration.png](assets/docs/deno-configuration.png)

#### Build Plugin

`Build Plugin`
![img.png](assets/docs/build-configuration.png)

#### Run Plugin

`Run Plugin`
![img.png](assets/docs/run-configuration.png)

### Example Scenario

Here is an example workflow for changing the background from base to mantle:

1. Change `primaryBackground` from `base` to `mantle`
2. Run `Build Plugin` task (this will generate files under `src/main/resources/themes` and the
resulting `.jar` file will be in `build/libs`)
3. Run `Run Plugin` task (this will spawn a new IDE with your changes already applied)
4. Observe new highlights within the test IDE instance
5. If you aren't happy with your changes, **start over from step 1**
6. Once happy, update `CHANGELOG.md` with new updates to the theme under relevant headings
7. Push changes to a new branch on your fork
8. Create pull request to the `main` branch on the main repository
113 changes: 14 additions & 99 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,112 +38,27 @@

## Installation

- Using IDE built-in plugin system:
### Plugin Marketplace

<kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>Marketplace</kbd> >
<kbd>Search for "Catppuccin Theme"</kbd> >
<kbd>Install Plugin</kbd>
1. Head to the [Plugin Marketplace](https://plugins.jetbrains.com/) (<kbd>Settings</kbd> → <kbd>Plugins</kbd> → <kbd>
Marketplace</kbd>)
2. Search for **"Catppuccin Theme"**
3. Install Plugin

- Manually:
### Manual

Download the
[latest release](https://github.com/catppuccin/jetbrains/releases/latest) and
install it manually using
<kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>⚙️</kbd> >
<kbd>Install plugin from disk...</kbd>
Download the [latest release](https://github.com/catppuccin/jetbrains/releases/latest) and import it by heading to <kbd>
Settings</kbd> → <kbd>Plugins</kbd> → ⚙️ → <kbd>Install plugin from disk...</kbd>

## Contributing

First, thank you for wanting to contribute! Make sure to read the organisation-wide [CONTRIBUTING.md](https://github.com/catppuccin/.github/blob/main/CONTRIBUTING.md)!

Listed below are details on the file structure, optimal development workflow and general notes that are useful
for developing on this port.

> **Note** <br>
> Please ensure that you have read the relevant JetBrains documentation listed [here](https://plugins.jetbrains.com/docs/intellij/developing-themes.html)
> which will answer any questions surrounding creating, running and deploying a JetBrains theme.

### File Structure

- `.github/workflows/` - CI/CD workflows for building and distributing `.jar` files
- `.run/` - Collection of useful Intellij run configuration tasks that ease the development process
- `generateFlavours/` - JS/TS code that generates all 4 Catppuccin flavours into the specified XML format that JetBrains require
- `main.ts` - Generates `.theme.json` and `.xml` files. The `.theme.json` file relates to the UI elements whereas the `.xml` file (derived solely from the `.template.xml`) is for the Editor elements entirely (e.g the code syntax highlighting)
- `template.xml` - As mentioned above, these are all the highlights for everything to do regarding the editor. It is important to note that we have included some [handlebars](https://handlebarsjs.com/) syntax to allow for easier generation of the Latte flavour compared to Frappé, Macchiato and Mocha
- `src/main/resources/META-INF` - Contains metadata that is shipped with the `.jar` including the Catppuccin logo, id, name, and description
- `build.gradle.kts` - Standard gradle build file defining custom build tasks on top of defaults
- `gradle.properties` - Properties that define the theme. For example, this includes the name, supported version(s) and type of IDE to build locally for testing, etc
- `settings.gradle.kts` - Contains the root project name

### Development Workflow

#### Requirements

- Deno v1.27+ with [Deno plugin](https://plugins.jetbrains.com/plugin/14382-deno)

#### Debugging Tools

JetBrains (thankfully) provide internal debugging tools to aid with theme creation in their IDE's. Please refer to the documentation below:

- [Internal Actions Menu](https://plugins.jetbrains.com/docs/intellij/internal-actions-intro.html)
- [UI Inspector](https://plugins.jetbrains.com/docs/intellij/internal-ui-inspector.html)
- [LaF Defaults](https://plugins.jetbrains.com/docs/intellij/internal-ui-laf-defaults.html)

#### IDE Build Configuration
## Usage

> **Note** <br>
> The configuration in the given screenshots below contain hardcoded paths based on my personal system. Please ensure
> that you tweak your configurations to make sense within the context of your own system setup
>
> ~ Hammy
- User Interface: <kbd>Settings</kbd> → <kbd>Appearance & Behaviour</kbd> → <kbd>Appearance</kbd> → Pick your
favourite flavour!
- Code Editor: <kbd>Settings</kbd> → <kbd>Editor</kbd> → <kbd>Color Scheme</kbd> → Pick your favourite flavour!

You should also ensure that the `Generate All Flavours.run.xml` configuration has been correctly identified by your
JetBrains IDE of choosing.

For reference, your `Generate All Flavours` build configuration should look like the following:

![deno-configuration.png](assets/docs/deno-configuration.png)

The build configurations for `Build Plugin` and `Run Plugin` should also include `Generate All Flavours` as pre-launch
tasks. (This is to ensure that the latest changes are included with each local build of the theme.) For reference, they
should look like the following:

`Build Plugin`
![img.png](assets/docs/build-configuration.png)

`Run Plugin`
![img.png](assets/docs/run-configuration.png)

#### Example Scenario

Some high level steps are shown below in an example development workflow for editing Link (UI) & Selection (Editor) highlights

##### High Level

1. Edit Link highlight colour within `main.ts`
2. Edit Selection highlight colour within `template.xml`
3. Run `Build Plugin` build configuration (there should be updated files in `src/main/resources/themes` and the resulting `.jar` file should be under `build/libs`)
4. Run `Run Plugin` build configuration (the result should be an entire IDE with the new changes applied)
5. Observe new highlights within the test IDE instance
6. If you aren't happy with your changes, repeat from step 2
7. Once happy, update `CHANGELOG.md` with new updates to the theme under relevant headings
8. Push changes to new remote branch
9. Create pull request
10. ???
11. Profit

#### CI/CD Pipeline

To ease the development and deployment process, we have defined a full CI/CD pipeline that is capable of producing test
`.jar` binaries on each relevant push, releasing draft binaries to GitHub and deploying straight to the JetBrains
Marketplace.
## Contributing

- `build.yml` - Runs on every relevant push/pull-request, it builds the `.jar` and uploads it for anyone to download it
- `publish.yml` - Runs on every git tag starting with `v*`
- Patches the `CHANGELOG.md` into the `.jar` for updated release notes
- Builds the `.jar`
- Publishes to the JetBrains Marketplace
- Creates a draft release on GitHub for maintainers with the new `.jar` to manually review and release
See [CONTRIBUTING.md](CONTRIBUTING.md)

## 💝 Thanks to

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
// Java support
id("java")
// Kotlin support
id("org.jetbrains.kotlin.jvm") version "1.6.10"
id("org.jetbrains.kotlin.jvm") version "1.9.10"
// Gradle IntelliJ Plugin
id("org.jetbrains.intellij") version "1.16.0"
// Gradle Changelog Plugin
Expand Down
40 changes: 40 additions & 0 deletions generateFlavours/template.xml → generateFlavours/editor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1348,6 +1348,11 @@
</value>
</option>
<option name="INSTANCE_FIELD_ATTRIBUTES" baseAttributes="DEFAULT_INSTANCE_FIELD"/>
<option name="io.github.intellij.dlanguage.sdlang.TAG_IDENTIFIER">
<value>
<option name="FOREGROUND" value="{{blue}}" />
</value>
</option>
<option name="IVAR">
<value>
<option name="FOREGROUND" value="{{text}}"/>
Expand Down Expand Up @@ -1379,6 +1384,16 @@
<option name="FOREGROUND" value="{{sky}}"/>
</value>
</option>
<option name="JADE_FILTER_NAME">
<value>
<option name="FOREGROUND" value="{{blue}}" />
</value>
</option>
<option name="JADE_JS_BLOCK">
<value>
<option name="FOREGROUND" value="{{lavender}}" />
</value>
</option>
<option name="JS.PARAMETER" baseAttributes="DEFAULT_PARAMETER"/>
<option name="JS.DECORATOR">
<value>
Expand Down Expand Up @@ -1574,6 +1589,26 @@
<option name="FOREGROUND" value="{{blue}}"/>
</value>
</option>
<option name="LOGCAT_FILTER_KEY">
<value>
<option name="FOREGROUND" value="{{blue}}" />
</value>
</option>
<option name="LOGCAT_FILTER_KVALUE">
<value>
<option name="FOREGROUND" value="{{text}}" />
</value>
</option>
<option name="LOGCAT_FILTER_REGEX_KVALUE">
<value>
<option name="FOREGROUND" value="{{pink}}" />
</value>
</option>
<option name="LOGCAT_FILTER_STRING_KVALUE">
<value>
<option name="FOREGROUND" value="{{green}}" />
</value>
</option>
<option name="LOGCAT_INFO_OUTPUT">
<value>
<option name="FOREGROUND" value="{{green}}"/>
Expand Down Expand Up @@ -2926,6 +2961,11 @@
<option name="org.rust.UNSAFE_CODE">
<value/>
</option>
<option name="org.rust.VARIABLE">
<value>
<option name="FOREGROUND" value="{{text}}"/>
</value>
</option>
<option name="org.toml.KEY">
<value>
<option name="FOREGROUND" value="{{blue}}"/>
Expand Down
Loading