Skip to content

Commit 9ff4c0d

Browse files
authored
Project-wide Prettier setup (#237)
* Setup project-wide prettier * Remove old workspace file * Remove old debugging directives * New top-level .prettierignore * Updated Prettier config settings * Contrubuting guide: Fix for some bad code blocks * Added more ignores * Improved the format script command * printWidth set to 100 * Formatted entire repo (pnpm run format)
1 parent 36ec16b commit 9ff4c0d

File tree

388 files changed

+3281
-7694
lines changed

Some content is hidden

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

388 files changed

+3281
-7694
lines changed

.infisical.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"workspaceId":"63e5e42daf9a537ba8d9503c"}
1+
{ "workspaceId": "63e5e42daf9a537ba8d9503c" }

.prettierignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
node_modules
2+
.env
3+
.env.local
4+
pnpm-lock.yaml
5+
tailwind.css
6+
.babelrc.json
7+
**/.react-email/
8+
**/storybook-static/
9+
**/.changeset/
10+
**/build/
11+
**/dist/

.vscode/launch.json

+1-8
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,12 @@
55
"version": "0.2.0",
66
"configurations": [
77
{
8-
"command": "pnpm run idev --filter webapp",
8+
"command": "pnpm run dev --filter webapp",
99
"name": "Run webapp",
1010
"request": "launch",
1111
"type": "node-terminal",
1212
"cwd": "${workspaceFolder}"
1313
},
14-
{
15-
"command": "pnpm run dev --filter integrations",
16-
"name": "Run integrations",
17-
"request": "launch",
18-
"type": "node-terminal",
19-
"cwd": "${workspaceFolder}"
20-
},
2114
{
2215
"type": "chrome",
2316
"request": "launch",

.vscode/trigger.code-workspace

-19
This file was deleted.

CONTRIBUTING.md

+51-41
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,20 @@ branch are tagged into a release monthly.
8181

8282
2. Once the app is running click the magic link button and enter your email.
8383
3. Check your terminal, the magic link email should have printed out as following:
84-
`webapp:dev: Log in to Trigger.dev
85-
webapp:dev:
86-
webapp:dev: Click here to log in with this magic link
87-
webapp:dev: [http://localhost:3030/magic?token=U2FsdGVkX18OvB0JxgaswTLCSbaRz%2FY82TN0EZWhSzFyZYwgG%2BIzKVTkeiaOtWfotPw7F8RwFzCHh53aBpMEu%2B%2B%2FItb%2FcJYh89MSjc3Pz92bevoEjqxSQ%2Ff%2BZbks09JOpqlBbYC3FzGWC8vuSVFBlxqLXxteSDLthZSUaC%2BS2LaA%2BJgp%2BLO7hgjAaC2lXbCHrM7MTgTdXOFt7i0Dvvuwz6%2BWY25RnfomZOPqDsyH0xz8Q2rzPTz0Xu53WSXrZ1hd]
88-
webapp:dev:
89-
webapp:dev: If you didn't try to log in, you can safely ignore this email.`
90-
4. Paste the magic link shown in your terminal into your browser to login.
84+
85+
```sh
86+
webapp:dev: Log in to Trigger.dev
87+
webapp:dev:
88+
webapp:dev: Click here to log in with this magic link
89+
webapp:dev: [http://localhost:3030/magic?token=U2FsdGVkX18OvB0JxgaswTLCSbaRz%2FY82TN0EZWhSzFyZYwgG%2BIzKVTkeiaOtWfotPw7F8RwFzCHh53aBpMEu%2B%2B%2FItb%2FcJYh89MSjc3Pz92bevoEjqxSQ%2Ff%2BZbks09JOpqlBbYC3FzGWC8vuSVFBlxqLXxteSDLthZSUaC%2BS2LaA%2BJgp%2BLO7hgjAaC2lXbCHrM7MTgTdXOFt7i0Dvvuwz6%2BWY25RnfomZOPqDsyH0xz8Q2rzPTz0Xu53WSXrZ1hd]
90+
webapp:dev:
91+
webapp:dev: If you didn't try to log in, you can safely ignore this email.
92+
```
93+
94+
Paste the magic link shown in your terminal into your browser to login.
9195
9296
## Adding and running migrations
97+
9398
1. Modify packages/database/prisma/schema.prisma file
9499
2. Change directory to the packages/database folder
95100
```sh
@@ -100,6 +105,7 @@ webapp:dev: If you didn't try to log in, you can safely ignore this email.`
100105
```sh
101106
pnpm run generate
102107
```
108+
103109
The above updates the prisma client generated into node_modules/.prisma/client folder. This helps with typing of relevant prisma models. It ensures typescript
104110
recognizes fields added or removed from a model and type-checks appropriately.
105111
@@ -108,6 +114,7 @@ webapp:dev: If you didn't try to log in, you can safely ignore this email.`
108114
```
109115
pnpm run db:migrate:dev
110116
```
117+
111118
This creates a migration file and executes the migrations against your database and applies changes to the database schema(s)
112119
113120
5. Commit generated migrations as well as changes to the schema.prisma file
@@ -119,44 +126,44 @@ To test CLI changes, follow the steps below:
119126

120127
1. Build the CLI and watch for changes
121128

122-
```
123-
cd packages/cli
124-
pnpm run dev
125-
```
129+
```sh
130+
cd packages/cli
131+
pnpm run dev
132+
```
126133

127134
2. Open a new Terminal window and run the webapp locally and then create a new project in the dashboard. Copy out the dev API key.
128135

129136
3. Create a new temporary Next.js app in examples directory
130137

131-
```
132-
pnpm create next-app@latest
133-
```
138+
```sh
139+
pnpm create next-app@latest
140+
```
134141

135-
Follow the prompts to create a TypeScript project using the App Directory.
142+
Follow the prompts to create a TypeScript project using the App Directory.
136143

137144
4. Then once that's finished, add the `@trigger.dev/cli` to the `devDependencies` of the newly created Next.js app's `package.json` file, like so:
138145

139-
```
140-
{
141-
"devDependencies": { "@trigger.dev/cli": "workspace:*" }
142-
}
143-
```
146+
```json
147+
{
148+
"devDependencies": { "@trigger.dev/cli": "workspace:*" }
149+
}
150+
```
144151
145152
5. Open a new terminal window, navigate into the example, and initialize the CLI:
146153
147-
```
148-
cd examples/your-newly-created-nextjs-project
149-
pnpm i
150-
pnpm exec trigger-cli init
151-
```
154+
```sh
155+
cd examples/your-newly-created-nextjs-project
156+
pnpm i
157+
pnpm exec trigger-cli init
158+
```
152159
153160
6. When prompted, select `self-hosted` and enter `localhost:3030` for your local version of the webapp. When asked for an API key, use the key you copied earlier.
154161
155162
7. Run the CLI
156163
157-
```
158-
pnpm exec trigger-cli dev
159-
```
164+
```sh
165+
pnpm exec trigger-cli dev
166+
```
160167
161168
8. After running the CLI, start your newly created Next.js project. You should now be able to see the changes.
162169
@@ -170,19 +177,19 @@ The [examples/jobs-starter](./examples/jobs-starter/) project defines simple job
170177
2. Create a `.env.local` file with the following content,
171178
replacing `[TRIGGER_DEV_API_KEY]` with an actual key:
172179
173-
```
174-
TRIGGER_API_KEY=[TRIGGER_DEV_API_KEY]
175-
TRIGGER_API_URL=http://localhost:3030
176-
```
180+
```env
181+
TRIGGER_API_KEY=[TRIGGER_DEV_API_KEY]
182+
TRIGGER_API_URL=http://localhost:3030
183+
```
177184
178-
`TRIGGER_API_URL` is used to configure the URL for your Trigger.dev instance,
179-
where the jobs will be registered.
185+
`TRIGGER_API_URL` is used to configure the URL for your Trigger.dev instance,
186+
where the jobs will be registered.
180187
181188
3. Run the `jobs-starter` app:
182189
183-
```
184-
pnpm dev
185-
```
190+
```sh
191+
pnpm dev
192+
```
186193
187194
4. Navigate to your trigger.dev instance ([http://localhost:3030](http://localhost:3030/)), to see the jobs.
188195
You can use the test feature to trigger them.
@@ -204,7 +211,7 @@ If you are contributing a change to any packages in this monorepo (anything in e
204211
205212
To add a changeset, run the following command in the root of the repo
206213
207-
```shell
214+
```sh
208215
pnpm run changeset:add
209216
```
210217
@@ -221,15 +228,18 @@ Most of the time the changes you'll make are likely to be categorized as patch r
221228
### EADDRINUSE: address already in use :::3030
222229
223230
When receiving the following error message:
224-
`webapp:dev: Error: listen EADDRINUSE: address already in use :::3030`
231+
232+
```sh
233+
webapp:dev: Error: listen EADDRINUSE: address already in use :::3030
234+
```
225235
226236
The process running on port `3030` should be destroyed.
227237
228238
1. Get the `PID` of the process running on PORT `3030`
229-
```
239+
```sh
230240
lsof -i :3030
231241
```
232242
2. Kill the process
233-
```
243+
```sh
234244
sudo kill -9 <PID>
235245
```

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111

1212
[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/triggerdotdev.svg?style=social&label=Follow%20%40trigger.dev)](https://twitter.com/triggerdotdev)
1313
[![GitHub Repo stars](https://img.shields.io/github/stars/triggerdotdev/trigger.dev?style=social)](https://github.com/triggerdotdev/trigger.dev)
14+
1415
</div>
1516

1617
# About Trigger.dev
18+
1719
Create long-running jobs directly in your codebase with features like API integrations, webhooks, scheduling and delays.
1820

1921
### Long running Jobs on serverless
@@ -60,5 +62,4 @@ We provide an official trigger.dev docker image you can use to easily self-host
6062

6163
## Development
6264

63-
To setup and develop locally or contribute to the open source project, follow our [developement guide](./CONTRIBUTING.md).
64-
65+
To setup and develop locally or contribute to the open source project, follow our [developement guide](./CONTRIBUTING.md).

apps/webapp/.eslintrc

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
{
2-
"extends": [
3-
"@remix-run/eslint-config",
4-
"@remix-run/eslint-config/node",
5-
"prettier"
6-
],
2+
"extends": ["@remix-run/eslint-config", "@remix-run/eslint-config/node", "prettier"],
73
"rules": {
84
"@typescript-eslint/strict-boolean-expressions": [
95
"error",

apps/webapp/.storybook/main.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ const config: StorybookConfig = {
2020
},
2121
};
2222
},
23-
stories: [
24-
"../app/**/stories/*.mdx",
25-
"../app/**/stories/*.stories.@(js|jsx|ts|tsx)",
26-
],
23+
stories: ["../app/**/stories/*.mdx", "../app/**/stories/*.stories.@(js|jsx|ts|tsx)"],
2724
addons: [
2825
"@storybook/addon-links",
2926
"@storybook/addon-essentials",

apps/webapp/.storybook/preview.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ const preview: Preview = {
3535

3636
return (
3737
<OperatingSystemContextProvider platform="mac">
38-
<LocaleContextProvider
39-
locales={window.navigator.languages as string[]}
40-
>
38+
<LocaleContextProvider locales={window.navigator.languages as string[]}>
4139
<RemixStub initialEntries={["/"]} />
4240
</LocaleContextProvider>
4341
</OperatingSystemContextProvider>

apps/webapp/app/assets/icons/DynamicTriggerIcon.tsx

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
export function DynamicTriggerIcon({ className }: { className?: string }) {
22
return (
3-
<svg
4-
viewBox="0 0 21 21"
5-
fill="none"
6-
xmlns="http://www.w3.org/2000/svg"
7-
className={className}
8-
>
3+
<svg viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg" className={className}>
94
<path
105
fillRule="evenodd"
116
clipRule="evenodd"

apps/webapp/app/assets/icons/ErrorIcon.tsx

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
export function ErrorIcon({ className }: { className?: string }) {
22
return (
3-
<svg
4-
className={className}
5-
viewBox="0 0 20 20"
6-
fill="none"
7-
xmlns="http://www.w3.org/2000/svg"
8-
>
3+
<svg className={className} viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
94
<circle cx="10" cy="10" r="7" fill="white" />
105
<path
116
fillRule="evenodd"

apps/webapp/app/assets/icons/WebhookIcon.tsx

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
export function WebhookIcon({ className }: { className?: string }) {
22
return (
3-
<svg
4-
className={className}
5-
viewBox="0 0 190 180"
6-
fill="none"
7-
xmlns="http://www.w3.org/2000/svg"
8-
>
3+
<svg className={className} viewBox="0 0 190 180" fill="none" xmlns="http://www.w3.org/2000/svg">
94
<path
105
fill="currentColor"
116
fillRule="evenodd"

apps/webapp/app/components/ComingSoon.tsx

+1-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ export function ComingSoon({ title, description, icon }: ComingSoonProps) {
1616
<div className="flex flex-col justify-center rounded border border-slate-800 bg-slate-850">
1717
<div className="flex items-center gap-2 border-b border-slate-750 px-4 py-4">
1818
{typeof icon === "string" ? (
19-
<NamedIconInBox
20-
name={icon}
21-
className={"h-10 w-10 bg-midnight-800"}
22-
/>
19+
<NamedIconInBox name={icon} className={"h-10 w-10 bg-midnight-800"} />
2320
) : (
2421
icon
2522
)}

apps/webapp/app/components/ErrorDisplay.tsx

+3-12
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,14 @@ export function RouteErrorDisplay(options?: ErrorDisplayOptions) {
1919
<ErrorDisplay
2020
title={friendlyErrorDisplay(error.status, error.statusText).title}
2121
message={
22-
error.data.message ??
23-
friendlyErrorDisplay(error.status, error.statusText).message
22+
error.data.message ?? friendlyErrorDisplay(error.status, error.statusText).message
2423
}
2524
{...options}
2625
/>
2726
) : error instanceof Error ? (
2827
<ErrorDisplay title={error.name} message={error.message} {...options} />
2928
) : (
30-
<ErrorDisplay
31-
title="Oops"
32-
message={JSON.stringify(error)}
33-
{...options}
34-
/>
29+
<ErrorDisplay title="Oops" message={JSON.stringify(error)} {...options} />
3530
)}
3631
</>
3732
);
@@ -47,11 +42,7 @@ export function ErrorDisplay({ title, message, button }: DisplayOptionsProps) {
4742
<div className="p-4">
4843
<Header1 className="mb-4 border-b border-slate-800 pb-4">{title}</Header1>
4944
{message && <Header3>{message}</Header3>}
50-
<LinkButton
51-
to={button ? button.to : "/"}
52-
variant="primary/medium"
53-
className="mt-8"
54-
>
45+
<LinkButton to={button ? button.to : "/"} variant="primary/medium" className="mt-8">
5546
{button ? button.title : "Home"}
5647
</LinkButton>
5748
</div>

0 commit comments

Comments
 (0)