Skip to content

Commit

Permalink
fix: lint issues in app.ts and update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
devin-ai-integration[bot] and trajan0x committed Dec 20, 2024
1 parent 0bb8ea0 commit 7e836c2
Show file tree
Hide file tree
Showing 7 changed files with 578 additions and 25 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"packages": ["packages/*", "packages/rfq-indexer/*", "docs/*"],
"packages": ["packages/*", "packages/rfq-indexer/*", "docs/*", "packages/synapse-constants"],
"version": "independent"
}
2 changes: 1 addition & 1 deletion packages/rest-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"node": ">=18.17.0"
},
"scripts": {
"npm run build": "tsc",
"build": "tsc",
"build:go": " ",
"build:slither": " ",
"dev": "NODE_ENV=development nodemon --watch src --exec ts-node src/app.ts",
Expand Down
26 changes: 15 additions & 11 deletions packages/rest-api/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import express from 'express'
import swaggerUi from 'swagger-ui-express'
import { startPyroscope, initializeTracing, tracingMiddleware } from '@synapsecns/tracing'
import {
startPyroscope,
initializeTracing,
tracingMiddleware,
} from '@synapsecns/tracing'

import { specs } from './swagger'
import routes from './routes'
Expand All @@ -15,23 +19,23 @@ import {
// Initialize tracing
const sdk = initializeTracing({
serviceName: 'rest-api',
version: process.env.VERSION || '0.0.0',
});
version: process.env.VERSION || '0.0.0'

Check warning on line 22 in packages/rest-api/src/app.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `,`

Check warning on line 22 in packages/rest-api/src/app.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `,`
})

// Start pyroscope
startPyroscope({
applicationName: 'rest-api',
serverAddress: process.env.PYROSCOPE_ENDPOINT,
tags: {
version: process.env.VERSION,
},
});
version: process.env.VERSION

Check warning on line 30 in packages/rest-api/src/app.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `,`

Check warning on line 30 in packages/rest-api/src/app.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `,`
}

Check warning on line 31 in packages/rest-api/src/app.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `,`

Check warning on line 31 in packages/rest-api/src/app.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `,`
})

const app = express()
const port = process.env.PORT || 3000

// Add middleware
app.use(tracingMiddleware());
app.use(tracingMiddleware())

app.use((req, res, next) => {
res.setHeader('Access-Control-Allow-Origin', '*')
Expand Down Expand Up @@ -135,7 +139,7 @@ process.on('SIGTERM', () => {
sdk.shutdown()

Check warning on line 139 in packages/rest-api/src/app.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `⏎····`

Check warning on line 139 in packages/rest-api/src/app.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `⏎····`
.then(() => process.exit(0))
.catch((error) => {
console.log('Error shutting down SDK', error);
process.exit(1);
});
});
console.log('Error shutting down SDK', error)
process.exit(1)
})
})
1 change: 1 addition & 0 deletions packages/synapse-constants/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"lint:fix": "npm run lint -- --fix",
"lint:check": "eslint . --max-warnings=0 --config .eslintrc.cjs",
"prepare": "rollup -c --bundleConfigAsCjs",
"prepack": "yarn build",
"build": "rollup -c --bundleConfigAsCjs",
"preinstall": "command -v rollup >/dev/null 2>&1 && rollup -c --buildConfigAsCjs || echo 'rollup not found'",
"prepublish": "yarn build",
Expand Down
2 changes: 1 addition & 1 deletion packages/tracing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"build": "rollup -c --bundleConfigAsCjs",
"prepublish": "yarn build",
"lint:check": "eslint . --max-warnings=0",
"ci:lint": "npm run lint:check",
"ci:lint": "yarn lint:check",
"test:coverage": "echo 'No tests defined.'"
},
"dependencies": {
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
"experimentalDecorators": true,
"typeRoots": [
"node_modules/@types"
]
],
"paths": {
"@synapsecns/*": ["./packages/*/src"]
}
},
"exclude": [
"node_modules",
Expand Down
Loading

0 comments on commit 7e836c2

Please sign in to comment.