Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up project references #1

Merged
merged 2 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/dist
/node_modules
/build
*.tsbuildinfo

# Logs
logs
Expand Down Expand Up @@ -36,4 +37,4 @@ lerna-debug.log*
.tmp

# EdgeDB Generated
/dbschema/edgeql-js
dbschema/edgeql-js
4 changes: 4 additions & 0 deletions dbschema/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../tsconfig.base.json",
"include": ["edgeql-js/**/*.ts"]
}
16 changes: 15 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
"version": "1.0.0",
"main": "index.js",
"scripts": {
"typecheck": "tsc -b --clean && tsc -b dbschema/tsconfig.json && tsc -b tsconfig.json --extendedDiagnostics",
"db:gen": "npx @edgedb/generate edgeql-js",
"db:init": "edgedb project init --server-instance edgedb_js_mem_test --non-interactive && edgedb configure set listen_addresses 127.0.0.1 ::1 && npm run db:migrate",
"db:migrate": "edgedb migration create && edgedb migrate && npm run db:gen",
"db:init": "edgedb project init --server-instance edgedb_js_mem_test --non-interactive && edgedb configure set listen_addresses 127.0.0.1 ::1 && npm run db:gen",
"db:migrate": "edgedb migration create && edgedb migrate",
"db:destroy": "edgedb instance destroy -I edgedb_js_mem_test --force",
"db:reset": "npm run db:destroy && npm run db:init"
"db:reset": "npm run db:destroy; npm run db:init"
},
"keywords": [],
"author": "",
Expand All @@ -17,6 +18,7 @@
"edgedb": "^1.5.7"
},
"devDependencies": {
"@edgedb/generate": "^0.5.3"
"@edgedb/generate": "^0.5.3",
"typescript": "^5.5.2"
}
}
2 changes: 1 addition & 1 deletion index.ts → src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import e from './dbschema/edgeql-js';
import e from '../dbschema/edgeql-js';
import * as edgedb from 'edgedb';

const query = e.select(e.Exchange, () => ({
Expand Down
7 changes: 7 additions & 0 deletions src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../tsconfig.base.json",
"include": ["**/*.ts"],
"references": [
{ "path": "../dbschema" }
]
}
14 changes: 14 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"rootDir": ".",
"outDir": "./dist",
"composite": true
}
}

15 changes: 5 additions & 10 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
{
"compilerOptions": {
"target": "ES2021", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"module": "commonjs", /* Specify what module code is generated. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
"strict": true, /* Enable all strict type-checking options. */
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
"outDir": "./dist",
"baseUrl": "./",
}
"references": [
{ "path": "./dbschema" },
{ "path": "./src" }
],
"files": []
}