Skip to content

Commit 4aecf0f

Browse files
committed
init
0 parents  commit 4aecf0f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+10029
-0
lines changed

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
dist
3+
out
4+
.gitignore
5+
generated-*

.eslintrc.cjs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
commonjs: true,
6+
es6: true,
7+
node: true,
8+
},
9+
parser: '@typescript-eslint/parser',
10+
parserOptions: {
11+
ecmaFeatures: {
12+
jsx: true,
13+
},
14+
sourceType: 'module',
15+
ecmaVersion: 2021,
16+
},
17+
extends: [
18+
'eslint:recommended',
19+
'plugin:react/recommended',
20+
'plugin:react/jsx-runtime',
21+
'plugin:@typescript-eslint/recommended',
22+
'plugin:@typescript-eslint/eslint-recommended',
23+
'plugin:prettier/recommended',
24+
],
25+
rules: {
26+
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }],
27+
'@typescript-eslint/explicit-module-boundary-types': 'off',
28+
'@typescript-eslint/no-empty-function': 'off',
29+
'@typescript-eslint/no-explicit-any': 'off',
30+
'@typescript-eslint/no-non-null-assertion': 'off',
31+
'@typescript-eslint/no-var-requires': 'off',
32+
'prefer-const': 'off',
33+
'no-async-promise-executor': 'off',
34+
},
35+
overrides: [
36+
{
37+
files: ['*.js'],
38+
rules: {
39+
'@typescript-eslint/explicit-function-return-type': 'off',
40+
},
41+
},
42+
],
43+
}

.github/release-drafter-config.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name-template: 'v$RESOLVED_VERSION 🌈'
2+
3+
tag-template: 'v$RESOLVED_VERSION'
4+
5+
categories:
6+
- title: '🚀 새로운 기능'
7+
labels:
8+
- 'enhancement'
9+
- 'feature'
10+
- title: '🐛 버그 수정'
11+
labels: 'bug'
12+
- title: '🧰 유지 보수'
13+
label: 'chore'
14+
15+
version-resolver:
16+
major:
17+
labels:
18+
- 'major'
19+
minor:
20+
labels:
21+
- 'minor'
22+
patch:
23+
labels:
24+
- 'patch'
25+
default: patch
26+
27+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
28+
change-title-escapes: '\<*_&'
29+
30+
template: |
31+
$CHANGES

.github/workflows/release.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: App build & release drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- '**/README.md'
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
release_draft:
15+
permissions:
16+
contents: write
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Release drafter
20+
uses: release-drafter/release-drafter@v5
21+
with:
22+
config-name: release-drafter-config.yml
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Sleep 5 seconds # release-drafter가 release를 생성하기 전에 아래 단계를 실행하는 문제를 해결하기 위해 sleep
27+
run: sleep 5
28+
29+
- name: Get latest release
30+
id: get_latest_release
31+
uses: pozetroninc/github-action-get-latest-release@master
32+
with:
33+
repository: ${{ github.repository }}
34+
token: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Checkout
37+
uses: actions/checkout@v3
38+
with:
39+
fetch-depth: 0
40+
41+
- name: Update package.json version
42+
run: |
43+
version=${{ steps.get_latest_release.outputs.release }}
44+
version=${version#v}
45+
echo "Latest release: $version"
46+
git config --global user.name "github-actions[bot]"
47+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
48+
yarn version --new-version $version --no-git-tag-version
49+
if ! git diff --exit-code; then
50+
git add package.json
51+
git commit -m "Update package.json version"
52+
git checkout dev
53+
git merge main
54+
git push --all
55+
fi
56+
57+
build_release:
58+
runs-on: windows-latest
59+
needs: release_draft
60+
steps:
61+
- name: Checkout
62+
uses: actions/checkout@v3
63+
with:
64+
ref: main # ref를 main 설정하지 않으면 workflow가 트리거된 ref가 사용됨 (`Update package.json version` 단계의 커밋 반영을 위해 main으로 설정)
65+
66+
- name: Setup Node.js
67+
uses: actions/setup-node@v3
68+
with:
69+
node-version: 18
70+
cache: 'yarn'
71+
72+
- name: Generate environment variables file
73+
run: |
74+
echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> .env
75+
echo "MAIN_VITE_SENTRY_DSN=${{ vars.MAIN_VITE_SENTRY_DSN }}" >> .env
76+
echo "RENDERER_VITE_SENTRY_DSN=${{ vars.RENDERER_VITE_SENTRY_DSN }}" >> .env
77+
78+
- name: Install dependencies
79+
run: yarn
80+
81+
- name: Build
82+
run: yarn build
83+
env:
84+
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }} # electron-builder은 자동 인증 토큰을 지원하지 않음

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
target
2+
index.node
3+
**/node_modules
4+
**/.DS_Store
5+
yarn-debug.log*
6+
yarn-error.log*
7+
/resources/windows/chromium
8+
chrome_data
9+
out
10+
release
11+
.env

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node-linker=hoisted
2+
public-hoist-pattern=*
3+
shamefully-hoist=true

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
out
2+
tsconfig.json
3+
tsconfig.*.json

