Skip to content

Commit

Permalink
chore: run Prettier (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey authored Nov 7, 2023
1 parent f76fa34 commit 83ccdee
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 35 deletions.
18 changes: 9 additions & 9 deletions app/entry.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
* For more information, see https://remix.run/file-conventions/entry.client
*/

import { RemixBrowser } from "@remix-run/react";
import { startTransition, StrictMode } from "react";
import { hydrateRoot } from "react-dom/client";
import { RemixBrowser } from '@remix-run/react'
import { startTransition, StrictMode } from 'react'
import { hydrateRoot } from 'react-dom/client'

startTransition(() => {
hydrateRoot(
document,
<StrictMode>
<RemixBrowser />
</StrictMode>
);
});
document,
<StrictMode>
<RemixBrowser />
</StrictMode>,
)
})
2 changes: 1 addition & 1 deletion app/entry.server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { PassThrough } from 'node:stream'
import type { EntryContext } from '@remix-run/node'
import { createReadableStreamFromReadable } from "@remix-run/node";
import { createReadableStreamFromReadable } from '@remix-run/node'
import { RemixServer } from '@remix-run/react'
import { renderToPipeableStream } from 'react-dom/server'
import { getSharedEnvs } from './utils/envs'
Expand Down
31 changes: 23 additions & 8 deletions app/routes/_layout+/_index.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,39 @@
import type { MetaFunction } from "@remix-run/node";
import type { MetaFunction } from '@remix-run/node'
import { Link } from '@remix-run/react'

export const meta: MetaFunction = () => [
{ title: 'Stripe Stack - Remix' },
{ description: `A Stripe focused Remix Stack that integrates User Subscriptions, Authentication and Testing. Driven by Prisma ORM. Deploys to Fly.io` },
{ keywords: 'remix, stripe, remix-stack, typescript, sqlite, postgresql, prisma, tailwindcss, fly.io' },
{
description: `A Stripe focused Remix Stack that integrates User Subscriptions, Authentication and Testing. Driven by Prisma ORM. Deploys to Fly.io`,
},
{
keywords:
'remix, stripe, remix-stack, typescript, sqlite, postgresql, prisma, tailwindcss, fly.io',
},
{ 'og:title': 'Stripe Stack - Remix' },
{ 'og:type': 'website' },
{ 'og:url': 'https://stripe-stack.fly.dev' },
{ 'og:image': 'https://raw.githubusercontent.com/dev-xo/dev-xo/main/stripe-stack/assets/images/Stripe-Thumbnail.png' },
{
'og:image':
'https://raw.githubusercontent.com/dev-xo/dev-xo/main/stripe-stack/assets/images/Stripe-Thumbnail.png',
},
{ 'og:card': 'summary_large_image' },
{ 'og:creator': '@DanielKanem' },
{ 'og:site': 'https://stripe-stack.fly.dev' },
{ 'og:description': `A Stripe focused Remix Stack that integrates User Subscriptions, Authentication and Testing. Driven by Prisma ORM. Deploys to Fly.io` },
{ 'twitter:image': 'https://raw.githubusercontent.com/dev-xo/dev-xo/main/stripe-stack/assets/images/Stripe-Thumbnail.png' },
{
'og:description': `A Stripe focused Remix Stack that integrates User Subscriptions, Authentication and Testing. Driven by Prisma ORM. Deploys to Fly.io`,
},
{
'twitter:image':
'https://raw.githubusercontent.com/dev-xo/dev-xo/main/stripe-stack/assets/images/Stripe-Thumbnail.png',
},
{ 'twitter:card': 'summary_large_image' },
{ 'twitter:creator': '@DanielKanem' },
{ 'twitter:title': 'Stripe Stack - Remix' },
{ 'twitter:description': `A Stripe focused Remix Stack that integrates User Subscriptions, Authentication and Testing. Driven by Prisma ORM. Deploys to Fly.io` },
];
{
'twitter:description': `A Stripe focused Remix Stack that integrates User Subscriptions, Authentication and Testing. Driven by Prisma ORM. Deploys to Fly.io`,
},
]

export default function Index() {
return (
Expand Down
4 changes: 3 additions & 1 deletion app/routes/api+/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ export async function action({ request }: ActionFunctionArgs) {
if (!user) throw new Error('User not found.')

// Cancel free subscription if user has a paid one.
const subscriptionsList = await stripe.subscriptions.list({ customer: customerId })
const subscriptionsList = await stripe.subscriptions.list({
customer: customerId,
})
const freeSubscriptions = subscriptionsList.data
.map((subscription) => {
return subscription.items.data.find(
Expand Down
8 changes: 4 additions & 4 deletions app/utils/db.server.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { PrismaClient } from "@prisma/client";
import { PrismaClient } from '@prisma/client'

import { singleton } from "./singleton.server";
import { singleton } from './singleton.server'

// Hard-code a unique key, so we can look up the client when this module gets re-imported
const db = singleton("prisma", () => new PrismaClient());
const db = singleton('prisma', () => new PrismaClient())

export { db };
export { db }
15 changes: 6 additions & 9 deletions app/utils/singleton.server.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
// Borrowed & modified from https://github.com/jenseng/abuse-the-platform/blob/main/app/utils/singleton.ts
// Thanks @jenseng!

export const singleton = <Value>(
name: string,
valueFactory: () => Value
): Value => {
const g = global as any;
g.__singletons ??= {};
g.__singletons[name] ??= valueFactory();
return g.__singletons[name];
};
export const singleton = <Value>(name: string, valueFactory: () => Value): Value => {
const g = global as any
g.__singletons ??= {}
g.__singletons[name] ??= valueFactory()
return g.__singletons[name]
}
6 changes: 3 additions & 3 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Config } from "tailwindcss";
import type { Config } from 'tailwindcss'

export default {
content: ["./app/**/*.{js,jsx,ts,tsx}"],
content: ['./app/**/*.{js,jsx,ts,tsx}'],
theme: {
extend: {},
},
plugins: [],
} satisfies Config;
} satisfies Config

0 comments on commit 83ccdee

Please sign in to comment.