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

Jsdoc ify the library #35

Merged
merged 44 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
f36ef6c
move src/index.ts to src/index.js
FroggyPanda Feb 16, 2024
951528c
move src/generate.ts to src/generate.js
FroggyPanda Feb 16, 2024
efd0df3
convert src/generate.js to jsdoc
FroggyPanda Feb 16, 2024
8665eac
move src/utils/toPascalCase.ts to src/utils/toPascalCase.js
FroggyPanda Feb 16, 2024
649e0ea
convert src/utils/toPascalCase.js to jsdoc
FroggyPanda Feb 16, 2024
66ede98
move src/utils/toCamelCase.ts to src/utils/toCamelCase.js
FroggyPanda Feb 16, 2024
927a5c7
convert src/utils/toCamelCase.js to jsdoc
FroggyPanda Feb 16, 2024
5f5ad86
move src/utils/prettierFormat.ts to src/utils/prettierFormat.js
FroggyPanda Feb 16, 2024
ef6c7a7
convert src/utils/prettierFormat.js to jsdoc
FroggyPanda Feb 16, 2024
7c82946
move src/utils/getViewsProperties.js to src/utils/getViewsProperties.js
FroggyPanda Feb 16, 2024
0e4364b
conver src/utils/getViewsProperties.js to jsdoc
FroggyPanda Feb 16, 2024
854fe36
move src/utils/getTablesProperties.ts to src/utils/getTablesPropertie…
FroggyPanda Feb 16, 2024
cf1c650
convert src/utils/getTablesProperties.js to jsdoc
FroggyPanda Feb 16, 2024
aed9946
move src/utils/getSchemasProperties.ts to src/utils/getSchemasPropert…
FroggyPanda Feb 16, 2024
34cd33b
convert src/utils/getSchemasProperties.js to jsdoc
FroggyPanda Feb 16, 2024
b39e329
move src/utils/getFunctionProperties.ts to src/utils/getFunctionPrope…
FroggyPanda Feb 16, 2024
b260252
convert src/utils/getFunctionProperties.js to jsdoc
FroggyPanda Feb 16, 2024
4ff9ae7
move src/utils/getEnumsProperties.ts to src/utils/getEnumsProperties.js
FroggyPanda Feb 16, 2024
0667eff
convert src/utils/getEnumsProperties.js to jsdoc
FroggyPanda Feb 16, 2024
4446846
move src/utils/index.ts to src/utils/index.js
FroggyPanda Feb 16, 2024
1e045f6
convert tsconfig.json to help jsdoc
FroggyPanda Feb 16, 2024
48115af
convert package.json to type module
FroggyPanda Feb 16, 2024
fe05a7a
convert imports
FroggyPanda Feb 16, 2024
e7f9b32
add eslint
FroggyPanda Feb 16, 2024
d14e806
housekeeping
FroggyPanda Feb 16, 2024
ba5ce78
sync up pnpm-lock
FroggyPanda Feb 16, 2024
0f1bcf0
fixed github workflow
FroggyPanda Feb 16, 2024
2cc30d2
pump minor version
FroggyPanda Feb 16, 2024
c248e3a
bump minor version
FroggyPanda Feb 16, 2024
5411283
Merge branch 'jsdoc-ify' of https://github.com/FroggyPanda/better-sup…
FroggyPanda Feb 16, 2024
3e6615f
add tsc to linting
FroggyPanda Feb 17, 2024
fdb4a5e
catchup with 2.7.3
FroggyPanda Mar 3, 2024
a51ec21
bump version
FroggyPanda Mar 3, 2024
1b52011
update workflow
FroggyPanda Mar 3, 2024
5d5e4c4
even more workflow stuff
FroggyPanda Mar 3, 2024
7b7192c
get rid of merge confilicts hopefully
FroggyPanda Mar 3, 2024
c6e3c01
delete ts file
FroggyPanda Mar 3, 2024
9ef0c91
Merge branch 'master' into jsdoc-ify
FroggyPanda Mar 15, 2024
37889c6
bump version
FroggyPanda Mar 15, 2024
89e77d1
remove old script
FroggyPanda Mar 15, 2024
b526382
maybe fix workflow
FroggyPanda Mar 16, 2024
d7d074d
add npmignore
FroggyPanda Mar 18, 2024
0fae1ff
make console outputs error
FroggyPanda Mar 18, 2024
3b0970b
fix console output
FroggyPanda Mar 18, 2024
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
26 changes: 26 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
env: {
browser: false,
node: true,
es2021: true,
},
extends: 'eslint:recommended',
overrides: [
{
env: {
node: true,
},
files: ['.eslintrc.{js}'],
parserOptions: {
sourceType: 'script',
},
},
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
'no-console': 'error',
},
};
23 changes: 19 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: CI
name: main
on:
push:
branches:
- '**'
pull_request:

