-
Notifications
You must be signed in to change notification settings - Fork 6
Add CI checks for the backend/email workspace #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
06f55c0
142c38e
d3c02ae
1401caf
5de691e
b527cab
035e6f3
fc0bd8d
996ff0a
dbeeead
5c74d91
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: CI checks for backend/email workspace | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: ['main'] | ||
| paths: ['backend/email/**/*', '!**/*.{txt,md,png}'] | ||
| push: | ||
| branches: ['main'] | ||
| paths: ['backend/email/**/*', '!**/*.{txt,md,png}'] | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: backend/email | ||
|
|
||
| jobs: | ||
| eslint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| - name: Install yarn | ||
| run: npm install -g yarn | ||
| - name: Install dependencies | ||
| run: yarn | ||
| - name: Run ESLint | ||
| run: yarn eslint . | ||
| prettier: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| - name: Install yarn | ||
| run: npm install -g yarn | ||
| - name: Install dependencies | ||
| run: yarn | ||
| - name: Run prettier | ||
| run: yarn prettier . --check --ignore-unknown | ||
| typecheck: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| - name: Install yarn | ||
| run: npm install -g yarn | ||
| - name: Install dependencies | ||
| run: yarn | ||
| - name: Use tsc to build | ||
| run: yarn tsc -b | ||
| - name: Use tsc to typecheck | ||
| run: yarn tsc --noEmit --strict |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| lib/**/* |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,10 +13,8 @@ export const sendNewMatchEmail = async ( | |
| privateUser: PrivateUser, | ||
| matchedWithUser: User | ||
| ) => { | ||
| const { sendToEmail, unsubscribeUrl } = getNotificationDestinationsForUser( | ||
| privateUser, | ||
| 'new_match' | ||
| ) | ||
| const { sendToEmail /*, unsubscribeUrl*/ } = | ||
| getNotificationDestinationsForUser(privateUser, 'new_match') | ||
| if (!privateUser.email || !sendToEmail) return | ||
| const lover = await getLover(privateUser.id) | ||
| if (!lover) return | ||
|
|
@@ -30,7 +28,7 @@ export const sendNewMatchEmail = async ( | |
| onUser={lover.user} | ||
| matchedWithUser={matchedWithUser} | ||
| matchedLover={lover} | ||
| unsubscribeUrl={unsubscribeUrl} | ||
| /*unsubscribeUrl={unsubscribeUrl}*/ | ||
| /> | ||
| ), | ||
| }) | ||
|
|
@@ -42,10 +40,8 @@ export const sendNewMessageEmail = async ( | |
| toUser: User, | ||
| channelId: number | ||
| ) => { | ||
| const { sendToEmail, unsubscribeUrl } = getNotificationDestinationsForUser( | ||
| privateUser, | ||
| 'new_message' | ||
| ) | ||
| const { sendToEmail /*, unsubscribeUrl*/ } = | ||
| getNotificationDestinationsForUser(privateUser, 'new_message') | ||
| if (!privateUser.email || !sendToEmail) return | ||
|
Comment on lines
+43
to
45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Remove commented unsubscribeUrl in sendNewMessageEmail Same rationale as above. - const { sendToEmail /*, unsubscribeUrl*/ } =
- getNotificationDestinationsForUser(privateUser, 'new_message')
+ const { sendToEmail } =
+ getNotificationDestinationsForUser(privateUser, 'new_message')
@@
toUser={toUser}
channelId={channelId}
- /*unsubscribeUrl={unsubscribeUrl}*/
/>Also applies to: 64-65 🤖 Prompt for AI Agents |
||
|
|
||
| const lover = await getLover(fromUser.id) | ||
|
|
@@ -65,7 +61,7 @@ export const sendNewMessageEmail = async ( | |
| fromUserLover={lover} | ||
| toUser={toUser} | ||
| channelId={channelId} | ||
| unsubscribeUrl={unsubscribeUrl} | ||
| /*unsubscribeUrl={unsubscribeUrl}*/ | ||
| /> | ||
| ), | ||
| }) | ||
|
|
@@ -77,10 +73,8 @@ export const sendNewEndorsementEmail = async ( | |
| onUser: User, | ||
| text: string | ||
| ) => { | ||
| const { sendToEmail, unsubscribeUrl } = getNotificationDestinationsForUser( | ||
| privateUser, | ||
| 'new_endorsement' | ||
| ) | ||
| const { sendToEmail /*, unsubscribeUrl*/ } = | ||
| getNotificationDestinationsForUser(privateUser, 'new_endorsement') | ||
| if (!privateUser.email || !sendToEmail) return | ||
|
Comment on lines
+76
to
78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Remove commented unsubscribeUrl in sendNewEndorsementEmail Same cleanup. - const { sendToEmail /*, unsubscribeUrl*/ } =
- getNotificationDestinationsForUser(privateUser, 'new_endorsement')
+ const { sendToEmail } =
+ getNotificationDestinationsForUser(privateUser, 'new_endorsement')
@@
onUser={onUser}
endorsementText={text}
- /*unsubscribeUrl={unsubscribeUrl}*/
/>Also applies to: 89-90 🤖 Prompt for AI Agents |
||
|
|
||
| return await sendEmail({ | ||
|
|
@@ -92,7 +86,7 @@ export const sendNewEndorsementEmail = async ( | |
| fromUser={fromUser} | ||
| onUser={onUser} | ||
| endorsementText={text} | ||
| unsubscribeUrl={unsubscribeUrl} | ||
| /*unsubscribeUrl={unsubscribeUrl}*/ | ||
| /> | ||
| ), | ||
| }) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import globals from 'globals' | ||
| import pluginJs from '@eslint/js' | ||
| import tseslint from 'typescript-eslint' | ||
|
|
||
| /** @type {import('eslint').Linter.Config[]} */ | ||
| export default [ | ||
| { ignores: ['lib/'] }, // generated by `tsc -b` so irrelevant (and all imports turn into requires there anyways) | ||
| { files: ['**/*.{js,mjs,cjs,ts}'] }, | ||
| { languageOptions: { globals: globals.node } }, | ||
| pluginJs.configs.recommended, | ||
| ...tseslint.configs.recommended, | ||
| { rules: { '@typescript-eslint/no-unused-expressions': 'off' } }, | ||
| ] |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,11 +7,15 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "build": "tsc -b" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "dependencies": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "@eslint/js": "9.32.0", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "@react-email/components": "0.0.33", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "eslint": "9.32.0", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "globals": "16.3.0", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "react": "19.0.0", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "react-dom": "19.0.0", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "react-email": "3.0.7", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "resend": "4.1.2" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "resend": "4.1.2", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "typescript-eslint": "8.39.0" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+10
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Move ESLint dependencies to devDependencies. ESLint and related tooling packages should be in "dependencies": {
- "@eslint/js": "9.32.0",
"@react-email/components": "0.0.33",
- "eslint": "9.32.0",
- "globals": "16.3.0",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-email": "3.0.7",
"resend": "4.1.2",
- "typescript-eslint": "8.39.0"
},
"devDependencies": {
+ "@eslint/js": "9.32.0",
+ "eslint": "9.32.0",
+ "globals": "16.3.0",
"@types/html-to-text": "9.0.4",
"@types/prismjs": "1.26.5",
"@types/react": "19.0.10",
- "@types/react-dom": "19.0.4"
+ "@types/react-dom": "19.0.4",
+ "typescript-eslint": "8.39.0"
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "devDependencies": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "@types/html-to-text": "9.0.4", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Remove commented unsubscribeUrl artifacts
Commented destructuring and props increase noise and can confuse future refactors. Remove them until the feature is implemented.
Also applies to: 31-32
🤖 Prompt for AI Agents