Skip to content

Commit b918001

Browse files
authored
Semantic releases & settings panel improvements (#9)
This pull request introduces a range of changes to improve the release workflow, enhance the user interface, and streamline the codebase. The most significant updates include implementing semantic release automation, renaming and restructuring components, and refining the styling and functionality of the UI. ### Workflow and Release Management: * Updated `.github/workflows/deploy.yml` to rename the workflow to "Release and Deploy," added permissions for GitHub Actions, and integrated `semantic-release` for automated versioning and changelog generation. The workflow now builds and deploys only if a new release is published. [[1]](diffhunk://#diff-28802fbf11c83a2eee09623fb192785e7ca92a3f40602a517c011b947a1822d3L1-R1) [[2]](diffhunk://#diff-28802fbf11c83a2eee09623fb192785e7ca92a3f40602a517c011b947a1822d3L10-R23) [[3]](diffhunk://#diff-28802fbf11c83a2eee09623fb192785e7ca92a3f40602a517c011b947a1822d3L42-R67) * Added a `.releaserc.json` configuration file to define semantic release plugins, including changelog generation, npm publishing, and GitHub integration. * Updated `package.json` to include semantic release dependencies. ### Documentation: * Added a `CONTRIBUTING.md` file with guidelines for contributing, including instructions for using conventional commits to automate versioning and changelogs. ### UI and Styling Enhancements: * Improved the `Input` component in `app/components/ui/input.tsx` by modifying focus ring styles and applying consistent formatting. [[1]](diffhunk://#diff-b9a6c9f7652ddf8fa58f96f8ec45530f9de86663d2d678954de6ac2856400c11L1-R3) [[2]](diffhunk://#diff-b9a6c9f7652ddf8fa58f96f8ec45530f9de86663d2d678954de6ac2856400c11L12-R21) * Enhanced the layout and styling of the main interface in `app/components/root.tsx` (renamed from `app/components/section/root.tsx`), including updates to card components, labels, and buttons for a more polished UI. [[1]](diffhunk://#diff-9a0b111763bec5af65c0eb219bdcb14deba81a1cdf3f7be8ca2f22f31f3bd73aL157-R177) [[2]](diffhunk://#diff-9a0b111763bec5af65c0eb219bdcb14deba81a1cdf3f7be8ca2f22f31f3bd73aL213-R231) ### File Restructuring: * Renamed several files for better organization and imports, such as `app/components/icon-picker/root.tsx` to `app/components/icon-picker.tsx` and `app/components/preview/root.tsx` to `app/components/preview.tsx`. Updated corresponding imports across the codebase. [[1]](diffhunk://#diff-e048232737afcfdad9d227474370bdda035799872928213c938450e9630f8b19L81-R81) [[2]](diffhunk://#diff-ce2af7bdea5a636c44305777c2f686af5b96a7181ab282730c6d87cbac907cd3L3-R3) [[3]](diffhunk://#diff-d4d02e1e213a6e908bde87dfb239e6d84dfbaeed2616b5695726416fbb2b2acbL3-R3) ### Functional Updates: * Updated the `IconPicker` component layout to use a grid-based structure instead of a flexbox for better alignment of icons.
2 parents 5895332 + 92fad78 commit b918001

File tree

11 files changed

+2417
-45
lines changed

11 files changed

+2417
-45
lines changed

.github/workflows/deploy.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy to Coolify
1+
name: Release and Deploy
22

33
on:
44
push:
@@ -7,11 +7,20 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
deploy:
10+
release_and_deploy:
11+
name: Release and Deploy
1112
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
issues: write
16+
pull-requests: write
17+
id-token: write
1218
steps:
1319
- name: Checkout
1420
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
token: ${{ secrets.PAT }}
1524

1625
- name: Setup Node.js
1726
uses: actions/setup-node@v4
@@ -39,13 +48,27 @@ jobs:
3948
${{ runner.os }}-pnpm-store-
4049
4150
- name: Install dependencies
42-
run: pnpm install
51+
run: pnpm install --frozen-lockfile
52+
53+
- name: Release
54+
id: semantic
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
run: |
58+
RELEASE_OUTPUT=$(pnpm exec semantic-release || true)
59+
if [ $? -eq 0 ]; then
60+
echo "new_release_published=true" >> $GITHUB_OUTPUT
61+
echo "new_release_version=$(echo "$RELEASE_OUTPUT" | grep -oP '(?<=The next release version is )\d+\.\d+\.\d+')" >> $GITHUB_OUTPUT
62+
else
63+
echo "new_release_published=false" >> $GITHUB_OUTPUT
64+
fi
4365
4466
- name: Build
67+
if: steps.semantic.outputs.new_release_published == 'true'
4568
run: pnpm build
4669

4770
- name: Deploy to Coolify
48-
if: github.ref == 'refs/heads/main'
71+
if: steps.semantic.outputs.new_release_published == 'true'
4972
run: |
5073
curl -X POST \
5174
-H "Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}" \

.releaserc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"branches": ["main"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
[
7+
"@semantic-release/changelog",
8+
{
9+
"changelogFile": "CHANGELOG.md"
10+
}
11+
],
12+
"@semantic-release/npm",
13+
[
14+
"@semantic-release/git",
15+
{
16+
"assets": ["package.json", "pnpm-lock.yaml", "CHANGELOG.md"],
17+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
18+
}
19+
],
20+
"@semantic-release/github"
21+
]
22+
}

