Skip to content

Commit

Permalink
Run formating/linting, added to CI (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntotten authored Sep 4, 2024
1 parent c654d73 commit d7bf49d
Show file tree
Hide file tree
Showing 18 changed files with 314 additions and 317 deletions.
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
npx lint-staged
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ packages/zudoku/standalone/
/.nx/workspace-data
pnpm-lock.yaml
.next/
stats.html
stats.html
.vercel/
12 changes: 11 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
{ "plugins": ["prettier-plugin-organize-imports"] }
{
"plugins": ["prettier-plugin-organize-imports"],
"overrides": [
{
"files": "*.md",
"options": {
"proseWrap": "always"
}
}
]
}
18 changes: 3 additions & 15 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,8 @@ The MIT License (MIT)

Copyright (c) Zuplo, Inc.

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:
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 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.
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.
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@

## API documentation should always be free.

[![MIT License](https://img.shields.io/badge/license-mit-green?style=for-the-badge&labelColor=000000)](https://github.com/zuplo/zudoku/license.md)
[![Zudoku Version](https://img.shields.io/npm/v/zudoku.svg?style=for-the-badge&labelColor=000000)](https://www.npmjs.com/package/zudoku)
[![Create Zudoku App Version](https://img.shields.io/npm/v/create-zudoku-app?label=cli&style=for-the-badge&labelColor=000000)](https://www.npmjs.com/package/create-zudoku-app)
[![Made with love by Zuplo](https://img.shields.io/badge/MADE%20BY%20Zuplo-FF00BD.svg?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAzNyAzMiIgYXJpYS1oaWRkZW49InRydWUiPgogIDxwYXRoIGZpbGw9IiNGRjAwQkQiIGQ9Ik0yNy4xNDIgMTkuOTc4SDE2LjYyTDI3LjgzIDguNzQ2YS43NTguNzU4IDAgMDAtLjUzNC0xLjI5M0g5LjQ4OFYwaDE5LjUzNGE3LjU3MyA3LjU3MyAwIDAxNC4wNjUgMS4xMjUgNy41OTEgNy41OTEgMCAwMTIuODM2IDMuMTI2IDcuNDAyIDcuNDAyIDAgMDEtMS40NjEgOC4zOThsLTcuMzIgNy4zMjh6Ii8+CiAgPHBhdGggZmlsbD0iI0ZGMDBCRCIgZD0iTTkuNDg5IDExLjA0MmgxMC41MjRsLTExLjE5IDExLjIxYS43NzIuNzcyIDAgMDAuNTQzIDEuMzE2aDE3Ljc1OXY3LjQ1Mkg3LjYxYTcuNTc0IDcuNTc0IDAgMDEtNC4wNjUtMS4xMjVBNy41OTMgNy41OTMgMCAwMS43MSAyNi43NjhhNy40MDMgNy40MDMgMCAwMTEuNDYyLTguMzk3bDcuMzE4LTcuMzI5eiIvPgo8L3N2Zz4K&labelColor=000)](https://zuplo.com)
[![Join the community on Discord](https://img.shields.io/badge/Chat%20on%20discord-5865F2.svg?style=for-the-badge&logo=discord&labelColor=000000&logoWidth=20)](https://discord.com/channels/848913990360629268/1235294876778627246)
[![MIT License](https://img.shields.io/badge/license-mit-green?style=for-the-badge&labelColor=000000)](https://github.com/zuplo/zudoku/license.md) [![Zudoku Version](https://img.shields.io/npm/v/zudoku.svg?style=for-the-badge&labelColor=000000)](https://www.npmjs.com/package/zudoku) [![Create Zudoku App Version](https://img.shields.io/npm/v/create-zudoku-app?label=cli&style=for-the-badge&labelColor=000000)](https://www.npmjs.com/package/create-zudoku-app) [![Made with love by Zuplo](https://img.shields.io/badge/MADE%20BY%20Zuplo-FF00BD.svg?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAzNyAzMiIgYXJpYS1oaWRkZW49InRydWUiPgogIDxwYXRoIGZpbGw9IiNGRjAwQkQiIGQ9Ik0yNy4xNDIgMTkuOTc4SDE2LjYyTDI3LjgzIDguNzQ2YS43NTguNzU4IDAgMDAtLjUzNC0xLjI5M0g5LjQ4OFYwaDE5LjUzNGE3LjU3MyA3LjU3MyAwIDAxNC4wNjUgMS4xMjUgNy41OTEgNy41OTEgMCAwMTIuODM2IDMuMTI2IDcuNDAyIDcuNDAyIDAgMDEtMS40NjEgOC4zOThsLTcuMzIgNy4zMjh6Ii8+CiAgPHBhdGggZmlsbD0iI0ZGMDBCRCIgZD0iTTkuNDg5IDExLjA0MmgxMC41MjRsLTExLjE5IDExLjIxYS43NzIuNzcyIDAgMDAuNTQzIDEuMzE2aDE3Ljc1OXY3LjQ1Mkg3LjYxYTcuNTc0IDcuNTc0IDAgMDEtNC4wNjUtMS4xMjVBNy41OTMgNy41OTMgMCAwMS43MSAyNi43NjhhNy40MDMgNy40MDMgMCAwMTEuNDYyLTguMzk3bDcuMzE4LTcuMzI5eiIvPgo8L3N2Zz4K&labelColor=000)](https://zuplo.com) [![Join the community on Discord](https://img.shields.io/badge/Chat%20on%20discord-5865F2.svg?style=for-the-badge&logo=discord&labelColor=000000&logoWidth=20)](https://discord.com/channels/848913990360629268/1235294876778627246)

</div>

Expand All @@ -36,11 +32,7 @@

Because great API documentation frameworks should always be:

✅ Free<br />
✅ OpenAPI powered<br />
✅ Extensible<br />
✅ Low barrier to entry<br />
✅ Easy to maintain
✅ Free<br /> ✅ OpenAPI powered<br /> ✅ Extensible<br /> ✅ Low barrier to entry<br /> ✅ Easy to maintain

## 🤩 Try it, right now!

Expand Down
4 changes: 1 addition & 3 deletions docs/pages/docs/markdown/admonitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ Hello world

<!-- Prettier changes this -->

:::note
Hello world
:::
:::note Hello world :::

<!-- to this -->

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
title: Zudoku Plugins
---

Zudoku can be extended using plugins.
Zudoku can be extended using plugins.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "zudoku-root",
"name": "root",
"private": true,
"version": "0.0.0",
"type": "module",
Expand All @@ -10,7 +10,7 @@
"format": "prettier --write .",
"format:ci": "prettier --check .",
"clean": "git clean -Xfde !.env",
"prepare": "husky prepare",
"prepare": "husky",
"release:pre": "gh workflow run release.yaml -f releaseType=prerelease",
"release:minor": "gh workflow run release.yaml -f releaseType=minor"
},
Expand Down
21 changes: 4 additions & 17 deletions packages/create-zudoku-app/LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
The MIT License (MIT)

Copyright (c) 2024 Vercel, Inc.
Copyright (c) 2024 Zuplo, Inc.
Copyright (c) 2024 Vercel, Inc. Copyright (c) 2024 Zuplo, Inc.

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:
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 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.
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.
6 changes: 2 additions & 4 deletions packages/create-zudoku-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ pnpm create zudoku-app
bunx create-zudoku-app
```

You will be asked for the name of your project, and then whether you want to
create a TypeScript project:
You will be asked for the name of your project, and then whether you want to create a TypeScript project:

```bash
✔ Would you like to use TypeScript? … No / Yes
Expand All @@ -27,8 +26,7 @@ Select **Yes** to install the necessary types/dependencies and create a new TS p

### Non-interactive

You can also pass command line arguments to set up a new project
non-interactively. See `create-zudoku-app --help`:
You can also pass command line arguments to set up a new project non-interactively. See `create-zudoku-app --help`:

```bash
Usage: create-zudoku-app [project-directory] [options]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
title: Example 1
description: This is what the description would look like, for example.
---
---
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
title: Another example
---

Add your MDX power, right here!
Add your MDX power, right here!
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const useNavigation = () => {
const { getPluginSidebar, sidebars } = useZudoku();
const navItem = useTopNavigationItem();
const path = navItem?.id;
const currentSidebar = path ? sidebars[path] ?? [] : [];
const currentSidebar = path ? (sidebars[path] ?? []) : [];
const location = useLocation();

return useSuspenseQuery({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const RevealApiKey = ({ apiKey }: { apiKey: string }) => {
<Button
variant="outline"
onClick={() => {
navigator.clipboard.writeText(apiKey).then(() => {
void navigator.clipboard.writeText(apiKey).then(() => {
setCopied(true);
setTimeout(() => setCopied(false), 2000);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export const UrlDisplay = ({ host, path }: { host: string; path: string }) => {
.split("/")
.map((v) =>
v.startsWith("{") && v.endsWith("}")
? data.pathParams.find((part) => part.name === v.slice(1, -1))
?.value ?? v
? (data.pathParams.find((part) => part.name === v.slice(1, -1))
?.value ?? v)
: v,
)
.join("/"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const SchemaPropertyItem = ({
<div className="flex gap-2 items-center">
<code>{name}</code>
<span className="text-muted-foreground">
{schema.type === "array" && schema.items?.type ? (
{schema.type === "array" && schema.items.type ? (
<span>{schema.items.type}[]</span>
) : Array.isArray(schema.type) ? (
<span>{schema.type.join(" | ")}</span>
Expand Down
Loading

0 comments on commit d7bf49d

Please sign in to comment.