Skip to content

Commit

Permalink
fix(merge): conflicts resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjeannesson committed Sep 19, 2023
2 parents 1e9f880 + 67cbada commit e180917
Show file tree
Hide file tree
Showing 80 changed files with 7,675 additions and 716 deletions.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
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"
25 changes: 25 additions & 0 deletions .github/workflows/check_PR_source_branch.yml
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
20 changes: 20 additions & 0 deletions .github/workflows/check_no_changes_workflows.yml
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
33 changes: 33 additions & 0 deletions .github/workflows/check_no_open_pr.yml
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
18 changes: 18 additions & 0 deletions .github/workflows/nextron.yml
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
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
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
21 changes: 21 additions & 0 deletions .releaserc
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}"
}
]
]
}
3 changes: 3 additions & 0 deletions desktop-app/.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
33 changes: 33 additions & 0 deletions desktop-app/.eslintrc.json
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"
}
}
10 changes: 10 additions & 0 deletions desktop-app/.prettierrc
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"
]
}
4 changes: 2 additions & 2 deletions desktop-app/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"cssVariables": true
},
"aliases": {
"components": "renderer/components",
"utils": "renderer/lib/utils"
"components": "@/components",
"utils": "@/lib/utils"
}
}
38 changes: 21 additions & 17 deletions desktop-app/main/background.ts
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()
})
Loading

0 comments on commit e180917

Please sign in to comment.