Skip to content

Commit

Permalink
initial drizzle prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
hayes committed Sep 15, 2023
1 parent f4f58bd commit a9f2692
Show file tree
Hide file tree
Showing 36 changed files with 3,149 additions and 9 deletions.
7 changes: 7 additions & 0 deletions packages/plugin-drizzle/.npmignore
@@ -0,0 +1,7 @@
test
tests
.turbo
babel.config.js
jest.config.js
*.tsbuildinfo
tsconfig.*
6 changes: 6 additions & 0 deletions packages/plugin-drizzle/LICENSE
@@ -0,0 +1,6 @@
ISC License (ISC)
Copyright 2021 Michael Hayes

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 changes: 18 additions & 0 deletions packages/plugin-drizzle/README.md
@@ -0,0 +1,18 @@
# Drizzle Plugin

## TODO

- [ ] connections
- [ ] connection helpers
- [ ] query usage checks
- [ ] normalize extras callback functions before merging
- [ ] with input integration
- [ ] errors integration
- [ ] drizzle field methods on builder
- [ ] drizzle refs
- [ ] drizzle interface types
- [ ] tests
- [ ] docs
- [ ] variants
- [ ] default selections for id/data-loading
- [ ] interface check for compatibility of implementors
5 changes: 5 additions & 0 deletions packages/plugin-drizzle/drizzle.config.json
@@ -0,0 +1,5 @@
{
"schema": "./tests/example/db/schema.ts",
"out": "./tests/drizzle",
"connectionString": "file:./tests/example/db/dev.db"
}
4 changes: 4 additions & 0 deletions packages/plugin-drizzle/esm/.gitignore
@@ -0,0 +1,4 @@
*
!.gitignore
!.npmignore
!package.json
Empty file.
3 changes: 3 additions & 0 deletions packages/plugin-drizzle/esm/package.json
@@ -0,0 +1,3 @@
{
"type": "module"
}
6 changes: 6 additions & 0 deletions packages/plugin-drizzle/jest.config.js
@@ -0,0 +1,6 @@
module.exports = {
transformIgnorePatterns: [`node_modules`],
transform: {
'^.+\\.(t|j)sx?$': ['@swc/jest'],
},
};
62 changes: 62 additions & 0 deletions packages/plugin-drizzle/package.json
@@ -0,0 +1,62 @@
{
"name": "@pothos/plugin-drizzle",
"version": "0.0.0",
"description": "A Pothos plugin for drizzle",
"main": "./lib/index.js",
"types": "./dts/index.d.ts",
"module": "./esm/index.js",
"exports": {
"import": {
"default": "./esm/index.js"
},
"require": {
"types": "./dts/index.d.ts",
"default": "./lib/index.js"
}
},
"scripts": {
"type": "tsc --project tsconfig.type.json",
"build": "pnpm build:clean && pnpm build:cjs && pnpm build:dts && pnpm build:esm",
"build:clean": "git clean -dfX esm lib",
"build:cjs": "swc src -d lib --config-file ../../.swcrc -C module.type=commonjs",
"build:esm": "cp -r dts/* esm/ && swc src -d esm --config-file ../../.swcrc -C module.type=es6 && pnpm esm:extensions",
"build:dts": "tsc",
"esm:extensions": "TS_NODE_PROJECT=../../tsconfig.json node -r @swc-node/register ../../scripts/esm-transformer.ts",
"test": "pnpm vitest --run --segfault-retry=3"
},
"repository": {
"type": "git",
"url": "git+https://github.com/hayes/pothos.git",
"directory": "packages/plugin-relay"
},
"author": "Michael Hayes",
"license": "ISC",
"keywords": [
"pothos",
"graphql",
"schema",
"typescript",
"drizzle",
"plugin"
],
"publishConfig": {
"access": "public",
"provenance": true
},
"peerDependencies": {
"@pothos/core": "*",
"graphql": ">=16.4.0"
},
"devDependencies": {
"@pothos/core": "workspace:*",
"@pothos/plugin-scope-auth": "workspace:*",
"@pothos/plugin-relay": "workspace:*",
"@pothos/test-utils": "workspace:*",
"@types/better-sqlite3": "^7.6.4",
"better-sqlite3": "^8.4.0",
"drizzle-kit": "^0.19.13",
"drizzle-orm": "^0.28.5",
"graphql": "16.6.0",
"graphql-tag": "^2.12.6"
}
}

0 comments on commit a9f2692

Please sign in to comment.