Skip to content

Commit

Permalink
refactor: create separate directories for UIs
Browse files Browse the repository at this point in the history
I will now have multiple UIs to interact with the same underlying data.
I figured keeping everything in a monorepo would be better for now. If I
need to break out into separate repositories, I will do so in the
future.
  • Loading branch information
nicholaschiang committed Nov 23, 2024
1 parent 3fae646 commit 80fd9c1
Show file tree
Hide file tree
Showing 830 changed files with 104 additions and 35 deletions.
79 changes: 60 additions & 19 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
pull_request:
merge_group:

defaults:
run:
working-directory: ./remix-ui

jobs:
lint:
name: ESLint
Expand All @@ -17,14 +21,21 @@ jobs:

- name: Checkout repo
uses: actions/checkout@v3


- name: Get package manager version
id: get-pnpm-version
run: echo "version=$(cat package.json | jq -r .packageManager | sed s/pnpm@//)" >> $GITHUB_OUTPUT

- name: Setup pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v4
with:
version: ${{ steps.get-pnpm-version.outputs.version }}

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: package.json
node-version-file: remix-ui/package.json
cache-dependency-path: remix-ui/pnpm-lock.yaml
cache: pnpm

- name: Download deps
Expand Down Expand Up @@ -52,13 +63,20 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3

- name: Get package manager version
id: get-pnpm-version
run: echo "version=$(cat package.json | jq -r .packageManager | sed s/pnpm@//)" >> $GITHUB_OUTPUT

- name: Setup pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v4
with:
version: ${{ steps.get-pnpm-version.outputs.version }}

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: package.json
node-version-file: remix-ui/package.json
cache-dependency-path: remix-ui/pnpm-lock.yaml
cache: pnpm

- name: Download deps
Expand All @@ -80,13 +98,20 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3

- name: Get package manager version
id: get-pnpm-version
run: echo "version=$(cat package.json | jq -r .packageManager | sed s/pnpm@//)" >> $GITHUB_OUTPUT

- name: Setup pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v4
with:
version: ${{ steps.get-pnpm-version.outputs.version }}

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: package.json
node-version-file: remix-ui/package.json
cache-dependency-path: remix-ui/pnpm-lock.yaml
cache: pnpm

- name: Download deps
Expand All @@ -100,27 +125,47 @@ jobs:
runs-on: ubuntu-latest
env:
PORT: '8811'
services:
localhost:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Cancel previous runs
uses: styfle/[email protected]

- name: Checkout repo
uses: actions/checkout@v3

- name: Get package manager version
id: get-pnpm-version
run: echo "version=$(cat package.json | jq -r .packageManager | sed s/pnpm@//)" >> $GITHUB_OUTPUT

- name: Setup pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v4
with:
version: ${{ steps.get-pnpm-version.outputs.version }}

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: package.json
node-version-file: remix-ui/package.json
cache-dependency-path: remix-ui/pnpm-lock.yaml
cache: pnpm

- name: Cache cypress binary
uses: actions/cache@v4
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
key: cypress-${{ runner.os }}-${{ hashFiles('remix-ui/pnpm-lock.yaml') }}

- name: Download deps
run: pnpm install --frozen-lockfile
Expand All @@ -131,10 +176,6 @@ jobs:
- name: Copy test env vars
run: cp .env.example .env

- name: Docker compose
# the sleep is just there to give time for postgres to get started
run: docker-compose --env-file .env up -d && sleep 3

- name: Setup database
run: pnpm prisma migrate reset --force --skip-seed --skip-generate

Expand Down Expand Up @@ -218,7 +259,7 @@ jobs:
- name: Docker build
uses: docker/build-push-action@v3
with:
context: .
context: ./remix-ui
platforms: linux/amd64
# only upload main branch (on pushes) to GHCR. otherwise, just check
# to ensure that the docker build completes without error.
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/migrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
branches:
- main

defaults:
run:
working-directory: ./remix-ui

jobs:
deploy:
name: Deploy
Expand All @@ -12,13 +16,20 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3

- name: Get package manager version
id: get-pnpm-version
run: echo "version=$(cat package.json | jq -r .packageManager | sed s/pnpm@//)" >> $GITHUB_OUTPUT

- name: Setup pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v4
with:
version: ${{ steps.get-pnpm-version.outputs.version }}

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: package.json
node-version-file: remix-ui/package.json
cache-dependency-path: remix-ui/pnpm-lock.yaml
cache: pnpm

- name: Download deps
Expand Down
30 changes: 24 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ on:
- main
- '*.x'

defaults:
run:
working-directory: ./remix-ui

concurrency:
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
Expand All @@ -34,13 +38,20 @@ jobs:
with:
fetch-depth: 0

- name: Get package manager version
id: get-pnpm-version
run: echo "version=$(cat package.json | jq -r .packageManager | sed s/pnpm@//)" >> $GITHUB_OUTPUT

- name: Setup pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v4
with:
version: ${{ steps.get-pnpm-version.outputs.version }}

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: package.json
node-version-file: remix-ui/package.json
cache-dependency-path: remix-ui/pnpm-lock.yaml
cache: pnpm

- name: Download deps
Expand Down Expand Up @@ -74,13 +85,20 @@ jobs:
fetch-depth: 0
token: ${{ steps.generate-token.outputs.token }}

- name: Get package manager version
id: get-pnpm-version
run: echo "version=$(cat package.json | jq -r .packageManager | sed s/pnpm@//)" >> $GITHUB_OUTPUT

- name: Setup pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v4
with:
version: ${{ steps.get-pnpm-version.outputs.version }}

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: package.json
node-version-file: remix-ui/package.json
cache-dependency-path: remix-ui/pnpm-lock.yaml
cache: pnpm

- name: Download deps
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions .releaserc.json → remix-ui/.releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
"countMatches": true
},
{
"files": ["pyproject.toml"],
"files": ["../data-collection/pyproject.toml"],
"from": "^version = \".*\"",
"to": "version = \"${nextRelease.version}\"",
"results": [
{
"file": "pyproject.toml",
"file": "../data-collection/pyproject.toml",
"hasChanged": true,
"numMatches": 1,
"numReplacements": 1
Expand All @@ -49,7 +49,7 @@
[
"@semantic-release/git",
{
"assets": ["package.json", "pyproject.toml", "CHANGELOG.md"],
"assets": ["package.json", "../data-collection/pyproject.toml", "../CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version}"
}
]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 3 additions & 4 deletions package.json → remix-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@
"test:e2e:run": "cross-env PORT=8811 start-server-and-test start:mocks http://localhost:8811 \"pnpm cypress run\"",
"typecheck": "run-p 'typecheck:*'",
"typecheck:app": "tsc -b",
"typecheck:scripts": "tsc -b scripts/node",
"typecheck:cypress": "tsc -b cypress",
"validate": "run-p \"test --run\" lint typecheck test:e2e:run",
"scripts": "run-s 'scripts:*'",
"scripts": "run-s '../data-collection/scripts:*'",
"scripts:prisma": "prisma generate --generator js",
"scripts:build": "tsc -p scripts/node",
"scripts:run": "node scripts/node/out/wikipedia.js | pino-pretty"
"scripts:build": "tsc -p ../data-collection/scripts/node",
"scripts:run": "node ../data-collection/scripts/node/out/wikipedia.js | pino-pretty"
},
"eslintIgnore": [
"/node_modules",
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 80fd9c1

Please sign in to comment.