Skip to content

Commit

Permalink
Merge pull request #250 from kinde-oss/chore/prettier-update
Browse files Browse the repository at this point in the history
chore: pretter run
  • Loading branch information
DanielRivers authored Nov 28, 2024
2 parents f3093e3 + 3f20e7c commit c65d265
Show file tree
Hide file tree
Showing 90 changed files with 1,050 additions and 1,032 deletions.
5 changes: 0 additions & 5 deletions .prettierrc.json

This file was deleted.

32 changes: 16 additions & 16 deletions clientConfig/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
const packageJson = require('./package.json');
const packageJson = require("./package.json");

import babel from '@rollup/plugin-babel';
import {terser} from 'rollup-plugin-terser';
import tsPlugin from '@rollup/plugin-typescript';
import babel from "@rollup/plugin-babel";
import { terser } from "rollup-plugin-terser";
import tsPlugin from "@rollup/plugin-typescript";

export default {
plugins: [babel({babelHelpers: 'bundled'}), terser(), tsPlugin()],
input: './src/index.ts',
plugins: [babel({ babelHelpers: "bundled" }), terser(), tsPlugin()],
input: "./src/index.ts",
output: [
{
file: packageJson.module,
format: 'esm',
format: "esm",
sourcemap: true,
exports: 'named'
exports: "named",
},
{
file: packageJson.main,
format: 'cjs',
format: "cjs",
sourcemap: true,
exports: 'named'
}
exports: "named",
},
],
external: [
'react',
'react-dom',
'@kinde-oss/kinde-typescript-sdk',
'@kinde/jwt-decoder'
]
"react",
"react-dom",
"@kinde-oss/kinde-typescript-sdk",
"@kinde/jwt-decoder",
],
};
24 changes: 12 additions & 12 deletions componentConfig/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import babel from '@rollup/plugin-babel';
import {terser} from 'rollup-plugin-terser';
import tsPlugin from '@rollup/plugin-typescript';
import babel from "@rollup/plugin-babel";
import { terser } from "rollup-plugin-terser";
import tsPlugin from "@rollup/plugin-typescript";

export default {
plugins: [babel({babelHelpers: 'bundled'}), terser(), tsPlugin()],
input: 'src/components/index.js',
plugins: [babel({ babelHelpers: "bundled" }), terser(), tsPlugin()],
input: "src/components/index.js",
output: [
{
file: 'dist/components/cjs/index.js',
format: 'cjs',
file: "dist/components/cjs/index.js",
format: "cjs",
sourcemap: true,
exports: 'named'
exports: "named",
},
{
file: `dist/components/index.js`,
sourcemap: true,
exports: 'named',
format: 'esm'
}
exports: "named",
format: "esm",
},
],
external: ['react', '@kinde-oss/kinde-typescript-sdk']
external: ["react", "@kinde-oss/kinde-typescript-sdk"],
};
12 changes: 6 additions & 6 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
preset: "ts-jest",
testEnvironment: "jsdom",
transform: {
'^.+\\.(ts|tsx)?$': 'ts-jest',
'^.+\\.(js|jsx)$': 'babel-jest'
"^.+\\.(ts|tsx)?$": "ts-jest",
"^.+\\.(js|jsx)$": "babel-jest",
},
moduleNameMapper: {
uncrypto: 'uncrypto'
}
uncrypto: "uncrypto",
},
};
30 changes: 15 additions & 15 deletions middlewareConfig/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import babel from '@rollup/plugin-babel';
import {terser} from 'rollup-plugin-terser';
import tsPlugin from '@rollup/plugin-typescript';
import babel from "@rollup/plugin-babel";
import { terser } from "rollup-plugin-terser";
import tsPlugin from "@rollup/plugin-typescript";

export default {
plugins: [babel({babelHelpers: 'bundled'}), terser(), tsPlugin()],
input: 'src/middleware/index.js',
plugins: [babel({ babelHelpers: "bundled" }), terser(), tsPlugin()],
input: "src/middleware/index.js",
output: [
{
file: 'dist/middleware/cjs/index.js',
format: 'cjs',
file: "dist/middleware/cjs/index.js",
format: "cjs",
sourcemap: true,
exports: 'named'
exports: "named",
},
{
file: `dist/middleware/index.js`,
sourcemap: true,
exports: 'named',
format: 'esm'
}
exports: "named",
format: "esm",
},
],
external: [
'@kinde-oss/kinde-typescript-sdk',
'next/server',
'@kinde/jwt-decoder'
]
"@kinde-oss/kinde-typescript-sdk",
"next/server",
"@kinde/jwt-decoder",
],
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"eslint-config-prettier": "^8.8.0",
"genversion": "^3.1.1",
"happy-dom": "^15.11.6",
"prettier": "^3.0.1",
"prettier": "^3.4.1",
"release-it": "^16.1.3",
"rollup": "^2.73.0",
"rollup-plugin-terser": "^7.0.2",
Expand Down
2 changes: 1 addition & 1 deletion playground/src/app/api/auth/[...kindeAuth]/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import {handleAuth} from '@kinde-oss/kinde-auth-nextjs/server';
import { handleAuth } from "@kinde-oss/kinde-auth-nextjs/server";

export const GET = handleAuth();
12 changes: 6 additions & 6 deletions playground/src/app/api/protected/route.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {getKindeServerSession} from '@kinde-oss/kinde-auth-nextjs/server';
import {NextResponse} from 'next/server';
import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server";
import { NextResponse } from "next/server";

