Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"ignorePatterns": [],
"experimentalSortImports": {
"sortSideEffects": true,
"groups": ["type"]
}
}
178 changes: 178 additions & 0 deletions .oxlintrc.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
// Unsupported BiomeJS-specific rules:
// - useNamingConvention (custom naming patterns)
// - noImplicitAnyLet (implicit any on let)
// - noMisleadingInstantiator (misleading constructors)
// - noUnsafeDeclarationMerging (unsafe declaration merging)
// - useImportExtensions (import extensions)
// - useExportType

// Unsupported ESLint rules:
// unsupported rule: import/newline-after-import
// unsupported rule: typescript/no-unnecessary-condition (now included)
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["import", "typescript", "unicorn", "react"],
"categories": {
"correctness": "error",
},
"env": {
"builtin": true,
},
"ignorePatterns": [
"node_modules/",
"dist/",
"*.config.js",
"*.config.mjs",
"*.config.mts",
"*.config.ts",
"**/*.test.ts",
"**/*.tst.ts",
"**/tests/*.ts",
"**/tests/**/*.ts",
"**/*.test.tsx",
"**/*.spec.ts",
"**/*.spec.tsx",
"**/*.d.ts",
],
"rules": {
// Base ESLint rules (existing)
"no-return-assign": "error",
"no-extend-native": "error",
"prefer-promise-reject-errors": "error",

// Complexity rules (existing + BiomeJS equivalents)
"complexity": ["warn", 6],
"max-depth": ["warn", 3],
"max-lines": ["warn", 300],
"max-lines-per-function": [
"warn",
{
"max": 85,
"skipComments": true,
"skipBlankLines": true,
},
],
"max-nested-callbacks": ["warn", 5],

// BiomeJS complexity equivalents
"no-sequences": "error", // noCommaOperator
"dot-notation": "warn", // useLiteralKeys
"prefer-optional-chaining": "warn", // useOptionalChain

// Import rules (existing)
"import/no-mutable-exports": "error",
"import/no-absolute-path": "error",
"import/first": "error",

// BiomeJS correctness equivalents
"no-const-assign": "error", // noConstAssign
"no-use-before-define": "error", // noInvalidUseBeforeDeclaration
"no-unused-vars": [
"error",
{
"varsIgnorePattern": "^_",
"ignoreRestSiblings": true,
},
], // noUnusedVariables

// BiomeJS security equivalents
"no-eval": "error", // noGlobalEval

// BiomeJS style equivalents
"no-param-reassign": "error", // noParameterAssign
"no-template-curly-in-string": "warn", // noUnusedTemplateLiteral
"no-else-return": "warn", // noUselessElse
"yoda": ["warn", "never"], // noYodaExpression
"curly": ["warn", "all"], // useBlockStatements
"prefer-const": "warn", // useConst
"prefer-destructuring": "off", // Allow flexible destructuring
"prefer-exponentiation-operator": "warn", // useExponentiationOperator
"prefer-for-of": "warn", // useForOf
"prefer-template": "warn", // useTemplate

// BiomeJS suspicious equivalents
"no-console": [
"warn",
{
"allow": ["error"],
},
], // noConsole
"eqeqeq": "error", // noDoubleEquals
"no-dupe-class-members": "error", // noDuplicateClassMembers
"no-implicit-globals": "error", // noGlobalAssign
"no-label-var": "error", // noLabelVar
"no-self-compare": "error", // noSelfCompare
"no-undef-init": "error", // noUnsafeNegation
"no-var": "error", // noVar
"require-await": "error", // useAwait
"default-case-last": "error", // useDefaultSwitchClauseLast
"prefer-array-isarray": "warn", // useIsArray
"no-empty": "error", // noEmptyBlockStatements
"no-empty-function": "error",
"no-empty-file": "error",
// BiomeJS performance equivalents
"no-barrel-files": "off", // noBarrelFile (custom rule, not available)

"sort-imports": "off",

"react/no-array-index-key": "warn",

"unicorn/prefer-node-protocol": "error",
"unicorn/filename-case": [
"error",
{
"cases": {
"camelCase": true,
"pascalCase": true,
},
},
],
"import/extensions": [
"error",
"ignorePackages",
{
"ts": "never",
"tsx": "never",
"js": "never",
"jsx": "never",
"mjs": "never",
"cjs": "never",
},
],

"typescript/consistent-type-imports": "error",

// TypeScript rules (existing)
"typescript/no-floating-promises": "error",
"typescript/no-misused-promises": [
"error",
{
"checksVoidReturn": false,
},
],
"typescript/no-unsafe-argument": "error",
"typescript/no-unsafe-assignment": "error",
"typescript/no-unsafe-call": "error",
"typescript/no-unsafe-member-access": "error",
"typescript/no-unsafe-return": "error",
"typescript/consistent-type-definitions": ["error", "interface"],
"typescript/no-explicit-any": "error",
"typescript/no-unnecessary-type-arguments": "warn",
"typescript/restrict-template-expressions": "warn",

// TypeScript BiomeJS equivalents
"typescript/prefer-for-of": "warn",
"typescript/prefer-optional-chaining": "warn",
"typescript/prefer-nullish-coalescing": "warn",
"typescript/prefer-string-starts-ends-with": "warn",
"typescript/no-useless-constructor": "error",
"typescript/unified-signatures": "warn",
"typescript/switch-exhaustiveness-check": "warn",
"typescript/require-array-sort-compare": "error",
"no-loop-func": "error",
},
"globals": {
"node": "readonly",
"es2021": "readonly",
},
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.formatOnSave": true,
"[typescript]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
}
}
103 changes: 41 additions & 62 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,87 +1,66 @@
{
"name": "@emergente-labs/effect-sql-model",
"version": "0.1.1",
"description": "Compile Effect Schema models into Drizzle ORM table definitions",
"name": "@sellhub/sql-model-drizzle",
"version": "0.0.0",
"private": true,
"type": "module",
"license": "MIT",
"author": "Emergente Labs",
"repository": {
"type": "git",
"url": "https://github.com/emergente-labs/effect-sql-model"
},
"bugs": "https://github.com/emergente-labs/effect-sql-model/issues",
"homepage": "https://github.com/emergente-labs/effect-sql-model#readme",
"keywords": [
"effect",
"effect-ts",
"schema",
"drizzle",
"orm",
"postgres",
"sql",
"compiler"
],
"engines": {
"node": ">=18.0.0"
},
"files": [
"dist",
"README.md",
"LICENSE"
],
"main": "./dist/index.mjs",
"types": "./dist/index.d.mts",
"scripts": {
"prepare": "pnpm build",
"build": "tsdown",
"test": "vitest run",
"test:types": "tstyche",
"typecheck": "tsc --noEmit",
"madge": "madge --circular src/index.ts",
"prepublishOnly": "pnpm run build && pnpm run test && pnpm run test:types"
},
"main": "./src/index.ts",
"types": "./src/index.ts",
"exports": {
".": {
"types": "./dist/index.d.mts",
"import": "./dist/index.mjs",
"default": "./dist/index.mjs"
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"default": "./dist/index.js"
},
"./*": {
"types": "./dist/*.d.mts",
"import": "./dist/*.mjs",
"default": "./dist/*.mjs"
"types": "./dist/*.d.ts",
"import": "./dist/*.js",
"default": "./dist/*.js"
},
"./pg": {
"types": "./dist/pg/index.d.mts",
"import": "./dist/pg/index.mjs",
"default": "./dist/pg/index.mjs"
"types": "./dist/pg/index.d.ts",
"import": "./dist/pg/index.js",
"default": "./dist/pg/index.js"
},
"./annotations": {
"types": "./dist/annotations.d.ts",
"import": "./dist/annotations.js",
"default": "./dist/annotations.js"
}
},
"scripts": {
"test": "vitest run && tstyche",
"typecheck": "tsgo --noEmit",
"build": "tsc",
"lint": "oxlint --type-aware",
"lint:json": "oxlint --type-aware -f json"
},
"dependencies": {
"@amar4enko/effect-schema-compiler": "~0.2.0"
},
"peerDependencies": {
"@effect/experimental": "^0.57.11",
"@effect/sql": "^0.48.6",
"@effect/sql-drizzle": "^0.47.0",
"@effect/sql-pg": "^0.49.7",
"drizzle-orm": "^0.44.7",
"effect": "^3.19.8",
"pg": "^8.18.0"
},
"devDependencies": {
"@effect/vitest": "^0.27.0",
"@effect/vitest": "~0.27.0",
"@electric-sql/pglite": "0.3.14",
"@types/pg": "^8.11.10",
"@typescript/native-preview": "^7.0.0-dev.20260113.1",
"drizzle-kit": "^0.28.1",
"drizzle-orm": "^0.44.7",
"effect": "^3.19.8",
"madge": "^8.0.0",
"oxfmt": "^0.34.0",
"oxlint": "^1.49.0",
"oxlint-tsgolint": "^0.14.1",
"pg": "^8.18.0",
"postgres": "^3.4.5",
"tstyche": "^5.0.2",
"tsdown": "^0.20.0-beta.2",
"tstyche": "^6.2.0",
"typescript": "^5.9.3",
"vitest": "^4.0.16"
},
"peerDependencies": {
"@effect/experimental": "^0.57.11",
"@effect/sql": "^0.48.6",
"@effect/sql-drizzle": "^0.47.0",
"@effect/sql-pg": "^0.49.7",
"drizzle-orm": "^0.44.7",
"effect": "^3.19.8",
"pg": "^8.18.0"
}
}
Loading
Loading