Skip to content

Commit 649e94f

Browse files
committed
linting
1 parent 2d1301b commit 649e94f

File tree

132 files changed

+10114
-10114
lines changed

Some content is hidden

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

132 files changed

+10114
-10114
lines changed

apps/backend/scripts/build.ts

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -5,90 +5,90 @@ import { resolve } from 'path';
55
import { getLatestVersionSoundList } from '@nbw/sounds';
66

77
const writeSoundList = async () => {
8-
function writeJSONFile(
9-
dir: string,
10-
fileName: string,
11-
data: Record<string, any> | string[]
12-
) {
13-
const path = resolve(dir, fileName);
14-
const jsonString = JSON.stringify(data, null, 0);
15-
writeFileSync(path, jsonString);
16-
}
8+
function writeJSONFile(
9+
dir: string,
10+
fileName: string,
11+
data: Record<string, any> | string[]
12+
) {
13+
const path = resolve(dir, fileName);
14+
const jsonString = JSON.stringify(data, null, 0);
15+
writeFileSync(path, jsonString);
16+
}
1717

18-
const dataDir = resolve(__dirname, '..', 'public', 'data');
18+
const dataDir = resolve(__dirname, '..', 'public', 'data');
1919

20-
const soundListPath = 'soundList.json';
20+
const soundListPath = 'soundList.json';
2121

22-
// Try to create the output directory if it doesn't exist
23-
try {
24-
mkdirSync(dataDir, { recursive: true });
25-
} catch (err) {
26-
if (err instanceof Error && err.message.includes('EEXIST')) {
27-
console.log('Sound data files already exist; skipping generation.');
28-
process.exit(0);
22+
// Try to create the output directory if it doesn't exist
23+
try {
24+
mkdirSync(dataDir, { recursive: true });
25+
} catch (err) {
26+
if (err instanceof Error && err.message.includes('EEXIST')) {
27+
console.log('Sound data files already exist; skipping generation.');
28+
process.exit(0);
29+
}
2930
}
30-
}
3131

32-
// If the files already exist, exit early
33-
const files = [soundListPath].map((fileName) => resolve(dataDir, fileName));
32+
// If the files already exist, exit early
33+
const files = [soundListPath].map((fileName) => resolve(dataDir, fileName));
3434

35-
if (files.every((file) => existsSync(file))) {
36-
console.log('Sound data files already exist; skipping generation.');
37-
process.exit(0);
38-
}
35+
if (files.every((file) => existsSync(file))) {
36+
console.log('Sound data files already exist; skipping generation.');
37+
process.exit(0);
38+
}
3939

40-
console.log('Generating sound data files...');
40+
console.log('Generating sound data files...');
4141

42-
// Write list of sounds in the latest MC version to a JSON file
43-
// Filter the list to only include sounds that match the chosen patterns
44-
// (defined in the shared/ module)
45-
getLatestVersionSoundList().then((soundList) => {
46-
writeJSONFile(dataDir, soundListPath, soundList);
47-
});
42+
// Write list of sounds in the latest MC version to a JSON file
43+
// Filter the list to only include sounds that match the chosen patterns
44+
// (defined in the shared/ module)
45+
getLatestVersionSoundList().then((soundList) => {
46+
writeJSONFile(dataDir, soundListPath, soundList);
47+
});
4848
};
4949

5050
const build = async () => {
51-
await Bun.$`rm -rf dist`;
51+
await Bun.$`rm -rf dist`;
5252

53-
const optionalRequirePackages = [
54-
'class-transformer',
55-
'class-transformer/storage',
56-
'class-validator',
57-
'@nestjs/microservices',
58-
'@nestjs/websockets',
59-
'@fastify/static'
60-
];
53+
const optionalRequirePackages = [
54+
'class-transformer',
55+
'class-transformer/storage',
56+
'class-validator',
57+
'@nestjs/microservices',
58+
'@nestjs/websockets',
59+
'@fastify/static'
60+
];
6161

62-
const result = await Bun.build({
63-
entrypoints: ['./src/main.ts'],
64-
outdir : './dist',
65-
target : 'bun',
66-
minify : false,
67-
sourcemap : 'linked',
68-
external : optionalRequirePackages.filter((pkg) => {
69-
try {
70-
require(pkg);
71-
return false;
72-
} catch (_) {
73-
return true;
74-
}
75-
}),
76-
splitting: true
77-
});
62+
const result = await Bun.build({
63+
entrypoints: ['./src/main.ts'],
64+
outdir : './dist',
65+
target : 'bun',
66+
minify : false,
67+
sourcemap : 'linked',
68+
external : optionalRequirePackages.filter((pkg) => {
69+
try {
70+
require(pkg);
71+
return false;
72+
} catch (_) {
73+
return true;
74+
}
75+
}),
76+
splitting: true
77+
});
7878

79-
if (!result.success) {
80-
console.log(result.logs[0]);
81-
process.exit(1);
82-
}
79+
if (!result.success) {
80+
console.log(result.logs[0]);
81+
process.exit(1);
82+
}
8383

84-
console.log('Built successfully!');
84+
console.log('Built successfully!');
8585
};
8686

8787
build()
88-
.then(() => {
89-
writeSoundList();
90-
})
91-
.catch((err) => {
92-
console.error(err);
93-
process.exit(1);
94-
});
88+
.then(() => {
89+
writeSoundList();
90+
})
91+
.catch((err) => {
92+
console.error(err);
93+
process.exit(1);
94+
});

apps/backend/src/app.module.ts

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -18,79 +18,79 @@ import { SongBrowserModule } from './song-browser/song-browser.module';
1818
import { UserModule } from './user/user.module';
1919

2020
@Module({
21-
imports: [
22-
ConfigModule.forRoot({
23-
isGlobal : true,
24-
envFilePath: ['.env.development', '.env.production'],
25-
validate
26-
}),
27-
//DatabaseModule,
28-
MongooseModule.forRootAsync({
29-
imports : [ConfigModule],
30-
inject : [ConfigService],
31-
useFactory: (
32-
configService: ConfigService
33-
): MongooseModuleFactoryOptions => {
34-
const url = configService.getOrThrow<string>('MONGO_URL');
35-
Logger.debug(`Connecting to ${url}`);
21+
imports: [
22+
ConfigModule.forRoot({
23+
isGlobal : true,
24+
envFilePath: ['.env.development', '.env.production'],
25+
validate
26+
}),
27+
//DatabaseModule,
28+
MongooseModule.forRootAsync({
29+
imports : [ConfigModule],
30+
inject : [ConfigService],
31+
useFactory: (
32+
configService: ConfigService
33+
): MongooseModuleFactoryOptions => {
34+
const url = configService.getOrThrow<string>('MONGO_URL');
35+
Logger.debug(`Connecting to ${url}`);
3636

37-
return {
38-
uri : url,
39-
retryAttempts: 10,
40-
retryDelay : 3000
41-
};
42-
}
43-
}),
44-
// Mailing
45-
MailerModule.forRootAsync({
46-
imports : [ConfigModule],
47-
useFactory: (configService: ConfigService) => {
48-
const transport = configService.getOrThrow<string>('MAIL_TRANSPORT');
49-
const from = configService.getOrThrow<string>('MAIL_FROM');
50-
AppModule.logger.debug(`MAIL_TRANSPORT: ${transport}`);
51-
AppModule.logger.debug(`MAIL_FROM: ${from}`);
52-
return {
53-
transport: transport,
54-
defaults : {
55-
from: from
56-
},
57-
template: {
58-
dir : __dirname + '/mailing/templates',
59-
adapter: new HandlebarsAdapter(),
60-
options: {
61-
strict: true
37+
return {
38+
uri : url,
39+
retryAttempts: 10,
40+
retryDelay : 3000
41+
};
6242
}
63-
}
64-
};
65-
},
66-
inject: [ConfigService]
67-
}),
68-
// Throttler
69-
ThrottlerModule.forRoot([
70-
{
71-
ttl : 60,
72-
limit: 256 // 256 requests per minute
73-
}
74-
]),
75-
SongModule,
76-
UserModule,
77-
AuthModule.forRootAsync(),
78-
FileModule.forRootAsync(),
79-
SongBrowserModule,
80-
SeedModule.forRoot(),
81-
EmailLoginModule,
82-
MailingModule
83-
],
84-
controllers: [],
85-
providers : [
86-
ParseTokenPipe,
87-
{
88-
provide : APP_GUARD,
89-
useClass: ThrottlerGuard
90-
}
91-
],
92-
exports: [ParseTokenPipe]
43+
}),
44+
// Mailing
45+
MailerModule.forRootAsync({
46+
imports : [ConfigModule],
47+
useFactory: (configService: ConfigService) => {
48+
const transport = configService.getOrThrow<string>('MAIL_TRANSPORT');
49+
const from = configService.getOrThrow<string>('MAIL_FROM');
50+
AppModule.logger.debug(`MAIL_TRANSPORT: ${transport}`);
51+
AppModule.logger.debug(`MAIL_FROM: ${from}`);
52+
return {
53+
transport: transport,
54+
defaults : {
55+
from: from
56+
},
57+
template: {
58+
dir : __dirname + '/mailing/templates',
59+
adapter: new HandlebarsAdapter(),
60+
options: {
61+
strict: true
62+
}
63+
}
64+
};
65+
},
66+
inject: [ConfigService]
67+
}),
68+
// Throttler
69+
ThrottlerModule.forRoot([
70+
{
71+
ttl : 60,
72+
limit: 256 // 256 requests per minute
73+
}
74+
]),
75+
SongModule,
76+
UserModule,
77+
AuthModule.forRootAsync(),
78+
FileModule.forRootAsync(),
79+
SongBrowserModule,
80+
SeedModule.forRoot(),
81+
EmailLoginModule,
82+
MailingModule
83+
],
84+
controllers: [],
85+
providers : [
86+
ParseTokenPipe,
87+
{
88+
provide : APP_GUARD,
89+
useClass: ThrottlerGuard
90+
}
91+
],
92+
exports: [ParseTokenPipe]
9393
})
9494
export class AppModule {
95-
static readonly logger = new Logger(AppModule.name);
95+
static readonly logger = new Logger(AppModule.name);
9696
}

0 commit comments

Comments
 (0)