Skip to content

Commit

Permalink
add prettier for formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam McKee committed Feb 25, 2025
1 parent 094cad1 commit 8d87eec
Show file tree
Hide file tree
Showing 93 changed files with 1,468 additions and 875 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@ jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
# services:
# postgres:
# image: postgres:16
# ports:
# - 5432:5432
# env:
# POSTGRES_DB: eighty4
# POSTGRES_USER: eighty4
# POSTGRES_PASSWORD: eighty4
# options: >-
# --health-cmd pg_isready
# --health-interval 5s
# --health-timeout 5s
# --health-retries 10
# services:
# postgres:
# image: postgres:16
# ports:
# - 5432:5432
# env:
# POSTGRES_DB: eighty4
# POSTGRES_USER: eighty4
# POSTGRES_PASSWORD: eighty4
# options: >-
# --health-cmd pg_isready
# --health-interval 5s
# --health-timeout 5s
# --health-retries 10
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
node-version: 23
cache: pnpm
# - name: sql
# run: |
# sudo apt-get install -y postgresql-client
# PGPASSWORD=eighty4 psql -h localhost -U eighty4 -f v001-init-schema.sql eighty4
# working-directory: sql
# - name: sql
# run: |
# sudo apt-get install -y postgresql-client
# PGPASSWORD=eighty4 psql -h localhost -U eighty4 -f v001-init-schema.sql eighty4
# working-directory: sql
- run: pnpm i
- name: playwright
env:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/publish_frontend.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Publish: frontend"
name: 'Publish: frontend'

on:
workflow_call:
Expand All @@ -14,7 +14,6 @@ on:
type: string

jobs:

publish-frontend:
runs-on: ubuntu-latest
defaults:
Expand All @@ -28,7 +27,7 @@ jobs:
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
node-version: 23
cache: pnpm
- run: pnpm i
- run: pnpm build
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/publish_lambdas.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Publish: lambdas"
name: 'Publish: lambdas'

on:
workflow_call:
Expand All @@ -14,7 +14,6 @@ on:
type: string

jobs:

publish-lambdas:
runs-on: ubuntu-24.04
defaults:
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Release
run-name: "Release: ${{ inputs.service }}"
run-name: 'Release: ${{ inputs.service }}'

on:
workflow_dispatch:
Expand All @@ -13,17 +13,16 @@ on:
- lambdas

concurrency:
group: "release-${{ inputs.service }}"
group: 'release-${{ inputs.service }}'
cancel-in-progress: false

jobs:

verified:
uses: ./.github/workflows/verify.yml

create-git-tag:
runs-on: ubuntu-latest
needs: [ verified ]
needs: [verified]
steps:
- if: github.ref != 'refs/heads/main'
run: exit 1
Expand All @@ -50,7 +49,7 @@ jobs:

create-gh-release:
runs-on: ubuntu-latest
needs: [ create-git-tag ]
needs: [create-git-tag]
steps:
- name: create github release
id: create
Expand Down
96 changes: 54 additions & 42 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ name: verify

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
workflow_call:

jobs:

verified:
runs-on: ubuntu-latest
needs:
# - verify-backend
- format
# - verify-backend
- verify-e2e
- verify-frontend
- verify-github
Expand All @@ -21,41 +21,53 @@ jobs:
- uses: actions/checkout@v4
- run: echo "44.481800,-88.054413"

# verify-backend:
# runs-on: ubuntu-latest
# services:
# postgres:
# image: postgres:16
# ports:
# - 5432:5432
# env:
# POSTGRES_DB: eighty4
# POSTGRES_USER: eighty4
# POSTGRES_PASSWORD: eighty4
# options: >-
# --health-cmd pg_isready
# --health-interval 5s
# --health-timeout 5s
# --health-retries 10
# steps:
# - uses: actions/checkout@v4
# - uses: pnpm/action-setup@v4
# - uses: actions/setup-node@v4
# with:
# node-version: 22
# cache: pnpm
# - name: sql
# run: |
# sudo apt-get update -y
# sudo apt-get install -y postgresql-client
# PGPASSWORD=eighty4 psql -h localhost -U eighty4 -f v001-init-schema.sql eighty4
# working-directory: sql
# - run: pnpm i
# - name: verify
# run: |
# pnpm build
# pnpm test
# working-directory: backend
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 23
cache: pnpm
- run: pnpm i
- run: pnpm exec prettier --check .

