Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f61524b
refactor: update ESLint configuration to use TypeScript ESLint and in…
tomast1337 Sep 24, 2025
64847d4
lint
tomast1337 Sep 24, 2025
3527592
chore: simplify lint scripts in package.json for improved maintainabi…
tomast1337 Sep 24, 2025
28b4e4f
chore: integrate @stylistic/eslint-plugin and update ESLint configura…
tomast1337 Sep 24, 2025
ea0dc10
lint commit
tomast1337 Sep 24, 2025
8a10859
lint commit
tomast1337 Sep 24, 2025
d367a4b
chore: update dependencies in package.json and bun.lock, add TypeScri…
tomast1337 Sep 24, 2025
ed45576
Lint fixes
tomast1337 Sep 24, 2025
fd2d4a7
test fixes
tomast1337 Sep 24, 2025
2d1301b
chore: update ESLint configuration to enforce 4-space indentation by …
tomast1337 Sep 24, 2025
649e94f
linting
tomast1337 Sep 24, 2025
58cf32e
refactor: remove unnecessary type assertions in service files and imp…
tomast1337 Sep 24, 2025
eb4b5e7
fix: update Swagger setup path from 'api/doc' to 'docs' in test file
tomast1337 Sep 24, 2025
bd1dd3e
chore: add @types/unidecode dependency and enhance postinstall script…
tomast1337 Sep 24, 2025
0d07788
chore: update GitHub workflows to include environment variables and s…
tomast1337 Sep 24, 2025
0704c54
refactor: reorganize thumbnail constants and update song preview DTO …
tomast1337 Sep 24, 2025
7457253
chore: add configs package to package.json and update build and link …
tomast1337 Sep 24, 2025
98924e1
chore: update ESLint configuration to include React plugin and enhanc…
tomast1337 Sep 25, 2025
98fe383
chore: streamline package build and start scripts in package.json, re…
tomast1337 Sep 26, 2025
54ee6d5
chore: remove workbench color customizations from VS Code settings file
Bentroen Sep 26, 2025
7dee3df
chore: remove @stylistic/eslint-plugin from devDependencies and updat…
tomast1337 Sep 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: bun install

- name: Install dependencies # (assuming your project has dependencies)
run: bun install # You can use npm/yarn/pnpm instead if you prefer
- name: Run linter
run: bun run lint

