mirror of
https://github.com/theoludwig/kysely-typegen.git
synced 2026-05-22 16:23:25 +02:00
chore: initial commit
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
# https://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
@@ -0,0 +1 @@
|
||||
* text=auto eol=lf
|
||||
@@ -0,0 +1,32 @@
|
||||
name: "ci"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [develop]
|
||||
pull_request:
|
||||
branches: [main, develop]
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
timeout-minutes: 15
|
||||
runs-on: "ubuntu-latest"
|
||||
env:
|
||||
CI: "1"
|
||||
TZ: "Europe/Paris"
|
||||
DO_NOT_TRACK: "1"
|
||||
steps:
|
||||
- uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2
|
||||
|
||||
- name: "Setup Node.js"
|
||||
uses: "actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e" # v6.4.0
|
||||
with:
|
||||
node-version: "24.15.0"
|
||||
cache: "npm"
|
||||
- run: "node --version"
|
||||
|
||||
- run: "npm clean-install"
|
||||
# - run: "node --run lint:typescript" # already covered by oxlint
|
||||
- run: "node --run lint:oxlint"
|
||||
- run: "node --run lint:oxfmt"
|
||||
- run: "node --run test"
|
||||
- run: "node --run build"
|
||||
@@ -0,0 +1,43 @@
|
||||
name: "Release"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
permissions:
|
||||
id-token: "write" # OIDC
|
||||
contents: "read"
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: "ubuntu-latest"
|
||||
permissions:
|
||||
contents: "write"
|
||||
issues: "write"
|
||||
pull-requests: "write"
|
||||
id-token: "write"
|
||||
steps:
|
||||
- uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: "Setup Node.js"
|
||||
uses: "actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e" # v6.4.0
|
||||
with:
|
||||
node-version: "24.15.0"
|
||||
cache: "npm"
|
||||
|
||||
- name: "Install dependencies"
|
||||
run: "npm clean-install"
|
||||
|
||||
- name: "Verify the integrity of provenance attestations and registry signatures for installed dependencies"
|
||||
run: "npm audit signatures"
|
||||
|
||||
- name: "Build"
|
||||
run: "node --run build"
|
||||
|
||||
- name: "Release"
|
||||
run: "node --run release"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
# dependencies
|
||||
node_modules
|
||||
.npm
|
||||
|
||||
# production
|
||||
build
|
||||
dist
|
||||
.swc
|
||||
|
||||
# testing
|
||||
coverage
|
||||
.nyc_output
|
||||
reports
|
||||
.stryker-tmp
|
||||
|
||||
# envs
|
||||
.env
|
||||
.env.production
|
||||
|
||||
# debug
|
||||
npm-debug.log*
|
||||
|
||||
# IDEs and editors
|
||||
/.idea
|
||||
.project
|
||||
.classpath
|
||||
.c9/
|
||||
*.launch
|
||||
.settings/
|
||||
*.sublime-workspace
|
||||
|
||||
# IDE - VSCode
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
|
||||
# misc
|
||||
codegen.ts
|
||||
.DS_Store
|
||||
examples
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"$schema": "./node_modules/oxfmt/configuration_schema.json",
|
||||
"semi": false
|
||||
}
|
||||
+283
@@ -0,0 +1,283 @@
|
||||
{
|
||||
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||
"options": {
|
||||
"typeAware": true,
|
||||
"typeCheck": true,
|
||||
"denyWarnings": true,
|
||||
"reportUnusedDisableDirectives": "error"
|
||||
},
|
||||
"env": {
|
||||
"builtin": true,
|
||||
"browser": true,
|
||||
"node": true,
|
||||
"shared-node-browser": true
|
||||
},
|
||||
"plugins": ["eslint", "typescript", "unicorn", "react", "oxc", "import", "promise"],
|
||||
"categories": {
|
||||
"correctness": "error",
|
||||
"suspicious": "error",
|
||||
"pedantic": "error",
|
||||
"perf": "error"
|
||||
},
|
||||
"rules": {
|
||||
"no-inline-comments": "off",
|
||||
"max-lines": "off",
|
||||
"max-depth": "off",
|
||||
"max-classes-per-file": "off",
|
||||
"max-lines-per-function": "off",
|
||||
"require-await": "off",
|
||||
"no-lonely-if": "off",
|
||||
"array-callback-return": "off",
|
||||
"no-shadow": "off",
|
||||
"consistent-return": "off",
|
||||
|
||||
"getter-return": "error",
|
||||
"no-undef": "error",
|
||||
"no-unreachable": "error",
|
||||
"use-isnan": [
|
||||
"error",
|
||||
{
|
||||
"enforceForSwitchCase": true,
|
||||
"enforceForIndexOf": true
|
||||
}
|
||||
],
|
||||
"valid-typeof": [
|
||||
"error",
|
||||
{
|
||||
"requireStringLiterals": true
|
||||
}
|
||||
],
|
||||
"default-param-last": "error",
|
||||
"default-case-last": "error",
|
||||
"eqeqeq": [
|
||||
"error",
|
||||
"always",
|
||||
{
|
||||
"null": "ignore"
|
||||
}
|
||||
],
|
||||
"grouped-accessor-pairs": "error",
|
||||
"new-cap": [
|
||||
"error",
|
||||
{
|
||||
"newIsCap": true,
|
||||
"capIsNew": false,
|
||||
"properties": true
|
||||
}
|
||||
],
|
||||
"no-implicit-coercion": "error",
|
||||
"no-extra-boolean-cast": [
|
||||
"error",
|
||||
{
|
||||
"enforceForInnerExpressions": true
|
||||
}
|
||||
],
|
||||
"no-empty": [
|
||||
"error",
|
||||
{
|
||||
"allowEmptyCatch": true
|
||||
}
|
||||
],
|
||||
"no-multi-str": "error",
|
||||
"no-new-func": "error",
|
||||
"no-proto": "error",
|
||||
"no-regex-spaces": "error",
|
||||
"no-useless-computed-key": "error",
|
||||
"no-else-return": [
|
||||
"error",
|
||||
{
|
||||
"allowElseIf": false
|
||||
}
|
||||
],
|
||||
"no-var": "error",
|
||||
"no-void": [
|
||||
"error",
|
||||
{
|
||||
"allowAsStatement": true
|
||||
}
|
||||
],
|
||||
"prefer-const": [
|
||||
"error",
|
||||
{
|
||||
"destructuring": "all"
|
||||
}
|
||||
],
|
||||
"prefer-object-has-own": "error",
|
||||
"yoda": "error",
|
||||
"curly": "error",
|
||||
"func-style": "error",
|
||||
"arrow-body-style": ["error", "always"],
|
||||
"object-shorthand": ["error", "properties"],
|
||||
|
||||
"promise/param-names": "error",
|
||||
"promise/no-nesting": "error",
|
||||
|
||||
"unicorn/catch-error-name": "error",
|
||||
"unicorn/consistent-date-clone": "error",
|
||||
"unicorn/error-message": "error",
|
||||
"unicorn/no-array-for-each": "error",
|
||||
"unicorn/no-array-method-this-argument": "error",
|
||||
"unicorn/no-document-cookie": "error",
|
||||
"unicorn/no-zero-fractions": "error",
|
||||
"unicorn/number-literal-case": "error",
|
||||
"unicorn/prefer-node-protocol": "error",
|
||||
"unicorn/throw-new-error": "error",
|
||||
"unicorn/require-array-join-separator": "error",
|
||||
"unicorn/prefer-number-properties": "error",
|
||||
"unicorn/prefer-modern-math-apis": "error",
|
||||
"unicorn/prefer-structured-clone": "error",
|
||||
"unicorn/consistent-existence-index-check": "error",
|
||||
"unicorn/no-array-reverse": "off",
|
||||
"unicorn/no-array-sort": "off",
|
||||
"unicorn/no-lonely-if": "off",
|
||||
"unicorn/prefer-string-replace-all": "off",
|
||||
"unicorn/prefer-at": "off",
|
||||
"unicorn/prefer-query-selector": "off",
|
||||
"unicorn/prefer-top-level-await": "off",
|
||||
"unicorn/prefer-string-slice": "off",
|
||||
"unicorn/no-immediate-mutation": "off",
|
||||
"unicorn/no-useless-undefined": "off",
|
||||
"unicorn/no-object-as-default-parameter": "off",
|
||||
|
||||
"react/no-array-index-key": "off",
|
||||
"react/no-unknown-property": "off",
|
||||
"react/react-in-jsx-scope": "off",
|
||||
"react/iframe-missing-sandbox": "off",
|
||||
"react/self-closing-comp": "error",
|
||||
"react/jsx-boolean-value": "error",
|
||||
"react/jsx-no-target-blank": "off",
|
||||
"react/jsx-no-useless-fragment": "off",
|
||||
|
||||
"import/no-webpack-loader-syntax": "error",
|
||||
"import/export": "error",
|
||||
"import/no-duplicates": "error",
|
||||
"import/no-named-default": "error",
|
||||
"import/no-anonymous-default-export": "error",
|
||||
"import/consistent-type-specifier-style": "error",
|
||||
"import/no-unassigned-import": "off",
|
||||
"import/no-named-as-default-member": "off",
|
||||
"import/max-dependencies": "off",
|
||||
"import/extensions": [
|
||||
"error",
|
||||
"ignorePackages",
|
||||
{
|
||||
"ts": "always",
|
||||
"tsx": "always",
|
||||
"js": "never",
|
||||
"jsx": "never"
|
||||
}
|
||||
],
|
||||
|
||||
"typescript/ban-types": "off",
|
||||
"typescript/no-unnecessary-type-arguments": "off",
|
||||
"typescript/no-unsafe-type-assertion": "off",
|
||||
"typescript/no-unsafe-member-access": "off",
|
||||
"typescript/no-confusing-void-expression": "off",
|
||||
"typescript/no-unsafe-assignment": "off",
|
||||
"typescript/no-misused-promises": "off",
|
||||
"typescript/return-await": ["error", "always"],
|
||||
"typescript/require-await": "off",
|
||||
"typescript/switch-exhaustiveness-check": "off",
|
||||
"typescript/ban-ts-comment": "off",
|
||||
"typescript/prefer-readonly-parameter-types": "off",
|
||||
"typescript/strict-void-return": "off",
|
||||
"no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
"args": "all",
|
||||
"argsIgnorePattern": "^_",
|
||||
"caughtErrors": "all",
|
||||
"caughtErrorsIgnorePattern": "^_",
|
||||
"destructuredArrayIgnorePattern": "^_",
|
||||
"varsIgnorePattern": "^_",
|
||||
"ignoreRestSiblings": true
|
||||
}
|
||||
],
|
||||
"no-use-before-define": [
|
||||
"error",
|
||||
{
|
||||
"functions": false,
|
||||
"classes": false,
|
||||
"enums": false,
|
||||
"variables": false,
|
||||
"typedefs": false
|
||||
}
|
||||
],
|
||||
"no-redeclare": [
|
||||
"error",
|
||||
{
|
||||
"builtinGlobals": false
|
||||
}
|
||||
],
|
||||
"typescript/only-throw-error": "off",
|
||||
"no-unused-expressions": [
|
||||
"error",
|
||||
{
|
||||
"allowShortCircuit": true,
|
||||
"allowTernary": true,
|
||||
"allowTaggedTemplates": true
|
||||
}
|
||||
],
|
||||
"typescript/adjacent-overload-signatures": "error",
|
||||
"typescript/consistent-type-definitions": "error",
|
||||
"typescript/consistent-type-imports": "error",
|
||||
"typescript/explicit-member-accessibility": "error",
|
||||
"typescript/explicit-function-return-type": [
|
||||
"error",
|
||||
{
|
||||
"allowExpressions": true,
|
||||
"allowHigherOrderFunctions": true,
|
||||
"allowTypedFunctionExpressions": true,
|
||||
"allowDirectConstAssertionInArrowFunctions": true
|
||||
}
|
||||
],
|
||||
"typescript/no-extraneous-class": [
|
||||
"error",
|
||||
{
|
||||
"allowWithDecorator": true
|
||||
}
|
||||
],
|
||||
"typescript/no-floating-promises": [
|
||||
"error",
|
||||
{
|
||||
"allowForKnownSafeCalls": [
|
||||
{
|
||||
"from": "package",
|
||||
"name": ["test", "it", "suite", "describe"],
|
||||
"package": "node:test"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"typescript/no-non-null-assertion": "error",
|
||||
"typescript/no-this-alias": "error",
|
||||
"typescript/no-require-imports": "error",
|
||||
"typescript/prefer-function-type": "error",
|
||||
"typescript/prefer-find": "error",
|
||||
"typescript/prefer-nullish-coalescing": "off",
|
||||
"typescript/prefer-readonly": "error",
|
||||
"typescript/prefer-reduce-type-parameter": "error",
|
||||
"typescript/prefer-return-this-type": "error",
|
||||
"typescript/promise-function-async": "error",
|
||||
"typescript/require-array-sort-compare": "error",
|
||||
"typescript/restrict-plus-operands": [
|
||||
"error",
|
||||
{
|
||||
"skipCompoundAssignments": true
|
||||
}
|
||||
],
|
||||
"typescript/restrict-template-expressions": "error",
|
||||
"typescript/strict-boolean-expressions": [
|
||||
"error",
|
||||
{
|
||||
"allowString": false,
|
||||
"allowNumber": false,
|
||||
"allowNullableObject": false,
|
||||
"allowNullableBoolean": false,
|
||||
"allowNullableString": false,
|
||||
"allowNullableNumber": false,
|
||||
"allowAny": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"branches": ["main", { "name": "beta", "prerelease": true }],
|
||||
"plugins": [
|
||||
"@semantic-release/commit-analyzer",
|
||||
"@semantic-release/release-notes-generator",
|
||||
"@semantic-release/npm",
|
||||
"@semantic-release/github"
|
||||
]
|
||||
}
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"js/ts.tsdk.path": "node_modules/typescript/lib",
|
||||
"oxc.enable": true,
|
||||
"editor.defaultFormatter": "oxc.oxc-vscode",
|
||||
"editor.formatOnSave": true,
|
||||
"editor.bracketPairColorization.enabled": true,
|
||||
"editor.wordWrap": "on",
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll": "explicit",
|
||||
"source.organizeImports": "never"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
# MIT License
|
||||
|
||||
Copyright (c) Théo LUDWIG <contact@theoludwig.fr>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
Generated
+9495
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"name": "kysely-typegen",
|
||||
"version": "0.0.0-development",
|
||||
"description": "Generate Kysely type definitions from your database.",
|
||||
"keywords": [
|
||||
"kysely"
|
||||
],
|
||||
"homepage": "https://github.com/theoludwig/kysely-typegen#readme",
|
||||
"bugs": {
|
||||
"url": "https://github.com/theoludwig/kysely-typegen/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"author": "Théo LUDWIG <contact@theoludwig.fr>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/theoludwig/kysely-typegen.git"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"type": "module",
|
||||
"types": "./dist/index.d.mts",
|
||||
"exports": {
|
||||
".": "./dist/index.mjs",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"provenance": true
|
||||
},
|
||||
"scripts": {
|
||||
"lint:typescript": "tsc --noEmit",
|
||||
"lint:oxlint": "oxlint .",
|
||||
"lint:oxfmt": "oxfmt . --check",
|
||||
"oxfmt": "oxfmt .",
|
||||
"test": "node --test",
|
||||
"build": "tsdown",
|
||||
"release": "semantic-release"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@testcontainers/postgresql": "12.0.0",
|
||||
"@types/node": "25.9.1",
|
||||
"kysely": "0.29.2",
|
||||
"kysely-postgres-js": "3.0.0",
|
||||
"oxfmt": "0.51.0",
|
||||
"oxlint": "1.66.0",
|
||||
"oxlint-tsgolint": "0.23.0",
|
||||
"postgres": "3.4.9",
|
||||
"semantic-release": "25.0.3",
|
||||
"tsdown": "0.22.0",
|
||||
"typescript": "6.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"kysely": ">=0.29.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=24.0.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import assert from "node:assert/strict"
|
||||
import { describe, it } from "node:test"
|
||||
import { fn } from "../index.ts"
|
||||
|
||||
describe("index", () => {
|
||||
it('should return "Hello, tsdown!"', () => {
|
||||
// Arrange - Given
|
||||
const input = "tsdown"
|
||||
|
||||
// Act - When
|
||||
const output = fn(input)
|
||||
|
||||
// Assert - Then
|
||||
const expected = "Hello, tsdown!"
|
||||
assert.strictEqual(output, expected)
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
export const fn = (input: string): string => {
|
||||
return `Hello, ${input}!`
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"strict": true,
|
||||
"allowUnusedLabels": false,
|
||||
"allowUnreachableCode": false,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noImplicitOverride": true,
|
||||
"noImplicitReturns": true,
|
||||
"noImplicitThis": true,
|
||||
"noImplicitAny": true,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"noUncheckedSideEffectImports": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"erasableSyntaxOnly": true,
|
||||
|
||||
"verbatimModuleSyntax": false,
|
||||
"isolatedModules": true,
|
||||
"esModuleInterop": true,
|
||||
"allowImportingTsExtensions": true,
|
||||
"skipLibCheck": true,
|
||||
"jsx": "react-jsx",
|
||||
"incremental": false,
|
||||
"noEmit": true,
|
||||
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"resolveJsonModule": true,
|
||||
|
||||
"lib": ["ESNext"],
|
||||
"types": ["@types/node"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { defineConfig } from "tsdown"
|
||||
|
||||
export default defineConfig({
|
||||
entry: "./src/index.ts",
|
||||
dts: true,
|
||||
exports: true,
|
||||
})
|
||||
Reference in New Issue
Block a user