Skip to content
Open
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ jobs:
- name: Run lint
run: npm run lint
- name: Run tests
run: npm test -- --ci --coverage --runInBand
run: npm run test:coverage
- name: Upload test reports
uses: actions/upload-artifact@v4
with:
name: test-reports-${{ matrix.node-version }}
path: test/reports
path: ./junit-report.xml
- name: Upload test coverage
uses: actions/upload-artifact@v4
with:
name: test-coverage-${{ matrix.node-version }}
path: test/coverage
path: coverage
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# npm
/node_modules

# Jest
/test/coverage
/test/reports
# Vitest
/coverage
test/reports/junit.xml

# Build output
/dist
14 changes: 14 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build TypeScript",
"type": "shell",
"command": "tsc",
"args": [],
"isBackground": false,
"problemMatcher": ["$tsc"],
"group": "build"
}
]
}
12 changes: 7 additions & 5 deletions DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ anyone can build their own adapter.
To define a querier, simply extend `QueryQL` with your own class:

```js
const QueryQL = require('@truepic/queryql')
import QueryQL from '@truepic/queryql'

class UserQuerier extends QueryQL {
defineSchema(schema) {
Expand Down Expand Up @@ -115,9 +115,9 @@ These defaults, however, can easily be changed for all querier instances. For
example, to use a different adapter:

```js
const { Config } = require('@truepic/queryql')
import { Config } from '@truepic/queryql'

const MyAdapter = require('./my_adapter')
import MyAdapter from './my_adapter'

Config.defaults = {
adapter: MyAdapter,
Expand All @@ -133,7 +133,7 @@ A config can also be passed as the third argument when creating an instance of a
querier:

```js
const MyAdapter = require('./my_adapter')
import MyAdapter from './my_adapter'

const querier = new UserQuerier(query, builder, {
adapter: MyAdapter,
Expand Down Expand Up @@ -544,7 +544,9 @@ include any additional fields or functions.
`ValidationError` is exported to make it easy to check for an instance of one:

```js
const { ValidationError } = require('@truepic/queryql').errors
import { errors } from '@truepic/queryql'

const { ValidationError } = errors

const querier = new UserQuerier(query, builder)
let users
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ allowed through what we call a _querier_. Here's how one might look for the
`/images` endpoint:

```js
const QueryQL = require('@truepic/queryql')
import QueryQL from '@truepic/queryql'

class ImageQuerier extends QueryQL {
defineSchema(schema) {
Expand Down
25 changes: 0 additions & 25 deletions eslint.config.js

This file was deleted.

28 changes: 28 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import js from '@eslint/js'
import vitest from '@vitest/eslint-plugin'
import ts from 'typescript-eslint'

export default ts.config(
// JS recommended rules (keeps JS files covered)
js.configs.recommended,
ts.configs.recommended,

// Vitest for test files
{
files: [
'src/**/*.test.ts',
'src/**/*.test.tsx',
'src/**/__tests__/**/*.ts',
],
plugins: {
vitest,
},
rules: {
...vitest.configs.recommended.rules,
},
},

{
ignores: ['dist/**', 'node_modules/**', 'coverage/**'],
},
)
13 changes: 0 additions & 13 deletions jest.config.js

This file was deleted.

Loading
Loading