@gblikas/querykit 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/.cursor/BUGBOT.md +21 -0
  2. package/.cursor/rules/01-project-structure.mdc +77 -0
  3. package/.cursor/rules/02-typescript-standards.mdc +105 -0
  4. package/.cursor/rules/03-testing-standards.mdc +78 -0
  5. package/.cursor/rules/04-query-language.mdc +79 -0
  6. package/.cursor/rules/05-solid-principles.mdc +118 -0
  7. package/.cursor/rules/liqe-readme-docs.mdc +438 -0
  8. package/.devcontainer/devcontainer.json +25 -0
  9. package/.eslintignore +1 -0
  10. package/.eslintrc.js +39 -0
  11. package/.github/dependabot.yml +12 -0
  12. package/.github/workflows/ci.yml +114 -0
  13. package/.github/workflows/publish.yml +61 -0
  14. package/.husky/pre-commit +30 -0
  15. package/.prettierrc +10 -0
  16. package/CONTRIBUTING.md +187 -0
  17. package/LICENSE +674 -0
  18. package/README.md +237 -0
  19. package/dist/adapters/drizzle/index.d.ts +122 -0
  20. package/dist/adapters/drizzle/index.js +166 -0
  21. package/dist/adapters/index.d.ts +7 -0
  22. package/dist/adapters/index.js +25 -0
  23. package/dist/adapters/types.d.ts +60 -0
  24. package/dist/adapters/types.js +8 -0
  25. package/dist/index.d.ts +75 -0
  26. package/dist/index.js +118 -0
  27. package/dist/parser/index.d.ts +2 -0
  28. package/dist/parser/index.js +18 -0
  29. package/dist/parser/parser.d.ts +51 -0
  30. package/dist/parser/parser.js +201 -0
  31. package/dist/parser/types.d.ts +68 -0
  32. package/dist/parser/types.js +5 -0
  33. package/dist/query/builder.d.ts +61 -0
  34. package/dist/query/builder.js +188 -0
  35. package/dist/query/index.d.ts +2 -0
  36. package/dist/query/index.js +18 -0
  37. package/dist/query/types.d.ts +79 -0
  38. package/dist/query/types.js +2 -0
  39. package/dist/security/index.d.ts +2 -0
  40. package/dist/security/index.js +18 -0
  41. package/dist/security/types.d.ts +181 -0
  42. package/dist/security/types.js +43 -0
  43. package/dist/security/validator.d.ts +191 -0
  44. package/dist/security/validator.js +344 -0
  45. package/dist/translators/drizzle/index.d.ts +73 -0
  46. package/dist/translators/drizzle/index.js +260 -0
  47. package/dist/translators/index.d.ts +8 -0
  48. package/dist/translators/index.js +27 -0
  49. package/dist/translators/sql/index.d.ts +108 -0
  50. package/dist/translators/sql/index.js +252 -0
  51. package/dist/translators/types.d.ts +39 -0
  52. package/dist/translators/types.js +8 -0
  53. package/examples/qk-next/README.md +35 -0
  54. package/examples/qk-next/app/favicon.ico +0 -0
  55. package/examples/qk-next/app/globals.css +122 -0
  56. package/examples/qk-next/app/layout.tsx +121 -0
  57. package/examples/qk-next/app/page.tsx +813 -0
  58. package/examples/qk-next/app/providers.tsx +80 -0
  59. package/examples/qk-next/components/aurora-background.tsx +12 -0
  60. package/examples/qk-next/components/github-stars.tsx +51 -0
  61. package/examples/qk-next/components/mode-toggle.tsx +27 -0
  62. package/examples/qk-next/components/reactbits/blocks/Backgrounds/Aurora/Aurora.tsx +217 -0
  63. package/examples/qk-next/components/reactbits/blocks/Backgrounds/LightRays/LightRays.tsx +474 -0
  64. package/examples/qk-next/components/theme-provider.tsx +11 -0
  65. package/examples/qk-next/components/ui/card.tsx +92 -0
  66. package/examples/qk-next/components/ui/command.tsx +184 -0
  67. package/examples/qk-next/components/ui/dialog.tsx +143 -0
  68. package/examples/qk-next/components/ui/drawer.tsx +135 -0
  69. package/examples/qk-next/components/ui/hover-card.tsx +44 -0
  70. package/examples/qk-next/components/ui/icons.tsx +148 -0
  71. package/examples/qk-next/components/ui/sonner.tsx +26 -0
  72. package/examples/qk-next/components/ui/table.tsx +117 -0
  73. package/examples/qk-next/components.json +21 -0
  74. package/examples/qk-next/eslint.config.mjs +21 -0
  75. package/examples/qk-next/jsrepo.json +13 -0
  76. package/examples/qk-next/lib/utils.ts +6 -0
  77. package/examples/qk-next/next.config.ts +8 -0
  78. package/examples/qk-next/package.json +48 -0
  79. package/examples/qk-next/pnpm-lock.yaml +5558 -0
  80. package/examples/qk-next/postcss.config.mjs +5 -0
  81. package/examples/qk-next/public/file.svg +1 -0
  82. package/examples/qk-next/public/globe.svg +1 -0
  83. package/examples/qk-next/public/next.svg +1 -0
  84. package/examples/qk-next/public/vercel.svg +1 -0
  85. package/examples/qk-next/public/window.svg +1 -0
  86. package/examples/qk-next/tsconfig.json +42 -0
  87. package/examples/qk-next/types/sonner.d.ts +3 -0
  88. package/jest.config.js +26 -0
  89. package/package.json +51 -0
  90. package/src/adapters/drizzle/drizzle-adapter.test.ts +115 -0
  91. package/src/adapters/drizzle/index.ts +299 -0
  92. package/src/adapters/index.ts +11 -0
  93. package/src/adapters/types.ts +72 -0
  94. package/src/index.ts +194 -0
  95. package/src/integration.test.ts +202 -0
  96. package/src/parser/index.ts +2 -0
  97. package/src/parser/parser.test.ts +1056 -0
  98. package/src/parser/parser.ts +268 -0
  99. package/src/parser/types.ts +97 -0
  100. package/src/query/builder.test.ts +272 -0
  101. package/src/query/builder.ts +274 -0
  102. package/src/query/index.ts +2 -0
  103. package/src/query/types.ts +107 -0
  104. package/src/security/index.ts +2 -0
  105. package/src/security/types.ts +210 -0
  106. package/src/security/validator.test.ts +459 -0
  107. package/src/security/validator.ts +395 -0
  108. package/src/security.test.ts +366 -0
  109. package/src/translators/drizzle/drizzle-translator.test.ts +128 -0
  110. package/src/translators/drizzle/index.test.ts +45 -0
  111. package/src/translators/drizzle/index.ts +346 -0
  112. package/src/translators/index.ts +14 -0
  113. package/src/translators/sql/index.test.ts +45 -0
  114. package/src/translators/sql/index.ts +331 -0
  115. package/src/translators/sql/sql-translator.test.ts +419 -0
  116. package/src/translators/types.ts +44 -0
  117. package/src/types/sonner.d.ts +3 -0
  118. package/tsconfig.json +34 -0
