-
Notifications
You must be signed in to change notification settings - Fork 2
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
80 changed files
with
7,675 additions
and
716 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,14 @@ | ||
version: 2 | ||
updates: | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
target-branch: "dev" | ||
schedule: | ||
interval: "daily" | ||
|
||
- package-ecosystem: "npm" | ||
directory: "/desktop-app/" | ||
target-branch: "dev" | ||
schedule: | ||
interval: "daily" |
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,25 @@ | ||
name: Check Source Branch | ||
|
||
on: | ||
pull_request_target: | ||
|
||
jobs: | ||
check-branches: | ||
name: Check branches | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check branches | ||
env: | ||
HEAD_REF: ${{ github.head_ref }} | ||
BASE_REF: ${{ github.base_ref }} | ||
ENVIRONMENT: ${{ github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }} | ||
run: | | ||
if [[ "$ENVIRONMENT" == "internal" ]] && [[ "$HEAD_REF" != "dev" ]] && [[ "$BASE_REF" == "main" ]]; then | ||
echo "Merge requests to the main branch are only allowed from the dev branch." | ||
exit 1 | ||
fi | ||
if [[ "$ENVIRONMENT" == "external" ]] && [[ "$BASE_REF" != "dev" ]]; then | ||
echo "Merge requests from external repositories are only allowed to the dev branch." | ||
exit 1 | ||
fi |
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,20 @@ | ||
name: Check Workflow Files Changes | ||
|
||
on: | ||
pull_request_target: | ||
paths: | ||
- .github/workflows/* | ||
|
||
jobs: | ||
check-changes: | ||
name: Check changes | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check changes | ||
env: | ||
ENVIRONMENT: ${{ github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }} | ||
run: | | ||
if [[ "$ENVIRONMENT" == "external" ]]; then | ||
echo "Merge requests from external repositories cannot contain changes to workflow files." | ||
exit 1 | ||
fi |
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,33 @@ | ||
name: Cross-PR Checks | ||
on: | ||
pull_request_target: | ||
|
||
jobs: | ||
check_cross_prs: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: List open PRs based on the same branch | ||
id: list_prs | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
BRANCH_NAME=${{ github.head_ref }} | ||
REPO_NAME=${{ github.repository }} | ||
PR_LIST=$(gh pr list --repo $REPO_NAME --head $BRANCH_NAME) | ||
PR_COUNT=$(echo "$PR_LIST" | wc -l) | ||
echo "PR_COUNT=$PR_COUNT" >> $GITHUB_ENV | ||
- name: Fail if there are more than one PRs open | ||
id: fail_multiple_prs | ||
run: | | ||
if [ $PR_COUNT -gt 1 ]; then | ||
echo "There are $PR_COUNT open PRs from the same branch. Please close them before merging this PR." | ||
exit 1 | ||
fi |
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 @@ | ||
name: Nextron CI | ||
|
||
on: | ||
pull_request_target: | ||
|
||
jobs: | ||
authorize: | ||
environment: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: true | ||
|
||
build: | ||
name: Nextron build | ||
needs: authorize | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: true |
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,31 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
|
||
- name: Install semantic-release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.NAPSE_GITHUB_TOKEN }} | ||
run: | | ||
npm install --save-dev semantic-release | ||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.NAPSE_GITHUB_TOKEN }} | ||
run: npx semantic-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,21 @@ | ||
{ | ||
"branches": ["main"], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
[ | ||
"@semantic-release/changelog", | ||
{ | ||
"changelogFile": "CHANGELOG.md" | ||
} | ||
], | ||
"@semantic-release/github", | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": ["package.json", "CHANGELOG.md"], | ||
"message": "chore(release): set 'package.json' version to '${nextRelease.version}' and update 'CHANGELOG.md' [skip ci]\n\n${nextRelease.notes}" | ||
} | ||
] | ||
] | ||
} |
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,3 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
} |
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,33 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true | ||
}, | ||
"extends": [ | ||
"standard-with-typescript", | ||
"plugin:react/recommended" | ||
], | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module", | ||
"project": "./desktop-app/tsconfig.json" | ||
}, | ||
"plugins": [ | ||
"react" | ||
], | ||
"rules": { | ||
"react/react-in-jsx-scope": "off", | ||
"react/jsx-filename-extension": [ | ||
1, | ||
{ | ||
"extensions": [ | ||
".ts", | ||
".tsx" | ||
] | ||
} | ||
], | ||
"@typescript-eslint/space-before-function-paren": "off", | ||
"@typescript-eslint/indent": "off", | ||
"multiline-ternary": "off" | ||
} | ||
} |
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,10 @@ | ||
{ | ||
"trailingComma": "none", | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"singleQuote": true, | ||
"semi": false, | ||
"plugins": [ | ||
"prettier-plugin-tailwindcss" | ||
] | ||
} |
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
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 |
---|---|---|
@@ -1,32 +1,36 @@ | ||
import { app } from 'electron'; | ||
import serve from 'electron-serve'; | ||
import { createWindow } from './helpers'; | ||
import { app } from 'electron' | ||
import serve from 'electron-serve' | ||
import { createWindow } from './helpers' | ||
|
||
const isProd: boolean = process.env.NODE_ENV === 'production'; | ||
const isProd: boolean = process.env.NODE_ENV === 'production' | ||
|
||
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = 'true' | ||
|
||
if (isProd) { | ||
serve({ directory: 'app' }); | ||
serve({ directory: 'app' }) | ||
} else { | ||
app.setPath('userData', `${app.getPath('userData')} (development)`); | ||
app.setPath('userData', `${app.getPath('userData')} (development)`) | ||
} | ||
|
||
(async () => { | ||
await app.whenReady(); | ||
;(async () => { | ||
await app.whenReady() | ||
|
||
const mainWindow = createWindow('main', { | ||
width: 1000, | ||
height: 600, | ||
}); | ||
height: 600 | ||
}) | ||
|
||
if (isProd) { | ||
await mainWindow.loadURL('app://./home.html'); | ||
await mainWindow.loadURL('app://./index.html') | ||
} else { | ||
const port = process.argv[2]; | ||
await mainWindow.loadURL(`http://localhost:${port}/home`); | ||
mainWindow.webContents.openDevTools(); | ||
const port = process.argv[2] | ||
await mainWindow.loadURL(`http://localhost:${port}/`) | ||
mainWindow.webContents.openDevTools() | ||
} | ||
})(); | ||
})() | ||
.then() | ||
.catch(console.error) | ||
|
||
app.on('window-all-closed', () => { | ||
app.quit(); | ||
}); | ||
app.quit() | ||
}) |
Oops, something went wrong.