Skip to content

Commit

Permalink
Migrated to electron-vite, migrated to ECMAScript modules
Browse files Browse the repository at this point in the history
  • Loading branch information
ransome1 committed Jan 14, 2025
1 parent 35aa231 commit 805aff6
Show file tree
Hide file tree
Showing 63 changed files with 3,049 additions and 6,080 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
out
.gitignore
9 changes: 9 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'@electron-toolkit/eslint-config-ts/recommended',
'@electron-toolkit/eslint-config-prettier'
]
}
4 changes: 2 additions & 2 deletions .github/workflows/code-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ jobs:
- name: Set up latest available Nodejs
uses: actions/setup-node@master
- name: Install dependencies
run: npm install
run: yarn install
- name: Build
run: yarn run build
run: yarn build
- name: Run tests
run: yarn run test
- name: Upload coverage reports to Codecov
Expand Down
96 changes: 96 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Prepare releases
on:
push:
tags:
- '*'
jobs:
trigger-flathub_build:
name: Trigger Flathub build bot
runs-on: ubuntu-latest
steps:
- name: Trigger Flathub build
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.TRIGGER_FLATHUB_BUILD }}
repository: ransome1/com.github.ransome1.sleek
event-type: trigger-flathub-build
client-payload: '{"commit_id": "${{ github.sha }}"}'
macos:
name: MacOS (Prepare release)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
steps:
- name: Checkout git repo
uses: actions/checkout@master
- name: Install Node and NPM
uses: actions/setup-node@master
with:
node-version: 23
cache: 'yarn'
- name: Install and build
run: |
yarn --network-timeout 100000
yarn run build
- name: Run Electron Builder
uses: samuelmeuli/action-electron-builder@v1
env:
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASS: ${{ secrets.APPLE_ID_PASS }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
with:
max_attempts: 5
github_token: ${{ secrets.github_token }}
release: ${{ startsWith(github.ref, 'refs/tags/') }}
windows:
name: Windows (Prepare release)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
steps:
- name: Checkout git repo
uses: actions/checkout@master
- name: Install Node and NPM
uses: actions/setup-node@master
with:
node-version: 23
cache: 'yarn'
- name: Install and build
run: |
yarn --network-timeout 100000
yarn run build
- name: Run Electron Builder
uses: samuelmeuli/action-electron-builder@v1
with:
max_attempts: 5
github_token: ${{ secrets.github_token }}
release: ${{ startsWith(github.ref, 'refs/tags/') }}
linux:
name: Linux (Prepare release)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- name: Checkout git repo
uses: actions/checkout@master
- name: Install Node and NPM
uses: actions/setup-node@master
with:
node-version: 23
cache: 'yarn'
- name: Install and build
run: |
yarn --network-timeout 100000
yarn run build
- name: Run Electron Builder
uses: samuelmeuli/action-electron-builder@v1
with:
max_attempts: 5
github_token: ${{ secrets.github_token }}
release: ${{ startsWith(github.ref, 'refs/tags/') }}
116 changes: 0 additions & 116 deletions .github/workflows/release.yml

This file was deleted.

8 changes: 7 additions & 1 deletion .gitignore
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,10 @@ typings/
out/

# Provisionong profiles
*.provisionprofile
*.provisionprofile

dist/

mas/

build/
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
out
dist
pnpm-lock.yaml
LICENSE.md
tsconfig.json
tsconfig.*.json
4 changes: 4 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
singleQuote: true
semi: false
printWidth: 100
trailingComma: none
Binary file removed assets/dmg-background.png
Binary file not shown.
Binary file added assets/dmg/background.tiff
Binary file not shown.
10 changes: 10 additions & 0 deletions assets/entitlements.mac.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
</dict>
</plist>
File renamed without changes
File renamed without changes.
70 changes: 70 additions & 0 deletions electron-builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
directories:
output: dist
buildResources: build
buildVersion: '50'
asar: true
mac:
appId: com.todotxt.sleek
target:
target: default
arch:
- arm64
- x64
fileAssociations:
- ext:
- txt
- md
role: Editor
isPackage: false
rank: Owner
icon: ./assets/icons/icon.icns
type: distribution
hardenedRuntime: true
entitlements: assets/entitlements.mac.plist
entitlementsInherit: assets/entitlements.mac.plist
gatekeeperAssess: false
category: public.app-category.productivity
artifactName: ${productName}-${version}-mac-${arch}.${ext}
darkModeSupport: true
dmg:
background: assets/dmg/background.tiff
contents:
- x: 130
'y': 220
- x: 410
'y': 220
type: link
path: /Applications
masDev:
entitlements: build/entitlements.mas.plist
entitlementsInherit: build/entitlements.mas.inherit.plist
provisioningProfile: assets/development.provisionprofile
mas:
entitlements: build/entitlements.mas.plist
entitlementsInherit: build/entitlements.mas.inherit.plist
provisioningProfile: assets/distribution.provisionprofile
win:
target:
- zip
- portable
- nsis
- appx
icon: assets/icons/sleek.ico
artifactName: ${productName}-${version}-win-${arch}.${ext}
nsis:
artifactName: ${productName}-${version}-win-${arch}-Setup.${ext}
appx:
displayName: sleek - todo.txt manager for Windows, free and open-source (FOSS)
identityName: 17450RobinAhle.sleektodomanager
publisher: CN=2B3D4037-FF2E-4C36-84A6-CFF49F585C0C
publisherDisplayName: ransome1
applicationId: RobinAhle.sleektodomanager
linux:
icon: assets/icons
category: ProjectManagement
target:
- deb
- freebsd
- rpm
- AppImage
electronVersion: 34.0.0
19 changes: 19 additions & 0 deletions electron.vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { resolve } from 'path'
import react from '@vitejs/plugin-react'

export default {
main: {
// vite config options
},
preload: {
// vite config options
},
renderer: {
resolve: {
alias: {
'@renderer': resolve('src/renderer/')
}
},
plugins: [react()]
}
}
Loading

0 comments on commit 805aff6

Please sign in to comment.