Skip to content

Commit 988cdda

Browse files
Update Node.js to v22 LTS (#98)
* Update packages to use native node TS support * Fix db package entrypoint * Remove ts-node from other commands * Remove nodemon and ts-node * Remove dotenv * Set pnpm version to 9.15.4 * Add nvmrc file * Newline * Update Next.js's TS compiler target version * Remove unused expression
1 parent 1a21fcb commit 988cdda

Some content is hidden

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

44 files changed

+203
-326
lines changed

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lts/jod

apps/bot/commands/context/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import * as markAnswer from './mark-answer.js'
1+
import * as markAnswer from './mark-answer.ts'
22

33
export const contextMenuCommands = [markAnswer.command]

apps/bot/commands/context/mark-answer.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ import {
77
ContextMenuCommandBuilder,
88
PermissionFlagsBits,
99
} from 'discord.js'
10-
import { ContextMenuCommand } from '../types.js'
10+
import { type ContextMenuCommand } from '../types.ts'
1111
import {
1212
isMessageInForumChannel,
1313
isMessageSupported,
1414
replyWithEmbed,
1515
replyWithEmbedError,
16-
} from '../../utils.js'
17-
import { markMessageAsSolution } from '../../db/actions/messages.js'
18-
import { env } from '../../env.js'
19-
import { tryToSetRegularMemberRole } from '../../lib/points.js'
16+
} from '../../utils.ts'
17+
import { markMessageAsSolution } from '../../db/actions/messages.ts'
18+
import { env } from '../../env.ts'
19+
import { tryToSetRegularMemberRole } from '../../lib/points.ts'
2020

2121
export const command: ContextMenuCommand = {
2222
data: new ContextMenuCommandBuilder()

apps/bot/commands/slash/add-regular-member-role.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { PermissionFlagsBits, SlashCommandBuilder } from 'discord.js'
2-
import { SlashCommand } from '../types.js'
3-
import { addFullPointsToUser, syncUser } from '../../db/actions/users.js'
4-
import { tryToSetRegularMemberRole } from '../../lib/points.js'
2+
import type { SlashCommand } from '../types.ts'
3+
import { addFullPointsToUser, syncUser } from '../../db/actions/users.ts'
4+
import { tryToSetRegularMemberRole } from '../../lib/points.ts'
55

66
export const command: SlashCommand = {
77
data: new SlashCommandBuilder()

apps/bot/commands/slash/get-answer-count.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { SlashCommandBuilder } from 'discord.js'
2-
import { SlashCommand } from '../types.js'
3-
import { getCorrectAnswersCount } from '../../db/actions/users.js'
2+
import type { SlashCommand } from '../types.ts'
3+
import { getCorrectAnswersCount } from '../../db/actions/users.ts'
44

55
export const command: SlashCommand = {
66
data: new SlashCommandBuilder()

apps/bot/commands/slash/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import * as refreshAnswerCount from './refresh-answer-count.js'
2-
import * as refreshLastActive from './refresh-last-active.js'
3-
import * as lockLowEffortPost from './lock-low-effort-post.js'
4-
import * as removePostAnswer from './remove-post-answer.js'
5-
import * as addRegularMemberRole from './add-regular-member-role.js'
6-
import * as revokeRegularMemberRole from './revoke-regular-member-role.js'
7-
import * as getAnswerCount from './get-answer-count.js'
1+
import * as refreshAnswerCount from './refresh-answer-count.ts'
2+
import * as refreshLastActive from './refresh-last-active.ts'
3+
import * as lockLowEffortPost from './lock-low-effort-post.ts'
4+
import * as removePostAnswer from './remove-post-answer.ts'
5+
import * as addRegularMemberRole from './add-regular-member-role.ts'
6+
import * as revokeRegularMemberRole from './revoke-regular-member-role.ts'
7+
import * as getAnswerCount from './get-answer-count.ts'
88

99
export const slashCommands = [
1010
refreshAnswerCount.command,

apps/bot/commands/slash/lock-low-effort-post.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import {
55
SlashCommandBuilder,
66
} from 'discord.js'
77
import { dedent } from 'ts-dedent'
8-
import { SlashCommand } from '../types.js'
9-
import { replyWithEmbedError } from '../../utils.js'
10-
import { unindexPost } from '../../db/actions/posts.js'
8+
import type { SlashCommand } from '../types.ts'
9+
import { replyWithEmbedError } from '../../utils.ts'
10+
import { unindexPost } from '../../db/actions/posts.ts'
1111

1212
export const command: SlashCommand = {
1313
data: new SlashCommandBuilder()

apps/bot/commands/slash/lock-post.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import {
44
PermissionFlagsBits,
55
SlashCommandBuilder,
66
} from 'discord.js'
7-
import { SlashCommand } from '../types.js'
8-
import { replyWithEmbedError } from '../../utils.js'
9-
import { unindexPost } from '../../db/actions/posts.js'
7+
import type { SlashCommand } from '../types.ts'
8+
import { replyWithEmbedError } from '../../utils.ts'
9+
import { unindexPost } from '../../db/actions/posts.ts'
1010

1111
export const command: SlashCommand = {
1212
data: new SlashCommandBuilder()

apps/bot/commands/slash/refresh-answer-count.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Colors, PermissionFlagsBits, SlashCommandBuilder } from 'discord.js'
2-
import { SlashCommand } from '../types.js'
3-
import { replyWithEmbed } from '../../utils.js'
4-
import { db } from '@nextjs-forum/db/node'
2+
import type { SlashCommand } from '../types.ts'
3+
import { replyWithEmbed } from '../../utils.ts'
4+
import { db } from '@nextjs-forum/db'
55

66
export const command: SlashCommand = {
77
data: new SlashCommandBuilder()

apps/bot/commands/slash/refresh-last-active.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Colors, PermissionFlagsBits, SlashCommandBuilder } from 'discord.js'
2-
import { SlashCommand } from '../types.js'
3-
import { replyWithEmbed } from '../../utils.js'
4-
import { db, sql } from '@nextjs-forum/db/node'
5-
import { baseLog } from '../../log.js'
2+
import type { SlashCommand } from '../types.ts'
3+
import { replyWithEmbed } from '../../utils.ts'
4+
import { db, sql } from '@nextjs-forum/db'
5+
import { baseLog } from '../../log.ts'
66

77
const log = baseLog.extend('refresh-last-active')
88

0 commit comments

Comments
 (0)