.prettierrc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"arrowParens": "avoid",
3+
"endOfLine": "auto",
4+
"singleQuote": true,
5+
"trailingComma": "all",
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"printWidth": 100,
9+
"semi": false,
10+
"importOrder": [
11+
"^reflect",
12+
"^electron",
13+
"^react",
14+
"<THIRD_PARTY_MODULES>",
15+
"^@main",
16+
"^@renderer",
17+
"^~.+$",
18+
"^\\..+$"
19+
],
20+
"importOrderSeparation": true,
21+
"importOrderParserPlugins": ["typescript", "decorators", "jsx"]
22+
}

.vscode/settings.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"editor.tabSize": 2,
3+
"editor.formatOnSave": true,
4+
"editor.defaultFormatter": "esbenp.prettier-vscode",
5+
"typescript.preferences.importModuleSpecifier": "non-relative",
6+
"typescript.tsdk": "node_modules\\typescript\\lib",
7+
"json.schemas": [
8+
{
9+
"fileMatch": [
10+
"/*electron-builder.json"
11+
],
12+
"url": "https://json.schemastore.org/electron-builder"
13+
}
14+
],
15+
"editor.wordBasedSuggestions": "matchingDocuments"
16+
}

.vscode/typescript.code-snippets

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"Styled Components Export": {
3+
"prefix": ["sc"],
4+
"body": [
5+
"import styled from 'styled-components';",
6+
"\n",
7+
"export const ${TM_DIRECTORY/^.+\\/(.*)$/$1/}Styled = styled.div`",
8+
" $0",
9+
"`"
10+
],
11+
"description": "Styled Components 내보내기"
12+
},
13+
"Styled Components Props Theme": {
14+
"prefix": ["pro"],
15+
"body": ["${props => props.theme${0}}"],
16+
"description": "Styled Components Props 자동완성"
17+
},
18+
"Component styled": {
19+
"prefix": ["cs"],
20+
"body": [
21+
"import clsx from 'clsx';\n",
22+
"import { ${TM_DIRECTORY/^.+\\/(.*)$/$1/}Styled } from './styled';\n",
23+
"interface ${TM_DIRECTORY/^.+\\/(.*)$/$1/}Props {",
24+
" className?: string;",
25+
"}\n",
26+
"const ${TM_DIRECTORY/^.+\\/(.*)$/$1/} = ({ className }: ${TM_DIRECTORY/^.+\\/(.*)$/$1/}Props) => {",
27+
" return (",
28+
" <${TM_DIRECTORY/^.+\\/(.*)$/$1/}Styled className={clsx('${TM_DIRECTORY/^.+\\/(.*)$/$1/}', className)}>",
29+
" $0",
30+
" </${TM_DIRECTORY/^.+\\/(.*)$/$1/}Styled>",
31+
" )",
32+
"}\n",
33+
"export default ${TM_DIRECTORY/^.+\\/(.*)$/$1/}"
34+
],
35+
"description": "컴포넌트 생성 & Styled Components 사용"
36+
}
37+
}

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# electron + react + nestjs + vite template
2+
3+
<br/>
4+
5+
## i18n support
6+
7+
The default language is set by detecting which language you use, and you can also change it directly on the Settings page.
8+
9+
<br/>
10+
11+
## Features
12+
13+
<br/>
14+
15+
## Architecture
16+
17+
> [Figma link](https://www.figma.com/file/qJrFt4YVAZX5UdbeKLx6xA/LADA?type=whiteboard&t=oozV2tgJvZuRd6S4-1)
18+
19+
![image](https://github.com/2skydev/LADA/assets/43225384/a4de6e74-4788-424c-a3f0-a329c853789a)
20+
21+
## Github workflow
22+
23+
> [Figma link](https://www.figma.com/file/qJrFt4YVAZX5UdbeKLx6xA/LADA?type=whiteboard&t=oozV2tgJvZuRd6S4-1)
24+
25+
![image](https://github.com/2skydev/LADA/assets/43225384/69dc01b1-0fab-4305-9e69-6821555119fe)
26+
27+
<br/>
28+
29+
## Start develop
30+
31+
#### dev mode
32+
33+
```bash
34+
pnpm dev
35+
```
36+
37+
#### vite & electron build
38+
39+
```bash
40+
pnpm build
41+
```
42+
43+
<br/>
44+
45+
## Overview framework & library
46+
47+
- App framework: [`electron`](https://www.electronjs.org/)
48+
- App build tool: [`electron-builder`](https://www.electron.build/)
49+
- App storage: [`electron-store`](https://github.com/sindresorhus/electron-store)
50+
- App auto updater: [`electron-updater`](https://www.electron.build/auto-update)
51+
- Bundle tool: [`vite`](https://vitejs.dev/) + [`electron-vite`](https://electron-vite.org/)
52+
- Main process framework: [`nestjs`](https://nestjs.com/)
53+
- Renderer process framework: [`react`](https://react.dev/) + [`typescript`](https://www.typescriptlang.org/)
54+
- Code style: `eslint` + `prettier` + [`@trivago/prettier-plugin-sort-imports`](https://github.com/trivago/prettier-plugin-sort-imports)
55+
- File system based router: [`react-router-dom v6`](https://reactrouter.com/docs/en/v6) + custom (src/components/FileSystemRoutes)
56+
- i18n: [`i18next`](https://www.i18next.com/) + [`react-i18next`](https://react.i18next.com/)

electron-builder.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"appId": "com.2skydev.example",
3+
"productName": "electron-nestjs-react-vite-template",
4+
"protocols": {
5+
"name": "example",
6+
"schemes": [
7+
"example"
8+
]
9+
},
10+
"publish": [
11+
{
12+
"provider": "github",
13+
"owner": "2skydev",
14+
"repo": "example"
15+
}
16+
],
17+
"asar": true,
18+
"win": {
19+
"target": "nsis",
20+
"icon": "resources/icons/logo@256.ico"
21+
},
22+
"mac": {
23+
"target": "dmg",
24+
"icon": "resources/icons/logo@512.png"
25+
},
26+
"nsis": {
27+
"oneClick": true,
28+
"artifactName": "${productName}-${version}.${ext}",
29+
"uninstallDisplayName": "${productName}"
30+
},
31+
"extraResources": [
32+
"./resources/**"
33+
],
34+
"directories": {
35+
"output": "release/"
36+
},
37+
"files": [
38+
"out/**/*"
39+
]
40+
}

0 commit comments

Comments
 (0)