-
-
Notifications
You must be signed in to change notification settings - Fork 3
chore: add nocodb package and update cspell dictionary #200
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
Changes from 3 commits
76c6801
d8efe85
05c6dfd
cbe0c5c
343e42b
243432d
fb01088
740e203
6464044
40f22c8
e215a76
c35d4bf
7bf56dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,7 @@ | |
| "macchiato", | ||
| "manypkg", | ||
| "multipublish", | ||
| "nocodb", | ||
| "nodemon", | ||
| "nvim", | ||
| "nvmrc", | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,28 @@ | ||||||
| # @stephansama/typed-nocodb-api | ||||||
|
|
||||||
| [](https://github.com/stephansama/packages/tree/main/core/typed-nocodb-api) | ||||||
| [](https://packages.stephansama.info/api/@stephansama/typed-nocodb-api) | ||||||
| [](https://www.npmjs.com/package/@stephansama/typed-nocodb-api) | ||||||
| [](https://www.npmjs.com/package/@stephansama/typed-nocodb-api) | ||||||
|
|
||||||
| standard schema compatible nocodb api | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hyphenate compound modifier: "standard-schema-compatible". Per grammar convention, compound adjectives before a noun should be hyphenated. Proposed fix-standard schema compatible nocodb api
+standard-schema-compatible NocoDB API📝 Committable suggestion
Suggested change
🧰 Tools🪛 LanguageTool[grammar] ~8-~8: Use a hyphen to join words. (QB_NEW_EN_HYPHEN) 🤖 Prompt for AI Agents |
||||||
|
|
||||||
| ##### Table of contents | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Heading level skips from h1 to h5 — violates markdownlint MD001. Heading levels should increment by one. Use Proposed fix-##### Table of contents
+## Table of contents🧰 Tools🪛 markdownlint-cli2 (0.20.0)[warning] 10-10: Heading levels should only increment by one level at a time (MD001, heading-increment) 🤖 Prompt for AI Agents |
||||||
|
|
||||||
| <details><summary>Open Table of contents</summary> | ||||||
|
|
||||||
| - [Installation](#installation) | ||||||
| - [Usage](#usage) | ||||||
|
|
||||||
| </details> | ||||||
|
|
||||||
| ## Installation | ||||||
|
|
||||||
| ```sh | ||||||
| pnpm install @stephansama/typed-nocodb-api | ||||||
| ``` | ||||||
|
|
||||||
| ## Usage | ||||||
|
|
||||||
| > \[!CAUTION] | ||||||
| > WIP | ||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,27 @@ | ||||||||||||||||||||||
| // remark-usage-ignore-next | ||||||||||||||||||||||
| /* eslint perfectionist/sort-modules: ["off"] */ | ||||||||||||||||||||||
| // remark-usage-ignore-next | ||||||||||||||||||||||
| /* eslint perfectionist/sort-imports: ["off"] */ | ||||||||||||||||||||||
| // remark-usage-ignore-next | ||||||||||||||||||||||
| import * as z from "zod"; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| import { createApi } from "../dist/index.cjs"; | ||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Importing from This requires the package to be pre-built and couples the example to a specific build output filename. Consider importing from the package name ( 🤖 Prompt for AI Agents |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| const api = createApi({ | ||||||||||||||||||||||
| baseId: process.env.NOCODB_BASE!, | ||||||||||||||||||||||
| origin: "https://nocodb.com", | ||||||||||||||||||||||
| schema: z.object({ | ||||||||||||||||||||||
| column1: z.string(), | ||||||||||||||||||||||
| column2: z.enum(["optionOne", "optionTwo", "optionThree"]), | ||||||||||||||||||||||
| column3: z.number(), | ||||||||||||||||||||||
| column4: z.boolean(), | ||||||||||||||||||||||
| }), | ||||||||||||||||||||||
| tableId: process.env.NOCODB_TABLE!, | ||||||||||||||||||||||
| token: process.env.NOCODB_TOKEN, | ||||||||||||||||||||||
| }); | ||||||||||||||||||||||
|
Comment on lines
+5
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Consider adding guards or defaults: 🛡️ Proposed fix+const baseId = process.env.NOCODB_BASE;
+const tableId = process.env.NOCODB_TABLE;
+const token = process.env.NOCODB_TOKEN;
+
+if (!baseId || !tableId || !token) {
+ throw new Error("NOCODB_BASE, NOCODB_TABLE, and NOCODB_TOKEN environment variables are required");
+}
+
const api = createApi({
- baseId: process.env.NOCODB_BASE,
+ baseId,
origin: "https://nocodb.com",
schema: z.object({
column1: z.string(),
column2: z.enum(["optionOne", "optionTwo", "optionThree"]),
column3: z.number(),
column4: z.boolean(),
}),
- tableId: process.env.NOCODB_TABLE,
- token: process.env.NOCODB_TOKEN,
+ tableId,
+ token,
});🤖 Prompt for AI Agents |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| export function callApi() { | ||||||||||||||||||||||
| api.fetch({ | ||||||||||||||||||||||
| action: "LIST", | ||||||||||||||||||||||
| }); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
Comment on lines
+18
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The promise from ♻️ Proposed fix-export function callApi() {
- api.fetch({
+export async function callApi() {
+ return api.fetch({
action: "LIST",
});
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,49 @@ | ||||||
| { | ||||||
| "name": "@stephansama/typed-nocodb-api", | ||||||
| "version": "0.0.0", | ||||||
| "description": "zod nocodb api", | ||||||
| "keywords": [ | ||||||
| "typed-nocodb-api" | ||||||
| ], | ||||||
| "homepage": "https://packages.stephansama.info/api/@stephansama/typed-nocodb-api", | ||||||
| "repository": { | ||||||
| "type": "git", | ||||||
| "url": "https://github.com/stephansama/packages", | ||||||
| "directory": "core/typed-nocodb-api" | ||||||
| }, | ||||||
| "license": "MIT", | ||||||
| "author": { | ||||||
| "name": "Stephan Randle", | ||||||
| "email": "stephanrandle.dev@gmail.com", | ||||||
| "url": "https://stephansama.info" | ||||||
| }, | ||||||
| "type": "module", | ||||||
| "scripts": { | ||||||
| "build": "tsdown", | ||||||
| "dev": "tsdown --watch", | ||||||
| "lint": "eslint ./ --pass-on-no-patterns --no-error-on-unmatched-pattern" | ||||||
| }, | ||||||
| "dependencies": {}, | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Empty If there are no runtime dependencies, omit the field entirely to reduce noise. Proposed fix- "dependencies": {},
"devDependencies": {📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| "devDependencies": { | ||||||
| "tsdown": "catalog:", | ||||||
| "zod": "catalog:schema" | ||||||
| }, | ||||||
| "peerDependencies": { | ||||||
| "zod": "catalog:schema" | ||||||
| }, | ||||||
| "packageManager": "pnpm@10.11.0", | ||||||
| "publishConfig": { | ||||||
| "access": "public", | ||||||
| "provenance": true | ||||||
| }, | ||||||
| "main": "./dist/index.cjs", | ||||||
| "module": "./dist/index.js", | ||||||
| "types": "./dist/index.d.cts", | ||||||
| "exports": { | ||||||
| ".": { | ||||||
| "import": "./dist/index.js", | ||||||
| "require": "./dist/index.cjs" | ||||||
| }, | ||||||
| "./package.json": "./package.json" | ||||||
| } | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,141 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||
| import * as z from "zod"; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| export const ACTIONS = [ | ||||||||||||||||||||||||||||||||||||||||||||||||
| "LIST", | ||||||||||||||||||||||||||||||||||||||||||||||||
| "CREATE", | ||||||||||||||||||||||||||||||||||||||||||||||||
| "UPDATE", | ||||||||||||||||||||||||||||||||||||||||||||||||
| "DELETE", | ||||||||||||||||||||||||||||||||||||||||||||||||
| "READ", | ||||||||||||||||||||||||||||||||||||||||||||||||
| "COUNT", | ||||||||||||||||||||||||||||||||||||||||||||||||
| ] as const; | ||||||||||||||||||||||||||||||||||||||||||||||||
| export type ACTION = (typeof ACTIONS)[number]; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| export function createApi<Schema extends z.ZodObject>({ | ||||||||||||||||||||||||||||||||||||||||||||||||
| baseId, | ||||||||||||||||||||||||||||||||||||||||||||||||
| origin, | ||||||||||||||||||||||||||||||||||||||||||||||||
| schema, | ||||||||||||||||||||||||||||||||||||||||||||||||
| tableId, | ||||||||||||||||||||||||||||||||||||||||||||||||
| token, | ||||||||||||||||||||||||||||||||||||||||||||||||
| }: { | ||||||||||||||||||||||||||||||||||||||||||||||||
| baseId: string; | ||||||||||||||||||||||||||||||||||||||||||||||||
| origin: string; | ||||||||||||||||||||||||||||||||||||||||||||||||
| schema: Schema; | ||||||||||||||||||||||||||||||||||||||||||||||||
| tableId: string; | ||||||||||||||||||||||||||||||||||||||||||||||||
| token?: string; | ||||||||||||||||||||||||||||||||||||||||||||||||
| }) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| let _token: string | undefined = token; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| const api = { | ||||||||||||||||||||||||||||||||||||||||||||||||
| COUNT: { | ||||||||||||||||||||||||||||||||||||||||||||||||
| method: "get", | ||||||||||||||||||||||||||||||||||||||||||||||||
| responseSchema: z | ||||||||||||||||||||||||||||||||||||||||||||||||
| .object({ count: z.number() }) | ||||||||||||||||||||||||||||||||||||||||||||||||
| .or(z.object({ msg: z.string() })), | ||||||||||||||||||||||||||||||||||||||||||||||||
| url: `/api/v3/data/${baseId}/${tableId}/records`, | ||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||
| CREATE: { | ||||||||||||||||||||||||||||||||||||||||||||||||
| inputSchema: z.object({ fields: schema }), | ||||||||||||||||||||||||||||||||||||||||||||||||
| method: "post", | ||||||||||||||||||||||||||||||||||||||||||||||||
| responseSchema: z.object({ | ||||||||||||||||||||||||||||||||||||||||||||||||
| records: z.array(z.object({ fields: schema, id: z.string() })), | ||||||||||||||||||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||||||||||||||||||
| url: `/api/v3/data/${baseId}/${tableId}/records`, | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+36
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent
The Also applies to: 44-49, 66-66, 70-73, 75-79 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||
| DELETE: { | ||||||||||||||||||||||||||||||||||||||||||||||||
| inputSchema: z.object({ id: z.number() }), | ||||||||||||||||||||||||||||||||||||||||||||||||
| method: "patch", | ||||||||||||||||||||||||||||||||||||||||||||||||
| responseSchema: z.object(), | ||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Proposed fix- responseSchema: z.object(),
+ responseSchema: z.object({}),Apply to both Line 47 (DELETE) and Line 78 (UPDATE). Also applies to: 78-78 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||
| url: `/api/v3/data/${baseId}/${tableId}/records`, | ||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+44
to
+49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DELETE action uses HTTP method This is almost certainly a copy-paste error from UPDATE. The NocoDB v3 delete endpoint expects the DELETE HTTP method. Proposed fix DELETE: {
inputSchema: z.object({ id: z.number() }),
- method: "patch",
+ method: "delete",
responseSchema: z.object(),
url: `/api/v3/data/${baseId}/${tableId}/records`,
},📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||
| LIST: { | ||||||||||||||||||||||||||||||||||||||||||||||||
| method: "get", | ||||||||||||||||||||||||||||||||||||||||||||||||
| querySchema: z.object({ | ||||||||||||||||||||||||||||||||||||||||||||||||
| fields: z.array(z.string()).or(z.string()), | ||||||||||||||||||||||||||||||||||||||||||||||||
| sort: z | ||||||||||||||||||||||||||||||||||||||||||||||||
| .object({ | ||||||||||||||||||||||||||||||||||||||||||||||||
| direction: z.enum(["asc", "desc"]), | ||||||||||||||||||||||||||||||||||||||||||||||||
| field: z.string(), | ||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||
| .transform((input) => JSON.stringify(input)), | ||||||||||||||||||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+50
to
+60
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LIST Both Proposed fix LIST: {
method: "get",
querySchema: z.object({
- fields: z.array(z.string()).or(z.string()),
- sort: z
+ fields: z.array(z.string()).or(z.string()).optional(),
+ sort: z
.object({
direction: z.enum(["asc", "desc"]),
field: z.string(),
})
- .transform((input) => JSON.stringify(input)),
+ .transform((input) => JSON.stringify(input))
+ .optional(),
}),📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||
| responseSchema: z.object({ | ||||||||||||||||||||||||||||||||||||||||||||||||
| nestedNext: z.string().optional().nullable(), | ||||||||||||||||||||||||||||||||||||||||||||||||
| nestedPrev: z.string().optional().nullable(), | ||||||||||||||||||||||||||||||||||||||||||||||||
| next: z.string().optional().nullable(), | ||||||||||||||||||||||||||||||||||||||||||||||||
| prev: z.string().optional().nullable(), | ||||||||||||||||||||||||||||||||||||||||||||||||
| records: z.array(z.object({ fields: schema, id: z.number() })), | ||||||||||||||||||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||||||||||||||||||
| url: `/api/v3/data/${baseId}/${tableId}/records`, | ||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||
| READ: { | ||||||||||||||||||||||||||||||||||||||||||||||||
| method: "get", | ||||||||||||||||||||||||||||||||||||||||||||||||
| responseSchema: z.object({ fields: schema, id: z.number() }), | ||||||||||||||||||||||||||||||||||||||||||||||||
| url: `/api/v3/data/${baseId}/${tableId}/records/{recordId}`, | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+70
to
+73
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. READ action URL contains The URL Consider adding an input for the record ID and interpolating it into the URL at fetch time: Proposed approachAdd an READ: {
+ inputSchema: z.object({ id: z.number() }),
method: "get",
responseSchema: z.object({ fields: schema, id: z.number() }),
- url: `/api/v3/data/${baseId}/${tableId}/records/{recordId}`,
+ url: `/api/v3/data/${baseId}/${tableId}/records`,
},Then in the fetch method, for READ, append the ID to the URL (e.g., 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||
| UPDATE: { | ||||||||||||||||||||||||||||||||||||||||||||||||
| inputSchema: z.object({ fields: schema, id: z.string() }), | ||||||||||||||||||||||||||||||||||||||||||||||||
| method: "patch", | ||||||||||||||||||||||||||||||||||||||||||||||||
| responseSchema: z.object(), | ||||||||||||||||||||||||||||||||||||||||||||||||
| url: `/api/v3/data/${baseId}/${tableId}/records`, | ||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||
| } satisfies Record< | ||||||||||||||||||||||||||||||||||||||||||||||||
| ACTION, | ||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||
| inputSchema?: z.ZodType; | ||||||||||||||||||||||||||||||||||||||||||||||||
| method: "delete" | "get" | "patch" | "post" | "put"; | ||||||||||||||||||||||||||||||||||||||||||||||||
| querySchema?: z.ZodType; | ||||||||||||||||||||||||||||||||||||||||||||||||
| responseSchema: z.ZodType; | ||||||||||||||||||||||||||||||||||||||||||||||||
| url: string; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
| >; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| type API = typeof api; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| return { | ||||||||||||||||||||||||||||||||||||||||||||||||
| async fetch( | ||||||||||||||||||||||||||||||||||||||||||||||||
| props: { | ||||||||||||||||||||||||||||||||||||||||||||||||
| [A in ACTION]: ("inputSchema" extends keyof API[A] | ||||||||||||||||||||||||||||||||||||||||||||||||
| ? { body: z.infer<API[A]["inputSchema"]> } | ||||||||||||||||||||||||||||||||||||||||||||||||
| : {}) & | ||||||||||||||||||||||||||||||||||||||||||||||||
| ("querySchema" extends keyof API[A] | ||||||||||||||||||||||||||||||||||||||||||||||||
| ? { query?: z.infer<API[A]["querySchema"]> } | ||||||||||||||||||||||||||||||||||||||||||||||||
| : {}) & { | ||||||||||||||||||||||||||||||||||||||||||||||||
| action: A; | ||||||||||||||||||||||||||||||||||||||||||||||||
| token?: string; | ||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||
| }[ACTION], | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| const token = (_token ??= props.token); | ||||||||||||||||||||||||||||||||||||||||||||||||
| if (!token) throw new Error("no token provided"); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| const current = api[props.action]; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| const url = new URL(current.url, origin); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| let params = ""; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| if ("query" in props && "querySchema" in current) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| const parsed = current.querySchema.parse(props.query); | ||||||||||||||||||||||||||||||||||||||||||||||||
| params = "?" + new URLSearchParams(parsed).toString(); | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+120
to
+125
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| let body: string | undefined; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| if ("body" in props && "inputSchema" in current) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| body = JSON.stringify(current.inputSchema.parse(props.body)); | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| const response = await fetch(url + params, { | ||||||||||||||||||||||||||||||||||||||||||||||||
| body, | ||||||||||||||||||||||||||||||||||||||||||||||||
| headers: new Headers({ | ||||||||||||||||||||||||||||||||||||||||||||||||
| "accept": "application/json", | ||||||||||||||||||||||||||||||||||||||||||||||||
| "xc-token": token, | ||||||||||||||||||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||||||||||||||||||
| method: current.method, | ||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
coderabbitai[bot] marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| const json = await response.json(); | ||||||||||||||||||||||||||||||||||||||||||||||||
| return current.responseSchema.parse(json); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
coderabbitai[bot] marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "extends": ["../../tsconfig.base.json"], | ||
| "include": ["./src/**/*"] | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,11 @@ | ||||||||||||||||||||||||||||||||||||||||
| import { defineConfig } from "tsdown"; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| export default defineConfig({ | ||||||||||||||||||||||||||||||||||||||||
| attw: true, | ||||||||||||||||||||||||||||||||||||||||
| dts: true, | ||||||||||||||||||||||||||||||||||||||||
| entry: ["src/index.ts"], | ||||||||||||||||||||||||||||||||||||||||
| exports: true, | ||||||||||||||||||||||||||||||||||||||||
| format: ["esm", "cjs"], | ||||||||||||||||||||||||||||||||||||||||
| publint: true, | ||||||||||||||||||||||||||||||||||||||||
| target: "esnext", | ||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Other packages in this repo (e.g., Proposed fix export default defineConfig({
attw: true,
dts: true,
entry: ["src/index.ts"],
exports: true,
format: ["esm", "cjs"],
publint: true,
+ skipNodeModulesBundle: true,
target: "esnext",
});📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "entryPoints": ["src/*"], | ||
| "tsconfig": "./tsconfig.json", | ||
| "exclude": [ | ||
| "**/tests/**", | ||
| "**/*.test.ts", | ||
| "**/*.spec.ts", | ||
| "node_modules", | ||
| "**/{node_modules,test,book,doc,dist}/**/*", | ||
| "**/{pages,components}/**" | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ import pluginPnpm from "eslint-plugin-pnpm"; | |
| import eslintPluginReactHooks from "eslint-plugin-react-hooks"; | ||
| import storybook from "eslint-plugin-storybook"; | ||
| import testingLibrary from "eslint-plugin-testing-library"; | ||
| import eslintPluginZodX from "eslint-plugin-zod-x"; | ||
| import eslintPluginZodX from "eslint-plugin-zod"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major Misleading variable name after plugin swap. The import variable is still named ♻️ Proposed fix-import eslintPluginZodX from "eslint-plugin-zod";
+import eslintPluginZod from "eslint-plugin-zod";Also update the usage on line 49: - eslintPluginZodX.configs.recommended,
+ eslintPluginZod.configs.recommended,🤖 Prompt for AI Agents |
||
| import { defineConfig } from "eslint/config"; | ||
| import globals from "globals"; | ||
| import * as jsoncParser from "jsonc-eslint-parser"; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Package description is vague.
The description
"zod nocodb api"is noticeably less informative than other workspace entries. Consider aligning it with the issue objective, e.g., "Typed API client for NocoDB using Zod". This description likely comes from the package'spackage.jsondescriptionfield and would need to be updated there as the source of truth.🤖 Prompt for AI Agents