Skip to content

Commit f935c2e

Browse files
committed
chore: run prettier
1 parent 42b0454 commit f935c2e

33 files changed

+829
-766
lines changed

.eslintrc.cjs

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
module.exports = {
2-
root: true,
3-
extends: [
4-
'eslint:recommended',
5-
'plugin:@typescript-eslint/recommended',
6-
'plugin:svelte/recommended',
7-
'prettier'
8-
],
9-
parser: '@typescript-eslint/parser',
10-
plugins: ['@typescript-eslint'],
11-
parserOptions: {
12-
sourceType: 'module',
13-
ecmaVersion: 2020,
14-
extraFileExtensions: ['.svelte']
15-
},
16-
env: {
17-
browser: true,
18-
es2017: true,
19-
node: true
20-
},
21-
overrides: [
22-
{
23-
files: ['*.svelte'],
24-
parser: 'svelte-eslint-parser',
25-
parserOptions: {
26-
parser: '@typescript-eslint/parser'
27-
}
28-
}
29-
]
2+
root: true,
3+
extends: [
4+
"eslint:recommended",
5+
"plugin:@typescript-eslint/recommended",
6+
"plugin:svelte/recommended",
7+
"prettier",
8+
],
9+
parser: "@typescript-eslint/parser",
10+
plugins: ["@typescript-eslint"],
11+
parserOptions: {
12+
sourceType: "module",
13+
ecmaVersion: 2020,
14+
extraFileExtensions: [".svelte"],
15+
},
16+
env: {
17+
browser: true,
18+
es2017: true,
19+
node: true,
20+
},
21+
overrides: [
22+
{
23+
files: ["*.svelte"],
24+
parser: "svelte-eslint-parser",
25+
parserOptions: {
26+
parser: "@typescript-eslint/parser",
27+
},
28+
},
29+
],
3030
};

.github/workflows/build-test-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: actions/setup-node@v3
2828
with:
2929
node-version: ${{ matrix.node-version }}
30-
cache: 'pnpm'
30+
cache: "pnpm"
3131
- name: Enabling pre-post scripts
3232
run: pnpm config set enable-pre-post-scripts true
3333
- run: pnpm install

.prettierrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"plugins": ["prettier-plugin-svelte"],
3-
"overrides": [{"files": "*.svelte", "options": {"parser": "svelte"}}]
2+
"plugins": ["prettier-plugin-svelte"],
3+
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
44
}

.release-it.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
2-
"git": {
3-
"requireBranch": "main",
4-
"commitMessage": "chore: release v${version}"
5-
},
6-
"hooks": {
7-
"before:init": ["git pull", "npm run lint"],
8-
"after:bump": "npx auto-changelog -p && npm run build"
9-
},
10-
"github": {
11-
"release": true
12-
},
13-
"npm": {
14-
"publish": true
15-
}
2+
"git": {
3+
"requireBranch": "main",
4+
"commitMessage": "chore: release v${version}"
5+
},
6+
"hooks": {
7+
"before:init": ["git pull", "npm run lint"],
8+
"after:bump": "npx auto-changelog -p && npm run build"
9+
},
10+
"github": {
11+
"release": true
12+
},
13+
"npm": {
14+
"publish": true
15+
}
1616
}

.vscode/extensions.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"recommendations": [
3-
"yzhang.markdown-all-in-one",
4-
"editorconfig.editorconfig",
5-
"esbenp.prettier-vscode"
6-
]
2+
"recommendations": [
3+
"yzhang.markdown-all-in-one",
4+
"editorconfig.editorconfig",
5+
"esbenp.prettier-vscode"
6+
]
77
}

.vscode/settings.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"editor.defaultFormatter": "esbenp.prettier-vscode",
3-
"editor.codeActionsOnSave": {
4-
"source.fixAll": "explicit"
5-
},
6-
"editor.formatOnSave": true,
7-
"files.trimTrailingWhitespace": true,
8-
"markdown.extension.italic.indicator": "_",
9-
"markdown.extension.toc.unorderedList.marker": "-",
10-
"markdown.extension.toc.slugifyMode": "github",
11-
"markdown.preview.fontFamily": "system-ui, -apple-system, sans-serif",
12-
"files.associations": {
13-
"CODEOWNERS": "ini"
14-
}
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"editor.codeActionsOnSave": {
4+
"source.fixAll": "explicit"
5+
},
6+
"editor.formatOnSave": true,
7+
"files.trimTrailingWhitespace": true,
8+
"markdown.extension.italic.indicator": "_",
9+
"markdown.extension.toc.unorderedList.marker": "-",
10+
"markdown.extension.toc.slugifyMode": "github",
11+
"markdown.preview.fontFamily": "system-ui, -apple-system, sans-serif",
12+
"files.associations": {
13+
"CODEOWNERS": "ini"
14+
}
1515
}

src/app.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import {sessionStorage} from '$lib/sessionStorage/index.js';
1+
import { sessionStorage } from "$lib/sessionStorage/index.js";
22