CONTRIBUTING.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Contributing to Stream Deck Icons
2+
3+
First off, thank you for considering contributing to this project! Your help is greatly appreciated.
4+
5+
## How to Contribute
6+
7+
We use a system of conventional commits to automate versioning and releases. When you contribute, it's important that your commit messages follow this specification.
8+
9+
### Commit Message Format
10+
11+
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **type**, a **scope** and a **subject**:
12+
13+
```
14+
<type>(<scope>): <subject>
15+
<BLANK LINE>
16+
<body>
17+
<BLANK LINE>
18+
<footer>
19+
```
20+
21+
The **header** is mandatory and the **scope** of the header is optional.
22+
23+
### Type
24+
25+
The type must be one of the following:
26+
27+
- **feat**: A new feature
28+
- **fix**: A bug fix
29+
- **docs**: Documentation only changes
30+
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
31+
- **refactor**: A code change that neither fixes a bug nor adds a feature
32+
- **perf**: A code change that improves performance
33+
- **test**: Adding missing tests or correcting existing tests
34+
- **chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation
35+
- **revert**: Reverts a previous commit
36+
37+
### Examples
38+
39+
Here are some examples of commit messages:
40+
41+
- **feat(icons): add new icon set for Adobe products**
42+
- **fix(picker): resolve issue where color picker would not update**
43+
- **docs(readme): update installation instructions**
44+
- **chore(release): 1.0.0**
45+
46+
By following this convention, we can automatically generate changelogs and determine the next version number for the project.
47+
48+
### Pull Requests
49+
50+
Please create a pull request with your changes. Ensure your branch is up-to-date with the `main` branch before submitting. All pull requests will be reviewed before being merged.

