-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dda4b37
commit 49ace3d
Showing
341 changed files
with
27,770 additions
and
18,044 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
LITEFS_DIR="/litefs/data" | ||
DATABASE_PATH="./prisma/data.db" | ||
DATABASE_URL="file:./data.db?connection_limit=1" | ||
CACHE_DATABASE_PATH="./other/cache.db" | ||
SESSION_SECRET="super-duper-s3cret" | ||
HONEYPOT_SECRET="super-duper-s3cret" | ||
INTERNAL_COMMAND_TOKEN="some-made-up-token" | ||
RESEND_API_KEY="re_blAh_blaHBlaHblahBLAhBlAh" | ||
SENTRY_DSN="your-dsn" | ||
|
||
# the mocks and some code rely on these two being prefixed with "MOCK_" | ||
# if they aren't then the real github api will be attempted | ||
GITHUB_CLIENT_ID="MOCK_GITHUB_CLIENT_ID" | ||
GITHUB_CLIENT_SECRET="MOCK_GITHUB_CLIENT_SECRET" | ||
GITHUB_TOKEN="MOCK_GITHUB_TOKEN" | ||
|
||
# set this to false to prevent search engines from indexing the website | ||
# default to allow indexing for seo safety | ||
ALLOW_INDEXING="true" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,85 @@ | ||
/** | ||
* @type {import('eslint').Linter.Config} | ||
*/ | ||
const vitestFiles = ['app/**/__tests__/**/*', 'app/**/*.{spec,test}.*'] | ||
const testFiles = ['**/tests/**', ...vitestFiles] | ||
const appFiles = ['app/**'] | ||
|
||
/** @type {import('@types/eslint').Linter.Config} */ | ||
module.exports = { | ||
extends: ['@remix-run/eslint-config', '@remix-run/eslint-config/node', 'prettier'], | ||
extends: [ | ||
'@remix-run/eslint-config', | ||
'@remix-run/eslint-config/node', | ||
'prettier', | ||
], | ||
rules: { | ||
// playwright requires destructuring in fixtures even if you don't use anything π€·ββοΈ | ||
'no-empty-pattern': 'off', | ||
'@typescript-eslint/consistent-type-imports': [ | ||
'warn', | ||
{ | ||
prefer: 'type-imports', | ||
disallowTypeAnnotations: true, | ||
fixStyle: 'inline-type-imports', | ||
}, | ||
], | ||
'import/no-duplicates': ['warn', { 'prefer-inline': true }], | ||
'import/consistent-type-specifier-style': ['warn', 'prefer-inline'], | ||
'import/order': [ | ||
'warn', | ||
{ | ||
alphabetize: { order: 'asc', caseInsensitive: true }, | ||
groups: [ | ||
'builtin', | ||
'external', | ||
'internal', | ||
'parent', | ||
'sibling', | ||
'index', | ||
], | ||
}, | ||
], | ||
}, | ||
overrides: [ | ||
{ | ||
plugins: ['remix-react-routes'], | ||
files: appFiles, | ||
excludedFiles: testFiles, | ||
rules: { | ||
'remix-react-routes/use-link-for-routes': 'error', | ||
'remix-react-routes/require-valid-paths': 'error', | ||
// disable this one because it doesn't appear to work with our | ||
// route convention. Someone should dig deeper into this... | ||
'remix-react-routes/no-relative-paths': [ | ||
'off', | ||
{ allowLinksToSelf: true }, | ||
], | ||
'remix-react-routes/no-urls': 'error', | ||
'no-restricted-imports': [ | ||
'error', | ||
{ | ||
patterns: [ | ||
{ | ||
group: testFiles, | ||
message: 'Do not import test files in app files', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
extends: ['@remix-run/eslint-config/jest-testing-library'], | ||
files: vitestFiles, | ||
rules: { | ||
'testing-library/no-await-sync-events': 'off', | ||
'jest-dom/prefer-in-document': 'off', | ||
}, | ||
// we're using vitest which has a very similar API to jest | ||
// (so the linting plugins work nicely), but it means we have to explicitly | ||
// set the jest version. | ||
settings: { | ||
jest: { | ||
version: 28, | ||
}, | ||
}, | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!-- Summary: Put your summary here --> | ||
|
||
## Test Plan | ||
|
||
<!-- What steps need to be taken to verify this works as expected? --> | ||
|
||
## Checklist | ||
|
||
- [ ] Tests updated | ||
- [ ] Docs updated | ||
|
||
## Screenshots | ||
|
||
<!-- If what you're changing is within the app, please show before/after. | ||
You can provide a video as well if that makes more sense --> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
name: π Deploy | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
pull_request: {} | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
actions: write | ||
contents: read | ||
|
||
jobs: | ||
lint: | ||
name: ⬣ ESLint | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: β¬οΈ Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: β Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: π₯ Download deps | ||
uses: bahmutov/npm-install@v1 | ||
|
||
- name: πΌ Build icons | ||
run: npm run build:icons | ||
|
||
- name: π¬ Lint | ||
run: npm run lint | ||
|
||
typecheck: | ||
name: Κ¦ TypeScript | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: β¬οΈ Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: β Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: π₯ Download deps | ||
uses: bahmutov/npm-install@v1 | ||
|
||
- name: πΌ Build icons | ||
run: npm run build:icons | ||
|
||
- name: π Type check | ||
run: npm run typecheck --if-present | ||
|
||
vitest: | ||
name: β‘ Vitest | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: β¬οΈ Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: β Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: π₯ Download deps | ||
uses: bahmutov/npm-install@v1 | ||
|
||
- name: π Copy test env vars | ||
run: cp .env.example .env | ||
|
||
- name: πΌ Build icons | ||
run: npm run build:icons | ||
|
||
- name: β‘ Run vitest | ||
run: npm run test -- --coverage | ||
|
||
playwright: | ||
name: π Playwright | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 60 | ||
steps: | ||
- name: β¬οΈ Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: π Copy test env vars | ||
run: cp .env.example .env | ||
|
||
- name: β Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: π₯ Download deps | ||
uses: bahmutov/npm-install@v1 | ||
|
||
- name: π₯ Install Playwright Browsers | ||
run: npm run test:e2e:install | ||
|
||
- name: π Setup Database | ||
run: npx prisma migrate deploy | ||
|
||
- name: π¦ Cache Database | ||
id: db-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: prisma/data.db | ||
key: | ||
db-cache-schema_${{ hashFiles('./prisma/schema.prisma') | ||
}}-migrations_${{ hashFiles('./prisma/migrations/*/migration.sql') | ||
}} | ||
|
||
- name: π± Seed Database | ||
if: steps.db-cache.outputs.cache-hit != 'true' | ||
run: npx prisma db seed | ||
env: | ||
MINIMAL_SEED: true | ||
|
||
- name: π Build | ||
run: npm run build | ||
|
||
- name: π Playwright tests | ||
run: npx playwright test | ||
|
||
- name: π Upload report | ||
uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 | ||
|
||
deploy: | ||
name: π Deploy | ||
runs-on: ubuntu-22.04 | ||
needs: [lint, typecheck, vitest, playwright] | ||
# only build/deploy branches on pushes | ||
if: ${{ github.event_name == 'push' }} | ||
|
||
steps: | ||
- name: β¬οΈ Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: π Read app name | ||
uses: SebRollen/[email protected] | ||
id: app_name | ||
with: | ||
file: 'fly.toml' | ||
field: 'app' | ||
|
||
# move Dockerfile to root | ||
- name: π Move Dockerfile | ||
run: | | ||
mv ./other/Dockerfile ./Dockerfile | ||
mv ./other/.dockerignore ./.dockerignore | ||
- name: π Setup Fly | ||
uses: superfly/flyctl-actions/[email protected] | ||
|
||
- name: π Deploy Staging | ||
if: ${{ github.ref == 'refs/heads/dev' }} | ||
run: | ||
flyctl deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }} | ||
--app ${{ steps.app_name.outputs.value }}-staging | ||
env: | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | ||
|
||
- name: π Deploy Production | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
run: | ||
flyctl deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }} | ||
--build-secret SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }} | ||
env: | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} |
Oops, something went wrong.