Skip to content

Commit 7dd8680

Browse files
authored
Merge pull request #35 from developmentseed/fix/app-setup
Enhance app setup
2 parents 65857f4 + f1d5fa5 commit 7dd8680

32 files changed

+2178
-100
lines changed

.github/workflows/checks.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Checks
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
- ready_for_review
10+
11+
env:
12+
NODE: 18
13+
WORKING_DIRECTORY: web
14+
15+
jobs:
16+
prep:
17+
if: github.event.pull_request.draft == false
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Cancel Previous Runs
22+
uses: styfle/[email protected]
23+
with:
24+
access_token: ${{ github.token }}
25+
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
29+
- name: Use Node.js ${{ env.NODE }}
30+
uses: actions/setup-node@v3
31+
with:
32+
node-version: ${{ env.NODE }}
33+
34+
- name: Get yarn cache directory path
35+
id: yarn-cache-dir-path
36+
run: echo "::set-output name=dir::$(yarn cache dir)"
37+
working-directory: ${{ env.WORKING_DIRECTORY }}
38+
39+
- uses: actions/cache@v3
40+
id: yarn-cache
41+
with:
42+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
43+
key: ${{ runner.os }}-yarn-${{ hashFiles('${{ env.WORKING_DIRECTORY }}/yarn.lock') }}
44+
restore-keys: |
45+
${{ runner.os }}-yarn-
46+
47+
- name: Install
48+
run: yarn install
49+
working-directory: ${{ env.WORKING_DIRECTORY }}
50+
51+
lint:
52+
needs: prep
53+
runs-on: ubuntu-latest
54+
55+
steps:
56+
- name: Checkout
57+
uses: actions/checkout@v3
58+
59+
- name: Use Node.js ${{ env.NODE }}
60+
uses: actions/setup-node@v3
61+
with:
62+
node-version: ${{ env.NODE }}
63+
64+
- name: Get yarn cache directory path
65+
id: yarn-cache-dir-path
66+
run: echo "::set-output name=dir::$(yarn cache dir)"
67+
working-directory: ${{ env.WORKING_DIRECTORY }}
68+
69+
- uses: actions/cache@v3
70+
id: yarn-cache
71+
with:
72+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
73+
key: ${{ runner.os }}-yarn-${{ hashFiles('${{ env.WORKING_DIRECTORY }}/yarn.lock') }}
74+
restore-keys: |
75+
${{ runner.os }}-yarn-
76+
77+
- name: Install
78+
run: yarn install
79+
working-directory: ${{ env.WORKING_DIRECTORY }}
80+
81+
- name: Lint
82+
run: yarn lint
83+
working-directory: ${{ env.WORKING_DIRECTORY }}

.github/workflows/deploy-web.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- main
77

8+
env:
9+
NODE: 18
10+
WORKING_DIRECTORY: web
11+
812
jobs:
913
build:
1014
runs-on: ubuntu-latest
@@ -18,19 +22,23 @@ jobs:
1822
- name: Checkout
1923
uses: actions/checkout@v3
2024

21-
- name: Use Node.js 18
25+
- name: Use Node.js ${{ env.NODE }}
2226
uses: actions/setup-node@v3
2327
with:
24-
node-version: 18
28+
node-version: ${{ env.NODE }}
2529
cache: "yarn"
26-
cache-dependency-path: web-vite/yarn.lock
30+
cache-dependency-path: ${{ env.WORKING_DIRECTORY }}/yarn.lock
2731

2832
- name: Install Dependencies
2933
run: yarn install
30-
working-directory: web-vite
34+
working-directory: ${{ env.WORKING_DIRECTORY }}
35+
36+
- name: Lint
37+
run: yarn lint
38+
working-directory: ${{ env.WORKING_DIRECTORY }}
3139

3240
- name: Deploy to surge
3341
run: yarn deploy
34-
working-directory: web-vite
42+
working-directory: ${{ env.WORKING_DIRECTORY }}
3543
env:
3644
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}

web-vite/public/sample-data.fgb

-6.16 MB
Binary file not shown.

web-vite/src/app/panel.tsx

Lines changed: 0 additions & 14 deletions
This file was deleted.

web/.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
dist/
3+
env.d.ts

web/.eslintrc.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"extends": [
3+
"eslint:recommended",
4+
"eslint-config-preact",
5+
"plugin:import/recommended",
6+
"plugin:jsx-a11y/recommended",
7+
"plugin:@typescript-eslint/recommended",
8+
"eslint-config-prettier"
9+
],
10+
"settings": {
11+
"import/resolver": {
12+
"node": {
13+
"paths": ["src"],
14+
"extensions": [".js", ".jsx", ".ts", ".tsx"]
15+
}
16+
}
17+
},
18+
"rules": {
19+
"no-unused-vars": [
20+
"error",
21+
{
22+
"vars": "all",
23+
"args": "after-used",
24+
"ignoreRestSiblings": true,
25+
"argsIgnorePattern": "^_"
26+
}
27+
],
28+
"@typescript-eslint/no-explicit-any": "off",
29+
"jest/no-deprecated-functions": "off"
30+
}
31+
}
File renamed without changes.
File renamed without changes.

web/.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
dist/

web/.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)