export async function GET() {
const {getUser, isAuthenticated} = getKindeServerSession();
const { getUser, isAuthenticated } = getKindeServerSession();

if (!(await isAuthenticated())) {
return new Response('Unauthorized', {status: 401});
return new Response("Unauthorized", { status: 401 });
}

const user = await getUser();
const data = {message: 'Hello User', id: user?.given_name};
const data = { message: "Hello User", id: user?.given_name };

return NextResponse.json({data});
return NextResponse.json({ data });
}
6 changes: 3 additions & 3 deletions playground/src/app/api/public/route.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {NextResponse} from 'next/server';
import { NextResponse } from "next/server";

export async function GET() {
const data = {message: 'Hello world'};
const data = { message: "Hello world" };

return NextResponse.json({data});
return NextResponse.json({ data });
}
2 changes: 1 addition & 1 deletion playground/src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
--g-box-shadow: 0px 6px 12px rgba(18, 20, 23, 0.06),
0px 15px 24px rgba(18, 20, 23, 0.07), 0px -4px 12px rgba(18, 20, 23, 0.05);

--g-font-family: 'Helvetica';
--g-font-family: "Helvetica";

--g-font-size-x-small: 0.75rem; /* 12px */
--g-font-size-small: 0.875rem; /* 14px */
Expand Down
20 changes: 10 additions & 10 deletions playground/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import './globals.css';
import "./globals.css";
import {
RegisterLink,
LoginLink,
LogoutLink
} from '@kinde-oss/kinde-auth-nextjs/components';
import {getKindeServerSession} from '@kinde-oss/kinde-auth-nextjs/server';
import Link from 'next/link';
LogoutLink,
} from "@kinde-oss/kinde-auth-nextjs/components";
import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server";
import Link from "next/link";

export const metadata = {
title: 'Kinde Auth',
description: 'Kinde with NextJS App Router'
title: "Kinde Auth",
description: "Kinde with NextJS App Router",
};

export default async function RootLayout({
children
children,
}: {
children: React.ReactNode;
}) {
const {isAuthenticated, getUser} = getKindeServerSession();
const { isAuthenticated, getUser } = getKindeServerSession();
const user = await getUser();
return (
<html lang="en">
Expand Down Expand Up @@ -65,7 +65,7 @@ export default async function RootLayout({
<div className="container">
<strong className="text-heading-2">KindeAuth</strong>
<p className="footer-tagline text-body-3">
Visit our{' '}
Visit our{" "}
<Link className="link" href="https://kinde.com/docs">
help center
</Link>
Expand Down
2 changes: 1 addition & 1 deletion playground/src/app/page.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@

.center::before,
.center::after {
content: '';
content: "";
left: 50%;
position: absolute;
filter: blur(45px);
Expand Down
2 changes: 1 addition & 1 deletion playground/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Link from 'next/link';
import Link from "next/link";

export default function Home() {
return (
Expand Down
4 changes: 2 additions & 2 deletions playground/src/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {withAuth} from '@kinde-oss/kinde-auth-nextjs/middleware';
import { withAuth } from "@kinde-oss/kinde-auth-nextjs/middleware";

export default function middleware(req: Request) {
return withAuth(req);
}

export const config = {
matcher: ['/dashboard']
matcher: ["/dashboard"],
};
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
packages:
- 'playground'
- "playground"
8 changes: 4 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import clientConfig from './clientConfig/rollup.config.js';
import serverConfig from './serverConfig/rollup.config.js';
import componentConfig from './componentConfig/rollup.config.js';
import middlewareConfig from './middlewareConfig/rollup.config.js';
import clientConfig from "./clientConfig/rollup.config.js";
import serverConfig from "./serverConfig/rollup.config.js";
import componentConfig from "./componentConfig/rollup.config.js";
import middlewareConfig from "./middlewareConfig/rollup.config.js";

export default [clientConfig, serverConfig, componentConfig, middlewareConfig];
36 changes: 18 additions & 18 deletions serverConfig/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import babel from '@rollup/plugin-babel';
import {terser} from 'rollup-plugin-terser';
import tsPlugin from '@rollup/plugin-typescript';
import babel from "@rollup/plugin-babel";
import { terser } from "rollup-plugin-terser";
import tsPlugin from "@rollup/plugin-typescript";

export default {
plugins: [babel({babelHelpers: 'bundled'}), terser(), tsPlugin()],
input: 'src/server/index.js',
plugins: [babel({ babelHelpers: "bundled" }), terser(), tsPlugin()],
input: "src/server/index.js",
output: [
{
file: 'dist/server/cjs/index.js',
format: 'cjs',
file: "dist/server/cjs/index.js",
format: "cjs",
sourcemap: true,
exports: 'named'
exports: "named",
},
{
file: `dist/server/index.js`,
sourcemap: true,
exports: 'named',
format: 'esm'
}
exports: "named",
format: "esm",
},
],
external: [
'next/server',
'next/navigation',
'next/headers',
'react',
'@kinde-oss/kinde-typescript-sdk',
'@kinde/jwt-decoder'
]
"next/server",
"next/navigation",
"next/headers",
"react",
"@kinde-oss/kinde-typescript-sdk",
"@kinde/jwt-decoder",
],
};
Loading

0 comments on commit c65d265

Please sign in to comment.