# verify-backend:
# runs-on: ubuntu-latest
# services:
# postgres:
# image: postgres:16
# ports:
# - 5432:5432
# env:
# POSTGRES_DB: eighty4
# POSTGRES_USER: eighty4
# POSTGRES_PASSWORD: eighty4
# options: >-
# --health-cmd pg_isready
# --health-interval 5s
# --health-timeout 5s
# --health-retries 10
# steps:
# - uses: actions/checkout@v4
# - uses: pnpm/action-setup@v4
# - uses: actions/setup-node@v4
# with:
# node-version: 22
# cache: pnpm
# - name: sql
# run: |
# sudo apt-get update -y
# sudo apt-get install -y postgresql-client
# PGPASSWORD=eighty4 psql -h localhost -U eighty4 -f v001-init-schema.sql eighty4
# working-directory: sql
# - run: pnpm i
# - name: verify
# run: |
# pnpm build
# pnpm test
# working-directory: backend

verify-e2e:
uses: ./.github/workflows/playwright.yml
Expand All @@ -70,7 +82,7 @@ jobs:
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
node-version: 23
cache: pnpm
- run: pnpm i
- run: VITE_GITHUB_CLIENT_ID=ci pnpm build
Expand All @@ -82,7 +94,7 @@ jobs:
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
node-version: 23
cache: pnpm
- name: verify
run: |
Expand All @@ -97,7 +109,7 @@ jobs:
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
node-version: 23
cache: pnpm
- name: verify
shell: 'script -q -e -c "bash {0}"'
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm-lock.yaml
19 changes: 19 additions & 0 deletions .prettierrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { type Config } from 'prettier'

const config: Config = {
arrowParens: 'avoid',
semi: false,
singleQuote: true,
tabWidth: 4,
trailingComma: 'all',
overrides: [
{
files: '*.{html,yaml,yml}',
options: {
tabWidth: 2,
},
},
],
}

export default config
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ See each package's .env file for environment variable names.

Use these commands to run Install.sh locally:

| Package | Command |
|----------|------------------|
| lambdas | l3 sync |
| frontend | pnpm dev |
| Package | Command |
| -------- | -------- |
| lambdas | l3 sync |
| frontend | pnpm dev |

APIs are deployed to AWS Lambdas with [eighty4/l3](https://github.com/eighty4/l3).
For development, Vite will proxy API requests to AWS Lambda.
`l3 sync` must be run before starting the frontend Vite server.
`l3 sync` must be run before starting the frontend Vite server.

Database features are currently disabled to migrate the backend to a serverless deployment.
Unit tests, however, are still ran against Postgres.
Expand All @@ -32,7 +32,7 @@ Data for offline mode is stubbed out in [//offline/src/data.ts](offline/src/data
These commands will stub API dependencies for offline development of the frontend:

| Package | Command |
|----------|------------------|
| -------- | ---------------- |
| frontend | pnpm dev:offline |
| offline | pnpm start |

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
container_name: binny-postgres
image: postgres:17
ports:
- "5432:5432"
- '5432:5432'
environment:
POSTGRES_DB: eighty4
POSTGRES_USER: eighty4
Expand Down
28 changes: 14 additions & 14 deletions e2e/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "@eighty4/install-e2e",
"version": "0.0.1",
"private": true,
"author": "Adam McKee <[email protected]>",
"license": "BSD-3-Clause",
"type": "module",
"scripts": {
"test:ui": "playwright test --ui",
"test": "playwright test"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
"@types/node": "^22.13.5"
}
"name": "@eighty4/install-e2e",
"version": "0.0.1",
"private": true,
"author": "Adam McKee <[email protected]>",
"license": "BSD-3-Clause",
"type": "module",
"scripts": {
"test:ui": "playwright test --ui",
"test": "playwright test"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
"@types/node": "^22.13.5"
}
}
16 changes: 11 additions & 5 deletions e2e/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import {defineConfig, devices, type PlaywrightTestConfig} from '@playwright/test'
import {
defineConfig,
devices,
type PlaywrightTestConfig,
} from '@playwright/test'

// https://playwright.dev/docs/test-configuration

Expand All @@ -16,24 +20,26 @@ export default defineConfig({
projects: [
{
name: 'chromium',
use: {...devices['Desktop Chrome']},
use: { ...devices['Desktop Chrome'] },
},

{
name: 'firefox',
use: {...devices['Desktop Firefox']},
use: { ...devices['Desktop Firefox'] },
},

{
name: 'webkit',
use: {...devices['Desktop Safari']},
use: { ...devices['Desktop Safari'] },
},
],

webServer: createWebServerConfig(),
})

function createWebServerConfig(): (PlaywrightTestConfig['webServer']) | undefined {
function createWebServerConfig():
| PlaywrightTestConfig['webServer']
| undefined {
if (process.env.CI) {
return {
command: './start_app.sh',
Expand Down
Loading

0 comments on commit 8d87eec

Please sign in to comment.