33
// See https://kit.svelte.dev/docs/types#app
44
// for information about these interfaces
55
declare global {
6-
namespace KindeSDK {
7-
let SessionStorage: typeof sessionStorage;
8-
// interface Error {}
9-
// interface Locals {}
10-
// interface PageData {}
11-
// interface Platform {}
12-
}
6+
namespace KindeSDK {
7+
let SessionStorage: typeof sessionStorage;
8+
// interface Error {}
9+
// interface Locals {}
10+
// interface PageData {}
11+
// interface Platform {}
12+
}
1313
}
1414

1515
export {};

src/app.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8" />
5-
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1" />
7-
%sveltekit.head%
8-
</head>
9-
<body data-sveltekit-preload-data="hover">
10-
<div>%sveltekit.body%</div>
11-
</body>
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
%sveltekit.head%
8+
</head>
9+
<body data-sveltekit-preload-data="hover">
10+
<div>%sveltekit.body%</div>
11+
</body>
1212
</html>

src/hooks.server.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import {sessionHooks, type Handler} from '$lib/index.js';
1+
import { sessionHooks, type Handler } from "$lib/index.js";
22

3-
export const handle: Handler = async ({event, resolve}) => {
4-
sessionHooks({event});
3+
export const handle: Handler = async ({ event, resolve }) => {
4+
sessionHooks({ event });
55

6-
return await resolve(event);
6+
return await resolve(event);
77
};

src/lib/KindeSDK.ts

Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,59 @@
1-
import {kindeConfiguration, kindeAPIConfiguration} from '$lib/config/index.js';
2-
import {sessionStorage} from '$lib/sessionStorage/index.js';
1+
import {
2+
kindeConfiguration,
3+
kindeAPIConfiguration,
4+
} from "$lib/config/index.js";
5+
import { sessionStorage } from "$lib/sessionStorage/index.js";
36

47
import {
5-
GrantType,
6-
createKindeServerClient,
7-
type CCClientOptions,
8-
type SessionManager,
9-
type PKCEClientOptions,
10-
type ACClientOptions,
11-
Configuration,
12-
type ConfigurationParameters
13-
} from '@kinde-oss/kinde-typescript-sdk';
14-
import {omit} from './utils/index.js';
8+
GrantType,
9+
createKindeServerClient,
10+
type CCClientOptions,
11+
type SessionManager,
12+
type PKCEClientOptions,
13+
type ACClientOptions,
14+
Configuration,
15+
type ConfigurationParameters,
16+
} from "@kinde-oss/kinde-typescript-sdk";
17+
import { omit } from "./utils/index.js";
1518

1619
export const getToken = async () => {
17-
const kindeManagementApi = createKindeServerClient(
18-
GrantType.CLIENT_CREDENTIALS,
19-
kindeAPIConfiguration as unknown as CCClientOptions
20-
);
21-
return await kindeManagementApi.getToken(sessionStorage as unknown as SessionManager);
20+
const kindeManagementApi = createKindeServerClient(
21+
GrantType.CLIENT_CREDENTIALS,
22+
kindeAPIConfiguration as unknown as CCClientOptions,
23+
);
24+
return await kindeManagementApi.getToken(
25+
sessionStorage as unknown as SessionManager,
26+
);
2227
};
2328

2429
export const kindeAuthClient = createKindeServerClient(
25-
kindeConfiguration.authUsePKCE ? GrantType.PKCE : GrantType.AUTHORIZATION_CODE,
26-
omit(
27-
kindeConfiguration,
28-
kindeConfiguration.authUsePKCE ? ['authUsePKCE', 'clientSecret'] : ['authUsePKCE']
29-
) as unknown as PKCEClientOptions | ACClientOptions
30+
kindeConfiguration.authUsePKCE
31+
? GrantType.PKCE
32+
: GrantType.AUTHORIZATION_CODE,
33+
omit(
34+
kindeConfiguration,
35+
kindeConfiguration.authUsePKCE
36+
? ["authUsePKCE", "clientSecret"]
37+
: ["authUsePKCE"],
38+
) as unknown as PKCEClientOptions | ACClientOptions,
3039
);
3140

3241
export const getHeaders = async () => {
33-
return {
34-
Authorization: `Bearer ${await getToken()}`,
35-
Accept: 'application/json'
36-
};
42+
return {
43+
Authorization: `Bearer ${await getToken()}`,
44+
Accept: "application/json",
45+
};
3746
};
3847

39-
export const getConfiguration = async (configurationOverrides?: ConfigurationParameters) => {
40-
return new Configuration({
41-
basePath: kindeConfiguration.authDomain,
42-
accessToken: await getToken(),
43-
headers: {
44-
Accept: 'application/json'
45-
},
46-
...(configurationOverrides || {})
47-
});
48+
export const getConfiguration = async (
49+
configurationOverrides?: ConfigurationParameters,
50+
) => {
51+
return new Configuration({
52+
basePath: kindeConfiguration.authDomain,
53+
accessToken: await getToken(),
54+
headers: {
55+
Accept: "application/json",
56+
},
57+
...(configurationOverrides || {}),
58+
});
4859
};

0 commit comments

Comments
 (0)