Skip to content

Commit d485372

Browse files
committed
refactoring
1 parent b9349e0 commit d485372

32 files changed

Lines changed: 745 additions & 550 deletions

.env.example

Lines changed: 0 additions & 10 deletions
This file was deleted.

.envrc.example

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# ModSwitchIME Environment Configuration
2+
# Copy this file to .envrc and customize with your values
3+
4+
# Development Team (from Apple Developer account)
5+
# Find your team ID via: security find-identity -v -p codesigning
6+
export DEVELOPMENT_TEAM="YOUR_TEAM_ID"
7+
8+
# Bundle Identifiers
9+
export PRODUCT_BUNDLE_IDENTIFIER="com.example.ModSwitchIME"
10+
export TEST_BUNDLE_IDENTIFIER="com.example.ModSwitchIMETests"
11+
12+
# Code Signing
13+
export CODE_SIGN_IDENTITY="Apple Development"
14+
export INSTALLER_IDENTITY="Developer ID Installer"
15+
16+
# Project Info
17+
export PROJECT_NAME="ModSwitchIME"
18+
export COPYRIGHT_HOLDER="Your Name"
19+
export COPYRIGHT_YEAR="2024"
20+
export AUTHOR_NAME="ModSwitchIME Team"
21+
export GITHUB_URL="https://github.com/YourOrg/ModSwitchIME"
22+
23+
# Build Configuration
24+
export XCODE_VERSION="15.4"
25+
export MACOS_DEPLOYMENT_TARGET="15.0"
26+
27+
# Version (usually from git tags)
28+
export VERSION="1.0.0"
29+
export BUILD_NUMBER="1"
30+
31+
# Optional: Set specific Xcode version
32+
# export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"
33+
34+
# Optional: Set custom build directory
35+
# export BUILD_DIR="./build"

.github/workflows/ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
run: xcodebuild -version
3939

4040
- name: Show available destinations
41-
run: xcodebuild -project iemsw.xcodeproj -scheme iemsw -showdestinations
41+
run: xcodebuild -project ModSwitchIME.xcodeproj -scheme ModSwitchIME -showdestinations
4242

4343
- name: Build
4444
run: make build
@@ -78,8 +78,8 @@ jobs:
7878
- name: Upload build artifacts
7979
uses: actions/upload-artifact@v4
8080
with:
81-
name: iemsw-archive
82-
path: build/iemsw.xcarchive
81+
name: ModSwitchIME-archive
82+
path: build/ModSwitchIME.xcarchive
8383
retention-days: 30
8484

8585
swift-package-manager:
@@ -127,21 +127,21 @@ jobs:
127127
- name: Validate project structure
128128
run: |
129129
echo "Checking required files..."
130-
test -f iemsw.xcodeproj/project.pbxproj || (echo "❌ Xcode project file missing" && exit 1)
130+
test -f ModSwitchIME.xcodeproj/project.pbxproj || (echo "❌ Xcode project file missing" && exit 1)
131131
test -f Package.swift || (echo "❌ Package.swift missing" && exit 1)
132132
test -f Makefile || (echo "❌ Makefile missing" && exit 1)
133133
test -f .swiftlint.yml || (echo "❌ SwiftLint config missing" && exit 1)
134134
135135
echo "Checking source files..."
136-
test -f iemsw/App.swift || (echo "❌ App.swift missing" && exit 1)
137-
test -f iemsw/MenuBarApp.swift || (echo "❌ MenuBarApp.swift missing" && exit 1)
138-
test -f iemsw/Preferences.swift || (echo "❌ Preferences.swift missing" && exit 1)
139-
test -f iemsw/ImeController.swift || (echo "❌ ImeController.swift missing" && exit 1)
140-
test -f iemsw/CustomIME.swift || (echo "❌ CustomIME.swift missing" && exit 1)
136+
test -f ModSwitchIME/App.swift || (echo "❌ App.swift missing" && exit 1)
137+
test -f ModSwitchIME/MenuBarApp.swift || (echo "❌ MenuBarApp.swift missing" && exit 1)
138+
test -f ModSwitchIME/Preferences.swift || (echo "❌ Preferences.swift missing" && exit 1)
139+
test -f ModSwitchIME/ImeController.swift || (echo "❌ ImeController.swift missing" && exit 1)
140+
test -f ModSwitchIME/KeyMonitor.swift || (echo "❌ KeyMonitor.swift missing" && exit 1)
141141
142142
echo "Checking test files..."
143-
test -f iemswTests/ImeControllerTests.swift || (echo "❌ ImeControllerTests.swift missing" && exit 1)
144-
test -f iemswTests/PreferencesTests.swift || (echo "❌ PreferencesTests.swift missing" && exit 1)
143+
test -f ModSwitchIMETests/ImeControllerTests.swift || (echo "❌ ImeControllerTests.swift missing" && exit 1)
144+
test -f ModSwitchIMETests/PreferencesLogicTests.swift || (echo "❌ PreferencesLogicTests.swift missing" && exit 1)
145145
146146
echo "✅ All required files found"
147147