app/components/icon-picker/root.tsx renamed to app/components/icon-picker.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const IconPicker: React.FC<IconPickerProps> = ({
7878
</Button>
7979
</PopoverTrigger>
8080
<PopoverContent className="w-96 p-0">
81-
<div className="flex flex-col gap-2 items-center justify-center">
81+
<div className="flex flex-col gap-0 items-center justify-center">
8282
<Input
8383
placeholder="Search icons..."
8484
value={searchTerm}
@@ -87,7 +87,7 @@ const IconPicker: React.FC<IconPickerProps> = ({
8787
<div
8888
ref={scrollContainerRef}
8989
onScroll={handleScroll}
90-
className="flex flex-wrap gap-2 h-80 overflow-y-auto p-3"
90+
className="grid grid-cols-4 gap-2 h-80 overflow-y-auto p-3"
9191
>
9292
{iconsToRender.map((iconName) => {
9393
const IconComponent = (TablerIcons as any)[iconName];

app/components/preview/root.tsx renamed to app/components/preview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import * as TablerIcons from "@tabler/icons-react";
3-
import { type TextPosition } from "~/components/text-position-control/root";
3+
import { type TextPosition } from "~/components/text-position-control";
44

55
interface PreviewProps {
66
icon: string;

app/components/section/root.tsx renamed to app/components/root.tsx

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import { Input } from "~/components/ui/input";
44
import { Button } from "~/components/ui/button";
55
import * as TablerIcons from "@tabler/icons-react";
66
import html2canvas from "html2canvas";
7-
import Preview from "~/components/preview/root";
7+
import Preview from "~/components/preview";
88
import TextPositionControl, {
99
type TextPosition,
10-
} from "~/components/text-position-control/root";
10+
} from "~/components/text-position-control";
1111
import printStyles from "~/lib/print-styles.css?raw";
1212
import { renderToStaticMarkup } from "react-dom/server";
13-
import IconPicker from "~/components/icon-picker/root";
13+
import IconPicker from "~/components/icon-picker";
1414
import { Link } from "react-router";
1515

1616
const Root: React.FC = () => {
@@ -154,15 +154,27 @@ const Root: React.FC = () => {
154154
<div className="container w-full mx-auto p-4 min-h-dvh h-dvh">
155155
<div className="flex items-start gap-8 h-full">
156156
<div className="w-1/3 h-full min-h-full">
157-
<Card className="min-h-full h-full overflow-auto">
158-
<CardHeader>
159-
<CardTitle>Stream Deck Icon Builder</CardTitle>
157+
<Card className="min-h-full h-full p-0 gap-0 overflow-hidden">
158+
<CardHeader className="p-3 bg-accent">
159+
<CardTitle>Stream Deck Icon</CardTitle>
160160
</CardHeader>
161-
<CardContent className="space-y-4">
162-
<div>
163-
<label>Text</label>
164-
<Input value={text} onChange={(e) => setText(e.target.value)} />
161+
<CardContent className="space-y-4 overflow-auto py-3 px-3">
162+
<div className="group relative">
163+
<label
164+
htmlFor={"text"}
165+
className="bg-card text-muted-foreground group-focus-within:text-foreground absolute start-1 top-0 z-10 block -translate-y-1/2 px-2 text-xs font-medium group-has-disabled:opacity-50"
166+
>
167+
Text
168+
</label>
169+
<Input
170+
id={"text"}
171+
className="h-10 !bg-card"
172+
placeholder="My button"
173+
value={text}
174+
onChange={(e) => setText(e.target.value)}
175+
/>
165176
</div>
177+
166178
<div>
167179
<label>Icon</label>
168180
<IconPicker
@@ -210,13 +222,13 @@ const Root: React.FC = () => {
210222
/>
211223
</div>
212224
</CardContent>
213-
<div className="mt-auto px-6 flex flex-col gap-3">
225+
<div className="mt-auto px-3 py-3 flex flex-col gap-3 bg-accent rounded-b-md">
214226
<Button className="w-full justify-start" onClick={handleDownload}>
215227
<TablerIcons.IconDownload />
216228
Download Icon
217229
</Button>
218230
<Link to="https://github.com/tommerty/streamdeck-icons">
219-
<Button variant={"secondary"} className="w-full justify-start">
231+
<Button variant={"outline"} className="w-full justify-start">
220232
<TablerIcons.IconBrandGithub />
221233
GitHub
222234
</Button>

app/components/ui/input.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as React from "react"
1+
import * as React from "react";
22

3-
import { cn } from "~/lib/utils"
3+
import { cn } from "~/lib/utils";
44

55
function Input({ className, type, ...props }: React.ComponentProps<"input">) {
66
return (
@@ -9,13 +9,13 @@ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
99
data-slot="input"
1010
className={cn(
1111
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
12-
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
12+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[0px]",
1313
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
1414
className
1515
)}
1616
{...props}
1717
/>
18-
)
18+
);
1919
}
2020

21-
export { Input }
21+
export { Input };

app/routes/home.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Route } from "./+types/home";
22
import { Welcome } from "../welcome/welcome";
3-
import Root from "~/components/section/root";
3+
import Root from "~/components/root";
44

55
export function meta({}: Route.MetaArgs) {
66
return [

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,19 @@
2727
"tailwind-merge": "^3.3.1"
2828
},
2929
"devDependencies": {
30+
"@semantic-release/changelog": "^6.0.3",
31+
"@semantic-release/git": "^10.0.1",
32+
"@semantic-release/github": "^10.1.3",
3033
"@react-router/dev": "^7.5.3",
3134
"@tailwindcss/vite": "^4.1.4",
3235
"@types/node": "^20",
3336
"@types/react": "^19.1.2",
3437
"@types/react-dom": "^19.1.2",
38+
"semantic-release": "^24.0.0",
3539
"tailwindcss": "^4.1.4",
3640
"tw-animate-css": "^1.3.5",
3741
"typescript": "^5.8.3",
3842
"vite": "^6.3.3",
3943
"vite-tsconfig-paths": "^5.1.4"
4044
}
41-
}
45+
}

0 commit comments

Comments
 (0)