cleanup internal package resolution

This commit is contained in:
Amruth Pillai
2025-01-13 11:53:42 +01:00
parent 51f38f0884
commit 0f8f2fe560
9 changed files with 66 additions and 60 deletions

View File

@ -30,14 +30,14 @@ export class GitHubStrategy extends PassportStrategy(Strategy, "github") {
let user: User | null = null; let user: User | null = null;
if (!email) throw new BadRequestException(); if (!email) throw new BadRequestException(ErrorMessage.InvalidCredentials);
try { try {
const user = const user =
(await this.userService.findOneByIdentifier(email)) ?? (await this.userService.findOneByIdentifier(email)) ??
(username && (await this.userService.findOneByIdentifier(username))); (username && (await this.userService.findOneByIdentifier(username)));
if (!user) throw new Error("User not found."); if (!user) throw new Error(ErrorMessage.InvalidCredentials);
done(null, user); done(null, user);
} catch { } catch {

View File

@ -30,14 +30,14 @@ export class GoogleStrategy extends PassportStrategy(Strategy, "google") {
let user: User | null = null; let user: User | null = null;
if (!email) throw new BadRequestException(); if (!email) throw new BadRequestException(ErrorMessage.InvalidCredentials);
try { try {
const user = const user =
(await this.userService.findOneByIdentifier(email)) ?? (await this.userService.findOneByIdentifier(email)) ??
(username && (await this.userService.findOneByIdentifier(username))); (username && (await this.userService.findOneByIdentifier(username)));
if (!user) throw new Error("User not found."); if (!user) throw new Error(ErrorMessage.InvalidCredentials);
done(null, user); done(null, user);
} catch { } catch {

View File

@ -8,10 +8,12 @@
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
}, },
"dependencies": { "peerDependencies": {
"@reactive-resume/utils": "*",
"zod": "^3.23.8", "zod": "^3.23.8",
"@paralleldrive/cuid2": "^2.2.2", "@paralleldrive/cuid2": "^2.2.2",
"@swc/helpers": "^0.5.15"
},
"devDependencies": {
"@swc/helpers": "~0.5.11" "@swc/helpers": "~0.5.11"
} }
} }

View File

@ -1,4 +1,4 @@
import { ResumeData } from "."; import { ResumeData } from "./index";
export const sampleResume: ResumeData = { export const sampleResume: ResumeData = {
basics: { basics: {

View File

@ -1,6 +1,6 @@
import { FilterKeys } from "@reactive-resume/utils";
import { z } from "zod"; import { z } from "zod";
import { FilterKeys } from "../shared";
import { idSchema } from "../shared"; import { idSchema } from "../shared";
import { awardSchema } from "./award"; import { awardSchema } from "./award";
import { certificationSchema } from "./certification"; import { certificationSchema } from "./certification";

View File

@ -1,3 +1,4 @@
export * from "./id"; export * from "./id";
export * from "./item"; export * from "./item";
export * from "./types";
export * from "./url"; export * from "./url";

View File

@ -0,0 +1,3 @@
export type FilterKeys<T, Condition> = {
[Key in keyof T]: T[Key] extends Condition ? Key : never;
}[keyof T];

View File

@ -95,7 +95,7 @@
"eslint-plugin-jsx-a11y": "^6.10.2", "eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-lingui": "^0.9.0", "eslint-plugin-lingui": "^0.9.0",
"eslint-plugin-prettier": "^5.2.1", "eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.3", "eslint-plugin-react": "^7.37.4",
"eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-simple-import-sort": "^12.1.1", "eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-tailwindcss": "^3.17.5", "eslint-plugin-tailwindcss": "^3.17.5",

102
pnpm-lock.yaml generated
View File

@ -574,8 +574,8 @@ importers:
specifier: ^5.2.1 specifier: ^5.2.1
version: 5.2.1(@types/eslint@8.56.5)(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.4.2) version: 5.2.1(@types/eslint@8.56.5)(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.4.2)
eslint-plugin-react: eslint-plugin-react:
specifier: ^7.37.3 specifier: ^7.37.4
version: 7.37.3(eslint@8.57.0) version: 7.37.4(eslint@8.57.0)
eslint-plugin-react-hooks: eslint-plugin-react-hooks:
specifier: ^4.6.2 specifier: ^4.6.2
version: 4.6.2(eslint@8.57.0) version: 4.6.2(eslint@8.57.0)
@ -6345,8 +6345,8 @@ packages:
peerDependencies: peerDependencies:
eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0
eslint-plugin-react@7.37.3: eslint-plugin-react@7.37.4:
resolution: {integrity: sha512-DomWuTQPFYZwF/7c9W2fkKkStqZmBd3uugfqBYLdkZ3Hii23WzZuOLUskGxB8qkSKqftxEeGL1TB2kMhrce0jA==} resolution: {integrity: sha512-BGP0jRmfYyvOyvMoRX/uoUeW+GqNj9y16bPQzqAHf3AYII/tDs+jMN0dBVkl88/OZwNGwrVFxE7riHsXVfy/LQ==}
engines: {node: '>=4'} engines: {node: '>=4'}
peerDependencies: peerDependencies:
eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7 eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7
@ -16805,7 +16805,7 @@ snapshots:
array-buffer-byte-length@1.0.1: array-buffer-byte-length@1.0.1:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
is-array-buffer: 3.0.4 is-array-buffer: 3.0.4
array-buffer-byte-length@1.0.2: array-buffer-byte-length@1.0.2:
@ -16817,12 +16817,12 @@ snapshots:
array-includes@3.1.8: array-includes@3.1.8:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
define-properties: 1.2.1 define-properties: 1.2.1
es-abstract: 1.23.3 es-abstract: 1.23.9
es-object-atoms: 1.0.0 es-object-atoms: 1.0.0
get-intrinsic: 1.2.4 get-intrinsic: 1.2.7
is-string: 1.0.7 is-string: 1.1.1
array-timsort@1.0.3: {} array-timsort@1.0.3: {}
@ -16830,9 +16830,9 @@ snapshots:
array.prototype.findlast@1.2.5: array.prototype.findlast@1.2.5:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
define-properties: 1.2.1 define-properties: 1.2.1
es-abstract: 1.23.3 es-abstract: 1.23.9
es-errors: 1.3.0 es-errors: 1.3.0
es-object-atoms: 1.0.0 es-object-atoms: 1.0.0
es-shim-unscopables: 1.0.2 es-shim-unscopables: 1.0.2
@ -16869,16 +16869,16 @@ snapshots:
array.prototype.tosorted@1.1.4: array.prototype.tosorted@1.1.4:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
define-properties: 1.2.1 define-properties: 1.2.1
es-abstract: 1.23.3 es-abstract: 1.23.9
es-errors: 1.3.0 es-errors: 1.3.0
es-shim-unscopables: 1.0.2 es-shim-unscopables: 1.0.2
arraybuffer.prototype.slice@1.0.3: arraybuffer.prototype.slice@1.0.3:
dependencies: dependencies:
array-buffer-byte-length: 1.0.1 array-buffer-byte-length: 1.0.1
call-bind: 1.0.7 call-bind: 1.0.8
define-properties: 1.2.1 define-properties: 1.2.1
es-abstract: 1.23.3 es-abstract: 1.23.3
es-errors: 1.3.0 es-errors: 1.3.0
@ -17297,8 +17297,8 @@ snapshots:
call-bind@1.0.8: call-bind@1.0.8:
dependencies: dependencies:
call-bind-apply-helpers: 1.0.1 call-bind-apply-helpers: 1.0.1
es-define-property: 1.0.0 es-define-property: 1.0.1
get-intrinsic: 1.2.4 get-intrinsic: 1.2.7
set-function-length: 1.2.2 set-function-length: 1.2.2
call-bound@1.0.3: call-bound@1.0.3:
@ -17859,7 +17859,7 @@ snapshots:
data-view-buffer@1.0.1: data-view-buffer@1.0.1:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
es-errors: 1.3.0 es-errors: 1.3.0
is-data-view: 1.0.1 is-data-view: 1.0.1
@ -17871,7 +17871,7 @@ snapshots:
data-view-byte-length@1.0.1: data-view-byte-length@1.0.1:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
es-errors: 1.3.0 es-errors: 1.3.0
is-data-view: 1.0.1 is-data-view: 1.0.1
@ -17883,7 +17883,7 @@ snapshots:
data-view-byte-offset@1.0.0: data-view-byte-offset@1.0.0:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
es-errors: 1.3.0 es-errors: 1.3.0
is-data-view: 1.0.1 is-data-view: 1.0.1
@ -18298,7 +18298,7 @@ snapshots:
define-properties: 1.2.1 define-properties: 1.2.1
es-abstract: 1.23.9 es-abstract: 1.23.9
es-errors: 1.3.0 es-errors: 1.3.0
es-set-tostringtag: 2.0.3 es-set-tostringtag: 2.1.0
function-bind: 1.1.2 function-bind: 1.1.2
get-intrinsic: 1.2.7 get-intrinsic: 1.2.7
globalthis: 1.0.4 globalthis: 1.0.4
@ -18344,8 +18344,8 @@ snapshots:
es-to-primitive@1.3.0: es-to-primitive@1.3.0:
dependencies: dependencies:
is-callable: 1.2.7 is-callable: 1.2.7
is-date-object: 1.0.5 is-date-object: 1.1.0
is-symbol: 1.0.4 is-symbol: 1.1.1
esbuild@0.17.19: esbuild@0.17.19:
optionalDependencies: optionalDependencies:
@ -18519,7 +18519,7 @@ snapshots:
dependencies: dependencies:
eslint: 8.57.0 eslint: 8.57.0
eslint-plugin-react@7.37.3(eslint@8.57.0): eslint-plugin-react@7.37.4(eslint@8.57.0):
dependencies: dependencies:
array-includes: 3.1.8 array-includes: 3.1.8
array.prototype.findlast: 1.2.5 array.prototype.findlast: 1.2.5
@ -19127,7 +19127,7 @@ snapshots:
function.prototype.name@1.1.6: function.prototype.name@1.1.6:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
define-properties: 1.2.1 define-properties: 1.2.1
es-abstract: 1.23.3 es-abstract: 1.23.3
functions-have-names: 1.2.3 functions-have-names: 1.2.3
@ -19194,7 +19194,7 @@ snapshots:
get-symbol-description@1.0.2: get-symbol-description@1.0.2:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
es-errors: 1.3.0 es-errors: 1.3.0
get-intrinsic: 1.2.4 get-intrinsic: 1.2.4
@ -19351,7 +19351,7 @@ snapshots:
has-property-descriptors@1.0.2: has-property-descriptors@1.0.2:
dependencies: dependencies:
es-define-property: 1.0.0 es-define-property: 1.0.1
has-proto@1.0.3: {} has-proto@1.0.3: {}
@ -19691,12 +19691,12 @@ snapshots:
is-arguments@1.1.1: is-arguments@1.1.1:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
has-tostringtag: 1.0.2 has-tostringtag: 1.0.2
is-array-buffer@3.0.4: is-array-buffer@3.0.4:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
get-intrinsic: 1.2.4 get-intrinsic: 1.2.4
is-array-buffer@3.0.5: is-array-buffer@3.0.5:
@ -19727,7 +19727,7 @@ snapshots:
is-boolean-object@1.1.2: is-boolean-object@1.1.2:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
has-tostringtag: 1.0.2 has-tostringtag: 1.0.2
is-boolean-object@1.2.1: is-boolean-object@1.2.1:
@ -19856,7 +19856,7 @@ snapshots:
is-shared-array-buffer@1.0.3: is-shared-array-buffer@1.0.3:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
is-shared-array-buffer@1.0.4: is-shared-array-buffer@1.0.4:
dependencies: dependencies:
@ -19877,7 +19877,7 @@ snapshots:
is-symbol@1.0.4: is-symbol@1.0.4:
dependencies: dependencies:
has-symbols: 1.0.3 has-symbols: 1.1.0
is-symbol@1.1.1: is-symbol@1.1.1:
dependencies: dependencies:
@ -19899,7 +19899,7 @@ snapshots:
is-weakref@1.0.2: is-weakref@1.0.2:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
is-weakref@1.1.0: is-weakref@1.1.0:
dependencies: dependencies:
@ -20469,8 +20469,8 @@ snapshots:
dependencies: dependencies:
array-includes: 3.1.8 array-includes: 3.1.8
array.prototype.flat: 1.3.2 array.prototype.flat: 1.3.2
object.assign: 4.1.5 object.assign: 4.1.7
object.values: 1.2.0 object.values: 1.2.1
jszip@3.10.1: jszip@3.10.1:
dependencies: dependencies:
@ -21600,7 +21600,7 @@ snapshots:
object.assign@4.1.5: object.assign@4.1.5:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
define-properties: 1.2.1 define-properties: 1.2.1
has-symbols: 1.0.3 has-symbols: 1.0.3
object-keys: 1.1.1 object-keys: 1.1.1
@ -21616,15 +21616,15 @@ snapshots:
object.entries@1.1.8: object.entries@1.1.8:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
define-properties: 1.2.1 define-properties: 1.2.1
es-object-atoms: 1.0.0 es-object-atoms: 1.0.0
object.fromentries@2.0.8: object.fromentries@2.0.8:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
define-properties: 1.2.1 define-properties: 1.2.1
es-abstract: 1.23.3 es-abstract: 1.23.9
es-object-atoms: 1.0.0 es-object-atoms: 1.0.0
object.groupby@1.0.3: object.groupby@1.0.3:
@ -22845,7 +22845,7 @@ snapshots:
regexp.prototype.flags@1.5.2: regexp.prototype.flags@1.5.2:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
define-properties: 1.2.1 define-properties: 1.2.1
es-errors: 1.3.0 es-errors: 1.3.0
set-function-name: 2.0.2 set-function-name: 2.0.2
@ -23009,7 +23009,7 @@ snapshots:
safe-array-concat@1.1.2: safe-array-concat@1.1.2:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
get-intrinsic: 1.2.4 get-intrinsic: 1.2.4
has-symbols: 1.0.3 has-symbols: 1.0.3
isarray: 2.0.5 isarray: 2.0.5
@ -23293,7 +23293,7 @@ snapshots:
side-channel@1.0.6: side-channel@1.0.6:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
es-errors: 1.3.0 es-errors: 1.3.0
get-intrinsic: 1.2.4 get-intrinsic: 1.2.4
object-inspect: 1.13.1 object-inspect: 1.13.1
@ -23526,7 +23526,7 @@ snapshots:
string.prototype.repeat@1.0.0: string.prototype.repeat@1.0.0:
dependencies: dependencies:
define-properties: 1.2.1 define-properties: 1.2.1
es-abstract: 1.23.3 es-abstract: 1.23.9
string.prototype.trim@1.2.10: string.prototype.trim@1.2.10:
dependencies: dependencies:
@ -23540,7 +23540,7 @@ snapshots:
string.prototype.trim@1.2.9: string.prototype.trim@1.2.9:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
define-properties: 1.2.1 define-properties: 1.2.1
es-abstract: 1.23.3 es-abstract: 1.23.3
es-object-atoms: 1.0.0 es-object-atoms: 1.0.0
@ -23560,7 +23560,7 @@ snapshots:
string.prototype.trimstart@1.0.8: string.prototype.trimstart@1.0.8:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
define-properties: 1.2.1 define-properties: 1.2.1
es-object-atoms: 1.0.0 es-object-atoms: 1.0.0
@ -24035,7 +24035,7 @@ snapshots:
typed-array-buffer@1.0.2: typed-array-buffer@1.0.2:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
es-errors: 1.3.0 es-errors: 1.3.0
is-typed-array: 1.1.13 is-typed-array: 1.1.13
@ -24047,7 +24047,7 @@ snapshots:
typed-array-byte-length@1.0.1: typed-array-byte-length@1.0.1:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
for-each: 0.3.3 for-each: 0.3.3
gopd: 1.0.1 gopd: 1.0.1
has-proto: 1.0.3 has-proto: 1.0.3
@ -24064,7 +24064,7 @@ snapshots:
typed-array-byte-offset@1.0.2: typed-array-byte-offset@1.0.2:
dependencies: dependencies:
available-typed-arrays: 1.0.7 available-typed-arrays: 1.0.7
call-bind: 1.0.7 call-bind: 1.0.8
for-each: 0.3.3 for-each: 0.3.3
gopd: 1.0.1 gopd: 1.0.1
has-proto: 1.0.3 has-proto: 1.0.3
@ -24082,7 +24082,7 @@ snapshots:
typed-array-length@1.0.6: typed-array-length@1.0.6:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
for-each: 0.3.3 for-each: 0.3.3
gopd: 1.0.1 gopd: 1.0.1
has-proto: 1.0.3 has-proto: 1.0.3
@ -24125,7 +24125,7 @@ snapshots:
unbox-primitive@1.0.2: unbox-primitive@1.0.2:
dependencies: dependencies:
call-bind: 1.0.7 call-bind: 1.0.8
has-bigints: 1.0.2 has-bigints: 1.0.2
has-symbols: 1.0.3 has-symbols: 1.0.3
which-boxed-primitive: 1.0.2 which-boxed-primitive: 1.0.2
@ -24556,7 +24556,7 @@ snapshots:
is-bigint: 1.0.4 is-bigint: 1.0.4
is-boolean-object: 1.1.2 is-boolean-object: 1.1.2
is-number-object: 1.0.7 is-number-object: 1.0.7
is-string: 1.0.7 is-string: 1.1.1
is-symbol: 1.0.4 is-symbol: 1.0.4
which-boxed-primitive@1.1.1: which-boxed-primitive@1.1.1:
@ -24593,7 +24593,7 @@ snapshots:
which-typed-array@1.1.15: which-typed-array@1.1.15:
dependencies: dependencies:
available-typed-arrays: 1.0.7 available-typed-arrays: 1.0.7
call-bind: 1.0.7 call-bind: 1.0.8
for-each: 0.3.3 for-each: 0.3.3
gopd: 1.0.1 gopd: 1.0.1
has-tostringtag: 1.0.2 has-tostringtag: 1.0.2