Skip to content

Commit 29ffffb

Browse files
professoralex13SkySailspepperoni505
authored
feat: Javascript interface and implementation of API based upon RFC 001 (#2)
* chore: ignore DS_Store files * build: create base navdata-sdk module * build: fix build with navdata-sdk * build: include navdata-sdk in tsconfig * refactor: add msfstypes to ts library * wip(feat/restructure): centralized function call, raw sql query heavy wip * refactor: clean up queue processing * refactor: move lint and lint to root * refactor: centralize communications between wasm and js, and cleanups also improves performance for deleting existing downloaded package * refactor: apply clippy changes * refactor: rename Request to Task to not confuse with network requests * refactor: download status update flow * refactor: move phase matching logic * refactor: add typescript interface typings * refactor: use string values for NavigraphFunction enum * refactor: use serde for all commbus related things makes code cleaner and less prone to error * docs: add note about the navdata interface construction * refactor: switch instead of if chain * chore: add temp. CommBus types, use types lib * refactor: avoid array with `any` callbacks * refactor: strongly type `callWasmFunction` name param Using string parameter instead of enum to increase discoverability * chore: use lowercase for type declaration file * refactor: improve error handling * refactor: move msfstypes to base package * feat: add get airport function * fix: use string literal instead of enum * chore: format * feat: unit tests and project refactor (#1) * start node running of interface * refactors * fix: update `memoryBuffer` after `malloc` * refactor: add `test_out` directory, fix our path type implementation * refactor: project structure * feat: jest test environment * fix: stop lifecycle once tests completed * feat: automatic download * remove unnecessary package * refactor: Cleanup setup.ts * fix: make sh files executable * fix: have build run with docker * feat: test workflow * fix: make test.sh executable * Update test.sh * test * Update setup.ts * Create push.yml * Update push.yml * general fixes * fix: workspace issues --------- Co-authored-by: Jack Lavigne <[email protected]> * fix: use params and support number fields in raw sql query * start new API * feat: get airports in range * feat: Airways by ident * feat: Airways by range * formatting * feat: Departures query * fix: sim issues * refactor: Move database out of wasm module * refactor: switch to fully snake_case and other spec compliance * feat: arrivals * refactor: procedure mapping * feat: get_database_info * refactor: remove uneccesary serde renames * feat: Approaches * fix: fix airport_ident * pad out tests * feat: Waypoint and VhfNavaid queries * refactor: Generic range query generator * feat: get runways at airport * feat: Waypoint/VhfNavaid range queries * feat: ndb navaids * feat: navaid and waypoint airport queries * feat: get airways at fix * feat: comments * feat: Airspace range queries * fix: missing Database Info type * fix: approach * feat: gates * feat: communications * feat: Gls navaids * feat: pathpoints * improved documentation * Update README.md * Update README.md * Update NavigraphLogin.tsx * fix: js interface return types * general fixes * refactor workflow env * Revert "refactor workflow env" This reverts commit dafb9ef. * refactors and comments in js * feat: click on qr code to login * test verbose * test * test * Update pr.yml * ci: run tests without docker * ci: run jest directly * ci: update actions, bump node version * ci: disable cone mode for sparse-checkout * ci: exclude blobs instead of sparse * ci: skip installing packages in docker This should cause the tests to fail right? I guess the reason it works locally is because it uses the dependencies installed by us on the windows-side... * ci: run correct test script * ci: temporarily skip WASM builds * ci: explicit node version, install deps * ci: install deps inside docker * ci: make sure both commands run inside docker * ci: revert to incorrect (but working) script This configuration seems to result in successful test runs for some reason ¯\_(ツ)_/¯ * ci: reintroduce WASM build step * ci: move test run to separate line for clarity * Delete DOCS.md --------- Co-authored-by: Malte Hallström <[email protected]> Co-authored-by: Jack Lavigne <[email protected]>
1 parent a2b04fc commit 29ffffb

File tree

122 files changed

+14397
-6853
lines changed

Some content is hidden

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

122 files changed

+14397
-6853
lines changed
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
[target.wasm32-wasi]
2-
rustflags = [
3-
"-Clink-arg=--export-table",
4-
"-Clink-arg=--export=malloc",
5-
"-Clink-arg=--export=free",
6-
"-Clink-arg=-L/usr/lib/llvm-15/lib/clang/15.0.7/lib/wasi",
7-
"-Clink-arg=-lclang_rt.builtins-wasm32"
8-
]
9-
10-
[build]
1+
[target.wasm32-wasi]
2+
rustflags = [
3+
"-Clink-arg=--export-table",
4+
"-Clink-arg=--export=malloc",
5+
"-Clink-arg=--export=free",
6+
"-Clink-arg=-L/usr/lib/llvm-15/lib/clang/15.0.7/lib/wasi",
7+
"-Clink-arg=-lclang_rt.builtins-wasm32"
8+
]
9+
10+
[build]
1111
target = "wasm32-wasi"

examples/gauge/.eslintrc.js renamed to .eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
root: true,
3-
ignorePatterns: [".eslintrc.js"],
3+
ignorePatterns: [".eslintrc.js", "src/wasm/", "msfstypes/"],
44
env: { browser: true, commonjs: true, es6: true },
55
plugins: ["@typescript-eslint"],
66
extends: [

.github/workflows/pr.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,23 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@v2
15-
- name: Build WASM module
14+
uses: actions/checkout@v4
15+
with:
16+
filter: blob:none
17+
18+
- name: Create env file
1619
run: |
17-
./src/wasm_navdata_interface/scripts/run_docker_cmd.sh ./scripts/build.sh
20+
touch .env
21+
echo NAVDATA_SIGNED_URL=${{ secrets.NAVDATA_SIGNED_URL }} >> .env
22+
23+
- name: Build WASM module
24+
run: npm run build:wasm-workflow
25+
26+
- name: Test
27+
run: npm run test-workflow
28+
1829
- name: Upload WASM module to GitHub
19-
uses: actions/upload-artifact@v2
30+
uses: actions/upload-artifact@v4
2031
with:
21-
name: navdata_interface.wasm
22-
path: ./src/wasm_navdata_interface/out/navdata_interface.wasm
32+
name: msfs_navdata_interface.wasm
33+
path: ./out/msfs_navdata_interface.wasm

.github/workflows/pre-release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ jobs:
1212
- name: Checkout
1313
uses: actions/checkout@v2
1414
- name: Build WASM module
15-
run: |
16-
./src/wasm_navdata_interface/scripts/run_docker_cmd.sh ./scripts/build.sh
15+
run: npm run build:wasm-workflow
1716
- name: Pre-Release
1817
uses: softprops/action-gh-release@v1
1918
with:
20-
files: ./src/wasm_navdata_interface/out/navdata_interface.wasm
19+
files: ./out/msfs_navdata_interface.wasm
2120
prerelease: true

.github/workflows/push.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
- name: create env file
13+
run: |
14+
touch .env
15+
echo NAVDATA_SIGNED_URL=${{ secrets.NAVDATA_SIGNED_URL }} >> .env
16+
- name: Build WASM module
17+
run: npm run build:wasm-workflow
18+
- name: Test
19+
run: npm run test-workflow
20+
- name: Upload WASM module to GitHub
21+
uses: actions/upload-artifact@v2
22+
with:
23+
name: msfs_navdata_interface.wasm
24+
path: ./out/msfs_navdata_interface.wasm

.github/workflows/release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ jobs:
1313
- name: Checkout
1414
uses: actions/checkout@v2
1515
- name: Build WASM module
16-
run: |
17-
./src/wasm_navdata_interface/scripts/run_docker_cmd.sh ./scripts/build.sh
16+
run: npm run build:wasm-workflow
1817
- name: Release
1918
uses: softprops/action-gh-release@v1
2019
with:
21-
files: ./src/wasm_navdata_interface/out/navdata_interface.wasm
20+
files: ./out/msfs_navdata_interface.wasm

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ _PackageInt
55
tsconfig.tsbuildinfo
66
.vs
77
examples/aircraft/PackageSources/html_ui/Pages/VCockpit/Instruments/Navigraph/NavdataInterfaceSample
8-
examples/aircraft/PackageSources/SimObjects/Airplanes/Navigraph_Navdata_Interface_Aircraft/panel/navdata_interface.wasm
9-
src/wasm_navdata_interface/out
8+
examples/aircraft/PackageSources/SimObjects/Airplanes/Navigraph_Navdata_Interface_Aircraft/panel/msfs_navdata_interface.wasm
9+
out
1010

1111
# Rust
1212
# will have compiled files and executables
@@ -26,3 +26,6 @@ Cargo.lock
2626
.vscode
2727
.env
2828
*.local
29+
.DS_Store
30+
31+
test_work/

.prettierignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Rollup
2+
.rollup.cache
3+
4+
package-lock.json
5+
6+
*.gltf
7+
*.json
8+
*.yml
File renamed without changes.

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
# @Navigraph/app-dev will be requested for
44
# review when someone opens a pull request.
55
* @pepperoni505
6+
* @professoralex13

0 commit comments

Comments
 (0)