Skip to content

Commit

Permalink
GroqD 1.0 - Docs (#302)
Browse files Browse the repository at this point in the history
* fix(docs): added sample dataset types

* fix(docs): refactored "playground" module to external file

* fix(docs): added error handling to `require` method

* fix(docs): improved TS config

* fix(arcade): support `groq-builder-playground`

* Docs: updated README (#291)

* docs: duplicated the `README.md` from the root to the package

* docs: changeset

---------

Co-authored-by: scottrippey <scott.william.rippey@gmail.com>

* Version Packages (#292)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* groq-builder: support sanity typegen output (#293)

* docs: duplicated the `README.md` from the root to the package

* fix(sanity typegen): made generated types have optional reference symbols, to match sanity typegen

* fix(sanity typegen): added support for optional reference symbols

* fix(sanity typegen): changeset

* fix(sanity typegen): added "real" generated types

* fix(sanity typegen): added "real" generated types with --enforce-required-fields

* fix(sanity typegen): renamed old generated types

* fix(sanity typegen): updated all tests with new generated types

* fix(sanity typegen): updated changelog

* fix(docs): Hide details for "What is GROQ"

* fix(docs): added mention of "GroqD"

* fix(docs): allow easier configuration by manually filtering non-documents

* fix(docs): updated documentation around Sanity Schema Configuration

* fix(docs): updated documentation around Sanity Schema Configuration

* fix(docs): minor wording improvements

* fix(docs): removed unused ExtractDocumentTypes

* fix(docs): improved jsdocs for `createGroqBuilder`

---------

Co-authored-by: scottrippey <scott.william.rippey@gmail.com>

* Version Packages (#297)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix(arcade): refactored `extraLibs` extraction

* fix(arcade): removed unused code

* fix(arcade): generate .d.ts files for all playground files

* fix(arcade): improved docs for gather-types

* fix(arcade): improved error handling

* fix(arcade): runQuery supports GroqBuilder

* chore(typescript): improved the way we define the SchemaConfig to simplify TS messaging

* chore(typescript): improved the way we define the SchemaConfig to simplify TS messaging

* chore(typescript): improved error messages for runQuery

* chore(typescript): update Monaco to latest

* chore(typescript): added type-fest to build

* fix(arcade): improved examples with `deref` and validation

* docs: updated introduction

* docs: added usage example

* chore(typescript): simplify config by passing all `schemaTypes`

* docs: removed unused script

* docs: added configuration docs

* docs: Improved configuration content

* docs: improved introduction examples

* docs: improved configuration

* feat(fragment): added `fragmentForType` method, and improved error reporting for fragments

* docs: minor jsdoc improvements

* docs: changed "intro" to "overview"

* docs: api: organized outline of doc

* docs: api: added docs for `filterByType`

* docs: api: added docs for `slice`

* docs: api: added docs for `project`

* docs: api: added docs for `raw/params/validate/nullable/deref`

* docs: api: added docs for `zod` and `transform`

* docs: api: improved generated types for zod

* docs: api: removed `q.nullToUndefined` helper, in favor of simply `q.default`

* docs: api: fixed tests from zod type refactor

* docs: api: include `zod.literal`

* docs: api: updated tests and samples to new `schemaTypes`

* docs: api: docs for Zod Extras

* docs: api: reorder docs

* docs: api: updated advanced links

* docs: api: reordered all docs

* docs: api: split API docs into multiple files

* docs: api: added `Query Parameters` docs

* docs: api: added `Validation` docs

* docs: api: reorganized the `raw` docs

* docs: fragments: documented "creating fragments"

* docs: fragments: documented "fragment usage"

* docs: projection: "ellipsis operator"

* docs: conditionals: improved `_type` typings

* docs: conditionals: added test for "overlapping conditionals"

* docs: conditionals: ensure vitest is testing! yikes

* docs: conditionals: "inline conditionals"

* docs: conditionals: added "select" docs

* docs: conditionals: added inline docs

* docs: removed obsolete `fragments` docs

* docs: updated "migration" docs

* docs: removed legacy docs

* docs: lint fix

* docs: do not commit generated .d.ts files

* docs: lint fix

* docs: update dependencies

* docs: dedupe dependencies

* docs: upgrade docusaurus

* docs: ignore TS warnings

* docs: ignore generated files

---------

Co-authored-by: scottrippey <scott.william.rippey@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored Dec 18, 2024
1 parent cdb4acb commit 112d8d4
Show file tree
Hide file tree
Showing 82 changed files with 14,300 additions and 12,581 deletions.
19 changes: 16 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "prettier"],
"extends": ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
"plugins": [
"@typescript-eslint",
"prettier"
],
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
Expand All @@ -15,5 +21,12 @@
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/no-var-requires": "off"
},
"ignorePatterns": ["**/dist/**/*", "**/build/**/*", "**/node_modules/**/*", "**/public/**/*", "**/.docusaurus/**/*"]
"ignorePatterns": [
"**/dist/**/*",
"**/build/**/*",
"**/node_modules/**/*",
"**/public/**/*",
"**/.docusaurus/**/*",
"website/src/arcade/**/*.d.ts"
]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.8.4",
"typescript": "^4.9.5",
"monaco-editor": "^0.37.1"
"monaco-editor": "^0.50.0"
}
}
12 changes: 11 additions & 1 deletion packages/groq-builder/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"rules": {
"@typescript-eslint/no-explicit-any": "off"
"@typescript-eslint/no-explicit-any": "off",

"@typescript-eslint/no-unused-vars": [
"error", // or "error"
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_",
}
]

}
}
14 changes: 6 additions & 8 deletions packages/groq-builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,14 @@ In your application, you can create a strongly-typed `groq-builder` using the fo

```ts
// ./q.ts
import { createGroqBuilder } from 'groq-builder';
import {
AllSanitySchemaTypes,
internalGroqTypeReferenceTo,
} from "./sanity.types.ts";
import { createGroqBuilder, ExtractDocumentTypes } from 'groq-builder';
import { AllSanitySchemaTypes, internalGroqTypeReferenceTo } from "./sanity.types.ts";

export const q = createGroqBuilder<{
documentTypes: AllSanitySchemaTypes,
type SchemaConfig = {
documentTypes: ExtractDocumentTypes<AllSanitySchemaTypes>;
referenceSymbol: typeof internalGroqTypeReferenceTo;
}>();
};
export const q = createGroqBuilder<SchemaConfig>();
```

And that's it! Wherever you write queries, be sure to import this strongly-typed `q` and you'll get full auto-completion and type-safety!
Expand Down
131 changes: 0 additions & 131 deletions packages/groq-builder/docs/CONDITIONALS.md

This file was deleted.

76 changes: 0 additions & 76 deletions packages/groq-builder/docs/FRAGMENTS.md

This file was deleted.

Loading

0 comments on commit 112d8d4

Please sign in to comment.