From db13e534d045bf784b6c543245d989f4d1f4225a Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Mon, 12 Feb 2024 16:42:33 +0100 Subject: [PATCH 01/51] chore: fix issue with node-gyp and node-addon-api --- package.json | 4 +- pnpm-lock.yaml | 512 +++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 473 insertions(+), 43 deletions(-) diff --git a/package.json b/package.json index a5216b447..2fc3a3902 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,9 @@ "prettier": "^3.1.1", "turbo": "^1.11.2", "typescript": "^5.3.3", - "vitest": "^1.1.1" + "vitest": "^1.1.1", + "node-addon-api": "^7.1.0", + "node-gyp": "^10.0.1" }, "resolutions": { "sharp": "0.33.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 79a4b344a..f3bc009f6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -52,6 +52,12 @@ importers: husky: specifier: ^8.0.3 version: 8.0.3 + node-addon-api: + specifier: ^7.1.0 + version: 7.1.0 + node-gyp: + specifier: ^10.0.1 + version: 10.0.1 prettier: specifier: ^3.1.1 version: 3.1.1 @@ -6164,6 +6170,19 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.16.0 + /@npmcli/agent@2.2.1: + resolution: {integrity: sha512-H4FrOVtNyWC8MUwL3UfjOsAihHvT1Pe8POj3JvjXhSTJipsZMtgUALCT4mGyYZNxymkUfOw3PUj6dE4QPp6osQ==} + engines: {node: ^16.14.0 || >=18.0.0} + dependencies: + agent-base: 7.1.0 + http-proxy-agent: 7.0.0 + https-proxy-agent: 7.0.2 + lru-cache: 10.1.0 + socks-proxy-agent: 8.0.2 + transitivePeerDependencies: + - supports-color + dev: true + /@npmcli/fs@1.1.1: resolution: {integrity: sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==} requiresBuild: true @@ -6173,6 +6192,13 @@ packages: dev: false optional: true + /@npmcli/fs@3.1.0: + resolution: {integrity: sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + semver: 7.5.4 + dev: true + /@npmcli/move-file@1.1.2: resolution: {integrity: sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==} engines: {node: '>=10'} @@ -7246,7 +7272,7 @@ packages: detect-libc: 1.0.3 is-glob: 4.0.3 micromatch: 4.0.5 - node-addon-api: 7.0.0 + node-addon-api: 7.1.0 optionalDependencies: '@parcel/watcher-android-arm64': 2.3.0 '@parcel/watcher-darwin-arm64': 2.3.0 @@ -7356,7 +7382,7 @@ packages: react-refresh: 0.14.0 schema-utils: 3.3.0 source-map: 0.7.4 - webpack: 5.89.0(@swc/core@1.3.102) + webpack: 5.89.0(esbuild@0.19.11) /@pnpm/config.env-replace@1.1.0: resolution: {integrity: sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==} @@ -11320,6 +11346,11 @@ packages: requiresBuild: true dev: false + /abbrev@2.0.0: + resolution: {integrity: sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dev: true + /abort-controller@3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} engines: {node: '>=6.5'} @@ -12201,7 +12232,7 @@ packages: loader-utils: 2.0.4 make-dir: 3.1.0 schema-utils: 2.7.1 - webpack: 5.89.0(@swc/core@1.3.102) + webpack: 5.89.0(esbuild@0.19.11) /babel-plugin-add-module-exports@1.0.4: resolution: {integrity: sha512-g+8yxHUZ60RcyaUpfNzy56OtWW+x9cyEe9j+CranqLiqbju2yf/Cy6ZtYK40EZxtrdHllzlVZgLmcOUCTlJ7Jg==} @@ -12294,7 +12325,7 @@ packages: '@babel/core': 7.23.7 '@babel/runtime': 7.23.7 '@babel/types': 7.23.6 - gatsby: 5.13.1(@swc/core@1.3.102)(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3) + gatsby: 5.13.1(babel-eslint@10.1.0)(esbuild@0.19.11)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3) gatsby-core-utils: 4.13.0 /babel-plugin-syntax-trailing-function-commas@7.0.0-beta.0: @@ -12785,6 +12816,24 @@ packages: dev: false optional: true + /cacache@18.0.2: + resolution: {integrity: sha512-r3NU8h/P+4lVUHfeRw1dtgQYar3DZMm4/cm2bZgOvrFC/su7budSOeqh52VJIC4U4iG1WWwV6vRW0znqBvxNuw==} + engines: {node: ^16.14.0 || >=18.0.0} + dependencies: + '@npmcli/fs': 3.1.0 + fs-minipass: 3.0.3 + glob: 10.3.10 + lru-cache: 10.1.0 + minipass: 7.0.4 + minipass-collect: 2.0.1 + minipass-flush: 1.0.5 + minipass-pipeline: 1.2.4 + p-map: 4.0.0 + ssri: 10.0.5 + tar: 6.2.0 + unique-filename: 3.0.0 + dev: true + /cache-base@1.0.1: resolution: {integrity: sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==} engines: {node: '>=0.10.0'} @@ -14037,7 +14086,7 @@ packages: postcss-value-parser: 4.2.0 schema-utils: 3.3.0 semver: 7.5.4 - webpack: 5.89.0(@swc/core@1.3.102) + webpack: 5.89.0(esbuild@0.19.11) /css-minimizer-webpack-plugin@2.0.0(webpack@5.89.0): resolution: {integrity: sha512-cG/uc94727tx5pBNtb1Sd7gvUPzwmcQi1lkpfqTpdkuNq75hJCw7bIVsCNijLm4dhDcr1atvuysl2rZqOG8Txw==} @@ -14059,7 +14108,7 @@ packages: schema-utils: 3.3.0 serialize-javascript: 5.0.1 source-map: 0.6.1 - webpack: 5.89.0(@swc/core@1.3.102) + webpack: 5.89.0(esbuild@0.19.11) /css-select@4.3.0: resolution: {integrity: sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==} @@ -15862,8 +15911,6 @@ packages: resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} engines: {node: '>=6'} requiresBuild: true - dev: false - optional: true /env-paths@3.0.0: resolution: {integrity: sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==} @@ -15891,8 +15938,6 @@ packages: /err-code@2.0.3: resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==} requiresBuild: true - dev: false - optional: true /error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} @@ -16644,7 +16689,7 @@ packages: micromatch: 4.0.5 normalize-path: 3.0.0 schema-utils: 3.3.0 - webpack: 5.89.0(@swc/core@1.3.102) + webpack: 5.89.0(esbuild@0.19.11) /eslint@7.32.0: resolution: {integrity: sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==} @@ -16903,6 +16948,10 @@ packages: jest-util: 29.7.0 dev: true + /exponential-backoff@3.1.1: + resolution: {integrity: sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==} + dev: true + /express-basic-auth@1.2.1: resolution: {integrity: sha512-L6YQ1wQ/mNjVLAmK3AG1RK6VkokA1BIY6wmiH304Xtt/cLTps40EusZsU1Uop+v9lTDPxdtzbFmdXfFO3KEnwA==} dependencies: @@ -17317,7 +17366,7 @@ packages: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.89.0(@swc/core@1.3.102) + webpack: 5.89.0(esbuild@0.19.11) /file-system-cache@2.3.0: resolution: {integrity: sha512-l4DMNdsIPsVnKrgEXbJwDJsA5mB8rGwHYERMgqQx/xAUtChPJMre1bXBzDEqqVbWv9AIbFezXMxeEkZDSrXUOQ==} @@ -17673,7 +17722,7 @@ packages: semver: 7.5.4 tapable: 1.1.3 typescript: 5.3.3 - webpack: 5.89.0(@swc/core@1.3.102) + webpack: 5.89.0(esbuild@0.19.11) /form-data-encoder@2.1.4: resolution: {integrity: sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==} @@ -17809,6 +17858,13 @@ packages: dependencies: minipass: 3.3.6 + /fs-minipass@3.0.3: + resolution: {integrity: sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + minipass: 7.0.4 + dev: true + /fs-monkey@1.0.5: resolution: {integrity: sha512-8uMbBjrhzW76TYgEV27Y5E//W2f/lTFmx78P2w19FZSxarhI/798APGQyuGCwmkNxgwGRhrLfvWyLBvNtuOmew==} @@ -17940,7 +17996,7 @@ packages: dependencies: '@types/node-fetch': 2.6.10 fs-extra: 9.1.0 - gatsby: 5.13.1(@swc/core@1.3.102)(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3) + gatsby: 5.13.1(babel-eslint@10.1.0)(esbuild@0.19.11)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3) lodash: 4.17.21 node-fetch: 2.7.0 p-queue: 6.6.2 @@ -18056,7 +18112,7 @@ packages: chokidar: 3.5.3 fs-exists-cached: 1.0.0 fs-extra: 11.2.0 - gatsby: 5.13.1(@swc/core@1.3.102)(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3) + gatsby: 5.13.1(babel-eslint@10.1.0)(esbuild@0.19.11)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3) gatsby-core-utils: 4.13.0 gatsby-page-utils: 3.13.0 gatsby-plugin-utils: 4.13.0(gatsby@5.13.1)(graphql@16.8.1) @@ -18142,7 +18198,7 @@ packages: '@babel/preset-typescript': 7.23.3(@babel/core@7.23.7) '@babel/runtime': 7.23.7 babel-plugin-remove-graphql-queries: 5.13.0(@babel/core@7.23.7)(gatsby@5.13.1) - gatsby: 5.13.1(@swc/core@1.3.102)(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3) + gatsby: 5.13.1(babel-eslint@10.1.0)(esbuild@0.19.11)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3) transitivePeerDependencies: - supports-color @@ -18160,7 +18216,7 @@ packages: '@babel/runtime': 7.23.7 fastq: 1.16.0 fs-extra: 11.2.0 - gatsby: 5.13.1(@swc/core@1.3.102)(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3) + gatsby: 5.13.1(babel-eslint@10.1.0)(esbuild@0.19.11)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3) gatsby-core-utils: 4.13.0 gatsby-sharp: 1.13.0 graphql: 16.8.1 @@ -18454,6 +18510,212 @@ packages: - webpack-dev-server - webpack-hot-middleware - webpack-plugin-serve + dev: true + + /gatsby@5.13.1(babel-eslint@10.1.0)(esbuild@0.19.11)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3): + resolution: {integrity: sha512-y8VB381ZnHX3Xxc1n78AAAd+t0EsIyyIRtfqlSQ10CXwZHpZzBR3DTRoHmqIG3/NmdiqWhbHb/nRlmKZUzixtQ==} + engines: {node: '>=18.0.0'} + hasBin: true + requiresBuild: true + peerDependencies: + react: ^18.0.0 || ^0.0.0 + react-dom: ^18.0.0 || ^0.0.0 + dependencies: + '@babel/code-frame': 7.23.5 + '@babel/core': 7.23.7 + '@babel/eslint-parser': 7.23.3(@babel/core@7.23.7)(eslint@7.32.0) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/parser': 7.23.6 + '@babel/runtime': 7.23.7 + '@babel/traverse': 7.23.7 + '@babel/types': 7.23.6 + '@builder.io/partytown': 0.7.6 + '@gatsbyjs/reach-router': 2.0.1(react-dom@18.2.0)(react@18.2.0) + '@gatsbyjs/webpack-hot-middleware': 2.25.3 + '@graphql-codegen/add': 3.2.3(graphql@16.8.1) + '@graphql-codegen/core': 2.6.8(graphql@16.8.1) + '@graphql-codegen/plugin-helpers': 2.7.2(graphql@16.8.1) + '@graphql-codegen/typescript': 2.8.8(graphql@16.8.1) + '@graphql-codegen/typescript-operations': 2.5.13(graphql@16.8.1) + '@graphql-tools/code-file-loader': 7.3.23(@babel/core@7.23.7)(graphql@16.8.1) + '@graphql-tools/load': 7.8.14(graphql@16.8.1) + '@jridgewell/trace-mapping': 0.3.20 + '@nodelib/fs.walk': 1.2.8 + '@parcel/cache': 2.8.3(@parcel/core@2.8.3) + '@parcel/core': 2.8.3 + '@pmmmwh/react-refresh-webpack-plugin': 0.5.11(react-refresh@0.14.0)(webpack@5.89.0) + '@types/http-proxy': 1.17.14 + '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@7.32.0)(typescript@5.3.3) + '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@5.3.3) + '@vercel/webpack-asset-relocator-loader': 1.7.3 + acorn-loose: 8.4.0 + acorn-walk: 8.3.1 + address: 1.2.2 + anser: 2.1.1 + autoprefixer: 10.4.16(postcss@8.4.32) + axios: 0.21.4(debug@4.3.4) + babel-jsx-utils: 1.1.0 + babel-loader: 8.3.0(@babel/core@7.23.7)(webpack@5.89.0) + babel-plugin-add-module-exports: 1.0.4 + babel-plugin-dynamic-import-node: 2.3.3 + babel-plugin-lodash: 3.3.4 + babel-plugin-remove-graphql-queries: 5.13.0(@babel/core@7.23.7)(gatsby@5.13.1) + babel-preset-gatsby: 3.13.0(@babel/core@7.23.7)(core-js@3.35.0) + better-opn: 2.1.1 + bluebird: 3.7.2 + body-parser: 1.20.1 + browserslist: 4.22.2 + cache-manager: 2.11.1 + chalk: 4.1.2 + chokidar: 3.5.3 + common-tags: 1.8.2 + compression: 1.7.4 + cookie: 0.5.0 + core-js: 3.35.0 + cors: 2.8.5 + css-loader: 5.2.7(webpack@5.89.0) + css-minimizer-webpack-plugin: 2.0.0(webpack@5.89.0) + css.escape: 1.5.1 + date-fns: 2.30.0 + debug: 4.3.4 + deepmerge: 4.3.1 + detect-port: 1.5.1 + devcert: 1.2.2 + dotenv: 8.6.0 + enhanced-resolve: 5.15.0 + error-stack-parser: 2.1.4 + eslint: 7.32.0 + eslint-config-react-app: 6.0.0(@typescript-eslint/eslint-plugin@5.62.0)(@typescript-eslint/parser@5.62.0)(babel-eslint@10.1.0)(eslint-plugin-flowtype@5.10.0)(eslint-plugin-import@2.29.1)(eslint-plugin-jsx-a11y@6.8.0)(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.33.2)(eslint@7.32.0)(typescript@5.3.3) + eslint-plugin-flowtype: 5.10.0(eslint@7.32.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@5.62.0)(eslint@7.32.0) + eslint-plugin-jsx-a11y: 6.8.0(eslint@7.32.0) + eslint-plugin-react: 7.33.2(eslint@7.32.0) + eslint-plugin-react-hooks: 4.6.0(eslint@7.32.0) + eslint-webpack-plugin: 2.7.0(eslint@7.32.0)(webpack@5.89.0) + event-source-polyfill: 1.0.31 + execa: 5.1.1 + express: 4.18.2 + express-http-proxy: 1.6.3 + fastest-levenshtein: 1.0.16 + fastq: 1.16.0 + file-loader: 6.2.0(webpack@5.89.0) + find-cache-dir: 3.3.2 + fs-exists-cached: 1.0.0 + fs-extra: 11.2.0 + gatsby-cli: 5.13.1 + gatsby-core-utils: 4.13.0 + gatsby-graphiql-explorer: 3.13.0 + gatsby-legacy-polyfills: 3.13.0 + gatsby-link: 5.13.0(@gatsbyjs/reach-router@2.0.1)(react-dom@18.2.0)(react@18.2.0) + gatsby-page-utils: 3.13.0 + gatsby-parcel-config: 1.13.0(@parcel/core@2.8.3) + gatsby-plugin-page-creator: 5.13.0(gatsby@5.13.1)(graphql@16.8.1) + gatsby-plugin-typescript: 5.13.0(gatsby@5.13.1) + gatsby-plugin-utils: 4.13.0(gatsby@5.13.1)(graphql@16.8.1) + gatsby-react-router-scroll: 6.13.0(@gatsbyjs/reach-router@2.0.1)(react-dom@18.2.0)(react@18.2.0) + gatsby-script: 2.13.0(@gatsbyjs/reach-router@2.0.1)(react-dom@18.2.0)(react@18.2.0) + gatsby-telemetry: 4.13.0 + gatsby-worker: 2.13.0 + glob: 7.2.3 + globby: 11.1.0 + got: 11.8.6 + graphql: 16.8.1 + graphql-compose: 9.0.10(graphql@16.8.1) + graphql-http: 1.22.0(graphql@16.8.1) + graphql-tag: 2.12.6(graphql@16.8.1) + hasha: 5.2.2 + invariant: 2.2.4 + is-relative: 1.0.0 + is-relative-url: 3.0.0 + joi: 17.11.0 + json-loader: 0.5.7 + latest-version: 7.0.0 + linkfs: 2.1.0 + lmdb: 2.5.3 + lodash: 4.17.21 + meant: 1.0.3 + memoizee: 0.4.15 + micromatch: 4.0.5 + mime: 3.0.0 + mini-css-extract-plugin: 1.6.2(webpack@5.89.0) + mitt: 1.2.0 + moment: 2.30.1 + multer: 1.4.5-lts.1 + node-fetch: 2.7.0 + node-html-parser: 5.4.2 + normalize-path: 3.0.0 + null-loader: 4.0.1(webpack@5.89.0) + opentracing: 0.14.7 + p-defer: 3.0.0 + parseurl: 1.3.3 + path-to-regexp: 0.1.7 + physical-cpu-count: 2.0.0 + platform: 1.3.6 + postcss: 8.4.32 + postcss-flexbugs-fixes: 5.0.2(postcss@8.4.32) + postcss-loader: 5.3.0(postcss@8.4.32)(webpack@5.89.0) + prompts: 2.4.2 + prop-types: 15.8.1 + query-string: 6.14.1 + raw-loader: 4.0.2(webpack@5.89.0) + react: 18.2.0 + react-dev-utils: 12.0.1(eslint@7.32.0)(typescript@5.3.3)(webpack@5.89.0) + react-dom: 18.2.0(react@18.2.0) + react-refresh: 0.14.0 + react-server-dom-webpack: 0.0.0-experimental-c8b778b7f-20220825(react@18.2.0)(webpack@5.89.0) + redux: 4.2.1 + redux-thunk: 2.4.2(redux@4.2.1) + resolve-from: 5.0.0 + semver: 7.5.4 + shallow-compare: 1.2.2 + signal-exit: 3.0.7 + slugify: 1.6.6 + socket.io: 4.7.1 + socket.io-client: 4.7.1 + stack-trace: 0.0.10 + string-similarity: 1.2.2 + strip-ansi: 6.0.1 + style-loader: 2.0.0(webpack@5.89.0) + style-to-object: 0.4.4 + terser-webpack-plugin: 5.3.10(esbuild@0.19.11)(webpack@5.89.0) + tmp: 0.2.1 + true-case-path: 2.2.1 + type-of: 2.0.1 + url-loader: 4.1.1(file-loader@6.2.0)(webpack@5.89.0) + uuid: 8.3.2 + webpack: 5.89.0(esbuild@0.19.11) + webpack-dev-middleware: 4.3.0(webpack@5.89.0) + webpack-merge: 5.10.0 + webpack-stats-plugin: 1.1.3 + webpack-virtual-modules: 0.5.0 + xstate: 4.38.3 + yaml-loader: 0.8.0 + optionalDependencies: + gatsby-sharp: 1.13.0 + transitivePeerDependencies: + - '@swc/core' + - '@types/webpack' + - babel-eslint + - bufferutil + - clean-css + - csso + - encoding + - esbuild + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - eslint-plugin-jest + - eslint-plugin-testing-library + - sockjs-client + - supports-color + - type-fest + - typescript + - uglify-js + - utf-8-validate + - vue-template-compiler + - webpack-cli + - webpack-dev-server + - webpack-hot-middleware + - webpack-plugin-serve /gatsby@5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): resolution: {integrity: sha512-y8VB381ZnHX3Xxc1n78AAAd+t0EsIyyIRtfqlSQ10CXwZHpZzBR3DTRoHmqIG3/NmdiqWhbHb/nRlmKZUzixtQ==} @@ -20577,8 +20839,6 @@ packages: /is-lambda@1.0.1: resolution: {integrity: sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==} requiresBuild: true - dev: false - optional: true /is-lower-case@2.0.2: resolution: {integrity: sha512-bVcMJy4X5Og6VZfdOZstSexlEy20Sr0k/p/b2IlQJlfdKAQuMpiv5w2Ccxb8sKdRUNAG1PnHVHjFSdRDVS6NlQ==} @@ -20877,6 +21137,11 @@ packages: /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + /isexe@3.1.1: + resolution: {integrity: sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==} + engines: {node: '>=16'} + dev: true + /isobject@2.1.0: resolution: {integrity: sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==} engines: {node: '>=0.10.0'} @@ -22396,6 +22661,25 @@ packages: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} dev: false + /make-fetch-happen@13.0.0: + resolution: {integrity: sha512-7ThobcL8brtGo9CavByQrQi+23aIfgYU++wg4B87AIS8Rb2ZBt/MEaDqzA00Xwv/jUjAjYkLHjVolYuTLKda2A==} + engines: {node: ^16.14.0 || >=18.0.0} + dependencies: + '@npmcli/agent': 2.2.1 + cacache: 18.0.2 + http-cache-semantics: 4.1.1 + is-lambda: 1.0.1 + minipass: 7.0.4 + minipass-fetch: 3.0.4 + minipass-flush: 1.0.5 + minipass-pipeline: 1.2.4 + negotiator: 0.6.3 + promise-retry: 2.0.1 + ssri: 10.0.5 + transitivePeerDependencies: + - supports-color + dev: true + /make-fetch-happen@9.1.0: resolution: {integrity: sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==} engines: {node: '>= 10'} @@ -23232,7 +23516,7 @@ packages: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.89.0(@swc/core@1.3.102) + webpack: 5.89.0(esbuild@0.19.11) webpack-sources: 1.4.3 /mini-svg-data-uri@1.4.4: @@ -23284,6 +23568,13 @@ packages: dev: false optional: true + /minipass-collect@2.0.1: + resolution: {integrity: sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + minipass: 7.0.4 + dev: true + /minipass-fetch@1.4.1: resolution: {integrity: sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==} engines: {node: '>=8'} @@ -23297,14 +23588,23 @@ packages: dev: false optional: true + /minipass-fetch@3.0.4: + resolution: {integrity: sha512-jHAqnA728uUpIaFm7NWsCnqKT6UqZz7GcI/bDpPATuwYyKwJwW0remxSCxUlKiEty+eopHGa3oc8WxgQ1FFJqg==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + minipass: 7.0.4 + minipass-sized: 1.0.3 + minizlib: 2.1.2 + optionalDependencies: + encoding: 0.1.13 + dev: true + /minipass-flush@1.0.5: resolution: {integrity: sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==} engines: {node: '>= 8'} requiresBuild: true dependencies: minipass: 3.3.6 - dev: false - optional: true /minipass-pipeline@1.2.4: resolution: {integrity: sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==} @@ -23312,8 +23612,6 @@ packages: requiresBuild: true dependencies: minipass: 3.3.6 - dev: false - optional: true /minipass-sized@1.0.3: resolution: {integrity: sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==} @@ -23321,8 +23619,6 @@ packages: requiresBuild: true dependencies: minipass: 3.3.6 - dev: false - optional: true /minipass@3.3.6: resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} @@ -23792,8 +24088,9 @@ packages: /node-addon-api@4.3.0: resolution: {integrity: sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==} - /node-addon-api@7.0.0: - resolution: {integrity: sha512-vgbBJTS4m5/KkE16t5Ly0WW9hz46swAstv0hYYwMtbG7AznRhNyfLRe8HZAiWIpcHzoO7HxhLuBQj9rJ/Ho0ZA==} + /node-addon-api@7.1.0: + resolution: {integrity: sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g==} + engines: {node: ^16 || ^18 || >= 20} /node-dir@0.1.17: resolution: {integrity: sha512-tmPX422rYgofd4epzrNoOXiE8XFZYOcCq1vD7MAXCDO+O+zndlA2ztdKKMa+EeuBG5tHETpr4ml4RGgpqDCCAg==} @@ -23860,6 +24157,25 @@ packages: hasBin: true dev: false + /node-gyp@10.0.1: + resolution: {integrity: sha512-gg3/bHehQfZivQVfqIyy8wTdSymF9yTyP4CJifK73imyNMU8AIGQE2pUa7dNWfmMeG9cDVF2eehiRMv0LC1iAg==} + engines: {node: ^16.14.0 || >=18.0.0} + hasBin: true + dependencies: + env-paths: 2.2.1 + exponential-backoff: 3.1.1 + glob: 10.3.10 + graceful-fs: 4.2.11 + make-fetch-happen: 13.0.0 + nopt: 7.2.0 + proc-log: 3.0.0 + semver: 7.5.4 + tar: 6.2.0 + which: 4.0.0 + transitivePeerDependencies: + - supports-color + dev: true + /node-gyp@8.4.1: resolution: {integrity: sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==} engines: {node: '>= 10.12.0'} @@ -23956,6 +24272,14 @@ packages: abbrev: 1.1.1 dev: false + /nopt@7.2.0: + resolution: {integrity: sha512-CVDtwCdhYIvnAzFoJ6NJ6dX3oga9/HyciQDnG1vQDjSLMeKLJ4A93ZqYKDrgYSr1FBY5/hMYC+2VCi24pgpkGA==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + hasBin: true + dependencies: + abbrev: 2.0.0 + dev: true + /normalize-node-version@12.4.0: resolution: {integrity: sha512-0oLZN5xcyKVrSHMk8/9RuNblEe7HEsXAt5Te2xmMiZD9VX7bqWYe0HMyfqSYFD3xv0949lZuXaEwjTqle1uWWQ==} engines: {node: '>=14.18.0'} @@ -24065,7 +24389,7 @@ packages: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.89.0(@swc/core@1.3.102) + webpack: 5.89.0(esbuild@0.19.11) /nullthrows@1.1.1: resolution: {integrity: sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw==} @@ -25275,7 +25599,7 @@ packages: klona: 2.0.6 postcss: 8.4.32 semver: 7.5.4 - webpack: 5.89.0(@swc/core@1.3.102) + webpack: 5.89.0(esbuild@0.19.11) /postcss-merge-longhand@5.1.7(postcss@8.4.32): resolution: {integrity: sha512-YCI9gZB+PLNskrK0BB3/2OzPnGhPkBEwmwhfYk1ilBHYVAZB7/tkTHFBAnCrvBBOmeYyMYw3DMjT55SyxMBzjQ==} @@ -25905,6 +26229,11 @@ packages: - supports-color dev: false + /proc-log@3.0.0: + resolution: {integrity: sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dev: true + /process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} @@ -25955,8 +26284,6 @@ packages: dependencies: err-code: 2.0.3 retry: 0.12.0 - dev: false - optional: true /promise@7.3.1: resolution: {integrity: sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==} @@ -26242,7 +26569,7 @@ packages: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.89.0(@swc/core@1.3.102) + webpack: 5.89.0(esbuild@0.19.11) /rbush@3.0.1: resolution: {integrity: sha512-XRaVO0YecOpEuIvbhbpTrZgoiI6xBlz6hnlr6EHhd+0x9ase6EmeN+hdwwUaJvLcsFFQ8iWVF1GAK1yB0BWi0w==} @@ -26416,7 +26743,7 @@ packages: strip-ansi: 6.0.1 text-table: 0.2.0 typescript: 5.3.3 - webpack: 5.89.0(@swc/core@1.3.102) + webpack: 5.89.0(esbuild@0.19.11) transitivePeerDependencies: - eslint - supports-color @@ -26822,7 +27149,7 @@ packages: loose-envify: 1.4.0 neo-async: 2.6.2 react: 18.2.0 - webpack: 5.89.0(@swc/core@1.3.102) + webpack: 5.89.0(esbuild@0.19.11) /react-split-pane@0.1.92(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-GfXP1xSzLMcLJI5BM36Vh7GgZBpy+U/X0no+VM3fxayv+p1Jly5HpMofZJraeaMl73b3hvlr+N9zJKvLB/uz9w==} @@ -28435,8 +28762,6 @@ packages: resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} requiresBuild: true - dev: false - optional: true /snake-case@3.0.4: resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==} @@ -28535,6 +28860,17 @@ packages: dev: false optional: true + /socks-proxy-agent@8.0.2: + resolution: {integrity: sha512-8zuqoLv1aP/66PHF5TqwJ7Czm3Yv32urJQHrVyhD7mmA6d61Zv8cIXQYPTWwmg6qlupnPvs/QKDmfa4P/qct2g==} + engines: {node: '>= 14'} + dependencies: + agent-base: 7.1.0 + debug: 4.3.4 + socks: 2.7.1 + transitivePeerDependencies: + - supports-color + dev: true + /socks@2.7.1: resolution: {integrity: sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==} engines: {node: '>= 10.13.0', npm: '>= 3.0.0'} @@ -28542,8 +28878,6 @@ packages: dependencies: ip: 2.0.0 smart-buffer: 4.2.0 - dev: false - optional: true /sonic-boom@3.7.0: resolution: {integrity: sha512-IudtNvSqA/ObjN97tfgNmOKyDOs4dNcg4cUUsHDebqsgb8wGBBwb31LIgShNO8fye0dFI52X1+tFoKKI6Rq1Gg==} @@ -28763,6 +29097,13 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: true + /ssri@10.0.5: + resolution: {integrity: sha512-bSf16tAFkGeRlUNDjXu8FzaMQt6g2HZJrun7mtMbIPOddxt3GLMSz5VWUWcqTJUPfLEaDIepGxv+bYQW49596A==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + minipass: 7.0.4 + dev: true + /ssri@8.0.1: resolution: {integrity: sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==} engines: {node: '>= 8'} @@ -29177,7 +29518,7 @@ packages: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.89.0(@swc/core@1.3.102) + webpack: 5.89.0(esbuild@0.19.11) /style-to-object@0.3.0: resolution: {integrity: sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA==} @@ -29511,6 +29852,31 @@ packages: serialize-javascript: 6.0.1 terser: 5.26.0 webpack: 5.89.0(@swc/core@1.3.102) + dev: true + + /terser-webpack-plugin@5.3.10(esbuild@0.19.11)(webpack@5.89.0): + resolution: {integrity: sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==} + engines: {node: '>= 10.13.0'} + peerDependencies: + '@swc/core': '*' + esbuild: '*' + uglify-js: '*' + webpack: ^5.1.0 + peerDependenciesMeta: + '@swc/core': + optional: true + esbuild: + optional: true + uglify-js: + optional: true + dependencies: + '@jridgewell/trace-mapping': 0.3.20 + esbuild: 0.19.11 + jest-worker: 27.5.1 + schema-utils: 3.3.0 + serialize-javascript: 6.0.1 + terser: 5.26.0 + webpack: 5.89.0(esbuild@0.19.11) /terser-webpack-plugin@5.3.10(webpack@5.89.0): resolution: {integrity: sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==} @@ -30365,6 +30731,13 @@ packages: dev: false optional: true + /unique-filename@3.0.0: + resolution: {integrity: sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + unique-slug: 4.0.0 + dev: true + /unique-slug@2.0.2: resolution: {integrity: sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==} requiresBuild: true @@ -30373,6 +30746,13 @@ packages: dev: false optional: true + /unique-slug@4.0.0: + resolution: {integrity: sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + imurmurhash: 0.1.4 + dev: true + /unique-string@2.0.0: resolution: {integrity: sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==} engines: {node: '>=8'} @@ -30702,7 +31082,7 @@ packages: loader-utils: 2.0.4 mime-types: 2.1.35 schema-utils: 3.3.0 - webpack: 5.89.0(@swc/core@1.3.102) + webpack: 5.89.0(esbuild@0.19.11) /url@0.11.3: resolution: {integrity: sha512-6hxOLGfZASQK/cijlZnZJTq8OXAkt/3YGfQX45vvMYXpZoo8NdWZcY73K108Jf759lS1Bv/8wXnHDTSz17dSRw==} @@ -31546,7 +31926,7 @@ packages: mime-types: 2.1.35 range-parser: 1.2.1 schema-utils: 3.3.0 - webpack: 5.89.0(@swc/core@1.3.102) + webpack: 5.89.0(esbuild@0.19.11) /webpack-merge@5.10.0: resolution: {integrity: sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==} @@ -31654,6 +32034,46 @@ packages: - '@swc/core' - esbuild - uglify-js + dev: true + + /webpack@5.89.0(esbuild@0.19.11): + resolution: {integrity: sha512-qyfIC10pOr70V+jkmud8tMfajraGCZMBWJtrmuBymQKCrLTRejBI8STDp1MCyZu/QTdZSeacCQYpYNQVOzX5kw==} + engines: {node: '>=10.13.0'} + hasBin: true + peerDependencies: + webpack-cli: '*' + peerDependenciesMeta: + webpack-cli: + optional: true + dependencies: + '@types/eslint-scope': 3.7.7 + '@types/estree': 1.0.5 + '@webassemblyjs/ast': 1.11.6 + '@webassemblyjs/wasm-edit': 1.11.6 + '@webassemblyjs/wasm-parser': 1.11.6 + acorn: 8.11.3 + acorn-import-assertions: 1.9.0(acorn@8.11.3) + browserslist: 4.22.2 + chrome-trace-event: 1.0.3 + enhanced-resolve: 5.15.0 + es-module-lexer: 1.4.1 + eslint-scope: 5.1.1 + events: 3.3.0 + glob-to-regexp: 0.4.1 + graceful-fs: 4.2.11 + json-parse-even-better-errors: 2.3.1 + loader-runner: 4.3.0 + mime-types: 2.1.35 + neo-async: 2.6.2 + schema-utils: 3.3.0 + tapable: 2.2.1 + terser-webpack-plugin: 5.3.10(esbuild@0.19.11)(webpack@5.89.0) + watchpack: 2.4.0 + webpack-sources: 3.2.3 + transitivePeerDependencies: + - '@swc/core' + - esbuild + - uglify-js /website-scraper@5.3.1: resolution: {integrity: sha512-gogqPXD2gVsxoyd2yRiympw3rA5GuEpD1CaDEJ/J8zzanx7hkbTtneoO1SGs436PpLbWVcUge+6APGLhzsuZPA==} @@ -31775,6 +32195,14 @@ packages: dependencies: isexe: 2.0.0 + /which@4.0.0: + resolution: {integrity: sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==} + engines: {node: ^16.13.0 || >=18.0.0} + hasBin: true + dependencies: + isexe: 3.1.1 + dev: true + /why-is-node-running@2.2.2: resolution: {integrity: sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==} engines: {node: '>=8'} From 00e3317625b105fb7de4aa85fad7285005147b12 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Mon, 12 Feb 2024 17:48:24 +0100 Subject: [PATCH 02/51] feat(gatsby-auth): add nextauth --- apps/website/gatsby-browser.ts | 3 + apps/website/nextauth.config.js | 38 ++ apps/website/package.json | 1 + apps/website/src/utils/wrapRootElement.tsx | 9 + pnpm-lock.yaml | 507 +++++++++++---------- 5 files changed, 317 insertions(+), 241 deletions(-) create mode 100644 apps/website/nextauth.config.js create mode 100644 apps/website/src/utils/wrapRootElement.tsx diff --git a/apps/website/gatsby-browser.ts b/apps/website/gatsby-browser.ts index 176e43b2b..06e037465 100644 --- a/apps/website/gatsby-browser.ts +++ b/apps/website/gatsby-browser.ts @@ -4,6 +4,9 @@ import { registerExecutor } from '@custom/schema'; import { GatsbyBrowser } from 'gatsby'; import { drupalExecutor } from './src/utils/drupal-executor'; +import { WrapRootElement } from './src/utils/wrapRootElement'; + +export const wrapRootElement = WrapRootElement; export const onClientEntry: GatsbyBrowser['onClientEntry'] = async () => { registerExecutor(drupalExecutor(`/graphql`)); diff --git a/apps/website/nextauth.config.js b/apps/website/nextauth.config.js new file mode 100644 index 000000000..0be05c40f --- /dev/null +++ b/apps/website/nextauth.config.js @@ -0,0 +1,38 @@ +/** @type {import("next-auth").NextAuthOptions} */ +export const authConfig = { + // @todo set hardcoded configuration from env vars. + providers: [ + { + clientId: 'gatsby_editor', + clientSecret: 'gatsby_editor', + id: 'drupal', + name: 'DrupalProvider', + type: 'oauth', + authorization: { + url: "http://127.0.0.1:8888/en/oauth/authorize", + params: { + scope: "editor", + } + }, + idToken: false, + token: "http://127.0.0.1:8888/en/oauth/token", + userinfo: "http://127.0.0.1:8888/en/oauth/userinfo", + // Make sure to request the users email address + profile(profile) { + console.log('Profile', profile); + return { + id: profile.sub, + name: profile.name, + email: profile.email, + image: 'https://avatars.githubusercontent.com/u/525003?v=4' + } + }, + //theme: 'light', + } + ], + theme: { + logo: "https://www.gatsbyjs.com/Gatsby-Monogram.svg", + colorScheme: "light", + brandColor: "#663399", + }, +} diff --git a/apps/website/package.json b/apps/website/package.json index 91ebb34d8..107d0e1cb 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -25,6 +25,7 @@ "image-size": "^1.1.1", "mime-types": "^2.1.35", "netlify-cli": "^17.11.0", + "next-auth": "^4.24.5", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/apps/website/src/utils/wrapRootElement.tsx b/apps/website/src/utils/wrapRootElement.tsx new file mode 100644 index 000000000..2bbd7ecca --- /dev/null +++ b/apps/website/src/utils/wrapRootElement.tsx @@ -0,0 +1,9 @@ +import React from 'react'; +import { GatsbyBrowser, WrapRootElementBrowserArgs } from 'gatsby'; +import { SessionProvider } from 'next-auth/react'; + +export const WrapRootElement: GatsbyBrowser['wrapRootElement'] = ({ + element, +}: WrapRootElementBrowserArgs) => ( + {element} +); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f3bc009f6..fd6d9fe9c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -251,6 +251,9 @@ importers: netlify-cli: specifier: ^17.11.0 version: 17.11.0(@types/node@18.19.4) + next-auth: + specifier: ^4.24.5 + version: 4.24.5(next@14.1.0)(react-dom@18.2.0)(react@18.2.0) react: specifier: ^18.2.0 version: 18.2.0 @@ -5687,7 +5690,7 @@ packages: terminal-link: 3.0.0 ts-node: 10.9.2(@types/node@18.19.4)(typescript@5.3.3) typescript: 5.3.3 - uuid: 9.0.0 + uuid: 9.0.1 yargs: 17.7.2 transitivePeerDependencies: - '@swc/core' @@ -5803,7 +5806,7 @@ packages: semver: 7.5.4 tmp-promise: 3.0.3 urlpattern-polyfill: 8.0.2 - uuid: 9.0.0 + uuid: 9.0.1 transitivePeerDependencies: - encoding - supports-color @@ -6147,6 +6150,91 @@ packages: - supports-color dev: false + /@next/env@14.1.0: + resolution: {integrity: sha512-Py8zIo+02ht82brwwhTg36iogzFqGLPXlRGKQw5s+qP/kMNc4MAyDeEwBKDijk6zTIbegEgu8Qy7C1LboslQAw==} + dev: false + + /@next/swc-darwin-arm64@14.1.0: + resolution: {integrity: sha512-nUDn7TOGcIeyQni6lZHfzNoo9S0euXnu0jhsbMOmMJUBfgsnESdjN97kM7cBqQxZa8L/bM9om/S5/1dzCrW6wQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@next/swc-darwin-x64@14.1.0: + resolution: {integrity: sha512-1jgudN5haWxiAl3O1ljUS2GfupPmcftu2RYJqZiMJmmbBT5M1XDffjUtRUzP4W3cBHsrvkfOFdQ71hAreNQP6g==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm64-gnu@14.1.0: + resolution: {integrity: sha512-RHo7Tcj+jllXUbK7xk2NyIDod3YcCPDZxj1WLIYxd709BQ7WuRYl3OWUNG+WUfqeQBds6kvZYlc42NJJTNi4tQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm64-musl@14.1.0: + resolution: {integrity: sha512-v6kP8sHYxjO8RwHmWMJSq7VZP2nYCkRVQ0qolh2l6xroe9QjbgV8siTbduED4u0hlk0+tjS6/Tuy4n5XCp+l6g==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-x64-gnu@14.1.0: + resolution: {integrity: sha512-zJ2pnoFYB1F4vmEVlb/eSe+VH679zT1VdXlZKX+pE66grOgjmKJHKacf82g/sWE4MQ4Rk2FMBCRnX+l6/TVYzQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-x64-musl@14.1.0: + resolution: {integrity: sha512-rbaIYFt2X9YZBSbH/CwGAjbBG2/MrACCVu2X0+kSykHzHnYH5FjHxwXLkcoJ10cX0aWCEynpu+rP76x0914atg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-arm64-msvc@14.1.0: + resolution: {integrity: sha512-o1N5TsYc8f/HpGt39OUQpQ9AKIGApd3QLueu7hXk//2xq5Z9OxmV6sQfNp8C7qYmiOlHYODOGqNNa0e9jvchGQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-ia32-msvc@14.1.0: + resolution: {integrity: sha512-XXIuB1DBRCFwNO6EEzCTMHT5pauwaSj4SWs7CYnME57eaReAKBXCnkUE80p/pAZcewm7hs+vGvNqDPacEXHVkw==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-x64-msvc@14.1.0: + resolution: {integrity: sha512-9WEbVRRAqJ3YFVqEZIxUqkiO8l1nool1LmNxygr5HWF8AcSYsEpneUDhmjUVJEzO2A04+oPtZdombzzPPkTtgg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: false + optional: true + /@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1: resolution: {integrity: sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==} dependencies: @@ -6870,6 +6958,10 @@ packages: engines: {node: '>=14'} dev: false + /@panva/hkdf@1.1.1: + resolution: {integrity: sha512-dhPeilub1NuIG0X5Kvhh9lH4iW3ZsHlnzwgwbOlgwQ2wG1IqFzsgHqmKPk3WzsdWAeaxKJxgM0+W433RmN45GA==} + dev: false + /@parcel/bundler-default@2.8.3(@parcel/core@2.8.3): resolution: {integrity: sha512-yJvRsNWWu5fVydsWk3O2L4yIy3UZiKWO2cPDukGOIWMgp/Vbpp+2Ct5IygVRtE22bnseW/E/oe0PV3d2IkEJGg==} engines: {node: '>= 12.0.0', parcel: ^2.8.3} @@ -7382,7 +7474,7 @@ packages: react-refresh: 0.14.0 schema-utils: 3.3.0 source-map: 0.7.4 - webpack: 5.89.0(esbuild@0.19.11) + webpack: 5.89.0 /@pnpm/config.env-replace@1.1.0: resolution: {integrity: sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==} @@ -9234,6 +9326,12 @@ packages: legacy-swc-helpers: /@swc/helpers@0.4.14 tslib: 2.6.2 + /@swc/helpers@0.5.2: + resolution: {integrity: sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==} + dependencies: + tslib: 2.6.2 + dev: false + /@swc/jest@0.2.29(@swc/core@1.3.102): resolution: {integrity: sha512-8reh5RvHBsSikDC3WGCd5ZTd2BXKkyOdK7QwynrCH58jk2cQFhhHhFBg/jvnWZehUQe/EoOImLENc9/DwbBFow==} engines: {npm: '>= 7.0.0'} @@ -10096,7 +10194,6 @@ packages: typescript: 4.9.5 transitivePeerDependencies: - supports-color - dev: false /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@7.32.0)(typescript@5.3.3): resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} @@ -10172,7 +10269,6 @@ packages: typescript: 4.9.5 transitivePeerDependencies: - supports-color - dev: false /@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.3.3): resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} @@ -10249,7 +10345,6 @@ packages: typescript: 4.9.5 transitivePeerDependencies: - supports-color - dev: false /@typescript-eslint/type-utils@5.62.0(eslint@7.32.0)(typescript@5.3.3): resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} @@ -10341,7 +10436,6 @@ packages: typescript: 4.9.5 transitivePeerDependencies: - supports-color - dev: false /@typescript-eslint/typescript-estree@5.62.0(typescript@5.3.3): resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} @@ -10404,7 +10498,6 @@ packages: transitivePeerDependencies: - supports-color - typescript - dev: false /@typescript-eslint/utils@5.62.0(eslint@7.32.0)(typescript@5.3.3): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} @@ -12232,7 +12325,7 @@ packages: loader-utils: 2.0.4 make-dir: 3.1.0 schema-utils: 2.7.1 - webpack: 5.89.0(esbuild@0.19.11) + webpack: 5.89.0 /babel-plugin-add-module-exports@1.0.4: resolution: {integrity: sha512-g+8yxHUZ60RcyaUpfNzy56OtWW+x9cyEe9j+CranqLiqbju2yf/Cy6ZtYK40EZxtrdHllzlVZgLmcOUCTlJ7Jg==} @@ -12325,7 +12418,7 @@ packages: '@babel/core': 7.23.7 '@babel/runtime': 7.23.7 '@babel/types': 7.23.6 - gatsby: 5.13.1(babel-eslint@10.1.0)(esbuild@0.19.11)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3) + gatsby: 5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) gatsby-core-utils: 4.13.0 /babel-plugin-syntax-trailing-function-commas@7.0.0-beta.0: @@ -12965,6 +13058,10 @@ packages: /caniuse-lite@1.0.30001574: resolution: {integrity: sha512-BtYEK4r/iHt/txm81KBudCUcTy7t+s9emrIaHqjYurQ10x71zJ5VQ9x1dYPcz/b+pKSp4y/v1xSI67A+LzpNyg==} + /caniuse-lite@1.0.30001587: + resolution: {integrity: sha512-HMFNotUmLXn71BQxg8cijvqxnIAofforZOwGsxyXJ0qugTdspUF4sPSJ2vhgprHCB996tIDzEq1ubumPDV8ULA==} + dev: false + /capital-case@1.0.4: resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==} dependencies: @@ -14086,7 +14183,7 @@ packages: postcss-value-parser: 4.2.0 schema-utils: 3.3.0 semver: 7.5.4 - webpack: 5.89.0(esbuild@0.19.11) + webpack: 5.89.0 /css-minimizer-webpack-plugin@2.0.0(webpack@5.89.0): resolution: {integrity: sha512-cG/uc94727tx5pBNtb1Sd7gvUPzwmcQi1lkpfqTpdkuNq75hJCw7bIVsCNijLm4dhDcr1atvuysl2rZqOG8Txw==} @@ -14108,7 +14205,7 @@ packages: schema-utils: 3.3.0 serialize-javascript: 5.0.1 source-map: 0.6.1 - webpack: 5.89.0(esbuild@0.19.11) + webpack: 5.89.0 /css-select@4.3.0: resolution: {integrity: sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==} @@ -16337,7 +16434,6 @@ packages: eslint-plugin-react: 7.33.2(eslint@7.32.0) eslint-plugin-react-hooks: 4.6.0(eslint@7.32.0) typescript: 4.9.5 - dev: false /eslint-config-react-app@6.0.0(@typescript-eslint/eslint-plugin@5.62.0)(@typescript-eslint/parser@5.62.0)(babel-eslint@10.1.0)(eslint-plugin-flowtype@5.10.0)(eslint-plugin-import@2.29.1)(eslint-plugin-jsx-a11y@6.8.0)(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.33.2)(eslint@7.32.0)(typescript@5.3.3): resolution: {integrity: sha512-bpoAAC+YRfzq0dsTk+6v9aHm/uqnDwayNAXleMypGl6CpxI9oXXscVHo4fk3eJPIn+rsbtNetB4r/ZIidFIE8A==} @@ -16374,6 +16470,7 @@ packages: eslint-plugin-react: 7.33.2(eslint@7.32.0) eslint-plugin-react-hooks: 4.6.0(eslint@7.32.0) typescript: 5.3.3 + dev: true /eslint-import-resolver-node@0.3.9: resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} @@ -16405,7 +16502,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@5.3.3) + '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@4.9.5) debug: 3.2.7 eslint: 7.32.0 eslint-import-resolver-node: 0.3.9 @@ -16483,7 +16580,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@5.3.3) + '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@4.9.5) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 @@ -16689,7 +16786,7 @@ packages: micromatch: 4.0.5 normalize-path: 3.0.0 schema-utils: 3.3.0 - webpack: 5.89.0(esbuild@0.19.11) + webpack: 5.89.0 /eslint@7.32.0: resolution: {integrity: sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==} @@ -17366,7 +17463,7 @@ packages: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.89.0(esbuild@0.19.11) + webpack: 5.89.0 /file-system-cache@2.3.0: resolution: {integrity: sha512-l4DMNdsIPsVnKrgEXbJwDJsA5mB8rGwHYERMgqQx/xAUtChPJMre1bXBzDEqqVbWv9AIbFezXMxeEkZDSrXUOQ==} @@ -17691,7 +17788,6 @@ packages: tapable: 1.1.3 typescript: 4.9.5 webpack: 5.89.0 - dev: false /fork-ts-checker-webpack-plugin@6.5.3(eslint@7.32.0)(typescript@5.3.3)(webpack@5.89.0): resolution: {integrity: sha512-SbH/l9ikmMWycd5puHJKTkZJKddF4iRLyW3DeZ08HTI7NGyLS38MXd/KGgeWumQO7YNQbW2u/NtPT2YowbPaGQ==} @@ -17723,6 +17819,7 @@ packages: tapable: 1.1.3 typescript: 5.3.3 webpack: 5.89.0(esbuild@0.19.11) + dev: true /form-data-encoder@2.1.4: resolution: {integrity: sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==} @@ -17996,7 +18093,7 @@ packages: dependencies: '@types/node-fetch': 2.6.10 fs-extra: 9.1.0 - gatsby: 5.13.1(babel-eslint@10.1.0)(esbuild@0.19.11)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3) + gatsby: 5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) lodash: 4.17.21 node-fetch: 2.7.0 p-queue: 6.6.2 @@ -18112,7 +18209,7 @@ packages: chokidar: 3.5.3 fs-exists-cached: 1.0.0 fs-extra: 11.2.0 - gatsby: 5.13.1(babel-eslint@10.1.0)(esbuild@0.19.11)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3) + gatsby: 5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) gatsby-core-utils: 4.13.0 gatsby-page-utils: 3.13.0 gatsby-plugin-utils: 4.13.0(gatsby@5.13.1)(graphql@16.8.1) @@ -18198,7 +18295,7 @@ packages: '@babel/preset-typescript': 7.23.3(@babel/core@7.23.7) '@babel/runtime': 7.23.7 babel-plugin-remove-graphql-queries: 5.13.0(@babel/core@7.23.7)(gatsby@5.13.1) - gatsby: 5.13.1(babel-eslint@10.1.0)(esbuild@0.19.11)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3) + gatsby: 5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) transitivePeerDependencies: - supports-color @@ -18216,7 +18313,7 @@ packages: '@babel/runtime': 7.23.7 fastq: 1.16.0 fs-extra: 11.2.0 - gatsby: 5.13.1(babel-eslint@10.1.0)(esbuild@0.19.11)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3) + gatsby: 5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) gatsby-core-utils: 4.13.0 gatsby-sharp: 1.13.0 graphql: 16.8.1 @@ -18512,211 +18609,6 @@ packages: - webpack-plugin-serve dev: true - /gatsby@5.13.1(babel-eslint@10.1.0)(esbuild@0.19.11)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3): - resolution: {integrity: sha512-y8VB381ZnHX3Xxc1n78AAAd+t0EsIyyIRtfqlSQ10CXwZHpZzBR3DTRoHmqIG3/NmdiqWhbHb/nRlmKZUzixtQ==} - engines: {node: '>=18.0.0'} - hasBin: true - requiresBuild: true - peerDependencies: - react: ^18.0.0 || ^0.0.0 - react-dom: ^18.0.0 || ^0.0.0 - dependencies: - '@babel/code-frame': 7.23.5 - '@babel/core': 7.23.7 - '@babel/eslint-parser': 7.23.3(@babel/core@7.23.7)(eslint@7.32.0) - '@babel/helper-plugin-utils': 7.22.5 - '@babel/parser': 7.23.6 - '@babel/runtime': 7.23.7 - '@babel/traverse': 7.23.7 - '@babel/types': 7.23.6 - '@builder.io/partytown': 0.7.6 - '@gatsbyjs/reach-router': 2.0.1(react-dom@18.2.0)(react@18.2.0) - '@gatsbyjs/webpack-hot-middleware': 2.25.3 - '@graphql-codegen/add': 3.2.3(graphql@16.8.1) - '@graphql-codegen/core': 2.6.8(graphql@16.8.1) - '@graphql-codegen/plugin-helpers': 2.7.2(graphql@16.8.1) - '@graphql-codegen/typescript': 2.8.8(graphql@16.8.1) - '@graphql-codegen/typescript-operations': 2.5.13(graphql@16.8.1) - '@graphql-tools/code-file-loader': 7.3.23(@babel/core@7.23.7)(graphql@16.8.1) - '@graphql-tools/load': 7.8.14(graphql@16.8.1) - '@jridgewell/trace-mapping': 0.3.20 - '@nodelib/fs.walk': 1.2.8 - '@parcel/cache': 2.8.3(@parcel/core@2.8.3) - '@parcel/core': 2.8.3 - '@pmmmwh/react-refresh-webpack-plugin': 0.5.11(react-refresh@0.14.0)(webpack@5.89.0) - '@types/http-proxy': 1.17.14 - '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@7.32.0)(typescript@5.3.3) - '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@5.3.3) - '@vercel/webpack-asset-relocator-loader': 1.7.3 - acorn-loose: 8.4.0 - acorn-walk: 8.3.1 - address: 1.2.2 - anser: 2.1.1 - autoprefixer: 10.4.16(postcss@8.4.32) - axios: 0.21.4(debug@4.3.4) - babel-jsx-utils: 1.1.0 - babel-loader: 8.3.0(@babel/core@7.23.7)(webpack@5.89.0) - babel-plugin-add-module-exports: 1.0.4 - babel-plugin-dynamic-import-node: 2.3.3 - babel-plugin-lodash: 3.3.4 - babel-plugin-remove-graphql-queries: 5.13.0(@babel/core@7.23.7)(gatsby@5.13.1) - babel-preset-gatsby: 3.13.0(@babel/core@7.23.7)(core-js@3.35.0) - better-opn: 2.1.1 - bluebird: 3.7.2 - body-parser: 1.20.1 - browserslist: 4.22.2 - cache-manager: 2.11.1 - chalk: 4.1.2 - chokidar: 3.5.3 - common-tags: 1.8.2 - compression: 1.7.4 - cookie: 0.5.0 - core-js: 3.35.0 - cors: 2.8.5 - css-loader: 5.2.7(webpack@5.89.0) - css-minimizer-webpack-plugin: 2.0.0(webpack@5.89.0) - css.escape: 1.5.1 - date-fns: 2.30.0 - debug: 4.3.4 - deepmerge: 4.3.1 - detect-port: 1.5.1 - devcert: 1.2.2 - dotenv: 8.6.0 - enhanced-resolve: 5.15.0 - error-stack-parser: 2.1.4 - eslint: 7.32.0 - eslint-config-react-app: 6.0.0(@typescript-eslint/eslint-plugin@5.62.0)(@typescript-eslint/parser@5.62.0)(babel-eslint@10.1.0)(eslint-plugin-flowtype@5.10.0)(eslint-plugin-import@2.29.1)(eslint-plugin-jsx-a11y@6.8.0)(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.33.2)(eslint@7.32.0)(typescript@5.3.3) - eslint-plugin-flowtype: 5.10.0(eslint@7.32.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@5.62.0)(eslint@7.32.0) - eslint-plugin-jsx-a11y: 6.8.0(eslint@7.32.0) - eslint-plugin-react: 7.33.2(eslint@7.32.0) - eslint-plugin-react-hooks: 4.6.0(eslint@7.32.0) - eslint-webpack-plugin: 2.7.0(eslint@7.32.0)(webpack@5.89.0) - event-source-polyfill: 1.0.31 - execa: 5.1.1 - express: 4.18.2 - express-http-proxy: 1.6.3 - fastest-levenshtein: 1.0.16 - fastq: 1.16.0 - file-loader: 6.2.0(webpack@5.89.0) - find-cache-dir: 3.3.2 - fs-exists-cached: 1.0.0 - fs-extra: 11.2.0 - gatsby-cli: 5.13.1 - gatsby-core-utils: 4.13.0 - gatsby-graphiql-explorer: 3.13.0 - gatsby-legacy-polyfills: 3.13.0 - gatsby-link: 5.13.0(@gatsbyjs/reach-router@2.0.1)(react-dom@18.2.0)(react@18.2.0) - gatsby-page-utils: 3.13.0 - gatsby-parcel-config: 1.13.0(@parcel/core@2.8.3) - gatsby-plugin-page-creator: 5.13.0(gatsby@5.13.1)(graphql@16.8.1) - gatsby-plugin-typescript: 5.13.0(gatsby@5.13.1) - gatsby-plugin-utils: 4.13.0(gatsby@5.13.1)(graphql@16.8.1) - gatsby-react-router-scroll: 6.13.0(@gatsbyjs/reach-router@2.0.1)(react-dom@18.2.0)(react@18.2.0) - gatsby-script: 2.13.0(@gatsbyjs/reach-router@2.0.1)(react-dom@18.2.0)(react@18.2.0) - gatsby-telemetry: 4.13.0 - gatsby-worker: 2.13.0 - glob: 7.2.3 - globby: 11.1.0 - got: 11.8.6 - graphql: 16.8.1 - graphql-compose: 9.0.10(graphql@16.8.1) - graphql-http: 1.22.0(graphql@16.8.1) - graphql-tag: 2.12.6(graphql@16.8.1) - hasha: 5.2.2 - invariant: 2.2.4 - is-relative: 1.0.0 - is-relative-url: 3.0.0 - joi: 17.11.0 - json-loader: 0.5.7 - latest-version: 7.0.0 - linkfs: 2.1.0 - lmdb: 2.5.3 - lodash: 4.17.21 - meant: 1.0.3 - memoizee: 0.4.15 - micromatch: 4.0.5 - mime: 3.0.0 - mini-css-extract-plugin: 1.6.2(webpack@5.89.0) - mitt: 1.2.0 - moment: 2.30.1 - multer: 1.4.5-lts.1 - node-fetch: 2.7.0 - node-html-parser: 5.4.2 - normalize-path: 3.0.0 - null-loader: 4.0.1(webpack@5.89.0) - opentracing: 0.14.7 - p-defer: 3.0.0 - parseurl: 1.3.3 - path-to-regexp: 0.1.7 - physical-cpu-count: 2.0.0 - platform: 1.3.6 - postcss: 8.4.32 - postcss-flexbugs-fixes: 5.0.2(postcss@8.4.32) - postcss-loader: 5.3.0(postcss@8.4.32)(webpack@5.89.0) - prompts: 2.4.2 - prop-types: 15.8.1 - query-string: 6.14.1 - raw-loader: 4.0.2(webpack@5.89.0) - react: 18.2.0 - react-dev-utils: 12.0.1(eslint@7.32.0)(typescript@5.3.3)(webpack@5.89.0) - react-dom: 18.2.0(react@18.2.0) - react-refresh: 0.14.0 - react-server-dom-webpack: 0.0.0-experimental-c8b778b7f-20220825(react@18.2.0)(webpack@5.89.0) - redux: 4.2.1 - redux-thunk: 2.4.2(redux@4.2.1) - resolve-from: 5.0.0 - semver: 7.5.4 - shallow-compare: 1.2.2 - signal-exit: 3.0.7 - slugify: 1.6.6 - socket.io: 4.7.1 - socket.io-client: 4.7.1 - stack-trace: 0.0.10 - string-similarity: 1.2.2 - strip-ansi: 6.0.1 - style-loader: 2.0.0(webpack@5.89.0) - style-to-object: 0.4.4 - terser-webpack-plugin: 5.3.10(esbuild@0.19.11)(webpack@5.89.0) - tmp: 0.2.1 - true-case-path: 2.2.1 - type-of: 2.0.1 - url-loader: 4.1.1(file-loader@6.2.0)(webpack@5.89.0) - uuid: 8.3.2 - webpack: 5.89.0(esbuild@0.19.11) - webpack-dev-middleware: 4.3.0(webpack@5.89.0) - webpack-merge: 5.10.0 - webpack-stats-plugin: 1.1.3 - webpack-virtual-modules: 0.5.0 - xstate: 4.38.3 - yaml-loader: 0.8.0 - optionalDependencies: - gatsby-sharp: 1.13.0 - transitivePeerDependencies: - - '@swc/core' - - '@types/webpack' - - babel-eslint - - bufferutil - - clean-css - - csso - - encoding - - esbuild - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - - eslint-plugin-jest - - eslint-plugin-testing-library - - sockjs-client - - supports-color - - type-fest - - typescript - - uglify-js - - utf-8-validate - - vue-template-compiler - - webpack-cli - - webpack-dev-server - - webpack-hot-middleware - - webpack-plugin-serve - /gatsby@5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5): resolution: {integrity: sha512-y8VB381ZnHX3Xxc1n78AAAd+t0EsIyyIRtfqlSQ10CXwZHpZzBR3DTRoHmqIG3/NmdiqWhbHb/nRlmKZUzixtQ==} engines: {node: '>=18.0.0'} @@ -18921,7 +18813,6 @@ packages: - webpack-dev-server - webpack-hot-middleware - webpack-plugin-serve - dev: false /gauge@3.0.2: resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} @@ -21841,6 +21732,10 @@ packages: '@sideway/formula': 3.0.1 '@sideway/pinpoint': 2.0.0 + /jose@4.15.4: + resolution: {integrity: sha512-W+oqK4H+r5sITxfxpSU+MMdr/YSWGvgZMQDIsNoBDGGy4i7GBPTtvFKibQzW06n3U3TqHjhvBJsirShsEJ6eeQ==} + dev: false + /jose@5.2.0: resolution: {integrity: sha512-oW3PCnvyrcm1HMvGTzqjxxfnEs9EoFOFWi2HsEGhlFVOXxTE3K9GKWVMFoFw06yPUqwpvEWic1BmtUZBI/tIjw==} dev: true @@ -23516,7 +23411,7 @@ packages: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.89.0(esbuild@0.19.11) + webpack: 5.89.0 webpack-sources: 1.4.3 /mini-svg-data-uri@1.4.4: @@ -24076,9 +23971,74 @@ packages: qs: 6.11.2 dev: false + /next-auth@4.24.5(next@14.1.0)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-3RafV3XbfIKk6rF6GlLE4/KxjTcuMCifqrmD+98ejFq73SRoj2rmzoca8u764977lH/Q7jo6Xu6yM+Re1Mz/Og==} + peerDependencies: + next: ^12.2.5 || ^13 || ^14 + nodemailer: ^6.6.5 + react: ^17.0.2 || ^18 + react-dom: ^17.0.2 || ^18 + peerDependenciesMeta: + nodemailer: + optional: true + dependencies: + '@babel/runtime': 7.23.7 + '@panva/hkdf': 1.1.1 + cookie: 0.5.0 + jose: 4.15.4 + next: 14.1.0(@babel/core@7.23.7)(@opentelemetry/api@1.7.0)(react-dom@18.2.0)(react@18.2.0) + oauth: 0.9.15 + openid-client: 5.6.4 + preact: 10.19.4 + preact-render-to-string: 5.2.6(preact@10.19.4) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + uuid: 8.3.2 + dev: false + /next-tick@1.1.0: resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} + /next@14.1.0(@babel/core@7.23.7)(@opentelemetry/api@1.7.0)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-wlzrsbfeSU48YQBjZhDzOwhWhGsy+uQycR8bHAOt1LY1bn3zZEcDyHQOEoN3aWzQ8LHCAJ1nqrWCc9XF2+O45Q==} + engines: {node: '>=18.17.0'} + hasBin: true + peerDependencies: + '@opentelemetry/api': ^1.1.0 + react: ^18.2.0 + react-dom: ^18.2.0 + sass: ^1.3.0 + peerDependenciesMeta: + '@opentelemetry/api': + optional: true + sass: + optional: true + dependencies: + '@next/env': 14.1.0 + '@opentelemetry/api': 1.7.0 + '@swc/helpers': 0.5.2 + busboy: 1.6.0 + caniuse-lite: 1.0.30001587 + graceful-fs: 4.2.11 + postcss: 8.4.31 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + styled-jsx: 5.1.1(@babel/core@7.23.7)(react@18.2.0) + optionalDependencies: + '@next/swc-darwin-arm64': 14.1.0 + '@next/swc-darwin-x64': 14.1.0 + '@next/swc-linux-arm64-gnu': 14.1.0 + '@next/swc-linux-arm64-musl': 14.1.0 + '@next/swc-linux-x64-gnu': 14.1.0 + '@next/swc-linux-x64-musl': 14.1.0 + '@next/swc-win32-arm64-msvc': 14.1.0 + '@next/swc-win32-ia32-msvc': 14.1.0 + '@next/swc-win32-x64-msvc': 14.1.0 + transitivePeerDependencies: + - '@babel/core' + - babel-plugin-macros + dev: false + /no-case@3.0.4: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} dependencies: @@ -24389,7 +24349,7 @@ packages: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.89.0(esbuild@0.19.11) + webpack: 5.89.0 /nullthrows@1.1.1: resolution: {integrity: sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw==} @@ -24441,6 +24401,10 @@ packages: ufo: 1.3.2 dev: true + /oauth@0.9.15: + resolution: {integrity: sha512-a5ERWK1kh38ExDEfoO6qUHJb32rd7aYmPHuyCu3Fta/cnICvYmgd2uhuKXvPD+PXB+gCEYYEaQdIRAjCOwAKNA==} + dev: false + /object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -24454,6 +24418,11 @@ packages: kind-of: 3.2.2 dev: false + /object-hash@2.2.0: + resolution: {integrity: sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==} + engines: {node: '>= 6'} + dev: false + /object-hash@3.0.0: resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==} engines: {node: '>= 6'} @@ -24548,6 +24517,11 @@ packages: resolution: {integrity: sha512-zuHHiGTYTA1sYJ/wZN+t5HKZaH23i4yI1HMwbuXm24Nid7Dv0KcuRlKoNKS9UNfAVSBlnGLcuQrnOKWOZoEGaw==} dev: true + /oidc-token-hash@5.0.3: + resolution: {integrity: sha512-IF4PcGgzAr6XXSff26Sk/+P4KZFJVuHAJZj3wgO3vX2bMdNVp/QXTP3P7CEm9V1IdG8lDLY3HhiqpsE/nOwpPw==} + engines: {node: ^10.13.0 || >=12.0.0} + dev: false + /ol-mapbox-style@8.2.1: resolution: {integrity: sha512-3kBBuZC627vDL8vnUdfVbCbfkhkcZj2kXPHQcuLhC4JJEA+XkEVEtEde8x8+AZctRbHwBkSiubTPaRukgLxIRw==} dependencies: @@ -24634,6 +24608,15 @@ packages: is-docker: 2.2.1 is-wsl: 2.2.0 + /openid-client@5.6.4: + resolution: {integrity: sha512-T1h3B10BRPKfcObdBklX639tVz+xh34O7GjofqrqiAQdm7eHsQ00ih18x6wuJ/E6FxdtS2u3FmUGPDeEcMwzNA==} + dependencies: + jose: 4.15.4 + lru-cache: 6.0.0 + object-hash: 2.2.0 + oidc-token-hash: 5.0.3 + dev: false + /opentracing@0.14.7: resolution: {integrity: sha512-vz9iS7MJ5+Bp1URw8Khvdyw1H/hGvzHWlKQ7eRrQojSCDL1/SrWfrY9QebLw97n2deyRtzHRC3MkQfVNUCo91Q==} engines: {node: '>=0.10'} @@ -25599,7 +25582,7 @@ packages: klona: 2.0.6 postcss: 8.4.32 semver: 7.5.4 - webpack: 5.89.0(esbuild@0.19.11) + webpack: 5.89.0 /postcss-merge-longhand@5.1.7(postcss@8.4.32): resolution: {integrity: sha512-YCI9gZB+PLNskrK0BB3/2OzPnGhPkBEwmwhfYk1ilBHYVAZB7/tkTHFBAnCrvBBOmeYyMYw3DMjT55SyxMBzjQ==} @@ -26099,6 +26082,15 @@ packages: quote-unquote: 1.0.0 dev: false + /postcss@8.4.31: + resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.7 + picocolors: 1.0.0 + source-map-js: 1.0.2 + dev: false + /postcss@8.4.32: resolution: {integrity: sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==} engines: {node: ^10 || ^12 || >=14} @@ -26107,6 +26099,19 @@ packages: picocolors: 1.0.0 source-map-js: 1.0.2 + /preact-render-to-string@5.2.6(preact@10.19.4): + resolution: {integrity: sha512-JyhErpYOvBV1hEPwIxc/fHWXPfnEGdRKxc8gFdAZ7XV4tlzyzG847XAyEZqoDnynP88akM4eaHcSOzNcLWFguw==} + peerDependencies: + preact: '>=10' + dependencies: + preact: 10.19.4 + pretty-format: 3.8.0 + dev: false + + /preact@10.19.4: + resolution: {integrity: sha512-dwaX5jAh0Ga8uENBX1hSOujmKWgx9RtL80KaKUFLc6jb4vCEAc3EeZ0rnQO/FO4VgjfPMfoLFWnNG8bHuZ9VLw==} + dev: false + /precinct@11.0.5: resolution: {integrity: sha512-oHSWLC8cL/0znFhvln26D14KfCQFFn4KOLSw6hmLhd+LQ2SKt9Ljm89but76Pc7flM9Ty1TnXyrA2u16MfRV3w==} engines: {node: ^14.14.0 || >=16.0.0} @@ -26199,6 +26204,10 @@ packages: ansi-styles: 5.2.0 react-is: 18.2.0 + /pretty-format@3.8.0: + resolution: {integrity: sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==} + dev: false + /pretty-hrtime@1.0.3: resolution: {integrity: sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==} engines: {node: '>= 0.8'} @@ -26569,7 +26578,7 @@ packages: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.89.0(esbuild@0.19.11) + webpack: 5.89.0 /rbush@3.0.1: resolution: {integrity: sha512-XRaVO0YecOpEuIvbhbpTrZgoiI6xBlz6hnlr6EHhd+0x9ase6EmeN+hdwwUaJvLcsFFQ8iWVF1GAK1yB0BWi0w==} @@ -26706,7 +26715,6 @@ packages: - eslint - supports-color - vue-template-compiler - dev: false /react-dev-utils@12.0.1(eslint@7.32.0)(typescript@5.3.3)(webpack@5.89.0): resolution: {integrity: sha512-84Ivxmr17KjUupyqzFode6xKhjwuEJDROWKJy/BthkL7Wn6NJ8h4WE6k/exAv6ImS+0oZLRRW5j/aINMHyeGeQ==} @@ -26748,6 +26756,7 @@ packages: - eslint - supports-color - vue-template-compiler + dev: true /react-dnd-html5-backend@14.1.0: resolution: {integrity: sha512-6ONeqEC3XKVf4eVmMTe0oPds+c5B9Foyj8p/ZKLb7kL2qh9COYxiBHv3szd6gztqi/efkmriywLUVlPotqoJyw==} @@ -27149,7 +27158,7 @@ packages: loose-envify: 1.4.0 neo-async: 2.6.2 react: 18.2.0 - webpack: 5.89.0(esbuild@0.19.11) + webpack: 5.89.0 /react-split-pane@0.1.92(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-GfXP1xSzLMcLJI5BM36Vh7GgZBpy+U/X0no+VM3fxayv+p1Jly5HpMofZJraeaMl73b3hvlr+N9zJKvLB/uz9w==} @@ -29518,7 +29527,7 @@ packages: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.89.0(esbuild@0.19.11) + webpack: 5.89.0 /style-to-object@0.3.0: resolution: {integrity: sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA==} @@ -29531,6 +29540,24 @@ packages: dependencies: inline-style-parser: 0.1.1 + /styled-jsx@5.1.1(@babel/core@7.23.7)(react@18.2.0): + resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==} + engines: {node: '>= 12.0.0'} + peerDependencies: + '@babel/core': '*' + babel-plugin-macros: '*' + react: '>= 16.8.0 || 17.x.x || ^18.0.0-0' + peerDependenciesMeta: + '@babel/core': + optional: true + babel-plugin-macros: + optional: true + dependencies: + '@babel/core': 7.23.7 + client-only: 0.0.1 + react: 18.2.0 + dev: false + /stylehacks@5.1.1(postcss@8.4.32): resolution: {integrity: sha512-sBpcd5Hx7G6seo7b1LkpttvTz7ikD0LlH5RmdcBNb6fFR0Fl7LQwHDFr300q4cwUqi+IYrFGmsIHieMBfnN/Bw==} engines: {node: ^10 || ^12 || >=14.0} @@ -29877,6 +29904,7 @@ packages: serialize-javascript: 6.0.1 terser: 5.26.0 webpack: 5.89.0(esbuild@0.19.11) + dev: true /terser-webpack-plugin@5.3.10(webpack@5.89.0): resolution: {integrity: sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==} @@ -29900,7 +29928,6 @@ packages: serialize-javascript: 6.0.1 terser: 5.26.0 webpack: 5.89.0 - dev: false /terser@5.26.0: resolution: {integrity: sha512-dytTGoE2oHgbNV9nTzgBEPaqAWvcJNl66VZ0BkJqlvp71IjO8CxdBx/ykCNb47cLnCmCvRZ6ZR0tLkqvZCdVBQ==} @@ -30369,7 +30396,6 @@ packages: dependencies: tslib: 1.14.1 typescript: 4.9.5 - dev: false /tsutils@3.21.0(typescript@5.3.3): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} @@ -30568,7 +30594,6 @@ packages: resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} engines: {node: '>=4.2.0'} hasBin: true - dev: false /typescript@5.3.3: resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} @@ -31082,7 +31107,7 @@ packages: loader-utils: 2.0.4 mime-types: 2.1.35 schema-utils: 3.3.0 - webpack: 5.89.0(esbuild@0.19.11) + webpack: 5.89.0 /url@0.11.3: resolution: {integrity: sha512-6hxOLGfZASQK/cijlZnZJTq8OXAkt/3YGfQX45vvMYXpZoo8NdWZcY73K108Jf759lS1Bv/8wXnHDTSz17dSRw==} @@ -31926,7 +31951,7 @@ packages: mime-types: 2.1.35 range-parser: 1.2.1 schema-utils: 3.3.0 - webpack: 5.89.0(esbuild@0.19.11) + webpack: 5.89.0 /webpack-merge@5.10.0: resolution: {integrity: sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==} @@ -31994,7 +32019,6 @@ packages: - '@swc/core' - esbuild - uglify-js - dev: false /webpack@5.89.0(@swc/core@1.3.102): resolution: {integrity: sha512-qyfIC10pOr70V+jkmud8tMfajraGCZMBWJtrmuBymQKCrLTRejBI8STDp1MCyZu/QTdZSeacCQYpYNQVOzX5kw==} @@ -32074,6 +32098,7 @@ packages: - '@swc/core' - esbuild - uglify-js + dev: true /website-scraper@5.3.1: resolution: {integrity: sha512-gogqPXD2gVsxoyd2yRiympw3rA5GuEpD1CaDEJ/J8zzanx7hkbTtneoO1SGs436PpLbWVcUge+6APGLhzsuZPA==} From 322e56169805cb2bdd8a3122f8476b957af56395 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Tue, 13 Feb 2024 12:50:44 +0100 Subject: [PATCH 03/51] feat(gatsby-auth): add authentication ui (wip) --- apps/website/nextauth.config.js | 30 +++++++------ apps/website/src/layouts/index.tsx | 51 +++++++++++++++++++++- apps/website/src/utils/wrapRootElement.tsx | 6 +-- 3 files changed, 68 insertions(+), 19 deletions(-) diff --git a/apps/website/nextauth.config.js b/apps/website/nextauth.config.js index 0be05c40f..73ca50f47 100644 --- a/apps/website/nextauth.config.js +++ b/apps/website/nextauth.config.js @@ -3,36 +3,38 @@ export const authConfig = { // @todo set hardcoded configuration from env vars. providers: [ { + // Client ID and secret are set in the Drupal Consumer. clientId: 'gatsby_editor', clientSecret: 'gatsby_editor', id: 'drupal', name: 'DrupalProvider', type: 'oauth', + // Language prefix is added to prevent 301 + // that will not be handled by NextAuth. authorization: { - url: "http://127.0.0.1:8888/en/oauth/authorize", + url: 'http://127.0.0.1:8888/en/oauth/authorize', params: { - scope: "editor", - } + // @todo refine scope, editor (role) is used for now. + scope: 'editor', + }, }, idToken: false, - token: "http://127.0.0.1:8888/en/oauth/token", - userinfo: "http://127.0.0.1:8888/en/oauth/userinfo", - // Make sure to request the users email address + token: 'http://127.0.0.1:8888/en/oauth/token', + userinfo: 'http://127.0.0.1:8888/en/oauth/userinfo', profile(profile) { - console.log('Profile', profile); return { id: profile.sub, name: profile.name, email: profile.email, - image: 'https://avatars.githubusercontent.com/u/525003?v=4' - } + }; }, //theme: 'light', - } + }, ], theme: { - logo: "https://www.gatsbyjs.com/Gatsby-Monogram.svg", - colorScheme: "light", - brandColor: "#663399", + // @todo use custom logo. + logo: 'https://www.gatsbyjs.com/Gatsby-Monogram.svg', + colorScheme: 'light', + brandColor: '#663399', }, -} +}; diff --git a/apps/website/src/layouts/index.tsx b/apps/website/src/layouts/index.tsx index cfd2650d1..a26cb5937 100644 --- a/apps/website/src/layouts/index.tsx +++ b/apps/website/src/layouts/index.tsx @@ -1,6 +1,7 @@ import { graphql, useStaticQuery } from '@amazeelabs/gatsby-plugin-operations'; import { FrameQuery, registerExecutor } from '@custom/schema'; import { Frame } from '@custom/ui/routes/Frame'; +import { signIn, signOut, useSession } from 'next-auth/react'; import React, { PropsWithChildren } from 'react'; export default function Layout({ @@ -8,7 +9,55 @@ export default function Layout({ }: PropsWithChildren<{ locale: string; }>) { + const session = useSession(); const data = useStaticQuery(graphql(FrameQuery)); registerExecutor(FrameQuery, data); - return {children}; + + // @todo move signin/signout to a specific component. + return ( + <> +
+
+

+ {session?.status !== 'authenticated' && ( + <> + You are not signed in + { + e.preventDefault(); + signIn(); + }} + > + Sign in + + + )} + {session?.status === 'authenticated' && session.data.user && ( + <> + + Signed in as +
+ {session.data.user.email} + {session.data.user.name + ? `(${session.data.user.name})` + : null} +
+ { + e.preventDefault(); + signOut(); + }} + > + Sign out + + + )} +

+
+
+ {children} + + ); } diff --git a/apps/website/src/utils/wrapRootElement.tsx b/apps/website/src/utils/wrapRootElement.tsx index 2bbd7ecca..68dbae1bf 100644 --- a/apps/website/src/utils/wrapRootElement.tsx +++ b/apps/website/src/utils/wrapRootElement.tsx @@ -1,9 +1,7 @@ -import React from 'react'; import { GatsbyBrowser, WrapRootElementBrowserArgs } from 'gatsby'; import { SessionProvider } from 'next-auth/react'; +import React from 'react'; export const WrapRootElement: GatsbyBrowser['wrapRootElement'] = ({ element, -}: WrapRootElementBrowserArgs) => ( - {element} -); +}: WrapRootElementBrowserArgs) => {element}; From 103082c87dfbd956b227ebe7f309c2d27a3b5a9c Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Wed, 14 Feb 2024 09:51:05 +0100 Subject: [PATCH 04/51] fix(gatsby-auth): missing dependencies --- apps/website/package.json | 6 + apps/website/src/api/auth/[...nextauth].js | 11 + pnpm-lock.yaml | 493 ++++++++++++++++++++- 3 files changed, 501 insertions(+), 9 deletions(-) create mode 100644 apps/website/src/api/auth/[...nextauth].js diff --git a/apps/website/package.json b/apps/website/package.json index 107d0e1cb..f0bf7ce27 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -12,6 +12,10 @@ "@custom/decap": "workspace:*", "@custom/schema": "workspace:*", "@custom/ui": "workspace:*", + "@gatsbyjs/reach-router": "^2.0.1", + "@netlify/plugin-nextjs": "^4.41.3", + "babel-loader": "^9.1.3", + "body-parser": "^1.20.2", "gatsby": "^5.13.1", "gatsby-plugin-layout": "^4.13.0", "gatsby-plugin-manifest": "^5.13.0", @@ -24,7 +28,9 @@ "gatsby-source-filesystem": "^5.13.0", "image-size": "^1.1.1", "mime-types": "^2.1.35", + "multer": "1.4.5-lts.1", "netlify-cli": "^17.11.0", + "next": "^14.1.0", "next-auth": "^4.24.5", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/apps/website/src/api/auth/[...nextauth].js b/apps/website/src/api/auth/[...nextauth].js new file mode 100644 index 000000000..2c8eff02e --- /dev/null +++ b/apps/website/src/api/auth/[...nextauth].js @@ -0,0 +1,11 @@ +// If your deployment environment supports Gatsby Functions, you won't need the root `api` folder, only this. + +import NextAuth from 'next-auth'; +import { authConfig } from '../../../nextauth.config'; + +// @todo +// @ts-ignore +export default async function handler(req, res) { + req.query.nextauth = req.params.nextauth.split('/'); + return await NextAuth(req, res, authConfig); +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fd6d9fe9c..4874b44d3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -212,6 +212,18 @@ importers: '@custom/ui': specifier: workspace:* version: link:../../packages/ui + '@gatsbyjs/reach-router': + specifier: ^2.0.1 + version: 2.0.1(react-dom@18.2.0)(react@18.2.0) + '@netlify/plugin-nextjs': + specifier: ^4.41.3 + version: 4.41.3 + babel-loader: + specifier: ^9.1.3 + version: 9.1.3(@babel/core@7.23.7)(webpack@5.89.0) + body-parser: + specifier: ^1.20.2 + version: 1.20.2 gatsby: specifier: ^5.13.1 version: 5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) @@ -248,9 +260,15 @@ importers: mime-types: specifier: ^2.1.35 version: 2.1.35 + multer: + specifier: 1.4.5-lts.1 + version: 1.4.5-lts.1 netlify-cli: specifier: ^17.11.0 version: 17.11.0(@types/node@18.19.4) + next: + specifier: ^14.1.0 + version: 14.1.0(@babel/core@7.23.7)(@opentelemetry/api@1.7.0)(react-dom@18.2.0)(react@18.2.0) next-auth: specifier: ^4.24.5 version: 4.24.5(next@14.1.0)(react-dom@18.2.0)(react@18.2.0) @@ -5602,6 +5620,11 @@ packages: resolution: {integrity: sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw==} dev: false + /@netlify/blobs@2.2.0: + resolution: {integrity: sha512-j2C0+IvWj9CLNGPoiA7ETquMFDExZTrv4CarjfE6Au0eY3zlinnnTVae7DE+VQFK+U0CDM/O0VvelNy1QbsdwQ==} + engines: {node: ^14.16.0 || >=16.0.0} + dev: false + /@netlify/blobs@6.3.1: resolution: {integrity: sha512-JjLz3WW7Wp6NVwQtDxPpWio4L3u9pnnDXnQ7Q16zgAFE9IA1rSjZVSsyOQrtkiBQIxaJ1Zr5eky8vrXJ5mdRWg==} engines: {node: ^14.16.0 || >=16.0.0} @@ -5812,6 +5835,214 @@ packages: - supports-color dev: false + /@netlify/esbuild-android-64@0.14.39: + resolution: {integrity: sha512-azq+lsvjRsKLap8ubIwSJXGyknUACqYu5h98Fvyoh40Qk4QXIVKl16JIJ4s+B7jy2k9qblEc5c4nxdDA3aGbVA==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: false + optional: true + + /@netlify/esbuild-android-arm64@0.14.39: + resolution: {integrity: sha512-WhIP7ePq4qMC1sxoaeB9SsJqSW6uzW7XDj/IuWl1l9r94nwxywU1sYdVLaF2mZr15njviazYjVr8x1d+ipwL3w==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: false + optional: true + + /@netlify/esbuild-darwin-64@0.14.39: + resolution: {integrity: sha512-eF4GvLYiDxtcyjFT55+h+8c8A2HltjeMezCqkt3AQSgOdu1nhlvwbBhIdg2dyM6gKEaEm5hBtTbicEDSwsLodA==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@netlify/esbuild-darwin-arm64@0.14.39: + resolution: {integrity: sha512-b7rtnX/VtYwNbUCxs3eulrCWJ+u2YvqDcXiIV1ka+od+N0fTx+4RrVkVp1lha9L0wEJYK9J7UWZOMLMyd1ynRg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@netlify/esbuild-freebsd-64@0.14.39: + resolution: {integrity: sha512-XtusxDJt2hUKUdggbTFolMx0kJL2zEa4STI7YwpB+ukEWoW5rODZjiLZbqqYLcjDH8k4YwHaMxs103L8eButEQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: false + optional: true + + /@netlify/esbuild-freebsd-arm64@0.14.39: + resolution: {integrity: sha512-A9XZKai+k6kfndCtN6Dh2usT28V0+OGxzFdZsANONPQiEUTrGZCgwcHWiVlVn7SeAwPR1tKZreTnvrfj8cj7hA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: false + optional: true + + /@netlify/esbuild-linux-32@0.14.39: + resolution: {integrity: sha512-ZQnqk/82YRvINY+aF+LlGfRZ19c5mH0jaxsO046GpIOPx6PcXHG8JJ2lg+vLJVe4zFPohxzabcYpwFuT4cg/GA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@netlify/esbuild-linux-64@0.14.39: + resolution: {integrity: sha512-IQtswVw7GAKNX/3yV390wSfSXvMWy0d5cw8csAffwBk9gupftY2lzepK4Cn6uD/aqLt3Iku33FbHop/2nPGfQA==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@netlify/esbuild-linux-arm64@0.14.39: + resolution: {integrity: sha512-4Jie4QV6pWWuGN7TAshNMGbdTA9+VbRkv3rPIxhgK5gBfmsAV1yRKsumE4Y77J0AZNRiOriyoec4zc1qkmI3zg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@netlify/esbuild-linux-arm@0.14.39: + resolution: {integrity: sha512-QdOzQniOed0Bz1cTC9TMMwvtAqKayYv66H4edJlbvElC81yJZF/c9XhmYWJ6P5g4nkChZubQ5RcQwTLmrFGexg==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@netlify/esbuild-linux-mips64le@0.14.39: + resolution: {integrity: sha512-Htozxr95tw4tSd86YNbCLs1eoYQzNu/cHpzFIkuJoztZueUhl8XpRvBdob7n3kEjW1gitLWAIn8XUwSt+aJ1Tg==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@netlify/esbuild-linux-ppc64le@0.14.39: + resolution: {integrity: sha512-tFy0ufWIdjeuk1rPHee00TZlhr9OSF00Ufb4ROFyt2ArKuMSkWRJuDgx6MtZcAnCIN4cybo/xWl3MKTM+scnww==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@netlify/esbuild-linux-riscv64@0.14.39: + resolution: {integrity: sha512-ZzfKvwIxL7wQnYbVFpyNW0wotnLoKageUEM57RbjekesJoNQnqUR6Usm+LDZoB8iRsI58VX1IxnstP0cX8vOHw==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@netlify/esbuild-linux-s390x@0.14.39: + resolution: {integrity: sha512-yjC0mFwnuMRoh0WcF0h71MF71ytZBFEQQTRdgiGT0+gbC4UApBqnTkJdLx32RscBKi9skbMChiJ748hDJou6FA==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@netlify/esbuild-netbsd-64@0.14.39: + resolution: {integrity: sha512-mIq4znOoz3YfTVdv3sIWfR4Zx5JgMnT4srlhC5KYVHibhxvyDdin5txldYXmR4Zv4dZd6DSuWFsn441aUegHeA==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: false + optional: true + + /@netlify/esbuild-openbsd-64@0.14.39: + resolution: {integrity: sha512-+t6QdzJCngH19hV7ClpFAeFDI2ko/HNcFbiNwaXTMVLB3hWi1sJtn+fzZck5HfzN4qsajAVqZq4nwX69SSt25A==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: false + optional: true + + /@netlify/esbuild-sunos-64@0.14.39: + resolution: {integrity: sha512-HLfXG6i2p3wyyyWHeeP4ShGDJ1zRMnf9YLJLe2ezv2KqvcKw/Un/m/FBuDW1p13oSUO7ShISMzgc1dw1GGBEOQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: false + optional: true + + /@netlify/esbuild-windows-32@0.14.39: + resolution: {integrity: sha512-ZpSQcKbVSCU3ln7mHpsL/5dWsUqCNdTnC5YAArnaOwdrlIunrsbo5j4MOZRRcGExb2uvTc/rb+D3mlGb8j1rkA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@netlify/esbuild-windows-64@0.14.39: + resolution: {integrity: sha512-I3gCdO8+6IDhT4Y1ZmV4o2Gg0oELv7N4kCcE4kqclz10fWHNjf19HQNHyBJe0AWnFV5ZfT154VVD31dqgwpgFw==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@netlify/esbuild-windows-arm64@0.14.39: + resolution: {integrity: sha512-WX52W8U1lsfWcz6NWoSpDs57lgiiMHN23seq8G2bvxzGS/tvYD3dxVLLW5UPoKSnFDyVQT7b6Zkt6AkBten1yQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@netlify/esbuild@0.14.39: + resolution: {integrity: sha512-C3xpwdT2xw6SnSb+hLQoxjtikAKiz6BjQjzlIaysHDpGbmIcmUHZ/X+dyLtCqAvf15WNK5GSBZYOlpgcOE0WZA==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@netlify/esbuild-android-64': 0.14.39 + '@netlify/esbuild-android-arm64': 0.14.39 + '@netlify/esbuild-darwin-64': 0.14.39 + '@netlify/esbuild-darwin-arm64': 0.14.39 + '@netlify/esbuild-freebsd-64': 0.14.39 + '@netlify/esbuild-freebsd-arm64': 0.14.39 + '@netlify/esbuild-linux-32': 0.14.39 + '@netlify/esbuild-linux-64': 0.14.39 + '@netlify/esbuild-linux-arm': 0.14.39 + '@netlify/esbuild-linux-arm64': 0.14.39 + '@netlify/esbuild-linux-mips64le': 0.14.39 + '@netlify/esbuild-linux-ppc64le': 0.14.39 + '@netlify/esbuild-linux-riscv64': 0.14.39 + '@netlify/esbuild-linux-s390x': 0.14.39 + '@netlify/esbuild-netbsd-64': 0.14.39 + '@netlify/esbuild-openbsd-64': 0.14.39 + '@netlify/esbuild-sunos-64': 0.14.39 + '@netlify/esbuild-windows-32': 0.14.39 + '@netlify/esbuild-windows-64': 0.14.39 + '@netlify/esbuild-windows-arm64': 0.14.39 + dev: false + /@netlify/framework-info@9.8.10: resolution: {integrity: sha512-VT8ejAaB/XU2xRpdpQinHUO1YL3+BMx6LJ49wJk2u9Yq/VI1/gYCi5VqbqTHBQXJUlOi84YuiRlrDBsLpPr8eg==} engines: {node: ^14.14.0 || >=16.0.0} @@ -5840,6 +6071,13 @@ packages: - supports-color dev: false + /@netlify/functions@1.6.0: + resolution: {integrity: sha512-6G92AlcpFrQG72XU8YH8pg94eDnq7+Q0YJhb8x4qNpdGsvuzvrfHWBmqFGp/Yshmv4wex9lpsTRZOocdrA2erQ==} + engines: {node: '>=14.0.0'} + dependencies: + is-promise: 4.0.0 + dev: false + /@netlify/functions@2.4.1: resolution: {integrity: sha512-sRFYBaz6dJP1MdUtk/5QNmshhg5UDmB+DUssmH6v9WUG85MrwyExEfGfJA5eClXATjXm0coTvO5nLAlyCpK7QQ==} engines: {node: '>=14.0.0'} @@ -5859,6 +6097,35 @@ packages: path-exists: 5.0.0 dev: false + /@netlify/ipx@1.4.6: + resolution: {integrity: sha512-rnKR2LXhtnflitPX9CQIv+XSrNlYIqGsV54xrXifhbtHHjCjCw/lixsi8qwAXqEIgZBC9b4Y7prhHqRtC4oIjw==} + dependencies: + '@netlify/functions': 2.4.1 + etag: 1.8.1 + fs-extra: 11.2.0 + ipx: 1.3.1 + micromatch: 4.0.5 + mkdirp: 3.0.1 + murmurhash: 2.0.1 + node-fetch: 2.7.0 + ufo: 1.3.2 + unstorage: 1.9.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@planetscale/database' + - '@upstash/redis' + - '@vercel/kv' + - encoding + - idb-keyval + - supports-color + dev: false + /@netlify/local-functions-proxy-darwin-arm64@1.1.1: resolution: {integrity: sha512-lphJ9qqZ3glnKWEqlemU1LMqXxtJ/tKf7VzakqqyjigwLscXSZSb6fupSjQfd4tR1xqxA76ylws/2HDhc/gs+Q==} cpu: [arm64] @@ -5993,6 +6260,51 @@ packages: resolution: {integrity: sha512-B7q+ySzQm6rJhaGbY0Pzqnb1p3FsBqwiPLnLtA17JgTsqmXgQ7j6OQImW9fRJy/Al1ob9M6Oxng/FA2c7aIW1g==} dev: false + /@netlify/plugin-nextjs@4.41.3: + resolution: {integrity: sha512-l8TB61u7A1ZF22QpoyZtresSUsHOJGP9DatECnqlNab3lG8id1kz9Pso+nZVOznWOm98o7w51k2+TIf52x+DBQ==} + engines: {node: '>=12.0.0'} + dependencies: + '@netlify/blobs': 2.2.0 + '@netlify/esbuild': 0.14.39 + '@netlify/functions': 1.6.0 + '@netlify/ipx': 1.4.6 + '@vercel/node-bridge': 2.2.2 + chalk: 4.1.2 + chokidar: 3.5.3 + destr: 1.2.2 + execa: 5.1.1 + follow-redirects: 1.15.4 + fs-extra: 10.1.0 + globby: 11.1.0 + merge-stream: 2.0.0 + moize: 6.1.6 + node-fetch: 2.7.0 + node-stream-zip: 1.15.0 + outdent: 0.8.0 + p-limit: 3.1.0 + pathe: 0.3.9 + pretty-bytes: 5.6.0 + regexp-tree: 0.1.27 + semver: 7.5.4 + slash: 3.0.0 + tiny-glob: 0.2.9 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@planetscale/database' + - '@upstash/redis' + - '@vercel/kv' + - debug + - encoding + - idb-keyval + - supports-color + dev: false + /@netlify/plugins-list@6.74.0: resolution: {integrity: sha512-cWZ9vQ0LgKowjlSG4vkLAQ+P41aB8KFrRRId2WCvYeK3g2pUJpseceZtYzTuQvvsOtBZh5qVkqRz1Ye/AfSP+A==} engines: {node: ^14.14.0 || >=16.0.0} @@ -10638,6 +10950,10 @@ packages: - supports-color dev: false + /@vercel/node-bridge@2.2.2: + resolution: {integrity: sha512-haGBC8noyA5BfjCRXRH+VIkHCDVW5iD5UX24P2nOdilwUxI4qWsattS/co8QBGq64XsNLRAMdM5pQUE3zxkF9Q==} + dev: false + /@vercel/webpack-asset-relocator-loader@1.7.3: resolution: {integrity: sha512-vizrI18v8Lcb1PmNNUBz7yxPxxXoOeuaVEjTG9MjvDrphjiSxFZrRJ5tIghk+qdLFRCXI5HBCshgobftbmrC5g==} dependencies: @@ -12202,7 +12518,7 @@ packages: postcss: ^8.1.0 dependencies: browserslist: 4.22.2 - caniuse-lite: 1.0.30001574 + caniuse-lite: 1.0.30001587 fraction.js: 4.3.7 normalize-range: 0.1.2 picocolors: 1.0.0 @@ -12327,6 +12643,19 @@ packages: schema-utils: 2.7.1 webpack: 5.89.0 + /babel-loader@9.1.3(@babel/core@7.23.7)(webpack@5.89.0): + resolution: {integrity: sha512-xG3ST4DglodGf8qSwv0MdeWLhrDsw/32QMdTO5T1ZIp9gQur0HkCyFs7Awskr10JKXFXwpAhiCuYX5oGXnRGbw==} + engines: {node: '>= 14.15.0'} + peerDependencies: + '@babel/core': ^7.12.0 + webpack: '>=5' + dependencies: + '@babel/core': 7.23.7 + find-cache-dir: 4.0.0 + schema-utils: 4.2.0 + webpack: 5.89.0 + dev: false + /babel-plugin-add-module-exports@1.0.4: resolution: {integrity: sha512-g+8yxHUZ60RcyaUpfNzy56OtWW+x9cyEe9j+CranqLiqbju2yf/Cy6ZtYK40EZxtrdHllzlVZgLmcOUCTlJ7Jg==} @@ -12687,6 +13016,26 @@ packages: transitivePeerDependencies: - supports-color + /body-parser@1.20.2: + resolution: {integrity: sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + on-finished: 2.4.1 + qs: 6.11.0 + raw-body: 2.5.2 + type-is: 1.6.18 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: false + /boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} @@ -12792,7 +13141,7 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001574 + caniuse-lite: 1.0.30001587 electron-to-chromium: 1.4.620 node-releases: 2.0.14 update-browserslist-db: 1.0.13(browserslist@4.22.2) @@ -13051,16 +13400,12 @@ packages: resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==} dependencies: browserslist: 4.22.2 - caniuse-lite: 1.0.30001574 + caniuse-lite: 1.0.30001587 lodash.memoize: 4.1.2 lodash.uniq: 4.5.0 - /caniuse-lite@1.0.30001574: - resolution: {integrity: sha512-BtYEK4r/iHt/txm81KBudCUcTy7t+s9emrIaHqjYurQ10x71zJ5VQ9x1dYPcz/b+pKSp4y/v1xSI67A+LzpNyg==} - /caniuse-lite@1.0.30001587: resolution: {integrity: sha512-HMFNotUmLXn71BQxg8cijvqxnIAofforZOwGsxyXJ0qugTdspUF4sPSJ2vhgprHCB996tIDzEq1ubumPDV8ULA==} - dev: false /capital-case@1.0.4: resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==} @@ -13588,7 +13933,7 @@ packages: resolution: {integrity: sha512-Soe5lerRg3erMRgYC0EC696/8dMCGpBzcQchFfi55Yrkja8F+P7cUt0LVTIg7u5ob5BexLZ/F1kO+ejmv+nq8w==} engines: {node: '>=14.18.0'} dependencies: - chalk: 5.2.0 + chalk: 5.3.0 is-plain-obj: 4.1.0 dev: false @@ -15447,6 +15792,10 @@ packages: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} + /destr@1.2.2: + resolution: {integrity: sha512-lrbCJwD9saUQrqUfXvl6qoM+QN3W7tLV5pAOs+OqOmopCCz/JkE05MHedJR1xfk4IAnZuJXPVuN5+7jNA2ZCiA==} + dev: false + /destr@2.0.2: resolution: {integrity: sha512-65AlobnZMiCET00KaFFjUefxDX0khFA/E4myqZ7a6Sq1yZtR8+FVIvilVX66vF2uobSumxooYZChiRPCKNqhmg==} dev: false @@ -17599,6 +17948,14 @@ packages: make-dir: 3.1.0 pkg-dir: 4.2.0 + /find-cache-dir@4.0.0: + resolution: {integrity: sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg==} + engines: {node: '>=14.16'} + dependencies: + common-path-prefix: 3.0.0 + pkg-dir: 7.0.0 + dev: false + /find-file-up@0.1.3: resolution: {integrity: sha512-mBxmNbVyjg1LQIIpgO8hN+ybWBgDQK8qjht+EbrTCGmmPV/sc7RF1i9stPTD6bpvXZywBdrwRYxhSdJv867L6A==} engines: {node: '>=0.10.0'} @@ -17921,7 +18278,6 @@ packages: graceful-fs: 4.2.11 jsonfile: 6.1.0 universalify: 2.0.1 - dev: true /fs-extra@11.1.1: resolution: {integrity: sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==} @@ -19174,6 +19530,10 @@ packages: dependencies: define-properties: 1.2.1 + /globalyzer@0.1.0: + resolution: {integrity: sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==} + dev: false + /globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} @@ -19208,6 +19568,10 @@ packages: unicorn-magic: 0.1.0 dev: true + /globrex@0.1.2: + resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} + dev: false + /gonzales-pe@4.3.0: resolution: {integrity: sha512-otgSPpUmdWJ43VXyiNgEYE4luzHCL2pz4wQ0OnDluC6Eg4Ko3Vexy/SrSynglw/eR+OhkzmqFCZa/OFa/RgAOQ==} engines: {node: '>=0.6.0'} @@ -20174,6 +20538,11 @@ packages: resolution: {integrity: sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==} engines: {node: '>= 4'} + /image-meta@0.1.1: + resolution: {integrity: sha512-+oXiHwOEPr1IE5zY0tcBLED/CYcre15J4nwL50x3o0jxWqEkyjrusiKP3YSU+tr9fvJp33ZcP5Gpj2295g3aEw==} + engines: {node: '>=10.18.0'} + dev: false + /image-meta@0.2.0: resolution: {integrity: sha512-ZBGjl0ZMEMeOC3Ns0wUF/5UdUmr3qQhBSCniT0LxOgGGIRHiNFOkMtIHB7EOznRU47V2AxPgiVP+s+0/UCU0Hg==} dev: false @@ -20408,6 +20777,24 @@ packages: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} engines: {node: '>= 0.10'} + /ipx@1.3.1: + resolution: {integrity: sha512-hWRLXdMDOz2q81T2x9lowFtAGO3E5b2HtC8xOOBTrlnxygHNaVrZqJ5c1P3T7tDkC3oCocYRRz0VBffvJKeQlw==} + hasBin: true + dependencies: + '@fastify/accept-negotiator': 1.1.0 + consola: 3.2.3 + defu: 6.1.3 + destr: 2.0.2 + etag: 1.8.1 + image-meta: 0.1.1 + listhen: 1.5.5 + node-fetch-native: 1.6.1 + pathe: 1.1.1 + sharp: 0.33.1 + ufo: 1.3.2 + xss: 1.0.14 + dev: false + /ipx@2.0.1(@netlify/blobs@6.3.1): resolution: {integrity: sha512-+EyZiVNosYr3hu3F5+5GripTBLjKmSPTvcy3YdT4zxlhqHQJ2gUopLGxpfv9Wd11YgeiPh53ysbtG+ZNIOVF4A==} hasBin: true @@ -23563,6 +23950,12 @@ packages: engines: {node: '>=10'} hasBin: true + /mkdirp@3.0.1: + resolution: {integrity: sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==} + engines: {node: '>=10'} + hasBin: true + dev: false + /mlly@1.4.2: resolution: {integrity: sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==} dependencies: @@ -23687,6 +24080,10 @@ packages: uid-safe: 2.1.5 dev: false + /murmurhash@2.0.1: + resolution: {integrity: sha512-5vQEh3y+DG/lMPM0mCGPDnyV8chYg/g7rl6v3Gd8WMF9S429ox3Xk8qrk174kWhG767KQMqqxLD1WnGd77hiew==} + dev: false + /mute-stream@0.0.7: resolution: {integrity: sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==} dev: false @@ -24699,6 +25096,10 @@ packages: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} + /outdent@0.8.0: + resolution: {integrity: sha512-KiOAIsdpUTcAXuykya5fnVVT+/5uS0Q1mrkRHcF89tpieSmY33O/tmc54CqwA+bfhbtEfZUNLHaPUiB9X3jt1A==} + dev: false + /p-cancelable@2.1.1: resolution: {integrity: sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==} engines: {node: '>=8'} @@ -25147,6 +25548,10 @@ packages: resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} engines: {node: '>=12'} + /pathe@0.3.9: + resolution: {integrity: sha512-6Y6s0vT112P3jD8dGfuS6r+lpa0qqNrLyHPOwvXMnyNTQaYiwgau2DP3aNDsR13xqtGj7rrPo+jFUATpU6/s+g==} + dev: false + /pathe@1.1.1: resolution: {integrity: sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==} requiresBuild: true @@ -28239,6 +28644,16 @@ packages: ajv: 6.12.6 ajv-keywords: 3.5.2(ajv@6.12.6) + /schema-utils@4.2.0: + resolution: {integrity: sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==} + engines: {node: '>= 12.13.0'} + dependencies: + '@types/json-schema': 7.0.15 + ajv: 8.12.0 + ajv-formats: 2.1.1(ajv@8.12.0) + ajv-keywords: 5.1.0(ajv@8.12.0) + dev: false + /scroll-into-view-if-needed@2.2.31: resolution: {integrity: sha512-dGCXy99wZQivjmjIqihaBQNjryrz5rueJY7eHfTdyWEiR4ttYpsajb14rn9s5d4DY4EcY6+4+U/maARBXJedkA==} dependencies: @@ -30040,6 +30455,13 @@ packages: resolution: {integrity: sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==} dev: true + /tiny-glob@0.2.9: + resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==} + dependencies: + globalyzer: 0.1.0 + globrex: 0.1.2 + dev: false + /tiny-invariant@1.0.6: resolution: {integrity: sha512-FOyLWWVjG+aC0UqG76V53yAWdXfH8bO6FNmyZOuUrzDzK8DI3/JRY25UD7+g49JWM1LXwymsKERB+DzI0dTEQA==} dev: false @@ -31008,6 +31430,59 @@ packages: - supports-color dev: false + /unstorage@1.9.0: + resolution: {integrity: sha512-VpD8ZEYc/le8DZCrny3bnqKE4ZjioQxBRnWE+j5sGNvziPjeDlaS1NaFFHzl/kkXaO3r7UaF8MGQrs14+1B4pQ==} + peerDependencies: + '@azure/app-configuration': ^1.4.1 + '@azure/cosmos': ^3.17.3 + '@azure/data-tables': ^13.2.2 + '@azure/identity': ^3.2.3 + '@azure/keyvault-secrets': ^4.7.0 + '@azure/storage-blob': ^12.14.0 + '@capacitor/preferences': ^5.0.0 + '@planetscale/database': ^1.8.0 + '@upstash/redis': ^1.22.0 + '@vercel/kv': ^0.2.2 + idb-keyval: ^6.2.1 + peerDependenciesMeta: + '@azure/app-configuration': + optional: true + '@azure/cosmos': + optional: true + '@azure/data-tables': + optional: true + '@azure/identity': + optional: true + '@azure/keyvault-secrets': + optional: true + '@azure/storage-blob': + optional: true + '@capacitor/preferences': + optional: true + '@planetscale/database': + optional: true + '@upstash/redis': + optional: true + '@vercel/kv': + optional: true + idb-keyval: + optional: true + dependencies: + anymatch: 3.1.3 + chokidar: 3.5.3 + destr: 2.0.2 + h3: 1.9.0 + ioredis: 5.3.2 + listhen: 1.5.5 + lru-cache: 10.1.0 + mri: 1.2.0 + node-fetch-native: 1.6.1 + ofetch: 1.3.3 + ufo: 1.3.2 + transitivePeerDependencies: + - supports-color + dev: false + /untildify@3.0.3: resolution: {integrity: sha512-iSk/J8efr8uPT/Z4eSUywnqyrQU7DSdMfdqK4iWEaUVVmcP5JcnpRqmVMwcwcnmI1ATFNgC5V90u09tBynNFKA==} engines: {node: '>=4'} From 29966e055a21803d253f00402b442de1d9ec5558 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Wed, 14 Feb 2024 11:34:18 +0100 Subject: [PATCH 05/51] fix(gatsby-oauth): authenticate with gatsby develop --- apps/website/api/auth/[nextauth].js | 10 ++++++++++ apps/website/api/auth/[nextauth]/[provider].js | 2 ++ apps/website/package.json | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 apps/website/api/auth/[nextauth].js create mode 100644 apps/website/api/auth/[nextauth]/[provider].js diff --git a/apps/website/api/auth/[nextauth].js b/apps/website/api/auth/[nextauth].js new file mode 100644 index 000000000..f2e406a44 --- /dev/null +++ b/apps/website/api/auth/[nextauth].js @@ -0,0 +1,10 @@ +// Gatsby Functions are not yet supported on Vercel, so you'll need to use the root `api` folder. +import NextAuth from 'next-auth'; +import { authConfig } from '../../nextauth.config'; + +// @ts-ignore +export default async function handler(req, res) { + const { nextauth, provider, ...rest } = req.query; + req.query = { nextauth: [nextauth, provider], ...rest }; + return await NextAuth(req, res, authConfig); +} diff --git a/apps/website/api/auth/[nextauth]/[provider].js b/apps/website/api/auth/[nextauth]/[provider].js new file mode 100644 index 000000000..0a3e8dbc2 --- /dev/null +++ b/apps/website/api/auth/[nextauth]/[provider].js @@ -0,0 +1,2 @@ +// Vercel Functions for Gatsby currently do not support catch-all routes. +export { default } from "../[nextauth]" diff --git a/apps/website/package.json b/apps/website/package.json index f0bf7ce27..62f856029 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -55,7 +55,7 @@ "serve": "netlify dev --cwd=. --dir=public --port=8000", "dev": "pnpm clean && publisher", "open": "open http://127.0.0.1:8000/___status/", - "gatsby:develop": "ENABLE_GATSBY_REFRESH_ENDPOINT=true pnpm gatsby develop", + "gatsby:develop": "NEXTAUTH_URL=http://localhost:8000 ENABLE_GATSBY_REFRESH_ENDPOINT=true pnpm gatsby develop", "gatsby:refresh": "curl -X POST http://localhost:8000/__refresh", "clean": "gatsby clean" } From 51b813156f90d14e11ccbc98c7fe2a3b79841fce Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Wed, 14 Feb 2024 11:48:02 +0100 Subject: [PATCH 06/51] feat(gatsby-oauth): set dummy credentials and drupal providers --- apps/website/nextauth.config.js | 42 ++++++++++++++----- .../57e1b8a7-48a5-4468-89d9-0016825b9868.yml | 38 +++++++++++++++++ .../ecfaf32e-48d5-461e-be02-5be95c24d5e1.yml | 24 ----------- 3 files changed, 69 insertions(+), 35 deletions(-) create mode 100644 packages/drupal/test_content/content/consumer/57e1b8a7-48a5-4468-89d9-0016825b9868.yml delete mode 100644 packages/drupal/test_content/content/consumer/ecfaf32e-48d5-461e-be02-5be95c24d5e1.yml diff --git a/apps/website/nextauth.config.js b/apps/website/nextauth.config.js index 73ca50f47..0d2def4ad 100644 --- a/apps/website/nextauth.config.js +++ b/apps/website/nextauth.config.js @@ -1,26 +1,48 @@ +import CredentialsProvider from 'next-auth/providers/credentials'; + +export const AUTH_DRUPAL_URL = + process.env.AUTH_DRUPAL_URL || 'http://127.0.0.1:8888'; + /** @type {import("next-auth").NextAuthOptions} */ export const authConfig = { - // @todo set hardcoded configuration from env vars. providers: [ + // Dummy provider for local development + // without the need to set up e.g. OAuth. + CredentialsProvider({ + credentials: { + Password: { placeholder: `type "password"`, type: 'password' }, + }, + // @ts-ignore + authorize(credentials) { + // @ts-ignore + if (credentials.Password === 'password') { + return { + name: 'Amazee Labs', + email: 'hello@amazeelabs.com', + image: 'https://www.amazeelabs.com/images/icon.png', + }; + } + }, + }), { // Client ID and secret are set in the Drupal Consumer. - clientId: 'gatsby_editor', - clientSecret: 'gatsby_editor', + clientId: process.env.AUTH_DRUPAL_ID || 'gatsby', + clientSecret: process.env.AUTH_DRUPAL_SECRET || 'gatsby', id: 'drupal', - name: 'DrupalProvider', + name: 'Drupal', type: 'oauth', // Language prefix is added to prevent 301 // that will not be handled by NextAuth. authorization: { - url: 'http://127.0.0.1:8888/en/oauth/authorize', + url: `${AUTH_DRUPAL_URL}/en/oauth/authorize`, params: { // @todo refine scope, editor (role) is used for now. scope: 'editor', }, }, idToken: false, - token: 'http://127.0.0.1:8888/en/oauth/token', - userinfo: 'http://127.0.0.1:8888/en/oauth/userinfo', + token: `${AUTH_DRUPAL_URL}/en/oauth/token`, + userinfo: `${AUTH_DRUPAL_URL}/en/oauth/userinfo`, profile(profile) { return { id: profile.sub, @@ -28,13 +50,11 @@ export const authConfig = { email: profile.email, }; }, - //theme: 'light', }, ], theme: { - // @todo use custom logo. - logo: 'https://www.gatsbyjs.com/Gatsby-Monogram.svg', + logo: 'https://www.amazeelabs.com/images/icon.png', colorScheme: 'light', - brandColor: '#663399', + brandColor: '#951B81', }, }; diff --git a/packages/drupal/test_content/content/consumer/57e1b8a7-48a5-4468-89d9-0016825b9868.yml b/packages/drupal/test_content/content/consumer/57e1b8a7-48a5-4468-89d9-0016825b9868.yml new file mode 100644 index 000000000..003a86ba9 --- /dev/null +++ b/packages/drupal/test_content/content/consumer/57e1b8a7-48a5-4468-89d9-0016825b9868.yml @@ -0,0 +1,38 @@ +_meta: + version: '1.0' + entity_type: consumer + uuid: 57e1b8a7-48a5-4468-89d9-0016825b9868 + default_langcode: en +default: + owner_id: + - + target_id: 1 + client_id: + - + value: gatsby + label: + - + value: Gatsby + third_party: + - + value: true + is_default: + - + value: false + secret: + - + value: $2y$10$oF1wWQgp0zlEYBnomKI.f.CvWf9VfpsowJA/JFNVN4u773miv90QW + existing: '' + pre_hashed: false + confidential: + - + value: true + roles: + - + target_id: editor + redirect: + - + value: 'http://localhost:8000/api/auth/callback/drupal' + pkce: + - + value: false diff --git a/packages/drupal/test_content/content/consumer/ecfaf32e-48d5-461e-be02-5be95c24d5e1.yml b/packages/drupal/test_content/content/consumer/ecfaf32e-48d5-461e-be02-5be95c24d5e1.yml deleted file mode 100644 index c36b936f3..000000000 --- a/packages/drupal/test_content/content/consumer/ecfaf32e-48d5-461e-be02-5be95c24d5e1.yml +++ /dev/null @@ -1,24 +0,0 @@ -_meta: - version: '1.0' - entity_type: consumer - uuid: ecfaf32e-48d5-461e-be02-5be95c24d5e1 - default_langcode: en -default: - owner_id: - - - target_id: 0 - client_id: - - - value: default_consumer - label: - - - value: 'Default Consumer' - description: - - - value: 'This is the default consumer. This was created programmatically when the Consumers module was first installed. Feel free to edit, or delete this.' - third_party: - - - value: true - is_default: - - - value: true From 166dbbbaf79b31651ca5e2fc9d0a96bc8678523b Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Wed, 14 Feb 2024 12:08:13 +0100 Subject: [PATCH 07/51] docs(gatsby-oauth): basic setup with drupal --- README.md | 38 +++++++++++++++++++ apps/website/api/auth/[nextauth].js | 1 + .../website/api/auth/[nextauth]/[provider].js | 2 +- apps/website/src/api/auth/[...nextauth].js | 2 +- 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 74a037439..d38671dd0 100644 --- a/README.md +++ b/README.md @@ -206,6 +206,44 @@ lagoon runtime configuration. lagoon add variable -p [project name] -e dev -N NETLIFY_SITE_ID -V [netlify site id] ``` +### Gatsby authentication / SSO + +Enabled only when `NEXTAUTH_URL` is set. + +Authentication providers are relying on Auth.js (formerly Next-Auth) and can be +configured in `/apps/website/nextauth.config.js` + +An example is provided for Drupal and a dummy `Credentials` provider. + +
+ How it works +On Netlify, several environment variables are required to be set: + +##### In all cases + +- `NEXTAUTH_URL` The URL of the website. This is used for the callback. +- `NEXTAUTH_SECRET` A random string used for encryption. + +Generate the secret with e.g. `openssl rand -base64 32` + +##### For Drupal + +- `AUTH_DRUPAL_ID` The client ID of the Drupal Consumer +- `AUTH_DRUPAL_SECRET` The client secret of the Drupal Consumer + +In Drupal go to `/admin/config/services/consumer` and add a new Consumer. + +- Label: `Gatsby` +- Client ID: `gatsby` +- Secret: a random string matching `AUTH_DRUPAL_SECRET` +- Redirect URI: `[netlify-gatsby-site-url]/oauth/callback` + +##### Other providers + +Refer to [Auth.js documentation](https://next-auth.js.org/providers/). + +
+ ### Publisher authentication with Drupal Publisher can require to authenticate with Drupal based on OAuth2. It is only diff --git a/apps/website/api/auth/[nextauth].js b/apps/website/api/auth/[nextauth].js index f2e406a44..e24fc5492 100644 --- a/apps/website/api/auth/[nextauth].js +++ b/apps/website/api/auth/[nextauth].js @@ -1,5 +1,6 @@ // Gatsby Functions are not yet supported on Vercel, so you'll need to use the root `api` folder. import NextAuth from 'next-auth'; + import { authConfig } from '../../nextauth.config'; // @ts-ignore diff --git a/apps/website/api/auth/[nextauth]/[provider].js b/apps/website/api/auth/[nextauth]/[provider].js index 0a3e8dbc2..cf1051443 100644 --- a/apps/website/api/auth/[nextauth]/[provider].js +++ b/apps/website/api/auth/[nextauth]/[provider].js @@ -1,2 +1,2 @@ // Vercel Functions for Gatsby currently do not support catch-all routes. -export { default } from "../[nextauth]" +export { default } from '../[nextauth]'; diff --git a/apps/website/src/api/auth/[...nextauth].js b/apps/website/src/api/auth/[...nextauth].js index 2c8eff02e..d5678f8f3 100644 --- a/apps/website/src/api/auth/[...nextauth].js +++ b/apps/website/src/api/auth/[...nextauth].js @@ -1,9 +1,9 @@ // If your deployment environment supports Gatsby Functions, you won't need the root `api` folder, only this. import NextAuth from 'next-auth'; + import { authConfig } from '../../../nextauth.config'; -// @todo // @ts-ignore export default async function handler(req, res) { req.query.nextauth = req.params.nextauth.split('/'); From a8b9300ab5f8f298a1d67eccd6bdfc9442b039ee Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Wed, 14 Feb 2024 12:39:51 +0100 Subject: [PATCH 08/51] =?UTF-8?q?chore(gatsby-oauth):=20give=20it=20a=20?= =?UTF-8?q?=F0=9F=8D=8C=20so=20next-auth=20logs=20are=20quiet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/website/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/website/package.json b/apps/website/package.json index 62f856029..252f1c8e6 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -55,7 +55,7 @@ "serve": "netlify dev --cwd=. --dir=public --port=8000", "dev": "pnpm clean && publisher", "open": "open http://127.0.0.1:8000/___status/", - "gatsby:develop": "NEXTAUTH_URL=http://localhost:8000 ENABLE_GATSBY_REFRESH_ENDPOINT=true pnpm gatsby develop", + "gatsby:develop": "NEXTAUTH_URL=http://localhost:8000 NEXTAUTH_SECRET=banana ENABLE_GATSBY_REFRESH_ENDPOINT=true pnpm gatsby develop", "gatsby:refresh": "curl -X POST http://localhost:8000/__refresh", "clean": "gatsby clean" } From 781e3fb9f6c9c72f2106c6810203b53db2979912 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Wed, 14 Feb 2024 12:48:01 +0100 Subject: [PATCH 09/51] refactor(gatsby-oauth): render login header only if a provider is available --- README.md | 2 +- apps/website/src/layouts/index.tsx | 86 ++++++++++++++++-------------- 2 files changed, 46 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index d38671dd0..ee9c87d75 100644 --- a/README.md +++ b/README.md @@ -208,7 +208,7 @@ lagoon add variable -p [project name] -e dev -N NETLIFY_SITE_ID -V [netlify site ### Gatsby authentication / SSO -Enabled only when `NEXTAUTH_URL` is set. +Enabled only when at least one provider is configured. Authentication providers are relying on Auth.js (formerly Next-Auth) and can be configured in `/apps/website/nextauth.config.js` diff --git a/apps/website/src/layouts/index.tsx b/apps/website/src/layouts/index.tsx index a26cb5937..216881268 100644 --- a/apps/website/src/layouts/index.tsx +++ b/apps/website/src/layouts/index.tsx @@ -4,6 +4,8 @@ import { Frame } from '@custom/ui/routes/Frame'; import { signIn, signOut, useSession } from 'next-auth/react'; import React, { PropsWithChildren } from 'react'; +import { authConfig } from '../../nextauth.config'; + export default function Layout({ children, }: PropsWithChildren<{ @@ -16,47 +18,49 @@ export default function Layout({ // @todo move signin/signout to a specific component. return ( <> -
-
-

- {session?.status !== 'authenticated' && ( - <> - You are not signed in - { - e.preventDefault(); - signIn(); - }} - > - Sign in - - - )} - {session?.status === 'authenticated' && session.data.user && ( - <> - - Signed in as -
- {session.data.user.email} - {session.data.user.name - ? `(${session.data.user.name})` - : null} -
- { - e.preventDefault(); - signOut(); - }} - > - Sign out - - - )} -

-
-
+ {authConfig.providers && ( +
+
+

+ {session?.status !== 'authenticated' && ( + <> + You are not signed in + { + e.preventDefault(); + signIn(); + }} + > + Sign in + + + )} + {session?.status === 'authenticated' && session.data.user && ( + <> + + Signed in as +
+ {session.data.user.email} + {session.data.user.name + ? `(${session.data.user.name})` + : null} +
+ { + e.preventDefault(); + signOut(); + }} + > + Sign out + + + )} +

+
+
+ )} {children} ); From f7bb0171ff444edc21e399edc9a5b756cc32ecb0 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Wed, 14 Feb 2024 19:45:24 +0100 Subject: [PATCH 10/51] chore(gatsby-oauth): prevent to export oauth2 tokens as default content --- packages/drupal/test_content/export.php | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/drupal/test_content/export.php b/packages/drupal/test_content/export.php index 4e89459f7..211352a54 100644 --- a/packages/drupal/test_content/export.php +++ b/packages/drupal/test_content/export.php @@ -13,6 +13,7 @@ // troubles if exported to the default content. 'path_alias', 'content_moderation_state', + 'oauth2_token', 'redirect', 'webform_submission', ]; From c86ba534624ab62e800e7adb71108303fb9bb1cb Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Thu, 28 Mar 2024 14:05:57 +0100 Subject: [PATCH 11/51] chore: copilot ignore --- .idea/.gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.idea/.gitignore b/.idea/.gitignore index 03d7c2646..a87f3fbd7 100644 --- a/.idea/.gitignore +++ b/.idea/.gitignore @@ -7,3 +7,5 @@ /dataSources/ /dataSources.local.xml /markdown.xml +# GitHub Copilot persisted chat sessions +/copilot/chatSessions From c63a0f03fdb6ff389a2b314bf65c281ff8e5f19c Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Thu, 28 Mar 2024 23:17:08 +0100 Subject: [PATCH 12/51] chore(gatsby-oauth): add supabase adapters --- apps/website/package.json | 2 + apps/website/supabase/.gitignore | 4 + apps/website/supabase/config.toml | 161 ++++++++++++++++++++++++++++++ apps/website/supabase/seed.sql | 0 pnpm-lock.yaml | 130 +++++++++++++++++++++++- 5 files changed, 296 insertions(+), 1 deletion(-) create mode 100644 apps/website/supabase/.gitignore create mode 100644 apps/website/supabase/config.toml create mode 100644 apps/website/supabase/seed.sql diff --git a/apps/website/package.json b/apps/website/package.json index 252f1c8e6..01134deb7 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -9,11 +9,13 @@ "@amazeelabs/gatsby-source-silverback": "^1.13.10", "@amazeelabs/publisher": "^2.4.17", "@amazeelabs/strangler-netlify": "^1.1.9", + "@auth/supabase-adapter": "^0.6.1", "@custom/decap": "workspace:*", "@custom/schema": "workspace:*", "@custom/ui": "workspace:*", "@gatsbyjs/reach-router": "^2.0.1", "@netlify/plugin-nextjs": "^4.41.3", + "@supabase/supabase-js": "^2.41.1", "babel-loader": "^9.1.3", "body-parser": "^1.20.2", "gatsby": "^5.13.1", diff --git a/apps/website/supabase/.gitignore b/apps/website/supabase/.gitignore new file mode 100644 index 000000000..a3ad88055 --- /dev/null +++ b/apps/website/supabase/.gitignore @@ -0,0 +1,4 @@ +# Supabase +.branches +.temp +.env diff --git a/apps/website/supabase/config.toml b/apps/website/supabase/config.toml new file mode 100644 index 000000000..f59455a54 --- /dev/null +++ b/apps/website/supabase/config.toml @@ -0,0 +1,161 @@ +# A string used to distinguish different Supabase projects on the same host. Defaults to the +# working directory name when running `supabase init`. +project_id = "website" + +[api] +enabled = true +# Port to use for the API URL. +port = 54321 +# Schemas to expose in your API. Tables, views and stored procedures in this schema will get API +# endpoints. public and storage are always included. +schemas = ["public", "storage", "graphql_public", "next_auth"] +# Extra schemas to add to the search_path of every request. public is always included. +extra_search_path = ["public", "extensions"] +# The maximum number of rows returns from a view, table, or stored procedure. Limits payload size +# for accidental or malicious requests. +max_rows = 1000 + +[db] +# Port to use for the local database URL. +port = 54322 +# Port used by db diff command to initialize the shadow database. +shadow_port = 54320 +# The database major version to use. This has to be the same as your remote database's. Run `SHOW +# server_version;` on the remote database to check. +major_version = 15 + +[db.pooler] +enabled = false +# Port to use for the local connection pooler. +port = 54329 +# Specifies when a server connection can be reused by other clients. +# Configure one of the supported pooler modes: `transaction`, `session`. +pool_mode = "transaction" +# How many server connections to allow per user/database pair. +default_pool_size = 20 +# Maximum number of client connections allowed. +max_client_conn = 100 + +[realtime] +enabled = true +# Bind realtime via either IPv4 or IPv6. (default: IPv6) +# ip_version = "IPv6" +# The maximum length in bytes of HTTP request headers. (default: 4096) +# max_header_length = 4096 + +[studio] +enabled = true +# Port to use for Supabase Studio. +port = 54323 +# External URL of the API server that frontend connects to. +api_url = "http://127.0.0.1" +# OpenAI API Key to use for Supabase AI in the Supabase Studio. +openai_api_key = "env(OPENAI_API_KEY)" + +# Email testing server. Emails sent with the local dev setup are not actually sent - rather, they +# are monitored, and you can view the emails that would have been sent from the web interface. +[inbucket] +enabled = true +# Port to use for the email testing server web interface. +port = 54324 +# Uncomment to expose additional ports for testing user applications that send emails. +# smtp_port = 54325 +# pop3_port = 54326 + +[storage] +enabled = true +# The maximum file size allowed (e.g. "5MB", "500KB"). +file_size_limit = "50MiB" + +[auth] +enabled = true +# The base URL of your website. Used as an allow-list for redirects and for constructing URLs used +# in emails. +site_url = "http://127.0.0.1:3000" +# A list of *exact* URLs that auth providers are permitted to redirect to post authentication. +additional_redirect_urls = ["https://127.0.0.1:3000"] +# How long tokens are valid for, in seconds. Defaults to 3600 (1 hour), maximum 604,800 (1 week). +jwt_expiry = 3600 +# If disabled, the refresh token will never expire. +enable_refresh_token_rotation = true +# Allows refresh tokens to be reused after expiry, up to the specified interval in seconds. +# Requires enable_refresh_token_rotation = true. +refresh_token_reuse_interval = 10 +# Allow/disallow new user signups to your project. +enable_signup = true +# Allow/disallow testing manual linking of accounts +enable_manual_linking = false + +[auth.email] +# Allow/disallow new user signups via email to your project. +enable_signup = true +# If enabled, a user will be required to confirm any email change on both the old, and new email +# addresses. If disabled, only the new email is required to confirm. +double_confirm_changes = true +# If enabled, users need to confirm their email address before signing in. +enable_confirmations = false + +# Uncomment to customize email template +# [auth.email.template.invite] +# subject = "You have been invited" +# content_path = "./supabase/templates/invite.html" + +[auth.sms] +# Allow/disallow new user signups via SMS to your project. +enable_signup = true +# If enabled, users need to confirm their phone number before signing in. +enable_confirmations = false +# Template for sending OTP to users +template = "Your code is {{ .Code }} ." + +# Use pre-defined map of phone number to OTP for testing. +[auth.sms.test_otp] +# 4152127777 = "123456" + +# This hook runs before a token is issued and allows you to add additional claims based on the authentication method used. +[auth.hook.custom_access_token] +# enabled = true +# uri = "pg-functions:////" + + +# Configure one of the supported SMS providers: `twilio`, `twilio_verify`, `messagebird`, `textlocal`, `vonage`. +[auth.sms.twilio] +enabled = false +account_sid = "" +message_service_sid = "" +# DO NOT commit your Twilio auth token to git. Use environment variable substitution instead: +auth_token = "env(SUPABASE_AUTH_SMS_TWILIO_AUTH_TOKEN)" + +# Use an external OAuth provider. The full list of providers are: `apple`, `azure`, `bitbucket`, +# `discord`, `facebook`, `github`, `gitlab`, `google`, `keycloak`, `linkedin_oidc`, `notion`, `twitch`, +# `twitter`, `slack`, `spotify`, `workos`, `zoom`. +[auth.external.apple] +enabled = false +client_id = "" +# DO NOT commit your OAuth provider secret to git. Use environment variable substitution instead: +secret = "env(SUPABASE_AUTH_EXTERNAL_APPLE_SECRET)" +# Overrides the default auth redirectUrl. +redirect_uri = "" +# Overrides the default auth provider URL. Used to support self-hosted gitlab, single-tenant Azure, +# or any other third-party OIDC providers. +url = "" + +[analytics] +enabled = false +port = 54327 +vector_port = 54328 +# Configure one of the supported backends: `postgres`, `bigquery`. +backend = "postgres" + +# Experimental features may be deprecated any time +[experimental] +# Configures Postgres storage engine to use OrioleDB (S3) +orioledb_version = "" +# Configures S3 bucket URL, eg. .s3-.amazonaws.com +s3_host = "env(S3_HOST)" +# Configures S3 bucket region, eg. us-east-1 +s3_region = "env(S3_REGION)" +# Configures AWS_ACCESS_KEY_ID for S3 bucket +s3_access_key = "env(S3_ACCESS_KEY)" +# Configures AWS_SECRET_ACCESS_KEY for S3 bucket +s3_secret_key = "env(S3_SECRET_KEY)" diff --git a/apps/website/supabase/seed.sql b/apps/website/supabase/seed.sql new file mode 100644 index 000000000..e69de29bb diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4874b44d3..242615c4d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -203,6 +203,9 @@ importers: '@amazeelabs/strangler-netlify': specifier: ^1.1.9 version: 1.1.9(happy-dom@12.10.3)(react@18.2.0) + '@auth/supabase-adapter': + specifier: ^0.6.1 + version: 0.6.1(@supabase/supabase-js@2.41.1) '@custom/decap': specifier: workspace:* version: link:../decap @@ -218,6 +221,9 @@ importers: '@netlify/plugin-nextjs': specifier: ^4.41.3 version: 4.41.3 + '@supabase/supabase-js': + specifier: ^2.41.1 + version: 2.41.1 babel-loader: specifier: ^9.1.3 version: 9.1.3(@babel/core@7.23.7)(webpack@5.89.0) @@ -1117,6 +1123,42 @@ packages: transitivePeerDependencies: - encoding + /@auth/core@0.28.1: + resolution: {integrity: sha512-gvp74mypYZADpTlfGRp6HE0G3pIHWvtJpy+KZ+8FvY0cmlIpHog+jdMOdd29dQtLtN25kF2YbfHsesCFuGUQbg==} + peerDependencies: + '@simplewebauthn/browser': ^9.0.1 + '@simplewebauthn/server': ^9.0.2 + nodemailer: ^6.8.0 + peerDependenciesMeta: + '@simplewebauthn/browser': + optional: true + '@simplewebauthn/server': + optional: true + nodemailer: + optional: true + dependencies: + '@panva/hkdf': 1.1.1 + '@types/cookie': 0.6.0 + cookie: 0.6.0 + jose: 5.2.0 + oauth4webapi: 2.10.3 + preact: 10.11.3 + preact-render-to-string: 5.2.3(preact@10.11.3) + dev: false + + /@auth/supabase-adapter@0.6.1(@supabase/supabase-js@2.41.1): + resolution: {integrity: sha512-xD7scVGms+X13F5hGce8oErQmxQXG+OKJD38zZ+hTmUoALNiDhK/COmy0hPtkXnAAVH///iuI0r7rzpawWuj7g==} + peerDependencies: + '@supabase/supabase-js': ^2.0.5 + dependencies: + '@auth/core': 0.28.1 + '@supabase/supabase-js': 2.41.1 + transitivePeerDependencies: + - '@simplewebauthn/browser' + - '@simplewebauthn/server' + - nodemailer + dev: false + /@aw-web-design/x-default-browser@1.4.126: resolution: {integrity: sha512-Xk1sIhyNC/esHGGVjL/niHLowM0csl/kFO5uawBy4IrWwy0o1G8LGt3jP6nmWGz+USxeeqbihAmp/oVZju6wug==} hasBin: true @@ -9501,6 +9543,63 @@ packages: file-system-cache: 2.3.0 dev: true + /@supabase/auth-js@2.63.0: + resolution: {integrity: sha512-yIgcHnlgv24GxHtVGUhwGqAFDyJkPIC/xjx7HostN08A8yCy8HIfl4JEkTKyBqD1v1L05jNEJOUke4Lf4O1+Qg==} + dependencies: + '@supabase/node-fetch': 2.6.15 + dev: false + + /@supabase/functions-js@2.2.2: + resolution: {integrity: sha512-sJGq1nludmi7pY/fdtCpyY/pYonx7MfHdN408bqb736guWcVI1AChYVbI4kUM978EuOE4Ci6l7bUudfGg07QRw==} + dependencies: + '@supabase/node-fetch': 2.6.15 + dev: false + + /@supabase/node-fetch@2.6.15: + resolution: {integrity: sha512-1ibVeYUacxWYi9i0cf5efil6adJ9WRyZBLivgjs+AUpewx1F3xPi7gLgaASI2SmIQxPoCEjAsLAzKPgMJVgOUQ==} + engines: {node: 4.x || >=6.0.0} + dependencies: + whatwg-url: 5.0.0 + dev: false + + /@supabase/postgrest-js@1.9.2: + resolution: {integrity: sha512-I6yHo8CC9cxhOo6DouDMy9uOfW7hjdsnCxZiaJuIVZm1dBGTFiQPgfMa9zXCamEWzNyWRjZvupAUuX+tqcl5Sw==} + dependencies: + '@supabase/node-fetch': 2.6.15 + dev: false + + /@supabase/realtime-js@2.9.3: + resolution: {integrity: sha512-lAp50s2n3FhGJFq+wTSXLNIDPw5Y0Wxrgt44eM5nLSA3jZNUUP3Oq2Ccd1CbZdVntPCWLZvJaU//pAd2NE+QnQ==} + dependencies: + '@supabase/node-fetch': 2.6.15 + '@types/phoenix': 1.6.4 + '@types/ws': 8.5.10 + ws: 8.16.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: false + + /@supabase/storage-js@2.5.5: + resolution: {integrity: sha512-OpLoDRjFwClwc2cjTJZG8XviTiQH4Ik8sCiMK5v7et0MDu2QlXjCAW3ljxJB5+z/KazdMOTnySi+hysxWUPu3w==} + dependencies: + '@supabase/node-fetch': 2.6.15 + dev: false + + /@supabase/supabase-js@2.41.1: + resolution: {integrity: sha512-xmECLhYugMo/6SObpsOhu5xaxVfsk+JK/d4JSh055bpESmgmN3PLpzbfqejKCpaUeeUNF21+lrJp/U9HQzT9mA==} + dependencies: + '@supabase/auth-js': 2.63.0 + '@supabase/functions-js': 2.2.2 + '@supabase/node-fetch': 2.6.15 + '@supabase/postgrest-js': 1.9.2 + '@supabase/realtime-js': 2.9.3 + '@supabase/storage-js': 2.5.5 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: false + /@swc/cli@0.1.63(@swc/core@1.3.102): resolution: {integrity: sha512-EM9oxxHzmmsprYRbGqsS2M4M/Gr5Gkcl0ROYYIdlUyTkhOiX822EQiRCpPCwdutdnzH2GyaTN7wc6i0Y+CKd3A==} engines: {node: '>= 12.13'} @@ -9911,6 +10010,10 @@ packages: /@types/cookie@0.4.1: resolution: {integrity: sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==} + /@types/cookie@0.6.0: + resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==} + dev: false + /@types/cors@2.8.17: resolution: {integrity: sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==} dependencies: @@ -10166,6 +10269,10 @@ packages: resolution: {integrity: sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g==} dev: false + /@types/phoenix@1.6.4: + resolution: {integrity: sha512-B34A7uot1Cv0XtaHRYDATltAdKx0BvVKNgYNqE4WjtPUa4VQJM7kxeXcVKaH+KS+kCmZ+6w+QaUdcljiheiBJA==} + dev: false + /@types/picomatch@2.3.3: resolution: {integrity: sha512-Yll76ZHikRFCyz/pffKGjrCwe/le2CDwOP5F210KQo27kpRE46U2rDnzikNlVn6/ezH3Mhn46bJMTfeVTtcYMg==} dev: true @@ -14244,6 +14351,11 @@ packages: resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} engines: {node: '>= 0.6'} + /cookie@0.6.0: + resolution: {integrity: sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==} + engines: {node: '>= 0.6'} + dev: false + /copy-descriptor@0.1.1: resolution: {integrity: sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw==} engines: {node: '>=0.10.0'} @@ -22125,7 +22237,6 @@ packages: /jose@5.2.0: resolution: {integrity: sha512-oW3PCnvyrcm1HMvGTzqjxxfnEs9EoFOFWi2HsEGhlFVOXxTE3K9GKWVMFoFw06yPUqwpvEWic1BmtUZBI/tIjw==} - dev: true /joycon@3.1.1: resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} @@ -24798,6 +24909,10 @@ packages: ufo: 1.3.2 dev: true + /oauth4webapi@2.10.3: + resolution: {integrity: sha512-9FkXEXfzVKzH63GUOZz1zMr3wBaICSzk6DLXx+CGdrQ10ItNk2ePWzYYc1fdmKq1ayGFb2aX97sRCoZ2s0mkDw==} + dev: false + /oauth@0.9.15: resolution: {integrity: sha512-a5ERWK1kh38ExDEfoO6qUHJb32rd7aYmPHuyCu3Fta/cnICvYmgd2uhuKXvPD+PXB+gCEYYEaQdIRAjCOwAKNA==} dev: false @@ -26504,6 +26619,15 @@ packages: picocolors: 1.0.0 source-map-js: 1.0.2 + /preact-render-to-string@5.2.3(preact@10.11.3): + resolution: {integrity: sha512-aPDxUn5o3GhWdtJtW0svRC2SS/l8D9MAgo2+AWml+BhDImb27ALf04Q2d+AHqUUOc6RdSXFIBVa2gxzgMKgtZA==} + peerDependencies: + preact: '>=10' + dependencies: + preact: 10.11.3 + pretty-format: 3.8.0 + dev: false + /preact-render-to-string@5.2.6(preact@10.19.4): resolution: {integrity: sha512-JyhErpYOvBV1hEPwIxc/fHWXPfnEGdRKxc8gFdAZ7XV4tlzyzG847XAyEZqoDnynP88akM4eaHcSOzNcLWFguw==} peerDependencies: @@ -26513,6 +26637,10 @@ packages: pretty-format: 3.8.0 dev: false + /preact@10.11.3: + resolution: {integrity: sha512-eY93IVpod/zG3uMF22Unl8h9KkrcKIRs2EGar8hwLZZDU1lkjph303V9HZBwufh2s736U6VXuhD109LYqPoffg==} + dev: false + /preact@10.19.4: resolution: {integrity: sha512-dwaX5jAh0Ga8uENBX1hSOujmKWgx9RtL80KaKUFLc6jb4vCEAc3EeZ0rnQO/FO4VgjfPMfoLFWnNG8bHuZ9VLw==} dev: false From d4b3acc16fc854eacd18997e413c846555399081 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Thu, 28 Mar 2024 23:17:25 +0100 Subject: [PATCH 13/51] feat(gatsby-oauth): add currentUser directive --- .../Plugin/GraphQL/Directive/CurrentUser.php | 36 +++++++++++++++++++ packages/schema/src/schema.graphql | 17 +++++++++ 2 files changed, 53 insertions(+) create mode 100644 packages/drupal/custom/src/Plugin/GraphQL/Directive/CurrentUser.php diff --git a/packages/drupal/custom/src/Plugin/GraphQL/Directive/CurrentUser.php b/packages/drupal/custom/src/Plugin/GraphQL/Directive/CurrentUser.php new file mode 100644 index 000000000..0251a1cd9 --- /dev/null +++ b/packages/drupal/custom/src/Plugin/GraphQL/Directive/CurrentUser.php @@ -0,0 +1,36 @@ +callback(function () { + $account = \Drupal::currentUser(); + if ($account->isAnonymous()) { + return null; + } + else { + $user = User::load($account->id()); + $memberFor = \Drupal::service('date.formatter')->formatTimeDiffSince($user->getCreatedTime()); + return [ + 'id' => $account->id(), + 'name' => $account->getDisplayName(), + 'email' => $account->getEmail(), + 'memberFor' => $memberFor, + ]; + } + }); + } +} diff --git a/packages/schema/src/schema.graphql b/packages/schema/src/schema.graphql index f801171b4..3d7bda996 100644 --- a/packages/schema/src/schema.graphql +++ b/packages/schema/src/schema.graphql @@ -44,6 +44,14 @@ directive @route( path: String! ) repeatable on FIELD_DEFINITION | SCALAR | UNION | ENUM | INTERFACE | OBJECT +""" +Retrieve the properties of the current user. + +Provided by the "silverback_gatsby" module. +Implemented in "Drupal\custom\Plugin\GraphQL\Directive\CurrentUser". +""" +directive @currentUser repeatable on FIELD_DEFINITION | SCALAR | UNION | ENUM | INTERFACE | OBJECT + enum Locale @default @value(json: "\"en\"") { en de @@ -211,6 +219,15 @@ type Query { contentHub(query: String, pagination: PaginationInput!): ContentHubResult! @contentHub(query: "$query", pagination: "$pagination") + + currentUser: User @currentUser +} + +type User { + id: ID! + name: String! + email: String! + memberFor: String! } type MetaTag { From c894e8653b3535d90feeda05fab1b655e33cb1cc Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Thu, 28 Mar 2024 23:17:45 +0100 Subject: [PATCH 14/51] chore: add ray --- apps/cms/composer.json | 3 +- apps/cms/composer.lock | 492 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 493 insertions(+), 2 deletions(-) diff --git a/apps/cms/composer.json b/apps/cms/composer.json index 3acd04789..71c319de6 100644 --- a/apps/cms/composer.json +++ b/apps/cms/composer.json @@ -157,6 +157,7 @@ }, "require-dev": { "drupal/core-dev": "^10", - "phpspec/prophecy-phpunit": "^2.0.2" + "phpspec/prophecy-phpunit": "^2.0.2", + "spatie/ray": "^1.41" } } diff --git a/apps/cms/composer.lock b/apps/cms/composer.lock index 68255b548..6fa4d86d9 100644 --- a/apps/cms/composer.lock +++ b/apps/cms/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "311e78367982e8dc03f205c19ae9871e", + "content-hash": "e950eb6b15c283659be53c3fa994a954", "packages": [ { "name": "amazeeio/drupal_integrations", @@ -10429,6 +10429,61 @@ }, "time": "2023-12-09T11:58:45+00:00" }, + { + "name": "brick/math", + "version": "0.11.0", + "source": { + "type": "git", + "url": "https://github.com/brick/math.git", + "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/brick/math/zipball/0ad82ce168c82ba30d1c01ec86116ab52f589478", + "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.2", + "phpunit/phpunit": "^9.0", + "vimeo/psalm": "5.0.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Brick\\Math\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Arbitrary-precision arithmetic library", + "keywords": [ + "Arbitrary-precision", + "BigInteger", + "BigRational", + "arithmetic", + "bigdecimal", + "bignum", + "brick", + "math" + ], + "support": { + "issues": "https://github.com/brick/math/issues", + "source": "https://github.com/brick/math/tree/0.11.0" + }, + "funding": [ + { + "url": "https://github.com/BenMorel", + "type": "github" + } + ], + "time": "2023-01-15T23:15:59+00:00" + }, { "name": "colinodell/psr-testlogger", "version": "v1.3.0", @@ -13474,6 +13529,187 @@ ], "time": "2023-12-01T16:55:19+00:00" }, + { + "name": "ramsey/collection", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/ramsey/collection.git", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/collection/zipball/a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "captainhook/plugin-composer": "^5.3", + "ergebnis/composer-normalize": "^2.28.3", + "fakerphp/faker": "^1.21", + "hamcrest/hamcrest-php": "^2.0", + "jangregor/phpstan-prophecy": "^1.0", + "mockery/mockery": "^1.5", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpcsstandards/phpcsutils": "^1.0.0-rc1", + "phpspec/prophecy-phpunit": "^2.0", + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan": "^1.9", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5", + "psalm/plugin-mockery": "^1.1", + "psalm/plugin-phpunit": "^0.18.4", + "ramsey/coding-standard": "^2.0.3", + "ramsey/conventional-commits": "^1.3", + "vimeo/psalm": "^5.4" + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A PHP library for representing and manipulating collections.", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], + "support": { + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", + "type": "tidelift" + } + ], + "time": "2022-12-31T21:50:55+00:00" + }, + { + "name": "ramsey/uuid", + "version": "4.7.5", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e", + "reference": "5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e", + "shasum": "" + }, + "require": { + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11", + "ext-json": "*", + "php": "^8.0", + "ramsey/collection": "^1.2 || ^2.0" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "captainhook/captainhook": "^5.10", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.8", + "ergebnis/composer-normalize": "^2.15", + "mockery/mockery": "^1.3", + "paragonie/random-lib": "^2", + "php-mock/php-mock": "^2.2", + "php-mock/php-mock-mockery": "^1.3", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpbench/phpbench": "^1.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^8.5 || ^9", + "ramsey/composer-repl": "^1.4", + "slevomat/coding-standard": "^8.4", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.9" + }, + "suggest": { + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "source": "https://github.com/ramsey/uuid/tree/4.7.5" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", + "type": "tidelift" + } + ], + "time": "2023-11-08T05:53:05+00:00" + }, { "name": "react/promise", "version": "v3.1.0", @@ -14741,6 +14977,198 @@ ], "time": "2023-10-08T07:28:08+00:00" }, + { + "name": "spatie/backtrace", + "version": "1.5.3", + "source": { + "type": "git", + "url": "https://github.com/spatie/backtrace.git", + "reference": "483f76a82964a0431aa836b6ed0edde0c248e3ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/backtrace/zipball/483f76a82964a0431aa836b6ed0edde0c248e3ab", + "reference": "483f76a82964a0431aa836b6ed0edde0c248e3ab", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0" + }, + "require-dev": { + "ext-json": "*", + "phpunit/phpunit": "^9.3", + "spatie/phpunit-snapshot-assertions": "^4.2", + "symfony/var-dumper": "^5.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Backtrace\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van de Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "A better backtrace", + "homepage": "https://github.com/spatie/backtrace", + "keywords": [ + "Backtrace", + "spatie" + ], + "support": { + "source": "https://github.com/spatie/backtrace/tree/1.5.3" + }, + "funding": [ + { + "url": "https://github.com/sponsors/spatie", + "type": "github" + }, + { + "url": "https://spatie.be/open-source/support-us", + "type": "other" + } + ], + "time": "2023-06-28T12:59:17+00:00" + }, + { + "name": "spatie/macroable", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/macroable.git", + "reference": "ec2c320f932e730607aff8052c44183cf3ecb072" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/macroable/zipball/ec2c320f932e730607aff8052c44183cf3ecb072", + "reference": "ec2c320f932e730607aff8052c44183cf3ecb072", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.0|^9.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Macroable\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "A trait to dynamically add methods to a class", + "homepage": "https://github.com/spatie/macroable", + "keywords": [ + "macroable", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/macroable/issues", + "source": "https://github.com/spatie/macroable/tree/2.0.0" + }, + "time": "2021-03-26T22:39:02+00:00" + }, + { + "name": "spatie/ray", + "version": "1.41.1", + "source": { + "type": "git", + "url": "https://github.com/spatie/ray.git", + "reference": "051a0facb1d2462fafef87ff77eb74d6f2d12944" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/ray/zipball/051a0facb1d2462fafef87ff77eb74d6f2d12944", + "reference": "051a0facb1d2462fafef87ff77eb74d6f2d12944", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "php": "^7.3|^8.0", + "ramsey/uuid": "^3.0|^4.1", + "spatie/backtrace": "^1.1", + "spatie/macroable": "^1.0|^2.0", + "symfony/stopwatch": "^4.0|^5.1|^6.0|^7.0", + "symfony/var-dumper": "^4.2|^5.1|^6.0|^7.0" + }, + "require-dev": { + "illuminate/support": "6.x|^8.18|^9.0", + "nesbot/carbon": "^2.63", + "pestphp/pest": "^1.22", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.19.2", + "spatie/phpunit-snapshot-assertions": "^4.2", + "spatie/test-time": "^1.2" + }, + "bin": [ + "bin/remove-ray.sh" + ], + "type": "library", + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Spatie\\Ray\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Debug with Ray to fix problems faster", + "homepage": "https://github.com/spatie/ray", + "keywords": [ + "ray", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/ray/issues", + "source": "https://github.com/spatie/ray/tree/1.41.1" + }, + "funding": [ + { + "url": "https://github.com/sponsors/spatie", + "type": "github" + }, + { + "url": "https://spatie.be/open-source/support-us", + "type": "other" + } + ], + "time": "2024-01-25T10:15:50+00:00" + }, { "name": "squizlabs/php_codesniffer", "version": "3.8.0", @@ -15339,6 +15767,68 @@ ], "time": "2023-08-25T17:27:25+00:00" }, + { + "name": "symfony/stopwatch", + "version": "v7.0.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "983900d6fddf2b0cbaacacbbad07610854bd8112" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/983900d6fddf2b0cbaacacbbad07610854bd8112", + "reference": "983900d6fddf2b0cbaacacbbad07610854bd8112", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v7.0.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-23T15:02:46+00:00" + }, { "name": "theseer/tokenizer", "version": "1.2.2", From 8553572a2b19bdb0f6c2edbf6b7c48622a450a15 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Fri, 5 Apr 2024 11:57:35 +0200 Subject: [PATCH 15/51] chore(gatsby-oauth): nextauth configuration --- apps/website/api/auth/[nextauth].js | 11 ---- .../website/api/auth/[nextauth]/[provider].js | 2 - apps/website/nextauth.config.js | 48 +++++++++-------- apps/website/src/api/auth/[...nextauth].js | 1 - apps/website/src/layouts/index.tsx | 2 + apps/website/src/pages/authenticated.tsx | 51 +++++++++++++++++++ 6 files changed, 76 insertions(+), 39 deletions(-) delete mode 100644 apps/website/api/auth/[nextauth].js delete mode 100644 apps/website/api/auth/[nextauth]/[provider].js create mode 100644 apps/website/src/pages/authenticated.tsx diff --git a/apps/website/api/auth/[nextauth].js b/apps/website/api/auth/[nextauth].js deleted file mode 100644 index e24fc5492..000000000 --- a/apps/website/api/auth/[nextauth].js +++ /dev/null @@ -1,11 +0,0 @@ -// Gatsby Functions are not yet supported on Vercel, so you'll need to use the root `api` folder. -import NextAuth from 'next-auth'; - -import { authConfig } from '../../nextauth.config'; - -// @ts-ignore -export default async function handler(req, res) { - const { nextauth, provider, ...rest } = req.query; - req.query = { nextauth: [nextauth, provider], ...rest }; - return await NextAuth(req, res, authConfig); -} diff --git a/apps/website/api/auth/[nextauth]/[provider].js b/apps/website/api/auth/[nextauth]/[provider].js deleted file mode 100644 index cf1051443..000000000 --- a/apps/website/api/auth/[nextauth]/[provider].js +++ /dev/null @@ -1,2 +0,0 @@ -// Vercel Functions for Gatsby currently do not support catch-all routes. -export { default } from '../[nextauth]'; diff --git a/apps/website/nextauth.config.js b/apps/website/nextauth.config.js index 0d2def4ad..611215923 100644 --- a/apps/website/nextauth.config.js +++ b/apps/website/nextauth.config.js @@ -1,29 +1,10 @@ -import CredentialsProvider from 'next-auth/providers/credentials'; - -export const AUTH_DRUPAL_URL = - process.env.AUTH_DRUPAL_URL || 'http://127.0.0.1:8888'; +const AUTH_DRUPAL_URL = process.env.AUTH_DRUPAL_URL || 'http://127.0.0.1:8888'; /** @type {import("next-auth").NextAuthOptions} */ export const authConfig = { providers: [ - // Dummy provider for local development - // without the need to set up e.g. OAuth. - CredentialsProvider({ - credentials: { - Password: { placeholder: `type "password"`, type: 'password' }, - }, - // @ts-ignore - authorize(credentials) { - // @ts-ignore - if (credentials.Password === 'password') { - return { - name: 'Amazee Labs', - email: 'hello@amazeelabs.com', - image: 'https://www.amazeelabs.com/images/icon.png', - }; - } - }, - }), + // Drupal provider. + // Other providers can be added here (e.g. Google, Keycloak). { // Client ID and secret are set in the Drupal Consumer. clientId: process.env.AUTH_DRUPAL_ID || 'gatsby', @@ -40,18 +21,35 @@ export const authConfig = { scope: 'editor', }, }, - idToken: false, token: `${AUTH_DRUPAL_URL}/en/oauth/token`, - userinfo: `${AUTH_DRUPAL_URL}/en/oauth/userinfo`, - profile(profile) { + userinfo: { + // Additional userinfo can be fetched with an extra request + // using the access token. + url: `${AUTH_DRUPAL_URL}/en/oauth/userinfo`, + }, + profile(profile, tokens) { return { id: profile.sub, name: profile.name, email: profile.email, + tokens: tokens, }; }, }, ], + // Persist the user object in the session. + // @todo use the refresh token + // https://github.com/nextauthjs/next-auth-refresh-token-example/blob/main/pages/api/auth/%5B...nextauth%5D.js + callbacks: { + async jwt({ token, user }) { + return { ...token, ...user }; + }, + async session({ session, token }) { + session.user = token; + return session; + }, + }, + secret: process.env.NEXTAUTH_SECRET, theme: { logo: 'https://www.amazeelabs.com/images/icon.png', colorScheme: 'light', diff --git a/apps/website/src/api/auth/[...nextauth].js b/apps/website/src/api/auth/[...nextauth].js index d5678f8f3..7201d33f1 100644 --- a/apps/website/src/api/auth/[...nextauth].js +++ b/apps/website/src/api/auth/[...nextauth].js @@ -1,5 +1,4 @@ // If your deployment environment supports Gatsby Functions, you won't need the root `api` folder, only this. - import NextAuth from 'next-auth'; import { authConfig } from '../../../nextauth.config'; diff --git a/apps/website/src/layouts/index.tsx b/apps/website/src/layouts/index.tsx index 216881268..7a0cd17b6 100644 --- a/apps/website/src/layouts/index.tsx +++ b/apps/website/src/layouts/index.tsx @@ -15,6 +15,8 @@ export default function Layout({ const data = useStaticQuery(graphql(FrameQuery)); registerExecutor(FrameQuery, data); + console.log('session', session); + // @todo move signin/signout to a specific component. return ( <> diff --git a/apps/website/src/pages/authenticated.tsx b/apps/website/src/pages/authenticated.tsx new file mode 100644 index 000000000..2fb8b35a5 --- /dev/null +++ b/apps/website/src/pages/authenticated.tsx @@ -0,0 +1,51 @@ +import { useSession } from 'next-auth/react'; +import React from 'react'; + +// @todo make a profile page. +export default function Index() { + //registerExecutor(NotFoundPageQuery, {}, data); + const session = useSession(); + if ( + session.status !== 'authenticated' || + // @ts-ignore + !session.data?.user?.tokens.access_token + ) { + return
Not authenticated
; + } else { + // @ts-ignore + const accessToken = session.data.user.tokens.access_token; + // @todo use proxy. + const AUTH_DRUPAL_URL = + process.env.AUTH_DRUPAL_URL || 'http://127.0.0.1:8888'; + const endpoint = `${AUTH_DRUPAL_URL}/graphql`; + const headers = { + 'Content-Type': 'application/json', + Authorization: `Bearer ${accessToken}`, + }; + const graphqlQuery = { + //operationName: 'CurrentUser', + query: ` + query CurrentUser { + currentUser { + id + name + email + memberFor + } + } + `, + variables: {}, + }; + const options = { + method: 'POST', + headers, + body: JSON.stringify(graphqlQuery), + }; + fetch(endpoint, options) + .then((res) => res.json()) + .then((result) => console.log(result)) + .catch((error) => console.error('Error:', error)); + + return
Authenticated
; + } +} From c01bb696d7e0622f65977ed966ae7f3111c99790 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Fri, 5 Apr 2024 12:53:09 +0200 Subject: [PATCH 16/51] docs(gatsby-oauth): local development --- README.md | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ee9c87d75..ef59cd529 100644 --- a/README.md +++ b/README.md @@ -213,20 +213,20 @@ Enabled only when at least one provider is configured. Authentication providers are relying on Auth.js (formerly Next-Auth) and can be configured in `/apps/website/nextauth.config.js` -An example is provided for Drupal and a dummy `Credentials` provider. +An example provider is available for Drupal.
How it works On Netlify, several environment variables are required to be set: -##### In all cases +#### In all cases - `NEXTAUTH_URL` The URL of the website. This is used for the callback. - `NEXTAUTH_SECRET` A random string used for encryption. Generate the secret with e.g. `openssl rand -base64 32` -##### For Drupal +#### For Drupal - `AUTH_DRUPAL_ID` The client ID of the Drupal Consumer - `AUTH_DRUPAL_SECRET` The client secret of the Drupal Consumer @@ -238,12 +238,30 @@ In Drupal go to `/admin/config/services/consumer` and add a new Consumer. - Secret: a random string matching `AUTH_DRUPAL_SECRET` - Redirect URI: `[netlify-gatsby-site-url]/oauth/callback` -##### Other providers +#### Other providers Refer to [Auth.js documentation](https://next-auth.js.org/providers/).
+
+ Local development + +#### Start Drupal and Gatsby + +- Drupal: in `/apps/cms` - `pnpm start` use http://127.0.0.1:8888 +- Gatsby: in `/apps/website` - `pnpm gatsby:develop` use + http://localhost:8000/en + +#### Basic troubleshooting + +- Make sure to have keys generated + http://127.0.0.1:8888/en/admin/config/people/simple_oauth +- Make sure to have the correct client id and secret set + http://127.0.0.1:8888/en/admin/config/services/consumer/2/edit + +
+ ### Publisher authentication with Drupal Publisher can require to authenticate with Drupal based on OAuth2. It is only From ce22c530313d8702faa2cbffa9f5cefec28b1927 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Fri, 5 Apr 2024 12:53:36 +0200 Subject: [PATCH 17/51] Revert "chore(gatsby-oauth): add supabase adapters" This reverts commit c63a0f03fdb6ff389a2b314bf65c281ff8e5f19c. --- apps/website/package.json | 2 - apps/website/supabase/.gitignore | 4 - apps/website/supabase/config.toml | 161 ------------------------------ apps/website/supabase/seed.sql | 0 pnpm-lock.yaml | 130 +----------------------- 5 files changed, 1 insertion(+), 296 deletions(-) delete mode 100644 apps/website/supabase/.gitignore delete mode 100644 apps/website/supabase/config.toml delete mode 100644 apps/website/supabase/seed.sql diff --git a/apps/website/package.json b/apps/website/package.json index 01134deb7..252f1c8e6 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -9,13 +9,11 @@ "@amazeelabs/gatsby-source-silverback": "^1.13.10", "@amazeelabs/publisher": "^2.4.17", "@amazeelabs/strangler-netlify": "^1.1.9", - "@auth/supabase-adapter": "^0.6.1", "@custom/decap": "workspace:*", "@custom/schema": "workspace:*", "@custom/ui": "workspace:*", "@gatsbyjs/reach-router": "^2.0.1", "@netlify/plugin-nextjs": "^4.41.3", - "@supabase/supabase-js": "^2.41.1", "babel-loader": "^9.1.3", "body-parser": "^1.20.2", "gatsby": "^5.13.1", diff --git a/apps/website/supabase/.gitignore b/apps/website/supabase/.gitignore deleted file mode 100644 index a3ad88055..000000000 --- a/apps/website/supabase/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Supabase -.branches -.temp -.env diff --git a/apps/website/supabase/config.toml b/apps/website/supabase/config.toml deleted file mode 100644 index f59455a54..000000000 --- a/apps/website/supabase/config.toml +++ /dev/null @@ -1,161 +0,0 @@ -# A string used to distinguish different Supabase projects on the same host. Defaults to the -# working directory name when running `supabase init`. -project_id = "website" - -[api] -enabled = true -# Port to use for the API URL. -port = 54321 -# Schemas to expose in your API. Tables, views and stored procedures in this schema will get API -# endpoints. public and storage are always included. -schemas = ["public", "storage", "graphql_public", "next_auth"] -# Extra schemas to add to the search_path of every request. public is always included. -extra_search_path = ["public", "extensions"] -# The maximum number of rows returns from a view, table, or stored procedure. Limits payload size -# for accidental or malicious requests. -max_rows = 1000 - -[db] -# Port to use for the local database URL. -port = 54322 -# Port used by db diff command to initialize the shadow database. -shadow_port = 54320 -# The database major version to use. This has to be the same as your remote database's. Run `SHOW -# server_version;` on the remote database to check. -major_version = 15 - -[db.pooler] -enabled = false -# Port to use for the local connection pooler. -port = 54329 -# Specifies when a server connection can be reused by other clients. -# Configure one of the supported pooler modes: `transaction`, `session`. -pool_mode = "transaction" -# How many server connections to allow per user/database pair. -default_pool_size = 20 -# Maximum number of client connections allowed. -max_client_conn = 100 - -[realtime] -enabled = true -# Bind realtime via either IPv4 or IPv6. (default: IPv6) -# ip_version = "IPv6" -# The maximum length in bytes of HTTP request headers. (default: 4096) -# max_header_length = 4096 - -[studio] -enabled = true -# Port to use for Supabase Studio. -port = 54323 -# External URL of the API server that frontend connects to. -api_url = "http://127.0.0.1" -# OpenAI API Key to use for Supabase AI in the Supabase Studio. -openai_api_key = "env(OPENAI_API_KEY)" - -# Email testing server. Emails sent with the local dev setup are not actually sent - rather, they -# are monitored, and you can view the emails that would have been sent from the web interface. -[inbucket] -enabled = true -# Port to use for the email testing server web interface. -port = 54324 -# Uncomment to expose additional ports for testing user applications that send emails. -# smtp_port = 54325 -# pop3_port = 54326 - -[storage] -enabled = true -# The maximum file size allowed (e.g. "5MB", "500KB"). -file_size_limit = "50MiB" - -[auth] -enabled = true -# The base URL of your website. Used as an allow-list for redirects and for constructing URLs used -# in emails. -site_url = "http://127.0.0.1:3000" -# A list of *exact* URLs that auth providers are permitted to redirect to post authentication. -additional_redirect_urls = ["https://127.0.0.1:3000"] -# How long tokens are valid for, in seconds. Defaults to 3600 (1 hour), maximum 604,800 (1 week). -jwt_expiry = 3600 -# If disabled, the refresh token will never expire. -enable_refresh_token_rotation = true -# Allows refresh tokens to be reused after expiry, up to the specified interval in seconds. -# Requires enable_refresh_token_rotation = true. -refresh_token_reuse_interval = 10 -# Allow/disallow new user signups to your project. -enable_signup = true -# Allow/disallow testing manual linking of accounts -enable_manual_linking = false - -[auth.email] -# Allow/disallow new user signups via email to your project. -enable_signup = true -# If enabled, a user will be required to confirm any email change on both the old, and new email -# addresses. If disabled, only the new email is required to confirm. -double_confirm_changes = true -# If enabled, users need to confirm their email address before signing in. -enable_confirmations = false - -# Uncomment to customize email template -# [auth.email.template.invite] -# subject = "You have been invited" -# content_path = "./supabase/templates/invite.html" - -[auth.sms] -# Allow/disallow new user signups via SMS to your project. -enable_signup = true -# If enabled, users need to confirm their phone number before signing in. -enable_confirmations = false -# Template for sending OTP to users -template = "Your code is {{ .Code }} ." - -# Use pre-defined map of phone number to OTP for testing. -[auth.sms.test_otp] -# 4152127777 = "123456" - -# This hook runs before a token is issued and allows you to add additional claims based on the authentication method used. -[auth.hook.custom_access_token] -# enabled = true -# uri = "pg-functions:////" - - -# Configure one of the supported SMS providers: `twilio`, `twilio_verify`, `messagebird`, `textlocal`, `vonage`. -[auth.sms.twilio] -enabled = false -account_sid = "" -message_service_sid = "" -# DO NOT commit your Twilio auth token to git. Use environment variable substitution instead: -auth_token = "env(SUPABASE_AUTH_SMS_TWILIO_AUTH_TOKEN)" - -# Use an external OAuth provider. The full list of providers are: `apple`, `azure`, `bitbucket`, -# `discord`, `facebook`, `github`, `gitlab`, `google`, `keycloak`, `linkedin_oidc`, `notion`, `twitch`, -# `twitter`, `slack`, `spotify`, `workos`, `zoom`. -[auth.external.apple] -enabled = false -client_id = "" -# DO NOT commit your OAuth provider secret to git. Use environment variable substitution instead: -secret = "env(SUPABASE_AUTH_EXTERNAL_APPLE_SECRET)" -# Overrides the default auth redirectUrl. -redirect_uri = "" -# Overrides the default auth provider URL. Used to support self-hosted gitlab, single-tenant Azure, -# or any other third-party OIDC providers. -url = "" - -[analytics] -enabled = false -port = 54327 -vector_port = 54328 -# Configure one of the supported backends: `postgres`, `bigquery`. -backend = "postgres" - -# Experimental features may be deprecated any time -[experimental] -# Configures Postgres storage engine to use OrioleDB (S3) -orioledb_version = "" -# Configures S3 bucket URL, eg. .s3-.amazonaws.com -s3_host = "env(S3_HOST)" -# Configures S3 bucket region, eg. us-east-1 -s3_region = "env(S3_REGION)" -# Configures AWS_ACCESS_KEY_ID for S3 bucket -s3_access_key = "env(S3_ACCESS_KEY)" -# Configures AWS_SECRET_ACCESS_KEY for S3 bucket -s3_secret_key = "env(S3_SECRET_KEY)" diff --git a/apps/website/supabase/seed.sql b/apps/website/supabase/seed.sql deleted file mode 100644 index e69de29bb..000000000 diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 242615c4d..4874b44d3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -203,9 +203,6 @@ importers: '@amazeelabs/strangler-netlify': specifier: ^1.1.9 version: 1.1.9(happy-dom@12.10.3)(react@18.2.0) - '@auth/supabase-adapter': - specifier: ^0.6.1 - version: 0.6.1(@supabase/supabase-js@2.41.1) '@custom/decap': specifier: workspace:* version: link:../decap @@ -221,9 +218,6 @@ importers: '@netlify/plugin-nextjs': specifier: ^4.41.3 version: 4.41.3 - '@supabase/supabase-js': - specifier: ^2.41.1 - version: 2.41.1 babel-loader: specifier: ^9.1.3 version: 9.1.3(@babel/core@7.23.7)(webpack@5.89.0) @@ -1123,42 +1117,6 @@ packages: transitivePeerDependencies: - encoding - /@auth/core@0.28.1: - resolution: {integrity: sha512-gvp74mypYZADpTlfGRp6HE0G3pIHWvtJpy+KZ+8FvY0cmlIpHog+jdMOdd29dQtLtN25kF2YbfHsesCFuGUQbg==} - peerDependencies: - '@simplewebauthn/browser': ^9.0.1 - '@simplewebauthn/server': ^9.0.2 - nodemailer: ^6.8.0 - peerDependenciesMeta: - '@simplewebauthn/browser': - optional: true - '@simplewebauthn/server': - optional: true - nodemailer: - optional: true - dependencies: - '@panva/hkdf': 1.1.1 - '@types/cookie': 0.6.0 - cookie: 0.6.0 - jose: 5.2.0 - oauth4webapi: 2.10.3 - preact: 10.11.3 - preact-render-to-string: 5.2.3(preact@10.11.3) - dev: false - - /@auth/supabase-adapter@0.6.1(@supabase/supabase-js@2.41.1): - resolution: {integrity: sha512-xD7scVGms+X13F5hGce8oErQmxQXG+OKJD38zZ+hTmUoALNiDhK/COmy0hPtkXnAAVH///iuI0r7rzpawWuj7g==} - peerDependencies: - '@supabase/supabase-js': ^2.0.5 - dependencies: - '@auth/core': 0.28.1 - '@supabase/supabase-js': 2.41.1 - transitivePeerDependencies: - - '@simplewebauthn/browser' - - '@simplewebauthn/server' - - nodemailer - dev: false - /@aw-web-design/x-default-browser@1.4.126: resolution: {integrity: sha512-Xk1sIhyNC/esHGGVjL/niHLowM0csl/kFO5uawBy4IrWwy0o1G8LGt3jP6nmWGz+USxeeqbihAmp/oVZju6wug==} hasBin: true @@ -9543,63 +9501,6 @@ packages: file-system-cache: 2.3.0 dev: true - /@supabase/auth-js@2.63.0: - resolution: {integrity: sha512-yIgcHnlgv24GxHtVGUhwGqAFDyJkPIC/xjx7HostN08A8yCy8HIfl4JEkTKyBqD1v1L05jNEJOUke4Lf4O1+Qg==} - dependencies: - '@supabase/node-fetch': 2.6.15 - dev: false - - /@supabase/functions-js@2.2.2: - resolution: {integrity: sha512-sJGq1nludmi7pY/fdtCpyY/pYonx7MfHdN408bqb736guWcVI1AChYVbI4kUM978EuOE4Ci6l7bUudfGg07QRw==} - dependencies: - '@supabase/node-fetch': 2.6.15 - dev: false - - /@supabase/node-fetch@2.6.15: - resolution: {integrity: sha512-1ibVeYUacxWYi9i0cf5efil6adJ9WRyZBLivgjs+AUpewx1F3xPi7gLgaASI2SmIQxPoCEjAsLAzKPgMJVgOUQ==} - engines: {node: 4.x || >=6.0.0} - dependencies: - whatwg-url: 5.0.0 - dev: false - - /@supabase/postgrest-js@1.9.2: - resolution: {integrity: sha512-I6yHo8CC9cxhOo6DouDMy9uOfW7hjdsnCxZiaJuIVZm1dBGTFiQPgfMa9zXCamEWzNyWRjZvupAUuX+tqcl5Sw==} - dependencies: - '@supabase/node-fetch': 2.6.15 - dev: false - - /@supabase/realtime-js@2.9.3: - resolution: {integrity: sha512-lAp50s2n3FhGJFq+wTSXLNIDPw5Y0Wxrgt44eM5nLSA3jZNUUP3Oq2Ccd1CbZdVntPCWLZvJaU//pAd2NE+QnQ==} - dependencies: - '@supabase/node-fetch': 2.6.15 - '@types/phoenix': 1.6.4 - '@types/ws': 8.5.10 - ws: 8.16.0 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - dev: false - - /@supabase/storage-js@2.5.5: - resolution: {integrity: sha512-OpLoDRjFwClwc2cjTJZG8XviTiQH4Ik8sCiMK5v7et0MDu2QlXjCAW3ljxJB5+z/KazdMOTnySi+hysxWUPu3w==} - dependencies: - '@supabase/node-fetch': 2.6.15 - dev: false - - /@supabase/supabase-js@2.41.1: - resolution: {integrity: sha512-xmECLhYugMo/6SObpsOhu5xaxVfsk+JK/d4JSh055bpESmgmN3PLpzbfqejKCpaUeeUNF21+lrJp/U9HQzT9mA==} - dependencies: - '@supabase/auth-js': 2.63.0 - '@supabase/functions-js': 2.2.2 - '@supabase/node-fetch': 2.6.15 - '@supabase/postgrest-js': 1.9.2 - '@supabase/realtime-js': 2.9.3 - '@supabase/storage-js': 2.5.5 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - dev: false - /@swc/cli@0.1.63(@swc/core@1.3.102): resolution: {integrity: sha512-EM9oxxHzmmsprYRbGqsS2M4M/Gr5Gkcl0ROYYIdlUyTkhOiX822EQiRCpPCwdutdnzH2GyaTN7wc6i0Y+CKd3A==} engines: {node: '>= 12.13'} @@ -10010,10 +9911,6 @@ packages: /@types/cookie@0.4.1: resolution: {integrity: sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==} - /@types/cookie@0.6.0: - resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==} - dev: false - /@types/cors@2.8.17: resolution: {integrity: sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==} dependencies: @@ -10269,10 +10166,6 @@ packages: resolution: {integrity: sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g==} dev: false - /@types/phoenix@1.6.4: - resolution: {integrity: sha512-B34A7uot1Cv0XtaHRYDATltAdKx0BvVKNgYNqE4WjtPUa4VQJM7kxeXcVKaH+KS+kCmZ+6w+QaUdcljiheiBJA==} - dev: false - /@types/picomatch@2.3.3: resolution: {integrity: sha512-Yll76ZHikRFCyz/pffKGjrCwe/le2CDwOP5F210KQo27kpRE46U2rDnzikNlVn6/ezH3Mhn46bJMTfeVTtcYMg==} dev: true @@ -14351,11 +14244,6 @@ packages: resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} engines: {node: '>= 0.6'} - /cookie@0.6.0: - resolution: {integrity: sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==} - engines: {node: '>= 0.6'} - dev: false - /copy-descriptor@0.1.1: resolution: {integrity: sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw==} engines: {node: '>=0.10.0'} @@ -22237,6 +22125,7 @@ packages: /jose@5.2.0: resolution: {integrity: sha512-oW3PCnvyrcm1HMvGTzqjxxfnEs9EoFOFWi2HsEGhlFVOXxTE3K9GKWVMFoFw06yPUqwpvEWic1BmtUZBI/tIjw==} + dev: true /joycon@3.1.1: resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} @@ -24909,10 +24798,6 @@ packages: ufo: 1.3.2 dev: true - /oauth4webapi@2.10.3: - resolution: {integrity: sha512-9FkXEXfzVKzH63GUOZz1zMr3wBaICSzk6DLXx+CGdrQ10ItNk2ePWzYYc1fdmKq1ayGFb2aX97sRCoZ2s0mkDw==} - dev: false - /oauth@0.9.15: resolution: {integrity: sha512-a5ERWK1kh38ExDEfoO6qUHJb32rd7aYmPHuyCu3Fta/cnICvYmgd2uhuKXvPD+PXB+gCEYYEaQdIRAjCOwAKNA==} dev: false @@ -26619,15 +26504,6 @@ packages: picocolors: 1.0.0 source-map-js: 1.0.2 - /preact-render-to-string@5.2.3(preact@10.11.3): - resolution: {integrity: sha512-aPDxUn5o3GhWdtJtW0svRC2SS/l8D9MAgo2+AWml+BhDImb27ALf04Q2d+AHqUUOc6RdSXFIBVa2gxzgMKgtZA==} - peerDependencies: - preact: '>=10' - dependencies: - preact: 10.11.3 - pretty-format: 3.8.0 - dev: false - /preact-render-to-string@5.2.6(preact@10.19.4): resolution: {integrity: sha512-JyhErpYOvBV1hEPwIxc/fHWXPfnEGdRKxc8gFdAZ7XV4tlzyzG847XAyEZqoDnynP88akM4eaHcSOzNcLWFguw==} peerDependencies: @@ -26637,10 +26513,6 @@ packages: pretty-format: 3.8.0 dev: false - /preact@10.11.3: - resolution: {integrity: sha512-eY93IVpod/zG3uMF22Unl8h9KkrcKIRs2EGar8hwLZZDU1lkjph303V9HZBwufh2s736U6VXuhD109LYqPoffg==} - dev: false - /preact@10.19.4: resolution: {integrity: sha512-dwaX5jAh0Ga8uENBX1hSOujmKWgx9RtL80KaKUFLc6jb4vCEAc3EeZ0rnQO/FO4VgjfPMfoLFWnNG8bHuZ9VLw==} dev: false From c79a0e97ab1260164fbae1f8f9600fe7e2ce9bef Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Fri, 5 Apr 2024 12:53:45 +0200 Subject: [PATCH 18/51] Revert "chore: add ray" This reverts commit c894e8653b3535d90feeda05fab1b655e33cb1cc. --- apps/cms/composer.json | 3 +- apps/cms/composer.lock | 492 +---------------------------------------- 2 files changed, 2 insertions(+), 493 deletions(-) diff --git a/apps/cms/composer.json b/apps/cms/composer.json index 71c319de6..3acd04789 100644 --- a/apps/cms/composer.json +++ b/apps/cms/composer.json @@ -157,7 +157,6 @@ }, "require-dev": { "drupal/core-dev": "^10", - "phpspec/prophecy-phpunit": "^2.0.2", - "spatie/ray": "^1.41" + "phpspec/prophecy-phpunit": "^2.0.2" } } diff --git a/apps/cms/composer.lock b/apps/cms/composer.lock index 6fa4d86d9..68255b548 100644 --- a/apps/cms/composer.lock +++ b/apps/cms/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e950eb6b15c283659be53c3fa994a954", + "content-hash": "311e78367982e8dc03f205c19ae9871e", "packages": [ { "name": "amazeeio/drupal_integrations", @@ -10429,61 +10429,6 @@ }, "time": "2023-12-09T11:58:45+00:00" }, - { - "name": "brick/math", - "version": "0.11.0", - "source": { - "type": "git", - "url": "https://github.com/brick/math.git", - "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/0ad82ce168c82ba30d1c01ec86116ab52f589478", - "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478", - "shasum": "" - }, - "require": { - "php": "^8.0" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^9.0", - "vimeo/psalm": "5.0.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Brick\\Math\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Arbitrary-precision arithmetic library", - "keywords": [ - "Arbitrary-precision", - "BigInteger", - "BigRational", - "arithmetic", - "bigdecimal", - "bignum", - "brick", - "math" - ], - "support": { - "issues": "https://github.com/brick/math/issues", - "source": "https://github.com/brick/math/tree/0.11.0" - }, - "funding": [ - { - "url": "https://github.com/BenMorel", - "type": "github" - } - ], - "time": "2023-01-15T23:15:59+00:00" - }, { "name": "colinodell/psr-testlogger", "version": "v1.3.0", @@ -13529,187 +13474,6 @@ ], "time": "2023-12-01T16:55:19+00:00" }, - { - "name": "ramsey/collection", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/ramsey/collection.git", - "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ramsey/collection/zipball/a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", - "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "require-dev": { - "captainhook/plugin-composer": "^5.3", - "ergebnis/composer-normalize": "^2.28.3", - "fakerphp/faker": "^1.21", - "hamcrest/hamcrest-php": "^2.0", - "jangregor/phpstan-prophecy": "^1.0", - "mockery/mockery": "^1.5", - "php-parallel-lint/php-console-highlighter": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.3", - "phpcsstandards/phpcsutils": "^1.0.0-rc1", - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/extension-installer": "^1.2", - "phpstan/phpstan": "^1.9", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5", - "psalm/plugin-mockery": "^1.1", - "psalm/plugin-phpunit": "^0.18.4", - "ramsey/coding-standard": "^2.0.3", - "ramsey/conventional-commits": "^1.3", - "vimeo/psalm": "^5.4" - }, - "type": "library", - "extra": { - "captainhook": { - "force-install": true - }, - "ramsey/conventional-commits": { - "configFile": "conventional-commits.json" - } - }, - "autoload": { - "psr-4": { - "Ramsey\\Collection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ben Ramsey", - "email": "ben@benramsey.com", - "homepage": "https://benramsey.com" - } - ], - "description": "A PHP library for representing and manipulating collections.", - "keywords": [ - "array", - "collection", - "hash", - "map", - "queue", - "set" - ], - "support": { - "issues": "https://github.com/ramsey/collection/issues", - "source": "https://github.com/ramsey/collection/tree/2.0.0" - }, - "funding": [ - { - "url": "https://github.com/ramsey", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", - "type": "tidelift" - } - ], - "time": "2022-12-31T21:50:55+00:00" - }, - { - "name": "ramsey/uuid", - "version": "4.7.5", - "source": { - "type": "git", - "url": "https://github.com/ramsey/uuid.git", - "reference": "5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e", - "reference": "5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e", - "shasum": "" - }, - "require": { - "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11", - "ext-json": "*", - "php": "^8.0", - "ramsey/collection": "^1.2 || ^2.0" - }, - "replace": { - "rhumsaa/uuid": "self.version" - }, - "require-dev": { - "captainhook/captainhook": "^5.10", - "captainhook/plugin-composer": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.8", - "ergebnis/composer-normalize": "^2.15", - "mockery/mockery": "^1.3", - "paragonie/random-lib": "^2", - "php-mock/php-mock": "^2.2", - "php-mock/php-mock-mockery": "^1.3", - "php-parallel-lint/php-parallel-lint": "^1.1", - "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^8.5 || ^9", - "ramsey/composer-repl": "^1.4", - "slevomat/coding-standard": "^8.4", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.9" - }, - "suggest": { - "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", - "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", - "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", - "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", - "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." - }, - "type": "library", - "extra": { - "captainhook": { - "force-install": true - } - }, - "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "Ramsey\\Uuid\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", - "keywords": [ - "guid", - "identifier", - "uuid" - ], - "support": { - "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.7.5" - }, - "funding": [ - { - "url": "https://github.com/ramsey", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", - "type": "tidelift" - } - ], - "time": "2023-11-08T05:53:05+00:00" - }, { "name": "react/promise", "version": "v3.1.0", @@ -14977,198 +14741,6 @@ ], "time": "2023-10-08T07:28:08+00:00" }, - { - "name": "spatie/backtrace", - "version": "1.5.3", - "source": { - "type": "git", - "url": "https://github.com/spatie/backtrace.git", - "reference": "483f76a82964a0431aa836b6ed0edde0c248e3ab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/backtrace/zipball/483f76a82964a0431aa836b6ed0edde0c248e3ab", - "reference": "483f76a82964a0431aa836b6ed0edde0c248e3ab", - "shasum": "" - }, - "require": { - "php": "^7.3|^8.0" - }, - "require-dev": { - "ext-json": "*", - "phpunit/phpunit": "^9.3", - "spatie/phpunit-snapshot-assertions": "^4.2", - "symfony/var-dumper": "^5.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "Spatie\\Backtrace\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van de Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "A better backtrace", - "homepage": "https://github.com/spatie/backtrace", - "keywords": [ - "Backtrace", - "spatie" - ], - "support": { - "source": "https://github.com/spatie/backtrace/tree/1.5.3" - }, - "funding": [ - { - "url": "https://github.com/sponsors/spatie", - "type": "github" - }, - { - "url": "https://spatie.be/open-source/support-us", - "type": "other" - } - ], - "time": "2023-06-28T12:59:17+00:00" - }, - { - "name": "spatie/macroable", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/spatie/macroable.git", - "reference": "ec2c320f932e730607aff8052c44183cf3ecb072" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/macroable/zipball/ec2c320f932e730607aff8052c44183cf3ecb072", - "reference": "ec2c320f932e730607aff8052c44183cf3ecb072", - "shasum": "" - }, - "require": { - "php": "^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^8.0|^9.3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Spatie\\Macroable\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "A trait to dynamically add methods to a class", - "homepage": "https://github.com/spatie/macroable", - "keywords": [ - "macroable", - "spatie" - ], - "support": { - "issues": "https://github.com/spatie/macroable/issues", - "source": "https://github.com/spatie/macroable/tree/2.0.0" - }, - "time": "2021-03-26T22:39:02+00:00" - }, - { - "name": "spatie/ray", - "version": "1.41.1", - "source": { - "type": "git", - "url": "https://github.com/spatie/ray.git", - "reference": "051a0facb1d2462fafef87ff77eb74d6f2d12944" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/ray/zipball/051a0facb1d2462fafef87ff77eb74d6f2d12944", - "reference": "051a0facb1d2462fafef87ff77eb74d6f2d12944", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-json": "*", - "php": "^7.3|^8.0", - "ramsey/uuid": "^3.0|^4.1", - "spatie/backtrace": "^1.1", - "spatie/macroable": "^1.0|^2.0", - "symfony/stopwatch": "^4.0|^5.1|^6.0|^7.0", - "symfony/var-dumper": "^4.2|^5.1|^6.0|^7.0" - }, - "require-dev": { - "illuminate/support": "6.x|^8.18|^9.0", - "nesbot/carbon": "^2.63", - "pestphp/pest": "^1.22", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^9.5", - "rector/rector": "^0.19.2", - "spatie/phpunit-snapshot-assertions": "^4.2", - "spatie/test-time": "^1.2" - }, - "bin": [ - "bin/remove-ray.sh" - ], - "type": "library", - "autoload": { - "files": [ - "src/helpers.php" - ], - "psr-4": { - "Spatie\\Ray\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "Debug with Ray to fix problems faster", - "homepage": "https://github.com/spatie/ray", - "keywords": [ - "ray", - "spatie" - ], - "support": { - "issues": "https://github.com/spatie/ray/issues", - "source": "https://github.com/spatie/ray/tree/1.41.1" - }, - "funding": [ - { - "url": "https://github.com/sponsors/spatie", - "type": "github" - }, - { - "url": "https://spatie.be/open-source/support-us", - "type": "other" - } - ], - "time": "2024-01-25T10:15:50+00:00" - }, { "name": "squizlabs/php_codesniffer", "version": "3.8.0", @@ -15767,68 +15339,6 @@ ], "time": "2023-08-25T17:27:25+00:00" }, - { - "name": "symfony/stopwatch", - "version": "v7.0.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "983900d6fddf2b0cbaacacbbad07610854bd8112" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/983900d6fddf2b0cbaacacbbad07610854bd8112", - "reference": "983900d6fddf2b0cbaacacbbad07610854bd8112", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/service-contracts": "^2.5|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides a way to profile code", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/stopwatch/tree/v7.0.3" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-01-23T15:02:46+00:00" - }, { "name": "theseer/tokenizer", "version": "1.2.2", From 01e6d8b663040a616bc993aa2f164e52fb9820c0 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Fri, 5 Apr 2024 13:11:29 +0200 Subject: [PATCH 19/51] chore(gatsby-oauth): set user/profile path --- apps/website/src/pages/{authenticated.tsx => user/profile.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename apps/website/src/pages/{authenticated.tsx => user/profile.tsx} (100%) diff --git a/apps/website/src/pages/authenticated.tsx b/apps/website/src/pages/user/profile.tsx similarity index 100% rename from apps/website/src/pages/authenticated.tsx rename to apps/website/src/pages/user/profile.tsx From fea4b3c517036e767e3d357e56e65a818348cb0b Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Fri, 5 Apr 2024 13:31:06 +0200 Subject: [PATCH 20/51] chore(gatsby-oauth): manually fix merge conflicts --- apps/website/gatsby-browser.ts | 4 + apps/website/package.json | 17 +- apps/website/src/layouts/index.tsx | 19 +- pnpm-lock.yaml | 532 ++++++++++++++++++++++++++--- 4 files changed, 517 insertions(+), 55 deletions(-) diff --git a/apps/website/gatsby-browser.ts b/apps/website/gatsby-browser.ts index 971084011..15fe7d455 100644 --- a/apps/website/gatsby-browser.ts +++ b/apps/website/gatsby-browser.ts @@ -2,6 +2,10 @@ import '@custom/ui/styles.css'; import { GatsbyBrowser } from 'gatsby'; +import { WrapRootElement } from './src/utils/wrapRootElement'; + +export const wrapRootElement = WrapRootElement; + export const shouldUpdateScroll: GatsbyBrowser['shouldUpdateScroll'] = ( args, ) => { diff --git a/apps/website/package.json b/apps/website/package.json index 5ab76b2a3..59921a618 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -3,18 +3,21 @@ "private": true, "dependencies": { "@amazeelabs/bridge-gatsby": "^1.2.7", - "@amazeelabs/decap-cms-backend-token-auth": "^1.1.1", - "@amazeelabs/token-auth-middleware": "^1.1.1", "@amazeelabs/cloudinary-responsive-image": "^1.6.15", + "@amazeelabs/decap-cms-backend-token-auth": "^1.1.1", "@amazeelabs/gatsby-plugin-operations": "^1.1.3", "@amazeelabs/gatsby-plugin-static-dirs": "^1.0.1", "@amazeelabs/gatsby-source-silverback": "^1.13.17", "@amazeelabs/publisher": "^2.4.17", "@amazeelabs/strangler-netlify": "^1.1.9", + "@amazeelabs/token-auth-middleware": "^1.1.1", + "@custom/cms": "workspace:*", "@custom/decap": "workspace:*", "@custom/schema": "workspace:*", "@custom/ui": "workspace:*", - "@custom/cms": "workspace:*", + "@gatsbyjs/reach-router": "^2.0.1", + "babel-loader": "^9.1.3", + "body-parser": "^1.20.2", "gatsby": "^5.13.1", "gatsby-plugin-layout": "^4.13.0", "gatsby-plugin-manifest": "^5.13.0", @@ -27,13 +30,17 @@ "gatsby-source-filesystem": "^5.13.0", "image-size": "^1.1.1", "mime-types": "^2.1.35", + "multer": "1.4.5-lts.1", "netlify-cli": "^17.21.1", + "next": "^14.1.4", + "next-auth": "^4.24.7", + "plugin-nextjs:^4.41.3": "link:@netlify/plugin-nextjs:^4.41.3", "react": "^18.2.0", "react-dom": "^18.2.0" }, "devDependencies": { - "@netlify/functions": "^2.6.0", "@netlify/edge-functions": "^2.3.1", + "@netlify/functions": "^2.6.0", "@testing-library/react": "^14.1.2", "@types/react": "^18.2.46", "@types/react-dom": "^18.2.18", @@ -53,7 +60,7 @@ "serve": "netlify dev --cwd=. --dir=public --port=8000", "dev": "pnpm clean && publisher", "open": "open http://127.0.0.1:8000/___status/", - "gatsby:develop": "ENABLE_GATSBY_REFRESH_ENDPOINT=true pnpm gatsby develop", + "gatsby:develop": "NEXTAUTH_URL=http://localhost:8000 NEXTAUTH_SECRET=banana ENABLE_GATSBY_REFRESH_ENDPOINT=true pnpm gatsby develop", "gatsby:refresh": "curl -X POST http://localhost:8000/__refresh", "clean": "gatsby clean" } diff --git a/apps/website/src/layouts/index.tsx b/apps/website/src/layouts/index.tsx index 363c02a0d..ad4e0aa45 100644 --- a/apps/website/src/layouts/index.tsx +++ b/apps/website/src/layouts/index.tsx @@ -4,9 +4,8 @@ import { Frame } from '@custom/ui/routes/Frame'; import { signIn, signOut, useSession } from 'next-auth/react'; import React, { PropsWithChildren } from 'react'; -import { drupalExecutor } from '../utils/drupal-executor'; - import { authConfig } from '../../nextauth.config'; +import { drupalExecutor } from '../utils/drupal-executor'; export default function Layout({ children, @@ -39,14 +38,14 @@ export default function Layout({ )} {session?.status === 'authenticated' && session.data.user && ( <> - - Signed in as -
- {session.data.user.email} - {session.data.user.name - ? `(${session.data.user.name})` - : null} -
+ + Signed in as +
+ {session.data.user.email} + {session.data.user.name + ? `(${session.data.user.name})` + : null} +
{ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 79a82eb2b..ea9ba0f72 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -52,6 +52,12 @@ importers: husky: specifier: ^8.0.3 version: 8.0.3 + node-addon-api: + specifier: ^7.1.0 + version: 7.1.0 + node-gyp: + specifier: ^10.0.1 + version: 10.0.1 prettier: specifier: ^3.1.1 version: 3.1.1 @@ -224,6 +230,15 @@ importers: '@custom/ui': specifier: workspace:* version: link:../../packages/ui + '@gatsbyjs/reach-router': + specifier: ^2.0.1 + version: 2.0.1(react-dom@18.2.0)(react@18.2.0) + babel-loader: + specifier: ^9.1.3 + version: 9.1.3(@babel/core@7.23.7)(webpack@5.89.0) + body-parser: + specifier: ^1.20.2 + version: 1.20.2 gatsby: specifier: ^5.13.1 version: 5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) @@ -260,9 +275,21 @@ importers: mime-types: specifier: ^2.1.35 version: 2.1.35 + multer: + specifier: 1.4.5-lts.1 + version: 1.4.5-lts.1 netlify-cli: specifier: ^17.21.1 version: 17.21.1(@types/node@18.19.17) + next: + specifier: ^14.1.4 + version: 14.1.4(@babel/core@7.23.7)(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) + next-auth: + specifier: ^4.24.7 + version: 4.24.7(next@14.1.4)(react-dom@18.2.0)(react@18.2.0) + plugin-nextjs:^4.41.3: + specifier: link:@netlify/plugin-nextjs:^4.41.3 + version: link:@netlify/plugin-nextjs:^4.41.3 react: specifier: ^18.2.0 version: 18.2.0 @@ -5954,6 +5981,91 @@ packages: - supports-color dev: false + /@next/env@14.1.4: + resolution: {integrity: sha512-e7X7bbn3Z6DWnDi75UWn+REgAbLEqxI8Tq2pkFOFAMpWAWApz/YCUhtWMWn410h8Q2fYiYL7Yg5OlxMOCfFjJQ==} + dev: false + + /@next/swc-darwin-arm64@14.1.4: + resolution: {integrity: sha512-ubmUkbmW65nIAOmoxT1IROZdmmJMmdYvXIe8211send9ZYJu+SqxSnJM4TrPj9wmL6g9Atvj0S/2cFmMSS99jg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@next/swc-darwin-x64@14.1.4: + resolution: {integrity: sha512-b0Xo1ELj3u7IkZWAKcJPJEhBop117U78l70nfoQGo4xUSvv0PJSTaV4U9xQBLvZlnjsYkc8RwQN1HoH/oQmLlQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm64-gnu@14.1.4: + resolution: {integrity: sha512-457G0hcLrdYA/u1O2XkRMsDKId5VKe3uKPvrKVOyuARa6nXrdhJOOYU9hkKKyQTMru1B8qEP78IAhf/1XnVqKA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm64-musl@14.1.4: + resolution: {integrity: sha512-l/kMG+z6MB+fKA9KdtyprkTQ1ihlJcBh66cf0HvqGP+rXBbOXX0dpJatjZbHeunvEHoBBS69GYQG5ry78JMy3g==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-x64-gnu@14.1.4: + resolution: {integrity: sha512-BapIFZ3ZRnvQ1uWbmqEGJuPT9cgLwvKtxhK/L2t4QYO7l+/DxXuIGjvp1x8rvfa/x1FFSsipERZK70pewbtJtw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-x64-musl@14.1.4: + resolution: {integrity: sha512-mqVxTwk4XuBl49qn2A5UmzFImoL1iLm0KQQwtdRJRKl21ylQwwGCxJtIYo2rbfkZHoSKlh/YgztY0qH3wG1xIg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-arm64-msvc@14.1.4: + resolution: {integrity: sha512-xzxF4ErcumXjO2Pvg/wVGrtr9QQJLk3IyQX1ddAC/fi6/5jZCZ9xpuL9Tzc4KPWMFq8GGWFVDMshZOdHGdkvag==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-ia32-msvc@14.1.4: + resolution: {integrity: sha512-WZiz8OdbkpRw6/IU/lredZWKKZopUMhcI2F+XiMAcPja0uZYdMTZQRoQ0WZcvinn9xZAidimE7tN9W5v9Yyfyw==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-x64-msvc@14.1.4: + resolution: {integrity: sha512-4Rto21sPfw555sZ/XNLqfxDUNeLhNYGO2dlPqsnuCg8N8a2a9u1ltqBOPQ4vj1Gf7eJC0W2hHG2eYUHuiXgY2w==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: false + optional: true + /@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1: resolution: {integrity: sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==} dependencies: @@ -5977,6 +6089,19 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.16.0 + /@npmcli/agent@2.2.2: + resolution: {integrity: sha512-OrcNPXdpSl9UX7qPVRWbmWMCSXrcDa2M9DvrbOTj7ao1S4PlqVFYv9/yLKMkrJKZ/V5A/kDBC690or307i26Og==} + engines: {node: ^16.14.0 || >=18.0.0} + dependencies: + agent-base: 7.1.0 + http-proxy-agent: 7.0.0 + https-proxy-agent: 7.0.2 + lru-cache: 10.1.0 + socks-proxy-agent: 8.0.3 + transitivePeerDependencies: + - supports-color + dev: true + /@npmcli/fs@1.1.1: resolution: {integrity: sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==} requiresBuild: true @@ -5986,6 +6111,13 @@ packages: dev: false optional: true + /@npmcli/fs@3.1.0: + resolution: {integrity: sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + semver: 7.5.4 + dev: true + /@npmcli/move-file@1.1.2: resolution: {integrity: sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==} engines: {node: '>=10'} @@ -6126,6 +6258,10 @@ packages: engines: {node: '>=8.0.0'} dev: false + /@panva/hkdf@1.1.1: + resolution: {integrity: sha512-dhPeilub1NuIG0X5Kvhh9lH4iW3ZsHlnzwgwbOlgwQ2wG1IqFzsgHqmKPk3WzsdWAeaxKJxgM0+W433RmN45GA==} + dev: false + /@parcel/bundler-default@2.8.3(@parcel/core@2.8.3): resolution: {integrity: sha512-yJvRsNWWu5fVydsWk3O2L4yIy3UZiKWO2cPDukGOIWMgp/Vbpp+2Ct5IygVRtE22bnseW/E/oe0PV3d2IkEJGg==} engines: {node: '>= 12.0.0', parcel: ^2.8.3} @@ -6636,7 +6772,7 @@ packages: detect-libc: 1.0.3 is-glob: 4.0.3 micromatch: 4.0.5 - node-addon-api: 7.0.0 + node-addon-api: 7.1.0 optionalDependencies: '@parcel/watcher-android-arm64': 2.3.0 '@parcel/watcher-darwin-arm64': 2.3.0 @@ -6658,7 +6794,7 @@ packages: detect-libc: 1.0.3 is-glob: 4.0.3 micromatch: 4.0.5 - node-addon-api: 7.0.0 + node-addon-api: 7.1.0 optionalDependencies: '@parcel/watcher-android-arm64': 2.4.1 '@parcel/watcher-darwin-arm64': 2.4.1 @@ -8691,6 +8827,12 @@ packages: legacy-swc-helpers: /@swc/helpers@0.4.14 tslib: 2.6.2 + /@swc/helpers@0.5.2: + resolution: {integrity: sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==} + dependencies: + tslib: 2.6.2 + dev: false + /@swc/jest@0.2.29(@swc/core@1.4.2): resolution: {integrity: sha512-8reh5RvHBsSikDC3WGCd5ZTd2BXKkyOdK7QwynrCH58jk2cQFhhHhFBg/jvnWZehUQe/EoOImLENc9/DwbBFow==} engines: {npm: '>= 7.0.0'} @@ -9556,7 +9698,6 @@ packages: typescript: 4.9.5 transitivePeerDependencies: - supports-color - dev: false /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@7.32.0)(typescript@5.3.3): resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} @@ -9612,6 +9753,7 @@ packages: typescript: 5.4.2 transitivePeerDependencies: - supports-color + dev: false /@typescript-eslint/eslint-plugin@6.17.0(@typescript-eslint/parser@6.17.0)(eslint@7.32.0)(typescript@5.3.3): resolution: {integrity: sha512-Vih/4xLXmY7V490dGwBQJTpIZxH4ZFH6eCVmQ4RFkB+wmaCTDAx4dtgoWwMNGKLkqRY1L6rPqzEbjorRnDo4rQ==} @@ -9660,7 +9802,6 @@ packages: typescript: 4.9.5 transitivePeerDependencies: - supports-color - dev: false /@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.3.3): resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} @@ -9699,6 +9840,7 @@ packages: typescript: 5.4.2 transitivePeerDependencies: - supports-color + dev: false /@typescript-eslint/parser@6.17.0(eslint@7.32.0)(typescript@5.3.3): resolution: {integrity: sha512-C4bBaX2orvhK+LlwrY8oWGmSl4WolCfYm513gEccdWZj0CwGadbIADb0FtVEcI+WzUyjyoBj2JRP8g25E6IB8A==} @@ -9756,7 +9898,6 @@ packages: typescript: 4.9.5 transitivePeerDependencies: - supports-color - dev: false /@typescript-eslint/type-utils@5.62.0(eslint@7.32.0)(typescript@5.3.3): resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} @@ -9798,6 +9939,7 @@ packages: typescript: 5.4.2 transitivePeerDependencies: - supports-color + dev: false /@typescript-eslint/type-utils@6.17.0(eslint@7.32.0)(typescript@5.3.3): resolution: {integrity: sha512-hDXcWmnbtn4P2B37ka3nil3yi3VCQO2QEB9gBiHJmQp5wmyQWqnjA85+ZcE8c4FqnaB6lBwMrPkgd4aBYz3iNg==} @@ -9869,7 +10011,6 @@ packages: typescript: 4.9.5 transitivePeerDependencies: - supports-color - dev: false /@typescript-eslint/typescript-estree@5.62.0(typescript@5.3.3): resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} @@ -9910,6 +10051,7 @@ packages: typescript: 5.4.2 transitivePeerDependencies: - supports-color + dev: false /@typescript-eslint/typescript-estree@6.17.0(typescript@5.3.3): resolution: {integrity: sha512-gVQe+SLdNPfjlJn5VNGhlOhrXz4cajwFd5kAgWtZ9dCZf4XJf8xmgCTLIqec7aha3JwgLI2CK6GY1043FRxZwg==} @@ -9974,7 +10116,6 @@ packages: transitivePeerDependencies: - supports-color - typescript - dev: false /@typescript-eslint/utils@5.62.0(eslint@7.32.0)(typescript@5.3.3): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} @@ -10016,6 +10157,7 @@ packages: transitivePeerDependencies: - supports-color - typescript + dev: false /@typescript-eslint/utils@6.17.0(eslint@7.32.0)(typescript@5.3.3): resolution: {integrity: sha512-LofsSPjN/ITNkzV47hxas2JCsNCEnGhVvocfyOcLzT9c/tSZE7SfhS/iWtzP1lKNOEfLhRTZz6xqI8N2RzweSQ==} @@ -10956,6 +11098,11 @@ packages: requiresBuild: true dev: false + /abbrev@2.0.0: + resolution: {integrity: sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dev: true + /abort-controller@3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} engines: {node: '>=6.5'} @@ -11081,6 +11228,15 @@ packages: - supports-color dev: true + /agent-base@7.1.1: + resolution: {integrity: sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==} + engines: {node: '>= 14'} + dependencies: + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: true + /agentkeepalive@4.5.0: resolution: {integrity: sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==} engines: {node: '>= 8.0.0'} @@ -11847,6 +12003,19 @@ packages: schema-utils: 2.7.1 webpack: 5.89.0 + /babel-loader@9.1.3(@babel/core@7.23.7)(webpack@5.89.0): + resolution: {integrity: sha512-xG3ST4DglodGf8qSwv0MdeWLhrDsw/32QMdTO5T1ZIp9gQur0HkCyFs7Awskr10JKXFXwpAhiCuYX5oGXnRGbw==} + engines: {node: '>= 14.15.0'} + peerDependencies: + '@babel/core': ^7.12.0 + webpack: '>=5' + dependencies: + '@babel/core': 7.23.7 + find-cache-dir: 4.0.0 + schema-utils: 4.2.0 + webpack: 5.89.0 + dev: false + /babel-plugin-add-module-exports@1.0.4: resolution: {integrity: sha512-g+8yxHUZ60RcyaUpfNzy56OtWW+x9cyEe9j+CranqLiqbju2yf/Cy6ZtYK40EZxtrdHllzlVZgLmcOUCTlJ7Jg==} @@ -11938,7 +12107,7 @@ packages: '@babel/core': 7.23.7 '@babel/runtime': 7.23.7 '@babel/types': 7.23.6 - gatsby: 5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.4.2) + gatsby: 5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) gatsby-core-utils: 4.13.0 /babel-plugin-syntax-trailing-function-commas@7.0.0-beta.0: @@ -12438,6 +12607,24 @@ packages: dev: false optional: true + /cacache@18.0.2: + resolution: {integrity: sha512-r3NU8h/P+4lVUHfeRw1dtgQYar3DZMm4/cm2bZgOvrFC/su7budSOeqh52VJIC4U4iG1WWwV6vRW0znqBvxNuw==} + engines: {node: ^16.14.0 || >=18.0.0} + dependencies: + '@npmcli/fs': 3.1.0 + fs-minipass: 3.0.3 + glob: 10.3.10 + lru-cache: 10.1.0 + minipass: 7.0.4 + minipass-collect: 2.0.1 + minipass-flush: 1.0.5 + minipass-pipeline: 1.2.4 + p-map: 4.0.0 + ssri: 10.0.5 + tar: 6.2.0 + unique-filename: 3.0.0 + dev: true + /cache-base@1.0.1: resolution: {integrity: sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==} engines: {node: '>=0.10.0'} @@ -12569,6 +12756,10 @@ packages: /caniuse-lite@1.0.30001574: resolution: {integrity: sha512-BtYEK4r/iHt/txm81KBudCUcTy7t+s9emrIaHqjYurQ10x71zJ5VQ9x1dYPcz/b+pKSp4y/v1xSI67A+LzpNyg==} + /caniuse-lite@1.0.30001606: + resolution: {integrity: sha512-LPbwnW4vfpJId225pwjZJOgX1m9sGfbw/RKJvw/t0QhYOOaTXHvkjVGFGPpvwEzufrjvTlsULnVTxdy4/6cqkg==} + dev: false + /capital-case@1.0.4: resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==} dependencies: @@ -15541,8 +15732,6 @@ packages: resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} engines: {node: '>=6'} requiresBuild: true - dev: false - optional: true /env-paths@3.0.0: resolution: {integrity: sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==} @@ -15570,8 +15759,6 @@ packages: /err-code@2.0.3: resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==} requiresBuild: true - dev: false - optional: true /error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} @@ -15935,7 +16122,6 @@ packages: eslint-plugin-react: 7.33.2(eslint@7.32.0) eslint-plugin-react-hooks: 4.6.0(eslint@7.32.0) typescript: 4.9.5 - dev: false /eslint-config-react-app@6.0.0(@typescript-eslint/eslint-plugin@5.62.0)(@typescript-eslint/parser@5.62.0)(babel-eslint@10.1.0)(eslint-plugin-flowtype@5.10.0)(eslint-plugin-import@2.29.1)(eslint-plugin-jsx-a11y@6.8.0)(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.33.2)(eslint@7.32.0)(typescript@5.3.3): resolution: {integrity: sha512-bpoAAC+YRfzq0dsTk+6v9aHm/uqnDwayNAXleMypGl6CpxI9oXXscVHo4fk3eJPIn+rsbtNetB4r/ZIidFIE8A==} @@ -16009,6 +16195,7 @@ packages: eslint-plugin-react: 7.33.2(eslint@7.32.0) eslint-plugin-react-hooks: 4.6.0(eslint@7.32.0) typescript: 5.4.2 + dev: false /eslint-import-resolver-node@0.3.9: resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} @@ -16040,7 +16227,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@5.4.2) + '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@4.9.5) debug: 3.2.7 eslint: 7.32.0 eslint-import-resolver-node: 0.3.9 @@ -16118,7 +16305,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@5.4.2) + '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@4.9.5) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 @@ -16584,6 +16771,10 @@ packages: jest-util: 29.7.0 dev: true + /exponential-backoff@3.1.1: + resolution: {integrity: sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==} + dev: true + /express-basic-auth@1.2.1: resolution: {integrity: sha512-L6YQ1wQ/mNjVLAmK3AG1RK6VkokA1BIY6wmiH304Xtt/cLTps40EusZsU1Uop+v9lTDPxdtzbFmdXfFO3KEnwA==} dependencies: @@ -17213,6 +17404,14 @@ packages: make-dir: 3.1.0 pkg-dir: 4.2.0 + /find-cache-dir@4.0.0: + resolution: {integrity: sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg==} + engines: {node: '>=14.16'} + dependencies: + common-path-prefix: 3.0.0 + pkg-dir: 7.0.0 + dev: false + /find-file-up@0.1.3: resolution: {integrity: sha512-mBxmNbVyjg1LQIIpgO8hN+ybWBgDQK8qjht+EbrTCGmmPV/sc7RF1i9stPTD6bpvXZywBdrwRYxhSdJv867L6A==} engines: {node: '>=0.10.0'} @@ -17405,7 +17604,6 @@ packages: tapable: 1.1.3 typescript: 4.9.5 webpack: 5.89.0 - dev: false /fork-ts-checker-webpack-plugin@6.5.3(eslint@7.32.0)(typescript@5.3.3)(webpack@5.89.0): resolution: {integrity: sha512-SbH/l9ikmMWycd5puHJKTkZJKddF4iRLyW3DeZ08HTI7NGyLS38MXd/KGgeWumQO7YNQbW2u/NtPT2YowbPaGQ==} @@ -17469,6 +17667,7 @@ packages: tapable: 1.1.3 typescript: 5.4.2 webpack: 5.89.0 + dev: false /form-data-encoder@2.1.4: resolution: {integrity: sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==} @@ -17599,6 +17798,13 @@ packages: dependencies: minipass: 3.3.6 + /fs-minipass@3.0.3: + resolution: {integrity: sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + minipass: 7.0.4 + dev: true + /fs-monkey@1.0.5: resolution: {integrity: sha512-8uMbBjrhzW76TYgEV27Y5E//W2f/lTFmx78P2w19FZSxarhI/798APGQyuGCwmkNxgwGRhrLfvWyLBvNtuOmew==} @@ -17756,7 +17962,7 @@ packages: dependencies: '@types/node-fetch': 2.6.10 fs-extra: 9.1.0 - gatsby: 5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.4.2) + gatsby: 5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) lodash: 4.17.21 node-fetch: 2.7.0 p-queue: 6.6.2 @@ -17873,7 +18079,7 @@ packages: chokidar: 3.5.3 fs-exists-cached: 1.0.0 fs-extra: 11.2.0 - gatsby: 5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.4.2) + gatsby: 5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) gatsby-core-utils: 4.13.0 gatsby-page-utils: 3.13.0 gatsby-plugin-utils: 4.13.0(gatsby@5.13.1)(graphql@16.8.1) @@ -17983,7 +18189,7 @@ packages: '@babel/preset-typescript': 7.23.3(@babel/core@7.23.7) '@babel/runtime': 7.23.7 babel-plugin-remove-graphql-queries: 5.13.0(@babel/core@7.23.7)(gatsby@5.13.1) - gatsby: 5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.4.2) + gatsby: 5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) transitivePeerDependencies: - supports-color @@ -18001,7 +18207,7 @@ packages: '@babel/runtime': 7.23.7 fastq: 1.16.0 fs-extra: 11.2.0 - gatsby: 5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.4.2) + gatsby: 5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) gatsby-core-utils: 4.13.0 gatsby-sharp: 1.13.0 graphql: 16.8.1 @@ -18521,7 +18727,6 @@ packages: - webpack-dev-server - webpack-hot-middleware - webpack-plugin-serve - dev: false /gatsby@5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.4.2): resolution: {integrity: sha512-y8VB381ZnHX3Xxc1n78AAAd+t0EsIyyIRtfqlSQ10CXwZHpZzBR3DTRoHmqIG3/NmdiqWhbHb/nRlmKZUzixtQ==} @@ -18727,6 +18932,7 @@ packages: - webpack-dev-server - webpack-hot-middleware - webpack-plugin-serve + dev: false /gauge@3.0.2: resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} @@ -20676,8 +20882,6 @@ packages: /is-lambda@1.0.1: resolution: {integrity: sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==} requiresBuild: true - dev: false - optional: true /is-lower-case@2.0.2: resolution: {integrity: sha512-bVcMJy4X5Og6VZfdOZstSexlEy20Sr0k/p/b2IlQJlfdKAQuMpiv5w2Ccxb8sKdRUNAG1PnHVHjFSdRDVS6NlQ==} @@ -20977,6 +21181,11 @@ packages: /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + /isexe@3.1.1: + resolution: {integrity: sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==} + engines: {node: '>=16'} + dev: true + /isobject@2.1.0: resolution: {integrity: sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==} engines: {node: '>=0.10.0'} @@ -21666,6 +21875,10 @@ packages: '@sideway/formula': 3.0.1 '@sideway/pinpoint': 2.0.0 + /jose@4.15.5: + resolution: {integrity: sha512-jc7BFxgKPKi94uOvEmzlSWFFe2+vASyXaKUpdQKatWAESU2MWjDfFf0fdfc83CDKcA5QecabZeNLyfhe3yKNkg==} + dev: false + /jose@5.2.2: resolution: {integrity: sha512-/WByRr4jDcsKlvMd1dRJnPfS1GVO3WuKyaurJ/vvXcOaUQO8rnNObCQMlv/5uCceVQIq5Q4WLF44ohsdiTohdg==} dev: true @@ -22508,6 +22721,25 @@ packages: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} dev: false + /make-fetch-happen@13.0.0: + resolution: {integrity: sha512-7ThobcL8brtGo9CavByQrQi+23aIfgYU++wg4B87AIS8Rb2ZBt/MEaDqzA00Xwv/jUjAjYkLHjVolYuTLKda2A==} + engines: {node: ^16.14.0 || >=18.0.0} + dependencies: + '@npmcli/agent': 2.2.2 + cacache: 18.0.2 + http-cache-semantics: 4.1.1 + is-lambda: 1.0.1 + minipass: 7.0.4 + minipass-fetch: 3.0.4 + minipass-flush: 1.0.5 + minipass-pipeline: 1.2.4 + negotiator: 0.6.3 + promise-retry: 2.0.1 + ssri: 10.0.5 + transitivePeerDependencies: + - supports-color + dev: true + /make-fetch-happen@9.1.0: resolution: {integrity: sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==} engines: {node: '>= 10'} @@ -23408,6 +23640,13 @@ packages: dev: false optional: true + /minipass-collect@2.0.1: + resolution: {integrity: sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + minipass: 7.0.4 + dev: true + /minipass-fetch@1.4.1: resolution: {integrity: sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==} engines: {node: '>=8'} @@ -23421,14 +23660,23 @@ packages: dev: false optional: true + /minipass-fetch@3.0.4: + resolution: {integrity: sha512-jHAqnA728uUpIaFm7NWsCnqKT6UqZz7GcI/bDpPATuwYyKwJwW0remxSCxUlKiEty+eopHGa3oc8WxgQ1FFJqg==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + minipass: 7.0.4 + minipass-sized: 1.0.3 + minizlib: 2.1.2 + optionalDependencies: + encoding: 0.1.13 + dev: true + /minipass-flush@1.0.5: resolution: {integrity: sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==} engines: {node: '>= 8'} requiresBuild: true dependencies: minipass: 3.3.6 - dev: false - optional: true /minipass-pipeline@1.2.4: resolution: {integrity: sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==} @@ -23436,8 +23684,6 @@ packages: requiresBuild: true dependencies: minipass: 3.3.6 - dev: false - optional: true /minipass-sized@1.0.3: resolution: {integrity: sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==} @@ -23445,8 +23691,6 @@ packages: requiresBuild: true dependencies: minipass: 3.3.6 - dev: false - optional: true /minipass@3.3.6: resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} @@ -23902,9 +24146,74 @@ packages: qs: 6.11.2 dev: false + /next-auth@4.24.7(next@14.1.4)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-iChjE8ov/1K/z98gdKbn2Jw+2vLgJtVV39X+rCP5SGnVQuco7QOr19FRNGMIrD8d3LYhHWV9j9sKLzq1aDWWQQ==} + peerDependencies: + next: ^12.2.5 || ^13 || ^14 + nodemailer: ^6.6.5 + react: ^17.0.2 || ^18 + react-dom: ^17.0.2 || ^18 + peerDependenciesMeta: + nodemailer: + optional: true + dependencies: + '@babel/runtime': 7.23.7 + '@panva/hkdf': 1.1.1 + cookie: 0.5.0 + jose: 4.15.5 + next: 14.1.4(@babel/core@7.23.7)(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) + oauth: 0.9.15 + openid-client: 5.6.5 + preact: 10.20.1 + preact-render-to-string: 5.2.6(preact@10.20.1) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + uuid: 8.3.2 + dev: false + /next-tick@1.1.0: resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} + /next@14.1.4(@babel/core@7.23.7)(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-1WTaXeSrUwlz/XcnhGTY7+8eiaFvdet5z9u3V2jb+Ek1vFo0VhHKSAIJvDWfQpttWjnyw14kBeq28TPq7bTeEQ==} + engines: {node: '>=18.17.0'} + hasBin: true + peerDependencies: + '@opentelemetry/api': ^1.1.0 + react: ^18.2.0 + react-dom: ^18.2.0 + sass: ^1.3.0 + peerDependenciesMeta: + '@opentelemetry/api': + optional: true + sass: + optional: true + dependencies: + '@next/env': 14.1.4 + '@opentelemetry/api': 1.8.0 + '@swc/helpers': 0.5.2 + busboy: 1.6.0 + caniuse-lite: 1.0.30001606 + graceful-fs: 4.2.11 + postcss: 8.4.31 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + styled-jsx: 5.1.1(@babel/core@7.23.7)(react@18.2.0) + optionalDependencies: + '@next/swc-darwin-arm64': 14.1.4 + '@next/swc-darwin-x64': 14.1.4 + '@next/swc-linux-arm64-gnu': 14.1.4 + '@next/swc-linux-arm64-musl': 14.1.4 + '@next/swc-linux-x64-gnu': 14.1.4 + '@next/swc-linux-x64-musl': 14.1.4 + '@next/swc-win32-arm64-msvc': 14.1.4 + '@next/swc-win32-ia32-msvc': 14.1.4 + '@next/swc-win32-x64-msvc': 14.1.4 + transitivePeerDependencies: + - '@babel/core' + - babel-plugin-macros + dev: false + /no-case@3.0.4: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} dependencies: @@ -23914,8 +24223,9 @@ packages: /node-addon-api@4.3.0: resolution: {integrity: sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==} - /node-addon-api@7.0.0: - resolution: {integrity: sha512-vgbBJTS4m5/KkE16t5Ly0WW9hz46swAstv0hYYwMtbG7AznRhNyfLRe8HZAiWIpcHzoO7HxhLuBQj9rJ/Ho0ZA==} + /node-addon-api@7.1.0: + resolution: {integrity: sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g==} + engines: {node: ^16 || ^18 || >= 20} /node-dir@0.1.17: resolution: {integrity: sha512-tmPX422rYgofd4epzrNoOXiE8XFZYOcCq1vD7MAXCDO+O+zndlA2ztdKKMa+EeuBG5tHETpr4ml4RGgpqDCCAg==} @@ -23985,6 +24295,25 @@ packages: requiresBuild: true dev: false + /node-gyp@10.0.1: + resolution: {integrity: sha512-gg3/bHehQfZivQVfqIyy8wTdSymF9yTyP4CJifK73imyNMU8AIGQE2pUa7dNWfmMeG9cDVF2eehiRMv0LC1iAg==} + engines: {node: ^16.14.0 || >=18.0.0} + hasBin: true + dependencies: + env-paths: 2.2.1 + exponential-backoff: 3.1.1 + glob: 10.3.10 + graceful-fs: 4.2.11 + make-fetch-happen: 13.0.0 + nopt: 7.2.0 + proc-log: 3.0.0 + semver: 7.5.4 + tar: 6.2.0 + which: 4.0.0 + transitivePeerDependencies: + - supports-color + dev: true + /node-gyp@8.4.1: resolution: {integrity: sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==} engines: {node: '>= 10.12.0'} @@ -24081,6 +24410,14 @@ packages: abbrev: 1.1.1 dev: false + /nopt@7.2.0: + resolution: {integrity: sha512-CVDtwCdhYIvnAzFoJ6NJ6dX3oga9/HyciQDnG1vQDjSLMeKLJ4A93ZqYKDrgYSr1FBY5/hMYC+2VCi24pgpkGA==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + hasBin: true + dependencies: + abbrev: 2.0.0 + dev: true + /normalize-node-version@12.4.0: resolution: {integrity: sha512-0oLZN5xcyKVrSHMk8/9RuNblEe7HEsXAt5Te2xmMiZD9VX7bqWYe0HMyfqSYFD3xv0949lZuXaEwjTqle1uWWQ==} engines: {node: '>=14.18.0'} @@ -24252,6 +24589,10 @@ packages: ufo: 1.4.0 dev: true + /oauth@0.9.15: + resolution: {integrity: sha512-a5ERWK1kh38ExDEfoO6qUHJb32rd7aYmPHuyCu3Fta/cnICvYmgd2uhuKXvPD+PXB+gCEYYEaQdIRAjCOwAKNA==} + dev: false + /object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -24265,6 +24606,11 @@ packages: kind-of: 3.2.2 dev: false + /object-hash@2.2.0: + resolution: {integrity: sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==} + engines: {node: '>= 6'} + dev: false + /object-hash@3.0.0: resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==} engines: {node: '>= 6'} @@ -24358,6 +24704,11 @@ packages: /ohash@1.1.3: resolution: {integrity: sha512-zuHHiGTYTA1sYJ/wZN+t5HKZaH23i4yI1HMwbuXm24Nid7Dv0KcuRlKoNKS9UNfAVSBlnGLcuQrnOKWOZoEGaw==} + /oidc-token-hash@5.0.3: + resolution: {integrity: sha512-IF4PcGgzAr6XXSff26Sk/+P4KZFJVuHAJZj3wgO3vX2bMdNVp/QXTP3P7CEm9V1IdG8lDLY3HhiqpsE/nOwpPw==} + engines: {node: ^10.13.0 || >=12.0.0} + dev: false + /ol-mapbox-style@8.2.1: resolution: {integrity: sha512-3kBBuZC627vDL8vnUdfVbCbfkhkcZj2kXPHQcuLhC4JJEA+XkEVEtEde8x8+AZctRbHwBkSiubTPaRukgLxIRw==} dependencies: @@ -24444,6 +24795,15 @@ packages: is-docker: 2.2.1 is-wsl: 2.2.0 + /openid-client@5.6.5: + resolution: {integrity: sha512-5P4qO9nGJzB5PI0LFlhj4Dzg3m4odt0qsJTfyEtZyOlkgpILwEioOhVVJOrS1iVH494S4Ee5OCjjg6Bf5WOj3w==} + dependencies: + jose: 4.15.5 + lru-cache: 6.0.0 + object-hash: 2.2.0 + oidc-token-hash: 5.0.3 + dev: false + /opentracing@0.14.7: resolution: {integrity: sha512-vz9iS7MJ5+Bp1URw8Khvdyw1H/hGvzHWlKQ7eRrQojSCDL1/SrWfrY9QebLw97n2deyRtzHRC3MkQfVNUCo91Q==} engines: {node: '>=0.10'} @@ -25917,6 +26277,15 @@ packages: quote-unquote: 1.0.0 dev: false + /postcss@8.4.31: + resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.7 + picocolors: 1.0.0 + source-map-js: 1.0.2 + dev: false + /postcss@8.4.32: resolution: {integrity: sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==} engines: {node: ^10 || ^12 || >=14} @@ -25925,6 +26294,19 @@ packages: picocolors: 1.0.0 source-map-js: 1.0.2 + /preact-render-to-string@5.2.6(preact@10.20.1): + resolution: {integrity: sha512-JyhErpYOvBV1hEPwIxc/fHWXPfnEGdRKxc8gFdAZ7XV4tlzyzG847XAyEZqoDnynP88akM4eaHcSOzNcLWFguw==} + peerDependencies: + preact: '>=10' + dependencies: + preact: 10.20.1 + pretty-format: 3.8.0 + dev: false + + /preact@10.20.1: + resolution: {integrity: sha512-JIFjgFg9B2qnOoGiYMVBtrcFxHqn+dNXbq76bVmcaHYJFYR4lW67AOcXgAYQQTDYXDOg/kTZrKPNCdRgJ2UJmw==} + dev: false + /precinct@11.0.5: resolution: {integrity: sha512-oHSWLC8cL/0znFhvln26D14KfCQFFn4KOLSw6hmLhd+LQ2SKt9Ljm89but76Pc7flM9Ty1TnXyrA2u16MfRV3w==} engines: {node: ^14.14.0 || >=16.0.0} @@ -26017,6 +26399,10 @@ packages: ansi-styles: 5.2.0 react-is: 18.2.0 + /pretty-format@3.8.0: + resolution: {integrity: sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==} + dev: false + /pretty-hrtime@1.0.3: resolution: {integrity: sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==} engines: {node: '>= 0.8'} @@ -26047,6 +26433,11 @@ packages: - supports-color dev: false + /proc-log@3.0.0: + resolution: {integrity: sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dev: true + /process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} @@ -26092,8 +26483,6 @@ packages: dependencies: err-code: 2.0.3 retry: 0.12.0 - dev: false - optional: true /promise@7.3.1: resolution: {integrity: sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==} @@ -26496,7 +26885,6 @@ packages: - eslint - supports-color - vue-template-compiler - dev: false /react-dev-utils@12.0.1(eslint@7.32.0)(typescript@5.3.3)(webpack@5.89.0): resolution: {integrity: sha512-84Ivxmr17KjUupyqzFode6xKhjwuEJDROWKJy/BthkL7Wn6NJ8h4WE6k/exAv6ImS+0oZLRRW5j/aINMHyeGeQ==} @@ -26580,6 +26968,7 @@ packages: - eslint - supports-color - vue-template-compiler + dev: false /react-dnd-html5-backend@14.1.0: resolution: {integrity: sha512-6ONeqEC3XKVf4eVmMTe0oPds+c5B9Foyj8p/ZKLb7kL2qh9COYxiBHv3szd6gztqi/efkmriywLUVlPotqoJyw==} @@ -28065,6 +28454,16 @@ packages: ajv: 6.12.6 ajv-keywords: 3.5.2(ajv@6.12.6) + /schema-utils@4.2.0: + resolution: {integrity: sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==} + engines: {node: '>= 12.13.0'} + dependencies: + '@types/json-schema': 7.0.15 + ajv: 8.12.0 + ajv-formats: 2.1.1(ajv@8.12.0) + ajv-keywords: 5.1.0(ajv@8.12.0) + dev: false + /scroll-into-view-if-needed@2.2.31: resolution: {integrity: sha512-dGCXy99wZQivjmjIqihaBQNjryrz5rueJY7eHfTdyWEiR4ttYpsajb14rn9s5d4DY4EcY6+4+U/maARBXJedkA==} dependencies: @@ -28592,8 +28991,6 @@ packages: resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} requiresBuild: true - dev: false - optional: true /snake-case@3.0.4: resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==} @@ -28692,6 +29089,17 @@ packages: dev: false optional: true + /socks-proxy-agent@8.0.3: + resolution: {integrity: sha512-VNegTZKhuGq5vSD6XNKlbqWhyt/40CgoEw8XxD6dhnm8Jq9IEa3nIa4HwnM8XOqU0CdB0BwWVXusqiFXfHB3+A==} + engines: {node: '>= 14'} + dependencies: + agent-base: 7.1.1 + debug: 4.3.4 + socks: 2.7.1 + transitivePeerDependencies: + - supports-color + dev: true + /socks@2.7.1: resolution: {integrity: sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==} engines: {node: '>= 10.13.0', npm: '>= 3.0.0'} @@ -28699,8 +29107,6 @@ packages: dependencies: ip: 2.0.0 smart-buffer: 4.2.0 - dev: false - optional: true /sonic-boom@3.7.0: resolution: {integrity: sha512-IudtNvSqA/ObjN97tfgNmOKyDOs4dNcg4cUUsHDebqsgb8wGBBwb31LIgShNO8fye0dFI52X1+tFoKKI6Rq1Gg==} @@ -28919,6 +29325,13 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: true + /ssri@10.0.5: + resolution: {integrity: sha512-bSf16tAFkGeRlUNDjXu8FzaMQt6g2HZJrun7mtMbIPOddxt3GLMSz5VWUWcqTJUPfLEaDIepGxv+bYQW49596A==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + minipass: 7.0.4 + dev: true + /ssri@8.0.1: resolution: {integrity: sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==} engines: {node: '>= 8'} @@ -29342,6 +29755,24 @@ packages: dependencies: inline-style-parser: 0.1.1 + /styled-jsx@5.1.1(@babel/core@7.23.7)(react@18.2.0): + resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==} + engines: {node: '>= 12.0.0'} + peerDependencies: + '@babel/core': '*' + babel-plugin-macros: '*' + react: '>= 16.8.0 || 17.x.x || ^18.0.0-0' + peerDependenciesMeta: + '@babel/core': + optional: true + babel-plugin-macros: + optional: true + dependencies: + '@babel/core': 7.23.7 + client-only: 0.0.1 + react: 18.2.0 + dev: false + /stylehacks@5.1.1(postcss@8.4.32): resolution: {integrity: sha512-sBpcd5Hx7G6seo7b1LkpttvTz7ikD0LlH5RmdcBNb6fFR0Fl7LQwHDFr300q4cwUqi+IYrFGmsIHieMBfnN/Bw==} engines: {node: ^10 || ^12 || >=14.0} @@ -30177,7 +30608,6 @@ packages: dependencies: tslib: 1.14.1 typescript: 4.9.5 - dev: false /tsutils@3.21.0(typescript@5.3.3): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} @@ -30198,6 +30628,7 @@ packages: dependencies: tslib: 1.14.1 typescript: 5.4.2 + dev: false /turbo-combine-reducers@1.0.2: resolution: {integrity: sha512-gHbdMZlA6Ym6Ur5pSH/UWrNQMIM9IqTH6SoL1DbHpqEdQ8i+cFunSmSlFykPt0eGQwZ4d/XTHOl74H0/kFBVWw==} @@ -30392,7 +30823,6 @@ packages: resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} engines: {node: '>=4.2.0'} hasBin: true - dev: false /typescript@5.3.3: resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} @@ -30560,6 +30990,13 @@ packages: dev: false optional: true + /unique-filename@3.0.0: + resolution: {integrity: sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + unique-slug: 4.0.0 + dev: true + /unique-slug@2.0.2: resolution: {integrity: sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==} requiresBuild: true @@ -30568,6 +31005,13 @@ packages: dev: false optional: true + /unique-slug@4.0.0: + resolution: {integrity: sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + imurmurhash: 0.1.4 + dev: true + /unique-string@2.0.0: resolution: {integrity: sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==} engines: {node: '>=8'} @@ -32069,6 +32513,14 @@ packages: dependencies: isexe: 2.0.0 + /which@4.0.0: + resolution: {integrity: sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==} + engines: {node: ^16.13.0 || >=18.0.0} + hasBin: true + dependencies: + isexe: 3.1.1 + dev: true + /why-is-node-running@2.2.2: resolution: {integrity: sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==} engines: {node: '>=8'} From 0bab3351487f71152d9131982625832363fadbf8 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Fri, 5 Apr 2024 20:31:29 +0200 Subject: [PATCH 21/51] chore(gatsby-oauth): storybook integration --- apps/website/gatsby-node.mjs | 8 ++ apps/website/src/layouts/index.tsx | 47 ------------ apps/website/src/pages/user/profile.tsx | 51 ------------- apps/website/src/templates/page.tsx | 2 +- apps/website/src/templates/profile.tsx | 51 +++++++++++++ packages/ui/.storybook/main.ts | 4 + packages/ui/.storybook/preview.tsx | 76 ++++++++++++++++++- packages/ui/package.json | 2 + .../Molecules/UserButton.stories.tsx | 11 +++ .../src/components/Molecules/UserButton.tsx | 55 ++++++++++++++ .../ui/src/components/Organisms/Header.tsx | 4 + .../src/components/Organisms/UserProfile.tsx | 41 ++++++++++ .../components/Routes/UserProfile.stories.tsx | 43 +++++++++++ .../ui/src/components/Routes/UserProfile.tsx | 12 +++ pnpm-lock.yaml | 54 ++++++++++++- 15 files changed, 359 insertions(+), 102 deletions(-) delete mode 100644 apps/website/src/pages/user/profile.tsx create mode 100644 apps/website/src/templates/profile.tsx create mode 100644 packages/ui/src/components/Molecules/UserButton.stories.tsx create mode 100644 packages/ui/src/components/Molecules/UserButton.tsx create mode 100644 packages/ui/src/components/Organisms/UserProfile.tsx create mode 100644 packages/ui/src/components/Routes/UserProfile.stories.tsx create mode 100644 packages/ui/src/components/Routes/UserProfile.tsx diff --git a/apps/website/gatsby-node.mjs b/apps/website/gatsby-node.mjs index ce8627ff7..4a9a8456e 100644 --- a/apps/website/gatsby-node.mjs +++ b/apps/website/gatsby-node.mjs @@ -97,6 +97,14 @@ export const createPages = async ({ actions }) => { }); }); + // Create a profile page in each language. + Object.values(Locale).forEach((locale) => { + actions.createPage({ + path: `/${locale}/profile`, + component: resolve(`./src/templates/profile.tsx`), + }); + }); + // Broken Gatsby links will attempt to load page-data.json files, which don't exist // and also should not be piped into the strangler function. Thats why they // are caught right here. diff --git a/apps/website/src/layouts/index.tsx b/apps/website/src/layouts/index.tsx index ad4e0aa45..6bc8438cf 100644 --- a/apps/website/src/layouts/index.tsx +++ b/apps/website/src/layouts/index.tsx @@ -1,10 +1,8 @@ import { graphql, useStaticQuery } from '@amazeelabs/gatsby-plugin-operations'; import { FrameQuery, OperationExecutor } from '@custom/schema'; import { Frame } from '@custom/ui/routes/Frame'; -import { signIn, signOut, useSession } from 'next-auth/react'; import React, { PropsWithChildren } from 'react'; -import { authConfig } from '../../nextauth.config'; import { drupalExecutor } from '../utils/drupal-executor'; export default function Layout({ @@ -12,55 +10,10 @@ export default function Layout({ }: PropsWithChildren<{ locale: string; }>) { - // @todo move signin/signout to a specific component. - const session = useSession(); const data = useStaticQuery(graphql(FrameQuery)); return ( - {authConfig.providers && ( -
-
-

- {session?.status !== 'authenticated' && ( - <> - You are not signed in - { - e.preventDefault(); - signIn(); - }} - > - Sign in - - - )} - {session?.status === 'authenticated' && session.data.user && ( - <> - - Signed in as -
- {session.data.user.email} - {session.data.user.name - ? `(${session.data.user.name})` - : null} -
- { - e.preventDefault(); - signOut(); - }} - > - Sign out - - - )} -

-
-
- )} {children} diff --git a/apps/website/src/pages/user/profile.tsx b/apps/website/src/pages/user/profile.tsx deleted file mode 100644 index 2fb8b35a5..000000000 --- a/apps/website/src/pages/user/profile.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import { useSession } from 'next-auth/react'; -import React from 'react'; - -// @todo make a profile page. -export default function Index() { - //registerExecutor(NotFoundPageQuery, {}, data); - const session = useSession(); - if ( - session.status !== 'authenticated' || - // @ts-ignore - !session.data?.user?.tokens.access_token - ) { - return
Not authenticated
; - } else { - // @ts-ignore - const accessToken = session.data.user.tokens.access_token; - // @todo use proxy. - const AUTH_DRUPAL_URL = - process.env.AUTH_DRUPAL_URL || 'http://127.0.0.1:8888'; - const endpoint = `${AUTH_DRUPAL_URL}/graphql`; - const headers = { - 'Content-Type': 'application/json', - Authorization: `Bearer ${accessToken}`, - }; - const graphqlQuery = { - //operationName: 'CurrentUser', - query: ` - query CurrentUser { - currentUser { - id - name - email - memberFor - } - } - `, - variables: {}, - }; - const options = { - method: 'POST', - headers, - body: JSON.stringify(graphqlQuery), - }; - fetch(endpoint, options) - .then((res) => res.json()) - .then((result) => console.log(result)) - .catch((error) => console.error('Error:', error)); - - return
Authenticated
; - } -} diff --git a/apps/website/src/templates/page.tsx b/apps/website/src/templates/page.tsx index f707acbb5..a85fb4eb0 100644 --- a/apps/website/src/templates/page.tsx +++ b/apps/website/src/templates/page.tsx @@ -38,7 +38,7 @@ export function Head({ data }: HeadProps) { export default function PageTemplate({ data }: PageProps) { // Retrieve the current location and prefill the // "ViewPageQuery" with these arguments. - // That makes shure the `useOperation(ViewPageQuery, ...)` with this + // That makes sure the `useOperation(ViewPageQuery, ...)` with this // path immediately returns this data. const [location] = useLocation(); return ( diff --git a/apps/website/src/templates/profile.tsx b/apps/website/src/templates/profile.tsx new file mode 100644 index 000000000..571a32b02 --- /dev/null +++ b/apps/website/src/templates/profile.tsx @@ -0,0 +1,51 @@ +import { UserProfile } from '@custom/ui/routes/UserProfile'; +import { useSession } from 'next-auth/react'; +import React, { useEffect, useState } from 'react'; + +export async function getCurrentUser(accessToken: string): Promise { + const host = process.env.GATSBY_DRUPAL_URL || 'http://127.0.0.1:8888'; + const endpoint = `${host}/graphql`; + const headers = { + 'Content-Type': 'application/json', + Authorization: `Bearer ${accessToken}`, + }; + const graphqlQuery = { + query: ` + query CurrentUser { + currentUser { + id + name + email + memberFor + } + } + `, + variables: {}, + }; + const options = { + method: 'POST', + headers, + body: JSON.stringify(graphqlQuery), + }; + return await fetch(endpoint, options); +} + +export default function ProfilePage() { + const session = useSession(); + const [user, setUser] = useState(null); + const [error, setError] = useState(null); + useEffect(() => { + if (session && session.status === 'authenticated') { + // @ts-ignore + const accessToken = session.data.user.tokens.access_token; + getCurrentUser(accessToken) + .then((response) => response.json()) + .then((result) => { + setUser(result.data.currentUser); + return result; + }) + .catch((error) => setError(error)); + } + }, [session]); + return ; +} diff --git a/packages/ui/.storybook/main.ts b/packages/ui/.storybook/main.ts index ca58622e6..c8db1415e 100644 --- a/packages/ui/.storybook/main.ts +++ b/packages/ui/.storybook/main.ts @@ -23,6 +23,10 @@ const config: StorybookConfig = { pluginTurbosnap({ rootDir: config.root ?? process.cwd() }), imagetools(), ], + // https://github.com/nextauthjs/next-auth/discussions/4566 + define: { + 'process.env': process.env, + }, } satisfies UserConfig), staticDirs: ['../static/public', '../static/stories'], stories: ['../src/**/*.stories.@(ts|tsx|mdx)'], diff --git a/packages/ui/.storybook/preview.tsx b/packages/ui/.storybook/preview.tsx index 28c5c4eb6..08121d802 100644 --- a/packages/ui/.storybook/preview.tsx +++ b/packages/ui/.storybook/preview.tsx @@ -5,6 +5,13 @@ import { Decorator } from '@storybook/react'; import React from 'react'; import { IntlProvider } from 'react-intl'; import { SWRConfig, useSWRConfig } from 'swr'; +import { + SessionContext as NextSessionContext, + SessionProvider, +} from 'next-auth/react'; +import { faker } from '@faker-js/faker'; +import { Session } from 'next-auth'; +import { useMemo } from 'react'; // Every story is wrapped in an IntlProvider by default. const IntlDecorator: Decorator = (Story) => ( @@ -21,6 +28,68 @@ const LocationDecorator: Decorator = (Story, ctx) => { ); }; +type AuthState = + | { data: Session; status: 'authenticated' } + | { data: null; status: 'unauthenticated' | 'loading' }; + +export const AUTH_STATES: Record< + string, + { title: string; session: AuthState | undefined } +> = { + unknown: { + title: 'Session Unknown', + session: undefined, + }, + loading: { + title: 'Session Loading', + session: { + data: null, + status: 'loading', + }, + }, + unauthenticated: { + title: 'Not Authenticated', + session: { + data: null, + status: 'unauthenticated', + }, + }, + authenticated: { + title: 'Authenticated', + session: { + data: { + user: { + name: faker.person.fullName(), + email: faker.internet.email(), + image: faker.image.avatar(), + }, + expires: faker.date.future().toString(), + }, + status: 'authenticated', + }, + }, +}; + +const SessionContext: React.FC<{ session: AuthState }> = ({ + session, + children, +}) => { + const value = useMemo((): AuthState => { + return session ? session : { data: undefined, status: 'unauthenticated' }; + }, [session]); + + return {children}; +}; + +const SessionDecorator: Decorator = (Story, context) => { + const session = AUTH_STATES[context.globals.authState]?.session; + return ( + + + + ); +}; + declare global { interface Window { __STORYBOOK_PREVIEW__: { @@ -64,4 +133,9 @@ export const parameters = { chromatic: { viewports: [320, 840, 1440] }, }; -export const decorators = [LocationDecorator, IntlDecorator, SWRCacheDecorator]; +export const decorators = [ + LocationDecorator, + IntlDecorator, + SWRCacheDecorator, + SessionDecorator, +]; diff --git a/packages/ui/package.json b/packages/ui/package.json index 6c22c8620..cf6699447 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -47,6 +47,7 @@ "framer-motion": "^10.17.4", "hast-util-is-element": "^2.1.3", "hast-util-select": "^5.0.5", + "next-auth": "^4.24.7", "react-hook-form": "^7.49.2", "react-intl": "^6.6.2", "swr": "^2.2.4", @@ -61,6 +62,7 @@ "devDependencies": { "@amazeelabs/bridge-storybook": "^1.2.8", "@amazeelabs/cloudinary-responsive-image": "^1.6.15", + "@faker-js/faker": "^8.4.1", "@formatjs/cli": "^6.2.4", "@storybook/addon-actions": "^7.6.7", "@storybook/addon-coverage": "^1.0.0", diff --git a/packages/ui/src/components/Molecules/UserButton.stories.tsx b/packages/ui/src/components/Molecules/UserButton.stories.tsx new file mode 100644 index 000000000..644b6244c --- /dev/null +++ b/packages/ui/src/components/Molecules/UserButton.stories.tsx @@ -0,0 +1,11 @@ +import { Meta, StoryObj } from '@storybook/react'; + +import { UserButton } from './UserButton'; + +export default { + component: UserButton, +} satisfies Meta; + +// @todo add signed in and signed out states. +// @todo fix next-auth errors +export const UserButtonStory = {} satisfies StoryObj; diff --git a/packages/ui/src/components/Molecules/UserButton.tsx b/packages/ui/src/components/Molecules/UserButton.tsx new file mode 100644 index 000000000..0521376fc --- /dev/null +++ b/packages/ui/src/components/Molecules/UserButton.tsx @@ -0,0 +1,55 @@ +import { Link } from '@custom/schema'; +import { signIn, signOut, useSession } from 'next-auth/react'; +import React from 'react'; +import { useIntl } from 'react-intl'; + +export function UserButton() { + const session = useSession(); + const intl = useIntl(); + const hostWithScheme = `${location.protocol}//${location.host}`; + return ( + <> + {!session && <>} + {session?.status !== 'authenticated' && ( + { + e.preventDefault(); + signIn(); + }} + > + {intl.formatMessage({ + defaultMessage: 'Sign in', + id: 'SQJto2', + })} + + )} + {session?.status === 'authenticated' && session.data.user && ( + <> + + {session.data.user.name + ? session.data.user.name + : session.data.user.email} + + { + e.preventDefault(); + signOut(); + }} + > + {intl.formatMessage({ + defaultMessage: 'Sign out', + id: 'xXbJso', + })} + + + )} + + ); +} diff --git a/packages/ui/src/components/Organisms/Header.tsx b/packages/ui/src/components/Organisms/Header.tsx index dacd4f058..273904369 100644 --- a/packages/ui/src/components/Organisms/Header.tsx +++ b/packages/ui/src/components/Organisms/Header.tsx @@ -18,6 +18,7 @@ import { MobileMenuProvider, } from '../Client/MobileMenu'; import { LanguageSwitcher } from '../Molecules/LanguageSwitcher'; +import { UserButton } from '../Molecules/UserButton'; function useHeaderNavigation(lang: string = 'en') { return ( @@ -180,6 +181,9 @@ function UserActions({ )} > +
+ +
); } diff --git a/packages/ui/src/components/Organisms/UserProfile.tsx b/packages/ui/src/components/Organisms/UserProfile.tsx new file mode 100644 index 000000000..dfde27d90 --- /dev/null +++ b/packages/ui/src/components/Organisms/UserProfile.tsx @@ -0,0 +1,41 @@ +import React from 'react'; +import { useIntl } from 'react-intl'; + +import { UserButton } from '../Molecules/UserButton'; + +export function UserProfile(props: any) { + const intl = useIntl(); + return ( +
+
+
+ {props.error &&

{props.error}

} + {!props.user && !props.error && } + {props.user && ( + <> +

+ {props.user.name} +

+

+ {intl.formatMessage( + { defaultMessage: 'Email: {email}', id: 'uPNlBw' }, + { + email: props.user.email, + }, + )} +

+

+ {intl.formatMessage( + { defaultMessage: 'Member for {member_for}', id: 'OZlBcy' }, + { + member_for: props.user.memberFor, + }, + )} +

+ + )} +
+
+
+ ); +} diff --git a/packages/ui/src/components/Routes/UserProfile.stories.tsx b/packages/ui/src/components/Routes/UserProfile.stories.tsx new file mode 100644 index 000000000..2d09e4f5a --- /dev/null +++ b/packages/ui/src/components/Routes/UserProfile.stories.tsx @@ -0,0 +1,43 @@ +import { Meta, StoryObj } from '@storybook/react'; +import React from 'react'; + +import { UserProfile } from './UserProfile'; + +export default { + component: UserProfile, +} satisfies Meta; + +export const AuthenticatedUser = { + render: (args) => { + return ; + }, + args: { + user: { + id: '1', + email: 'test@example.com', + name: 'Jane Doe', + memberFor: '1 year', + }, + error: null, + }, +} satisfies StoryObj; + +export const AnonymousUser = { + render: (args) => { + return ; + }, + args: { + user: null, + error: null, + }, +} satisfies StoryObj; + +export const AuthenticationError = { + render: (args) => { + return ; + }, + args: { + user: null, + error: 'Authentication error', + }, +} satisfies StoryObj; diff --git a/packages/ui/src/components/Routes/UserProfile.tsx b/packages/ui/src/components/Routes/UserProfile.tsx new file mode 100644 index 000000000..6272aa758 --- /dev/null +++ b/packages/ui/src/components/Routes/UserProfile.tsx @@ -0,0 +1,12 @@ +import React from 'react'; + +import { PageTransition } from '../Molecules/PageTransition'; +import { UserProfile as UserProfileOrganism } from '../Organisms/UserProfile'; + +export function UserProfile(props: any) { + return ( + + + + ); +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ea9ba0f72..fff773221 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -488,6 +488,9 @@ importers: hast-util-select: specifier: ^5.0.5 version: 5.0.5 + next-auth: + specifier: ^4.24.7 + version: 4.24.7(next@14.1.4)(react-dom@18.2.0)(react@18.2.0) react-hook-form: specifier: ^7.49.2 version: 7.49.2(react@18.2.0) @@ -513,6 +516,9 @@ importers: '@amazeelabs/cloudinary-responsive-image': specifier: ^1.6.15 version: 1.6.15 + '@faker-js/faker': + specifier: ^8.4.1 + version: 8.4.1 '@formatjs/cli': specifier: ^6.2.4 version: 6.2.4 @@ -3582,6 +3588,11 @@ packages: transitivePeerDependencies: - supports-color + /@faker-js/faker@8.4.1: + resolution: {integrity: sha512-XQ3cU+Q8Uqmrbf2e0cIC/QN43sTBSC8KF12u29Mb47tWrt2hAgBXSgpZMj4Ao8Uk0iJcU99QsOCaIL8934obCg==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0, npm: '>=6.14.13'} + dev: true + /@fal-works/esbuild-plugin-global-externals@2.1.2: resolution: {integrity: sha512-cEee/Z+I12mZcFJshKcCqC8tuX5hG3s+d+9nZ3LabqKF1vKdF41B92pJVCBggjAGORAeOzyyDDKrZwIkLffeOQ==} dev: true @@ -10310,7 +10321,7 @@ packages: vite: ^4 || ^5 dependencies: '@swc/core': 1.3.102 - vite: 5.0.10(@types/node@18.19.4) + vite: 5.0.10(@types/node@18.19.17) transitivePeerDependencies: - '@swc/helpers' dev: true @@ -24161,7 +24172,7 @@ packages: '@panva/hkdf': 1.1.1 cookie: 0.5.0 jose: 4.15.5 - next: 14.1.4(@babel/core@7.23.7)(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) + next: 14.1.4(@babel/core@7.23.7)(react-dom@18.2.0)(react@18.2.0) oauth: 0.9.15 openid-client: 5.6.5 preact: 10.20.1 @@ -24214,6 +24225,45 @@ packages: - babel-plugin-macros dev: false + /next@14.1.4(@babel/core@7.23.7)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-1WTaXeSrUwlz/XcnhGTY7+8eiaFvdet5z9u3V2jb+Ek1vFo0VhHKSAIJvDWfQpttWjnyw14kBeq28TPq7bTeEQ==} + engines: {node: '>=18.17.0'} + hasBin: true + peerDependencies: + '@opentelemetry/api': ^1.1.0 + react: ^18.2.0 + react-dom: ^18.2.0 + sass: ^1.3.0 + peerDependenciesMeta: + '@opentelemetry/api': + optional: true + sass: + optional: true + dependencies: + '@next/env': 14.1.4 + '@swc/helpers': 0.5.2 + busboy: 1.6.0 + caniuse-lite: 1.0.30001606 + graceful-fs: 4.2.11 + postcss: 8.4.31 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + styled-jsx: 5.1.1(@babel/core@7.23.7)(react@18.2.0) + optionalDependencies: + '@next/swc-darwin-arm64': 14.1.4 + '@next/swc-darwin-x64': 14.1.4 + '@next/swc-linux-arm64-gnu': 14.1.4 + '@next/swc-linux-arm64-musl': 14.1.4 + '@next/swc-linux-x64-gnu': 14.1.4 + '@next/swc-linux-x64-musl': 14.1.4 + '@next/swc-win32-arm64-msvc': 14.1.4 + '@next/swc-win32-ia32-msvc': 14.1.4 + '@next/swc-win32-x64-msvc': 14.1.4 + transitivePeerDependencies: + - '@babel/core' + - babel-plugin-macros + dev: false + /no-case@3.0.4: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} dependencies: From 695dd8e6f89acc902cf0e6abe2f97892dcf985dd Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Wed, 10 Apr 2024 22:35:52 +0200 Subject: [PATCH 22/51] chore: manually fix merge conflicts --- apps/website/package.json | 4 + pnpm-lock.yaml | 548 +++++++++++++++++++++++++++++++++++--- 2 files changed, 514 insertions(+), 38 deletions(-) diff --git a/apps/website/package.json b/apps/website/package.json index 284072ca7..3d352095a 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -15,6 +15,10 @@ "@custom/decap": "workspace:*", "@custom/schema": "workspace:*", "@custom/ui": "workspace:*", + "@gatsbyjs/reach-router": "^2.0.1", + "@netlify/plugin-nextjs": "^5.0.0", + "babel-loader": "^9.1.3", + "body-parser": "^1.20.2", "gatsby": "^5.13.1", "gatsby-plugin-layout": "^4.13.0", "gatsby-plugin-manifest": "^5.13.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8aca358f2..c38a6ec16 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -53,6 +53,12 @@ importers: husky: specifier: ^8.0.3 version: 8.0.3 + node-addon-api: + specifier: ^7.1.0 + version: 7.1.0 + node-gyp: + specifier: ^10.0.1 + version: 10.0.1 prettier: specifier: ^3.1.1 version: 3.1.1 @@ -225,6 +231,18 @@ importers: '@custom/ui': specifier: workspace:* version: link:../../packages/ui + '@gatsbyjs/reach-router': + specifier: ^2.0.1 + version: 2.0.1(react-dom@18.2.0)(react@18.2.0) + '@netlify/plugin-nextjs': + specifier: ^5.0.0 + version: 5.0.0 + babel-loader: + specifier: ^9.1.3 + version: 9.1.3(@babel/core@7.24.4)(webpack@5.91.0) + body-parser: + specifier: ^1.20.2 + version: 1.20.2 gatsby: specifier: ^5.13.1 version: 5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) @@ -261,9 +279,21 @@ importers: mime-types: specifier: ^2.1.35 version: 2.1.35 + multer: + specifier: 1.4.5-lts.1 + version: 1.4.5-lts.1 netlify-cli: specifier: ^17.21.1 version: 17.21.1(@types/node@18.19.31) + next: + specifier: ^14.1.4 + version: 14.1.4(@babel/core@7.24.4)(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) + next-auth: + specifier: ^4.24.7 + version: 4.24.7(next@14.1.4)(react-dom@18.2.0)(react@18.2.0) + plugin-nextjs:^4.41.3: + specifier: link:@netlify/plugin-nextjs:^4.41.3 + version: link:@netlify/plugin-nextjs:^4.41.3 react: specifier: ^18.2.0 version: 18.2.0 @@ -6308,6 +6338,11 @@ packages: '@opentelemetry/api': 1.8.0 dev: false + /@netlify/plugin-nextjs@5.0.0: + resolution: {integrity: sha512-LAeQ6ltXsJyxtk2wDwb75Pu80A+duQvEtDB9Y3xJ16+mb2bQXv5sV9Y6dCdyTCBQjw1h0UGv1bL3vPDLG6Wlcw==} + engines: {node: '>=18.0.0'} + dev: false + /@netlify/plugins-list@6.77.0: resolution: {integrity: sha512-czL3FH61hFhhVQydRj2xjIwLVYHDNskMhRib7dUfOQrUHifqLlUFKp03NwBD87G9BFKXUYGWZMEUU+JjIpVc9w==} engines: {node: ^14.14.0 || >=16.0.0} @@ -6464,6 +6499,91 @@ packages: - supports-color dev: false + /@next/env@14.1.4: + resolution: {integrity: sha512-e7X7bbn3Z6DWnDi75UWn+REgAbLEqxI8Tq2pkFOFAMpWAWApz/YCUhtWMWn410h8Q2fYiYL7Yg5OlxMOCfFjJQ==} + dev: false + + /@next/swc-darwin-arm64@14.1.4: + resolution: {integrity: sha512-ubmUkbmW65nIAOmoxT1IROZdmmJMmdYvXIe8211send9ZYJu+SqxSnJM4TrPj9wmL6g9Atvj0S/2cFmMSS99jg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@next/swc-darwin-x64@14.1.4: + resolution: {integrity: sha512-b0Xo1ELj3u7IkZWAKcJPJEhBop117U78l70nfoQGo4xUSvv0PJSTaV4U9xQBLvZlnjsYkc8RwQN1HoH/oQmLlQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm64-gnu@14.1.4: + resolution: {integrity: sha512-457G0hcLrdYA/u1O2XkRMsDKId5VKe3uKPvrKVOyuARa6nXrdhJOOYU9hkKKyQTMru1B8qEP78IAhf/1XnVqKA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm64-musl@14.1.4: + resolution: {integrity: sha512-l/kMG+z6MB+fKA9KdtyprkTQ1ihlJcBh66cf0HvqGP+rXBbOXX0dpJatjZbHeunvEHoBBS69GYQG5ry78JMy3g==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-x64-gnu@14.1.4: + resolution: {integrity: sha512-BapIFZ3ZRnvQ1uWbmqEGJuPT9cgLwvKtxhK/L2t4QYO7l+/DxXuIGjvp1x8rvfa/x1FFSsipERZK70pewbtJtw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-x64-musl@14.1.4: + resolution: {integrity: sha512-mqVxTwk4XuBl49qn2A5UmzFImoL1iLm0KQQwtdRJRKl21ylQwwGCxJtIYo2rbfkZHoSKlh/YgztY0qH3wG1xIg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-arm64-msvc@14.1.4: + resolution: {integrity: sha512-xzxF4ErcumXjO2Pvg/wVGrtr9QQJLk3IyQX1ddAC/fi6/5jZCZ9xpuL9Tzc4KPWMFq8GGWFVDMshZOdHGdkvag==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-ia32-msvc@14.1.4: + resolution: {integrity: sha512-WZiz8OdbkpRw6/IU/lredZWKKZopUMhcI2F+XiMAcPja0uZYdMTZQRoQ0WZcvinn9xZAidimE7tN9W5v9Yyfyw==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-x64-msvc@14.1.4: + resolution: {integrity: sha512-4Rto21sPfw555sZ/XNLqfxDUNeLhNYGO2dlPqsnuCg8N8a2a9u1ltqBOPQ4vj1Gf7eJC0W2hHG2eYUHuiXgY2w==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: false + optional: true + /@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1: resolution: {integrity: sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==} dependencies: @@ -6487,6 +6607,19 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 + /@npmcli/agent@2.2.2: + resolution: {integrity: sha512-OrcNPXdpSl9UX7qPVRWbmWMCSXrcDa2M9DvrbOTj7ao1S4PlqVFYv9/yLKMkrJKZ/V5A/kDBC690or307i26Og==} + engines: {node: ^16.14.0 || >=18.0.0} + dependencies: + agent-base: 7.1.1 + http-proxy-agent: 7.0.2 + https-proxy-agent: 7.0.4 + lru-cache: 10.2.0 + socks-proxy-agent: 8.0.3 + transitivePeerDependencies: + - supports-color + dev: true + /@npmcli/fs@1.1.1: resolution: {integrity: sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==} requiresBuild: true @@ -6496,6 +6629,13 @@ packages: dev: false optional: true + /@npmcli/fs@3.1.0: + resolution: {integrity: sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + semver: 7.6.0 + dev: true + /@npmcli/move-file@1.1.2: resolution: {integrity: sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==} engines: {node: '>=10'} @@ -6636,6 +6776,10 @@ packages: engines: {node: '>=8.0.0'} dev: false + /@panva/hkdf@1.1.1: + resolution: {integrity: sha512-dhPeilub1NuIG0X5Kvhh9lH4iW3ZsHlnzwgwbOlgwQ2wG1IqFzsgHqmKPk3WzsdWAeaxKJxgM0+W433RmN45GA==} + dev: false + /@parcel/bundler-default@2.8.3(@parcel/core@2.8.3): resolution: {integrity: sha512-yJvRsNWWu5fVydsWk3O2L4yIy3UZiKWO2cPDukGOIWMgp/Vbpp+2Ct5IygVRtE22bnseW/E/oe0PV3d2IkEJGg==} engines: {node: '>= 12.0.0', parcel: ^2.8.3} @@ -7147,7 +7291,7 @@ packages: react-refresh: 0.14.0 schema-utils: 3.3.0 source-map: 0.7.4 - webpack: 5.91.0(esbuild@0.19.12) + webpack: 5.91.0 /@pnpm/config.env-replace@1.1.0: resolution: {integrity: sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==} @@ -9191,6 +9335,12 @@ packages: legacy-swc-helpers: /@swc/helpers@0.4.14 tslib: 2.6.2 + /@swc/helpers@0.5.2: + resolution: {integrity: sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==} + dependencies: + tslib: 2.6.2 + dev: false + /@swc/jest@0.2.36(@swc/core@1.3.102): resolution: {integrity: sha512-8X80dp81ugxs4a11z1ka43FPhP+/e+mJNXJSxiNYk8gIX/jPBtY4gQTrKu/KIoco8bzKuPI5lUxjfLiGsfvnlw==} engines: {npm: '>= 7.0.0'} @@ -11608,6 +11758,11 @@ packages: requiresBuild: true dev: false + /abbrev@2.0.0: + resolution: {integrity: sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dev: true + /abort-controller@3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} engines: {node: '>=6.5'} @@ -12524,7 +12679,20 @@ packages: loader-utils: 2.0.4 make-dir: 3.1.0 schema-utils: 2.7.1 - webpack: 5.91.0(esbuild@0.19.12) + webpack: 5.91.0 + + /babel-loader@9.1.3(@babel/core@7.24.4)(webpack@5.91.0): + resolution: {integrity: sha512-xG3ST4DglodGf8qSwv0MdeWLhrDsw/32QMdTO5T1ZIp9gQur0HkCyFs7Awskr10JKXFXwpAhiCuYX5oGXnRGbw==} + engines: {node: '>= 14.15.0'} + peerDependencies: + '@babel/core': ^7.12.0 + webpack: '>=5' + dependencies: + '@babel/core': 7.24.4 + find-cache-dir: 4.0.0 + schema-utils: 4.2.0 + webpack: 5.91.0 + dev: false /babel-plugin-add-module-exports@1.0.4: resolution: {integrity: sha512-g+8yxHUZ60RcyaUpfNzy56OtWW+x9cyEe9j+CranqLiqbju2yf/Cy6ZtYK40EZxtrdHllzlVZgLmcOUCTlJ7Jg==} @@ -13131,6 +13299,24 @@ packages: dev: false optional: true + /cacache@18.0.2: + resolution: {integrity: sha512-r3NU8h/P+4lVUHfeRw1dtgQYar3DZMm4/cm2bZgOvrFC/su7budSOeqh52VJIC4U4iG1WWwV6vRW0znqBvxNuw==} + engines: {node: ^16.14.0 || >=18.0.0} + dependencies: + '@npmcli/fs': 3.1.0 + fs-minipass: 3.0.3 + glob: 10.3.12 + lru-cache: 10.2.0 + minipass: 7.0.4 + minipass-collect: 2.0.1 + minipass-flush: 1.0.5 + minipass-pipeline: 1.2.4 + p-map: 4.0.0 + ssri: 10.0.5 + tar: 6.2.1 + unique-filename: 3.0.0 + dev: true + /cache-base@1.0.1: resolution: {integrity: sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==} engines: {node: '>=0.10.0'} @@ -14417,7 +14603,7 @@ packages: postcss-value-parser: 4.2.0 schema-utils: 3.3.0 semver: 7.6.0 - webpack: 5.91.0(esbuild@0.19.12) + webpack: 5.91.0 /css-minimizer-webpack-plugin@2.0.0(webpack@5.91.0): resolution: {integrity: sha512-cG/uc94727tx5pBNtb1Sd7gvUPzwmcQi1lkpfqTpdkuNq75hJCw7bIVsCNijLm4dhDcr1atvuysl2rZqOG8Txw==} @@ -14439,7 +14625,7 @@ packages: schema-utils: 3.3.0 serialize-javascript: 5.0.1 source-map: 0.6.1 - webpack: 5.91.0(esbuild@0.19.12) + webpack: 5.91.0 /css-select@4.3.0: resolution: {integrity: sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==} @@ -16175,6 +16361,7 @@ packages: /encoding@0.1.13: resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==} + requiresBuild: true dependencies: iconv-lite: 0.6.3 @@ -16248,8 +16435,6 @@ packages: resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} engines: {node: '>=6'} requiresBuild: true - dev: false - optional: true /env-paths@3.0.0: resolution: {integrity: sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==} @@ -16277,8 +16462,6 @@ packages: /err-code@2.0.3: resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==} requiresBuild: true - dev: false - optional: true /error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} @@ -16772,6 +16955,34 @@ packages: transitivePeerDependencies: - supports-color + /eslint-module-utils@2.8.1(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.9)(eslint@7.32.0): + resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: '*' + eslint-import-resolver-node: '*' + eslint-import-resolver-typescript: '*' + eslint-import-resolver-webpack: '*' + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + eslint: + optional: true + eslint-import-resolver-node: + optional: true + eslint-import-resolver-typescript: + optional: true + eslint-import-resolver-webpack: + optional: true + dependencies: + '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@4.9.5) + debug: 3.2.7 + eslint: 7.32.0 + eslint-import-resolver-node: 0.3.9 + transitivePeerDependencies: + - supports-color + /eslint-module-utils@2.8.1(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-node@0.3.9)(eslint@7.0.0): resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==} engines: {node: '>=4'} @@ -16871,7 +17082,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@5.3.3) + '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@4.9.5) array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 array.prototype.flat: 1.3.2 @@ -16880,7 +17091,7 @@ packages: doctrine: 2.1.0 eslint: 7.32.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-node@0.3.9)(eslint@7.32.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.9)(eslint@7.32.0) hasown: 2.0.2 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -17175,7 +17386,7 @@ packages: micromatch: 4.0.5 normalize-path: 3.0.0 schema-utils: 3.3.0 - webpack: 5.91.0(esbuild@0.19.12) + webpack: 5.91.0 /eslint@7.0.0: resolution: {integrity: sha512-qY1cwdOxMONHJfGqw52UOpZDeqXy8xmD0u8CT6jIstil72jkhURC704W8CFyTPDPllz4z4lu0Ql1+07PG/XdIg==} @@ -17486,6 +17697,10 @@ packages: jest-util: 29.7.0 dev: true + /exponential-backoff@3.1.1: + resolution: {integrity: sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==} + dev: true + /express-basic-auth@1.2.1: resolution: {integrity: sha512-L6YQ1wQ/mNjVLAmK3AG1RK6VkokA1BIY6wmiH304Xtt/cLTps40EusZsU1Uop+v9lTDPxdtzbFmdXfFO3KEnwA==} dependencies: @@ -17979,7 +18194,7 @@ packages: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.91.0(esbuild@0.19.12) + webpack: 5.91.0 /file-system-cache@2.3.0: resolution: {integrity: sha512-l4DMNdsIPsVnKrgEXbJwDJsA5mB8rGwHYERMgqQx/xAUtChPJMre1bXBzDEqqVbWv9AIbFezXMxeEkZDSrXUOQ==} @@ -18114,6 +18329,14 @@ packages: make-dir: 3.1.0 pkg-dir: 4.2.0 + /find-cache-dir@4.0.0: + resolution: {integrity: sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg==} + engines: {node: '>=14.16'} + dependencies: + common-path-prefix: 3.0.0 + pkg-dir: 7.0.0 + dev: false + /find-file-up@0.1.3: resolution: {integrity: sha512-mBxmNbVyjg1LQIIpgO8hN+ybWBgDQK8qjht+EbrTCGmmPV/sc7RF1i9stPTD6bpvXZywBdrwRYxhSdJv867L6A==} engines: {node: '>=0.10.0'} @@ -18477,6 +18700,13 @@ packages: dependencies: minipass: 3.3.6 + /fs-minipass@3.0.3: + resolution: {integrity: sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + minipass: 7.0.4 + dev: true + /fs-monkey@1.0.5: resolution: {integrity: sha512-8uMbBjrhzW76TYgEV27Y5E//W2f/lTFmx78P2w19FZSxarhI/798APGQyuGCwmkNxgwGRhrLfvWyLBvNtuOmew==} @@ -21262,8 +21492,6 @@ packages: dependencies: jsbn: 1.1.0 sprintf-js: 1.1.3 - dev: false - optional: true /ip-regex@4.3.0: resolution: {integrity: sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==} @@ -21601,8 +21829,6 @@ packages: /is-lambda@1.0.1: resolution: {integrity: sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==} requiresBuild: true - dev: false - optional: true /is-lower-case@2.0.2: resolution: {integrity: sha512-bVcMJy4X5Og6VZfdOZstSexlEy20Sr0k/p/b2IlQJlfdKAQuMpiv5w2Ccxb8sKdRUNAG1PnHVHjFSdRDVS6NlQ==} @@ -21898,6 +22124,11 @@ packages: /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + /isexe@3.1.1: + resolution: {integrity: sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==} + engines: {node: '>=16'} + dev: true + /isobject@2.1.0: resolution: {integrity: sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==} engines: {node: '>=0.10.0'} @@ -22587,6 +22818,10 @@ packages: '@sideway/formula': 3.0.1 '@sideway/pinpoint': 2.0.0 + /jose@4.15.5: + resolution: {integrity: sha512-jc7BFxgKPKi94uOvEmzlSWFFe2+vASyXaKUpdQKatWAESU2MWjDfFf0fdfc83CDKcA5QecabZeNLyfhe3yKNkg==} + dev: false + /jose@5.2.4: resolution: {integrity: sha512-6ScbIk2WWCeXkmzF6bRPmEuaqy1m8SbsRFMa/FLrSCkGIhj8OLVG/IH+XHVmNMx/KUo8cVWEE6oKR4dJ+S0Rkg==} dev: true @@ -22626,8 +22861,6 @@ packages: /jsbn@1.1.0: resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==} requiresBuild: true - dev: false - optional: true /jscodeshift@0.15.2(@babel/preset-env@7.24.4): resolution: {integrity: sha512-FquR7Okgmc4Sd0aEDwqho3rEiKR3BdvuG9jfdHjLJ6JQoWSMpavug3AoIfnfWhxFlf+5pzQh8qjqz0DWFrNQzA==} @@ -23417,6 +23650,25 @@ packages: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} dev: false + /make-fetch-happen@13.0.0: + resolution: {integrity: sha512-7ThobcL8brtGo9CavByQrQi+23aIfgYU++wg4B87AIS8Rb2ZBt/MEaDqzA00Xwv/jUjAjYkLHjVolYuTLKda2A==} + engines: {node: ^16.14.0 || >=18.0.0} + dependencies: + '@npmcli/agent': 2.2.2 + cacache: 18.0.2 + http-cache-semantics: 4.1.1 + is-lambda: 1.0.1 + minipass: 7.0.4 + minipass-fetch: 3.0.4 + minipass-flush: 1.0.5 + minipass-pipeline: 1.2.4 + negotiator: 0.6.3 + promise-retry: 2.0.1 + ssri: 10.0.5 + transitivePeerDependencies: + - supports-color + dev: true + /make-fetch-happen@9.1.0: resolution: {integrity: sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==} engines: {node: '>= 10'} @@ -24269,7 +24521,7 @@ packages: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.91.0(esbuild@0.19.12) + webpack: 5.91.0 webpack-sources: 1.4.3 /mini-svg-data-uri@1.4.4: @@ -24326,6 +24578,13 @@ packages: dev: false optional: true + /minipass-collect@2.0.1: + resolution: {integrity: sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + minipass: 7.0.4 + dev: true + /minipass-fetch@1.4.1: resolution: {integrity: sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==} engines: {node: '>=8'} @@ -24339,14 +24598,23 @@ packages: dev: false optional: true + /minipass-fetch@3.0.4: + resolution: {integrity: sha512-jHAqnA728uUpIaFm7NWsCnqKT6UqZz7GcI/bDpPATuwYyKwJwW0remxSCxUlKiEty+eopHGa3oc8WxgQ1FFJqg==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + minipass: 7.0.4 + minipass-sized: 1.0.3 + minizlib: 2.1.2 + optionalDependencies: + encoding: 0.1.13 + dev: true + /minipass-flush@1.0.5: resolution: {integrity: sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==} engines: {node: '>= 8'} requiresBuild: true dependencies: minipass: 3.3.6 - dev: false - optional: true /minipass-pipeline@1.2.4: resolution: {integrity: sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==} @@ -24354,8 +24622,6 @@ packages: requiresBuild: true dependencies: minipass: 3.3.6 - dev: false - optional: true /minipass-sized@1.0.3: resolution: {integrity: sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==} @@ -24363,8 +24629,6 @@ packages: requiresBuild: true dependencies: minipass: 3.3.6 - dev: false - optional: true /minipass@3.3.6: resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} @@ -24817,9 +25081,74 @@ packages: qs: 6.12.0 dev: false + /next-auth@4.24.7(next@14.1.4)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-iChjE8ov/1K/z98gdKbn2Jw+2vLgJtVV39X+rCP5SGnVQuco7QOr19FRNGMIrD8d3LYhHWV9j9sKLzq1aDWWQQ==} + peerDependencies: + next: ^12.2.5 || ^13 || ^14 + nodemailer: ^6.6.5 + react: ^17.0.2 || ^18 + react-dom: ^17.0.2 || ^18 + peerDependenciesMeta: + nodemailer: + optional: true + dependencies: + '@babel/runtime': 7.24.4 + '@panva/hkdf': 1.1.1 + cookie: 0.5.0 + jose: 4.15.5 + next: 14.1.4(@babel/core@7.24.4)(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) + oauth: 0.9.15 + openid-client: 5.6.5 + preact: 10.20.2 + preact-render-to-string: 5.2.6(preact@10.20.2) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + uuid: 8.3.2 + dev: false + /next-tick@1.1.0: resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} + /next@14.1.4(@babel/core@7.24.4)(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-1WTaXeSrUwlz/XcnhGTY7+8eiaFvdet5z9u3V2jb+Ek1vFo0VhHKSAIJvDWfQpttWjnyw14kBeq28TPq7bTeEQ==} + engines: {node: '>=18.17.0'} + hasBin: true + peerDependencies: + '@opentelemetry/api': ^1.1.0 + react: ^18.2.0 + react-dom: ^18.2.0 + sass: ^1.3.0 + peerDependenciesMeta: + '@opentelemetry/api': + optional: true + sass: + optional: true + dependencies: + '@next/env': 14.1.4 + '@opentelemetry/api': 1.8.0 + '@swc/helpers': 0.5.2 + busboy: 1.6.0 + caniuse-lite: 1.0.30001608 + graceful-fs: 4.2.11 + postcss: 8.4.31 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + styled-jsx: 5.1.1(@babel/core@7.24.4)(react@18.2.0) + optionalDependencies: + '@next/swc-darwin-arm64': 14.1.4 + '@next/swc-darwin-x64': 14.1.4 + '@next/swc-linux-arm64-gnu': 14.1.4 + '@next/swc-linux-arm64-musl': 14.1.4 + '@next/swc-linux-x64-gnu': 14.1.4 + '@next/swc-linux-x64-musl': 14.1.4 + '@next/swc-win32-arm64-msvc': 14.1.4 + '@next/swc-win32-ia32-msvc': 14.1.4 + '@next/swc-win32-x64-msvc': 14.1.4 + transitivePeerDependencies: + - '@babel/core' + - babel-plugin-macros + dev: false + /no-case@3.0.4: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} dependencies: @@ -24907,6 +25236,25 @@ packages: hasBin: true dev: false + /node-gyp@10.0.1: + resolution: {integrity: sha512-gg3/bHehQfZivQVfqIyy8wTdSymF9yTyP4CJifK73imyNMU8AIGQE2pUa7dNWfmMeG9cDVF2eehiRMv0LC1iAg==} + engines: {node: ^16.14.0 || >=18.0.0} + hasBin: true + dependencies: + env-paths: 2.2.1 + exponential-backoff: 3.1.1 + glob: 10.3.12 + graceful-fs: 4.2.11 + make-fetch-happen: 13.0.0 + nopt: 7.2.0 + proc-log: 3.0.0 + semver: 7.6.0 + tar: 6.2.1 + which: 4.0.0 + transitivePeerDependencies: + - supports-color + dev: true + /node-gyp@8.4.1: resolution: {integrity: sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==} engines: {node: '>= 10.12.0'} @@ -25002,6 +25350,14 @@ packages: abbrev: 1.1.1 dev: false + /nopt@7.2.0: + resolution: {integrity: sha512-CVDtwCdhYIvnAzFoJ6NJ6dX3oga9/HyciQDnG1vQDjSLMeKLJ4A93ZqYKDrgYSr1FBY5/hMYC+2VCi24pgpkGA==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + hasBin: true + dependencies: + abbrev: 2.0.0 + dev: true + /normalize-node-version@12.4.0: resolution: {integrity: sha512-0oLZN5xcyKVrSHMk8/9RuNblEe7HEsXAt5Te2xmMiZD9VX7bqWYe0HMyfqSYFD3xv0949lZuXaEwjTqle1uWWQ==} engines: {node: '>=14.18.0'} @@ -25121,7 +25477,7 @@ packages: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.91.0(esbuild@0.19.12) + webpack: 5.91.0 /nullthrows@1.1.1: resolution: {integrity: sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw==} @@ -25174,6 +25530,10 @@ packages: ufo: 1.5.3 dev: true + /oauth@0.9.15: + resolution: {integrity: sha512-a5ERWK1kh38ExDEfoO6qUHJb32rd7aYmPHuyCu3Fta/cnICvYmgd2uhuKXvPD+PXB+gCEYYEaQdIRAjCOwAKNA==} + dev: false + /object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -25187,6 +25547,11 @@ packages: kind-of: 3.2.2 dev: false + /object-hash@2.2.0: + resolution: {integrity: sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==} + engines: {node: '>= 6'} + dev: false + /object-hash@3.0.0: resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==} engines: {node: '>= 6'} @@ -25281,6 +25646,11 @@ packages: /ohash@1.1.3: resolution: {integrity: sha512-zuHHiGTYTA1sYJ/wZN+t5HKZaH23i4yI1HMwbuXm24Nid7Dv0KcuRlKoNKS9UNfAVSBlnGLcuQrnOKWOZoEGaw==} + /oidc-token-hash@5.0.3: + resolution: {integrity: sha512-IF4PcGgzAr6XXSff26Sk/+P4KZFJVuHAJZj3wgO3vX2bMdNVp/QXTP3P7CEm9V1IdG8lDLY3HhiqpsE/nOwpPw==} + engines: {node: ^10.13.0 || >=12.0.0} + dev: false + /ol-mapbox-style@8.2.1: resolution: {integrity: sha512-3kBBuZC627vDL8vnUdfVbCbfkhkcZj2kXPHQcuLhC4JJEA+XkEVEtEde8x8+AZctRbHwBkSiubTPaRukgLxIRw==} dependencies: @@ -25367,6 +25737,15 @@ packages: is-docker: 2.2.1 is-wsl: 2.2.0 + /openid-client@5.6.5: + resolution: {integrity: sha512-5P4qO9nGJzB5PI0LFlhj4Dzg3m4odt0qsJTfyEtZyOlkgpILwEioOhVVJOrS1iVH494S4Ee5OCjjg6Bf5WOj3w==} + dependencies: + jose: 4.15.5 + lru-cache: 6.0.0 + object-hash: 2.2.0 + oidc-token-hash: 5.0.3 + dev: false + /opentracing@0.14.7: resolution: {integrity: sha512-vz9iS7MJ5+Bp1URw8Khvdyw1H/hGvzHWlKQ7eRrQojSCDL1/SrWfrY9QebLw97n2deyRtzHRC3MkQfVNUCo91Q==} engines: {node: '>=0.10'} @@ -26376,7 +26755,7 @@ packages: klona: 2.0.6 postcss: 8.4.38 semver: 7.6.0 - webpack: 5.91.0(esbuild@0.19.12) + webpack: 5.91.0 /postcss-merge-longhand@5.1.7(postcss@8.4.38): resolution: {integrity: sha512-YCI9gZB+PLNskrK0BB3/2OzPnGhPkBEwmwhfYk1ilBHYVAZB7/tkTHFBAnCrvBBOmeYyMYw3DMjT55SyxMBzjQ==} @@ -26888,6 +27267,15 @@ packages: quote-unquote: 1.0.0 dev: false + /postcss@8.4.31: + resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.7 + picocolors: 1.0.0 + source-map-js: 1.2.0 + dev: false + /postcss@8.4.32: resolution: {integrity: sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==} engines: {node: ^10 || ^12 || >=14} @@ -26905,6 +27293,19 @@ packages: picocolors: 1.0.0 source-map-js: 1.2.0 + /preact-render-to-string@5.2.6(preact@10.20.2): + resolution: {integrity: sha512-JyhErpYOvBV1hEPwIxc/fHWXPfnEGdRKxc8gFdAZ7XV4tlzyzG847XAyEZqoDnynP88akM4eaHcSOzNcLWFguw==} + peerDependencies: + preact: '>=10' + dependencies: + preact: 10.20.2 + pretty-format: 3.8.0 + dev: false + + /preact@10.20.2: + resolution: {integrity: sha512-S1d1ernz3KQ+Y2awUxKakpfOg2CEmJmwOP+6igPx6dgr6pgDvenqYviyokWso2rhHvGtTlWWnJDa7RaPbQerTg==} + dev: false + /prebuild-install@7.1.2: resolution: {integrity: sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==} engines: {node: '>=10'} @@ -27022,6 +27423,10 @@ packages: ansi-styles: 5.2.0 react-is: 18.2.0 + /pretty-format@3.8.0: + resolution: {integrity: sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==} + dev: false + /pretty-hrtime@1.0.3: resolution: {integrity: sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==} engines: {node: '>= 0.8'} @@ -27052,6 +27457,11 @@ packages: - supports-color dev: false + /proc-log@3.0.0: + resolution: {integrity: sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dev: true + /process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} @@ -27096,8 +27506,6 @@ packages: dependencies: err-code: 2.0.3 retry: 0.12.0 - dev: false - optional: true /promise@7.3.1: resolution: {integrity: sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==} @@ -27371,7 +27779,7 @@ packages: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.91.0(esbuild@0.19.12) + webpack: 5.91.0 /rbush@3.0.1: resolution: {integrity: sha512-XRaVO0YecOpEuIvbhbpTrZgoiI6xBlz6hnlr6EHhd+0x9ase6EmeN+hdwwUaJvLcsFFQ8iWVF1GAK1yB0BWi0w==} @@ -27936,7 +28344,7 @@ packages: loose-envify: 1.4.0 neo-async: 2.6.2 react: 18.2.0 - webpack: 5.91.0(esbuild@0.19.12) + webpack: 5.91.0 /react-split-pane@0.1.92(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-GfXP1xSzLMcLJI5BM36Vh7GgZBpy+U/X0no+VM3fxayv+p1Jly5HpMofZJraeaMl73b3hvlr+N9zJKvLB/uz9w==} @@ -29004,6 +29412,16 @@ packages: ajv: 6.12.6 ajv-keywords: 3.5.2(ajv@6.12.6) + /schema-utils@4.2.0: + resolution: {integrity: sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==} + engines: {node: '>= 12.13.0'} + dependencies: + '@types/json-schema': 7.0.15 + ajv: 8.12.0 + ajv-formats: 2.1.1(ajv@8.12.0) + ajv-keywords: 5.1.0(ajv@8.12.0) + dev: false + /scroll-into-view-if-needed@2.2.31: resolution: {integrity: sha512-dGCXy99wZQivjmjIqihaBQNjryrz5rueJY7eHfTdyWEiR4ttYpsajb14rn9s5d4DY4EcY6+4+U/maARBXJedkA==} dependencies: @@ -29557,8 +29975,6 @@ packages: resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} requiresBuild: true - dev: false - optional: true /snake-case@3.0.4: resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==} @@ -29659,6 +30075,17 @@ packages: dev: false optional: true + /socks-proxy-agent@8.0.3: + resolution: {integrity: sha512-VNegTZKhuGq5vSD6XNKlbqWhyt/40CgoEw8XxD6dhnm8Jq9IEa3nIa4HwnM8XOqU0CdB0BwWVXusqiFXfHB3+A==} + engines: {node: '>= 14'} + dependencies: + agent-base: 7.1.1 + debug: 4.3.4 + socks: 2.8.3 + transitivePeerDependencies: + - supports-color + dev: true + /socks@2.8.3: resolution: {integrity: sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==} engines: {node: '>= 10.0.0', npm: '>= 3.0.0'} @@ -29666,8 +30093,6 @@ packages: dependencies: ip-address: 9.0.5 smart-buffer: 4.2.0 - dev: false - optional: true /sonic-boom@3.8.1: resolution: {integrity: sha512-y4Z8LCDBuum+PBP3lSV7RHrXscqksve/bi0as7mhwVnBW+/wUqKT/2Kb7um8yqcFy0duYbbPxzt89Zy2nOCaxg==} @@ -29883,6 +30308,13 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: true + /ssri@10.0.5: + resolution: {integrity: sha512-bSf16tAFkGeRlUNDjXu8FzaMQt6g2HZJrun7mtMbIPOddxt3GLMSz5VWUWcqTJUPfLEaDIepGxv+bYQW49596A==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + minipass: 7.0.4 + dev: true + /ssri@8.0.1: resolution: {integrity: sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==} engines: {node: '>= 8'} @@ -30290,7 +30722,7 @@ packages: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.91.0(esbuild@0.19.12) + webpack: 5.91.0 /style-to-object@0.3.0: resolution: {integrity: sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA==} @@ -30303,6 +30735,24 @@ packages: dependencies: inline-style-parser: 0.1.1 + /styled-jsx@5.1.1(@babel/core@7.24.4)(react@18.2.0): + resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==} + engines: {node: '>= 12.0.0'} + peerDependencies: + '@babel/core': '*' + babel-plugin-macros: '*' + react: '>= 16.8.0 || 17.x.x || ^18.0.0-0' + peerDependenciesMeta: + '@babel/core': + optional: true + babel-plugin-macros: + optional: true + dependencies: + '@babel/core': 7.24.4 + client-only: 0.0.1 + react: 18.2.0 + dev: false + /stylehacks@5.1.1(postcss@8.4.38): resolution: {integrity: sha512-sBpcd5Hx7G6seo7b1LkpttvTz7ikD0LlH5RmdcBNb6fFR0Fl7LQwHDFr300q4cwUqi+IYrFGmsIHieMBfnN/Bw==} engines: {node: ^10 || ^12 || >=14.0} @@ -31517,6 +31967,13 @@ packages: dev: false optional: true + /unique-filename@3.0.0: + resolution: {integrity: sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + unique-slug: 4.0.0 + dev: true + /unique-slug@2.0.2: resolution: {integrity: sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==} requiresBuild: true @@ -31525,6 +31982,13 @@ packages: dev: false optional: true + /unique-slug@4.0.0: + resolution: {integrity: sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + imurmurhash: 0.1.4 + dev: true + /unique-string@2.0.0: resolution: {integrity: sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==} engines: {node: '>=8'} @@ -31846,7 +32310,7 @@ packages: loader-utils: 2.0.4 mime-types: 2.1.35 schema-utils: 3.3.0 - webpack: 5.91.0(esbuild@0.19.12) + webpack: 5.91.0 /url@0.11.3: resolution: {integrity: sha512-6hxOLGfZASQK/cijlZnZJTq8OXAkt/3YGfQX45vvMYXpZoo8NdWZcY73K108Jf759lS1Bv/8wXnHDTSz17dSRw==} @@ -32817,7 +33281,7 @@ packages: mime-types: 2.1.35 range-parser: 1.2.1 schema-utils: 3.3.0 - webpack: 5.91.0(esbuild@0.19.12) + webpack: 5.91.0 /webpack-merge@5.10.0: resolution: {integrity: sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==} @@ -33083,6 +33547,14 @@ packages: dependencies: isexe: 2.0.0 + /which@4.0.0: + resolution: {integrity: sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==} + engines: {node: ^16.13.0 || >=18.0.0} + hasBin: true + dependencies: + isexe: 3.1.1 + dev: true + /why-is-node-running@2.2.2: resolution: {integrity: sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==} engines: {node: '>=8'} From 77d6e18c61f86768e9b13fa4d87f6dbd7c174baf Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Thu, 11 Apr 2024 08:47:20 +0200 Subject: [PATCH 23/51] chore(gastby-oauth): update pnpm lock --- pnpm-lock.yaml | 202 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 179 insertions(+), 23 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c38a6ec16..46eeaae26 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -492,6 +492,9 @@ importers: hast-util-select: specifier: ^5.0.5 version: 5.0.5 + next-auth: + specifier: ^4.24.7 + version: 4.24.7(next@14.1.4)(react-dom@18.2.0)(react@18.2.0) query-string: specifier: ^9.0.0 version: 9.0.0 @@ -520,6 +523,9 @@ importers: '@amazeelabs/cloudinary-responsive-image': specifier: ^1.6.15 version: 1.6.15 + '@faker-js/faker': + specifier: ^8.4.1 + version: 8.4.1 '@formatjs/cli': specifier: ^6.2.4 version: 6.2.4 @@ -3023,6 +3029,7 @@ packages: cpu: [ppc64] os: [aix] requiresBuild: true + dev: true optional: true /@esbuild/aix-ppc64@0.20.0: @@ -3066,6 +3073,7 @@ packages: cpu: [arm64] os: [android] requiresBuild: true + dev: true optional: true /@esbuild/android-arm64@0.20.0: @@ -3109,6 +3117,7 @@ packages: cpu: [arm] os: [android] requiresBuild: true + dev: true optional: true /@esbuild/android-arm@0.20.0: @@ -3152,6 +3161,7 @@ packages: cpu: [x64] os: [android] requiresBuild: true + dev: true optional: true /@esbuild/android-x64@0.20.0: @@ -3195,6 +3205,7 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true + dev: true optional: true /@esbuild/darwin-arm64@0.20.0: @@ -3238,6 +3249,7 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true + dev: true optional: true /@esbuild/darwin-x64@0.20.0: @@ -3281,6 +3293,7 @@ packages: cpu: [arm64] os: [freebsd] requiresBuild: true + dev: true optional: true /@esbuild/freebsd-arm64@0.20.0: @@ -3324,6 +3337,7 @@ packages: cpu: [x64] os: [freebsd] requiresBuild: true + dev: true optional: true /@esbuild/freebsd-x64@0.20.0: @@ -3367,6 +3381,7 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-arm64@0.20.0: @@ -3410,6 +3425,7 @@ packages: cpu: [arm] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-arm@0.20.0: @@ -3453,6 +3469,7 @@ packages: cpu: [ia32] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-ia32@0.20.0: @@ -3496,6 +3513,7 @@ packages: cpu: [loong64] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-loong64@0.20.0: @@ -3539,6 +3557,7 @@ packages: cpu: [mips64el] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-mips64el@0.20.0: @@ -3582,6 +3601,7 @@ packages: cpu: [ppc64] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-ppc64@0.20.0: @@ -3625,6 +3645,7 @@ packages: cpu: [riscv64] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-riscv64@0.20.0: @@ -3668,6 +3689,7 @@ packages: cpu: [s390x] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-s390x@0.20.0: @@ -3711,6 +3733,7 @@ packages: cpu: [x64] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-x64@0.20.0: @@ -3754,6 +3777,7 @@ packages: cpu: [x64] os: [netbsd] requiresBuild: true + dev: true optional: true /@esbuild/netbsd-x64@0.20.0: @@ -3797,6 +3821,7 @@ packages: cpu: [x64] os: [openbsd] requiresBuild: true + dev: true optional: true /@esbuild/openbsd-x64@0.20.0: @@ -3840,6 +3865,7 @@ packages: cpu: [x64] os: [sunos] requiresBuild: true + dev: true optional: true /@esbuild/sunos-x64@0.20.0: @@ -3883,6 +3909,7 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true + dev: true optional: true /@esbuild/win32-arm64@0.20.0: @@ -3926,6 +3953,7 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true + dev: true optional: true /@esbuild/win32-ia32@0.20.0: @@ -3969,6 +3997,7 @@ packages: cpu: [x64] os: [win32] requiresBuild: true + dev: true optional: true /@esbuild/win32-x64@0.20.0: @@ -4027,6 +4056,11 @@ packages: transitivePeerDependencies: - supports-color + /@faker-js/faker@8.4.1: + resolution: {integrity: sha512-XQ3cU+Q8Uqmrbf2e0cIC/QN43sTBSC8KF12u29Mb47tWrt2hAgBXSgpZMj4Ao8Uk0iJcU99QsOCaIL8934obCg==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0, npm: '>=6.14.13'} + dev: true + /@fal-works/esbuild-plugin-global-externals@2.1.2: resolution: {integrity: sha512-cEee/Z+I12mZcFJshKcCqC8tuX5hG3s+d+9nZ3LabqKF1vKdF41B92pJVCBggjAGORAeOzyyDDKrZwIkLffeOQ==} dev: true @@ -10232,6 +10266,7 @@ packages: typescript: 5.3.3 transitivePeerDependencies: - supports-color + dev: true /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@7.32.0)(typescript@5.4.4): resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} @@ -10260,7 +10295,6 @@ packages: transitivePeerDependencies: - supports-color dev: false - optional: true /@typescript-eslint/eslint-plugin@6.17.0(@typescript-eslint/parser@6.17.0)(eslint@7.0.0)(typescript@5.3.3): resolution: {integrity: sha512-Vih/4xLXmY7V490dGwBQJTpIZxH4ZFH6eCVmQ4RFkB+wmaCTDAx4dtgoWwMNGKLkqRY1L6rPqzEbjorRnDo4rQ==} @@ -10376,8 +10410,6 @@ packages: typescript: 5.4.4 transitivePeerDependencies: - supports-color - dev: false - optional: true /@typescript-eslint/parser@6.17.0(eslint@7.0.0)(typescript@5.3.3): resolution: {integrity: sha512-C4bBaX2orvhK+LlwrY8oWGmSl4WolCfYm513gEccdWZj0CwGadbIADb0FtVEcI+WzUyjyoBj2JRP8g25E6IB8A==} @@ -10419,6 +10451,7 @@ packages: typescript: 5.3.3 transitivePeerDependencies: - supports-color + dev: true /@typescript-eslint/scope-manager@5.62.0: resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} @@ -10433,6 +10466,7 @@ packages: dependencies: '@typescript-eslint/types': 6.17.0 '@typescript-eslint/visitor-keys': 6.17.0 + dev: true /@typescript-eslint/scope-manager@6.21.0: resolution: {integrity: sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==} @@ -10479,6 +10513,7 @@ packages: typescript: 5.3.3 transitivePeerDependencies: - supports-color + dev: true /@typescript-eslint/type-utils@5.62.0(eslint@7.32.0)(typescript@5.4.4): resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} @@ -10499,7 +10534,6 @@ packages: transitivePeerDependencies: - supports-color dev: false - optional: true /@typescript-eslint/type-utils@6.17.0(eslint@7.0.0)(typescript@5.3.3): resolution: {integrity: sha512-hDXcWmnbtn4P2B37ka3nil3yi3VCQO2QEB9gBiHJmQp5wmyQWqnjA85+ZcE8c4FqnaB6lBwMrPkgd4aBYz3iNg==} @@ -10548,6 +10582,7 @@ packages: /@typescript-eslint/types@6.17.0: resolution: {integrity: sha512-qRKs9tvc3a4RBcL/9PXtKSehI/q8wuU9xYJxe97WFxnzH8NWWtcW3ffNS+EWg8uPvIerhjsEZ+rHtDqOCiH57A==} engines: {node: ^16.0.0 || >=18.0.0} + dev: true /@typescript-eslint/types@6.21.0: resolution: {integrity: sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==} @@ -10634,7 +10669,6 @@ packages: typescript: 5.4.4 transitivePeerDependencies: - supports-color - dev: false /@typescript-eslint/typescript-estree@6.17.0(typescript@5.3.3): resolution: {integrity: sha512-gVQe+SLdNPfjlJn5VNGhlOhrXz4cajwFd5kAgWtZ9dCZf4XJf8xmgCTLIqec7aha3JwgLI2CK6GY1043FRxZwg==} @@ -10656,6 +10690,7 @@ packages: typescript: 5.3.3 transitivePeerDependencies: - supports-color + dev: true /@typescript-eslint/typescript-estree@6.21.0(typescript@5.3.3): resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==} @@ -10716,6 +10751,7 @@ packages: transitivePeerDependencies: - supports-color - typescript + dev: true /@typescript-eslint/utils@5.62.0(eslint@7.32.0)(typescript@5.4.4): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} @@ -10736,7 +10772,6 @@ packages: - supports-color - typescript dev: false - optional: true /@typescript-eslint/utils@6.17.0(eslint@7.0.0)(typescript@5.3.3): resolution: {integrity: sha512-LofsSPjN/ITNkzV47hxas2JCsNCEnGhVvocfyOcLzT9c/tSZE7SfhS/iWtzP1lKNOEfLhRTZz6xqI8N2RzweSQ==} @@ -10808,6 +10843,7 @@ packages: dependencies: '@typescript-eslint/types': 6.17.0 eslint-visitor-keys: 3.4.3 + dev: true /@typescript-eslint/visitor-keys@6.21.0: resolution: {integrity: sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==} @@ -12798,7 +12834,7 @@ packages: '@babel/core': 7.24.4 '@babel/runtime': 7.24.4 '@babel/types': 7.24.0 - gatsby: 5.13.3(babel-eslint@10.1.0)(esbuild@0.19.12)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3) + gatsby: 5.13.3(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.4.4) gatsby-core-utils: 4.13.1 dev: false @@ -16753,6 +16789,7 @@ packages: '@esbuild/win32-arm64': 0.19.12 '@esbuild/win32-ia32': 0.19.12 '@esbuild/win32-x64': 0.19.12 + dev: true /esbuild@0.20.0: resolution: {integrity: sha512-6iwE3Y2RVYCME1jLpBqq7LQWK3MW6vjV2bZy6gt/WrqkY+WE74Spyc0ThAOYpMtITvnjX09CrC6ym7A/m9mebA==} @@ -16945,6 +16982,44 @@ packages: eslint-plugin-react: 7.34.1(eslint@7.32.0) eslint-plugin-react-hooks: 4.6.0(eslint@7.32.0) typescript: 5.3.3 + dev: true + + /eslint-config-react-app@6.0.0(@typescript-eslint/eslint-plugin@5.62.0)(@typescript-eslint/parser@5.62.0)(babel-eslint@10.1.0)(eslint-plugin-flowtype@5.10.0)(eslint-plugin-import@2.29.1)(eslint-plugin-jsx-a11y@6.8.0)(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.34.1)(eslint@7.32.0)(typescript@5.4.4): + resolution: {integrity: sha512-bpoAAC+YRfzq0dsTk+6v9aHm/uqnDwayNAXleMypGl6CpxI9oXXscVHo4fk3eJPIn+rsbtNetB4r/ZIidFIE8A==} + engines: {node: ^10.12.0 || >=12.0.0} + peerDependencies: + '@typescript-eslint/eslint-plugin': ^4.0.0 + '@typescript-eslint/parser': ^4.0.0 + babel-eslint: ^10.0.0 + eslint: ^7.5.0 + eslint-plugin-flowtype: ^5.2.0 + eslint-plugin-import: ^2.22.0 + eslint-plugin-jest: ^24.0.0 + eslint-plugin-jsx-a11y: ^6.3.1 + eslint-plugin-react: ^7.20.3 + eslint-plugin-react-hooks: ^4.0.8 + eslint-plugin-testing-library: ^3.9.0 + typescript: '*' + peerDependenciesMeta: + eslint-plugin-jest: + optional: true + eslint-plugin-testing-library: + optional: true + typescript: + optional: true + dependencies: + '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@7.32.0)(typescript@5.4.4) + '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@5.4.4) + babel-eslint: 10.1.0(eslint@7.32.0) + confusing-browser-globals: 1.0.11 + eslint: 7.32.0 + eslint-plugin-flowtype: 5.10.0(eslint@7.32.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@5.62.0)(eslint@7.32.0) + eslint-plugin-jsx-a11y: 6.8.0(eslint@7.32.0) + eslint-plugin-react: 7.34.1(eslint@7.32.0) + eslint-plugin-react-hooks: 4.6.0(eslint@7.32.0) + typescript: 5.4.4 + dev: false /eslint-import-resolver-node@0.3.9: resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} @@ -16976,7 +17051,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@5.4.4) debug: 3.2.7 eslint: 7.32.0 eslint-import-resolver-node: 0.3.9 @@ -17039,6 +17114,7 @@ packages: eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: - supports-color + dev: true /eslint-plugin-flowtype@5.10.0(eslint@7.32.0): resolution: {integrity: sha512-vcz32f+7TP+kvTUyMXZmCnNujBQZDNmcqPImw8b9PZ+16w1Qdm6ryRuYZYVaG9xRqqmAPr2Cs9FAX5gN+x/bjw==} @@ -17082,7 +17158,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@5.4.4) array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 array.prototype.flat: 1.3.2 @@ -17174,6 +17250,7 @@ packages: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color + dev: true /eslint-plugin-jsx-a11y@6.8.0(eslint@7.32.0): resolution: {integrity: sha512-Hdh937BS3KdwwbBaKd5+PLCOmYY6U4f2h9Z2ktwtNKvIdIEu137rjYbcb9ApSbVJfWxANNuiKTD/9tOKjK9qOA==} @@ -18572,6 +18649,39 @@ packages: tapable: 1.1.3 typescript: 5.3.3 webpack: 5.91.0(esbuild@0.19.12) + dev: true + + /fork-ts-checker-webpack-plugin@6.5.3(eslint@7.32.0)(typescript@5.4.4)(webpack@5.91.0): + resolution: {integrity: sha512-SbH/l9ikmMWycd5puHJKTkZJKddF4iRLyW3DeZ08HTI7NGyLS38MXd/KGgeWumQO7YNQbW2u/NtPT2YowbPaGQ==} + engines: {node: '>=10', yarn: '>=1.0.0'} + peerDependencies: + eslint: '>= 6' + typescript: '>= 2.7' + vue-template-compiler: '*' + webpack: '>= 4' + peerDependenciesMeta: + eslint: + optional: true + vue-template-compiler: + optional: true + dependencies: + '@babel/code-frame': 7.24.2 + '@types/json-schema': 7.0.15 + chalk: 4.1.2 + chokidar: 3.6.0 + cosmiconfig: 6.0.0 + deepmerge: 4.3.1 + eslint: 7.32.0 + fs-extra: 9.1.0 + glob: 7.2.3 + memfs: 3.5.3 + minimatch: 3.1.2 + schema-utils: 2.7.0 + semver: 7.6.0 + tapable: 1.1.3 + typescript: 5.4.4 + webpack: 5.91.0 + dev: false /form-data-encoder@2.1.4: resolution: {integrity: sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==} @@ -18853,7 +18963,7 @@ packages: dependencies: '@types/node-fetch': 2.6.11 fs-extra: 9.1.0 - gatsby: 5.13.3(babel-eslint@10.1.0)(esbuild@0.19.12)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3) + gatsby: 5.13.3(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.4.4) lodash: 4.17.21 node-fetch: 2.7.0 p-queue: 6.6.2 @@ -19015,7 +19125,7 @@ packages: chokidar: 3.6.0 fs-exists-cached: 1.0.0 fs-extra: 11.2.0 - gatsby: 5.13.3(babel-eslint@10.1.0)(esbuild@0.19.12)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3) + gatsby: 5.13.3(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.4.4) gatsby-core-utils: 4.13.1 gatsby-page-utils: 3.13.1 gatsby-plugin-utils: 4.13.1(gatsby@5.13.3)(graphql@16.8.1) @@ -19084,7 +19194,7 @@ packages: debug: 4.3.4 filenamify: 4.3.0 fs-extra: 11.2.0 - gatsby: 5.13.3(babel-eslint@10.1.0)(esbuild@0.19.12)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3) + gatsby: 5.13.3(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.4.4) gatsby-core-utils: 4.13.1 gatsby-plugin-utils: 4.13.1(gatsby@5.13.3)(graphql@16.8.1) lodash: 4.17.21 @@ -19143,7 +19253,7 @@ packages: '@babel/preset-typescript': 7.24.1(@babel/core@7.24.4) '@babel/runtime': 7.24.4 babel-plugin-remove-graphql-queries: 5.13.1(@babel/core@7.24.4)(gatsby@5.13.3) - gatsby: 5.13.3(babel-eslint@10.1.0)(esbuild@0.19.12)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3) + gatsby: 5.13.3(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.4.4) transitivePeerDependencies: - supports-color dev: false @@ -19181,7 +19291,7 @@ packages: '@babel/runtime': 7.24.4 fastq: 1.17.1 fs-extra: 11.2.0 - gatsby: 5.13.3(babel-eslint@10.1.0)(esbuild@0.19.12)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3) + gatsby: 5.13.3(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.4.4) gatsby-core-utils: 4.13.1 gatsby-sharp: 1.13.0 graphql: 16.8.1 @@ -19683,7 +19793,7 @@ packages: - webpack-hot-middleware - webpack-plugin-serve - /gatsby@5.13.3(babel-eslint@10.1.0)(esbuild@0.19.12)(react-dom@18.2.0)(react@18.2.0)(typescript@5.3.3): + /gatsby@5.13.3(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.4.4): resolution: {integrity: sha512-SSnGpjswK20BQORcvTbtK8eI+W4QUG+u8rdVswB4suva6BfvTakW2wiktj7E2MdO4NjRvlgJjF5dUUncU5nldA==} engines: {node: '>=18.0.0'} hasBin: true @@ -19717,8 +19827,8 @@ packages: '@pmmmwh/react-refresh-webpack-plugin': 0.5.11(react-refresh@0.14.0)(webpack@5.91.0) '@sigmacomputing/babel-plugin-lodash': 3.3.5 '@types/http-proxy': 1.17.14 - '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@7.32.0)(typescript@5.3.3) - '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@5.3.3) + '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@7.32.0)(typescript@5.4.4) + '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@5.4.4) '@vercel/webpack-asset-relocator-loader': 1.7.3 acorn-loose: 8.4.0 acorn-walk: 8.3.2 @@ -19756,9 +19866,9 @@ packages: enhanced-resolve: 5.16.0 error-stack-parser: 2.1.4 eslint: 7.32.0 - eslint-config-react-app: 6.0.0(@typescript-eslint/eslint-plugin@5.62.0)(@typescript-eslint/parser@5.62.0)(babel-eslint@10.1.0)(eslint-plugin-flowtype@5.10.0)(eslint-plugin-import@2.29.1)(eslint-plugin-jsx-a11y@6.8.0)(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.34.1)(eslint@7.32.0)(typescript@5.3.3) + eslint-config-react-app: 6.0.0(@typescript-eslint/eslint-plugin@5.62.0)(@typescript-eslint/parser@5.62.0)(babel-eslint@10.1.0)(eslint-plugin-flowtype@5.10.0)(eslint-plugin-import@2.29.1)(eslint-plugin-jsx-a11y@6.8.0)(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.34.1)(eslint@7.32.0)(typescript@5.4.4) eslint-plugin-flowtype: 5.10.0(eslint@7.32.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.17.0)(eslint@7.32.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@5.62.0)(eslint@7.32.0) eslint-plugin-jsx-a11y: 6.8.0(eslint@7.32.0) eslint-plugin-react: 7.34.1(eslint@7.32.0) eslint-plugin-react-hooks: 4.6.0(eslint@7.32.0) @@ -19830,7 +19940,7 @@ packages: query-string: 6.14.1 raw-loader: 4.0.2(webpack@5.91.0) react: 18.2.0 - react-dev-utils: 12.0.1(eslint@7.32.0)(typescript@5.3.3)(webpack@5.91.0) + react-dev-utils: 12.0.1(eslint@7.32.0)(typescript@5.4.4)(webpack@5.91.0) react-dom: 18.2.0(react@18.2.0) react-refresh: 0.14.0 react-server-dom-webpack: 0.0.0-experimental-c8b778b7f-20220825(react@18.2.0)(webpack@5.91.0) @@ -19848,13 +19958,13 @@ packages: strip-ansi: 6.0.1 style-loader: 2.0.0(webpack@5.91.0) style-to-object: 0.4.4 - terser-webpack-plugin: 5.3.10(esbuild@0.19.12)(webpack@5.91.0) + terser-webpack-plugin: 5.3.10(webpack@5.91.0) tmp: 0.2.3 true-case-path: 2.2.1 type-of: 2.0.1 url-loader: 4.1.1(file-loader@6.2.0)(webpack@5.91.0) uuid: 8.3.2 - webpack: 5.91.0(esbuild@0.19.12) + webpack: 5.91.0 webpack-dev-middleware: 4.3.0(webpack@5.91.0) webpack-merge: 5.10.0 webpack-stats-plugin: 1.1.3 @@ -24551,6 +24661,7 @@ packages: engines: {node: '>=16 || 14 >=14.17'} dependencies: brace-expansion: 2.0.1 + dev: true /minimatch@9.0.4: resolution: {integrity: sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==} @@ -27945,6 +28056,49 @@ packages: - eslint - supports-color - vue-template-compiler + dev: true + + /react-dev-utils@12.0.1(eslint@7.32.0)(typescript@5.4.4)(webpack@5.91.0): + resolution: {integrity: sha512-84Ivxmr17KjUupyqzFode6xKhjwuEJDROWKJy/BthkL7Wn6NJ8h4WE6k/exAv6ImS+0oZLRRW5j/aINMHyeGeQ==} + engines: {node: '>=14'} + peerDependencies: + typescript: '>=2.7' + webpack: '>=4' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@babel/code-frame': 7.24.2 + address: 1.2.2 + browserslist: 4.23.0 + chalk: 4.1.2 + cross-spawn: 7.0.3 + detect-port-alt: 1.1.6 + escape-string-regexp: 4.0.0 + filesize: 8.0.7 + find-up: 5.0.0 + fork-ts-checker-webpack-plugin: 6.5.3(eslint@7.32.0)(typescript@5.4.4)(webpack@5.91.0) + global-modules: 2.0.0 + globby: 11.1.0 + gzip-size: 6.0.0 + immer: 9.0.21 + is-root: 2.1.0 + loader-utils: 3.2.1 + open: 8.4.2 + pkg-up: 3.1.0 + prompts: 2.4.2 + react-error-overlay: 6.0.11 + recursive-readdir: 2.2.3 + shell-quote: 1.8.1 + strip-ansi: 6.0.1 + text-table: 0.2.0 + typescript: 5.4.4 + webpack: 5.91.0 + transitivePeerDependencies: + - eslint + - supports-color + - vue-template-compiler + dev: false /react-dnd-html5-backend@14.1.0: resolution: {integrity: sha512-6ONeqEC3XKVf4eVmMTe0oPds+c5B9Foyj8p/ZKLb7kL2qh9COYxiBHv3szd6gztqi/efkmriywLUVlPotqoJyw==} @@ -31132,6 +31286,7 @@ packages: serialize-javascript: 6.0.2 terser: 5.30.3 webpack: 5.91.0(esbuild@0.19.12) + dev: true /terser-webpack-plugin@5.3.10(webpack@5.91.0): resolution: {integrity: sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==} @@ -31476,6 +31631,7 @@ packages: typescript: '>=4.2.0' dependencies: typescript: 5.3.3 + dev: true /ts-dedent@2.2.0: resolution: {integrity: sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ==} @@ -31624,7 +31780,6 @@ packages: dependencies: tslib: 1.14.1 typescript: 5.4.4 - dev: false /tunnel-agent@0.6.0: resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} @@ -33428,6 +33583,7 @@ packages: - '@swc/core' - esbuild - uglify-js + dev: true /website-scraper@5.3.1: resolution: {integrity: sha512-gogqPXD2gVsxoyd2yRiympw3rA5GuEpD1CaDEJ/J8zzanx7hkbTtneoO1SGs436PpLbWVcUge+6APGLhzsuZPA==} From b11901e27e48d529d570471210fef402caccea65 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Thu, 11 Apr 2024 09:09:11 +0200 Subject: [PATCH 24/51] fix(gatsby-oauth): ssr --- packages/ui/src/components/Molecules/UserButton.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/ui/src/components/Molecules/UserButton.tsx b/packages/ui/src/components/Molecules/UserButton.tsx index 0521376fc..822c5ec5f 100644 --- a/packages/ui/src/components/Molecules/UserButton.tsx +++ b/packages/ui/src/components/Molecules/UserButton.tsx @@ -6,7 +6,10 @@ import { useIntl } from 'react-intl'; export function UserButton() { const session = useSession(); const intl = useIntl(); - const hostWithScheme = `${location.protocol}//${location.host}`; + const hostWithScheme = + typeof window !== 'undefined' + ? `${location.protocol}//${location.host}` + : ''; return ( <> {!session && <>} From 572d7bc9dcbaf28ce5ab5aa16e3e3c7368fda924 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Thu, 11 Apr 2024 19:59:39 +0200 Subject: [PATCH 25/51] refactor: query (wip) --- apps/website/src/utils/drupal-executor.ts | 28 ++++++++++ packages/schema/src/index.ts | 3 +- .../schema/src/operations/CurrentUser.gql | 8 +++ .../Organisms/UserProfile.stories.tsx | 54 +++++++++++++++++++ .../src/components/Organisms/UserProfile.tsx | 36 ++++++++++--- .../components/Routes/UserProfile.stories.tsx | 43 --------------- packages/ui/src/utils/operation.ts | 3 +- 7 files changed, 123 insertions(+), 52 deletions(-) create mode 100644 packages/schema/src/operations/CurrentUser.gql create mode 100644 packages/ui/src/components/Organisms/UserProfile.stories.tsx delete mode 100644 packages/ui/src/components/Routes/UserProfile.stories.tsx diff --git a/apps/website/src/utils/drupal-executor.ts b/apps/website/src/utils/drupal-executor.ts index f38a98fc5..520f5f807 100644 --- a/apps/website/src/utils/drupal-executor.ts +++ b/apps/website/src/utils/drupal-executor.ts @@ -7,9 +7,37 @@ export function drupalExecutor(endpoint: string, forward: boolean = true) { return async function ( id: OperationId, variables?: OperationVariables, + accessToken?: string, ) { const url = new URL(endpoint, window.location.origin); const isMutation = id.includes('Mutation:'); + const isAuthenticated = accessToken !== undefined; + if (isAuthenticated) { + const { data, errors } = await ( + await fetch(url, { + method: 'POST', + body: JSON.stringify({ + queryId: id, + variables: variables, + }), + headers: forward + ? { + 'SLB-Forwarded-Proto': window.location.protocol.slice(0, -1), + 'SLB-Forwarded-Host': window.location.hostname, + 'SLB-Forwarded-Port': window.location.port, + 'Content-Type': 'application/json', + Authorization: `Bearer ${accessToken}`, + } + : { + 'Content-Type': 'application/json', + }, + }) + ).json(); + if (errors) { + throw errors; + } + return data; + } if (isMutation) { const { data, errors } = await ( await fetch(url, { diff --git a/packages/schema/src/index.ts b/packages/schema/src/index.ts index 42559e8d3..ba8d26957 100644 --- a/packages/schema/src/index.ts +++ b/packages/schema/src/index.ts @@ -39,10 +39,11 @@ export function OperationExecutor( export function useExecutor( id: OperationId, variables?: OperationVariables, + accessToken?: string, ): | OperationResult | (( variables?: OperationVariables, ) => Promise>) { - return untypedUseExecutor(id, variables); + return untypedUseExecutor(id, variables, accessToken); } diff --git a/packages/schema/src/operations/CurrentUser.gql b/packages/schema/src/operations/CurrentUser.gql new file mode 100644 index 000000000..191ab8876 --- /dev/null +++ b/packages/schema/src/operations/CurrentUser.gql @@ -0,0 +1,8 @@ +query CurrentUser { + currentUser { + id + name + email + memberFor + } +} \ No newline at end of file diff --git a/packages/ui/src/components/Organisms/UserProfile.stories.tsx b/packages/ui/src/components/Organisms/UserProfile.stories.tsx new file mode 100644 index 000000000..71d24f28e --- /dev/null +++ b/packages/ui/src/components/Organisms/UserProfile.stories.tsx @@ -0,0 +1,54 @@ +import { + CurrentUserQuery, + OperationExecutor, + OperationResult, +} from '@custom/schema'; +import { Meta, StoryObj } from '@storybook/react'; +import React from 'react'; + +import { UserProfile } from './UserProfile'; + +type CurrentUserExecutor = ( + id: typeof CurrentUserQuery, +) => Promise>; + +export default { + title: 'Components/Organisms/User Profile', + render: (args) => { + return ( + + + + ); + }, +} satisfies Meta<{ exec: CurrentUserExecutor }>; + +type UserProfileStory = StoryObj<{ exec: CurrentUserExecutor }>; + +export const Loading = { + args: { + exec: () => new Promise>(() => {}), + }, +} satisfies UserProfileStory; + +export const Error = { + args: { + exec: () => + new Promise>(() => { + throw 'Authentication error.'; + }), + }, +} satisfies UserProfileStory; + +export const Authenticated = { + args: { + exec: async () => ({ + currentUser: { + id: '1', + name: 'Jane Doe', + email: 'jane@example.com', + memberFor: '1 year', + }, + }), + }, +} satisfies UserProfileStory; diff --git a/packages/ui/src/components/Organisms/UserProfile.tsx b/packages/ui/src/components/Organisms/UserProfile.tsx index dfde27d90..e62c179da 100644 --- a/packages/ui/src/components/Organisms/UserProfile.tsx +++ b/packages/ui/src/components/Organisms/UserProfile.tsx @@ -1,26 +1,48 @@ +import { CurrentUserQuery } from '@custom/schema'; +import { useSession } from 'next-auth/react'; import React from 'react'; import { useIntl } from 'react-intl'; +import { useOperation } from '../../utils/operation'; +import { Loading } from '../Molecules/Loading'; import { UserButton } from '../Molecules/UserButton'; -export function UserProfile(props: any) { +export function UserProfile() { const intl = useIntl(); + const session = useSession(); + let accessToken = null; + if (session && session.status === 'authenticated') { + // @ts-ignore + accessToken = session.data.user.tokens.access_token; + } + const { data, isLoading, error } = useOperation( + CurrentUserQuery, + {}, + accessToken, + ); return (
- {props.error &&

{props.error}

} - {!props.user && !props.error && } - {props.user && ( + {error ? ( +
+
+ {error} +
+
+ ) : null} + {isLoading ? : null} + {!isLoading && !data?.currentUser && !error && } + {data?.currentUser && ( <>

- {props.user.name} + {data?.currentUser.name}

{intl.formatMessage( { defaultMessage: 'Email: {email}', id: 'uPNlBw' }, { - email: props.user.email, + email: data?.currentUser.email, }, )}

@@ -28,7 +50,7 @@ export function UserProfile(props: any) { {intl.formatMessage( { defaultMessage: 'Member for {member_for}', id: 'OZlBcy' }, { - member_for: props.user.memberFor, + member_for: data.currentUser.memberFor, }, )}

diff --git a/packages/ui/src/components/Routes/UserProfile.stories.tsx b/packages/ui/src/components/Routes/UserProfile.stories.tsx deleted file mode 100644 index 2d09e4f5a..000000000 --- a/packages/ui/src/components/Routes/UserProfile.stories.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { Meta, StoryObj } from '@storybook/react'; -import React from 'react'; - -import { UserProfile } from './UserProfile'; - -export default { - component: UserProfile, -} satisfies Meta; - -export const AuthenticatedUser = { - render: (args) => { - return ; - }, - args: { - user: { - id: '1', - email: 'test@example.com', - name: 'Jane Doe', - memberFor: '1 year', - }, - error: null, - }, -} satisfies StoryObj; - -export const AnonymousUser = { - render: (args) => { - return ; - }, - args: { - user: null, - error: null, - }, -} satisfies StoryObj; - -export const AuthenticationError = { - render: (args) => { - return ; - }, - args: { - user: null, - error: 'Authentication error', - }, -} satisfies StoryObj; diff --git a/packages/ui/src/utils/operation.ts b/packages/ui/src/utils/operation.ts index 136595b1d..48ee33303 100644 --- a/packages/ui/src/utils/operation.ts +++ b/packages/ui/src/utils/operation.ts @@ -10,8 +10,9 @@ import useSWRMutation, { SWRMutationResponse } from 'swr/mutation'; export function useOperation( operation: TOperation, variables?: OperationVariables, + accessToken?: string, ): Omit>, 'mutate'> { - const executor = useExecutor(operation, variables); + const executor = useExecutor(operation, variables, accessToken); // If the executor is a function, use SWR to manage it. const result = useSwr>( [operation, variables], From 2151682700dc2b1e66f668582f59cc481f9951c0 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Fri, 12 Apr 2024 19:35:01 +0200 Subject: [PATCH 26/51] refactor: query --- apps/website/src/templates/profile.tsx | 72 ++++++++----------- apps/website/src/utils/drupal-executor.ts | 9 ++- packages/schema/src/index.ts | 1 + .../src/components/Organisms/UserProfile.tsx | 44 +++++------- .../ui/src/components/Routes/UserProfile.tsx | 4 +- 5 files changed, 54 insertions(+), 76 deletions(-) diff --git a/apps/website/src/templates/profile.tsx b/apps/website/src/templates/profile.tsx index 571a32b02..360032808 100644 --- a/apps/website/src/templates/profile.tsx +++ b/apps/website/src/templates/profile.tsx @@ -1,51 +1,35 @@ +import { CurrentUserQuery, OperationExecutor } from '@custom/schema'; import { UserProfile } from '@custom/ui/routes/UserProfile'; import { useSession } from 'next-auth/react'; -import React, { useEffect, useState } from 'react'; +import React from 'react'; -export async function getCurrentUser(accessToken: string): Promise { - const host = process.env.GATSBY_DRUPAL_URL || 'http://127.0.0.1:8888'; - const endpoint = `${host}/graphql`; - const headers = { - 'Content-Type': 'application/json', - Authorization: `Bearer ${accessToken}`, - }; - const graphqlQuery = { - query: ` - query CurrentUser { - currentUser { - id - name - email - memberFor - } - } - `, - variables: {}, - }; - const options = { - method: 'POST', - headers, - body: JSON.stringify(graphqlQuery), - }; - return await fetch(endpoint, options); -} +import { drupalExecutor } from '../utils/drupal-executor'; export default function ProfilePage() { const session = useSession(); - const [user, setUser] = useState(null); - const [error, setError] = useState(null); - useEffect(() => { - if (session && session.status === 'authenticated') { - // @ts-ignore - const accessToken = session.data.user.tokens.access_token; - getCurrentUser(accessToken) - .then((response) => response.json()) - .then((result) => { - setUser(result.data.currentUser); - return result; - }) - .catch((error) => setError(error)); - } - }, [session]); - return ; + let accessToken = null; + if (session && session.status === 'authenticated') { + // @ts-ignore + accessToken = session.data.user.tokens.access_token; + const authenticatedExecutor = drupalExecutor( + `${process.env.GATSBY_DRUPAL_URL}/graphql`, + false, + accessToken, + ); + return ( + { + const data = await authenticatedExecutor(CurrentUserQuery, {}); + return { + currentUser: data.currentUser, + }; + }} + id={CurrentUserQuery} + > + + + ); + } else { + return ; + } } diff --git a/apps/website/src/utils/drupal-executor.ts b/apps/website/src/utils/drupal-executor.ts index 520f5f807..135dc85c4 100644 --- a/apps/website/src/utils/drupal-executor.ts +++ b/apps/website/src/utils/drupal-executor.ts @@ -3,15 +3,19 @@ import { AnyOperationId, OperationVariables } from '@custom/schema'; /** * Create an executor that operates against a Drupal endpoint. */ -export function drupalExecutor(endpoint: string, forward: boolean = true) { +export function drupalExecutor( + endpoint: string, + forward: boolean = true, + accessToken: string | undefined = undefined, +) { return async function ( id: OperationId, variables?: OperationVariables, - accessToken?: string, ) { const url = new URL(endpoint, window.location.origin); const isMutation = id.includes('Mutation:'); const isAuthenticated = accessToken !== undefined; + if (isAuthenticated) { const { data, errors } = await ( await fetch(url, { @@ -30,6 +34,7 @@ export function drupalExecutor(endpoint: string, forward: boolean = true) { } : { 'Content-Type': 'application/json', + Authorization: `Bearer ${accessToken}`, }, }) ).json(); diff --git a/packages/schema/src/index.ts b/packages/schema/src/index.ts index ba8d26957..f371048bb 100644 --- a/packages/schema/src/index.ts +++ b/packages/schema/src/index.ts @@ -31,6 +31,7 @@ export function OperationExecutor( id?: OperationId; variables?: VariablesMatcher>; executor: Executor; + accessToken?: string; }>, ) { return UntypedOperationExecutor(props); diff --git a/packages/ui/src/components/Organisms/UserProfile.tsx b/packages/ui/src/components/Organisms/UserProfile.tsx index e62c179da..86bd1df10 100644 --- a/packages/ui/src/components/Organisms/UserProfile.tsx +++ b/packages/ui/src/components/Organisms/UserProfile.tsx @@ -1,60 +1,48 @@ import { CurrentUserQuery } from '@custom/schema'; -import { useSession } from 'next-auth/react'; import React from 'react'; import { useIntl } from 'react-intl'; import { useOperation } from '../../utils/operation'; -import { Loading } from '../Molecules/Loading'; -import { UserButton } from '../Molecules/UserButton'; export function UserProfile() { const intl = useIntl(); - const session = useSession(); - let accessToken = null; - if (session && session.status === 'authenticated') { - // @ts-ignore - accessToken = session.data.user.tokens.access_token; - } - const { data, isLoading, error } = useOperation( - CurrentUserQuery, - {}, - accessToken, - ); + const { data, isLoading, error } = useOperation(CurrentUserQuery); return (
- {error ? ( -
-
- {error} -
-
- ) : null} - {isLoading ? : null} - {!isLoading && !data?.currentUser && !error && } - {data?.currentUser && ( + {!isLoading && !error && data?.currentUser ? ( <>

- {data?.currentUser.name} + {data?.currentUser?.name}

{intl.formatMessage( { defaultMessage: 'Email: {email}', id: 'uPNlBw' }, { - email: data?.currentUser.email, + email: data?.currentUser?.email, }, )}

{intl.formatMessage( - { defaultMessage: 'Member for {member_for}', id: 'OZlBcy' }, { - member_for: data.currentUser.memberFor, + defaultMessage: 'Member for {member_for}', + id: 'OZlBcy', + }, + { + member_for: data?.currentUser?.memberFor, }, )}

+ ) : ( +

+ {intl.formatMessage({ + defaultMessage: 'Sign in to view your profile.', + id: 'K99M9A', + })} +

)}
diff --git a/packages/ui/src/components/Routes/UserProfile.tsx b/packages/ui/src/components/Routes/UserProfile.tsx index 6272aa758..5ade53004 100644 --- a/packages/ui/src/components/Routes/UserProfile.tsx +++ b/packages/ui/src/components/Routes/UserProfile.tsx @@ -3,10 +3,10 @@ import React from 'react'; import { PageTransition } from '../Molecules/PageTransition'; import { UserProfile as UserProfileOrganism } from '../Organisms/UserProfile'; -export function UserProfile(props: any) { +export function UserProfile() { return ( - + ); } From ef458f84970c2629648ba634cabc2f2b87c50ce5 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Fri, 12 Apr 2024 20:23:24 +0200 Subject: [PATCH 27/51] chore: lint fix --- packages/schema/src/operations/CurrentUser.gql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/schema/src/operations/CurrentUser.gql b/packages/schema/src/operations/CurrentUser.gql index 191ab8876..56047b3d8 100644 --- a/packages/schema/src/operations/CurrentUser.gql +++ b/packages/schema/src/operations/CurrentUser.gql @@ -5,4 +5,4 @@ query CurrentUser { email memberFor } -} \ No newline at end of file +} From 8eb7ae881f1d862c5319bfe268b95c654b84de21 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Mon, 15 Apr 2024 14:24:56 +0200 Subject: [PATCH 28/51] fix(gatsby-oauth): remove unnecessary accessToken --- packages/schema/src/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/schema/src/index.ts b/packages/schema/src/index.ts index f371048bb..ba8d26957 100644 --- a/packages/schema/src/index.ts +++ b/packages/schema/src/index.ts @@ -31,7 +31,6 @@ export function OperationExecutor( id?: OperationId; variables?: VariablesMatcher>; executor: Executor; - accessToken?: string; }>, ) { return UntypedOperationExecutor(props); From 7d2893c69ee54b21cfe3ae8493456a68a5a3e101 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Mon, 15 Apr 2024 22:45:25 +0200 Subject: [PATCH 29/51] fix(gatsby-oauth): accessToken with executor --- apps/website/src/templates/profile.tsx | 9 ++++++--- apps/website/src/utils/drupal-executor.ts | 7 ++----- packages/schema/src/index.ts | 3 +-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/apps/website/src/templates/profile.tsx b/apps/website/src/templates/profile.tsx index 360032808..f6040496d 100644 --- a/apps/website/src/templates/profile.tsx +++ b/apps/website/src/templates/profile.tsx @@ -7,19 +7,22 @@ import { drupalExecutor } from '../utils/drupal-executor'; export default function ProfilePage() { const session = useSession(); - let accessToken = null; + let accessToken: string | undefined = undefined; if (session && session.status === 'authenticated') { // @ts-ignore accessToken = session.data.user.tokens.access_token; const authenticatedExecutor = drupalExecutor( `${process.env.GATSBY_DRUPAL_URL}/graphql`, false, - accessToken, ); return ( { - const data = await authenticatedExecutor(CurrentUserQuery, {}); + const data = await authenticatedExecutor( + CurrentUserQuery, + {}, + accessToken, + ); return { currentUser: data.currentUser, }; diff --git a/apps/website/src/utils/drupal-executor.ts b/apps/website/src/utils/drupal-executor.ts index 135dc85c4..2d9e79487 100644 --- a/apps/website/src/utils/drupal-executor.ts +++ b/apps/website/src/utils/drupal-executor.ts @@ -3,14 +3,11 @@ import { AnyOperationId, OperationVariables } from '@custom/schema'; /** * Create an executor that operates against a Drupal endpoint. */ -export function drupalExecutor( - endpoint: string, - forward: boolean = true, - accessToken: string | undefined = undefined, -) { +export function drupalExecutor(endpoint: string, forward: boolean = true) { return async function ( id: OperationId, variables?: OperationVariables, + accessToken?: string, ) { const url = new URL(endpoint, window.location.origin); const isMutation = id.includes('Mutation:'); diff --git a/packages/schema/src/index.ts b/packages/schema/src/index.ts index ba8d26957..42559e8d3 100644 --- a/packages/schema/src/index.ts +++ b/packages/schema/src/index.ts @@ -39,11 +39,10 @@ export function OperationExecutor( export function useExecutor( id: OperationId, variables?: OperationVariables, - accessToken?: string, ): | OperationResult | (( variables?: OperationVariables, ) => Promise>) { - return untypedUseExecutor(id, variables, accessToken); + return untypedUseExecutor(id, variables); } From 1f5e97fcc6c4eb13205cde6c64775c5e750c7f94 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Mon, 15 Apr 2024 23:03:43 +0200 Subject: [PATCH 30/51] fix(gatsby-oauth): executor condition --- apps/website/src/utils/drupal-executor.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/website/src/utils/drupal-executor.ts b/apps/website/src/utils/drupal-executor.ts index 2d9e79487..0dd78d8b5 100644 --- a/apps/website/src/utils/drupal-executor.ts +++ b/apps/website/src/utils/drupal-executor.ts @@ -39,8 +39,7 @@ export function drupalExecutor(endpoint: string, forward: boolean = true) { throw errors; } return data; - } - if (isMutation) { + } else if (isMutation) { const { data, errors } = await ( await fetch(url, { method: 'POST', From 2a12f0b4e304526bfed7449c6bb65356376890a6 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Tue, 16 Apr 2024 09:04:36 +0200 Subject: [PATCH 31/51] fix(gatsby-oauth): accessToken with executor --- packages/ui/src/utils/operation.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/ui/src/utils/operation.ts b/packages/ui/src/utils/operation.ts index 48ee33303..136595b1d 100644 --- a/packages/ui/src/utils/operation.ts +++ b/packages/ui/src/utils/operation.ts @@ -10,9 +10,8 @@ import useSWRMutation, { SWRMutationResponse } from 'swr/mutation'; export function useOperation( operation: TOperation, variables?: OperationVariables, - accessToken?: string, ): Omit>, 'mutate'> { - const executor = useExecutor(operation, variables, accessToken); + const executor = useExecutor(operation, variables); // If the executor is a function, use SWR to manage it. const result = useSwr>( [operation, variables], From 923d68e6fae407aeb0af07014c479de3e15a5ecf Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Tue, 16 Apr 2024 10:06:34 +0200 Subject: [PATCH 32/51] refactor(gatsby-oauth): use directives service --- packages/drupal/custom/custom.services.yml | 4 ++ packages/drupal/custom/src/Directives.php | 42 +++++++++++++++++++ .../Plugin/GraphQL/Directive/CurrentUser.php | 36 ---------------- packages/schema/codegen.ts | 2 +- packages/schema/src/schema.graphql | 2 +- 5 files changed, 48 insertions(+), 38 deletions(-) create mode 100644 packages/drupal/custom/src/Directives.php delete mode 100644 packages/drupal/custom/src/Plugin/GraphQL/Directive/CurrentUser.php diff --git a/packages/drupal/custom/custom.services.yml b/packages/drupal/custom/custom.services.yml index fd6d0a918..157d654e6 100644 --- a/packages/drupal/custom/custom.services.yml +++ b/packages/drupal/custom/custom.services.yml @@ -7,3 +7,7 @@ services: custom.webform: class: Drupal\custom\Webform arguments: ['@renderer', '@entity_type.manager', '@serializer'] + + custom.directives: + class: Drupal\custom\Directives + arguments: ['@current_user', '@date.formatter'] diff --git a/packages/drupal/custom/src/Directives.php b/packages/drupal/custom/src/Directives.php new file mode 100644 index 000000000..a2d3a925a --- /dev/null +++ b/packages/drupal/custom/src/Directives.php @@ -0,0 +1,42 @@ +currentUser->isAnonymous()) { + return NULL; + } + else { + $user = User::load($account->id()); + $memberFor = $this->dateFormatter->formatTimeDiffSince($user->getCreatedTime()); + return [ + 'id' => $account->id(), + 'name' => $account->getDisplayName(), + 'email' => $account->getEmail(), + 'memberFor' => $memberFor, + ]; + } + } + +} diff --git a/packages/drupal/custom/src/Plugin/GraphQL/Directive/CurrentUser.php b/packages/drupal/custom/src/Plugin/GraphQL/Directive/CurrentUser.php deleted file mode 100644 index 0251a1cd9..000000000 --- a/packages/drupal/custom/src/Plugin/GraphQL/Directive/CurrentUser.php +++ /dev/null @@ -1,36 +0,0 @@ -callback(function () { - $account = \Drupal::currentUser(); - if ($account->isAnonymous()) { - return null; - } - else { - $user = User::load($account->id()); - $memberFor = \Drupal::service('date.formatter')->formatTimeDiffSince($user->getCreatedTime()); - return [ - 'id' => $account->id(), - 'name' => $account->getDisplayName(), - 'email' => $account->getEmail(), - 'memberFor' => $memberFor, - ]; - } - }); - } -} diff --git a/packages/schema/codegen.ts b/packages/schema/codegen.ts index 7dc41889a..7a0ea92c9 100644 --- a/packages/schema/codegen.ts +++ b/packages/schema/codegen.ts @@ -40,7 +40,7 @@ const config: CodegenConfig = { context: ['gatsby'], }, }, - // Directive autoloader for Drupla. + // Directive autoloader for Drupal. 'build/drupal-autoload.json': { plugins: ['@amazeelabs/codegen-autoloader'], config: { diff --git a/packages/schema/src/schema.graphql b/packages/schema/src/schema.graphql index f3f0a8410..e88f2a43e 100644 --- a/packages/schema/src/schema.graphql +++ b/packages/schema/src/schema.graphql @@ -72,7 +72,7 @@ directive @route( Retrieve the properties of the current user. Provided by the "silverback_gatsby" module. -Implemented in "Drupal\custom\Plugin\GraphQL\Directive\CurrentUser". +implementation(drupal): custom.directives::currentUser """ directive @currentUser repeatable on FIELD_DEFINITION | SCALAR | UNION | ENUM | INTERFACE | OBJECT From 4d3e1f058e70e7764c403f25cfac50ec686cf202 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Tue, 16 Apr 2024 10:16:10 +0200 Subject: [PATCH 33/51] docs(gatsby-oauth): improve wording --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1b1f71d3a..7ec95ba15 100644 --- a/README.md +++ b/README.md @@ -219,8 +219,6 @@ lagoon add variable -p [project name] -e dev -N NETLIFY_SITE_ID -V [netlify site ### Gatsby authentication / SSO -Enabled only when at least one provider is configured. - Authentication providers are relying on Auth.js (formerly Next-Auth) and can be configured in `/apps/website/nextauth.config.js` @@ -230,9 +228,9 @@ An example provider is available for Drupal. How it works On Netlify, several environment variables are required to be set: -#### In all cases +#### For all providers -- `NEXTAUTH_URL` The URL of the website. This is used for the callback. +- `NEXTAUTH_URL` The URL of the frontend. This is used for the callback. - `NEXTAUTH_SECRET` A random string used for encryption. Generate the secret with e.g. `openssl rand -base64 32` From 1b587b511f207b9cb966992990f069c587c224b9 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Thu, 25 Apr 2024 11:00:50 +0200 Subject: [PATCH 34/51] refactor(gatsby-oauth): use a more generic client id for the frontend --- README.md | 4 ++-- apps/website/nextauth.config.js | 7 +++---- ...ml => 73dc184f-806f-4c22-8014-6686390a06cf.yml} | 14 +++++++------- 3 files changed, 12 insertions(+), 13 deletions(-) rename packages/drupal/test_content/content/consumer/{57e1b8a7-48a5-4468-89d9-0016825b9868.yml => 73dc184f-806f-4c22-8014-6686390a06cf.yml} (69%) diff --git a/README.md b/README.md index 7ec95ba15..39c162635 100644 --- a/README.md +++ b/README.md @@ -242,8 +242,8 @@ Generate the secret with e.g. `openssl rand -base64 32` In Drupal go to `/admin/config/services/consumer` and add a new Consumer. -- Label: `Gatsby` -- Client ID: `gatsby` +- Label: `Website` +- Client ID: `website` - Secret: a random string matching `AUTH_DRUPAL_SECRET` - Redirect URI: `[netlify-gatsby-site-url]/oauth/callback` diff --git a/apps/website/nextauth.config.js b/apps/website/nextauth.config.js index 611215923..fab2e76aa 100644 --- a/apps/website/nextauth.config.js +++ b/apps/website/nextauth.config.js @@ -7,8 +7,8 @@ export const authConfig = { // Other providers can be added here (e.g. Google, Keycloak). { // Client ID and secret are set in the Drupal Consumer. - clientId: process.env.AUTH_DRUPAL_ID || 'gatsby', - clientSecret: process.env.AUTH_DRUPAL_SECRET || 'gatsby', + clientId: process.env.AUTH_DRUPAL_ID || 'website', + clientSecret: process.env.AUTH_DRUPAL_SECRET || 'banana', id: 'drupal', name: 'Drupal', type: 'oauth', @@ -17,8 +17,7 @@ export const authConfig = { authorization: { url: `${AUTH_DRUPAL_URL}/en/oauth/authorize`, params: { - // @todo refine scope, editor (role) is used for now. - scope: 'editor', + scope: 'authenticated', }, }, token: `${AUTH_DRUPAL_URL}/en/oauth/token`, diff --git a/packages/drupal/test_content/content/consumer/57e1b8a7-48a5-4468-89d9-0016825b9868.yml b/packages/drupal/test_content/content/consumer/73dc184f-806f-4c22-8014-6686390a06cf.yml similarity index 69% rename from packages/drupal/test_content/content/consumer/57e1b8a7-48a5-4468-89d9-0016825b9868.yml rename to packages/drupal/test_content/content/consumer/73dc184f-806f-4c22-8014-6686390a06cf.yml index 003a86ba9..3115d8d97 100644 --- a/packages/drupal/test_content/content/consumer/57e1b8a7-48a5-4468-89d9-0016825b9868.yml +++ b/packages/drupal/test_content/content/consumer/73dc184f-806f-4c22-8014-6686390a06cf.yml @@ -1,7 +1,7 @@ _meta: version: '1.0' entity_type: consumer - uuid: 57e1b8a7-48a5-4468-89d9-0016825b9868 + uuid: 73dc184f-806f-4c22-8014-6686390a06cf default_langcode: en default: owner_id: @@ -9,10 +9,13 @@ default: target_id: 1 client_id: - - value: gatsby + value: website label: - - value: Gatsby + value: Website + description: + - + value: banana third_party: - value: true @@ -21,15 +24,12 @@ default: value: false secret: - - value: $2y$10$oF1wWQgp0zlEYBnomKI.f.CvWf9VfpsowJA/JFNVN4u773miv90QW + value: $2y$10$VFVObrn/AcLeb7Va.xcy8OUQTPYC3t7DzJsfwZK8DzHzlZ05njMSS existing: '' pre_hashed: false confidential: - value: true - roles: - - - target_id: editor redirect: - value: 'http://localhost:8000/api/auth/callback/drupal' From cb62ec0ac7f5e6c5b71c498a401517c65e416bee Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Thu, 25 Apr 2024 11:34:35 +0200 Subject: [PATCH 35/51] chore(gatsby-oauth): create website consumer, add to INIT --- INIT.md | 19 +++++++-- README.md | 5 +++ apps/cms/.lagoon.env | 5 ++- packages/drupal/custom/custom.deploy.php | 52 ++++++++++++++++++++++-- 4 files changed, 73 insertions(+), 8 deletions(-) diff --git a/INIT.md b/INIT.md index 679a143b6..6d606c3f5 100644 --- a/INIT.md +++ b/INIT.md @@ -70,17 +70,28 @@ replace( 'PROJECT_NAME=example', 'PROJECT_NAME=' + process.env.PROJECT_NAME_MACHINE, ); -const clientSecret = randomString(32); +const publisherClientSecret = randomString(32); replace( ['apps/cms/.lagoon.env', 'apps/website/.lagoon.env'], 'PUBLISHER_OAUTH2_CLIENT_SECRET=REPLACE_ME', - 'PUBLISHER_OAUTH2_CLIENT_SECRET=' + clientSecret, + `PUBLISHER_OAUTH2_CLIENT_SECRET='${publisherClientSecret}`, ); -const sessionSecret = randomString(32); +const publisherSessionSecret = randomString(32); replace( ['apps/website/.lagoon.env'], 'PUBLISHER_OAUTH2_SESSION_SECRET=REPLACE_ME', - 'PUBLISHER_OAUTH2_SESSION_SECRET=' + sessionSecret, + `PUBLISHER_OAUTH2_SESSION_SECRET=${publisherSessionSecret}`, +); +const websiteClientSecret = randomString(32); +replace( + ['apps/cms/.lagoon.env'], + 'WEBSITE_OAUTH2_CLIENT_SECRET=REPLACE_ME', + `WEBSITE_OAUTH2_CLIENT_SECRET=${websiteClientSecret}`, +); +console.log( + 'Website OAuth2 environment variables to be set in Netlify', + `AUTH_DRUPAL_ID: website`, + `AUTH_DRUPAL_SECRET: ${websiteClientSecret}`, ); // Template's prod domain is special. replace( diff --git a/README.md b/README.md index 39c162635..15ea04680 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ Other steps - [Create a new Lagoon project](https://amazeelabs.atlassian.net/wiki/spaces/ALU/pages/368115717/Create+a+new+Lagoon+project) - [Create a new Netlify project](https://amazeelabs.atlassian.net/wiki/spaces/ALU/pages/368017428/Create+a+new+Netlify+project) +- Set `AUTH_DRUPAL_ID` and `AUTH_DRUPAL_SECRET` in + [Netlify environment variables](#gatsby-authentication--sso) - Check the [Environment overrides](#environment-overrides) section below - Check the [Choose a CMS](#choose-a-cms) section below - Create `dev` and `prod` branches (and optionally `stage`) from `release` @@ -224,6 +226,9 @@ configured in `/apps/website/nextauth.config.js` An example provider is available for Drupal. +Netlify environment variables are required are displayed in the console when +running `pnpx @amazeelabs/mzx run INIT.md`. +
How it works On Netlify, several environment variables are required to be set: diff --git a/apps/cms/.lagoon.env b/apps/cms/.lagoon.env index a2fa48dbc..f416ff4d1 100644 --- a/apps/cms/.lagoon.env +++ b/apps/cms/.lagoon.env @@ -2,5 +2,8 @@ PROJECT_NAME=example PUBLISHER_URL="https://${LAGOON_GIT_BRANCH}-${PROJECT_NAME}.build.amazeelabs.dev" NETLIFY_URL="https://${LAGOON_GIT_BRANCH}-${PROJECT_NAME}.amazeelabs.dev" -# Used to set the original client secret. +# Used to set the original client secret for Publisher. PUBLISHER_OAUTH2_CLIENT_SECRET=REPLACE_ME + +# Used to set the original client secret for the Website. +WEBSITE_OAUTH2_CLIENT_SECRET=REPLACE_ME diff --git a/packages/drupal/custom/custom.deploy.php b/packages/drupal/custom/custom.deploy.php index 29177aad4..e950e51d6 100644 --- a/packages/drupal/custom/custom.deploy.php +++ b/packages/drupal/custom/custom.deploy.php @@ -14,8 +14,6 @@ function custom_deploy_set_consumers(array &$sandbox): string { } // Check requirements. - $entityTypeManager = \Drupal::entityTypeManager(); - $publisherUrl = getenv('PUBLISHER_URL'); if (!$publisherUrl) { throw new \Exception('PUBLISHER_URL environment variable is not set. It is required to setup the Publisher OAuth Consumer.'); @@ -26,11 +24,12 @@ function custom_deploy_set_consumers(array &$sandbox): string { throw new \Exception('PUBLISHER_OAUTH2_CLIENT_SECRET environment variable is not set. It is required to setup the Publisher OAuth Consumer.'); } + $entityTypeManager = \Drupal::entityTypeManager(); $consumersStorage = $entityTypeManager->getStorage('consumer'); $existingConsumers = $consumersStorage->loadMultiple(); $hasPublisherConsumer = FALSE; /** @var \Drupal\consumers\Entity\ConsumerInterface $consumer */ - foreach($existingConsumers as $consumer) { + foreach ($existingConsumers as $consumer) { // As a side effect, delete the default consumer. // It is installed by the Consumers module. if ($consumer->getClientId() === 'default_consumer') { @@ -56,3 +55,50 @@ function custom_deploy_set_consumers(array &$sandbox): string { return t('Publisher OAuth Consumer already exists.'); } + +/** + * Set up the Website OAuth Consumer. + */ +function custom_deploy_set_website_consumer(array &$sandbox): string { + // Skip for Silverback environments. + if (getenv('SB_ENVIRONMENT')) { + return t('Skipping for Silverback environment.'); + } + + // Check requirements. + $websiteUrl = getenv('NETLIFY_URL'); + if (!$websiteUrl) { + throw new \Exception('NETLIFY_URL environment variable is not set. It is required to setup the Website OAuth Consumer.'); + } + + $clientSecret = getenv('WEBSITE_OAUTH2_CLIENT_SECRET'); + if (!$clientSecret) { + throw new \Exception('WEBSITE_OAUTH2_CLIENT_SECRET environment variable is not set. It is required to setup the Website OAuth Consumer.'); + } + + $entityTypeManager = \Drupal::entityTypeManager(); + $consumersStorage = $entityTypeManager->getStorage('consumer'); + $existingConsumers = $consumersStorage->loadMultiple(); + $hasWebsiteConsumer = FALSE; + /** @var \Drupal\consumers\Entity\ConsumerInterface $consumer */ + foreach ($existingConsumers as $consumer) { + if ($consumer->getClientId() === 'website') { + $hasWebsiteConsumer = TRUE; + } + } + + // Create the Website Consumer if it does not exist. + if (!$hasWebsiteConsumer) { + $oAuthCallback = $websiteUrl . '/api/auth/callback/drupal'; + $consumersStorage->create([ + 'label' => 'Website', + 'client_id' => 'website', + 'is_default' => FALSE, + 'secret' => $clientSecret, + 'redirect' => $oAuthCallback, + ])->save(); + return t('Created Website OAuth Consumer.'); + } + + return t('Website OAuth Consumer already exists.'); +} From 1be1f045411d0ca31199d3936ef1437fd4e945b0 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Thu, 25 Apr 2024 11:48:11 +0200 Subject: [PATCH 36/51] fix: pnpm.lock merge --- pnpm-lock.yaml | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 93dd20ddb..a922a7a13 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17065,34 +17065,6 @@ packages: transitivePeerDependencies: - supports-color - /eslint-module-utils@2.8.1(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.9)(eslint@7.32.0): - resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==} - engines: {node: '>=4'} - peerDependencies: - '@typescript-eslint/parser': '*' - eslint: '*' - eslint-import-resolver-node: '*' - eslint-import-resolver-typescript: '*' - eslint-import-resolver-webpack: '*' - peerDependenciesMeta: - '@typescript-eslint/parser': - optional: true - eslint: - optional: true - eslint-import-resolver-node: - optional: true - eslint-import-resolver-typescript: - optional: true - eslint-import-resolver-webpack: - optional: true - dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@5.4.4) - debug: 3.2.7 - eslint: 7.32.0 - eslint-import-resolver-node: 0.3.9 - transitivePeerDependencies: - - supports-color - /eslint-module-utils@2.8.1(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-node@0.3.9)(eslint@7.0.0): resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==} engines: {node: '>=4'} From 2e87f7909376122780382e5e65dd330f512121dc Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Thu, 25 Apr 2024 12:03:20 +0200 Subject: [PATCH 37/51] docs(gatsby-oauth): clearer environment variables setup --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 15ea04680..fd0990ccb 100644 --- a/README.md +++ b/README.md @@ -226,11 +226,6 @@ configured in `/apps/website/nextauth.config.js` An example provider is available for Drupal. -Netlify environment variables are required are displayed in the console when -running `pnpx @amazeelabs/mzx run INIT.md`. - -
- How it works On Netlify, several environment variables are required to be set: #### For all providers @@ -245,7 +240,12 @@ Generate the secret with e.g. `openssl rand -base64 32` - `AUTH_DRUPAL_ID` The client ID of the Drupal Consumer - `AUTH_DRUPAL_SECRET` The client secret of the Drupal Consumer -In Drupal go to `/admin/config/services/consumer` and add a new Consumer. +Drupal environment variables are displayed in the console when running +`pnpx @amazeelabs/mzx run INIT.md`. + +
+ How it works +A `Website` consumer is created in Drupal `/admin/config/services/consumer` with - Label: `Website` - Client ID: `website` From c7c79e1a0a24972bb99d1ca09bece8f4bd4f3127 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Thu, 25 Apr 2024 12:24:12 +0200 Subject: [PATCH 38/51] chore(gatsby-oauth): remove node-gyp, node-addon-api --- package.json | 4 +- pnpm-lock.yaml | 196 ++++++------------------------------------------- 2 files changed, 23 insertions(+), 177 deletions(-) diff --git a/package.json b/package.json index 059b089cc..e4b531976 100644 --- a/package.json +++ b/package.json @@ -40,9 +40,7 @@ "prettier": "^3.1.1", "turbo": "^1.11.2", "typescript": "^5.3.3", - "vitest": "^1.1.1", - "node-addon-api": "^7.1.0", - "node-gyp": "^10.0.1" + "vitest": "^1.1.1" }, "resolutions": { "gatsby-plugin-sharp": "5.13.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a922a7a13..7e5ecb217 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -53,12 +53,6 @@ importers: husky: specifier: ^8.0.3 version: 8.0.3 - node-addon-api: - specifier: ^7.1.0 - version: 7.1.0 - node-gyp: - specifier: ^10.0.1 - version: 10.0.1 prettier: specifier: ^3.1.1 version: 3.1.1 @@ -6644,19 +6638,6 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 - /@npmcli/agent@2.2.2: - resolution: {integrity: sha512-OrcNPXdpSl9UX7qPVRWbmWMCSXrcDa2M9DvrbOTj7ao1S4PlqVFYv9/yLKMkrJKZ/V5A/kDBC690or307i26Og==} - engines: {node: ^16.14.0 || >=18.0.0} - dependencies: - agent-base: 7.1.1 - http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.4 - lru-cache: 10.2.0 - socks-proxy-agent: 8.0.3 - transitivePeerDependencies: - - supports-color - dev: true - /@npmcli/fs@1.1.1: resolution: {integrity: sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==} requiresBuild: true @@ -6666,13 +6647,6 @@ packages: dev: false optional: true - /@npmcli/fs@3.1.0: - resolution: {integrity: sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dependencies: - semver: 7.6.0 - dev: true - /@npmcli/move-file@1.1.2: resolution: {integrity: sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==} engines: {node: '>=10'} @@ -11801,11 +11775,6 @@ packages: requiresBuild: true dev: false - /abbrev@2.0.0: - resolution: {integrity: sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dev: true - /abort-controller@3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} engines: {node: '>=6.5'} @@ -13342,24 +13311,6 @@ packages: dev: false optional: true - /cacache@18.0.2: - resolution: {integrity: sha512-r3NU8h/P+4lVUHfeRw1dtgQYar3DZMm4/cm2bZgOvrFC/su7budSOeqh52VJIC4U4iG1WWwV6vRW0znqBvxNuw==} - engines: {node: ^16.14.0 || >=18.0.0} - dependencies: - '@npmcli/fs': 3.1.0 - fs-minipass: 3.0.3 - glob: 10.3.12 - lru-cache: 10.2.0 - minipass: 7.0.4 - minipass-collect: 2.0.1 - minipass-flush: 1.0.5 - minipass-pipeline: 1.2.4 - p-map: 4.0.0 - ssri: 10.0.5 - tar: 6.2.1 - unique-filename: 3.0.0 - dev: true - /cache-base@1.0.1: resolution: {integrity: sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==} engines: {node: '>=0.10.0'} @@ -16478,6 +16429,8 @@ packages: resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} engines: {node: '>=6'} requiresBuild: true + dev: false + optional: true /env-paths@3.0.0: resolution: {integrity: sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==} @@ -16505,6 +16458,8 @@ packages: /err-code@2.0.3: resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==} requiresBuild: true + dev: false + optional: true /error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} @@ -17781,10 +17736,6 @@ packages: jest-util: 29.7.0 dev: true - /exponential-backoff@3.1.1: - resolution: {integrity: sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==} - dev: true - /express-basic-auth@1.2.1: resolution: {integrity: sha512-L6YQ1wQ/mNjVLAmK3AG1RK6VkokA1BIY6wmiH304Xtt/cLTps40EusZsU1Uop+v9lTDPxdtzbFmdXfFO3KEnwA==} dependencies: @@ -18817,13 +18768,6 @@ packages: dependencies: minipass: 3.3.6 - /fs-minipass@3.0.3: - resolution: {integrity: sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dependencies: - minipass: 7.0.4 - dev: true - /fs-monkey@1.0.5: resolution: {integrity: sha512-8uMbBjrhzW76TYgEV27Y5E//W2f/lTFmx78P2w19FZSxarhI/798APGQyuGCwmkNxgwGRhrLfvWyLBvNtuOmew==} @@ -21609,6 +21553,8 @@ packages: dependencies: jsbn: 1.1.0 sprintf-js: 1.1.3 + dev: false + optional: true /ip-regex@4.3.0: resolution: {integrity: sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==} @@ -21946,6 +21892,8 @@ packages: /is-lambda@1.0.1: resolution: {integrity: sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==} requiresBuild: true + dev: false + optional: true /is-lower-case@2.0.2: resolution: {integrity: sha512-bVcMJy4X5Og6VZfdOZstSexlEy20Sr0k/p/b2IlQJlfdKAQuMpiv5w2Ccxb8sKdRUNAG1PnHVHjFSdRDVS6NlQ==} @@ -22241,11 +22189,6 @@ packages: /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - /isexe@3.1.1: - resolution: {integrity: sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==} - engines: {node: '>=16'} - dev: true - /isobject@2.1.0: resolution: {integrity: sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==} engines: {node: '>=0.10.0'} @@ -22978,6 +22921,8 @@ packages: /jsbn@1.1.0: resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==} requiresBuild: true + dev: false + optional: true /jscodeshift@0.15.2(@babel/preset-env@7.24.4): resolution: {integrity: sha512-FquR7Okgmc4Sd0aEDwqho3rEiKR3BdvuG9jfdHjLJ6JQoWSMpavug3AoIfnfWhxFlf+5pzQh8qjqz0DWFrNQzA==} @@ -23767,25 +23712,6 @@ packages: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} dev: false - /make-fetch-happen@13.0.0: - resolution: {integrity: sha512-7ThobcL8brtGo9CavByQrQi+23aIfgYU++wg4B87AIS8Rb2ZBt/MEaDqzA00Xwv/jUjAjYkLHjVolYuTLKda2A==} - engines: {node: ^16.14.0 || >=18.0.0} - dependencies: - '@npmcli/agent': 2.2.2 - cacache: 18.0.2 - http-cache-semantics: 4.1.1 - is-lambda: 1.0.1 - minipass: 7.0.4 - minipass-fetch: 3.0.4 - minipass-flush: 1.0.5 - minipass-pipeline: 1.2.4 - negotiator: 0.6.3 - promise-retry: 2.0.1 - ssri: 10.0.5 - transitivePeerDependencies: - - supports-color - dev: true - /make-fetch-happen@9.1.0: resolution: {integrity: sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==} engines: {node: '>= 10'} @@ -24696,13 +24622,6 @@ packages: dev: false optional: true - /minipass-collect@2.0.1: - resolution: {integrity: sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw==} - engines: {node: '>=16 || 14 >=14.17'} - dependencies: - minipass: 7.0.4 - dev: true - /minipass-fetch@1.4.1: resolution: {integrity: sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==} engines: {node: '>=8'} @@ -24716,23 +24635,14 @@ packages: dev: false optional: true - /minipass-fetch@3.0.4: - resolution: {integrity: sha512-jHAqnA728uUpIaFm7NWsCnqKT6UqZz7GcI/bDpPATuwYyKwJwW0remxSCxUlKiEty+eopHGa3oc8WxgQ1FFJqg==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dependencies: - minipass: 7.0.4 - minipass-sized: 1.0.3 - minizlib: 2.1.2 - optionalDependencies: - encoding: 0.1.13 - dev: true - /minipass-flush@1.0.5: resolution: {integrity: sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==} engines: {node: '>= 8'} requiresBuild: true dependencies: minipass: 3.3.6 + dev: false + optional: true /minipass-pipeline@1.2.4: resolution: {integrity: sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==} @@ -24740,6 +24650,8 @@ packages: requiresBuild: true dependencies: minipass: 3.3.6 + dev: false + optional: true /minipass-sized@1.0.3: resolution: {integrity: sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==} @@ -24747,6 +24659,8 @@ packages: requiresBuild: true dependencies: minipass: 3.3.6 + dev: false + optional: true /minipass@3.3.6: resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} @@ -25354,25 +25268,6 @@ packages: hasBin: true dev: false - /node-gyp@10.0.1: - resolution: {integrity: sha512-gg3/bHehQfZivQVfqIyy8wTdSymF9yTyP4CJifK73imyNMU8AIGQE2pUa7dNWfmMeG9cDVF2eehiRMv0LC1iAg==} - engines: {node: ^16.14.0 || >=18.0.0} - hasBin: true - dependencies: - env-paths: 2.2.1 - exponential-backoff: 3.1.1 - glob: 10.3.12 - graceful-fs: 4.2.11 - make-fetch-happen: 13.0.0 - nopt: 7.2.0 - proc-log: 3.0.0 - semver: 7.6.0 - tar: 6.2.1 - which: 4.0.0 - transitivePeerDependencies: - - supports-color - dev: true - /node-gyp@8.4.1: resolution: {integrity: sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==} engines: {node: '>= 10.12.0'} @@ -25468,14 +25363,6 @@ packages: abbrev: 1.1.1 dev: false - /nopt@7.2.0: - resolution: {integrity: sha512-CVDtwCdhYIvnAzFoJ6NJ6dX3oga9/HyciQDnG1vQDjSLMeKLJ4A93ZqYKDrgYSr1FBY5/hMYC+2VCi24pgpkGA==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - hasBin: true - dependencies: - abbrev: 2.0.0 - dev: true - /normalize-node-version@12.4.0: resolution: {integrity: sha512-0oLZN5xcyKVrSHMk8/9RuNblEe7HEsXAt5Te2xmMiZD9VX7bqWYe0HMyfqSYFD3xv0949lZuXaEwjTqle1uWWQ==} engines: {node: '>=14.18.0'} @@ -27575,11 +27462,6 @@ packages: - supports-color dev: false - /proc-log@3.0.0: - resolution: {integrity: sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dev: true - /process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} @@ -27624,6 +27506,8 @@ packages: dependencies: err-code: 2.0.3 retry: 0.12.0 + dev: false + optional: true /promise@7.3.1: resolution: {integrity: sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==} @@ -30136,6 +30020,8 @@ packages: resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} requiresBuild: true + dev: false + optional: true /snake-case@3.0.4: resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==} @@ -30236,17 +30122,6 @@ packages: dev: false optional: true - /socks-proxy-agent@8.0.3: - resolution: {integrity: sha512-VNegTZKhuGq5vSD6XNKlbqWhyt/40CgoEw8XxD6dhnm8Jq9IEa3nIa4HwnM8XOqU0CdB0BwWVXusqiFXfHB3+A==} - engines: {node: '>= 14'} - dependencies: - agent-base: 7.1.1 - debug: 4.3.4 - socks: 2.8.3 - transitivePeerDependencies: - - supports-color - dev: true - /socks@2.8.3: resolution: {integrity: sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==} engines: {node: '>= 10.0.0', npm: '>= 3.0.0'} @@ -30254,6 +30129,8 @@ packages: dependencies: ip-address: 9.0.5 smart-buffer: 4.2.0 + dev: false + optional: true /sonic-boom@3.8.1: resolution: {integrity: sha512-y4Z8LCDBuum+PBP3lSV7RHrXscqksve/bi0as7mhwVnBW+/wUqKT/2Kb7um8yqcFy0duYbbPxzt89Zy2nOCaxg==} @@ -30469,13 +30346,6 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: true - /ssri@10.0.5: - resolution: {integrity: sha512-bSf16tAFkGeRlUNDjXu8FzaMQt6g2HZJrun7mtMbIPOddxt3GLMSz5VWUWcqTJUPfLEaDIepGxv+bYQW49596A==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dependencies: - minipass: 7.0.4 - dev: true - /ssri@8.0.1: resolution: {integrity: sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==} engines: {node: '>= 8'} @@ -32129,13 +31999,6 @@ packages: dev: false optional: true - /unique-filename@3.0.0: - resolution: {integrity: sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dependencies: - unique-slug: 4.0.0 - dev: true - /unique-slug@2.0.2: resolution: {integrity: sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==} requiresBuild: true @@ -32144,13 +32007,6 @@ packages: dev: false optional: true - /unique-slug@4.0.0: - resolution: {integrity: sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dependencies: - imurmurhash: 0.1.4 - dev: true - /unique-string@2.0.0: resolution: {integrity: sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==} engines: {node: '>=8'} @@ -33710,14 +33566,6 @@ packages: dependencies: isexe: 2.0.0 - /which@4.0.0: - resolution: {integrity: sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==} - engines: {node: ^16.13.0 || >=18.0.0} - hasBin: true - dependencies: - isexe: 3.1.1 - dev: true - /why-is-node-running@2.2.2: resolution: {integrity: sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==} engines: {node: '>=8'} From 939466193c89df0bf3ee1ec9c4c258cc9a185810 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Thu, 25 Apr 2024 14:18:25 +0200 Subject: [PATCH 39/51] fix(gatsby-oauth): typo --- INIT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INIT.md b/INIT.md index 6d606c3f5..3d69cc6da 100644 --- a/INIT.md +++ b/INIT.md @@ -74,7 +74,7 @@ const publisherClientSecret = randomString(32); replace( ['apps/cms/.lagoon.env', 'apps/website/.lagoon.env'], 'PUBLISHER_OAUTH2_CLIENT_SECRET=REPLACE_ME', - `PUBLISHER_OAUTH2_CLIENT_SECRET='${publisherClientSecret}`, + `PUBLISHER_OAUTH2_CLIENT_SECRET=${publisherClientSecret}`, ); const publisherSessionSecret = randomString(32); replace( From a66950fede763d35cd9d4cc3ad99c51239a3f8c5 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Thu, 25 Apr 2024 19:31:10 +0200 Subject: [PATCH 40/51] chore: rollback pnpm-lock and package.json --- apps/website/package.json | 10 +- packages/ui/package.json | 2 - pnpm-lock.yaml | 303 -------------------------------------- 3 files changed, 1 insertion(+), 314 deletions(-) diff --git a/apps/website/package.json b/apps/website/package.json index 3804aa103..2954fe07e 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -15,10 +15,6 @@ "@custom/decap": "workspace:*", "@custom/schema": "workspace:*", "@custom/ui": "workspace:*", - "@gatsbyjs/reach-router": "^2.0.1", - "@netlify/plugin-nextjs": "^5.0.0", - "babel-loader": "^9.1.3", - "body-parser": "^1.20.2", "gatsby": "^5.13.1", "gatsby-plugin-layout": "^4.13.0", "gatsby-plugin-manifest": "^5.13.0", @@ -31,11 +27,7 @@ "gatsby-source-filesystem": "^5.13.0", "image-size": "^1.1.1", "mime-types": "^2.1.35", - "multer": "1.4.5-lts.1", "netlify-cli": "^17.21.1", - "next": "^14.1.4", - "next-auth": "^4.24.7", - "plugin-nextjs:^4.41.3": "link:@netlify/plugin-nextjs:^4.41.3", "react": "^18.2.0", "react-dom": "^18.2.0" }, @@ -61,7 +53,7 @@ "serve": "netlify dev --cwd=. --dir=public --port=8000", "dev": "pnpm clean && publisher", "open": "open http://127.0.0.1:8000/___status/", - "gatsby:develop": "NEXTAUTH_URL=http://localhost:8000 NEXTAUTH_SECRET=banana ENABLE_GATSBY_REFRESH_ENDPOINT=true pnpm gatsby develop", + "gatsby:develop": "ENABLE_GATSBY_REFRESH_ENDPOINT=true pnpm gatsby develop", "gatsby:refresh": "curl -X POST http://localhost:8000/__refresh", "clean": "gatsby clean" } diff --git a/packages/ui/package.json b/packages/ui/package.json index ab927c93c..f3320b5ce 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -47,7 +47,6 @@ "framer-motion": "^10.17.4", "hast-util-is-element": "^2.1.3", "hast-util-select": "^5.0.5", - "next-auth": "^4.24.7", "query-string": "^9.0.0", "react-hook-form": "^7.49.2", "react-intl": "^6.6.2", @@ -63,7 +62,6 @@ "devDependencies": { "@amazeelabs/bridge-storybook": "^1.2.8", "@amazeelabs/cloudinary-responsive-image": "^1.6.15", - "@faker-js/faker": "^8.4.1", "@formatjs/cli": "^6.2.4", "@storybook/addon-actions": "^7.6.7", "@storybook/addon-coverage": "^1.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0dc78bde2..05006d49f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -301,18 +301,6 @@ importers: '@custom/ui': specifier: workspace:* version: link:../../packages/ui - '@gatsbyjs/reach-router': - specifier: ^2.0.1 - version: 2.0.1(react-dom@18.2.0)(react@18.2.0) - '@netlify/plugin-nextjs': - specifier: ^5.0.0 - version: 5.0.0 - babel-loader: - specifier: ^9.1.3 - version: 9.1.3(@babel/core@7.24.4)(webpack@5.91.0) - body-parser: - specifier: ^1.20.2 - version: 1.20.2 gatsby: specifier: ^5.13.1 version: 5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) @@ -349,21 +337,9 @@ importers: mime-types: specifier: ^2.1.35 version: 2.1.35 - multer: - specifier: 1.4.5-lts.1 - version: 1.4.5-lts.1 netlify-cli: specifier: ^17.21.1 version: 17.21.1(@types/node@18.19.31) - next: - specifier: ^14.1.4 - version: 14.1.4(@babel/core@7.24.4)(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) - next-auth: - specifier: ^4.24.7 - version: 4.24.7(next@14.1.4)(react-dom@18.2.0)(react@18.2.0) - plugin-nextjs:^4.41.3: - specifier: link:@netlify/plugin-nextjs:^4.41.3 - version: link:@netlify/plugin-nextjs:^4.41.3 react: specifier: ^18.2.0 version: 18.2.0 @@ -565,9 +541,6 @@ importers: hast-util-select: specifier: ^5.0.5 version: 5.0.5 - next-auth: - specifier: ^4.24.7 - version: 4.24.7(next@14.1.4)(react-dom@18.2.0)(react@18.2.0) query-string: specifier: ^9.0.0 version: 9.0.0 @@ -596,9 +569,6 @@ importers: '@amazeelabs/cloudinary-responsive-image': specifier: ^1.6.15 version: 1.6.15 - '@faker-js/faker': - specifier: ^8.4.1 - version: 8.4.1 '@formatjs/cli': specifier: ^6.2.4 version: 6.2.4 @@ -4129,11 +4099,6 @@ packages: transitivePeerDependencies: - supports-color - /@faker-js/faker@8.4.1: - resolution: {integrity: sha512-XQ3cU+Q8Uqmrbf2e0cIC/QN43sTBSC8KF12u29Mb47tWrt2hAgBXSgpZMj4Ao8Uk0iJcU99QsOCaIL8934obCg==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0, npm: '>=6.14.13'} - dev: true - /@fal-works/esbuild-plugin-global-externals@2.1.2: resolution: {integrity: sha512-cEee/Z+I12mZcFJshKcCqC8tuX5hG3s+d+9nZ3LabqKF1vKdF41B92pJVCBggjAGORAeOzyyDDKrZwIkLffeOQ==} dev: true @@ -6445,11 +6410,6 @@ packages: '@opentelemetry/api': 1.8.0 dev: false - /@netlify/plugin-nextjs@5.0.0: - resolution: {integrity: sha512-LAeQ6ltXsJyxtk2wDwb75Pu80A+duQvEtDB9Y3xJ16+mb2bQXv5sV9Y6dCdyTCBQjw1h0UGv1bL3vPDLG6Wlcw==} - engines: {node: '>=18.0.0'} - dev: false - /@netlify/plugins-list@6.77.0: resolution: {integrity: sha512-czL3FH61hFhhVQydRj2xjIwLVYHDNskMhRib7dUfOQrUHifqLlUFKp03NwBD87G9BFKXUYGWZMEUU+JjIpVc9w==} engines: {node: ^14.14.0 || >=16.0.0} @@ -6606,91 +6566,6 @@ packages: - supports-color dev: false - /@next/env@14.1.4: - resolution: {integrity: sha512-e7X7bbn3Z6DWnDi75UWn+REgAbLEqxI8Tq2pkFOFAMpWAWApz/YCUhtWMWn410h8Q2fYiYL7Yg5OlxMOCfFjJQ==} - dev: false - - /@next/swc-darwin-arm64@14.1.4: - resolution: {integrity: sha512-ubmUkbmW65nIAOmoxT1IROZdmmJMmdYvXIe8211send9ZYJu+SqxSnJM4TrPj9wmL6g9Atvj0S/2cFmMSS99jg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: false - optional: true - - /@next/swc-darwin-x64@14.1.4: - resolution: {integrity: sha512-b0Xo1ELj3u7IkZWAKcJPJEhBop117U78l70nfoQGo4xUSvv0PJSTaV4U9xQBLvZlnjsYkc8RwQN1HoH/oQmLlQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: false - optional: true - - /@next/swc-linux-arm64-gnu@14.1.4: - resolution: {integrity: sha512-457G0hcLrdYA/u1O2XkRMsDKId5VKe3uKPvrKVOyuARa6nXrdhJOOYU9hkKKyQTMru1B8qEP78IAhf/1XnVqKA==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: false - optional: true - - /@next/swc-linux-arm64-musl@14.1.4: - resolution: {integrity: sha512-l/kMG+z6MB+fKA9KdtyprkTQ1ihlJcBh66cf0HvqGP+rXBbOXX0dpJatjZbHeunvEHoBBS69GYQG5ry78JMy3g==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: false - optional: true - - /@next/swc-linux-x64-gnu@14.1.4: - resolution: {integrity: sha512-BapIFZ3ZRnvQ1uWbmqEGJuPT9cgLwvKtxhK/L2t4QYO7l+/DxXuIGjvp1x8rvfa/x1FFSsipERZK70pewbtJtw==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: false - optional: true - - /@next/swc-linux-x64-musl@14.1.4: - resolution: {integrity: sha512-mqVxTwk4XuBl49qn2A5UmzFImoL1iLm0KQQwtdRJRKl21ylQwwGCxJtIYo2rbfkZHoSKlh/YgztY0qH3wG1xIg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: false - optional: true - - /@next/swc-win32-arm64-msvc@14.1.4: - resolution: {integrity: sha512-xzxF4ErcumXjO2Pvg/wVGrtr9QQJLk3IyQX1ddAC/fi6/5jZCZ9xpuL9Tzc4KPWMFq8GGWFVDMshZOdHGdkvag==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: false - optional: true - - /@next/swc-win32-ia32-msvc@14.1.4: - resolution: {integrity: sha512-WZiz8OdbkpRw6/IU/lredZWKKZopUMhcI2F+XiMAcPja0uZYdMTZQRoQ0WZcvinn9xZAidimE7tN9W5v9Yyfyw==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: false - optional: true - - /@next/swc-win32-x64-msvc@14.1.4: - resolution: {integrity: sha512-4Rto21sPfw555sZ/XNLqfxDUNeLhNYGO2dlPqsnuCg8N8a2a9u1ltqBOPQ4vj1Gf7eJC0W2hHG2eYUHuiXgY2w==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: false - optional: true - /@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1: resolution: {integrity: sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==} dependencies: @@ -6863,10 +6738,6 @@ packages: engines: {node: '>=8.0.0'} dev: false - /@panva/hkdf@1.1.1: - resolution: {integrity: sha512-dhPeilub1NuIG0X5Kvhh9lH4iW3ZsHlnzwgwbOlgwQ2wG1IqFzsgHqmKPk3WzsdWAeaxKJxgM0+W433RmN45GA==} - dev: false - /@parcel/bundler-default@2.8.3(@parcel/core@2.8.3): resolution: {integrity: sha512-yJvRsNWWu5fVydsWk3O2L4yIy3UZiKWO2cPDukGOIWMgp/Vbpp+2Ct5IygVRtE22bnseW/E/oe0PV3d2IkEJGg==} engines: {node: '>= 12.0.0', parcel: ^2.8.3} @@ -9422,12 +9293,6 @@ packages: legacy-swc-helpers: /@swc/helpers@0.4.14 tslib: 2.6.2 - /@swc/helpers@0.5.2: - resolution: {integrity: sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==} - dependencies: - tslib: 2.6.2 - dev: false - /@swc/jest@0.2.36(@swc/core@1.4.13): resolution: {integrity: sha512-8X80dp81ugxs4a11z1ka43FPhP+/e+mJNXJSxiNYk8gIX/jPBtY4gQTrKu/KIoco8bzKuPI5lUxjfLiGsfvnlw==} engines: {npm: '>= 7.0.0'} @@ -12925,19 +12790,6 @@ packages: schema-utils: 2.7.1 webpack: 5.91.0 - /babel-loader@9.1.3(@babel/core@7.24.4)(webpack@5.91.0): - resolution: {integrity: sha512-xG3ST4DglodGf8qSwv0MdeWLhrDsw/32QMdTO5T1ZIp9gQur0HkCyFs7Awskr10JKXFXwpAhiCuYX5oGXnRGbw==} - engines: {node: '>= 14.15.0'} - peerDependencies: - '@babel/core': ^7.12.0 - webpack: '>=5' - dependencies: - '@babel/core': 7.24.4 - find-cache-dir: 4.0.0 - schema-utils: 4.2.0 - webpack: 5.91.0 - dev: false - /babel-plugin-add-module-exports@1.0.4: resolution: {integrity: sha512-g+8yxHUZ60RcyaUpfNzy56OtWW+x9cyEe9j+CranqLiqbju2yf/Cy6ZtYK40EZxtrdHllzlVZgLmcOUCTlJ7Jg==} @@ -16586,7 +16438,6 @@ packages: /encoding@0.1.13: resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==} - requiresBuild: true dependencies: iconv-lite: 0.6.3 @@ -18616,14 +18467,6 @@ packages: make-dir: 3.1.0 pkg-dir: 4.2.0 - /find-cache-dir@4.0.0: - resolution: {integrity: sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg==} - engines: {node: '>=14.16'} - dependencies: - common-path-prefix: 3.0.0 - pkg-dir: 7.0.0 - dev: false - /find-file-up@0.1.3: resolution: {integrity: sha512-mBxmNbVyjg1LQIIpgO8hN+ybWBgDQK8qjht+EbrTCGmmPV/sc7RF1i9stPTD6bpvXZywBdrwRYxhSdJv867L6A==} engines: {node: '>=0.10.0'} @@ -23136,10 +22979,6 @@ packages: '@sideway/formula': 3.0.1 '@sideway/pinpoint': 2.0.0 - /jose@4.15.5: - resolution: {integrity: sha512-jc7BFxgKPKi94uOvEmzlSWFFe2+vASyXaKUpdQKatWAESU2MWjDfFf0fdfc83CDKcA5QecabZeNLyfhe3yKNkg==} - dev: false - /jose@5.2.4: resolution: {integrity: sha512-6ScbIk2WWCeXkmzF6bRPmEuaqy1m8SbsRFMa/FLrSCkGIhj8OLVG/IH+XHVmNMx/KUo8cVWEE6oKR4dJ+S0Rkg==} dev: true @@ -25371,74 +25210,9 @@ packages: qs: 6.12.0 dev: false - /next-auth@4.24.7(next@14.1.4)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-iChjE8ov/1K/z98gdKbn2Jw+2vLgJtVV39X+rCP5SGnVQuco7QOr19FRNGMIrD8d3LYhHWV9j9sKLzq1aDWWQQ==} - peerDependencies: - next: ^12.2.5 || ^13 || ^14 - nodemailer: ^6.6.5 - react: ^17.0.2 || ^18 - react-dom: ^17.0.2 || ^18 - peerDependenciesMeta: - nodemailer: - optional: true - dependencies: - '@babel/runtime': 7.24.4 - '@panva/hkdf': 1.1.1 - cookie: 0.5.0 - jose: 4.15.5 - next: 14.1.4(@babel/core@7.24.4)(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) - oauth: 0.9.15 - openid-client: 5.6.5 - preact: 10.20.2 - preact-render-to-string: 5.2.6(preact@10.20.2) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - uuid: 8.3.2 - dev: false - /next-tick@1.1.0: resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} - /next@14.1.4(@babel/core@7.24.4)(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-1WTaXeSrUwlz/XcnhGTY7+8eiaFvdet5z9u3V2jb+Ek1vFo0VhHKSAIJvDWfQpttWjnyw14kBeq28TPq7bTeEQ==} - engines: {node: '>=18.17.0'} - hasBin: true - peerDependencies: - '@opentelemetry/api': ^1.1.0 - react: ^18.2.0 - react-dom: ^18.2.0 - sass: ^1.3.0 - peerDependenciesMeta: - '@opentelemetry/api': - optional: true - sass: - optional: true - dependencies: - '@next/env': 14.1.4 - '@opentelemetry/api': 1.8.0 - '@swc/helpers': 0.5.2 - busboy: 1.6.0 - caniuse-lite: 1.0.30001608 - graceful-fs: 4.2.11 - postcss: 8.4.31 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - styled-jsx: 5.1.1(@babel/core@7.24.4)(react@18.2.0) - optionalDependencies: - '@next/swc-darwin-arm64': 14.1.4 - '@next/swc-darwin-x64': 14.1.4 - '@next/swc-linux-arm64-gnu': 14.1.4 - '@next/swc-linux-arm64-musl': 14.1.4 - '@next/swc-linux-x64-gnu': 14.1.4 - '@next/swc-linux-x64-musl': 14.1.4 - '@next/swc-win32-arm64-msvc': 14.1.4 - '@next/swc-win32-ia32-msvc': 14.1.4 - '@next/swc-win32-x64-msvc': 14.1.4 - transitivePeerDependencies: - - '@babel/core' - - babel-plugin-macros - dev: false - /no-case@3.0.4: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} dependencies: @@ -25793,10 +25567,6 @@ packages: ufo: 1.5.3 dev: true - /oauth@0.9.15: - resolution: {integrity: sha512-a5ERWK1kh38ExDEfoO6qUHJb32rd7aYmPHuyCu3Fta/cnICvYmgd2uhuKXvPD+PXB+gCEYYEaQdIRAjCOwAKNA==} - dev: false - /object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -25810,11 +25580,6 @@ packages: kind-of: 3.2.2 dev: false - /object-hash@2.2.0: - resolution: {integrity: sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==} - engines: {node: '>= 6'} - dev: false - /object-hash@3.0.0: resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==} engines: {node: '>= 6'} @@ -25909,11 +25674,6 @@ packages: /ohash@1.1.3: resolution: {integrity: sha512-zuHHiGTYTA1sYJ/wZN+t5HKZaH23i4yI1HMwbuXm24Nid7Dv0KcuRlKoNKS9UNfAVSBlnGLcuQrnOKWOZoEGaw==} - /oidc-token-hash@5.0.3: - resolution: {integrity: sha512-IF4PcGgzAr6XXSff26Sk/+P4KZFJVuHAJZj3wgO3vX2bMdNVp/QXTP3P7CEm9V1IdG8lDLY3HhiqpsE/nOwpPw==} - engines: {node: ^10.13.0 || >=12.0.0} - dev: false - /ol-mapbox-style@8.2.1: resolution: {integrity: sha512-3kBBuZC627vDL8vnUdfVbCbfkhkcZj2kXPHQcuLhC4JJEA+XkEVEtEde8x8+AZctRbHwBkSiubTPaRukgLxIRw==} dependencies: @@ -26000,15 +25760,6 @@ packages: is-docker: 2.2.1 is-wsl: 2.2.0 - /openid-client@5.6.5: - resolution: {integrity: sha512-5P4qO9nGJzB5PI0LFlhj4Dzg3m4odt0qsJTfyEtZyOlkgpILwEioOhVVJOrS1iVH494S4Ee5OCjjg6Bf5WOj3w==} - dependencies: - jose: 4.15.5 - lru-cache: 6.0.0 - object-hash: 2.2.0 - oidc-token-hash: 5.0.3 - dev: false - /opentracing@0.14.7: resolution: {integrity: sha512-vz9iS7MJ5+Bp1URw8Khvdyw1H/hGvzHWlKQ7eRrQojSCDL1/SrWfrY9QebLw97n2deyRtzHRC3MkQfVNUCo91Q==} engines: {node: '>=0.10'} @@ -27530,15 +27281,6 @@ packages: quote-unquote: 1.0.0 dev: false - /postcss@8.4.31: - resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.2.0 - dev: false - /postcss@8.4.32: resolution: {integrity: sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==} engines: {node: ^10 || ^12 || >=14} @@ -27556,19 +27298,6 @@ packages: picocolors: 1.0.0 source-map-js: 1.2.0 - /preact-render-to-string@5.2.6(preact@10.20.2): - resolution: {integrity: sha512-JyhErpYOvBV1hEPwIxc/fHWXPfnEGdRKxc8gFdAZ7XV4tlzyzG847XAyEZqoDnynP88akM4eaHcSOzNcLWFguw==} - peerDependencies: - preact: '>=10' - dependencies: - preact: 10.20.2 - pretty-format: 3.8.0 - dev: false - - /preact@10.20.2: - resolution: {integrity: sha512-S1d1ernz3KQ+Y2awUxKakpfOg2CEmJmwOP+6igPx6dgr6pgDvenqYviyokWso2rhHvGtTlWWnJDa7RaPbQerTg==} - dev: false - /prebuild-install@7.1.2: resolution: {integrity: sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==} engines: {node: '>=10'} @@ -27686,10 +27415,6 @@ packages: ansi-styles: 5.2.0 react-is: 18.2.0 - /pretty-format@3.8.0: - resolution: {integrity: sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==} - dev: false - /pretty-hrtime@1.0.3: resolution: {integrity: sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==} engines: {node: '>= 0.8'} @@ -29719,16 +29444,6 @@ packages: ajv: 6.12.6 ajv-keywords: 3.5.2(ajv@6.12.6) - /schema-utils@4.2.0: - resolution: {integrity: sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==} - engines: {node: '>= 12.13.0'} - dependencies: - '@types/json-schema': 7.0.15 - ajv: 8.12.0 - ajv-formats: 2.1.1(ajv@8.12.0) - ajv-keywords: 5.1.0(ajv@8.12.0) - dev: false - /scroll-into-view-if-needed@2.2.31: resolution: {integrity: sha512-dGCXy99wZQivjmjIqihaBQNjryrz5rueJY7eHfTdyWEiR4ttYpsajb14rn9s5d4DY4EcY6+4+U/maARBXJedkA==} dependencies: @@ -31028,24 +30743,6 @@ packages: dependencies: inline-style-parser: 0.1.1 - /styled-jsx@5.1.1(@babel/core@7.24.4)(react@18.2.0): - resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==} - engines: {node: '>= 12.0.0'} - peerDependencies: - '@babel/core': '*' - babel-plugin-macros: '*' - react: '>= 16.8.0 || 17.x.x || ^18.0.0-0' - peerDependenciesMeta: - '@babel/core': - optional: true - babel-plugin-macros: - optional: true - dependencies: - '@babel/core': 7.24.4 - client-only: 0.0.1 - react: 18.2.0 - dev: false - /stylehacks@5.1.1(postcss@8.4.38): resolution: {integrity: sha512-sBpcd5Hx7G6seo7b1LkpttvTz7ikD0LlH5RmdcBNb6fFR0Fl7LQwHDFr300q4cwUqi+IYrFGmsIHieMBfnN/Bw==} engines: {node: ^10 || ^12 || >=14.0} From f878d847c4b6d8d8873bff77cddc51e3969e3ebd Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Thu, 25 Apr 2024 19:36:04 +0200 Subject: [PATCH 41/51] chore: re-add next-auth --- apps/website/package.json | 5 +- packages/ui/package.json | 1 + pnpm-lock.yaml | 477 ++++++++++++++++++++++++++++++++------ 3 files changed, 416 insertions(+), 67 deletions(-) diff --git a/apps/website/package.json b/apps/website/package.json index 2954fe07e..503886d30 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -28,6 +28,7 @@ "image-size": "^1.1.1", "mime-types": "^2.1.35", "netlify-cli": "^17.21.1", + "next-auth": "^4.24.7", "react": "^18.2.0", "react-dom": "^18.2.0" }, @@ -49,11 +50,11 @@ "build:drupal": "CLOUDINARY_CLOUDNAME=test pnpm start-test start:drupal 8888 build:gatsby", "build:gatsby": "gatsby build", "build": "if node has-drupal.mjs; then pnpm build:drupal; else pnpm build:gatsby; fi", - "start": "publisher", + "start": "NEXTAUTH_URL=http://localhost:8000 NEXTAUTH_SECRET=banana publisher", "serve": "netlify dev --cwd=. --dir=public --port=8000", "dev": "pnpm clean && publisher", "open": "open http://127.0.0.1:8000/___status/", - "gatsby:develop": "ENABLE_GATSBY_REFRESH_ENDPOINT=true pnpm gatsby develop", + "gatsby:develop": "NEXTAUTH_URL=http://localhost:8000 NEXTAUTH_SECRET=banana ENABLE_GATSBY_REFRESH_ENDPOINT=true pnpm gatsby develop", "gatsby:refresh": "curl -X POST http://localhost:8000/__refresh", "clean": "gatsby clean" } diff --git a/packages/ui/package.json b/packages/ui/package.json index f3320b5ce..aaddf700a 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -47,6 +47,7 @@ "framer-motion": "^10.17.4", "hast-util-is-element": "^2.1.3", "hast-util-select": "^5.0.5", + "next-auth": "^4.24.7", "query-string": "^9.0.0", "react-hook-form": "^7.49.2", "react-intl": "^6.6.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 05006d49f..5e9fb00b4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,7 +16,7 @@ importers: devDependencies: '@commitlint/cli': specifier: ^18.4.3 - version: 18.4.3(@types/node@18.19.31)(typescript@5.3.3) + version: 18.4.3(@types/node@20.11.17)(typescript@5.3.3) '@commitlint/config-conventional': specifier: ^18.4.3 version: 18.4.3 @@ -64,7 +64,7 @@ importers: version: 5.3.3 vitest: specifier: ^1.1.1 - version: 1.1.1(@types/node@18.19.31) + version: 1.1.1(@types/node@20.11.17) apps/cms: dependencies: @@ -279,7 +279,7 @@ importers: version: 1.0.1 '@amazeelabs/gatsby-source-silverback': specifier: ^1.14.0 - version: 1.14.0(@types/node@18.19.31)(gatsby-plugin-sharp@5.13.1)(gatsby@5.13.1)(typescript@4.9.5) + version: 1.14.0(@types/node@20.11.17)(gatsby-plugin-sharp@5.13.1)(gatsby@5.13.1)(typescript@4.9.5) '@amazeelabs/publisher': specifier: ^2.4.17 version: 2.4.17(@types/react@18.2.46)(react@18.2.0)(typescript@4.9.5) @@ -339,7 +339,10 @@ importers: version: 2.1.35 netlify-cli: specifier: ^17.21.1 - version: 17.21.1(@types/node@18.19.31) + version: 17.21.1(@types/node@20.11.17) + next-auth: + specifier: ^4.24.7 + version: 4.24.7(next@14.2.3)(react-dom@18.2.0)(react@18.2.0) react: specifier: ^18.2.0 version: 18.2.0 @@ -373,7 +376,7 @@ importers: version: 2.0.3 vitest: specifier: ^1.1.1 - version: 1.1.1(@types/node@18.19.31)(happy-dom@12.10.3) + version: 1.1.1(@types/node@20.11.17)(happy-dom@12.10.3) packages/drupal/custom: {} @@ -541,6 +544,9 @@ importers: hast-util-select: specifier: ^5.0.5 version: 5.0.5 + next-auth: + specifier: ^4.24.7 + version: 4.24.7(next@14.2.3)(react-dom@18.2.0)(react@18.2.0) query-string: specifier: ^9.0.0 version: 9.0.0 @@ -601,7 +607,7 @@ importers: version: 8.0.0-alpha.14(jest@29.7.0)(vitest@1.1.1) '@storybook/test-runner': specifier: ^0.16.0 - version: 0.16.0(@types/node@18.19.31) + version: 0.16.0(@types/node@20.11.17) '@swc/cli': specifier: ^0.1.63 version: 0.1.63(@swc/core@1.3.102) @@ -694,7 +700,7 @@ importers: version: 5.3.3 vite: specifier: ^5.0.10 - version: 5.0.10(@types/node@18.19.31) + version: 5.0.10(@types/node@20.11.17) vite-imagetools: specifier: ^6.2.9 version: 6.2.9 @@ -703,7 +709,7 @@ importers: version: 1.0.3 vitest: specifier: ^1.1.1 - version: 1.1.1(@types/node@18.19.31)(happy-dom@12.10.3) + version: 1.1.1(@types/node@20.11.17)(happy-dom@12.10.3) tests/e2e: devDependencies: @@ -996,17 +1002,17 @@ packages: - utf-8-validate dev: false - /@amazeelabs/gatsby-source-silverback@1.14.0(@types/node@18.19.31)(gatsby-plugin-sharp@5.13.1)(gatsby@5.13.1)(typescript@4.9.5): + /@amazeelabs/gatsby-source-silverback@1.14.0(@types/node@18.19.31)(gatsby-plugin-sharp@5.13.1)(gatsby@5.13.3)(typescript@5.4.4): resolution: {integrity: sha512-tIL4lPx7mQDBH5XiouXgTEhOIXF/oKDss0OYbHJEbxXVofv4IDifZcZZO1Hw9oWmrTSaJhYoC2Bdm+2kdvxf6g==} peerDependencies: gatsby-plugin-sharp: ^5.13.1 dependencies: '@amazeelabs/graphql-directives': 1.3.2 fetch-retry: 5.0.6 - gatsby-graphql-source-toolkit: 2.0.4(gatsby@5.13.1) - gatsby-plugin-sharp: 5.13.1(gatsby@5.13.1)(graphql@16.8.1) + gatsby-graphql-source-toolkit: 2.0.4(gatsby@5.13.3) + gatsby-plugin-sharp: 5.13.1(gatsby@5.13.3)(graphql@16.8.1) graphql: 16.8.1 - graphql-config: 5.0.3(@types/node@18.19.31)(graphql@16.8.1)(typescript@4.9.5) + graphql-config: 5.0.3(@types/node@18.19.31)(graphql@16.8.1)(typescript@5.4.4) isomorphic-fetch: 3.0.0 lodash-es: 4.17.21 node-fetch: 3.3.2 @@ -1021,17 +1027,17 @@ packages: - utf-8-validate dev: false - /@amazeelabs/gatsby-source-silverback@1.14.0(@types/node@18.19.31)(gatsby-plugin-sharp@5.13.1)(gatsby@5.13.3)(typescript@5.4.4): + /@amazeelabs/gatsby-source-silverback@1.14.0(@types/node@20.11.17)(gatsby-plugin-sharp@5.13.1)(gatsby@5.13.1)(typescript@4.9.5): resolution: {integrity: sha512-tIL4lPx7mQDBH5XiouXgTEhOIXF/oKDss0OYbHJEbxXVofv4IDifZcZZO1Hw9oWmrTSaJhYoC2Bdm+2kdvxf6g==} peerDependencies: gatsby-plugin-sharp: ^5.13.1 dependencies: '@amazeelabs/graphql-directives': 1.3.2 fetch-retry: 5.0.6 - gatsby-graphql-source-toolkit: 2.0.4(gatsby@5.13.3) - gatsby-plugin-sharp: 5.13.1(gatsby@5.13.3)(graphql@16.8.1) + gatsby-graphql-source-toolkit: 2.0.4(gatsby@5.13.1) + gatsby-plugin-sharp: 5.13.1(gatsby@5.13.1)(graphql@16.8.1) graphql: 16.8.1 - graphql-config: 5.0.3(@types/node@18.19.31)(graphql@16.8.1)(typescript@5.4.4) + graphql-config: 5.0.3(@types/node@20.11.17)(graphql@16.8.1)(typescript@4.9.5) isomorphic-fetch: 3.0.0 lodash-es: 4.17.21 node-fetch: 3.3.2 @@ -2687,14 +2693,14 @@ packages: resolution: {integrity: sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==} engines: {node: '>=0.1.90'} - /@commitlint/cli@18.4.3(@types/node@18.19.31)(typescript@5.3.3): + /@commitlint/cli@18.4.3(@types/node@20.11.17)(typescript@5.3.3): resolution: {integrity: sha512-zop98yfB3A6NveYAZ3P1Mb6bIXuCeWgnUfVNkH4yhIMQpQfzFwseadazOuSn0OOfTt0lWuFauehpm9GcqM5lww==} engines: {node: '>=v18'} hasBin: true dependencies: '@commitlint/format': 18.6.1 '@commitlint/lint': 18.6.1 - '@commitlint/load': 18.6.1(@types/node@18.19.31)(typescript@5.3.3) + '@commitlint/load': 18.6.1(@types/node@20.11.17)(typescript@5.3.3) '@commitlint/read': 18.6.1 '@commitlint/types': 18.6.1 execa: 5.1.1 @@ -2765,7 +2771,7 @@ packages: '@commitlint/types': 18.6.1 dev: true - /@commitlint/load@18.6.1(@types/node@18.19.31)(typescript@5.3.3): + /@commitlint/load@18.6.1(@types/node@20.11.17)(typescript@5.3.3): resolution: {integrity: sha512-p26x8734tSXUHoAw0ERIiHyW4RaI4Bj99D8YgUlVV9SedLf8hlWAfyIFhHRIhfPngLlCe0QYOdRKYFt8gy56TA==} engines: {node: '>=v18'} dependencies: @@ -2775,7 +2781,7 @@ packages: '@commitlint/types': 18.6.1 chalk: 4.1.2 cosmiconfig: 8.3.6(typescript@5.3.3) - cosmiconfig-typescript-loader: 5.0.0(@types/node@18.19.31)(cosmiconfig@8.3.6)(typescript@5.3.3) + cosmiconfig-typescript-loader: 5.0.0(@types/node@20.11.17)(cosmiconfig@8.3.6)(typescript@5.3.3) lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 lodash.uniq: 4.5.0 @@ -4738,6 +4744,24 @@ packages: - '@types/node' dev: false + /@graphql-tools/executor-http@1.0.9(@types/node@20.11.17)(graphql@16.8.1): + resolution: {integrity: sha512-+NXaZd2MWbbrWHqU4EhXcrDbogeiCDmEbrAN+rMn4Nu2okDjn2MTFDbTIab87oEubQCH4Te1wDkWPKrzXup7+Q==} + engines: {node: '>=16.0.0'} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/utils': 10.1.2(graphql@16.8.1) + '@repeaterjs/repeater': 3.0.5 + '@whatwg-node/fetch': 0.9.17 + extract-files: 11.0.0 + graphql: 16.8.1 + meros: 1.3.0(@types/node@20.11.17) + tslib: 2.6.2 + value-or-promise: 1.0.12 + transitivePeerDependencies: + - '@types/node' + dev: false + /@graphql-tools/executor-legacy-ws@1.0.6(graphql@16.8.1): resolution: {integrity: sha512-lDSxz9VyyquOrvSuCCnld3256Hmd+QI2lkmkEv7d4mdzkxkK4ddAWW1geQiWrQvWmdsmcnGGlZ7gDGbhEExwqg==} engines: {node: '>=16.0.0'} @@ -5071,6 +5095,33 @@ packages: - utf-8-validate dev: false + /@graphql-tools/url-loader@8.0.2(@types/node@20.11.17)(graphql@16.8.1): + resolution: {integrity: sha512-1dKp2K8UuFn7DFo1qX5c1cyazQv2h2ICwA9esHblEqCYrgf69Nk8N7SODmsfWg94OEaI74IqMoM12t7eIGwFzQ==} + engines: {node: '>=16.0.0'} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@ardatan/sync-fetch': 0.0.1 + '@graphql-tools/delegate': 10.0.4(graphql@16.8.1) + '@graphql-tools/executor-graphql-ws': 1.1.2(graphql@16.8.1) + '@graphql-tools/executor-http': 1.0.9(@types/node@20.11.17)(graphql@16.8.1) + '@graphql-tools/executor-legacy-ws': 1.0.6(graphql@16.8.1) + '@graphql-tools/utils': 10.1.2(graphql@16.8.1) + '@graphql-tools/wrap': 10.0.5(graphql@16.8.1) + '@types/ws': 8.5.10 + '@whatwg-node/fetch': 0.9.17 + graphql: 16.8.1 + isomorphic-ws: 5.0.0(ws@8.16.0) + tslib: 2.6.2 + value-or-promise: 1.0.12 + ws: 8.16.0 + transitivePeerDependencies: + - '@types/node' + - bufferutil + - encoding + - utf-8-validate + dev: false + /@graphql-tools/utils@10.1.2(graphql@16.8.1): resolution: {integrity: sha512-fX13CYsDnX4yifIyNdiN0cVygz/muvkreWWem6BBw130+ODbRRgfiVveL0NizCEnKXkpvdeTy9Bxvo9LIKlhrw==} engines: {node: '>=16.0.0'} @@ -5683,7 +5734,7 @@ packages: magic-string: 0.27.0 react-docgen-typescript: 2.2.2(typescript@5.3.3) typescript: 5.3.3 - vite: 5.0.10(@types/node@18.19.31) + vite: 5.0.10(@types/node@20.11.17) dev: true /@jridgewell/gen-mapping@0.3.5: @@ -6032,7 +6083,7 @@ packages: yargs: 17.7.2 dev: false - /@netlify/build@29.36.6(@opentelemetry/api@1.8.0)(@types/node@18.19.31): + /@netlify/build@29.36.6(@opentelemetry/api@1.8.0)(@types/node@20.11.17): resolution: {integrity: sha512-crNoY5Vr7tAodBfYdz8weM+NTw5q6W6ArkowNw6QhKXa4iRXT5MY6H0c2ztsge9o5gAYs55bDhBpKiPcZlzDlA==} engines: {node: ^14.16.0 || >=16.0.0} hasBin: true @@ -6097,7 +6148,7 @@ packages: strip-ansi: 7.1.0 supports-color: 9.4.0 terminal-link: 3.0.0 - ts-node: 10.9.2(@types/node@18.19.31)(typescript@5.4.4) + ts-node: 10.9.2(@types/node@20.11.17)(typescript@5.4.4) typescript: 5.4.4 uuid: 9.0.0 yargs: 17.7.2 @@ -6566,6 +6617,91 @@ packages: - supports-color dev: false + /@next/env@14.2.3: + resolution: {integrity: sha512-W7fd7IbkfmeeY2gXrzJYDx8D2lWKbVoTIj1o1ScPHNzvp30s1AuoEFSdr39bC5sjxJaxTtq3OTCZboNp0lNWHA==} + dev: false + + /@next/swc-darwin-arm64@14.2.3: + resolution: {integrity: sha512-3pEYo/RaGqPP0YzwnlmPN2puaF2WMLM3apt5jLW2fFdXD9+pqcoTzRk+iZsf8ta7+quAe4Q6Ms0nR0SFGFdS1A==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@next/swc-darwin-x64@14.2.3: + resolution: {integrity: sha512-6adp7waE6P1TYFSXpY366xwsOnEXM+y1kgRpjSRVI2CBDOcbRjsJ67Z6EgKIqWIue52d2q/Mx8g9MszARj8IEA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm64-gnu@14.2.3: + resolution: {integrity: sha512-cuzCE/1G0ZSnTAHJPUT1rPgQx1w5tzSX7POXSLaS7w2nIUJUD+e25QoXD/hMfxbsT9rslEXugWypJMILBj/QsA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm64-musl@14.2.3: + resolution: {integrity: sha512-0D4/oMM2Y9Ta3nGuCcQN8jjJjmDPYpHX9OJzqk42NZGJocU2MqhBq5tWkJrUQOQY9N+In9xOdymzapM09GeiZw==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-x64-gnu@14.2.3: + resolution: {integrity: sha512-ENPiNnBNDInBLyUU5ii8PMQh+4XLr4pG51tOp6aJ9xqFQ2iRI6IH0Ds2yJkAzNV1CfyagcyzPfROMViS2wOZ9w==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-x64-musl@14.2.3: + resolution: {integrity: sha512-BTAbq0LnCbF5MtoM7I/9UeUu/8ZBY0i8SFjUMCbPDOLv+un67e2JgyN4pmgfXBwy/I+RHu8q+k+MCkDN6P9ViQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-arm64-msvc@14.2.3: + resolution: {integrity: sha512-AEHIw/dhAMLNFJFJIJIyOFDzrzI5bAjI9J26gbO5xhAKHYTZ9Or04BesFPXiAYXDNdrwTP2dQceYA4dL1geu8A==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-ia32-msvc@14.2.3: + resolution: {integrity: sha512-vga40n1q6aYb0CLrM+eEmisfKCR45ixQYXuBXxOOmmoV8sYST9k7E3US32FsY+CkkF7NtzdcebiFT4CHuMSyZw==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-x64-msvc@14.2.3: + resolution: {integrity: sha512-Q1/zm43RWynxrO7lW4ehciQVj+5ePBhOK+/K2P7pLFX3JaJ/IZVC69SHidrmZSOkqz7ECIOhhy7XhAFG4JYyHA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: false + optional: true + /@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1: resolution: {integrity: sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==} dependencies: @@ -6738,6 +6874,10 @@ packages: engines: {node: '>=8.0.0'} dev: false + /@panva/hkdf@1.1.1: + resolution: {integrity: sha512-dhPeilub1NuIG0X5Kvhh9lH4iW3ZsHlnzwgwbOlgwQ2wG1IqFzsgHqmKPk3WzsdWAeaxKJxgM0+W433RmN45GA==} + dev: false + /@parcel/bundler-default@2.8.3(@parcel/core@2.8.3): resolution: {integrity: sha512-yJvRsNWWu5fVydsWk3O2L4yIy3UZiKWO2cPDukGOIWMgp/Vbpp+2Ct5IygVRtE22bnseW/E/oe0PV3d2IkEJGg==} engines: {node: '>= 12.0.0', parcel: ^2.8.3} @@ -8352,7 +8492,7 @@ packages: magic-string: 0.30.9 rollup: 3.29.4 typescript: 5.3.3 - vite: 5.0.10(@types/node@18.19.31) + vite: 5.0.10(@types/node@20.11.17) transitivePeerDependencies: - encoding - supports-color @@ -8861,7 +9001,7 @@ packages: react: 18.2.0 react-docgen: 7.0.3 react-dom: 18.2.0(react@18.2.0) - vite: 5.0.10(@types/node@18.19.31) + vite: 5.0.10(@types/node@20.11.17) transitivePeerDependencies: - '@preact/preset-vite' - encoding @@ -8935,7 +9075,7 @@ packages: - supports-color dev: true - /@storybook/test-runner@0.16.0(@types/node@18.19.31): + /@storybook/test-runner@0.16.0(@types/node@20.11.17): resolution: {integrity: sha512-LDmNbKFoEDW/VS9o6KR8e1r5MnbCc5ZojUfi5yqLdq80gFD7BvilgKgV0lUh/xWHryzoy+Ids5LYgrPJZmU2dQ==} engines: {node: ^16.10.0 || ^18.0.0 || >=20.0.0} hasBin: true @@ -8955,7 +9095,7 @@ packages: commander: 9.5.0 expect-playwright: 0.8.0 glob: 10.3.12 - jest: 29.7.0(@types/node@18.19.31) + jest: 29.7.0(@types/node@20.11.17) jest-circus: 29.7.0 jest-environment-node: 29.7.0 jest-junit: 16.0.0 @@ -9293,6 +9433,13 @@ packages: legacy-swc-helpers: /@swc/helpers@0.4.14 tslib: 2.6.2 + /@swc/helpers@0.5.5: + resolution: {integrity: sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A==} + dependencies: + '@swc/counter': 0.1.3 + tslib: 2.6.2 + dev: false + /@swc/jest@0.2.36(@swc/core@1.4.13): resolution: {integrity: sha512-8X80dp81ugxs4a11z1ka43FPhP+/e+mJNXJSxiNYk8gIX/jPBtY4gQTrKu/KIoco8bzKuPI5lUxjfLiGsfvnlw==} engines: {npm: '>= 7.0.0'} @@ -9413,10 +9560,10 @@ packages: chalk: 3.0.0 css.escape: 1.5.1 dom-accessibility-api: 0.6.3 - jest: 29.7.0(@types/node@18.19.31) + jest: 29.7.0(@types/node@20.11.17) lodash: 4.17.21 redent: 3.0.0 - vitest: 1.1.1(@types/node@18.19.31)(happy-dom@12.10.3) + vitest: 1.1.1(@types/node@20.11.17)(happy-dom@12.10.3) dev: true /@testing-library/react@14.1.2(react-dom@18.2.0)(react@18.2.0): @@ -10374,6 +10521,7 @@ packages: typescript: 5.4.4 transitivePeerDependencies: - supports-color + dev: false /@typescript-eslint/parser@6.17.0(eslint@7.0.0)(typescript@5.3.3): resolution: {integrity: sha512-C4bBaX2orvhK+LlwrY8oWGmSl4WolCfYm513gEccdWZj0CwGadbIADb0FtVEcI+WzUyjyoBj2JRP8g25E6IB8A==} @@ -10687,6 +10835,7 @@ packages: typescript: 5.4.4 transitivePeerDependencies: - supports-color + dev: false /@typescript-eslint/typescript-estree@6.17.0(typescript@5.3.3): resolution: {integrity: sha512-gVQe+SLdNPfjlJn5VNGhlOhrXz4cajwFd5kAgWtZ9dCZf4XJf8xmgCTLIqec7aha3JwgLI2CK6GY1043FRxZwg==} @@ -11017,7 +11166,7 @@ packages: vite: ^4 || ^5 dependencies: '@swc/core': 1.4.13 - vite: 5.0.10(@types/node@18.0.0) + vite: 5.0.10(@types/node@20.11.17) transitivePeerDependencies: - '@swc/helpers' dev: true @@ -11044,7 +11193,7 @@ packages: '@babel/plugin-transform-react-jsx-source': 7.24.1(@babel/core@7.24.4) magic-string: 0.27.0 react-refresh: 0.14.0 - vite: 5.0.10(@types/node@18.19.31) + vite: 5.0.10(@types/node@20.11.17) transitivePeerDependencies: - supports-color dev: true @@ -12001,6 +12150,7 @@ packages: /aggregate-error@3.1.0: resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} engines: {node: '>=8'} + requiresBuild: true dependencies: clean-stack: 2.2.0 indent-string: 4.0.0 @@ -13805,6 +13955,7 @@ packages: /clean-stack@2.2.0: resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} engines: {node: '>=6'} + requiresBuild: true /clean-stack@4.2.0: resolution: {integrity: sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==} @@ -14425,7 +14576,7 @@ packages: object-assign: 4.1.1 vary: 1.1.2 - /cosmiconfig-typescript-loader@5.0.0(@types/node@18.19.31)(cosmiconfig@8.3.6)(typescript@5.3.3): + /cosmiconfig-typescript-loader@5.0.0(@types/node@20.11.17)(cosmiconfig@8.3.6)(typescript@5.3.3): resolution: {integrity: sha512-+8cK7jRAReYkMwMiG+bxhcNKiHJDM6bR9FD/nGBXOWdMLuYawjF5cGrtLilJ+LGd3ZjCXnJjR5DkfWPoIVlqJA==} engines: {node: '>=v16'} peerDependencies: @@ -14433,7 +14584,7 @@ packages: cosmiconfig: '>=8.2' typescript: '>=4' dependencies: - '@types/node': 18.19.31 + '@types/node': 20.11.17 cosmiconfig: 8.3.6(typescript@5.3.3) jiti: 1.21.0 typescript: 5.3.3 @@ -14559,7 +14710,7 @@ packages: dependencies: '@babel/runtime': 7.24.4 - /create-jest@29.7.0(@types/node@18.19.31): + /create-jest@29.7.0(@types/node@20.11.17): resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -14568,7 +14719,7 @@ packages: chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@18.19.31) + jest-config: 29.7.0(@types/node@20.11.17) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -16438,6 +16589,7 @@ packages: /encoding@0.1.13: resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==} + requiresBuild: true dependencies: iconv-lite: 0.6.3 @@ -17095,7 +17247,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@5.4.4) + '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@4.9.5) debug: 3.2.7 eslint: 7.32.0 eslint-import-resolver-node: 0.3.9 @@ -17202,7 +17354,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@5.4.4) + '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@4.9.5) array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 array.prototype.flat: 1.3.2 @@ -20576,7 +20728,7 @@ packages: - typescript - utf-8-validate - /graphql-config@5.0.3(@types/node@18.19.31)(graphql@16.8.1)(typescript@4.9.5): + /graphql-config@5.0.3(@types/node@18.19.31)(graphql@16.8.1)(typescript@5.4.4): resolution: {integrity: sha512-BNGZaoxIBkv9yy6Y7omvsaBUHOzfFcII3UN++tpH8MGOKFPFkCPZuwx09ggANMt8FgyWP1Od8SWPmrUEZca4NQ==} engines: {node: '>= 16.0.0'} peerDependencies: @@ -20592,7 +20744,7 @@ packages: '@graphql-tools/merge': 9.0.3(graphql@16.8.1) '@graphql-tools/url-loader': 8.0.2(@types/node@18.19.31)(graphql@16.8.1) '@graphql-tools/utils': 10.1.2(graphql@16.8.1) - cosmiconfig: 8.3.6(typescript@4.9.5) + cosmiconfig: 8.3.6(typescript@5.4.4) graphql: 16.8.1 jiti: 1.21.0 minimatch: 4.2.3 @@ -20606,7 +20758,7 @@ packages: - utf-8-validate dev: false - /graphql-config@5.0.3(@types/node@18.19.31)(graphql@16.8.1)(typescript@5.4.4): + /graphql-config@5.0.3(@types/node@20.11.17)(graphql@16.8.1)(typescript@4.9.5): resolution: {integrity: sha512-BNGZaoxIBkv9yy6Y7omvsaBUHOzfFcII3UN++tpH8MGOKFPFkCPZuwx09ggANMt8FgyWP1Od8SWPmrUEZca4NQ==} engines: {node: '>= 16.0.0'} peerDependencies: @@ -20620,9 +20772,9 @@ packages: '@graphql-tools/json-file-loader': 8.0.1(graphql@16.8.1) '@graphql-tools/load': 8.0.2(graphql@16.8.1) '@graphql-tools/merge': 9.0.3(graphql@16.8.1) - '@graphql-tools/url-loader': 8.0.2(@types/node@18.19.31)(graphql@16.8.1) + '@graphql-tools/url-loader': 8.0.2(@types/node@20.11.17)(graphql@16.8.1) '@graphql-tools/utils': 10.1.2(graphql@16.8.1) - cosmiconfig: 8.3.6(typescript@5.4.4) + cosmiconfig: 8.3.6(typescript@4.9.5) graphql: 16.8.1 jiti: 1.21.0 minimatch: 4.2.3 @@ -22480,7 +22632,7 @@ packages: - supports-color dev: true - /jest-cli@29.7.0(@types/node@18.19.31): + /jest-cli@29.7.0(@types/node@20.11.17): resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -22494,10 +22646,10 @@ packages: '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@18.19.31) + create-jest: 29.7.0(@types/node@20.11.17) exit: 0.1.2 import-local: 3.1.0 - jest-config: 29.7.0(@types/node@18.19.31) + jest-config: 29.7.0(@types/node@20.11.17) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -22548,6 +22700,46 @@ packages: - supports-color dev: true + /jest-config@29.7.0(@types/node@20.11.17): + resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@types/node': '*' + ts-node: '>=9.0.0' + peerDependenciesMeta: + '@types/node': + optional: true + ts-node: + optional: true + dependencies: + '@babel/core': 7.24.4 + '@jest/test-sequencer': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.11.17 + babel-jest: 29.7.0(@babel/core@7.24.4) + chalk: 4.1.2 + ci-info: 3.9.0 + deepmerge: 4.3.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-circus: 29.7.0 + jest-environment-node: 29.7.0 + jest-get-type: 29.6.3 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-runner: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + micromatch: 4.0.5 + parse-json: 5.2.0 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + dev: true + /jest-diff@29.7.0: resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -22686,7 +22878,7 @@ packages: jest-runner: ^29.3.1 dependencies: expect-playwright: 0.8.0 - jest: 29.7.0(@types/node@18.19.31) + jest: 29.7.0(@types/node@20.11.17) jest-circus: 29.7.0 jest-environment-node: 29.7.0 jest-process-manager: 0.4.0 @@ -22897,7 +23089,7 @@ packages: dependencies: ansi-escapes: 6.2.1 chalk: 5.3.0 - jest: 29.7.0(@types/node@18.19.31) + jest: 29.7.0(@types/node@20.11.17) jest-regex-util: 29.6.3 jest-watcher: 29.7.0 slash: 5.1.0 @@ -22945,7 +23137,7 @@ packages: supports-color: 8.1.1 dev: true - /jest@29.7.0(@types/node@18.19.31): + /jest@29.7.0(@types/node@20.11.17): resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -22958,7 +23150,7 @@ packages: '@jest/core': 29.7.0 '@jest/types': 29.6.3 import-local: 3.1.0 - jest-cli: 29.7.0(@types/node@18.19.31) + jest-cli: 29.7.0(@types/node@20.11.17) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -22979,6 +23171,10 @@ packages: '@sideway/formula': 3.0.1 '@sideway/pinpoint': 2.0.0 + /jose@4.15.5: + resolution: {integrity: sha512-jc7BFxgKPKi94uOvEmzlSWFFe2+vASyXaKUpdQKatWAESU2MWjDfFf0fdfc83CDKcA5QecabZeNLyfhe3yKNkg==} + dev: false + /jose@5.2.4: resolution: {integrity: sha512-6ScbIk2WWCeXkmzF6bRPmEuaqy1m8SbsRFMa/FLrSCkGIhj8OLVG/IH+XHVmNMx/KUo8cVWEE6oKR4dJ+S0Rkg==} dev: true @@ -24297,6 +24493,18 @@ packages: '@types/node': 18.19.31 dev: false + /meros@1.3.0(@types/node@20.11.17): + resolution: {integrity: sha512-2BNGOimxEz5hmjUG2FwoxCt5HN7BXdaWyFqEwxPTrJzVdABtrL4TiHTcsWSFAxPQ/tOnEaQEJh3qWq71QRMY+w==} + engines: {node: '>=13'} + peerDependencies: + '@types/node': '>=13' + peerDependenciesMeta: + '@types/node': + optional: true + dependencies: + '@types/node': 20.11.17 + dev: false + /methods@1.1.2: resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} engines: {node: '>= 0.6'} @@ -25009,7 +25217,7 @@ packages: resolution: {integrity: sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw==} dev: false - /netlify-cli@17.21.1(@types/node@18.19.31): + /netlify-cli@17.21.1(@types/node@20.11.17): resolution: {integrity: sha512-B8QveV55h2dFCTnk5LInVW1MiXPINTQ61IkEtih15CVYpvVSQy+he8M6hdpucq83VqaF/phaJkb3Si2ligOxxw==} engines: {node: '>=18.14.0'} hasBin: true @@ -25018,7 +25226,7 @@ packages: '@bugsnag/js': 7.20.2 '@fastify/static': 6.10.2 '@netlify/blobs': 7.0.1 - '@netlify/build': 29.36.6(@opentelemetry/api@1.8.0)(@types/node@18.19.31) + '@netlify/build': 29.36.6(@opentelemetry/api@1.8.0)(@types/node@20.11.17) '@netlify/build-info': 7.13.2 '@netlify/config': 20.12.1 '@netlify/edge-bundler': 11.3.0 @@ -25210,9 +25418,76 @@ packages: qs: 6.12.0 dev: false + /next-auth@4.24.7(next@14.2.3)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-iChjE8ov/1K/z98gdKbn2Jw+2vLgJtVV39X+rCP5SGnVQuco7QOr19FRNGMIrD8d3LYhHWV9j9sKLzq1aDWWQQ==} + peerDependencies: + next: ^12.2.5 || ^13 || ^14 + nodemailer: ^6.6.5 + react: ^17.0.2 || ^18 + react-dom: ^17.0.2 || ^18 + peerDependenciesMeta: + nodemailer: + optional: true + dependencies: + '@babel/runtime': 7.24.4 + '@panva/hkdf': 1.1.1 + cookie: 0.5.0 + jose: 4.15.5 + next: 14.2.3(@babel/core@7.24.4)(react-dom@18.2.0)(react@18.2.0) + oauth: 0.9.15 + openid-client: 5.6.5 + preact: 10.20.2 + preact-render-to-string: 5.2.6(preact@10.20.2) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + uuid: 8.3.2 + dev: false + /next-tick@1.1.0: resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} + /next@14.2.3(@babel/core@7.24.4)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-dowFkFTR8v79NPJO4QsBUtxv0g9BrS/phluVpMAt2ku7H+cbcBJlopXjkWlwxrk/xGqMemr7JkGPGemPrLLX7A==} + engines: {node: '>=18.17.0'} + hasBin: true + peerDependencies: + '@opentelemetry/api': ^1.1.0 + '@playwright/test': ^1.41.2 + react: ^18.2.0 + react-dom: ^18.2.0 + sass: ^1.3.0 + peerDependenciesMeta: + '@opentelemetry/api': + optional: true + '@playwright/test': + optional: true + sass: + optional: true + dependencies: + '@next/env': 14.2.3 + '@swc/helpers': 0.5.5 + busboy: 1.6.0 + caniuse-lite: 1.0.30001608 + graceful-fs: 4.2.11 + postcss: 8.4.31 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + styled-jsx: 5.1.1(@babel/core@7.24.4)(react@18.2.0) + optionalDependencies: + '@next/swc-darwin-arm64': 14.2.3 + '@next/swc-darwin-x64': 14.2.3 + '@next/swc-linux-arm64-gnu': 14.2.3 + '@next/swc-linux-arm64-musl': 14.2.3 + '@next/swc-linux-x64-gnu': 14.2.3 + '@next/swc-linux-x64-musl': 14.2.3 + '@next/swc-win32-arm64-msvc': 14.2.3 + '@next/swc-win32-ia32-msvc': 14.2.3 + '@next/swc-win32-x64-msvc': 14.2.3 + transitivePeerDependencies: + - '@babel/core' + - babel-plugin-macros + dev: false + /no-case@3.0.4: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} dependencies: @@ -25567,6 +25842,10 @@ packages: ufo: 1.5.3 dev: true + /oauth@0.9.15: + resolution: {integrity: sha512-a5ERWK1kh38ExDEfoO6qUHJb32rd7aYmPHuyCu3Fta/cnICvYmgd2uhuKXvPD+PXB+gCEYYEaQdIRAjCOwAKNA==} + dev: false + /object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -25580,6 +25859,11 @@ packages: kind-of: 3.2.2 dev: false + /object-hash@2.2.0: + resolution: {integrity: sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==} + engines: {node: '>= 6'} + dev: false + /object-hash@3.0.0: resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==} engines: {node: '>= 6'} @@ -25674,6 +25958,11 @@ packages: /ohash@1.1.3: resolution: {integrity: sha512-zuHHiGTYTA1sYJ/wZN+t5HKZaH23i4yI1HMwbuXm24Nid7Dv0KcuRlKoNKS9UNfAVSBlnGLcuQrnOKWOZoEGaw==} + /oidc-token-hash@5.0.3: + resolution: {integrity: sha512-IF4PcGgzAr6XXSff26Sk/+P4KZFJVuHAJZj3wgO3vX2bMdNVp/QXTP3P7CEm9V1IdG8lDLY3HhiqpsE/nOwpPw==} + engines: {node: ^10.13.0 || >=12.0.0} + dev: false + /ol-mapbox-style@8.2.1: resolution: {integrity: sha512-3kBBuZC627vDL8vnUdfVbCbfkhkcZj2kXPHQcuLhC4JJEA+XkEVEtEde8x8+AZctRbHwBkSiubTPaRukgLxIRw==} dependencies: @@ -25760,6 +26049,15 @@ packages: is-docker: 2.2.1 is-wsl: 2.2.0 + /openid-client@5.6.5: + resolution: {integrity: sha512-5P4qO9nGJzB5PI0LFlhj4Dzg3m4odt0qsJTfyEtZyOlkgpILwEioOhVVJOrS1iVH494S4Ee5OCjjg6Bf5WOj3w==} + dependencies: + jose: 4.15.5 + lru-cache: 6.0.0 + object-hash: 2.2.0 + oidc-token-hash: 5.0.3 + dev: false + /opentracing@0.14.7: resolution: {integrity: sha512-vz9iS7MJ5+Bp1URw8Khvdyw1H/hGvzHWlKQ7eRrQojSCDL1/SrWfrY9QebLw97n2deyRtzHRC3MkQfVNUCo91Q==} engines: {node: '>=0.10'} @@ -25903,6 +26201,7 @@ packages: /p-limit@4.0.0: resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + requiresBuild: true dependencies: yocto-queue: 1.0.0 @@ -25953,6 +26252,7 @@ packages: /p-map@4.0.0: resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} engines: {node: '>=10'} + requiresBuild: true dependencies: aggregate-error: 3.1.0 @@ -27281,6 +27581,15 @@ packages: quote-unquote: 1.0.0 dev: false + /postcss@8.4.31: + resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.7 + picocolors: 1.0.0 + source-map-js: 1.2.0 + dev: false + /postcss@8.4.32: resolution: {integrity: sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==} engines: {node: ^10 || ^12 || >=14} @@ -27298,6 +27607,19 @@ packages: picocolors: 1.0.0 source-map-js: 1.2.0 + /preact-render-to-string@5.2.6(preact@10.20.2): + resolution: {integrity: sha512-JyhErpYOvBV1hEPwIxc/fHWXPfnEGdRKxc8gFdAZ7XV4tlzyzG847XAyEZqoDnynP88akM4eaHcSOzNcLWFguw==} + peerDependencies: + preact: '>=10' + dependencies: + preact: 10.20.2 + pretty-format: 3.8.0 + dev: false + + /preact@10.20.2: + resolution: {integrity: sha512-S1d1ernz3KQ+Y2awUxKakpfOg2CEmJmwOP+6igPx6dgr6pgDvenqYviyokWso2rhHvGtTlWWnJDa7RaPbQerTg==} + dev: false + /prebuild-install@7.1.2: resolution: {integrity: sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==} engines: {node: '>=10'} @@ -27415,6 +27737,10 @@ packages: ansi-styles: 5.2.0 react-is: 18.2.0 + /pretty-format@3.8.0: + resolution: {integrity: sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==} + dev: false + /pretty-hrtime@1.0.3: resolution: {integrity: sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==} engines: {node: '>= 0.8'} @@ -30299,6 +30625,7 @@ packages: /sprintf-js@1.1.3: resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==} + requiresBuild: true /sqlite3@5.1.7: resolution: {integrity: sha512-GGIyOiFaG+TUra3JIfkI/zGP8yZYLPQ0pl1bH+ODjiX57sPhrLU5sQJn1y9bDKZUFYkX1crlrPfSYt0BKKdkog==} @@ -30743,6 +31070,24 @@ packages: dependencies: inline-style-parser: 0.1.1 + /styled-jsx@5.1.1(@babel/core@7.24.4)(react@18.2.0): + resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==} + engines: {node: '>= 12.0.0'} + peerDependencies: + '@babel/core': '*' + babel-plugin-macros: '*' + react: '>= 16.8.0 || 17.x.x || ^18.0.0-0' + peerDependenciesMeta: + '@babel/core': + optional: true + babel-plugin-macros: + optional: true + dependencies: + '@babel/core': 7.24.4 + client-only: 0.0.1 + react: 18.2.0 + dev: false + /stylehacks@5.1.1(postcss@8.4.38): resolution: {integrity: sha512-sBpcd5Hx7G6seo7b1LkpttvTz7ikD0LlH5RmdcBNb6fFR0Fl7LQwHDFr300q4cwUqi+IYrFGmsIHieMBfnN/Bw==} engines: {node: ^10 || ^12 || >=14.0} @@ -31507,7 +31852,7 @@ packages: resolution: {integrity: sha512-PGcnJoTBnVGy6yYNFxWVNkdcAuAMstvutN9MgDJIV6L0oG8fB+ZNNy1T+wJzah8RPGor1mZuPQkVfXNDpy9eHA==} dev: true - /ts-node@10.9.2(@types/node@18.19.31)(typescript@5.4.4): + /ts-node@10.9.2(@types/node@20.11.17)(typescript@5.4.4): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} hasBin: true peerDependencies: @@ -31526,7 +31871,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 18.19.31 + '@types/node': 20.11.17 acorn: 8.11.3 acorn-walk: 8.3.2 arg: 4.1.3 @@ -31625,6 +31970,7 @@ packages: dependencies: tslib: 1.14.1 typescript: 5.4.4 + dev: false /tsx@4.7.1: resolution: {integrity: sha512-8d6VuibXHtlN5E3zFkgY8u4DX7Y3Z27zvvPKVmLon/D4AjuKzarkUBTLDBgj9iTQ0hg5xM7c/mYiRVM+HETf0g==} @@ -32619,7 +32965,7 @@ packages: - terser dev: true - /vite-node@1.1.1(@types/node@18.19.31): + /vite-node@1.1.1(@types/node@20.11.17): resolution: {integrity: sha512-2bGE5w4jvym5v8llF6Gu1oBrmImoNSs4WmRVcavnG2me6+8UQntTqLiAMFyiAobp+ZXhj5ZFhI7SmLiFr/jrow==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -32628,7 +32974,7 @@ packages: debug: 4.3.4 pathe: 1.1.2 picocolors: 1.0.0 - vite: 5.2.8(@types/node@18.19.31) + vite: 5.2.8(@types/node@20.11.17) transitivePeerDependencies: - '@types/node' - less @@ -32691,7 +33037,7 @@ packages: fsevents: 2.3.3 dev: true - /vite@5.0.10(@types/node@18.19.31): + /vite@5.0.10(@types/node@20.11.17): resolution: {integrity: sha512-2P8J7WWgmc355HUMlFrwofacvr98DAjoE52BfdbwQtyLH06XKwaL/FMnmKM2crF0iX4MpmMKoDlNCB1ok7zHCw==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -32719,7 +33065,7 @@ packages: terser: optional: true dependencies: - '@types/node': 18.19.31 + '@types/node': 20.11.17 esbuild: 0.19.12 postcss: 8.4.32 rollup: 4.14.1 @@ -32797,6 +33143,7 @@ packages: rollup: 4.14.1 optionalDependencies: fsevents: 2.3.3 + optional: true /vite@5.2.8(@types/node@20.11.17): resolution: {integrity: sha512-OyZR+c1CE8yeHw5V5t59aXsUPPVTHMDjEZz8MgguLL/Q7NblxhZUlTu9xSPqlsUO/y+X7dlU05jdhvyycD55DA==} @@ -33026,7 +33373,7 @@ packages: - terser dev: true - /vitest@1.1.1(@types/node@18.19.31): + /vitest@1.1.1(@types/node@20.11.17): resolution: {integrity: sha512-Ry2qs4UOu/KjpXVfOCfQkTnwSXYGrqTbBZxw6reIYEFjSy1QUARRg5pxiI5BEXy+kBVntxUYNMlq4Co+2vD3fQ==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -33051,7 +33398,7 @@ packages: jsdom: optional: true dependencies: - '@types/node': 18.19.31 + '@types/node': 20.11.17 '@vitest/expect': 1.1.1 '@vitest/runner': 1.1.1 '@vitest/snapshot': 1.1.1 @@ -33070,8 +33417,8 @@ packages: strip-literal: 1.3.0 tinybench: 2.6.0 tinypool: 0.8.3 - vite: 5.2.8(@types/node@18.19.31) - vite-node: 1.1.1(@types/node@18.19.31) + vite: 5.2.8(@types/node@20.11.17) + vite-node: 1.1.1(@types/node@20.11.17) why-is-node-running: 2.2.2 transitivePeerDependencies: - less @@ -33083,7 +33430,7 @@ packages: - terser dev: true - /vitest@1.1.1(@types/node@18.19.31)(happy-dom@12.10.3): + /vitest@1.1.1(@types/node@20.11.17)(happy-dom@12.10.3): resolution: {integrity: sha512-Ry2qs4UOu/KjpXVfOCfQkTnwSXYGrqTbBZxw6reIYEFjSy1QUARRg5pxiI5BEXy+kBVntxUYNMlq4Co+2vD3fQ==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -33108,7 +33455,7 @@ packages: jsdom: optional: true dependencies: - '@types/node': 18.19.31 + '@types/node': 20.11.17 '@vitest/expect': 1.1.1 '@vitest/runner': 1.1.1 '@vitest/snapshot': 1.1.1 @@ -33128,8 +33475,8 @@ packages: strip-literal: 1.3.0 tinybench: 2.6.0 tinypool: 0.8.3 - vite: 5.2.8(@types/node@18.19.31) - vite-node: 1.1.1(@types/node@18.19.31) + vite: 5.2.8(@types/node@20.11.17) + vite-node: 1.1.1(@types/node@20.11.17) why-is-node-running: 2.2.2 transitivePeerDependencies: - less From 49256ac6c4c9272586ec01a2feb563358493fd5c Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Thu, 25 Apr 2024 19:37:06 +0200 Subject: [PATCH 42/51] chore: re-add faker --- packages/ui/package.json | 1 + pnpm-lock.yaml | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/packages/ui/package.json b/packages/ui/package.json index aaddf700a..4694ac3a3 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -40,6 +40,7 @@ "dependencies": { "@amazeelabs/silverback-iframe": "^1.3.0", "@custom/schema": "workspace:*", + "@faker-js/faker": "^8.4.1", "@headlessui/react": "^1.7.17", "@heroicons/react": "^2.1.1", "@hookform/resolvers": "^3.3.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5e9fb00b4..7b43b7e62 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -523,6 +523,9 @@ importers: '@custom/schema': specifier: workspace:* version: link:../schema + '@faker-js/faker': + specifier: ^8.4.1 + version: 8.4.1 '@headlessui/react': specifier: ^1.7.17 version: 1.7.17(react-dom@18.2.0)(react@18.2.0) @@ -4105,6 +4108,11 @@ packages: transitivePeerDependencies: - supports-color + /@faker-js/faker@8.4.1: + resolution: {integrity: sha512-XQ3cU+Q8Uqmrbf2e0cIC/QN43sTBSC8KF12u29Mb47tWrt2hAgBXSgpZMj4Ao8Uk0iJcU99QsOCaIL8934obCg==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0, npm: '>=6.14.13'} + dev: false + /@fal-works/esbuild-plugin-global-externals@2.1.2: resolution: {integrity: sha512-cEee/Z+I12mZcFJshKcCqC8tuX5hG3s+d+9nZ3LabqKF1vKdF41B92pJVCBggjAGORAeOzyyDDKrZwIkLffeOQ==} dev: true From cb123d70c5977ef8e859f070de658da11bccd703 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Thu, 25 Apr 2024 20:30:28 +0200 Subject: [PATCH 43/51] chore: re-add next-auth dependencies --- apps/website/package.json | 6 ++++ pnpm-lock.yaml | 59 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/apps/website/package.json b/apps/website/package.json index 503886d30..73d7a6c10 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -15,6 +15,10 @@ "@custom/decap": "workspace:*", "@custom/schema": "workspace:*", "@custom/ui": "workspace:*", + "@gatsbyjs/reach-router": "^2.0.1", + "@netlify/plugin-nextjs": "^5.1.2", + "babel-loader": "^9.1.3", + "body-parser": "^1.20.2", "gatsby": "^5.13.1", "gatsby-plugin-layout": "^4.13.0", "gatsby-plugin-manifest": "^5.13.0", @@ -27,7 +31,9 @@ "gatsby-source-filesystem": "^5.13.0", "image-size": "^1.1.1", "mime-types": "^2.1.35", + "multer": "1.4.5-lts.1", "netlify-cli": "^17.21.1", + "next": "^14.2.3", "next-auth": "^4.24.7", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7b43b7e62..e429feae1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -301,6 +301,18 @@ importers: '@custom/ui': specifier: workspace:* version: link:../../packages/ui + '@gatsbyjs/reach-router': + specifier: ^2.0.1 + version: 2.0.1(react-dom@18.2.0)(react@18.2.0) + '@netlify/plugin-nextjs': + specifier: ^5.1.2 + version: 5.1.2 + babel-loader: + specifier: ^9.1.3 + version: 9.1.3(@babel/core@7.24.4)(webpack@5.91.0) + body-parser: + specifier: ^1.20.2 + version: 1.20.2 gatsby: specifier: ^5.13.1 version: 5.13.1(babel-eslint@10.1.0)(react-dom@18.2.0)(react@18.2.0)(typescript@4.9.5) @@ -337,9 +349,15 @@ importers: mime-types: specifier: ^2.1.35 version: 2.1.35 + multer: + specifier: 1.4.5-lts.1 + version: 1.4.5-lts.1 netlify-cli: specifier: ^17.21.1 version: 17.21.1(@types/node@20.11.17) + next: + specifier: ^14.2.3 + version: 14.2.3(@babel/core@7.24.4)(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) next-auth: specifier: ^4.24.7 version: 4.24.7(next@14.2.3)(react-dom@18.2.0)(react@18.2.0) @@ -6469,6 +6487,11 @@ packages: '@opentelemetry/api': 1.8.0 dev: false + /@netlify/plugin-nextjs@5.1.2: + resolution: {integrity: sha512-rftBlZmrkxy8zeXZ/tT2u/v2iIZd9s0cV7MdtjUFOgizjhtY0fCZEUQ7OIEQIMogzGNMDXFcb84HXX9a8OZ8/w==} + engines: {node: '>=18.0.0'} + dev: false + /@netlify/plugins-list@6.77.0: resolution: {integrity: sha512-czL3FH61hFhhVQydRj2xjIwLVYHDNskMhRib7dUfOQrUHifqLlUFKp03NwBD87G9BFKXUYGWZMEUU+JjIpVc9w==} engines: {node: ^14.14.0 || >=16.0.0} @@ -12948,6 +12971,19 @@ packages: schema-utils: 2.7.1 webpack: 5.91.0 + /babel-loader@9.1.3(@babel/core@7.24.4)(webpack@5.91.0): + resolution: {integrity: sha512-xG3ST4DglodGf8qSwv0MdeWLhrDsw/32QMdTO5T1ZIp9gQur0HkCyFs7Awskr10JKXFXwpAhiCuYX5oGXnRGbw==} + engines: {node: '>= 14.15.0'} + peerDependencies: + '@babel/core': ^7.12.0 + webpack: '>=5' + dependencies: + '@babel/core': 7.24.4 + find-cache-dir: 4.0.0 + schema-utils: 4.2.0 + webpack: 5.91.0 + dev: false + /babel-plugin-add-module-exports@1.0.4: resolution: {integrity: sha512-g+8yxHUZ60RcyaUpfNzy56OtWW+x9cyEe9j+CranqLiqbju2yf/Cy6ZtYK40EZxtrdHllzlVZgLmcOUCTlJ7Jg==} @@ -18627,6 +18663,14 @@ packages: make-dir: 3.1.0 pkg-dir: 4.2.0 + /find-cache-dir@4.0.0: + resolution: {integrity: sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg==} + engines: {node: '>=14.16'} + dependencies: + common-path-prefix: 3.0.0 + pkg-dir: 7.0.0 + dev: false + /find-file-up@0.1.3: resolution: {integrity: sha512-mBxmNbVyjg1LQIIpgO8hN+ybWBgDQK8qjht+EbrTCGmmPV/sc7RF1i9stPTD6bpvXZywBdrwRYxhSdJv867L6A==} engines: {node: '>=0.10.0'} @@ -25441,7 +25485,7 @@ packages: '@panva/hkdf': 1.1.1 cookie: 0.5.0 jose: 4.15.5 - next: 14.2.3(@babel/core@7.24.4)(react-dom@18.2.0)(react@18.2.0) + next: 14.2.3(@babel/core@7.24.4)(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0) oauth: 0.9.15 openid-client: 5.6.5 preact: 10.20.2 @@ -25454,7 +25498,7 @@ packages: /next-tick@1.1.0: resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} - /next@14.2.3(@babel/core@7.24.4)(react-dom@18.2.0)(react@18.2.0): + /next@14.2.3(@babel/core@7.24.4)(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-dowFkFTR8v79NPJO4QsBUtxv0g9BrS/phluVpMAt2ku7H+cbcBJlopXjkWlwxrk/xGqMemr7JkGPGemPrLLX7A==} engines: {node: '>=18.17.0'} hasBin: true @@ -25473,6 +25517,7 @@ packages: optional: true dependencies: '@next/env': 14.2.3 + '@opentelemetry/api': 1.8.0 '@swc/helpers': 0.5.5 busboy: 1.6.0 caniuse-lite: 1.0.30001608 @@ -29778,6 +29823,16 @@ packages: ajv: 6.12.6 ajv-keywords: 3.5.2(ajv@6.12.6) + /schema-utils@4.2.0: + resolution: {integrity: sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==} + engines: {node: '>= 12.13.0'} + dependencies: + '@types/json-schema': 7.0.15 + ajv: 8.12.0 + ajv-formats: 2.1.1(ajv@8.12.0) + ajv-keywords: 5.1.0(ajv@8.12.0) + dev: false + /scroll-into-view-if-needed@2.2.31: resolution: {integrity: sha512-dGCXy99wZQivjmjIqihaBQNjryrz5rueJY7eHfTdyWEiR4ttYpsajb14rn9s5d4DY4EcY6+4+U/maARBXJedkA==} dependencies: From 9afa08fbae04a919fa941c57a3dc622c3919ec5a Mon Sep 17 00:00:00 2001 From: Alex Tkachev Date: Tue, 30 Apr 2024 13:49:05 +0400 Subject: [PATCH 44/51] chore: make publisher work again locally --- apps/website/publisher.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/website/publisher.config.ts b/apps/website/publisher.config.ts index abaf98f01..6c5d95797 100644 --- a/apps/website/publisher.config.ts +++ b/apps/website/publisher.config.ts @@ -16,7 +16,7 @@ export default defineConfig({ // cannot report it. // Workaround: Do a double build on the first build. 'if test -d public; then echo "Single build" && pnpm build:gatsby; else echo "Double build" && pnpm build:gatsby && pnpm build:gatsby; fi' - : 'pnpm build:gatsby', + : 'DRUPAL_EXTERNAL_URL=http://127.0.0.1:8888 pnpm build:gatsby', outputTimeout: 1000 * 60 * 10, }, clean: 'pnpm clean', From 731027ad295cd563155905af8e8630fa76b350ff Mon Sep 17 00:00:00 2001 From: Alex Tkachev Date: Wed, 1 May 2024 18:45:24 +0400 Subject: [PATCH 45/51] chore: ensure iframeResizer script is present before saving the form MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Somehow it was missing on the "error" page 🤷 --- tests/e2e/webform-snapshots/webforms.spec.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/e2e/webform-snapshots/webforms.spec.ts b/tests/e2e/webform-snapshots/webforms.spec.ts index bdd7fbb51..c3eb894e5 100644 --- a/tests/e2e/webform-snapshots/webforms.spec.ts +++ b/tests/e2e/webform-snapshots/webforms.spec.ts @@ -5,6 +5,8 @@ import { execSync } from 'child_process'; import { cmsUrl } from '../helpers/url'; const baseDir = '../../packages/ui/static/stories/webforms'; +const iframeResizerSelector = + 'script[src*="silverback_iframe/js/iframeResizer.contentWindow.min.js"]'; test('Export webforms for styling', async ({ page }) => { execSync(`rm -rf ${baseDir}`); @@ -12,6 +14,7 @@ test('Export webforms for styling', async ({ page }) => { const baseUrl = cmsUrl('/en/form/styling?iframe=true&no_css=true'); await page.goto(baseUrl); + await expect(page.locator(iframeResizerSelector)).toHaveCount(1); await savePage(page, 'idle'); await page.getByLabel('Email with a confirmation').fill('asd@asd'); @@ -19,6 +22,7 @@ test('Export webforms for styling', async ({ page }) => { await expect( page.locator('[data-drupal-messages] [role="alert"]'), ).toBeVisible(); + await expect(page.locator(iframeResizerSelector)).toHaveCount(1); await savePage(page, 'error'); }); From 264ec90f346e0946c9e5bf08a43fc10050dbfa9d Mon Sep 17 00:00:00 2001 From: Alex Tkachev Date: Wed, 1 May 2024 18:58:33 +0400 Subject: [PATCH 46/51] chore: let chromatic's turbosnap know when webforms are changed --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a8f39a873..e93af97c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,6 +59,7 @@ jobs: storybookBaseDir: packages/ui onlyChanged: true exitOnceUploaded: true + externals: packages/ui/static/stories/webforms/** if: ${{ steps.chromatic-check.outputs.available == 'true' }} - name: Deploy storybook to netlify From b3487bc964c0b455a8695c1cb82d258c9e874535 Mon Sep 17 00:00:00 2001 From: Alex Tkachev Date: Wed, 1 May 2024 19:13:04 +0400 Subject: [PATCH 47/51] chore: redo "Test without Turbo cache" workflow Previously: No felixmosh/turborepo-gh-artifacts, Turbo can't read/write persisted caches Now: Turbo is executed with --force flag This way we can override broken Turbo caches --- .github/workflows/test_without_turbo_cache.yml | 17 +++++++++++++++-- package.json | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_without_turbo_cache.yml b/.github/workflows/test_without_turbo_cache.yml index 837d24c68..c247a595e 100644 --- a/.github/workflows/test_without_turbo_cache.yml +++ b/.github/workflows/test_without_turbo_cache.yml @@ -3,11 +3,14 @@ on: workflow_dispatch: jobs: - test: name: Test runs-on: ubuntu-20.04 steps: + - name: Init check + if: ${{ github.repository != 'AmazeeLabs/silverback-template'}} + run: echo 'Please run the INIT script. See the root README.md for instructions.' && false + - name: Checkout uses: actions/checkout@v3 with: @@ -16,8 +19,18 @@ jobs: - name: Setup uses: ./.github/actions/setup + - name: TurboRepo local server + uses: felixmosh/turborepo-gh-artifacts@v2 + with: + server-token: 'local' + repo-token: ${{ secrets.GITHUB_TOKEN }} + - name: Test - run: pnpm turbo:test + run: pnpm turbo:test:force + env: + TURBO_API: 'http://127.0.0.1:9080' + TURBO_TOKEN: 'local' + TURBO_TEAM: 'local' - name: Upload Playwright report uses: actions/upload-artifact@v3 diff --git a/package.json b/package.json index e4b531976..12321130c 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "test:format:workspaces": "pnpm --workspace-concurrency=1 -r exec prettier '**/*.{js,cjs,mjs,ts,jsx,tsx,gql,graphql,graphqls,md,mdx,json,htm,html}' --ignore-path='./.gitignore'", "turbo:local": "if [ -z $CI ]; then echo $(date)$RANDOM > apps/cms/turbo-seed.txt; fi", "turbo:test": "pnpm turbo:local && pnpm tb test:unit --no-daemon --go-fallback --output-logs=new-only && pnpm tb test:integration --no-daemon --go-fallback --output-logs=new-only --concurrency=1", + "turbo:test:force": "pnpm tb test:unit --no-daemon --go-fallback --output-logs=new-only --force && pnpm tb test:integration --no-daemon --go-fallback --output-logs=new-only --concurrency=1 --force", "turbo:test:quick": "pnpm turbo:local && pnpm tb test:unit --no-daemon --go-fallback --output-logs=new-only", "turbo:prep": "pnpm turbo:local && pnpm tb prep --no-daemon --go-fallback --output-logs=new-only", "turbo:prep:force": "rm -f apps/cms/web/sites/default/files/.sqlite && pnpm tb prep --no-daemon --go-fallback --force", From 91859833de474b66c245b2d307251616aaed492b Mon Sep 17 00:00:00 2001 From: Alex Tkachev Date: Wed, 1 May 2024 19:44:28 +0400 Subject: [PATCH 48/51] chore: remove useless classname Also trigger BlockForm stories re-test in Chromatic. --- .../src/components/Organisms/PageContent/BlockForm.stories.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/ui/src/components/Organisms/PageContent/BlockForm.stories.tsx b/packages/ui/src/components/Organisms/PageContent/BlockForm.stories.tsx index 4b9471c37..9d255cea9 100644 --- a/packages/ui/src/components/Organisms/PageContent/BlockForm.stories.tsx +++ b/packages/ui/src/components/Organisms/PageContent/BlockForm.stories.tsx @@ -19,6 +19,5 @@ export const Error = { args: { url: 'webforms/error/index.html' as Url, cssStylesToInject: cmsCss, - className: 'mt-16', }, } satisfies StoryObj; From a2279bdfe7b3fec139db2513a2c0af3daf26d214 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Thu, 2 May 2024 16:12:24 +0200 Subject: [PATCH 49/51] fix(gatsby-oauth): remove absolute url --- apps/website/gatsby-config.mjs | 2 -- packages/ui/src/components/Molecules/UserButton.tsx | 12 ++++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/apps/website/gatsby-config.mjs b/apps/website/gatsby-config.mjs index 842076dff..81457209e 100644 --- a/apps/website/gatsby-config.mjs +++ b/apps/website/gatsby-config.mjs @@ -6,8 +6,6 @@ // TS file name should be different from gastby-config.ts, otherwise Gatsby will // pick it up instead of the JS file. -import { existsSync } from 'fs'; - process.env.NETLIFY_URL = process.env.NETLIFY_URL || 'http://127.0.0.1:8000'; process.env.CLOUDINARY_API_KEY = process.env.CLOUDINARY_API_KEY || 'test'; diff --git a/packages/ui/src/components/Molecules/UserButton.tsx b/packages/ui/src/components/Molecules/UserButton.tsx index 822c5ec5f..cba33168a 100644 --- a/packages/ui/src/components/Molecules/UserButton.tsx +++ b/packages/ui/src/components/Molecules/UserButton.tsx @@ -1,4 +1,4 @@ -import { Link } from '@custom/schema'; +import { Link, Url } from '@custom/schema'; import { signIn, signOut, useSession } from 'next-auth/react'; import React from 'react'; import { useIntl } from 'react-intl'; @@ -6,16 +6,12 @@ import { useIntl } from 'react-intl'; export function UserButton() { const session = useSession(); const intl = useIntl(); - const hostWithScheme = - typeof window !== 'undefined' - ? `${location.protocol}//${location.host}` - : ''; return ( <> {!session && <>} {session?.status !== 'authenticated' && ( { e.preventDefault(); @@ -31,7 +27,7 @@ export function UserButton() { {session?.status === 'authenticated' && session.data.user && ( <> {session.data.user.name @@ -39,7 +35,7 @@ export function UserButton() { : session.data.user.email} { e.preventDefault(); From 12a7258ea502264d28a73e25b1bd8169358825d1 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Thu, 2 May 2024 16:14:33 +0200 Subject: [PATCH 50/51] chore(gatsby-oauth): remove nextauth env vars with publisher --- apps/website/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/website/package.json b/apps/website/package.json index 73d7a6c10..75bcc0550 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -56,7 +56,7 @@ "build:drupal": "CLOUDINARY_CLOUDNAME=test pnpm start-test start:drupal 8888 build:gatsby", "build:gatsby": "gatsby build", "build": "if node has-drupal.mjs; then pnpm build:drupal; else pnpm build:gatsby; fi", - "start": "NEXTAUTH_URL=http://localhost:8000 NEXTAUTH_SECRET=banana publisher", + "start": "publisher", "serve": "netlify dev --cwd=. --dir=public --port=8000", "dev": "pnpm clean && publisher", "open": "open http://127.0.0.1:8000/___status/", From acf8294f38236d60b7e061602a9e02e5a2564fc6 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Thu, 2 May 2024 16:56:04 +0200 Subject: [PATCH 51/51] docs(gatsby-oauth): fix redirect uri --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fd0990ccb..eacf844f5 100644 --- a/README.md +++ b/README.md @@ -250,7 +250,7 @@ A `Website` consumer is created in Drupal `/admin/config/services/consumer` with - Label: `Website` - Client ID: `website` - Secret: a random string matching `AUTH_DRUPAL_SECRET` -- Redirect URI: `[netlify-gatsby-site-url]/oauth/callback` +- Redirect URI: `[netlify-gatsby-site-url]/api/auth/callback/drupal` #### Other providers