diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml index 0710a50..c14e11f 100644 --- a/.github/workflows/format-check.yml +++ b/.github/workflows/format-check.yml @@ -8,7 +8,7 @@ on: jobs: format-check: - name: ESLint & Prettier + name: Format Checks runs-on: ubuntu-latest steps: - name: Checkout @@ -29,6 +29,6 @@ jobs: - name: Run ESLint run: pnpm lint - - name: Run Prettier + - name: Run Oxfmt if: always() - run: pnpm prettier:check + run: pnpm fmt:check diff --git a/.gitignore b/.gitignore index 437ce7c..a46938d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,8 @@ node_modules .DS_Store .fleet .idea -.vscode +.vscode/* +!.vscode/extensions.json # Cache files *.tsbuildinfo diff --git a/.oxfmtrc.json b/.oxfmtrc.json new file mode 100644 index 0000000..8a494c3 --- /dev/null +++ b/.oxfmtrc.json @@ -0,0 +1,11 @@ +{ + "$schema": "./node_modules/oxfmt/configuration_schema.json", + "printWidth": 120, + "sortPackageJson": false, + "ignorePatterns": ["docs/content/index.md", "docs/.nuxt", "docs/.data", "docs/.output"], + "sortTailwindcss": { + "stylesheet": "docs/assets/css/main.css", + "functions": ["clsx", "cn"], + "preserveWhitespace": true + } +} diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 217ebb0..0000000 --- a/.prettierignore +++ /dev/null @@ -1,5 +0,0 @@ -# ignore index.md since it's using MDC and prettier messes that up -docs/content/index.md -docs/.nuxt -docs/.data -docs/.output \ No newline at end of file diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 963354f..0000000 --- a/.prettierrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "printWidth": 120 -} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..99e2f7d --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["oxc.oxc-vscode"] +} diff --git a/README.md b/README.md index a5cea17..86d4e75 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ Vasta is a type-safe Object Relational Mapper (ORM) layer for [Kysely](https://k Vasta provides an [active record pattern](https://en.wikipedia.org/wiki/Active_record_pattern) interface for querying and manipulating your data, making it easy to work with your database in a model-instance oriented way. You can define your models with attributes, relationships, methods, and more. You can use these model properties to perform actions directly on your models before easily saving those changes to the database. - ```js const pet = await Pet.findOrFail(1); pet.name = "Fluffy"; diff --git a/docs/README.md b/docs/README.md index 6778e19..a56bf6c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -10,7 +10,7 @@ This is the default Docus starter template that provides everything you need to ## ✨ Features - 🎨 **Beautiful Design** - Clean, modern documentation theme -- 📱 **Responsive** - Mobile-first responsive design +- 📱 **Responsive** - Mobile-first responsive design - 🌙 **Dark Mode** - Built-in dark/light mode support - 🔍 **Search** - Full-text search functionality - 📝 **Markdown Enhanced** - Extended markdown with custom components @@ -79,4 +79,4 @@ The built files will be in the `.output` directory, ready for deployment to any ## 📄 License -[MIT License](https://opensource.org/licenses/MIT) \ No newline at end of file +[MIT License](https://opensource.org/licenses/MIT) diff --git a/docs/content/1.getting-started/1.introduction.md b/docs/content/1.getting-started/1.introduction.md index 672f558..81686f2 100644 --- a/docs/content/1.getting-started/1.introduction.md +++ b/docs/content/1.getting-started/1.introduction.md @@ -33,4 +33,4 @@ In this example, the `where` method is type-safe and will only allow valid colum ![Example type safety not allowing invalid columns, and a type error when an invalid column is entered](/img/content/1.getting-started/invalid-column.png) -![Example type safety not allowing values, and a type error when an invalid value is entered](/img/content/1.getting-started/invalid-value.png) \ No newline at end of file +![Example type safety not allowing values, and a type error when an invalid value is entered](/img/content/1.getting-started/invalid-value.png) diff --git a/docs/content/3.contributing/1.local-development.md b/docs/content/3.contributing/1.local-development.md index 9f3aa8a..755a6eb 100644 --- a/docs/content/3.contributing/1.local-development.md +++ b/docs/content/3.contributing/1.local-development.md @@ -30,15 +30,15 @@ pnpm test:reset ``` ## Testing the package locally + You can bundle this package for local testing as an independent package without publishing to npm. This is useful for making sure that all peer dependencies are correct and that the package works as expected when installed as a dependency in another project. 1. Build the package with `pnpm build` 1. Bundle the package with `pnpm pack` -2. Install the tarball in your project with `pnpm install /path/to/tarball.tgz` +1. Install the tarball in your project with `pnpm install /path/to/tarball.tgz` When you want to update the package in your project, you'll need to repeat these steps, which should also refresh any dependencies that have changed. - ## Docs Run the docs server locally with hot-reloading for development: diff --git a/package.json b/package.json index a31ed07..95904e2 100644 --- a/package.json +++ b/package.json @@ -46,9 +46,9 @@ "db:seed": "kysely seed:run", "lint": "eslint", "lint:fix": "eslint --fix", - "prettier:check": "prettier \"**/*.{js,ts,mjs,vue}\" --check", - "prettier:write": "prettier \"**/*.{js,ts,mjs,vue}\" --write", - "format": "pnpm run prettier:write && pnpm run lint:fix", + "fmt": "oxfmt", + "fmt:check": "oxfmt --check", + "format": "pnpm run fmt && pnpm run lint:fix", "publish": "pnpm run build && npm publish --access public" }, "main": "dist/cjs/index.js", @@ -62,8 +62,8 @@ "eslint-config-prettier": "^9.1.2", "kysely": "^0.29.0", "kysely-ctl": "^0.21.0", + "oxfmt": "^0.51.0", "pg": "^8.20.0", - "prettier": "^3.8.3", "tsc-alias": "^1.8.17", "typescript": "^5.9.3", "typescript-eslint": "^8.59.3", @@ -76,5 +76,5 @@ "unimport": "5.6.0", "citty": "0.1.6" }, - "packageManager": "pnpm@11.1.2" + "packageManager": "pnpm@11.1.3" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 333c2c3..8cf11f3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,12 +29,12 @@ importers: kysely-ctl: specifier: ^0.21.0 version: 0.21.0(kysely@0.29.0)(magicast@0.5.2) + oxfmt: + specifier: ^0.51.0 + version: 0.51.0 pg: specifier: ^8.20.0 version: 8.20.0 - prettier: - specifier: ^3.8.3 - version: 3.8.3 tsc-alias: specifier: ^1.8.17 version: 1.8.17 @@ -1908,6 +1908,128 @@ packages: cpu: [x64] os: [win32] + '@oxfmt/binding-android-arm-eabi@0.51.0': + resolution: {integrity: sha512-Ni0sCqg5CIHaLIYFGj+ncbcumylvNC6FE4rfD0KfdmnWHbPJ+zev0qZCXKxy2hFVa0fYRK0yPzf5nzPbkZou7g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@oxfmt/binding-android-arm64@0.51.0': + resolution: {integrity: sha512-eu5lAZjuo0KAkp+M24EhDqfOwA8owQ8d7wyBlOUUGRbDLHpU3IRlDHp8Dif+YqGlxs6jra7yS6WQu/NkPhAxeg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@oxfmt/binding-darwin-arm64@0.51.0': + resolution: {integrity: sha512-6LsUNIdURhhcIfIn8+xsOb61mSTa9msAHTeSGx9Jf4rsP/gN8PGCF+SKWPAQZbND2w/WBkqQ6303jqEEIXzMdQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@oxfmt/binding-darwin-x64@0.51.0': + resolution: {integrity: sha512-9aUMGmVxdHjYMsEAW1tNRoieTJXlVNDFkRvIR1J7LttJXWjVYCu2ekclLij2KJtxBxSQOYSHd12ME/adVGVbZg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@oxfmt/binding-freebsd-x64@0.51.0': + resolution: {integrity: sha512-mkY1nhZTqYb+NHaAWxOCKISN6FwdrwMNsu17vTUA3wzUV2VJ+Paq15ZokRcsMU/2PUdHO73prxyeJpjXQ3MPpQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@oxfmt/binding-linux-arm-gnueabihf@0.51.0': + resolution: {integrity: sha512-wtFwNwE4+YCNuPaWoGDZeGsKvD6D1YSUNBJNn/rJBh7CrDBThFE+TBI5kY7vRW9rIOQRsbW2IpyyL3Du4Zqwiw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxfmt/binding-linux-arm-musleabihf@0.51.0': + resolution: {integrity: sha512-rnOaNx86G7iRKM6lsCIQMux0SMGNC/TEbFR+r7lpruJ12bnrIWgxd5w1PLqOvgR9r8ZJbpK/zfRKctJnh8/Jfg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxfmt/binding-linux-arm64-gnu@0.51.0': + resolution: {integrity: sha512-jOgDzSqWcICGRjsp4mc08FxKMN8vzP2Kgs4E0d2HUP99F+nJDQKklRV4Zuj+0gcBgjrzx2CbpqaIdUVPepCojA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-arm64-musl@0.51.0': + resolution: {integrity: sha512-KBUCdrH5bwVrAvI9gU/1S55oH6fzXjr++J/oVocdu7bYTks1l7DNNT+rLd/1TDdAEjObGwmfWamn7LC1m8A0DQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oxfmt/binding-linux-ppc64-gnu@0.51.0': + resolution: {integrity: sha512-NapfjYsABFqTJ1Dn9Efq6sN5esaHconVKwVLbDGNQLrwpOx/g17mkwErHzU72PutL67nf3wNAkbq122H+zLxag==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-riscv64-gnu@0.51.0': + resolution: {integrity: sha512-5dlDt1dUZCVi6elIhiK1PWg9wpTzTcIuj0IZnSurvIoMrhOWqqTcc1dSTxcSkNaBZhfsNqRZdINI1zAgbKkJNQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-riscv64-musl@0.51.0': + resolution: {integrity: sha512-pgdWUJn0S5nulyiVdlFV8DzCUnGXkU99W5PSkkmbaZW+LrZBPxpezun4G0DDHbQaVYuJeCuKsXsGKGo77CkUTQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@oxfmt/binding-linux-s390x-gnu@0.51.0': + resolution: {integrity: sha512-2XTFUe97CbDGAI8vjwDfZ1HdakO0XIADyJ24idEg64SC4/K4in/OisXVnrW4NMK7I6TgC7EqRhC0Ln/nKhAemA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-x64-gnu@0.51.0': + resolution: {integrity: sha512-kQ1OuCqqt/yyf0ZN9VFxW1/JnlgJgii3Dr7pWf9vNBvrX1hv6g39/+mc5oGRHRGJFZtl3zsGDWR9c5N2B/gwBw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-x64-musl@0.51.0': + resolution: {integrity: sha512-ARTYqxHF475o96Gbn41hvSWSSRygPlRDXZZgZ9I2scU1y0qiWpCQyZCoefaQa0mwv+wwtZ+luS4YOzsRzM/izg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oxfmt/binding-openharmony-arm64@0.51.0': + resolution: {integrity: sha512-QiC1XrCl6a6BmqMzduO8hdIRMf1m44hCkt2Q68KWkTvUB/E7fd2iomyNh6KnnRca5w6eBrRAAtLFqTh+xjsjJA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@oxfmt/binding-win32-arm64-msvc@0.51.0': + resolution: {integrity: sha512-NC/hJb9dtU23Zf8L7IVK95xnFjiQ7AfcLO2l5pb69TDEr958qxrtnB2CveeeNSCBFNIkgaTCfd/vHNSoG78l9g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@oxfmt/binding-win32-ia32-msvc@0.51.0': + resolution: {integrity: sha512-2C45za4Rj36n8YIbhRL1PQbxmXJYf81WEcAgvj5I4ptRROG+A+81hREEN5bmCHADE1UfYaN312U6tkILoZZy6w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ia32] + os: [win32] + + '@oxfmt/binding-win32-x64-msvc@0.51.0': + resolution: {integrity: sha512-73RqdAuVKQTkjZIDw08JaDHUM4lav5Qu+CaPwg4QbbA7k8o7LEW0p3UsfZ/F8dsO/pwVYh3RzFcanwLRTTahbQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + '@parcel/watcher-android-arm64@2.5.6': resolution: {integrity: sha512-YQxSS34tPF/6ZG7r/Ih9xy+kP/WwediEUsqmtf0cuCV5TPPKw/PQHRhueUo6JdeFJaqV3pyjm0GdYjZotbRt/A==} engines: {node: '>= 10.0.0'} @@ -5558,6 +5680,16 @@ packages: peerDependencies: oxc-parser: '>=0.98.0' + oxfmt@0.51.0: + resolution: {integrity: sha512-l/AoAnaEOV7Q5/Z9kHOMDehVJnCgYN7wRoooWCTUMBMi16BJhLZqd9cmCnwcVFfVlzkt53zK2KLPFNp8vSsoDg==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + svelte: ^5.0.0 + peerDependenciesMeta: + svelte: + optional: true + p-limit@3.1.0: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} @@ -5925,11 +6057,6 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} - prettier@3.8.3: - resolution: {integrity: sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==} - engines: {node: '>=14'} - hasBin: true - pretty-bytes@7.1.0: resolution: {integrity: sha512-nODzvTiYVRGRqAOvE84Vk5JDPyyxsVk0/fbA/bq7RqlnhksGpset09XTxbpvLTIjoaF7K8Z8DG8yHtKGTPSYRw==} engines: {node: '>=20'} @@ -6569,6 +6696,10 @@ packages: resolution: {integrity: sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==} engines: {node: '>=14.0.0'} + tinypool@2.1.0: + resolution: {integrity: sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw==} + engines: {node: ^20.0.0 || >=22.0.0} + tinyspy@2.2.1: resolution: {integrity: sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==} engines: {node: '>=14.0.0'} @@ -9294,6 +9425,63 @@ snapshots: '@oxc-transform/binding-win32-x64-msvc@0.112.0': optional: true + '@oxfmt/binding-android-arm-eabi@0.51.0': + optional: true + + '@oxfmt/binding-android-arm64@0.51.0': + optional: true + + '@oxfmt/binding-darwin-arm64@0.51.0': + optional: true + + '@oxfmt/binding-darwin-x64@0.51.0': + optional: true + + '@oxfmt/binding-freebsd-x64@0.51.0': + optional: true + + '@oxfmt/binding-linux-arm-gnueabihf@0.51.0': + optional: true + + '@oxfmt/binding-linux-arm-musleabihf@0.51.0': + optional: true + + '@oxfmt/binding-linux-arm64-gnu@0.51.0': + optional: true + + '@oxfmt/binding-linux-arm64-musl@0.51.0': + optional: true + + '@oxfmt/binding-linux-ppc64-gnu@0.51.0': + optional: true + + '@oxfmt/binding-linux-riscv64-gnu@0.51.0': + optional: true + + '@oxfmt/binding-linux-riscv64-musl@0.51.0': + optional: true + + '@oxfmt/binding-linux-s390x-gnu@0.51.0': + optional: true + + '@oxfmt/binding-linux-x64-gnu@0.51.0': + optional: true + + '@oxfmt/binding-linux-x64-musl@0.51.0': + optional: true + + '@oxfmt/binding-openharmony-arm64@0.51.0': + optional: true + + '@oxfmt/binding-win32-arm64-msvc@0.51.0': + optional: true + + '@oxfmt/binding-win32-ia32-msvc@0.51.0': + optional: true + + '@oxfmt/binding-win32-x64-msvc@0.51.0': + optional: true + '@parcel/watcher-android-arm64@2.5.6': optional: true @@ -13654,6 +13842,30 @@ snapshots: magic-regexp: 0.10.0 oxc-parser: 0.128.0 + oxfmt@0.51.0: + dependencies: + tinypool: 2.1.0 + optionalDependencies: + '@oxfmt/binding-android-arm-eabi': 0.51.0 + '@oxfmt/binding-android-arm64': 0.51.0 + '@oxfmt/binding-darwin-arm64': 0.51.0 + '@oxfmt/binding-darwin-x64': 0.51.0 + '@oxfmt/binding-freebsd-x64': 0.51.0 + '@oxfmt/binding-linux-arm-gnueabihf': 0.51.0 + '@oxfmt/binding-linux-arm-musleabihf': 0.51.0 + '@oxfmt/binding-linux-arm64-gnu': 0.51.0 + '@oxfmt/binding-linux-arm64-musl': 0.51.0 + '@oxfmt/binding-linux-ppc64-gnu': 0.51.0 + '@oxfmt/binding-linux-riscv64-gnu': 0.51.0 + '@oxfmt/binding-linux-riscv64-musl': 0.51.0 + '@oxfmt/binding-linux-s390x-gnu': 0.51.0 + '@oxfmt/binding-linux-x64-gnu': 0.51.0 + '@oxfmt/binding-linux-x64-musl': 0.51.0 + '@oxfmt/binding-openharmony-arm64': 0.51.0 + '@oxfmt/binding-win32-arm64-msvc': 0.51.0 + '@oxfmt/binding-win32-ia32-msvc': 0.51.0 + '@oxfmt/binding-win32-x64-msvc': 0.51.0 + p-limit@3.1.0: dependencies: yocto-queue: 0.1.0 @@ -14005,8 +14217,6 @@ snapshots: prelude-ls@1.2.1: {} - prettier@3.8.3: {} - pretty-bytes@7.1.0: {} pretty-format@29.7.0: @@ -14874,6 +15084,8 @@ snapshots: tinypool@0.8.4: {} + tinypool@2.1.0: {} + tinyspy@2.2.1: {} to-buffer@1.2.2: diff --git a/wrangler.toml b/wrangler.toml index 56941c3..c5b2221 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -2,4 +2,4 @@ name = "vasta-docs" compatibility_date = "2026-03-02" [assets] -directory = "./docs/.output/public" \ No newline at end of file +directory = "./docs/.output/public"