Skip to content

Commit cac1d33

Browse files
authored
Nextjs 16 (#667)
* Next 16 * Turned off ignoreBuildErrors
1 parent ea2793b commit cac1d33

File tree

119 files changed

+5314
-2749
lines changed

Some content is hidden

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

119 files changed

+5314
-2749
lines changed

.cursor/rules/basics.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ alwaysApply: true
77
- Command for running script in a workspace: `pnpm --filter <workspace> <command>`.
88
- Command for running tests: `pnpm test`.
99
- The project uses shadcn for building UI so stick to its conventions and design.
10-
- In `apps/web` workspace, create a string first in `apps/web/config/strings.ts` and then import it in the `.tsx` files, instead of using inline strings.
10+
- In `apps/web` workspace, create a string first in `apps/web/ui-config/strings.ts` and then import it in the `.tsx` files, instead of using inline strings.
1111
- When working with forms, always use refs to keep the current state of the form's data and use it to enable/disable the form submit button.

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

apps/docs/src/pages/en/website/blocks.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ You will also see the newly added link on the header itself.
3636
3. Click on the pencil icon against the newly added link to edit it as shown above.
3737
4. Change the label (displayed as text on the header block) and the URL (where the user should be taken upon clicking the label on the header) and click `Done` to save.
3838
![Header edit link](/assets/pages/header-edit-link.png)
39-
</details>
39+
</details>
4040

4141
### [Rich Text](#rich-text)
4242

@@ -61,7 +61,7 @@ You can also use the floating controls to do the same as shown below.
6161
2. Click on the floating `link` button to reveal a popup text input.
6262
3. In the popup text input, enter the URL as shown below.
6363
![Create a hyperlink in rich text block](/assets/pages/rich-text-create-hyperlink.gif)
64-
</details>
64+
</details>
6565

6666
### [Hero](#hero)
6767

@@ -87,7 +87,7 @@ Following is how it looks on a page.
8787
4. In the button action, enter the URL the user should be taken to upon clicking.
8888
a. If the URL is from your own school, use its relative form, i.e., `/courses`.
8989
b. If the URL is from some external website, use the absolute (complete) URL, i.e., `https://website.com/courses`.
90-
</details>
90+
</details>
9191

9292
### [Grid](#grid)
9393

@@ -132,7 +132,7 @@ A grid block comes in handy when you want to show some sort of list, for example
132132
4. In the button action, enter the URL the user should be taken to upon clicking.
133133
a. If the URL is from your own school, use its relative form, i.e., `/courses`.
134134
b. If the URL is from some external website, use the absolute (complete) URL, i.e., `https://website.com/courses`.
135-
</details>
135+
</details>
136136

137137
### [Featured](#featured)
138138

@@ -268,7 +268,7 @@ In the `Design` panel, you can customize:
268268
- Maximum width
269269
- Vertical padding
270270
- Social media links (Facebook, Twitter, Instagram, LinkedIn, YouTube, Discord, GitHub)
271-
</details>
271+
</details>
272272

273273
## [Shared blocks](#shared-blocks)
274274

apps/docs/src/pages/en/website/themes.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -192,30 +192,30 @@ The typography editor lets you customize text styles across your website. These
192192
- Header 3: Smaller titles for subsections
193193
- Header 4: Small titles for minor sections
194194
- Preheader: Introductory text that appears above headers
195-
</details>
195+
</details>
196196

197197
<details>
198198
<summary>Subheaders</summary>
199199

200200
- Subheader 1: Primary subheaders for section introductions
201201
- Subheader 2: Secondary subheaders for supporting text
202-
</details>
202+
</details>
203203

204204
<details>
205205
<summary>Body Text</summary>
206206

207207
- Text 1: Main body text for content
208208
- Text 2: Secondary body text for supporting content
209209
- Caption: Small text for image captions and footnotes
210-
</details>
210+
</details>
211211

212212
<details>
213213
<summary>Interactive Elements</summary>
214214

215215
- Link: Text for clickable links
216216
- Button: Text for buttons and calls-to-action
217217
- Input: Text for form fields and search boxes
218-
</details>
218+
</details>
219219

220220
For each text style, you can customize:
221221

@@ -243,7 +243,7 @@ CourseLit provides a carefully curated selection of professional fonts, organize
243243
- **Mulish**: A geometric sans-serif with a modern feel
244244
- **Nunito**: A well-balanced font with rounded terminals
245245
- **Work Sans**: A clean, modern font with a geometric feel
246-
</details>
246+
</details>
247247

248248
<details>
249249
<summary>Serif Fonts</summary>
@@ -253,7 +253,7 @@ CourseLit provides a carefully curated selection of professional fonts, organize
253253
- **Playfair Display**: An elegant serif font for headings
254254
- **Roboto Slab**: A serif variant of Roboto
255255
- **Source Serif 4**: A serif font designed for digital reading
256-
</details>
256+
</details>
257257

258258
<details>
259259
<summary>Display Fonts</summary>
@@ -264,15 +264,15 @@ CourseLit provides a carefully curated selection of professional fonts, organize
264264
- **Rubik**: A sans-serif with a geometric feel
265265
- **Oswald**: A reworking of the classic style
266266
- **Bebas Neue**: A display font with a strong personality
267-
</details>
267+
</details>
268268

269269
<details>
270270
<summary>Modern Fonts</summary>
271271

272272
- **Lato**: A sans-serif font with a warm feel
273273
- **PT Sans**: A font designed for public use
274274
- **Quicksand**: A display sans-serif with rounded terminals
275-
</details>
275+
</details>
276276

277277
Each font is optimized for web use and includes multiple weights for flexibility in design. All fonts support Latin characters and are carefully selected for their readability and professional appearance.
278278

@@ -290,7 +290,7 @@ The interactives editor allows you to customize the appearance of interactive el
290290
- Shadow effects: From None to 2X Large
291291
- Custom styles: Add your own custom styles using [supported Tailwind classes](#supported-tailwind-classes)
292292
- Disabled state: How the button looks when it can't be clicked
293-
</details>
293+
</details>
294294

295295
<details>
296296
<summary>Link</summary>
@@ -300,7 +300,7 @@ The interactives editor allows you to customize the appearance of interactive el
300300
- Text shadow: Add depth to your links
301301
- Custom styles: Add your own custom styles using [supported Tailwind classes](#supported-tailwind-classes)
302302
- Disabled state: How the link looks when it can't be clicked
303-
</details>
303+
</details>
304304

305305
<details>
306306
<summary>Card</summary>
@@ -309,7 +309,7 @@ The interactives editor allows you to customize the appearance of interactive el
309309
- Border style: Choose from various border styles
310310
- Shadow effects: Add depth to your cards
311311
- Custom styles: Add your own custom styles using [supported Tailwind classes](#supported-tailwind-classes)
312-
</details>
312+
</details>
313313

314314
<details>
315315
<summary>Input</summary>
@@ -320,7 +320,7 @@ The interactives editor allows you to customize the appearance of interactive el
320320
- Shadow effects: Add depth to your input fields
321321
- Custom styles: Add your own custom styles using [supported Tailwind classes](#supported-tailwind-classes)
322322
- Disabled state: How the input looks when it can't be used
323-
</details>
323+
</details>
324324

325325
### 4. Structure
326326

@@ -332,14 +332,14 @@ The structure editor lets you customize the layout of your pages, like section p
332332
<summary>Page</summary>
333333

334334
- Maximum width options: - 2XL (42rem): Compact layout - 3XL (48rem): Standard layout - 4XL (56rem): Wide layout - 5XL (64rem): Extra wide layout - 6XL (72rem): Full width layout
335-
</details>
335+
</details>
336336

337337
<details>
338338
<summary>Section</summary>
339339

340340
- Horizontal padding: Space on the left and right sides (None to 9X Large)
341341
- Vertical padding: Space on the top and bottom (None to 9X Large)
342-
</details>
342+
</details>
343343

344344
## Publishing Changes
345345

@@ -387,7 +387,7 @@ When adding custom styles to interactive elements, you can use the following Tai
387387
- `text-6xl`: 6X large text
388388
- `text-7xl`: 7X large text
389389
- `text-8xl`: 8X large text
390-
</details>
390+
</details>
391391

392392
<details>
393393
<summary>Padding</summary>
@@ -399,7 +399,7 @@ When adding custom styles to interactive elements, you can use the following Tai
399399
#### Horizontal Padding
400400

401401
- `px-4` to `px-20`: Horizontal padding from 1rem to 5rem
402-
</details>
402+
</details>
403403

404404
<details>
405405
<summary>Colors</summary>
@@ -454,7 +454,7 @@ Variants available: `hover`, `disabled`, `dark`
454454
- `ease-out`: Ease out
455455
- `ease-in-out`: Ease in and out
456456
- `ease-linear`: Linear
457-
</details>
457+
</details>
458458

459459
<details>
460460
<summary>Transforms</summary>
@@ -481,7 +481,7 @@ Variants available: `hover`, `disabled`, `dark`
481481
- `scale-110`: 110% scale
482482
- `scale-125`: 125% scale
483483
- `scale-150`: 150% scale
484-
</details>
484+
</details>
485485

486486
<details>
487487
<summary>Shadows</summary>

apps/queue/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@types/nodemailer": "^6.4.8",
3434
"tsconfig": "workspace:^",
3535
"tsup": "^7.2.0",
36-
"typescript": "^5.0.4",
37-
"typescript-eslint": "^7.5.0"
36+
"typescript": "^5.9.3",
37+
"typescript-eslint": "^8.46.4"
3838
}
3939
}
Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
import { Domain as PublicDomain } from "@courselit/common-models";
2-
import mongoose from "mongoose";
2+
import mongoose, { Document, Model } from "mongoose";
33
import SettingsSchema from "./site-info";
44

5-
export interface Domain extends PublicDomain {
6-
_id: mongoose.Types.ObjectId;
7-
}
5+
export type DomainDocument = Document &
6+
PublicDomain & {
7+
_id: mongoose.Types.ObjectId;
8+
incrementEmailCount: () => Promise<DomainDocument>;
9+
};
810

9-
const DomainSchema = new mongoose.Schema<Domain>(
11+
const DomainSchema = new mongoose.Schema<DomainDocument>(
1012
{
1113
name: { type: String, required: true, unique: true },
1214
settings: SettingsSchema,
13-
quota: new mongoose.Schema<Domain["quota"]>({
14-
mail: new mongoose.Schema<Domain["quota"]["mail"]>({
15+
quota: new mongoose.Schema<DomainDocument["quota"]>({
16+
mail: new mongoose.Schema<DomainDocument["quota"]["mail"]>({
1517
daily: { type: Number, default: 0 },
1618
monthly: { type: Number, default: 0 },
1719
dailyCount: { type: Number, default: 0 },
1820
monthlyCount: { type: Number, default: 0 },
19-
lastDailyCountUpdate: { type: Date, default: Date.now },
20-
lastMonthlyCountUpdate: { type: Date, default: Date.now },
21+
lastDailyCountUpdate: { type: Date, default: () => new Date() },
22+
lastMonthlyCountUpdate: {
23+
type: Date,
24+
default: () => new Date(),
25+
},
2126
}),
2227
}),
2328
},
@@ -26,7 +31,9 @@ const DomainSchema = new mongoose.Schema<Domain>(
2631
},
2732
);
2833

29-
DomainSchema.methods.incrementEmailCount = async function () {
34+
DomainSchema.methods.incrementEmailCount = async function (
35+
this: DomainDocument,
36+
) {
3037
const today = new Date().toISOString().split("T")[0];
3138
const thisMonth = new Date().toISOString().slice(0, 7);
3239
const lastDailyUpdate = new Date(this.quota.mail.lastDailyCountUpdate)
@@ -40,17 +47,21 @@ DomainSchema.methods.incrementEmailCount = async function () {
4047
this.quota.mail.dailyCount++;
4148
} else {
4249
this.quota.mail.dailyCount = 1;
43-
this.quota.mail.lastDailyCountUpdate = Date.now();
50+
this.quota.mail.lastDailyCountUpdate = new Date();
4451
}
4552

4653
if (thisMonth === lastMonthlyUpdate) {
4754
this.quota.mail.monthlyCount++;
4855
} else {
4956
this.quota.mail.monthlyCount = 1;
50-
this.quota.mail.lastMonthlyCountUpdate = Date.now();
57+
this.quota.mail.lastMonthlyCountUpdate = new Date();
5158
}
5259

5360
return this.save();
5461
};
5562

56-
export default mongoose.models.Domain || mongoose.model("Domain", DomainSchema);
63+
const DomainModel =
64+
(mongoose.models.Domain as Model<DomainDocument>) ||
65+
mongoose.model<DomainDocument>("Domain", DomainSchema);
66+
67+
export default DomainModel;

apps/queue/src/domain/model/email-template.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import mongoose from "mongoose";
1+
import mongoose, { Model } from "mongoose";
22
import { EmailTemplate as PublicEmailTemplate } from "@courselit/common-models";
33
import { EmailContentSchema } from "@courselit/common-logic";
44

@@ -23,5 +23,8 @@ EmailTemplateSchema.index(
2323
{ unique: true },
2424
);
2525

26-
export default mongoose.models.EmailTemplate ||
27-
mongoose.model("EmailTemplate", EmailTemplateSchema);
26+
const EmailTemplateModel =
27+
(mongoose.models.EmailTemplate as Model<EmailTemplate>) ||
28+
mongoose.model<EmailTemplate>("EmailTemplate", EmailTemplateSchema);
29+
30+
export default EmailTemplateModel;
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { MembershipSchema } from "@courselit/common-logic";
2-
import mongoose from "mongoose";
2+
import mongoose, { Model } from "mongoose";
33

4-
export default mongoose.models.Membership ||
4+
const MembershipModel =
5+
(mongoose.models.Membership as Model<any>) ||
56
mongoose.model("Membership", MembershipSchema);
7+
8+
export default MembershipModel;

apps/queue/src/domain/model/ongoing-sequence.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import mongoose, { Schema, Document } from "mongoose";
33

44
export type OngoingSequence = OS &
55
Document & {
6-
domain: mongoose.Schema.Types.ObjectId;
6+
domain: mongoose.Types.ObjectId;
77
};
88

99
const OngoingSequenceSchema: Schema = new Schema<OngoingSequence>(
@@ -22,5 +22,8 @@ const OngoingSequenceSchema: Schema = new Schema<OngoingSequence>(
2222

2323
OngoingSequenceSchema.index({ sequenceId: 1, userId: 1 }, { unique: true });
2424

25-
export default mongoose.models.OngoingSequence ||
26-
mongoose.model("OngoingSequence", OngoingSequenceSchema);
25+
const OngoingSequenceModel =
26+
(mongoose.models.OngoingSequence as mongoose.Model<OngoingSequence>) ||
27+
mongoose.model<OngoingSequence>("OngoingSequence", OngoingSequenceSchema);
28+
29+
export default OngoingSequenceModel;
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
import mongoose from "mongoose";
1+
import mongoose, { Model } from "mongoose";
22
import { RuleSchema } from "@courselit/common-logic";
3-
export default mongoose.models.Rule || mongoose.model("Rule", RuleSchema);
3+
4+
const RuleModel =
5+
(mongoose.models.Rule as Model<any>) || mongoose.model("Rule", RuleSchema);
6+
7+
export default RuleModel;

0 commit comments

Comments
 (0)