From bcbaa5ebafb1c995a15d8a7139f93c38735fb45e Mon Sep 17 00:00:00 2001 From: Guillaume Dorce Date: Sat, 4 Feb 2023 17:07:05 +0100 Subject: [PATCH] remove builder.io --- package.json | 1 - pnpm-lock.yaml | 195 +--------------------------------------- src/pages/[...page].tsx | 115 ------------------------ 3 files changed, 2 insertions(+), 309 deletions(-) delete mode 100644 src/pages/[...page].tsx diff --git a/package.json b/package.json index 15c76a7..b442e72 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ "start": "next start" }, "dependencies": { - "@builder.io/react": "^2.0.13", "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", "@prisma/client": "^4.8.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 40081be..2eb3f10 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,7 +1,6 @@ lockfileVersion: 5.4 specifiers: - '@builder.io/react': ^2.0.13 '@emotion/react': ^11.10.5 '@emotion/styled': ^11.10.5 '@prisma/client': ^4.8.0 @@ -37,7 +36,6 @@ specifiers: zod: ^3.20.2 dependencies: - '@builder.io/react': 2.0.13_biqbaboplfbrettd7655fr4n2y '@emotion/react': 11.10.5_3stiutgnnbnfnf3uowm5cip22i '@emotion/styled': 11.10.5_jrh5enlbqfbnumycmktdqgd6se '@prisma/client': 4.9.0_prisma@4.9.0 @@ -138,37 +136,6 @@ packages: to-fast-properties: 2.0.0 dev: false - /@builder.io/react/2.0.13_biqbaboplfbrettd7655fr4n2y: - resolution: {integrity: sha512-z9LdFaM4kzTxT5OqgEF7O3oFsnzgEkthhRXaNASN3GB0XocxRU0gH42aAnv5pr2u6TPIvEFyIqwb+udJMSLIng==} - engines: {node: '>=6.0.0'} - peerDependencies: - react: '>=16.8.0' - react-dom: '>=16.8.0' - dependencies: - '@builder.io/sdk': 1.1.30 - '@emotion/core': 10.3.1_react@18.2.0 - hash-sum: 2.0.0 - preact: 10.11.3 - react: 18.2.0 - react-dom: 18.2.0_react@18.2.0 - vm2: 3.9.13 - optionalDependencies: - node-fetch: 2.6.8 - prop-types: 15.8.1 - transitivePeerDependencies: - - encoding - dev: false - - /@builder.io/sdk/1.1.30: - resolution: {integrity: sha512-HS5TSs/r7DsDFYaMQ8poXcMD/1jFjgrxulf1Ai/1y494QlxNyhQKQSZyhYJe2B+C2nZJTPfJjEFQMDSlACeoLA==} - dependencies: - hash-sum: 2.0.0 - node-fetch: 2.6.8 - tslib: 1.14.1 - transitivePeerDependencies: - - encoding - dev: false - /@emotion/babel-plugin/11.10.5: resolution: {integrity: sha512-xE7/hyLHJac7D2Ve9dKroBBZqBT7WuPQmWcq7HSGb84sUuP4mlOWoB8dvVfD9yk5DHkU1m6RW7xSoDtnQHNQeA==} peerDependencies: @@ -188,15 +155,6 @@ packages: stylis: 4.1.3 dev: false - /@emotion/cache/10.0.29: - resolution: {integrity: sha512-fU2VtSVlHiF27empSbxi1O2JFdNWZO+2NFHfwO0pxgTep6Xa3uGb+3pVKfLww2l/IBGLNEZl5Xf/++A4wAYDYQ==} - dependencies: - '@emotion/sheet': 0.9.4 - '@emotion/stylis': 0.8.5 - '@emotion/utils': 0.11.3 - '@emotion/weak-memoize': 0.2.5 - dev: false - /@emotion/cache/11.10.5: resolution: {integrity: sha512-dGYHWyzTdmK+f2+EnIGBpkz1lKc4Zbj2KHd4cX3Wi8/OWr5pKslNjc3yABKH4adRGCvSX4VDC0i04mrrq0aiRA==} dependencies: @@ -207,32 +165,6 @@ packages: stylis: 4.1.3 dev: false - /@emotion/core/10.3.1_react@18.2.0: - resolution: {integrity: sha512-447aUEjPIm0MnE6QYIaFz9VQOHSXf4Iu6EWOIqq11EAPqinkSZmfymPTmlOE3QjLv846lH4JVZBUOtwGbuQoww==} - peerDependencies: - react: '>=16.3.0' - dependencies: - '@babel/runtime': 7.20.13 - '@emotion/cache': 10.0.29 - '@emotion/css': 10.0.27 - '@emotion/serialize': 0.11.16 - '@emotion/sheet': 0.9.4 - '@emotion/utils': 0.11.3 - react: 18.2.0 - dev: false - - /@emotion/css/10.0.27: - resolution: {integrity: sha512-6wZjsvYeBhyZQYNrGoR5yPMYbMBNEnanDrqmsqS1mzDm1cOTu12shvl2j4QHNS36UaTE0USIJawCH9C8oW34Zw==} - dependencies: - '@emotion/serialize': 0.11.16 - '@emotion/utils': 0.11.3 - babel-plugin-emotion: 10.2.2 - dev: false - - /@emotion/hash/0.8.0: - resolution: {integrity: sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==} - dev: false - /@emotion/hash/0.9.0: resolution: {integrity: sha512-14FtKiHhy2QoPIzdTcvh//8OyBlknNs2nXRwIhG904opCby3l+9Xaf/wuPvICBF0rc1ZCNBd3nKe9cd2mecVkQ==} dev: false @@ -243,10 +175,6 @@ packages: '@emotion/memoize': 0.8.0 dev: false - /@emotion/memoize/0.7.4: - resolution: {integrity: sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==} - dev: false - /@emotion/memoize/0.8.0: resolution: {integrity: sha512-G/YwXTkv7Den9mXDO7AhLWkE3q+I92B+VqAE+dYG4NGPaHZGvt3G8Q0p9vmE+sq7rTGphUbAvmQ9YpbfMQGGlA==} dev: false @@ -275,16 +203,6 @@ packages: react: 18.2.0 dev: false - /@emotion/serialize/0.11.16: - resolution: {integrity: sha512-G3J4o8by0VRrO+PFeSc3js2myYNOXVJ3Ya+RGVxnshRYgsvErfAOglKAiy1Eo1vhzxqtUvjCyS5gtewzkmvSSg==} - dependencies: - '@emotion/hash': 0.8.0 - '@emotion/memoize': 0.7.4 - '@emotion/unitless': 0.7.5 - '@emotion/utils': 0.11.3 - csstype: 2.6.21 - dev: false - /@emotion/serialize/1.1.1: resolution: {integrity: sha512-Zl/0LFggN7+L1liljxXdsVSVlg6E/Z/olVWpfxUTxOAmi8NU7YoeWeLfi1RmnB2TATHoaWwIBRoL+FvAJiTUQA==} dependencies: @@ -295,10 +213,6 @@ packages: csstype: 3.1.1 dev: false - /@emotion/sheet/0.9.4: - resolution: {integrity: sha512-zM9PFmgVSqBw4zL101Q0HrBVTGmpAxFZH/pYx/cjJT5advXguvcgjHFTCaIO3enL/xr89vK2bh0Mfyj9aa0ANA==} - dev: false - /@emotion/sheet/1.2.1: resolution: {integrity: sha512-zxRBwl93sHMsOj4zs+OslQKg/uhF38MB+OMKoCrVuS0nyTkqnau+BM3WGEoOptg9Oz45T/aIGs1qbVAsEFo3nA==} dev: false @@ -327,14 +241,6 @@ packages: react: 18.2.0 dev: false - /@emotion/stylis/0.8.5: - resolution: {integrity: sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==} - dev: false - - /@emotion/unitless/0.7.5: - resolution: {integrity: sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==} - dev: false - /@emotion/unitless/0.8.0: resolution: {integrity: sha512-VINS5vEYAscRl2ZUDiT3uMPlrFQupiKgHz5AA4bCH1miKBg4qtwkim1qPmJj/4WG6TreYMY111rEFsjupcOKHw==} dev: false @@ -347,18 +253,10 @@ packages: react: 18.2.0 dev: false - /@emotion/utils/0.11.3: - resolution: {integrity: sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw==} - dev: false - /@emotion/utils/1.2.0: resolution: {integrity: sha512-sn3WH53Kzpw8oQ5mgMmIzzyAaH2ZqFEbozVVBSYp538E06OSE6ytOp7pRAjNQR+Q/orwqdQYJSe2m3hCOeznkw==} dev: false - /@emotion/weak-memoize/0.2.5: - resolution: {integrity: sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA==} - dev: false - /@emotion/weak-memoize/0.3.0: resolution: {integrity: sha512-AHPmaAx+RYfZz0eYu6Gviiagpmiyw98ySSlQvCUhVGDRtDFe4DBS0x1bSjdF3gqUDYOczB+yYvBTtEylYSdRhg==} dev: false @@ -1229,11 +1127,6 @@ packages: engines: {node: '>=0.4.0'} dev: true - /acorn-walk/8.2.0: - resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} - engines: {node: '>=0.4.0'} - dev: false - /acorn/7.4.1: resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} engines: {node: '>=0.4.0'} @@ -1244,6 +1137,7 @@ packages: resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} engines: {node: '>=0.4.0'} hasBin: true + dev: true /add/2.0.6: resolution: {integrity: sha512-j5QzrmsokwWWp6kUcJQySpbG+xfOBqqKnup3OIk1pz+kB/80SLorZ9V8zHFLO92Lcd+hbvq8bT+zOGoPkmBV0Q==} @@ -1390,29 +1284,6 @@ packages: deep-equal: 2.2.0 dev: true - /babel-plugin-emotion/10.2.2: - resolution: {integrity: sha512-SMSkGoqTbTyUTDeuVuPIWifPdUGkTk1Kf9BWRiXIOIcuyMfsdp2EjeiiFvOzX8NOBvEh/ypKYvUh2rkgAJMCLA==} - dependencies: - '@babel/helper-module-imports': 7.18.6 - '@emotion/hash': 0.8.0 - '@emotion/memoize': 0.7.4 - '@emotion/serialize': 0.11.16 - babel-plugin-macros: 2.8.0 - babel-plugin-syntax-jsx: 6.18.0 - convert-source-map: 1.9.0 - escape-string-regexp: 1.0.5 - find-root: 1.1.0 - source-map: 0.5.7 - dev: false - - /babel-plugin-macros/2.8.0: - resolution: {integrity: sha512-SEP5kJpfGYqYKpBrj5XU3ahw5p5GOHJ0U5ssOSQ/WBVdwkD2Dzlce95exQTs3jOVWPPKLBN2rlEWkCK7dSmLvg==} - dependencies: - '@babel/runtime': 7.20.13 - cosmiconfig: 6.0.0 - resolve: 1.22.1 - dev: false - /babel-plugin-macros/3.1.0: resolution: {integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==} engines: {node: '>=10', npm: '>=6'} @@ -1422,10 +1293,6 @@ packages: resolve: 1.22.1 dev: false - /babel-plugin-syntax-jsx/6.18.0: - resolution: {integrity: sha512-qrPaCSo9c8RHNRHIotaufGbuOBN8rtdC4QrrFFc43vyWCCz7Kl7GL1PGaXtMGQZUXrkCjNEgxDfmAuAabr/rlw==} - dev: false - /balanced-match/1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} dev: true @@ -1575,17 +1442,6 @@ packages: toggle-selection: 1.0.6 dev: false - /cosmiconfig/6.0.0: - resolution: {integrity: sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==} - engines: {node: '>=8'} - dependencies: - '@types/parse-json': 4.0.0 - import-fresh: 3.3.0 - parse-json: 5.2.0 - path-type: 4.0.0 - yaml: 1.10.2 - dev: false - /cosmiconfig/7.1.0: resolution: {integrity: sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==} engines: {node: '>=10'} @@ -1637,10 +1493,6 @@ packages: cssom: 0.3.8 dev: false - /csstype/2.6.21: - resolution: {integrity: sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==} - dev: false - /csstype/3.1.1: resolution: {integrity: sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==} @@ -2473,10 +2325,6 @@ packages: dependencies: function-bind: 1.1.1 - /hash-sum/2.0.0: - resolution: {integrity: sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==} - dev: false - /hoist-non-react-statics/3.3.2: resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==} dependencies: @@ -2993,18 +2841,6 @@ packages: - babel-plugin-macros dev: false - /node-fetch/2.6.8: - resolution: {integrity: sha512-RZ6dBYuj8dRSfxpUSu+NsdF1dpPpluJxwOp+6IoDp/sH2QNDSvurYsAa+F1WxY2RjA1iP93xhcsUoYbF2XBqVg==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - dependencies: - whatwg-url: 5.0.0 - dev: false - /node-releases/2.0.8: resolution: {integrity: sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A==} dev: true @@ -3260,10 +3096,6 @@ packages: source-map-js: 1.0.2 dev: true - /preact/10.11.3: - resolution: {integrity: sha512-eY93IVpod/zG3uMF22Unl8h9KkrcKIRs2EGar8hwLZZDU1lkjph303V9HZBwufh2s736U6VXuhD109LYqPoffg==} - dev: false - /prelude-ls/1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -4013,10 +3845,6 @@ packages: resolution: {integrity: sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ==} dev: false - /tr46/0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - dev: false - /ts-easing/0.2.0: resolution: {integrity: sha512-Z86EW+fFFh/IFB1fqQ3/+7Zpf9t2ebOAxNI/V6Wo7r5gqiqtxmgTlQ1qbqQcjLKYeSHPTsEmvlJUDg/EuL0uHQ==} dev: false @@ -4032,6 +3860,7 @@ packages: /tslib/1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + dev: true /tslib/2.5.0: resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} @@ -4131,26 +3960,6 @@ packages: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} dev: true - /vm2/3.9.13: - resolution: {integrity: sha512-0rvxpB8P8Shm4wX2EKOiMp7H2zq+HUE/UwodY0pCZXs9IffIKZq6vUti5OgkVCTakKo9e/fgO4X1fkwfjWxE3Q==} - engines: {node: '>=6.0'} - hasBin: true - dependencies: - acorn: 8.8.2 - acorn-walk: 8.2.0 - dev: false - - /webidl-conversions/3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - dev: false - - /whatwg-url/5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - dev: false - /which-boxed-primitive/1.0.2: resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} dependencies: diff --git a/src/pages/[...page].tsx b/src/pages/[...page].tsx deleted file mode 100644 index c297f87..0000000 --- a/src/pages/[...page].tsx +++ /dev/null @@ -1,115 +0,0 @@ -import { useRouter } from 'next/router'; -import DefaultErrorPage from 'next/error'; -import Head from 'next/head'; -import React from 'react'; -import { BuilderComponent, builder, useIsPreviewing, Builder } from '@builder.io/react'; - - -// Initialize the Builder SDK with your organization's API Key -// Find the API Key on: https://builder.io/account/settings -builder.init("37b11147aa464a4d9525b2ab66c319f7"); - -export async function getStaticProps({ params }) { - // Fetch the first page from Builder that matches the current URL. - // Use the `userAttributes` field for targeting content. - // For more, see https://www.builder.io/c/docs/targeting-with-builder - const page = await builder - .get('page', { - userAttributes: { - urlPath: '/' + (params?.page?.join('/') || ''), - }, - }) - .toPromise(); - - return { - props: { - page: page || null, - }, - revalidate: 5, - }; -} - -export async function getStaticPaths() { - // Fetch all published pages for the current model. - // Using the `fields` option will limit the size of the response - // and only return the `data.url` field from the matching pages. - const pages = await builder.getAll('page', { - fields: 'data.url', // only request the `data.url` field - options: { noTargeting: true }, - limit: 0, - }); - - return { - paths: pages.map(page => `${page.data?.url}`), - fallback: true, - }; -} - -export default function Page({ page }) { - const router = useRouter(); - // This flag indicates if you are viewing the page in the Builder editor. - const isPreviewing = useIsPreviewing(); - - if (router.isFallback) { - return

Loading...

; - } - - // Add your error page here to return if there are no matching - // content entries published in Builder. - if (!page && !isPreviewing) { - return ; - } - - return ( - <> - - {/* Add any relevant SEO metadata or open graph tags here */} - {page?.data.title} - - -
- {/* Put your header or main layout here */} - Your header -
- - {/* Render the Builder page */} - - -
- {/* Put your footer or main layout here */} - Your footer -
- - ); -} - -// This is an example of registering a custom component to be used in Builder.io. -// You would typically do this in the file where the component is defined. - -const MyCustomComponent = props => ( -
-

{props.title}

-

{props.description}

-
-); - -// This is a minimal example of a custom component, you can view more complex input types here: -// https://www.builder.io/c/docs/custom-react-components#input-types -Builder.registerComponent(MyCustomComponent, { - name: 'ExampleCustomComponent', - inputs: [ - { name: 'title', type: 'string', defaultValue: 'I am a React component!' }, - { - name: 'description', - type: 'string', - defaultValue: 'Find my source in /pages/[...page].js', - }, - ], -}); - -// Register a custom insert menu to organize your custom componnets -// https://www.builder.io/c/docs/custom-components-visual-editor#:~:text=than%20this%20screenshot.-,organizing%20your%20components%20in%20custom%20sections,-You%20can%20create -Builder.register('insertMenu', { - name: 'My Components', - items: [{ item: 'ExampleCustomComponent', name: 'My React Component' }], -});