Skip to content

Commit

Permalink
feat(server): swap pnpm workspaces for bun workspaces, removal of web…
Browse files Browse the repository at this point in the history
…pack
  • Loading branch information
benpsnyder committed Apr 7, 2024
1 parent 7c9b7c3 commit c098f36
Show file tree
Hide file tree
Showing 442 changed files with 1,726 additions and 68,997 deletions.
22 changes: 16 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ cp .env.example .env
- Install all npm dependencies of the monorepo, you don't have to change directory to the `backend` package. just hit the command on root directory and it will install dependencies of all packages.

```
pnpm install
bun install
```

- Run all required docker containers in the development, we already configured all containers under `docker-compose.yml`.
Expand All @@ -69,13 +69,13 @@ cefa73fe2881 bigcapital-redis "docker-entrypoint.s…" 7 seconds ago Up
- There're some CLI commands we should run before running the server like databaase migration, so we need to build the `server` app first.

```
pnpm run build:server
bun run build:server
```

- Run the database migration for system database.

```
node packages/server/build/commands.js system:migrate:latest
bun packages/server/build/commands/index.js system:migrate:latest
```

And you should get something like that.
Expand All @@ -87,7 +87,7 @@ Batch 1 run: 6 migrations
- Next, start the webapp application.

```
pnpm run dev:server
bun run dev:server
```

**[`^top^`](#)**
Expand All @@ -105,19 +105,29 @@ git clone https://github.com/bigcapital/bigcapital.git && cd bigcaptial
- Install all npm dependencies of the monorepo, you don't have to change directory to the `frontend` package. just hit that command and will install all packages across all application.

```
pnpm install
bun install
```

- Next, start the webapp application.

```
pnpm run dev:webapp
bun run dev:webapp
```

**[`^top^`](#)**

---

## Contribute to Backend & Frontend
- Or develop both the backend and frontend at the same time!

```
bun run dev
```

**[`^top^`](#)**

----
## Code Review

We welcome constructive criticism and feedback on code submitted by contributors. All feedback should be constructive and respectful, and should focus on the code rather than the contributor. Code review may include suggestions for improvement or changes to the code.
Expand Down
2 changes: 2 additions & 0 deletions bunfig.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[install]
peer = true
5 changes: 5 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bun.serve({
fetch(req) {
return new Response("Bun!");
},
});
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"name": "bigcapital-monorepo",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"build": "lerna run build",
"build:server": "lerna run build --scope \"@bigcapital/server\"",
Expand All @@ -18,6 +15,7 @@
"serve:server": "lerna run serve --scope \"@bigcapital/server\"",
"test:e2e": "playwright test"
},
"workspaces": ["packages/*"],
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
Expand All @@ -30,11 +28,18 @@
"@commitlint/config-lerna-scopes": "^17.8.1",
"@faker-js/faker": "^8.4.1",
"@playwright/test": "^1.43.0",
"@types/bcryptjs": "^2.4.6",
"@types/node": "^20.12.5",
"bun": "^1.1.2",
"bun-types": "^1.1.2",
"husky": "^9.0.11",
"lerna": "^8.1.2",
"nx": "^18.2.3"
},
"engines": {
"node": "16.x || 17.x || 18.x || 20.x || 21.x"
},
"dependencies": {
"objection": "^3.1.4"
}
}
Binary file added packages/server/.DS_Store
Binary file not shown.
10 changes: 9 additions & 1 deletion packages/server/biome.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
"$schema": "https://biomejs.dev/schemas/1.6.0/schema.json",
"extends": ["../../biome.json"]
"extends": ["../../biome.json"],
"linter": {
"enabled": true,
"rules": {
"style": {
"useImportType": "error"
}
}
}
}
16 changes: 16 additions & 0 deletions packages/server/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// We need this in order to use @Decorators
// DO NOT CHANGE THE LINE SPACING OF THE IMPORTS
// OR THE LINTER WILL REORDER THEM
import 'reflect-metadata';

import { startServer } from './src/server';

// Additional initializations can go here
console.log('Additional initializations or logic before starting the server.');

// Now explicitly start the server
startServer().then(() => {
console.log('Server started successfully.');
}).catch((error) => {
console.error('Failed to start the server:', error);
});
Loading

0 comments on commit c098f36

Please sign in to comment.