- name: Check for changes
id: verify-changed-files
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@ on:
jobs:
test:
runs-on: ubuntu-latest
env:
THUMBNAIL_URL: ${{ vars.THUMBNAIL_URL }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies # (assuming your project has dependencies)
run: bun install # You can use npm/yarn/pnpm instead if you prefer

- name: Install dependencies
run: bun install

- name: Run tests
run: bun run test
40 changes: 9 additions & 31 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,10 @@
{
"editor.formatOnSave": true,
"eslint.validate": [
"typescript"
],
"eslint.run": "onType",
"eslint.format.enable": true,
"mdx.server.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#fac977",
"activityBar.background": "#fac977",
"activityBar.foreground": "#15202b",
"activityBar.inactiveForeground": "#15202b99",
"activityBarBadge.background": "#069a62",
"activityBarBadge.foreground": "#e7e7e7",
"commandCenter.border": "#15202b99",
"sash.hoverBorder": "#fac977",
"statusBar.background": "#f8b646",
"statusBar.foreground": "#15202b",
"statusBarItem.hoverBackground": "#f6a315",
"statusBarItem.remoteBackground": "#f8b646",
"statusBarItem.remoteForeground": "#15202b",
"titleBar.activeBackground": "#f8b646",
"titleBar.activeForeground": "#15202b",
"titleBar.inactiveBackground": "#f8b64699",
"titleBar.inactiveForeground": "#15202b99"
},
"peacock.color": "#f8b646"
}
"editor.formatOnSave": true,
"eslint.validate": ["typescript"],
"eslint.run": "onType",
"eslint.format.enable": true,
"mdx.server.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
}
}
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ To install all dependencies, run in the root of the project:
bun install
```

> **Note**: This will automatically build all workspace packages (database, song, thumbnail, sounds) via the `postinstall` hook to ensure proper workspace dependency linking.

---

## Running the Project
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@
"@nbw/sounds": "workspace:*"
},
"devDependencies": {
"@types/bun": "latest",
"@faker-js/faker": "^9.3.0",
"@nestjs/cli": "^10.4.9",
"@nestjs/schematics": "^10.2.3",
"@nestjs/testing": "^10.4.15",
"@types/bcryptjs": "^2.4.6",
"@types/bun": "^1.2.10",
"@types/express": "^4.17.21",
"@types/multer": "^1.4.12",
"@types/node": "^20.17.10",
Expand Down
138 changes: 69 additions & 69 deletions apps/backend/scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,90 +5,90 @@ import { resolve } from 'path';
import { getLatestVersionSoundList } from '@nbw/sounds';

const writeSoundList = async () => {
function writeJSONFile(
dir: string,
fileName: string,
data: Record<string, any> | string[],
) {
const path = resolve(dir, fileName);
const jsonString = JSON.stringify(data, null, 0);
writeFileSync(path, jsonString);
}
function writeJSONFile(
dir: string,
fileName: string,
data: Record<string, any> | string[]
) {
const path = resolve(dir, fileName);
const jsonString = JSON.stringify(data, null, 0);
writeFileSync(path, jsonString);
}

const dataDir = resolve(__dirname, '..', 'public', 'data');
const dataDir = resolve(__dirname, '..', 'public', 'data');

const soundListPath = 'soundList.json';
const soundListPath = 'soundList.json';

// Try to create the output directory if it doesn't exist
try {
mkdirSync(dataDir, { recursive: true });
} catch (err) {
if (err instanceof Error && err.message.includes('EEXIST')) {
console.log('Sound data files already exist; skipping generation.');
process.exit(0);
// Try to create the output directory if it doesn't exist
try {
mkdirSync(dataDir, { recursive: true });
} catch (err) {
if (err instanceof Error && err.message.includes('EEXIST')) {
console.log('Sound data files already exist; skipping generation.');
process.exit(0);
}
}
}

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

if (files.every((file) => existsSync(file))) {
console.log('Sound data files already exist; skipping generation.');
process.exit(0);
}
if (files.every((file) => existsSync(file))) {
console.log('Sound data files already exist; skipping generation.');
process.exit(0);
}

console.log('Generating sound data files...');
console.log('Generating sound data files...');

// Write list of sounds in the latest MC version to a JSON file
// Filter the list to only include sounds that match the chosen patterns
// (defined in the shared/ module)
getLatestVersionSoundList().then((soundList) => {
writeJSONFile(dataDir, soundListPath, soundList);
});
// Write list of sounds in the latest MC version to a JSON file
// Filter the list to only include sounds that match the chosen patterns
// (defined in the shared/ module)
getLatestVersionSoundList().then((soundList) => {
writeJSONFile(dataDir, soundListPath, soundList);
});
};

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

const optionalRequirePackages = [
'class-transformer',
'class-transformer/storage',
'class-validator',
'@nestjs/microservices',
'@nestjs/websockets',
'@fastify/static',
];
const optionalRequirePackages = [
'class-transformer',
'class-transformer/storage',
'class-validator',
'@nestjs/microservices',
'@nestjs/websockets',
'@fastify/static'
];

const result = await Bun.build({
entrypoints: ['./src/main.ts'],
outdir: './dist',
target: 'bun',
minify: false,
sourcemap: 'linked',
external: optionalRequirePackages.filter((pkg) => {
try {
require(pkg);
return false;
} catch (_) {
return true;
}
}),
splitting: true,
});
const result = await Bun.build({
entrypoints: ['./src/main.ts'],
outdir : './dist',
target : 'bun',
minify : false,
sourcemap : 'linked',
external : optionalRequirePackages.filter((pkg) => {
try {
require(pkg);
return false;
} catch (_) {
return true;
}
}),
splitting: true
});

if (!result.success) {
console.log(result.logs[0]);
process.exit(1);
}
if (!result.success) {
console.log(result.logs[0]);
process.exit(1);
}

console.log('Built successfully!');
console.log('Built successfully!');
};

build()
.then(() => {
writeSoundList();
})
.catch((err) => {
console.error(err);
process.exit(1);
});
.then(() => {
writeSoundList();
})
.catch((err) => {
console.error(err);
process.exit(1);
});
Loading