From 982b3844e6584f453393344f2e58e420997f209a Mon Sep 17 00:00:00 2001 From: Hunter Johnston <64506580+huntabyte@users.noreply.github.com> Date: Thu, 29 Feb 2024 14:30:07 -0600 Subject: [PATCH] chore: readme and pretty-quick (#839) --- LICENSE.md | 3 +- README.md | 2 +- apps/www/package.json | 4 +- apps/www/pnpm-lock.yaml | 84 +++++++++++++++++++++++++++++++++++++- package.json | 88 +++++++++++++++++++++------------------- packages/cli/.prettierrc | 24 +---------- packages/cli/LICENSE.md | 23 +++++++++++ pnpm-lock.yaml | 9 ++++ 8 files changed, 169 insertions(+), 68 deletions(-) create mode 100644 packages/cli/LICENSE.md diff --git a/LICENSE.md b/LICENSE.md index abd68bcdd..a9c907ccf 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,7 +1,8 @@ MIT License +Copyright (c) 2023 Hunter Johnston +Copyright (c) 2023 CokaKoala Copyright (c) 2023 shadcn -Copyright (c) 2023 huntabyte Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 4014b5e0d..979cda2af 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ This project is supported by the following beautiful people/organizations: Published under the [MIT](https://github.com/huntabyte/shadcn-svelte/blob/main/LICENSE) license. -Made by [@huntabyte](https://github.com/huntabyte) and [community](https://github.com/huntabyte/shadcn-svelte/graphs/contributors) 💛 +Built by [@huntabyte](https://github.com/huntabyte), [CokaKoala](https://github.com/adriangonz97),and [community](https://github.com/huntabyte/shadcn-svelte/graphs/contributors) 💛

diff --git a/apps/www/package.json b/apps/www/package.json index 0403bfad7..205d85578 100644 --- a/apps/www/package.json +++ b/apps/www/package.json @@ -24,7 +24,8 @@ "test:unit": "vitest", "lint": "prettier --check . && eslint .", "format": "prettier --write .", - "format:check": "prettier --check ." + "format:check": "prettier --check .", + "format:staged": "pretty-quick --staged" }, "devDependencies": { "@faker-js/faker": "^8.0.2", @@ -56,6 +57,7 @@ "prettier": "^3.1.1", "prettier-plugin-svelte": "^3.2.1", "prettier-plugin-tailwindcss": "^0.5.11", + "pretty-quick": "^4.0.0", "rehype-pretty-code": "^0.13.0", "rehype-slug": "^6.0.0", "remark-code-import": "^1.2.0", diff --git a/apps/www/pnpm-lock.yaml b/apps/www/pnpm-lock.yaml index faca25be3..c839c008d 100644 --- a/apps/www/pnpm-lock.yaml +++ b/apps/www/pnpm-lock.yaml @@ -142,6 +142,9 @@ devDependencies: prettier-plugin-tailwindcss: specifier: ^0.5.11 version: 0.5.11(prettier-plugin-svelte@3.2.1)(prettier@3.1.1) + pretty-quick: + specifier: ^4.0.0 + version: 4.0.0(prettier@3.1.1) rehype-pretty-code: specifier: ^0.13.0 version: 0.13.0(shiki@1.1.5) @@ -3016,6 +3019,21 @@ packages: engines: {node: '>=0.10.0'} dev: true + /execa@5.1.1: + resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} + engines: {node: '>=10'} + dependencies: + cross-spawn: 7.0.3 + get-stream: 6.0.1 + human-signals: 2.1.0 + is-stream: 2.0.1 + merge-stream: 2.0.0 + npm-run-path: 4.0.1 + onetime: 5.1.2 + signal-exit: 3.0.7 + strip-final-newline: 2.0.0 + dev: true + /extend@3.0.2: resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} dev: true @@ -3173,7 +3191,6 @@ packages: /get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} - dev: false /get-tsconfig@4.7.2: resolution: {integrity: sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==} @@ -3497,6 +3514,11 @@ packages: - supports-color dev: true + /human-signals@2.1.0: + resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} + engines: {node: '>=10.17.0'} + dev: true + /iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} @@ -3513,6 +3535,11 @@ packages: engines: {node: '>= 4'} dev: true + /ignore@5.3.1: + resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} + engines: {node: '>= 4'} + dev: true + /import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} @@ -3607,6 +3634,11 @@ packages: dependencies: '@types/estree': 1.0.1 + /is-stream@2.0.1: + resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} + engines: {node: '>=8'} + dev: true + /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -3979,6 +4011,10 @@ packages: resolution: {integrity: sha512-gj39xkrjEw7nCn4nJ1M5ms6+MyMlyiGmttzsqAUsAKn6bYKwuTHh/AO3cKPF8IBrTIYTxb0wWXFs3E//Y8VoWQ==} dev: true + /merge-stream@2.0.0: + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + dev: true + /merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} @@ -4239,6 +4275,11 @@ packages: picomatch: 2.3.1 dev: true + /mimic-fn@2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} + dev: true + /min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} @@ -4417,6 +4458,13 @@ packages: dev: true optional: true + /npm-run-path@4.0.1: + resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} + engines: {node: '>=8'} + dependencies: + path-key: 3.1.1 + dev: true + /npmlog@5.0.1: resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} dependencies: @@ -4442,6 +4490,13 @@ packages: wrappy: 1.0.2 dev: true + /onetime@5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} + dependencies: + mimic-fn: 2.1.0 + dev: true + /optionator@0.9.3: resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} engines: {node: '>= 0.8.0'} @@ -4580,6 +4635,11 @@ packages: engines: {node: '>=8.6'} dev: true + /picomatch@3.0.1: + resolution: {integrity: sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==} + engines: {node: '>=10'} + dev: true + /pify@2.3.0: resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} engines: {node: '>=0.10.0'} @@ -4795,6 +4855,23 @@ packages: react-is: 18.2.0 dev: true + /pretty-quick@4.0.0(prettier@3.1.1): + resolution: {integrity: sha512-M+2MmeufXb/M7Xw3Afh1gxcYpj+sK0AxEfnfF958ktFeAyi5MsKY5brymVURQLgPLV1QaF5P4pb2oFJ54H3yzQ==} + engines: {node: '>=14'} + hasBin: true + peerDependencies: + prettier: ^3.0.0 + dependencies: + execa: 5.1.1 + find-up: 5.0.0 + ignore: 5.3.1 + mri: 1.2.0 + picocolors: 1.0.0 + picomatch: 3.0.1 + prettier: 3.1.1 + tslib: 2.6.2 + dev: true + /prism-svelte@0.5.0: resolution: {integrity: sha512-db91Bf3pRGKDPz1lAqLFSJXeW13mulUJxhycysFpfXV5MIK7RgWWK2E5aPAa71s8TCzQUXxF5JOV42/iOs6QkA==} dev: false @@ -5183,6 +5260,11 @@ packages: ansi-regex: 5.0.1 dev: true + /strip-final-newline@2.0.0: + resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} + engines: {node: '>=6'} + dev: true + /strip-indent@3.0.0: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} engines: {node: '>=8'} diff --git a/package.json b/package.json index 49e8ed322..39d80a479 100644 --- a/package.json +++ b/package.json @@ -1,44 +1,48 @@ { - "name": "shadcn-svelte", - "version": "0.0.1", - "description": "monorepo for shadcn-svelte", - "author": { - "name": "huntabyte", - "url": "https://twitter.com/huntabyte" - }, - "private": true, - "scripts": { - "build": "pnpm build:registry && pnpm --filter www build", - "build:cli": "pnpm --filter shadcn-svelte build", - "build:registry": "pnpm --filter www build:registry", - "dev": "pnpm build:registry && pnpm --filter www dev", - "dev:cli": "pnpm --filter shadcn-svelte start:dev", - "preview": "pnpm --filter www preview", - "test": "pnpm --filter www test", - "check": "pnpm --filter www check", - "check:watch": "pnpm --filter www check:watch", - "test:unit": "pnpm --filter www test:unit", - "lint": "pnpm -r lint", - "format:check": "pnpm -r format:check", - "format": "pnpm -r format", - "preinstall": "npx only-allow pnpm", - "postinstall": "pnpm -r sync", - "ci:publish": "changeset publish", - "ci:build": "pnpm --filter shadcn-svelte build", - "ci:release": "pnpm ci:build && pnpm ci:publish", - "pub:beta": "cd packages/cli && pnpm pub:beta", - "pub:release": "cd packages/cli && pnpm pub:release" - }, - "engines": { - "pnpm": ">=8" - }, - "repository": { - "type": "git", - "url": "https://github.com/huntabyte/shadcn-svelte.git" - }, - "license": "MIT", - "type": "module", - "devDependencies": { - "@changesets/cli": "^2.26.2" - } + "name": "shadcn-svelte", + "version": "0.0.1", + "description": "monorepo for shadcn-svelte", + "author": { + "name": "huntabyte", + "url": "https://twitter.com/huntabyte" + }, + "private": true, + "scripts": { + "build": "pnpm build:registry && pnpm --filter www build", + "build:cli": "pnpm --filter shadcn-svelte build", + "build:registry": "pnpm --filter www build:registry", + "dev": "pnpm build:registry && pnpm --filter www dev", + "dev:cli": "pnpm --filter shadcn-svelte start:dev", + "preview": "pnpm --filter www preview", + "test": "pnpm --filter www test", + "check": "pnpm --filter www check", + "check:watch": "pnpm --filter www check:watch", + "test:unit": "pnpm --filter www test:unit", + "lint": "pnpm -r lint", + "format:check": "pnpm -r format:check", + "format": "pnpm -r format", + "preinstall": "npx only-allow pnpm", + "postinstall": "pnpm -r sync", + "ci:publish": "changeset publish", + "ci:build": "pnpm --filter shadcn-svelte build", + "ci:release": "pnpm ci:build && pnpm ci:publish", + "pub:beta": "cd packages/cli && pnpm pub:beta", + "pub:release": "cd packages/cli && pnpm pub:release" + }, + "engines": { + "pnpm": ">=8" + }, + "repository": { + "type": "git", + "url": "https://github.com/huntabyte/shadcn-svelte.git" + }, + "license": "MIT", + "type": "module", + "devDependencies": { + "@changesets/cli": "^2.26.2", + "simple-git-hooks": "^2.9.0" + }, + "simple-git-hooks": { + "pre-commit": "pnpm -r format:staged --staged" + } } diff --git a/packages/cli/.prettierrc b/packages/cli/.prettierrc index 278366dd4..987c5dd77 100644 --- a/packages/cli/.prettierrc +++ b/packages/cli/.prettierrc @@ -6,26 +6,6 @@ "printWidth": 90, "endOfLine": "lf", "pluginSearchDirs": false, - "plugins": ["@ianvs/prettier-plugin-sort-imports"], - "bracketSameLine": false, - "importOrder": [ - "", - "^[.]", - "", - "", - "^\\$app", - "^\\$env", - "^\\$service-worker", - "^\\$lib/server", - "^\\$(?![^\\/]*\\/)", - "^\\$[^/]*\\/[^/]+", - "^[./]", - "\\.js$", - "\\.svelte$" - ], - "importOrderSeparation": false, - "importOrderSortSpecifiers": true, - "importOrderBuiltinModulesToTop": true, - "importOrderParserPlugins": ["typescript"], - "importOrderMergeDuplicateImports": true + "plugins": [], + "bracketSameLine": false } diff --git a/packages/cli/LICENSE.md b/packages/cli/LICENSE.md new file mode 100644 index 000000000..a9c907ccf --- /dev/null +++ b/packages/cli/LICENSE.md @@ -0,0 +1,23 @@ +MIT License + +Copyright (c) 2023 Hunter Johnston +Copyright (c) 2023 CokaKoala +Copyright (c) 2023 shadcn + +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. diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 43754e833..763719565 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ devDependencies: '@changesets/cli': specifier: ^2.26.2 version: 2.26.2 + simple-git-hooks: + specifier: ^2.9.0 + version: 2.9.0 packages: @@ -1448,6 +1451,12 @@ packages: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} dev: true + /simple-git-hooks@2.9.0: + resolution: {integrity: sha512-waSQ5paUQtyGC0ZxlHmcMmD9I1rRXauikBwX31bX58l5vTOhCEcBC5Bi+ZDkPXTjDnZAF8TbCqKBY+9+sVPScw==} + hasBin: true + requiresBuild: true + dev: true + /slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'}