Skip to content

Commit 7e0a58e

Browse files
authored
Merge pull request #621 from UTDNebula/develop
Sync with develop (Migrating from Railway => Neon)
2 parents 4200bfe + 2e4ab59 commit 7e0a58e

File tree

91 files changed

+1073
-316
lines changed

Some content is hidden

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

91 files changed

+1073
-316
lines changed

.eslintrc.js

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,53 @@
11
module.exports = {
22
parser: '@typescript-eslint/parser',
3-
// Specifies the ESLint parser
43
parserOptions: {
54
ecmaVersion: 2020,
6-
// Allows for the parsing of modern ECMAScript features
5+
// Allows for the parsing of modern ECMAScript features.
76
sourceType: 'module',
8-
// Allows for the use of imports
7+
// Allows for the use of imports.
98
ecmaFeatures: {
10-
jsx: true, // Allows for the parsing of JSX
9+
jsx: true, // Allows for the parsing of JSX.
1110
},
12-
// project: ['./tsconfig.json'],
1311
},
1412

15-
plugins: ['simple-import-sort', 'unused-imports'],
13+
plugins: ['unused-imports'],
1614
extends: [
1715
'plugin:react-hooks/recommended',
1816
'plugin:react/recommended',
1917
'plugin:@typescript-eslint/recommended',
18+
'plugin:import/recommended',
19+
'plugin:import/typescript',
2020
'prettier',
2121
],
2222
rules: {
2323
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
2424
// e.g. '@typescript-eslint/explicit-function-return-type': 'off',
2525
'react/prop-types': 'warn',
2626
'react/jsx-key': 'warn',
27-
'simple-import-sort/imports': process.env.NODE_ENV === 'test' ? 'error' : 'off',
28-
'simple-import-sort/exports': process.env.NODE_ENV === 'test' ? 'error' : 'off',
2927
'react/react-in-jsx-scope': 'off',
28+
// Configuration for import. See: https://github.com/import-js/eslint-plugin-import/tree/main.
29+
'import/order': [
30+
'warn',
31+
{
32+
groups: [
33+
'builtin',
34+
'external',
35+
'internal',
36+
['parent', 'sibling'],
37+
'index',
38+
'object',
39+
'type',
40+
],
41+
alphabetize: {
42+
order: 'asc',
43+
caseInsensitive: true,
44+
},
45+
'newlines-between': 'always',
46+
},
47+
],
48+
'import/no-named-as-default': 'off',
49+
// Configuration for unused-imports. See: https://github.com/sweepline/eslint-plugin-unused-imports#usage.
50+
'@typescript-eslint/no-unused-vars': 'off',
3051
'unused-imports/no-unused-imports': process.env.NODE_ENV === 'test' ? 'error' : 'warn',
3152
'unused-imports/no-unused-vars': [
3253
'warn',
@@ -40,7 +61,11 @@ module.exports = {
4061
},
4162
settings: {
4263
react: {
43-
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
64+
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use.
65+
},
66+
'import/resolver': {
67+
typescript: true,
68+
node: true,
4469
},
4570
},
4671
};

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
env:
4848
# Prisma
4949
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres?schema=public
50+
DIRECT_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres?schema=public
5051
PLATFORM_DATABASE_URL: mongodb://localhost:27017/platformDB # This is a dead connection URL - build does not need live DB.
5152

5253
# Next Auth
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Delete Neon Branch
2+
3+
env:
4+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
5+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
6+
7+
on:
8+
pull_request:
9+
types:
10+
- closed
11+
workflow_dispatch:
12+
13+
jobs:
14+
delete-neon-branch:
15+
permissions: write-all
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
21+
- name: Search branch by name
22+
id: get_branch_id
23+
# list all branches and filter by name
24+
run: |
25+
branch_id=$(curl --silent \
26+
"https://console.neon.tech/api/v2/projects/${{ secrets.NEON_PROJECT_ID }}/branches" \
27+
--header "Accept: application/json" \
28+
--header "Content-Type: application/json" \
29+
--header "Authorization: Bearer ${{ secrets.NEON_API_KEY }}" \
30+
| jq -r .branches \
31+
| jq -c '.[] | select(.name | contains("'${{ github.event.pull_request.head.ref || github.head_ref }}'")) .id' \
32+
| jq -r \
33+
) \
34+
35+
echo "branch_id=${branch_id}" >> $GITHUB_OUTPUT
36+
37+
- name: Delete Neon Branch
38+
uses: neondatabase/delete-branch-action@v2
39+
with:
40+
project_id: ${{ secrets.NEON_PROJECT_ID }}
41+
branch_id: ${{ steps.get_branch_id.outputs.branch_id }}
42+
api_key: ${{ secrets.NEON_API_KEY }}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deploy Preview
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "develop"
7+
workflow_dispatch:
8+
9+
env:
10+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
11+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
12+
13+
jobs:
14+
deploy-preview:
15+
permissions: write-all
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
21+
- name: Neon Database Create Branch Action
22+
uses: neondatabase/create-branch-action@v3
23+
id: create_branch
24+
with:
25+
project_id: ${{ secrets.NEON_PROJECT_ID }}
26+
branch_name: ${{ github.event.pull_request.head.ref || github.head_ref }}
27+
api_key: ${{ secrets.NEON_API_KEY }}
28+
username: ${{ secrets.PG_USERNAME }}
29+
password: ${{ secrets.PG_PASSWORD }}
30+
31+
- name: Install Vercel CLI
32+
run: npm install --global vercel@latest
33+
34+
- name: Deploy Preview to Vercel
35+
id: deploy
36+
run: |
37+
echo preview_url=$(vercel deploy \
38+
--env DATABASE_URL=${{ steps.create_branch.outputs.db_url_with_pooler}}/neondb \
39+
--build-env DIRECT_DATABASE_URL=${{ steps.create_branch.outputs.db_url}}/neondb \
40+
--public --yes --token=${{ secrets.VERCEL_TOKEN }}) \
41+
>> $GITHUB_OUTPUT
42+
43+
- name: Comment on Pull Request
44+
uses: thollander/actions-comment-pull-request@v2
45+
with:
46+
message: |
47+
Vercel Preview URL :rocket: : ${{ steps.deploy.outputs.preview_url }}
48+
Neon branch :elephant: : https://console.neon.tech/app/projects/${{ secrets.NEON_PROJECT_ID }}/branches/${{ steps.create_branch.outputs.branch_id }}

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
env:
3232
# Prisma
3333
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres?schema=public
34+
DIRECT_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres?schema=public
3435
PLATFORM_DATABASE_URL: ${{ secrets.PLATFORM_DATABASE_URL }}
3536

3637
steps:

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Request project lead by default
2-
* @syl15
2+
* @akevinge
33

44
# Request all Project Nebula Maintainers to review other pull requests
55
src/**/* @UTDNebula/Planner-Maintainers

SECURITY.md

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

cypress.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineConfig } from 'cypress';
2-
import { prisma } from 'cypress/support/constants';
32
import dotenv from 'dotenv';
3+
4+
import { prisma } from 'cypress/support/constants';
45
import { seedTemplates } from 'prisma/seedTemplates';
56
import { seedTestUser } from 'prisma/seedTestUser';
67

0 commit comments

Comments
 (0)