Skip to content

Commit

Permalink
Overhaul datasources, update dependencies, and more (#530)
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] committed Dec 10, 2022
2 parents 3d58a93 + 31902f0 commit 1c3eb66
Show file tree
Hide file tree
Showing 49 changed files with 4,146 additions and 2,934 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[![codecov](https://codecov.io/gh/ProjectXero/dbds/branch/main/graph/badge.svg?token=KIGHDB3D2H)](https://codecov.io/gh/ProjectXero/dbds)

`DBDataSource` (**dbds**) is primarily a lightweight PostgreSQL-backed [`dataSource`]
for [apollo-server]. It also includes a simple CLI utility for generating TypeScript
`DBDataSource` (**dbds**) is primarily a lightweight PostgreSQL-backed data access
object library. It also includes a simple CLI utility for generating TypeScript
types for a PostgreSQL database.

It is built with [dataloader] and [slonik] for simple, out-of-the-box query batching
Expand Down Expand Up @@ -192,8 +192,6 @@ Pull requests, questions, and bug reports are gladly accepted!

MIT License

[apollo-server]: https://www.apollographql.com/docs/apollo-server/
[`datasource`]: https://www.apollographql.com/docs/apollo-server/data/data-sources/
[dataloader]: https://github.com/graphql/dataloader
[slonik]: https://github.com/gajus/slonik
[stop using knex.js]: https://gajus.medium.com/stop-using-knex-js-and-earn-30-bf410349856c
11 changes: 7 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ module.exports = {
'!**/__tests__/**',
'!**/node_modules/**',
],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.test.json',
},
transform: {
'^.+\\.[cm]?ts$': [
'ts-jest',
{
tsconfig: 'tsconfig.test.json',
},
],
},
}
61 changes: 28 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"generation",
"typings",
"graphql",
"apollo-server",
"dataloader",
"dao"
],
Expand Down Expand Up @@ -41,43 +40,39 @@
"prepack": "yarn build"
},
"dependencies": {
"apollo-datasource": "^3.3.1",
"apollo-server-caching": "^3.3.0",
"case": "^1.6.3",
"dataloader": "^2.0.0",
"slonik": "^27.1.0",
"slonik-sql-tag-raw": "^1.1.3",
"yargs": "^17.3.1"
"dataloader": "^2.1.0",
"slonik": "^33.0.4",
"slonik-sql-tag-raw": "^2.0.0",
"yargs": "^17.6.2"
},
"devDependencies": {
"@commitlint/cli": "^16.1.0",
"@commitlint/config-conventional": "^16.0.0",
"@databases/pg-test": "^3.1.1",
"@semantic-release/changelog": "^6.0.1",
"@commitlint/cli": "^17.3.0",
"@commitlint/config-conventional": "^17.3.0",
"@databases/pg-test": "^3.1.2",
"@semantic-release/changelog": "^6.0.2",
"@semantic-release/git": "^10.0.1",
"@types/config": "^0.0.41",
"@types/jest": "^27.4.0",
"@types/node": "^17.0.10",
"@types/yargs": "^17.0.8",
"@typescript-eslint/eslint-plugin": "^5.10.1",
"@typescript-eslint/parser": "^5.10.1",
"config": "^3.3.7",
"eslint": "^8.7.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-jsonc": "^2.0.0",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^7.0.4",
"jest": "^27.4.7",
"pinst": "^2.1.1",
"prettier": "^2.5.1",
"semantic-release": "^19.0.2",
"ts-jest": "^27.1.3",
"ts-node": "^10.4.0",
"typescript": "^4.5.5",
"zod": "^3.14.4"
"@types/config": "^3.3.0",
"@types/jest": "^29.2.4",
"@types/node": "^18.11.12",
"@types/yargs": "^17.0.17",
"@typescript-eslint/eslint-plugin": "^5.46.0",
"@typescript-eslint/parser": "^5.46.0",
"config": "^3.3.8",
"eslint": "^8.29.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jsonc": "^2.5.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.2",
"jest": "^29.3.1",
"pinst": "^3.0.0",
"prettier": "^2.8.1",
"semantic-release": "^19.0.5",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1"
},
"peerDependencies": {
"typescript": ">= 3.9.0",
"zod": "^3.14.4"
"typescript": ">= 4.9.0",
"zod": "^3.20.0-beta"
}
}
2 changes: 1 addition & 1 deletion src/cli/commands/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export const handler = async (
)
}

const schemaInfo = new SchemaInfo(createPool(dbUrl), String(schema))
const schemaInfo = new SchemaInfo(await createPool(dbUrl), String(schema))

const generator = new Generator({
schema: schemaInfo,
Expand Down
Loading

0 comments on commit 1c3eb66

Please sign in to comment.