Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remote displays app and PR CI #114

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
{
"singleQuote": true,
"parser": "typescript",
"printWidth": 120
"printWidth": 120,
"endOfLine": "auto"
}
],

Expand Down
33 changes: 17 additions & 16 deletions .github/workflows/pr-title.yml → .github/workflows/pr-target.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
name: PR
on:
pull_request_target:
types:
- opened
- synchronize
- reopened
- ready_for_review

jobs:
title:
runs-on: ubuntu-latest
steps:
- uses: amannn/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: PR
on:
pull_request_target:
types:
- opened
- synchronize
- reopened
- ready_for_review

jobs:
title:
name: Validate title semantics
runs-on: ubuntu-latest
steps:
- uses: amannn/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61 changes: 61 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: PR
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review

jobs:
lint:
name: Lint
runs-on: windows-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: set Node version
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: |
npm install
cd apps/remote/
npm install
- name: npm run lint
run: |
npm run lint
build:
name: Build and upload SimBridge
runs-on: windows-latest
env:
RELEASE_ZIP_NAME: fbw-simbridge.zip
BUILD_DIR_NAME: pr
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: set Node version
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: |
npm install
cd apps/remote/
npm install
- name: Build SimBridge
run: |
npm run typecheck
npm run build:exec
- name: Build ZIP File
run: |
node .\scripts\fragment.js
mkdir .\${{env.BUILD_DIR_NAME}}
Compress-Archive -Path .\build\* .\${{env.BUILD_DIR_NAME }}\${{ env.RELEASE_ZIP_NAME }}
- name: Upload PR artifact
uses: actions/upload-artifact@v4
if: github.event.pull_request.auto_merge == false
with:
name: flybywire-external-simbridge
path: .\${{env.BUILD_DIR_NAME }}\${{ env.RELEASE_ZIP_NAME }}
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- name: Build Local API
run: |
npm install
npm run typecheck
npm run build:exec
- name: Build ZIP File
run: |
Expand Down
28 changes: 28 additions & 0 deletions apps/remote/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'../../.eslintrc',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
// Since we are shimming MSFS APIs that truly take `any` as a type, we need it
'@typescript-eslint/no-explicit-any': 'off',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
// Configure prettier
"prettier/prettier": [
"error",
{
"singleQuote": true,
"parser": "typescript",
"printWidth": 120
}
]
}
}
28 changes: 28 additions & 0 deletions apps/remote/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local
vite.config.ts.js

# Fonts should be pulled locally
./public/Fonts/fbw-a32nx/*

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
30 changes: 30 additions & 0 deletions apps/remote/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
}
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
13 changes: 13 additions & 0 deletions apps/remote/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/ico" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>FBW Remote</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading
Loading