forked from yorkie-team/codepair
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
8,342 additions
and
8,224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: electron-build | ||
on: push | ||
jobs: | ||
release: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
node-version: [18.x] | ||
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Node.js, NPM and Yarn | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "pnpm" | ||
|
||
- name: Build/release Electron app | ||
uses: samuelmeuli/action-electron-builder@v1 | ||
with: | ||
package_root: native | ||
build_script_name: build:app | ||
# GitHub token, automatically provided to the action | ||
# (No need to define this secret in the repo settings) | ||
github_token: ${{ secrets.github_token }} | ||
|
||
# If the commit is tagged with a version (e.g. "v1.0.0"), | ||
# release the app after building | ||
release: ${{ startsWith(github.ref, 'refs/tags/v') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,7 @@ dist-ssr/ | |
# Tests | ||
coverage/ | ||
.nyc_output/ | ||
|
||
# native | ||
native/frontend | ||
native/release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"name": "@codepair/native", | ||
"version": "1.0.0", | ||
"main": "dist/main.js", | ||
"description": "Codepair Native", | ||
"author": "yorkie-team", | ||
"license": "Apache-2.0", | ||
"scripts": { | ||
"build": "tsc src/main.ts --outDir dist", | ||
"start": "pnpm run build && cross-env NODE_ENV=production pnpx electron dist/main.js", | ||
"start:dev": "pnpm run start:codepair:dev && pnpm run build && cross-env NODE_ENV=development bunx electron dist/main.js", | ||
"start:codepair:dev": "cd ../frontend && bun run dev & ", | ||
"build:app": "pnpm run build && electron-builder" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^22.7.6", | ||
"cross-env": "^7.0.3", | ||
"electron": "^33.0.1", | ||
"electron-builder": "^25.1.8", | ||
"typescript": "^5.3.3" | ||
}, | ||
"build": { | ||
"appId": "com.example.codepair", | ||
"productName": "codepair", | ||
"files": [ | ||
"dist/**/*", | ||
"node_modules/**/*", | ||
"package.json" | ||
], | ||
"directories": { | ||
"output": "release" | ||
}, | ||
"mac": { | ||
"target": "dmg" | ||
}, | ||
"win": { | ||
"target": "nsis" | ||
}, | ||
"linux": { | ||
"target": "AppImage" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { app, BrowserWindow } from "electron"; | ||
|
||
function createWindow() { | ||
const win = new BrowserWindow({ | ||
width: 800, | ||
height: 600, | ||
webPreferences: { | ||
nodeIntegration: true, | ||
}, | ||
}); | ||
if (process.env.NODE_ENV === "development") { | ||
win.loadURL("http://localhost:5173"); | ||
} else { | ||
win.loadURL("https://codepair.yorkie.dev"); | ||
} | ||
} | ||
|
||
app.whenReady().then(createWindow); | ||
|
||
app.on("window-all-closed", () => { | ||
if (process.platform !== "darwin") { | ||
app.quit(); | ||
} | ||
}); | ||
|
||
app.on("activate", () => { | ||
if (BrowserWindow.getAllWindows().length === 0) { | ||
createWindow(); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2020", | ||
"module": "ESNext", | ||
"outDir": "dist", | ||
"esModuleInterop": true, | ||
"skipLibCheck": true, | ||
"lib": ["ES2020", "DOM", "DOM.Iterable"], | ||
|
||
/* Bundler mode */ | ||
"moduleResolution": "bundler", | ||
|
||
/* Linting */ | ||
"strict": true | ||
}, | ||
"include": ["src"], | ||
"exclude": ["dist"] | ||
} |
Oops, something went wrong.