From a8e7fc3ba18890e3f0554664ada41afb48c93340 Mon Sep 17 00:00:00 2001 From: Noam Honig Date: Mon, 13 May 2024 10:18:23 +0300 Subject: [PATCH] updated next app router example --- .../nextjs-app-router-todo/package-lock.json | 81 ++++++++++++------- examples/nextjs-app-router-todo/package.json | 4 +- projects/core/src/remult3/remult3.ts | 2 + 3 files changed, 55 insertions(+), 32 deletions(-) diff --git a/examples/nextjs-app-router-todo/package-lock.json b/examples/nextjs-app-router-todo/package-lock.json index d88bb4d15..b6240e779 100644 --- a/examples/nextjs-app-router-todo/package-lock.json +++ b/examples/nextjs-app-router-todo/package-lock.json @@ -12,10 +12,10 @@ "@types/react": "18.2.6", "@types/react-dom": "18.2.4", "next": "14.1.1", - "next-auth": "^4.22.1", + "next-auth": "^4.24.7", "react": "18.2.0", "react-dom": "18.2.0", - "remult": "^0.20.6", + "remult": "^0.26.11", "typescript": "5.0.4" } }, @@ -170,6 +170,17 @@ "node": ">= 10" } }, + "node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@panva/hkdf": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@panva/hkdf/-/hkdf-1.1.1.tgz", @@ -178,6 +189,14 @@ "url": "https://github.com/sponsors/panva" } }, + "node_modules/@paralleldrive/cuid2": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@paralleldrive/cuid2/-/cuid2-2.2.2.tgz", + "integrity": "sha512-ZOBkgDwEdoYVlSeRbYYXs0S9MejQofiVYoTbKzy/6GQa39/q5tQU2IX46+shYnUkpEl3wc+J6wRlar7r2EK2xA==", + "dependencies": { + "@noble/hashes": "^1.1.5" + } + }, "node_modules/@swc/helpers": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.2.tgz", @@ -267,12 +286,6 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, - "node_modules/cuid": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/cuid/-/cuid-2.1.8.tgz", - "integrity": "sha512-xiEMER6E7TlTPnDxrM4eRiC6TRgjNX9xzEZ5U/Se2YJKr7Mq4pJn/2XEHjl3STcSh96GmkHPcBXLES8M29wyyg==", - "deprecated": "Cuid and other k-sortable and non-cryptographic ids (Ulid, ObjectId, KSUID, all UUIDs) are all insecure. Use @paralleldrive/cuid2 instead." - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -376,14 +389,14 @@ } }, "node_modules/next-auth": { - "version": "4.22.1", - "resolved": "https://registry.npmjs.org/next-auth/-/next-auth-4.22.1.tgz", - "integrity": "sha512-NTR3f6W7/AWXKw8GSsgSyQcDW6jkslZLH8AiZa5PQ09w1kR8uHtR9rez/E9gAq/o17+p0JYHE8QjF3RoniiObA==", + "version": "4.24.7", + "resolved": "https://registry.npmjs.org/next-auth/-/next-auth-4.24.7.tgz", + "integrity": "sha512-iChjE8ov/1K/z98gdKbn2Jw+2vLgJtVV39X+rCP5SGnVQuco7QOr19FRNGMIrD8d3LYhHWV9j9sKLzq1aDWWQQ==", "dependencies": { "@babel/runtime": "^7.20.13", "@panva/hkdf": "^1.0.2", "cookie": "^0.5.0", - "jose": "^4.11.4", + "jose": "^4.15.5", "oauth": "^0.9.15", "openid-client": "^5.4.0", "preact": "^10.6.3", @@ -391,7 +404,7 @@ "uuid": "^8.3.2" }, "peerDependencies": { - "next": "^12.2.5 || ^13", + "next": "^12.2.5 || ^13 || ^14", "nodemailer": "^6.6.5", "react": "^17.0.2 || ^18", "react-dom": "^17.0.2 || ^18" @@ -528,11 +541,11 @@ "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" }, "node_modules/remult": { - "version": "0.20.6", - "resolved": "https://registry.npmjs.org/remult/-/remult-0.20.6.tgz", - "integrity": "sha512-hrQiAncivyB9n/ZxAWaYmqkuB1Ym/heRCRQ7Gd7dUirAgannGvKm80tGwxMUD5/zNu+4UWB4570OqEW0Ap1aug==", + "version": "0.26.11", + "resolved": "https://registry.npmjs.org/remult/-/remult-0.26.11.tgz", + "integrity": "sha512-uy/o/UG8e/uvzGBPDOibCc/4FE94HufhL6eFQc73dRFvNwsee4PgjX4/qZr+3rqsPEfkUT8Idg8Ny5O0Vj1JnA==", "dependencies": { - "cuid": "^2.1.8", + "@paralleldrive/cuid2": "^2.2.1", "reflect-metadata": "^0.1.13", "tslib": "^2.3.1", "uuid": "^8.3.2" @@ -683,11 +696,24 @@ "integrity": "sha512-S6K6EHDU5+1KrBDLko7/c1MNy/Ya73pIAmvKeFwsF4RmBFJSO7/7YeD4FnZ4iBdzE69PpQ4sOMU9ORKeNuxe8A==", "optional": true }, + "@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==" + }, "@panva/hkdf": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@panva/hkdf/-/hkdf-1.1.1.tgz", "integrity": "sha512-dhPeilub1NuIG0X5Kvhh9lH4iW3ZsHlnzwgwbOlgwQ2wG1IqFzsgHqmKPk3WzsdWAeaxKJxgM0+W433RmN45GA==" }, + "@paralleldrive/cuid2": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@paralleldrive/cuid2/-/cuid2-2.2.2.tgz", + "integrity": "sha512-ZOBkgDwEdoYVlSeRbYYXs0S9MejQofiVYoTbKzy/6GQa39/q5tQU2IX46+shYnUkpEl3wc+J6wRlar7r2EK2xA==", + "requires": { + "@noble/hashes": "^1.1.5" + } + }, "@swc/helpers": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.2.tgz", @@ -757,11 +783,6 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, - "cuid": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/cuid/-/cuid-2.1.8.tgz", - "integrity": "sha512-xiEMER6E7TlTPnDxrM4eRiC6TRgjNX9xzEZ5U/Se2YJKr7Mq4pJn/2XEHjl3STcSh96GmkHPcBXLES8M29wyyg==" - }, "graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -822,14 +843,14 @@ } }, "next-auth": { - "version": "4.22.1", - "resolved": "https://registry.npmjs.org/next-auth/-/next-auth-4.22.1.tgz", - "integrity": "sha512-NTR3f6W7/AWXKw8GSsgSyQcDW6jkslZLH8AiZa5PQ09w1kR8uHtR9rez/E9gAq/o17+p0JYHE8QjF3RoniiObA==", + "version": "4.24.7", + "resolved": "https://registry.npmjs.org/next-auth/-/next-auth-4.24.7.tgz", + "integrity": "sha512-iChjE8ov/1K/z98gdKbn2Jw+2vLgJtVV39X+rCP5SGnVQuco7QOr19FRNGMIrD8d3LYhHWV9j9sKLzq1aDWWQQ==", "requires": { "@babel/runtime": "^7.20.13", "@panva/hkdf": "^1.0.2", "cookie": "^0.5.0", - "jose": "^4.11.4", + "jose": "^4.15.5", "oauth": "^0.9.15", "openid-client": "^5.4.0", "preact": "^10.6.3", @@ -924,11 +945,11 @@ "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" }, "remult": { - "version": "0.20.6", - "resolved": "https://registry.npmjs.org/remult/-/remult-0.20.6.tgz", - "integrity": "sha512-hrQiAncivyB9n/ZxAWaYmqkuB1Ym/heRCRQ7Gd7dUirAgannGvKm80tGwxMUD5/zNu+4UWB4570OqEW0Ap1aug==", + "version": "0.26.11", + "resolved": "https://registry.npmjs.org/remult/-/remult-0.26.11.tgz", + "integrity": "sha512-uy/o/UG8e/uvzGBPDOibCc/4FE94HufhL6eFQc73dRFvNwsee4PgjX4/qZr+3rqsPEfkUT8Idg8Ny5O0Vj1JnA==", "requires": { - "cuid": "^2.1.8", + "@paralleldrive/cuid2": "^2.2.1", "reflect-metadata": "^0.1.13", "tslib": "^2.3.1", "uuid": "^8.3.2" diff --git a/examples/nextjs-app-router-todo/package.json b/examples/nextjs-app-router-todo/package.json index bff612287..4d31ddd50 100644 --- a/examples/nextjs-app-router-todo/package.json +++ b/examples/nextjs-app-router-todo/package.json @@ -13,10 +13,10 @@ "@types/react": "18.2.6", "@types/react-dom": "18.2.4", "next": "14.1.1", - "next-auth": "^4.22.1", + "next-auth": "^4.24.7", "react": "18.2.0", "react-dom": "18.2.0", - "remult": "^0.20.6", + "remult": "^0.26.11", "typescript": "5.0.4" } } diff --git a/projects/core/src/remult3/remult3.ts b/projects/core/src/remult3/remult3.ts index 59c188428..64a4671f8 100644 --- a/projects/core/src/remult3/remult3.ts +++ b/projects/core/src/remult3/remult3.ts @@ -830,7 +830,9 @@ export const flags = { } //y2 - soft-delete-discussion https://discord.com/channels/975754286384418847/1230386433093533698/1230386433093533698 +//y1 - discuss next auth withRemult paradox //y1 - live query with count #436 +//y1 - maybe the default withRemult should by default use the data provider set by the remultExpress //y1 TODO - In the esm version of our tutorial - the imports are automatically .ts and not .js in react and not in vue //y1 TODO - consider id to also support keyof (id:['company','index']) - had problem with | (keyof Partial)[] & `entity`