jazz-react-auth-clerk 0.8.15 → 0.8.16

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { BrowserClerkAuth } from "jazz-browser-auth-clerk";
2
- import { useState, useMemo } from "react";
1
+ import { BrowserClerkAuth, } from "jazz-browser-auth-clerk";
2
+ import { useMemo, useState } from "react";
3
3
  export function useJazzClerkAuth(clerk) {
4
4
  const [state, setState] = useState({ errors: [] });
5
5
  const authMethod = useMemo(() => {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAA2B,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,UAAU,gBAAgB,CAAC,KAEhC;IACG,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAuB,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;IAEzE,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE;QAC5B,OAAO,IAAI,gBAAgB,CACvB;YACI,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;gBACf,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;gBACrB,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;oBACjB,GAAG,KAAK;oBACR,MAAM,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;iBAC9C,CAAC,CAAC,CAAC;YACR,CAAC;SACJ,EACD,KAAK,CACR,CAAC;IACN,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAEjB,OAAO,CAAC,UAAU,EAAE,KAAK,CAAU,CAAC;AACxC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,GAEjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,UAAU,gBAAgB,CAC9B,KAEC;IAED,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAuB,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;IAEzE,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE;QAC9B,OAAO,IAAI,gBAAgB,CACzB;YACE,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;gBACjB,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;gBACrB,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;oBACnB,GAAG,KAAK;oBACR,MAAM,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;iBAC5C,CAAC,CAAC,CAAC;YACN,CAAC;SACF,EACD,KAAK,CACN,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAEjB,OAAO,CAAC,UAAU,EAAE,KAAK,CAAU,CAAC;AACtC,CAAC"}
package/package.json CHANGED
@@ -1,19 +1,15 @@
1
1
  {
2
2
  "name": "jazz-react-auth-clerk",
3
- "version": "0.8.15",
3
+ "version": "0.8.16",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "src/index.tsx",
7
7
  "license": "MIT",
8
- "lint-staged": {
9
- "*.{ts,tsx}": "eslint --fix",
10
- "*.{js,jsx,mdx,json}": "prettier --write"
11
- },
12
8
  "dependencies": {
13
- "cojson": "0.8.12",
14
- "jazz-browser-auth-clerk": "0.8.15",
15
- "jazz-react": "0.8.15",
16
- "jazz-tools": "0.8.15"
9
+ "cojson": "0.8.16",
10
+ "jazz-browser-auth-clerk": "0.8.16",
11
+ "jazz-react": "0.8.16",
12
+ "jazz-tools": "0.8.16"
17
13
  },
18
14
  "peerDependencies": {
19
15
  "react": "^18.2.0"
@@ -23,8 +19,8 @@
23
19
  "typescript": "^5.3.3"
24
20
  },
25
21
  "scripts": {
26
- "lint": "eslint . --ext ts,tsx",
27
- "format": "prettier --write './src/**/*.{ts,tsx}'",
28
- "build": "npm run lint && rm -rf ./dist && tsc --sourceMap --outDir dist"
22
+ "format-and-lint": "biome check .",
23
+ "format-and-lint:fix": "biome check . --write",
24
+ "build": "rm -rf ./dist && tsc --sourceMap --outDir dist"
29
25
  }
30
26
  }
package/src/index.tsx CHANGED
@@ -1,25 +1,30 @@
1
- import { BrowserClerkAuth, type MinimalClerkClient } from "jazz-browser-auth-clerk";
2
- import { useState, useMemo } from "react";
1
+ import {
2
+ BrowserClerkAuth,
3
+ type MinimalClerkClient,
4
+ } from "jazz-browser-auth-clerk";
5
+ import { useMemo, useState } from "react";
3
6
 
4
- export function useJazzClerkAuth(clerk: MinimalClerkClient & {
7
+ export function useJazzClerkAuth(
8
+ clerk: MinimalClerkClient & {
5
9
  signOut: () => Promise<unknown>;
6
- }) {
7
- const [state, setState] = useState<{ errors: string[] }>({ errors: [] });
10
+ },
11
+ ) {
12
+ const [state, setState] = useState<{ errors: string[] }>({ errors: [] });
8
13
 
9
- const authMethod = useMemo(() => {
10
- return new BrowserClerkAuth(
11
- {
12
- onError: (error) => {
13
- void clerk.signOut();
14
- setState((state) => ({
15
- ...state,
16
- errors: [...state.errors, error.toString()],
17
- }));
18
- },
19
- },
20
- clerk,
21
- );
22
- }, [clerk.user]);
14
+ const authMethod = useMemo(() => {
15
+ return new BrowserClerkAuth(
16
+ {
17
+ onError: (error) => {
18
+ void clerk.signOut();
19
+ setState((state) => ({
20
+ ...state,
21
+ errors: [...state.errors, error.toString()],
22
+ }));
23
+ },
24
+ },
25
+ clerk,
26
+ );
27
+ }, [clerk.user]);
23
28
 
24
- return [authMethod, state] as const;
29
+ return [authMethod, state] as const;
25
30
  }
package/tsconfig.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "jsx": "react-jsx",
11
11
  "forceConsistentCasingInFileNames": true,
12
12
  "noUncheckedIndexedAccess": true,
13
- "esModuleInterop": true,
13
+ "esModuleInterop": true
14
14
  },
15
- "include": ["./src/**/*"],
15
+ "include": ["./src/**/*"]
16
16
  }
package/.eslintrc.cjs DELETED
@@ -1,24 +0,0 @@
1
- module.exports = {
2
- extends: [
3
- "eslint:recommended",
4
- "plugin:@typescript-eslint/recommended",
5
- "plugin:require-extensions/recommended",
6
- "prettier"
7
- ],
8
- parser: "@typescript-eslint/parser",
9
- plugins: ["@typescript-eslint", "require-extensions"],
10
- parserOptions: {
11
- project: "./tsconfig.json",
12
- tsconfigRootDir: __dirname,
13
- },
14
- ignorePatterns: [".eslint.cjs"],
15
- root: true,
16
- rules: {
17
- "no-unused-vars": "off",
18
- "@typescript-eslint/no-unused-vars": [
19
- "error",
20
- { argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
21
- ],
22
- "@typescript-eslint/no-floating-promises": "error",
23
- },
24
- }
package/.prettierrc.js DELETED
@@ -1,9 +0,0 @@
1
- /** @type {import("prettier").Config} */
2
- const config = {
3
- trailingComma: "all",
4
- tabWidth: 4,
5
- semi: true,
6
- singleQuote: false,
7
- };
8
-
9
- export default config;