Skip to content

Commit

Permalink
removed unused packages
Browse files Browse the repository at this point in the history
  • Loading branch information
yashpokar committed Mar 29, 2024
1 parent 5ba4ae3 commit bb5fe52
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 152 deletions.
6 changes: 2 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
API_PORT=
API_URL=

UI_PORT=
API_PORT=8000
API_URL=http://localhost:8000
5 changes: 3 additions & 2 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
"author": "Yash Patel <[email protected]>",
"license": "ISC",
"dependencies": {
"core": "workspace:^",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"socket.io": "^4.7.5"
"socket.io": "^4.7.5",
"winston": "^3.13.0"
},
"devDependencies": {
"@types/express": "^4.17.21",
Expand Down
4 changes: 4 additions & 0 deletions apps/api/src/core/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import 'dotenv/config'

export const API_PORT = parseInt(process.env.API_PORT || '3000')
export const API_URL = process.env.API_URL || `http://localhost:${API_PORT}`
9 changes: 8 additions & 1 deletion packages/core/src/logger.ts → apps/api/src/core/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ const logger = winston.createLogger({
level: 'info',
format: winston.format.json(),
defaultMeta: { service: 'api' },
transports: [new winston.transports.Console()]
transports: [
new winston.transports.Console({
format: winston.format.combine(
winston.format.colorize(),
winston.format.simple()
)
})
]
})

export default logger
4 changes: 2 additions & 2 deletions apps/api/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import express from 'express'
import { createServer } from 'node:http'

import { API_PORT, API_URL } from 'core'
import logger from 'core/dist/logger'
import { API_PORT, API_URL } from './core/config'
import logger from './core/logger'

const app = express()
const server = createServer(app)
Expand Down
1 change: 0 additions & 1 deletion apps/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"@headlessui/tailwindcss": "^0.2.0",
"@heroicons/react": "^2.1.3",
"clsx": "^2.1.0",
"dotenv": "^16.4.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"short-unique-id": "^5.0.3"
Expand Down
6 changes: 1 addition & 5 deletions apps/ui/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import 'dotenv/config'

// TODO: refer this from the core package
const port = parseInt(process.env.UI_PORT || '3000')

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
server: {
port
port: 3000
}
})
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"version": "0.0.1",
"description": "The Manas AI",
"scripts": {
"ui:dev": "concurrently \"nx run core:build:watch\" \"nx run ui:dev\"",
"ui:dev": "nx run ui:dev",
"ui:build": "nx run ui:build",
"ui:lint": "nx run ui:lint",
"ui:test": "nx run ui:test",
"api:dev": "concurrently \"nx run core:build:watch\" \"nx run api:dev\"",
"api:dev": "nx run api:dev",
"api:build": "nx run api:build",
"api:lint": "nx run api:lint",
"api:test": "nx run api:test",
"lint": "nx run-many --target=lint --all",
"test": "nx run-many --target=test --all",
"build": "nx run core:build && nx run ui:build && nx run api:build",
"build": "nx run-many --target=build --all",
"prepare": "husky"
},
"lint-staged": {
Expand All @@ -32,7 +32,6 @@
"author": "Yash Patel <[email protected]>",
"license": "ISC",
"devDependencies": {
"concurrently": "^8.2.2",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"nx": "^18.2.1",
Expand Down
23 changes: 0 additions & 23 deletions packages/core/package.json

This file was deleted.

6 changes: 0 additions & 6 deletions packages/core/src/config.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/core/src/index.ts

This file was deleted.

19 changes: 0 additions & 19 deletions packages/core/tsconfig.json

This file was deleted.

Loading

0 comments on commit bb5fe52

Please sign in to comment.