feat(examples): add example-with-typeorm
This pull request introduces a new typeorm-service package to the official TurboRepo examples. The aim is to demonstrate the implementation of a robust service layer using TypeORM with a custom dependency injection (DI) mechanism. This example is designed to help developers integrate a more structured backend architecture with their existing Next.js applications, leveraging TypeORM for ORM capabilities.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| examples-basic-web | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 27, 2024 2:17pm |
| examples-designsystem-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 27, 2024 2:17pm |
| examples-gatsby-web | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 27, 2024 2:17pm |
| examples-kitchensink-blog | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 27, 2024 2:17pm |
| examples-native-web | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 27, 2024 2:17pm |
| examples-nonmonorepo | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 27, 2024 2:17pm |
| examples-svelte-web | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 27, 2024 2:17pm |
| examples-tailwind-web | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 27, 2024 2:17pm |
| examples-vite-web | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 27, 2024 2:17pm |
| rust-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 27, 2024 2:17pm |
Deployment failed with the following error:
Creating the Deployment Timed Out.
@cgoinglove is attempting to deploy a commit to the Vercel Team on Vercel.
A member of the Team first needs to authorize it.
Hi,
Thank you for your feedback. I have addressed the issues you mentioned:
Fixed the build, test, and lint commands so they now work out of the box. Upgraded Turborepo to version 2 using npx @turbo/codemod upgrade. Please let me know if there are any other changes or improvements needed.
Thank you! @anthonyshew
I'm still seeing a lot of errors when I run turbo test.
I'm still seeing a lot of errors when I run turbo test.
This issue occurs because the example user might not have verified the database connection configuration before running the test code.
To address this, I added a comment in the test code:
/**
*
* If you have correctly configured the database connection information in 'packages/typeorm-service/src/orm-config.ts',
* remove this skipIf statement and run the tests.
*/
const todoService = inject(TodoService);
suite.skipIf(true)("Todo", () => {
let id: Todo["id"];
test("Insert", async () => {
const newTodo = await todoService.add("Hello World");
id = newTodo.id;
expect(newTodo.complete).toBeFalsy();
});
});
Additionally, for example users, I have updated the README to include instructions on entering database connection information and provided a MySQL Dockerfile and execution script.
Thank you for your(@anthonyshew ) comment. I have been waiting for your feedback and appreciate you reaching out.
I'd prefer to have these be unit tests, mocking the database call. Is that something you could do?
Refactor tests to include both unit tests and integration tests for TodoService
- Added unit tests for TodoService using Vitest and mocking TodoRepository
- Ensured each method in TodoService is tested with mocked database calls
- Included integration tests for TodoRepository using TypeORM with SQL.js
- Verified CRUD operations on Todo entity with in-memory SQL.js database
Allow CI Workflow Run
- [x] approve CI run for commit: 3160ecd72e422f745f74bca058f8688ec6169101
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer