Skip to content

Commit

Permalink
update astro, add prettier plugins, format
Browse files Browse the repository at this point in the history
  • Loading branch information
marcjulian committed Feb 2, 2024
1 parent 8c683e7 commit cc6ad98
Show file tree
Hide file tree
Showing 18 changed files with 204 additions and 236 deletions.
1 change: 1 addition & 0 deletions docs/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock.json
5 changes: 4 additions & 1 deletion docs/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{ "singleQuote": true }
{
"singleQuote": true,
"plugins": ["prettier-plugin-astro", "prettier-plugin-tailwindcss"]
}
1 change: 0 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
![basics](https://user-images.githubusercontent.com/4677417/186188965-73453154-fdec-4d6b-9c34-cb35c248ae5b.png)


## 🚀 Project Structure

Inside of your Astro project, you'll see the following folders and files:
Expand Down
355 changes: 161 additions & 194 deletions docs/package-lock.json

Large diffs are not rendered by default.

25 changes: 13 additions & 12 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,32 @@
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
"astro": "astro",
"format": "prettier --write ."
},
"dependencies": {
"@astrojs/alpinejs": "^0.3.1",
"@astrojs/react": "^3.0.7",
"@astrojs/sitemap": "^3.0.3",
"@astrojs/tailwind": "^5.0.3",
"@astrojs/alpinejs": "^0.4.0",
"@astrojs/react": "^3.0.9",
"@astrojs/sitemap": "^3.0.5",
"@astrojs/tailwind": "^5.1.0",
"@docsearch/react": "^3.3.4",
"alpinejs": "^3.13.3",
"astro": "^4.0.3",
"alpinejs": "^3.13.5",
"astro": "^4.3.1",
"astro-icon": "^0.8.2",
"astro-robots-txt": "^1.0.0",
"astro-seo": "^0.8.0",
"inter-ui": "^3.19.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tailwindcss": "^3.3.6"
"tailwindcss": "^3.4.1"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.10",
"@types/alpinejs": "^3.7.1",
"@types/alpinejs": "^3.13.6",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.1",
"prettier": "^3.1.0",
"prettier-plugin-astro": "^0.12.2",
"prettier-plugin-tailwindcss": "^0.5.9"
"prettier": "^3.2.4",
"prettier-plugin-astro": "^0.13.0",
"prettier-plugin-tailwindcss": "^0.5.11"
}
}
3 changes: 1 addition & 2 deletions docs/src/components/HeadCommon.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@
<script
defer
data-domain="nestjs-prisma.dev"
src="https://analytics.notiz.dev/js/plausible.outbound-links.js"
></script>
src="https://analytics.notiz.dev/js/plausible.outbound-links.js"></script>
6 changes: 3 additions & 3 deletions docs/src/components/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function SearchDialog({
setIsOpen(true);
setInitialQuery(e.key);
},
[setIsOpen, setInitialQuery]
[setIsOpen, setInitialQuery],
);

if (keyboardEvents) {
Expand Down Expand Up @@ -114,7 +114,7 @@ function SearchDialog({
});
}}
/>,
document.body
document.body,
)}
</>
);
Expand All @@ -125,7 +125,7 @@ export function Search() {
let [modifierKey, setModifierKey] = useState<string>('⌘');
useEffect(() => {
setModifierKey(
/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform) ? '⌘' : 'Ctrl '
/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform) ? '⌘' : 'Ctrl ',
);
}, []);

Expand Down
6 changes: 2 additions & 4 deletions docs/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,12 @@ export const examples: Example[] = [
},
{
name: 'Extensions',
description:
'Using the Prisma Client extension with nestjs-prisma',
description: 'Using the Prisma Client extension with nestjs-prisma',
link: 'https://github.com/notiz-dev/nestjs-prisma/tree/main/examples/extensions',
},
{
name: 'GraphQL',
description:
'NestJS app with GraphQL Apollo, Prisma and nestjs-prisma',
description: 'NestJS app with GraphQL Apollo, Prisma and nestjs-prisma',
link: 'https://github.com/notiz-dev/nestjs-prisma/tree/main/examples/graphql',
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/basic-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Basic Usage

## Prisma schema

`nestjs-prisma` requires the Prisma Client to be generated to the default output location (`./node_modules/.prisma/client`). The client will be imported from `@prisma/client`.
`nestjs-prisma` requires the Prisma Client to be generated to the default output location (`./node_modules/.prisma/client`). The client will be imported from `@prisma/client`.

```prisma
// prisma/schema.prisma
Expand Down
6 changes: 3 additions & 3 deletions docs/src/content/docs/custom-prisma-client-location.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This can be useful if you want to just use a **different location** or want to u

To use `nestjs-prisma` with custom output location for Prisma Client, you need to update to `[email protected]` or later and use `CustomPrismaModule` and `CustomPrismaService`.

Import `CustomPrismaModule` and provide a **unique** name and an **instance** of your `PrismaClient`. The unique name will be used to inject the `CustomPrismaService`.
Import `CustomPrismaModule` and provide a **unique** name and an **instance** of your `PrismaClient`. The unique name will be used to inject the `CustomPrismaService`.

```ts
import { Module } from '@nestjs/common';
Expand Down Expand Up @@ -63,7 +63,7 @@ import { PrismaClient } from '@notiz/prisma'; // 👈 update to your output dire
export class AppService {
constructor(
@Inject('PrismaServiceAuth') // 👈 use unique name to reference
private prisma: CustomPrismaService<PrismaClient> // specify PrismaClient for type-safety & auto-completion
private prisma: CustomPrismaService<PrismaClient>, // specify PrismaClient for type-safety & auto-completion
) {}

users() {
Expand Down Expand Up @@ -127,7 +127,7 @@ export class AppService {
@Inject('PrismaServiceAuth') // 👈 use unique name to reference
private prismaAuth: CustomPrismaService<PrismaAuth>,
@Inject('PrismaServiceCms') // 👈 use unique name to reference
private prismaCms: CustomPrismaService<PrismaCms>
private prismaCms: CustomPrismaService<PrismaCms>,
) {}

users() {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/exception-filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async function bootstrap() {
P2000: HttpStatus.BAD_REQUEST,
P2002: HttpStatus.CONFLICT,
P2025: HttpStatus.NOT_FOUND,
})
}),
);

await app.listen(3000);
Expand Down
8 changes: 4 additions & 4 deletions docs/src/content/docs/prisma-client-extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export class AppService {
constructor(
// ✅ use `ExtendedPrismaClient` type for correct type-safety of your extended PrismaClient
@Inject('PrismaService')
private prismaService: CustomPrismaService<ExtendedPrismaClient>
private prismaService: CustomPrismaService<ExtendedPrismaClient>,
) {}

users() {
Expand Down Expand Up @@ -185,7 +185,7 @@ export class AppService {
constructor(
// ✅ use `ExtendedPrismaClient` from extension for correct type-safety
@Inject('PrismaService')
private prismaService: CustomPrismaService<ExtendedPrismaClient>
private prismaService: CustomPrismaService<ExtendedPrismaClient>,
) {}

async usersPage() {
Expand Down Expand Up @@ -225,7 +225,7 @@ import { readReplicas } from '@prisma/extension-read-replicas';

export const extendedPrismaClient = new PrismaClient().$extends(
// update url to your read replica url
readReplicas({ url: 'postgresql://replica.example.com:5432/db' })
readReplicas({ url: 'postgresql://replica.example.com:5432/db' }),
);

export type ExtendedPrismaClient = typeof extendedPrismaClient;
Expand All @@ -243,7 +243,7 @@ export class AppService {
constructor(
// ✅ use `ExtendedPrismaClient` type for correct type-safety of your extended PrismaClient
@Inject('PrismaService')
private prismaService: CustomPrismaService<ExtendedPrismaClient>
private prismaService: CustomPrismaService<ExtendedPrismaClient>,
) {}

users() {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/prisma-middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function loggingMiddleware(): Prisma.Middleware {
const after = Date.now();

console.log(
`Query ${params.model}.${params.action} took ${after - before}ms`
`Query ${params.model}.${params.action} took ${after - before}ms`,
);

return result;
Expand Down
4 changes: 2 additions & 2 deletions docs/src/layouts/Base.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const { title } = Astro.props;
const formattedContentTitle = title ? `${title} - ${SITE.title}` : SITE.title;
---

<!DOCTYPE html>
<!doctype html>
<html lang="en" class="scroll-smooth">
<head>
<HeadCommon />
Expand Down Expand Up @@ -56,7 +56,7 @@ const formattedContentTitle = title ? `${title} - ${SITE.title}` : SITE.title;
</style>

<script is:inline>
if (
if (
localStorage.theme === 'dark' ||
(!('theme' in localStorage) &&
window.matchMedia('(prefers-color-scheme: dark)').matches)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/layouts/CustomDoc.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const currentPageMatch = currentPage.endsWith('/')
? currentPage.slice(0, -1)
: currentPage.slice(0);
const currentSection = navigation.find((section) =>
section.links.find((link) => link.link == currentPageMatch)
section.links.find((link) => link.link == currentPageMatch),
);
---

Expand Down
4 changes: 2 additions & 2 deletions docs/src/layouts/Doc.astro
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const currentPageMatch = currentPage.endsWith('/')
? currentPage.slice(0, -1)
: currentPage.slice(0);
const currentSection = navigation.find((section) =>
section.links.find((link) => link.link == currentPageMatch)
section.links.find((link) => link.link == currentPageMatch),
);
const currentFile = `src/content${currentPage.replace(/\/$/, '')}.md`;
Expand Down Expand Up @@ -47,7 +47,7 @@ const githubEditUrl = `${GITHUB_EDIT_URL}/${currentFile}`;
</header>

<div
class="prose prose-lg prose-pre:scrollbar:w-1.5 prose-pre:scrollbar:h-1.5 prose-pre:scrollbar:bg-transparent prose-pre:scrollbar-track:bg-gray-800 prose-pre:scrollbar-track:rounded prose-pre:scrollbar-thumb:bg-gray-600 prose-pre:scrollbar-thumb:rounded prose-h2:scroll-mt-24 prose-h3:scroll-mt-24 dark:prose-invert mt-6"
class="prose prose-lg mt-6 dark:prose-invert prose-h2:scroll-mt-24 prose-h3:scroll-mt-24 prose-pre:scrollbar:h-1.5 prose-pre:scrollbar:w-1.5 prose-pre:scrollbar:bg-transparent prose-pre:scrollbar-track:rounded prose-pre:scrollbar-track:bg-gray-800 prose-pre:scrollbar-thumb:rounded prose-pre:scrollbar-thumb:bg-gray-600"
>
<slot />
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/404.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Layout from '../layouts/Base.astro';
---

<Layout>
<main class="grid min-h-full place-items-center py-24 px-6 sm:py-32 lg:px-8">
<main class="grid min-h-full place-items-center px-6 py-24 sm:py-32 lg:px-8">
<div class="py-12 text-center sm:py-16 md:py-20 lg:py-24 xl:py-28">
<p
class="bg-gradient-to-r from-red-600 via-pink-600 to-violet-500 bg-clip-text text-base font-semibold text-transparent"
Expand All @@ -21,7 +21,7 @@ import Layout from '../layouts/Base.astro';
<div class="mt-10 flex items-center justify-center">
<a
href="/"
class="rounded-full border border-transparent bg-[#55b9f3] py-2 px-5 text-sm text-white transition-all hover:bg-[#55b9f3]/90"
class="rounded-full border border-transparent bg-[#55b9f3] px-5 py-2 text-sm text-white transition-all hover:bg-[#55b9f3]/90"
>
Go back home
</a>
Expand Down
4 changes: 2 additions & 2 deletions docs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"strict": true,
"importsNotUsedAsValues": "error",
"jsx": "react-jsx",
"jsxImportSource": "react"
}
"jsxImportSource": "react",
},
}

0 comments on commit cc6ad98

Please sign in to comment.