-
-
Notifications
You must be signed in to change notification settings - Fork 4
refactor: split shared into packages #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…adjusting exports
…e unused imports across various files
… unused imports across the frontend
… up unused imports in auth and song services
…ture for backend and frontend
…add dependency in package.json
…istency across song components
…an up unused imports in auth, song, and user modules
…g, sounds, and thumbnail packages
…song, and sounds packages to use glob pattern for improved test discovery
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you for working on these changes =)
Some extra things (besides the review comments) we gotta make sure are working before merging:
- Update VSCode workspace file, test running etc. to reflect the new project structure
- Update GitHub Actions to reflect the new project structure
package.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had originally decided to leave build.ts
in the root of the project, as it was depended upon by both the frontend and the backend. With the new project structure, doesn't it belong in one of the different packages we created?
(Adding @nbw/sounds
as the one single global workspace dependency looks a bit weird to me, haha :) )
package.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, could we rename the build commands to use frontend
and backend
too, like the package names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a result of introducing separate packages, first-party package imports have been grouped with third-party ones (see this file as an example). The @nbw/
group should be added as a local package group in ESLint - I'll look up how we can do this again :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following the rest of the project's structure, this file could be moved to the source file's path, and renamed to stats.spec.ts
(as we'll likely add test files for the other modules in there)
packages/song/tsconfig.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid all the repetition, would it be possible to use a shared tsconfig.json
using extends
with these common package configurations?
packages/song/.gitignore
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The separate .gitignore
files may not be necessary, in case the root's package.json
already takes care of them
…Script configuration, color utilities, and user constants
…t new naming conventions and add development scripts
…nsistency across database and user modules
…TANTS across song and seed modules for consistency
… for improved performance and simplicity
…stants from @nbw/config for consistency across modules
…w package structure
…r Node and browser environments
…for Node and browser environments
…nvironments with improved error handling
…nent with NoteQuadTree import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR restructures the monorepo by splitting the original server
, web
, and shared
packages into focused workspace packages and applications. It creates a more modular architecture with separate packages for configuration, database entities, song processing, thumbnail generation, and sound management, while establishing clear dependency relationships between components.
- Splits the monolithic structure into focused packages (
@nbw/config
,@nbw/database
,@nbw/song
,@nbw/thumbnail
,@nbw/sounds
) - Creates dedicated application packages (
@nbw/backend
,@nbw/frontend
) - Updates all import paths throughout the codebase to use the new package structure
Reviewed Changes
Copilot reviewed 124 out of 398 changed files in this pull request and generated 7 comments.
Show a summary per file
File | Description |
---|---|
packages/configs/ | New configuration package with shared constants and types |
packages/database/ | New database package setup with gitignore and eslint config |
apps/frontend/ | Updated frontend with new import paths and package structure |
apps/backend/ | Updated backend with new import paths and dependency references |
package.json | Root package updated with new workspace structure and exports |
build.ts | Updated build script to use new package imports |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
apps/frontend/src/modules/song-upload/components/client/context/UploadSong.context.tsx
Show resolved
Hide resolved
apps/frontend/src/modules/song-edit/components/client/context/EditSong.context.tsx
Show resolved
Hide resolved
…rvice.spec.ts for cleaner code
…or improved project organization
…nhance module functionality
…s, moving frontend to apps/frontend and adding components package
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ons for improved UI aesthetics
…eBlockWorld into feature/node-workspace-setup
This pull request introduces several structural and configuration changes to the whole project, primarily focused on spiting the project
server
,web
andshared
packages into separate@nbw/backend
,@nbw/frontend
,@nbw/database
,@nbw/song
,@nbw/thumbnail
,@nbw/sounds
and@nbw/config
.The following diagram shows the new structure of the project:
Bun and Testing Improvements
Refined test scripts in
package.json
to run tests specifically onsrc/**/*.spec.ts
ande2e/**/*.spec.ts
, improving test targeting and coverage.Added
.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc
to document and enforce the use of Bun over Node.js, npm, pnpm, or vite, including recommendations for APIs, testing, and frontend workflows.