.github/workflows/release.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ jobs:
7070
- name: Generate checksums
7171
run: |
7272
cd build
73-
shasum -a 256 iemsw.dmg > iemsw.dmg.sha256
74-
cat iemsw.dmg.sha256
73+
shasum -a 256 ModSwitchIME.dmg > ModSwitchIME.dmg.sha256
74+
cat ModSwitchIME.dmg.sha256
7575
7676
- name: Generate release notes
7777
id: release_notes
@@ -97,17 +97,17 @@ jobs:
9797
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9898
with:
9999
tag_name: ${{ github.ref }}
100-
release_name: iemsw v${{ steps.get_version.outputs.VERSION }}
100+
release_name: ModSwitchIME v${{ steps.get_version.outputs.VERSION }}
101101
body: |
102-
## iemsw v${{ steps.get_version.outputs.VERSION }}
102+
## ModSwitchIME v${{ steps.get_version.outputs.VERSION }}
103103
104104
A macOS menu bar helper that switches between English input and native IME by pressing left/right ⌘ keys individually.
105105
106106
### Installation
107107
108-
1. Download `iemsw.dmg` from the assets below
109-
2. Open the DMG file and drag iemsw.app to your Applications folder
110-
3. Launch iemsw and grant accessibility permissions when prompted
108+
1. Download `ModSwitchIME.dmg` from the assets below
109+
2. Open the DMG file and drag ModSwitchIME.app to your Applications folder
110+
3. Launch ModSwitchIME and grant accessibility permissions when prompted
111111
4. The app will appear in your menu bar
112112
113113
### Features
@@ -129,7 +129,7 @@ jobs:
129129
130130
### Verification
131131
132-
SHA256 checksum: See `iemsw.dmg.sha256` file in assets.
132+
SHA256 checksum: See `ModSwitchIME.dmg.sha256` file in assets.
133133
draft: false
134134
prerelease: false
135135

@@ -139,8 +139,8 @@ jobs:
139139
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
140140
with:
141141
upload_url: ${{ steps.create_release.outputs.upload_url }}
142-
asset_path: ./build/iemsw.dmg
143-
asset_name: iemsw.dmg
142+
asset_path: ./build/ModSwitchIME.dmg
143+
asset_name: ModSwitchIME.dmg
144144
asset_content_type: application/octet-stream
145145

146146
- name: Upload checksum
@@ -149,8 +149,8 @@ jobs:
149149
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
150150
with:
151151
upload_url: ${{ steps.create_release.outputs.upload_url }}
152-
asset_path: ./build/iemsw.dmg.sha256
153-
asset_name: iemsw.dmg.sha256
152+
asset_path: ./build/ModSwitchIME.dmg.sha256
153+
asset_name: ModSwitchIME.dmg.sha256
154154
asset_content_type: text/plain
155155