@@ -0,0 +1,117 @@
1
+ // @ts-nocheck - This file is not typed
2
+ 'use client';
3
+
4
+ import * as React from 'react';
5
+
6
+ import { cn } from '@/lib/utils';
7
+
8
+ function Table({ className, ...props }: React.ComponentProps<'table'>) {
9
+ return (
10
+ <div
11
+ data-slot="table-container"
12
+ className="relative w-full overflow-x-auto"
13
+ >
14
+ <table
15
+ data-slot="table"
16
+ className={cn('w-full caption-bottom text-sm', className)}
17
+ {...props}
18
+ />
19
+ </div>
20
+ );
21
+ }
22
+
23
+ function TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {
24
+ return (
25
+ <thead
26
+ data-slot="table-header"
27
+ className={cn('[&_tr]:border-b', className)}
28
+ {...props}
29
+ />
30
+ );
31
+ }
32
+
33
+ function TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {
34
+ return (
35
+ <tbody
36
+ data-slot="table-body"
37
+ className={cn('[&_tr:last-child]:border-0', className)}
38
+ {...props}
39
+ />
40
+ );
41
+ }
42
+
43
+ function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {
44
+ return (
45
+ <tfoot
46
+ data-slot="table-footer"
47
+ className={cn(
48
+ 'bg-muted/50 border-t font-medium [&>tr]:last:border-b-0',
49
+ className
50
+ )}
51
+ {...props}
52
+ />
53
+ );
54
+ }
55
+
56
+ function TableRow({ className, ...props }: React.ComponentProps<'tr'>) {
57
+ return (
58
+ <tr
59
+ data-slot="table-row"
60
+ className={cn(
61
+ 'hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors',
62
+ className
63
+ )}
64
+ {...props}
65
+ />
66
+ );
67
+ }
68
+
69
+ function TableHead({ className, ...props }: React.ComponentProps<'th'>) {
70
+ return (
71
+ <th
72
+ data-slot="table-head"
73
+ className={cn(
74
+ 'text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
75
+ className
76
+ )}
77
+ {...props}
78
+ />
79
+ );
80
+ }
81
+
82
+ function TableCell({ className, ...props }: React.ComponentProps<'td'>) {
83
+ return (
84
+ <td
85
+ data-slot="table-cell"
86
+ className={cn(
87
+ 'p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
88
+ className
89
+ )}
90
+ {...props}
91
+ />
92
+ );
93
+ }
94
+
95
+ function TableCaption({
96
+ className,
97
+ ...props
98
+ }: React.ComponentProps<'caption'>) {
99
+ return (
100
+ <caption
101
+ data-slot="table-caption"
102
+ className={cn('text-muted-foreground mt-4 text-sm', className)}
103
+ {...props}
104
+ />
105
+ );
106
+ }
107
+
108
+ export {
109
+ Table,
110
+ TableHeader,
111
+ TableBody,
112
+ TableFooter,
113
+ TableHead,
114
+ TableRow,
115
+ TableCell,
116
+ TableCaption
117
+ };
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema.json",
3
+ "style": "new-york",
4
+ "rsc": true,
5
+ "tsx": true,
6
+ "tailwind": {
7
+ "config": "",
8
+ "css": "app/globals.css",
9
+ "baseColor": "neutral",
10
+ "cssVariables": true,
11
+ "prefix": ""
12
+ },
13
+ "aliases": {
14
+ "components": "@/components",
15
+ "utils": "@/lib/utils",
16
+ "ui": "@/components/ui",
17
+ "lib": "@/lib",
18
+ "hooks": "@/hooks"
19
+ },
20
+ "iconLibrary": "lucide"
21
+ }
@@ -0,0 +1,21 @@
1
+ import { dirname } from "path";
2
+ import { fileURLToPath } from "url";
3
+ import { FlatCompat } from "@eslint/eslintrc";
4
+
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = dirname(__filename);
7
+
8
+ const compat = new FlatCompat({
9
+ baseDirectory: __dirname,
10
+ });
11
+
12
+ const eslintConfig = [
13
+ ...compat.extends("next/core-web-vitals", "next/typescript"),
14
+ {
15
+ ignores: [
16
+ "components/**",
17
+ ],
18
+ },
19
+ ];
20
+
21
+ export default eslintConfig;
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://unpkg.com/jsrepo@2.4.5/schemas/project-config.json",
3
+ "repos": [
4
+ "https://reactbits.dev/ts/tailwind"
5
+ ],
6
+ "includeTests": false,
7
+ "includeDocs": false,
8
+ "watermark": true,
9
+ "configFiles": {},
10
+ "paths": {
11
+ "*": "./components/reactbits/blocks"
12
+ }
13
+ }
@@ -0,0 +1,6 @@
1
+ import { clsx, type ClassValue } from 'clsx';
2
+ import { twMerge } from 'tailwind-merge';
3
+
4
+ export function cn(...inputs: ClassValue[]): string {
5
+ return twMerge(clsx(inputs));
6
+ }
@@ -0,0 +1,8 @@
1
+ import type { NextConfig } from 'next';
2
+
3
+ const nextConfig: NextConfig = {
4
+ swcMinify: false,
5
+ transpilePackages: ['@electric-sql/pglite-react', '@electric-sql/pglite']
6
+ };
7
+
8
+ export default nextConfig;
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "qk-next",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "dev": "next dev --turbopack",
7
+ "build": "next build",
8
+ "start": "next start",
9
+ "lint": "next lint"
10
+ },
11
+ "dependencies": {
12
+ "@electric-sql/pglite": "^0.3.7",
13
+ "@electric-sql/pglite-react": "^0.2.25",
14
+ "@gblikas/querykit": "file:../..",
15
+ "@radix-ui/react-dialog": "^1.1.15",
16
+ "@radix-ui/react-hover-card": "^1.1.15",
17
+ "class-variance-authority": "^0.7.1",
18
+ "clsx": "^2.1.1",
19
+ "cmdk": "^1.0.0",
20
+ "drizzle-orm": "^0.44.4",
21
+ "lucide-react": "^0.539.0",
22
+ "next": "15.4.6",
23
+ "next-themes": "^0.4.6",
24
+ "ogl": "^1.0.11",
25
+ "prism-react-renderer": "^2.4.1",
26
+ "prismjs": "^1.30.0",
27
+ "react": "19.1.0",
28
+ "react-dom": "19.1.0",
29
+ "react-syntax-highlighter": "^15.6.1",
30
+ "sonner": "^2.0.7",
31
+ "tailwind-merge": "^3.3.1",
32
+ "vaul": "^1.1.2"
33
+ },
34
+ "devDependencies": {
35
+ "@eslint/eslintrc": "^3",
36
+ "@tailwindcss/postcss": "^4",
37
+ "@types/node": "^20",
38
+ "@types/react": "^19",
39
+ "@types/react-dom": "^19",
40
+ "@types/react-syntax-highlighter": "^15.5.13",
41
+ "drizzle-kit": "^0.31.4",
42
+ "eslint": "^9",
43
+ "eslint-config-next": "15.4.6",
44
+ "tailwindcss": "^4",
45
+ "tw-animate-css": "^1.3.6",
46
+ "typescript": "^5"
47
+ }
48
+ }