jobs:
build:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -17,5 +18,19 @@ jobs:
node-version: 16.x
cache: 'pnpm'

- run: pnpm install
- run: pnpm run build
- run: pnpm install --frozen-lockfile
- run: pnpm run format
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'pnpm'

- run: pnpm install --frozen-lockfile
- run: pnpm run lint
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!src/**/*
!README.md
!package.json
16 changes: 8 additions & 8 deletions example/afterSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export type Json =
| { [key: string]: Json | undefined }
| Json[];

export interface Database {
export type Database = {
public: {
Tables: {
todos: {
Expand Down Expand Up @@ -37,7 +37,7 @@ export interface Database {
columns: ['user_id'];
referencedRelation: 'users';
referencedColumns: ['id'];
}
},
];
};
};
Expand All @@ -54,10 +54,10 @@ export interface Database {
[_ in never]: never;
};
};
}
};

//Schema: public
//Tables
export type Todo = Database['public']['Tables']['todos']['Row'];
export type InsertTodo = Database['public']['Tables']['todos']['Insert'];
export type UpdateTodo = Database['public']['Tables']['todos']['Update'];
// Schema: public
// Tables
export type Todos = Database['public']['Tables']['todos']['Row'];
export type InsertTodos = Database['public']['Tables']['todos']['Insert'];
export type UpdateTodos = Database['public']['Tables']['todos']['Update'];
74 changes: 37 additions & 37 deletions example/beforeSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,54 @@ export type Json =
| boolean
| null
| { [key: string]: Json | undefined }
| Json[]
| Json[];

export type Database = {
public: {
Tables: {
todos: {
Row: {
id: number
inserted_at: string
is_complete: boolean | null
task: string | null
user_id: string
}
id: number;
inserted_at: string;
is_complete: boolean | null;
task: string | null;
user_id: string;
};
Insert: {
id?: number
inserted_at?: string
is_complete?: boolean | null
task?: string | null
user_id: string
}
id?: number;
inserted_at?: string;
is_complete?: boolean | null;
task?: string | null;
user_id: string;
};
Update: {
id?: number
inserted_at?: string
is_complete?: boolean | null
task?: string | null
user_id?: string
}
id?: number;
inserted_at?: string;
is_complete?: boolean | null;
task?: string | null;
user_id?: string;
};
Relationships: [
{
foreignKeyName: "todos_user_id_fkey"
columns: ["user_id"]
referencedRelation: "users"
referencedColumns: ["id"]
}
]
}
}
foreignKeyName: 'todos_user_id_fkey';
columns: ['user_id'];
referencedRelation: 'users';
referencedColumns: ['id'];
},
];
};
};
Views: {
[_ in never]: never
}
[_ in never]: never;
};
Functions: {
[_ in never]: never
}
[_ in never]: never;
};
Enums: {
[_ in never]: never
}
[_ in never]: never;
};
CompositeTypes: {
[_ in never]: never
}
}
}
[_ in never]: never;
};
};
};
23 changes: 9 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@
"repository": "FroggyPanda/better-supabase-types",
"bugs": "https://github.com/FroggyPanda/better-supabase-types/issues",
"author": "FroggyPanda",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"main": "src/index.js",
"bin": "src/index.js",
"private": false,
"version": "2.7.4",
"version": "2.7.5",
"license": "MIT",
"type": "module",
"scripts": {
"build": "tsup ./src/index.ts --format cjs,esm --dts",
"lint": "tsc"
},
"bin": {
"better-supabase-types": "./dist/index.js"
"lint": "prettier \"src/**/**.js\" --check && eslint \"src/**/**.js\" && tsc",
"format": "prettier \"src/**/**.js\" --write"
},
"dependencies": {
"chalk": "^4.1.2",
Expand All @@ -29,10 +26,8 @@
"@types/node": "^18.15.13",
"@types/pluralize": "^0.0.29",
"@types/yargs": "^17.0.24",
"nodemon": "^2.0.22",
"ts-node": "^10.9.1",
"tsup": "^6.7.0",
"typescript": "^5.0.4"
"eslint": "^8.56.0",
"typescript": "^5.3.3"
},
"keywords": [
"supabase",
Expand All @@ -41,4 +36,4 @@
"developer-tools",
"automatic"
]
}
}
Loading
Loading