156156
- name: Cleanup keychain
@@ -172,29 +172,29 @@ jobs:
172172
id: get_info
173173
run: |
174174
VERSION=${GITHUB_REF#refs/tags/v}
175-
DOWNLOAD_URL="https://github.com/${{ github.repository }}/releases/download/v${VERSION}/iemsw.dmg"
175+
DOWNLOAD_URL="https://github.com/${{ github.repository }}/releases/download/v${VERSION}/ModSwitchIME.dmg"
176176
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
177177
echo "DOWNLOAD_URL=$DOWNLOAD_URL" >> $GITHUB_OUTPUT
178178
179179
- name: Download and get SHA256
180180
run: |
181-
curl -L "${{ steps.get_info.outputs.DOWNLOAD_URL }}" -o iemsw.dmg
182-
SHA256=$(shasum -a 256 iemsw.dmg | cut -d' ' -f1)
181+
curl -L "${{ steps.get_info.outputs.DOWNLOAD_URL }}" -o ModSwitchIME.dmg
182+
SHA256=$(shasum -a 256 ModSwitchIME.dmg | cut -d' ' -f1)
183183
echo "SHA256=$SHA256" >> $GITHUB_ENV
184184
185185
- name: Create Homebrew Cask PR
186186
uses: peter-evans/create-pull-request@v5
187187
with:
188188
token: ${{ secrets.HOMEBREW_GITHUB_TOKEN }}
189189
push-to-fork: ${{ github.repository_owner }}/homebrew-cask
190-
branch: update-iemsw-${{ steps.get_info.outputs.VERSION }}
191-
title: 'iemsw: update to ${{ steps.get_info.outputs.VERSION }}'
190+
branch: update-modswitchime-${{ steps.get_info.outputs.VERSION }}
191+
title: 'ModSwitchIME: update to ${{ steps.get_info.outputs.VERSION }}'
192192
body: |
193-
Update iemsw to version ${{ steps.get_info.outputs.VERSION }}
193+
Update ModSwitchIME to version ${{ steps.get_info.outputs.VERSION }}
194194
195195
- Version: ${{ steps.get_info.outputs.VERSION }}
196196
- Download URL: ${{ steps.get_info.outputs.DOWNLOAD_URL }}
197197
- SHA256: ${{ env.SHA256 }}
198198
199199
Generated automatically by GitHub Actions.
200-
commit-message: 'iemsw: update to ${{ steps.get_info.outputs.VERSION }}'
200+
commit-message: 'ModSwitchIME: update to ${{ steps.get_info.outputs.VERSION }}'

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ dist/
111111
.env.*.local
112112
.envrc
113113

114+
# Generated files
115+
ModSwitchIME/Info.plist
116+
ExportOptions.plist
117+
114118
# IDE files
115119
.vscode/
116120
.idea/
@@ -244,4 +248,7 @@ create_*.sh
244248

245249
# Xcode workspace state
246250
*.xcuserstate
247-
UserInterfaceState.xcuserstate
251+
UserInterfaceState.xcuserstate
252+
253+
# claude
254+
.claude/

.swiftlint.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
# SwiftLint Configuration for iemsw
1+
# SwiftLint Configuration for ModSwitchIME
22

33
# Included and excluded paths
44
included:
5-
- iemsw
6-
- iemswTests
7-
- iemswUITests
5+
- ModSwitchIME
6+
- ModSwitchIMETests
87

98
excluded:
109
- build
1110
- DerivedData
1211
- .build
1312
- Package.swift
14-
- iemsw.xcodeproj
15-
- iemsw/Assets.xcassets
16-
- iemsw/Preview Content
13+
- ModSwitchIME.xcodeproj
14+
- ModSwitchIME/Assets.xcassets
15+
- ModSwitchIME/Preview Content
1716

1817
# Rules configuration
1918
disabled_rules:

ExportOptions.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
<key>thinning</key>
2222
<string>&lt;none&gt;</string>
2323
</dict>
24-
</plist>
24+
</plist>

0 commit comments

Comments
 (0)