From 0b7adf89f795cdefdd5a48f9ad03b933232f7091 Mon Sep 17 00:00:00 2001 From: Alican Erdurmaz Date: Wed, 17 Jan 2024 15:15:54 +0300 Subject: [PATCH] chore: remove refine-react --- .github/workflows/test-local.yaml | 51 --- refine-react/plugins/_base/extend.js | 208 ----------- .../plugins/_base/public/images/flags/de.svg | 1 - .../plugins/_base/public/images/flags/en.svg | 1 - .../_base/public/locales/de/common.json | 204 ----------- .../_base/public/locales/en/common.json | 205 ----------- refine-react/plugins/_base/src/App.css | 88 ----- .../_base/src/components/app-icon/index.tsx | 9 - .../_base/src/components/breadcrumb/index.tsx | 22 -- .../_base/src/components/layout/index.tsx | 15 - .../_base/src/components/menu/index.tsx | 35 -- refine-react/plugins/antd/extend.js | 22 -- refine-react/plugins/antd/meta.json | 4 - refine-react/plugins/antd/package.json | 7 - .../antd/src/components/header/index.tsx | 65 ---- .../plugins/antd/src/components/index.ts | 1 - .../antd/src/contexts/color-mode/index.tsx | 60 ---- .../plugins/auth-provider-auth0/extend.js | 96 ----- .../plugins/auth-provider-auth0/meta.json | 4 - .../plugins/auth-provider-auth0/package.json | 6 - .../auth-provider-auth0/public/refine.svg | 10 - .../auth-provider-auth0/src/pages/login.tsx | 265 -------------- .../plugins/auth-provider-custom/extend.js | 22 -- .../plugins/auth-provider-custom/meta.json | 4 - .../auth-provider-custom/src/authProvider.ts | 59 ---- .../src/pages/forgotPassword/index.tsx | 59 ---- .../src/pages/login/index.tsx | 60 ---- .../src/pages/register/index.tsx | 59 ---- .../plugins/auth-provider-google/extend.js | 110 ------ .../plugins/auth-provider-google/meta.json | 4 - .../plugins/auth-provider-google/package.json | 5 - .../auth-provider-google/public/refine.svg | 10 - .../src/interfaces/google.d.ts | 126 ------- .../auth-provider-google/src/pages/login.tsx | 261 -------------- .../src/utils/parse-jwt.ts | 17 - .../plugins/auth-provider-keycloak/extend.js | 107 ------ .../plugins/auth-provider-keycloak/meta.json | 4 - .../auth-provider-keycloak/package.json | 7 - .../auth-provider-keycloak/public/refine.svg | 10 - .../src/pages/login.tsx | 260 -------------- refine-react/plugins/chakra/extend.js | 35 -- refine-react/plugins/chakra/meta.json | 4 - refine-react/plugins/chakra/package.json | 10 - .../chakra/src/components/header/index.tsx | 93 ----- .../plugins/chakra/src/components/index.ts | 1 - .../plugins/data-provider-airtable/extend.js | 16 - .../plugins/data-provider-airtable/meta.json | 4 - .../data-provider-airtable/package.json | 5 - .../plugins/data-provider-altogic/extend.js | 44 --- .../plugins/data-provider-altogic/meta.json | 4 - .../data-provider-altogic/package.json | 6 - .../plugins/data-provider-appwrite/extend.js | 30 -- .../plugins/data-provider-appwrite/meta.json | 4 - .../data-provider-appwrite/package.json | 9 - .../src/authProvider.ts | 100 ------ .../src/utility/appwriteClient.ts | 12 - .../src/utility/index.ts | 4 - .../src/utility/normalize.ts | 27 -- .../data-provider-custom-json-rest/extend.js | 14 - .../data-provider-custom-json-rest/meta.json | 4 - .../package.json | 5 - .../plugins/data-provider-graphql/extend.js | 25 -- .../plugins/data-provider-graphql/meta.json | 4 - .../data-provider-graphql/package.json | 7 - .../plugins/data-provider-hasura/extend.js | 32 -- .../plugins/data-provider-hasura/meta.json | 4 - .../plugins/data-provider-hasura/package.json | 7 - .../src/inferencerPredefinedMeta.ts | 33 -- .../plugins/data-provider-medusa/extend.js | 23 -- .../plugins/data-provider-medusa/package.json | 5 - .../data-provider-nestjsx-crud/extend.js | 20 -- .../data-provider-nestjsx-crud/meta.json | 4 - .../data-provider-nestjsx-crud/package.json | 5 - .../plugins/data-provider-strapi-v4/extend.js | 25 -- .../plugins/data-provider-strapi-v4/meta.json | 4 - .../data-provider-strapi-v4/package.json | 6 - .../src/authProvider.ts | 86 ----- .../data-provider-strapi-v4/src/constants.ts | 2 - .../plugins/data-provider-supabase/extend.js | 31 -- .../plugins/data-provider-supabase/meta.json | 4 - .../data-provider-supabase/package.json | 5 - .../src/authProvider.ts | 247 ------------- .../src/utility/index.ts | 1 - .../src/utility/supabaseClient.ts | 14 - refine-react/plugins/i18n-antd/extend.js | 23 -- refine-react/plugins/i18n-antd/meta.json | 4 - refine-react/plugins/i18n-antd/package.json | 8 - .../i18n-antd/src/components/header/index.tsx | 105 ------ .../plugins/i18n-antd/src/components/index.ts | 1 - refine-react/plugins/i18n-antd/src/i18n.ts | 19 - refine-react/plugins/i18n-chakra/extend.js | 23 -- refine-react/plugins/i18n-chakra/meta.json | 4 - refine-react/plugins/i18n-chakra/package.json | 8 - .../src/components/header/index.tsx | 139 -------- .../i18n-chakra/src/components/index.ts | 1 - refine-react/plugins/i18n-chakra/src/i18n.ts | 19 - refine-react/plugins/i18n-mantine/extend.js | 23 -- refine-react/plugins/i18n-mantine/meta.json | 4 - .../plugins/i18n-mantine/package.json | 8 - .../src/components/header/index.tsx | 138 -------- .../i18n-mantine/src/components/index.ts | 1 - refine-react/plugins/i18n-mantine/src/i18n.ts | 19 - refine-react/plugins/i18n-mui/extend.js | 23 -- refine-react/plugins/i18n-mui/meta.json | 4 - refine-react/plugins/i18n-mui/package.json | 8 - .../i18n-mui/src/components/header/index.tsx | 144 -------- refine-react/plugins/i18n-mui/src/i18n.ts | 19 - refine-react/plugins/i18n/extend.js | 22 -- refine-react/plugins/i18n/meta.json | 4 - refine-react/plugins/i18n/package.json | 8 - refine-react/plugins/i18n/src/i18n.ts | 19 - .../plugins/inferencer-headless/extend.js | 21 -- .../plugins/inferencer-headless/meta.json | 4 - .../plugins/inferencer-headless/package.json | 7 - .../src/pages/blog-posts/create.tsx | 31 -- .../src/pages/blog-posts/edit.tsx | 31 -- .../src/pages/blog-posts/index.ts | 4 - .../src/pages/blog-posts/list.tsx | 32 -- .../src/pages/blog-posts/show.tsx | 31 -- .../src/pages/categories/create.tsx | 30 -- .../src/pages/categories/edit.tsx | 30 -- .../src/pages/categories/index.ts | 4 - .../src/pages/categories/list.tsx | 30 -- .../src/pages/categories/show.tsx | 30 -- refine-react/plugins/inferencer/extend.js | 49 --- refine-react/plugins/inferencer/meta.json | 4 - .../src/pages/blog-posts/create.tsx | 31 -- .../inferencer/src/pages/blog-posts/edit.tsx | 31 -- .../inferencer/src/pages/blog-posts/index.ts | 4 - .../inferencer/src/pages/blog-posts/list.tsx | 32 -- .../inferencer/src/pages/blog-posts/show.tsx | 31 -- .../src/pages/categories/create.tsx | 30 -- .../inferencer/src/pages/categories/edit.tsx | 31 -- .../inferencer/src/pages/categories/index.ts | 4 - .../inferencer/src/pages/categories/list.tsx | 30 -- .../inferencer/src/pages/categories/show.tsx | 31 -- refine-react/plugins/mantine/extend.js | 62 ---- refine-react/plugins/mantine/meta.json | 4 - refine-react/plugins/mantine/package.json | 12 - .../mantine/src/components/header/index.tsx | 95 ----- .../plugins/mantine/src/components/index.ts | 1 - refine-react/plugins/mui/extend.js | 33 -- refine-react/plugins/mui/meta.json | 4 - refine-react/plugins/mui/package.json | 13 - .../mui/src/components/header/index.tsx | 84 ----- .../plugins/mui/src/components/index.ts | 1 - .../mui/src/contexts/color-mode/index.tsx | 61 ---- .../plugins/react-router-v6/extend.js | 18 - .../plugins/react-router-v6/meta.json | 4 - .../plugins/react-router-v6/package.json | 5 - refine-react/prompt.js | 331 ------------------ refine-react/template/.npmrc | 2 - refine-react/template/README.MD | 54 --- refine-react/template/_package.json | 52 --- refine-react/template/_tsconfig.json | 30 -- refine-react/template/gitignore | 23 -- refine-react/template/public/favicon.ico | Bin 101076 -> 0 bytes refine-react/template/public/index.html | 42 --- refine-react/template/src/App.tsx | 273 --------------- refine-react/template/src/index.tsx | 58 --- refine-react/template/src/meta.json | 4 - refine-react/template/src/react-app-env.d.ts | 1 - refine-react/template/src/reportWebVitals.ts | 15 - refine-react/template/src/setupTests.ts | 5 - 164 files changed, 6266 deletions(-) delete mode 100644 refine-react/plugins/_base/extend.js delete mode 100644 refine-react/plugins/_base/public/images/flags/de.svg delete mode 100644 refine-react/plugins/_base/public/images/flags/en.svg delete mode 100644 refine-react/plugins/_base/public/locales/de/common.json delete mode 100644 refine-react/plugins/_base/public/locales/en/common.json delete mode 100644 refine-react/plugins/_base/src/App.css delete mode 100644 refine-react/plugins/_base/src/components/app-icon/index.tsx delete mode 100644 refine-react/plugins/_base/src/components/breadcrumb/index.tsx delete mode 100644 refine-react/plugins/_base/src/components/layout/index.tsx delete mode 100644 refine-react/plugins/_base/src/components/menu/index.tsx delete mode 100644 refine-react/plugins/antd/extend.js delete mode 100644 refine-react/plugins/antd/meta.json delete mode 100644 refine-react/plugins/antd/package.json delete mode 100644 refine-react/plugins/antd/src/components/header/index.tsx delete mode 100644 refine-react/plugins/antd/src/components/index.ts delete mode 100644 refine-react/plugins/antd/src/contexts/color-mode/index.tsx delete mode 100644 refine-react/plugins/auth-provider-auth0/extend.js delete mode 100644 refine-react/plugins/auth-provider-auth0/meta.json delete mode 100644 refine-react/plugins/auth-provider-auth0/package.json delete mode 100644 refine-react/plugins/auth-provider-auth0/public/refine.svg delete mode 100644 refine-react/plugins/auth-provider-auth0/src/pages/login.tsx delete mode 100644 refine-react/plugins/auth-provider-custom/extend.js delete mode 100644 refine-react/plugins/auth-provider-custom/meta.json delete mode 100644 refine-react/plugins/auth-provider-custom/src/authProvider.ts delete mode 100644 refine-react/plugins/auth-provider-custom/src/pages/forgotPassword/index.tsx delete mode 100644 refine-react/plugins/auth-provider-custom/src/pages/login/index.tsx delete mode 100644 refine-react/plugins/auth-provider-custom/src/pages/register/index.tsx delete mode 100644 refine-react/plugins/auth-provider-google/extend.js delete mode 100644 refine-react/plugins/auth-provider-google/meta.json delete mode 100644 refine-react/plugins/auth-provider-google/package.json delete mode 100644 refine-react/plugins/auth-provider-google/public/refine.svg delete mode 100644 refine-react/plugins/auth-provider-google/src/interfaces/google.d.ts delete mode 100644 refine-react/plugins/auth-provider-google/src/pages/login.tsx delete mode 100644 refine-react/plugins/auth-provider-google/src/utils/parse-jwt.ts delete mode 100644 refine-react/plugins/auth-provider-keycloak/extend.js delete mode 100644 refine-react/plugins/auth-provider-keycloak/meta.json delete mode 100644 refine-react/plugins/auth-provider-keycloak/package.json delete mode 100644 refine-react/plugins/auth-provider-keycloak/public/refine.svg delete mode 100644 refine-react/plugins/auth-provider-keycloak/src/pages/login.tsx delete mode 100644 refine-react/plugins/chakra/extend.js delete mode 100644 refine-react/plugins/chakra/meta.json delete mode 100644 refine-react/plugins/chakra/package.json delete mode 100644 refine-react/plugins/chakra/src/components/header/index.tsx delete mode 100644 refine-react/plugins/chakra/src/components/index.ts delete mode 100644 refine-react/plugins/data-provider-airtable/extend.js delete mode 100644 refine-react/plugins/data-provider-airtable/meta.json delete mode 100644 refine-react/plugins/data-provider-airtable/package.json delete mode 100644 refine-react/plugins/data-provider-altogic/extend.js delete mode 100644 refine-react/plugins/data-provider-altogic/meta.json delete mode 100644 refine-react/plugins/data-provider-altogic/package.json delete mode 100644 refine-react/plugins/data-provider-appwrite/extend.js delete mode 100644 refine-react/plugins/data-provider-appwrite/meta.json delete mode 100644 refine-react/plugins/data-provider-appwrite/package.json delete mode 100644 refine-react/plugins/data-provider-appwrite/src/authProvider.ts delete mode 100644 refine-react/plugins/data-provider-appwrite/src/utility/appwriteClient.ts delete mode 100644 refine-react/plugins/data-provider-appwrite/src/utility/index.ts delete mode 100644 refine-react/plugins/data-provider-appwrite/src/utility/normalize.ts delete mode 100644 refine-react/plugins/data-provider-custom-json-rest/extend.js delete mode 100644 refine-react/plugins/data-provider-custom-json-rest/meta.json delete mode 100644 refine-react/plugins/data-provider-custom-json-rest/package.json delete mode 100644 refine-react/plugins/data-provider-graphql/extend.js delete mode 100644 refine-react/plugins/data-provider-graphql/meta.json delete mode 100644 refine-react/plugins/data-provider-graphql/package.json delete mode 100644 refine-react/plugins/data-provider-hasura/extend.js delete mode 100644 refine-react/plugins/data-provider-hasura/meta.json delete mode 100644 refine-react/plugins/data-provider-hasura/package.json delete mode 100644 refine-react/plugins/data-provider-hasura/src/inferencerPredefinedMeta.ts delete mode 100644 refine-react/plugins/data-provider-medusa/extend.js delete mode 100644 refine-react/plugins/data-provider-medusa/package.json delete mode 100644 refine-react/plugins/data-provider-nestjsx-crud/extend.js delete mode 100644 refine-react/plugins/data-provider-nestjsx-crud/meta.json delete mode 100644 refine-react/plugins/data-provider-nestjsx-crud/package.json delete mode 100644 refine-react/plugins/data-provider-strapi-v4/extend.js delete mode 100644 refine-react/plugins/data-provider-strapi-v4/meta.json delete mode 100644 refine-react/plugins/data-provider-strapi-v4/package.json delete mode 100644 refine-react/plugins/data-provider-strapi-v4/src/authProvider.ts delete mode 100644 refine-react/plugins/data-provider-strapi-v4/src/constants.ts delete mode 100644 refine-react/plugins/data-provider-supabase/extend.js delete mode 100644 refine-react/plugins/data-provider-supabase/meta.json delete mode 100644 refine-react/plugins/data-provider-supabase/package.json delete mode 100644 refine-react/plugins/data-provider-supabase/src/authProvider.ts delete mode 100644 refine-react/plugins/data-provider-supabase/src/utility/index.ts delete mode 100644 refine-react/plugins/data-provider-supabase/src/utility/supabaseClient.ts delete mode 100644 refine-react/plugins/i18n-antd/extend.js delete mode 100644 refine-react/plugins/i18n-antd/meta.json delete mode 100644 refine-react/plugins/i18n-antd/package.json delete mode 100644 refine-react/plugins/i18n-antd/src/components/header/index.tsx delete mode 100644 refine-react/plugins/i18n-antd/src/components/index.ts delete mode 100644 refine-react/plugins/i18n-antd/src/i18n.ts delete mode 100644 refine-react/plugins/i18n-chakra/extend.js delete mode 100644 refine-react/plugins/i18n-chakra/meta.json delete mode 100644 refine-react/plugins/i18n-chakra/package.json delete mode 100644 refine-react/plugins/i18n-chakra/src/components/header/index.tsx delete mode 100644 refine-react/plugins/i18n-chakra/src/components/index.ts delete mode 100644 refine-react/plugins/i18n-chakra/src/i18n.ts delete mode 100644 refine-react/plugins/i18n-mantine/extend.js delete mode 100644 refine-react/plugins/i18n-mantine/meta.json delete mode 100644 refine-react/plugins/i18n-mantine/package.json delete mode 100644 refine-react/plugins/i18n-mantine/src/components/header/index.tsx delete mode 100644 refine-react/plugins/i18n-mantine/src/components/index.ts delete mode 100644 refine-react/plugins/i18n-mantine/src/i18n.ts delete mode 100644 refine-react/plugins/i18n-mui/extend.js delete mode 100644 refine-react/plugins/i18n-mui/meta.json delete mode 100644 refine-react/plugins/i18n-mui/package.json delete mode 100644 refine-react/plugins/i18n-mui/src/components/header/index.tsx delete mode 100644 refine-react/plugins/i18n-mui/src/i18n.ts delete mode 100644 refine-react/plugins/i18n/extend.js delete mode 100644 refine-react/plugins/i18n/meta.json delete mode 100644 refine-react/plugins/i18n/package.json delete mode 100644 refine-react/plugins/i18n/src/i18n.ts delete mode 100644 refine-react/plugins/inferencer-headless/extend.js delete mode 100644 refine-react/plugins/inferencer-headless/meta.json delete mode 100644 refine-react/plugins/inferencer-headless/package.json delete mode 100644 refine-react/plugins/inferencer-headless/src/pages/blog-posts/create.tsx delete mode 100644 refine-react/plugins/inferencer-headless/src/pages/blog-posts/edit.tsx delete mode 100644 refine-react/plugins/inferencer-headless/src/pages/blog-posts/index.ts delete mode 100644 refine-react/plugins/inferencer-headless/src/pages/blog-posts/list.tsx delete mode 100644 refine-react/plugins/inferencer-headless/src/pages/blog-posts/show.tsx delete mode 100644 refine-react/plugins/inferencer-headless/src/pages/categories/create.tsx delete mode 100644 refine-react/plugins/inferencer-headless/src/pages/categories/edit.tsx delete mode 100644 refine-react/plugins/inferencer-headless/src/pages/categories/index.ts delete mode 100644 refine-react/plugins/inferencer-headless/src/pages/categories/list.tsx delete mode 100644 refine-react/plugins/inferencer-headless/src/pages/categories/show.tsx delete mode 100644 refine-react/plugins/inferencer/extend.js delete mode 100644 refine-react/plugins/inferencer/meta.json delete mode 100644 refine-react/plugins/inferencer/src/pages/blog-posts/create.tsx delete mode 100644 refine-react/plugins/inferencer/src/pages/blog-posts/edit.tsx delete mode 100644 refine-react/plugins/inferencer/src/pages/blog-posts/index.ts delete mode 100644 refine-react/plugins/inferencer/src/pages/blog-posts/list.tsx delete mode 100644 refine-react/plugins/inferencer/src/pages/blog-posts/show.tsx delete mode 100644 refine-react/plugins/inferencer/src/pages/categories/create.tsx delete mode 100644 refine-react/plugins/inferencer/src/pages/categories/edit.tsx delete mode 100644 refine-react/plugins/inferencer/src/pages/categories/index.ts delete mode 100644 refine-react/plugins/inferencer/src/pages/categories/list.tsx delete mode 100644 refine-react/plugins/inferencer/src/pages/categories/show.tsx delete mode 100644 refine-react/plugins/mantine/extend.js delete mode 100644 refine-react/plugins/mantine/meta.json delete mode 100644 refine-react/plugins/mantine/package.json delete mode 100644 refine-react/plugins/mantine/src/components/header/index.tsx delete mode 100644 refine-react/plugins/mantine/src/components/index.ts delete mode 100644 refine-react/plugins/mui/extend.js delete mode 100644 refine-react/plugins/mui/meta.json delete mode 100644 refine-react/plugins/mui/package.json delete mode 100644 refine-react/plugins/mui/src/components/header/index.tsx delete mode 100644 refine-react/plugins/mui/src/components/index.ts delete mode 100644 refine-react/plugins/mui/src/contexts/color-mode/index.tsx delete mode 100644 refine-react/plugins/react-router-v6/extend.js delete mode 100644 refine-react/plugins/react-router-v6/meta.json delete mode 100644 refine-react/plugins/react-router-v6/package.json delete mode 100644 refine-react/prompt.js delete mode 100644 refine-react/template/.npmrc delete mode 100644 refine-react/template/README.MD delete mode 100644 refine-react/template/_package.json delete mode 100644 refine-react/template/_tsconfig.json delete mode 100644 refine-react/template/gitignore delete mode 100644 refine-react/template/public/favicon.ico delete mode 100644 refine-react/template/public/index.html delete mode 100644 refine-react/template/src/App.tsx delete mode 100644 refine-react/template/src/index.tsx delete mode 100644 refine-react/template/src/meta.json delete mode 100644 refine-react/template/src/react-app-env.d.ts delete mode 100644 refine-react/template/src/reportWebVitals.ts delete mode 100644 refine-react/template/src/setupTests.ts diff --git a/.github/workflows/test-local.yaml b/.github/workflows/test-local.yaml index 493cbb118..3ad4338fc 100644 --- a/.github/workflows/test-local.yaml +++ b/.github/workflows/test-local.yaml @@ -53,57 +53,6 @@ jobs: DATA_PROVIDER: ${{ matrix.data_provider }} UI_FRAMEWORK: ${{ matrix.ui_framework }} AUTH_PROVIDER: ${{ steps.build_step.outputs.auth_provider }} - react: - runs-on: ubuntu-latest - name: react - concurrency: - group: ${{ github.ref }}-e2e-local-react-${{ matrix.data_provider }}-${{ matrix.ui_framework }} - cancel-in-progress: true - strategy: - fail-fast: false - matrix: - data_provider: - [ - custom-json-rest, - strapi-v4, - nestjsx-crud, - airtable, - supabase, - appwrite, - hasura, - ] - ui_framework: [antd, mui, no] - steps: - - name: Checkout - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 18 - - name: Install - run: npm install - - name: Build Examples - id: build_step - run: FRAMEWORK=react DATA_PROVIDER=${{ matrix.data_provider }} UI_FRAMEWORK=${{ matrix.ui_framework }} node ./.github/workflows/build-template.js - - name: Install Deps - run: | - cd ${{ steps.build_step.outputs.project_path }} - npm install - npm run build - npm install -g serve - serve -s build & - - name: Run Cypress on local - uses: cypress-io/github-action@v4 - with: - command: npx cypress run --record --parallel --env=AUTH_PROVIDER=${{ steps.build_step.outputs.auth_provider }},UI_FRAMEWORK=${{ matrix.ui_framework }},FRAMEWORK=react,DATA_PROVIDER=${{ matrix.data_provider }} - install: false - start: "npm ls" - wait-on: "http://0.0.0.0:3000" - env: - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - FRAMEWORK: react - DATA_PROVIDER: ${{ matrix.data_provider }} - UI_FRAMEWORK: ${{ matrix.ui_framework }} - AUTH_PROVIDER: ${{ steps.build_step.outputs.auth_provider }} nextjs: runs-on: ubuntu-latest name: nextjs diff --git a/refine-react/plugins/_base/extend.js b/refine-react/plugins/_base/extend.js deleted file mode 100644 index 7eccbf54f..000000000 --- a/refine-react/plugins/_base/extend.js +++ /dev/null @@ -1,208 +0,0 @@ -const base = { - _app: { - isAuthRoutes: false, - isNoAuthRoutes: false, - hasRoutes: true, - isCustomLoginPage: false, - hasStrictMode: true, - authPageProps: [], - loginPageProps: [], - refineProps: [], - localImport: [], - refineImports: [`Authenticated`], - refineAntdImports: [], - refineChakraImports: [], - refineMuiImports: [], - refineMantineImports: [], - }, - selectedTheme: "Blue", - selectedTitle: undefined, - selectedSvg: undefined, -}; - -module.exports = { - extend(answers) { - const uiFramework = answers["ui-framework"]; - const dataProvider = answers["data-provider"]; - const inferencer = answers["inferencer"]; - - switch (uiFramework) { - case "antd": - base._app.refineAntdImports.push([ - `AuthPage`, - `ErrorComponent`, - ]); - break; - case "mui": - base._app.refineMuiImports.push([`AuthPage`, `ErrorComponent`]); - break; - case "mantine": - base._app.refineMantineImports.push([ - `AuthPage`, - `ErrorComponent`, - ]); - break; - case "chakra": - base._app.refineChakraImports.push([ - `AuthPage`, - `ErrorComponent`, - ]); - break; - default: - base._app.refineImports.push([`AuthPage`, `ErrorComponent`]); - break; - } - - if (inferencer === "no" && answers["inferencer-headless"] === "no") { - base._app.hasRoutes = false; - } - - if (answers["auth-provider"] === "none") { - if ( - [ - "data-provider-appwrite", - "data-provider-supabase", - "auth-provider-auth0", - "data-provider-strapi-v4", - ].includes(dataProvider) - ) { - base._app.isAuthRoutes = true; - } else { - base._app.isNoAuthRoutes = true; - } - } else { - base._app.isAuthRoutes = true; - } - - if ( - answers["auth-provider"] === "auth-provider-auth0" || - answers["auth-provider"] === "auth-provider-google" || - answers["auth-provider"] === "auth-provider-keycloak" || - answers["auth-provider"] === "auth-provider-custom" - ) { - base._app.isCustomLoginPage = true; - } - - // ## hasStrictMode - if (answers["auth-provider"] === "auth-provider-keycloak") { - base._app.hasStrictMode = false; - } - // ## hasStrictMode - - // ## authPageProps - let defaultValuePropsName = "initialValues"; - let defaultValues = `email: "demo@refine.dev", password: "demodemo"`; - // change supabase login credentials - if (dataProvider === "data-provider-supabase") { - defaultValues = `email: "info@refine.dev", password: "refine-supabase"`; - } - - // mui || chakra - if (uiFramework === "mui" || uiFramework === "chakra") { - defaultValuePropsName = "defaultValues"; - } - - base._app.authPageProps = [ - `formProps={{ ${defaultValuePropsName}:{ ${defaultValues} } }}`, - ]; - - // update for headless - if (uiFramework === "no") { - base._app.authPageProps = [ - ` - renderContent={(content) => ( -
-

- ${defaultValues - .replace(/"/g, "") - .replace(/,/g, "
")} -

- {content} -
- )} - `, - ]; - } - // ## authPageProps - - // ## localImport - if (base._app.isAuthRoutes || base._app.isNoAuthRoutes) { - // ignore this data providers - if ( - ![ - "data-provider-graphql", - "data-provider-medusa", - ].includes(dataProvider) && - base._app.hasRoutes === true - ) { - base._app.localImport.push( - `import { BlogPostList, BlogPostCreate, BlogPostEdit, BlogPostShow } from "pages/blog-posts";`, - ); - base._app.localImport.push( - `import { CategoryList, CategoryCreate, CategoryEdit, CategoryShow } from "pages/categories";`, - ); - } - } - - // ## selected theme - const themeFromAnswers = answers["theme"]; - if (themeFromAnswers) { - base.selectedTheme = themeFromAnswers; - } - // ## selected title - const titleFromAnswers = answers["title"]; - if (titleFromAnswers) { - base.selectedTitle = titleFromAnswers; - } - // ## selected svg - const svgFromAnswers = answers["svg"]; - if (svgFromAnswers) { - base.selectedSvg = svgFromAnswers; - } - - if ( - answers["ui-framework"] !== "no" && - (answers["title"] || answers["svg"]) - ) { - if (answers["ui-framework"] === "antd") { - base._app.refineAntdImports.push("ThemedTitleV2"); - } - if (answers["ui-framework"] === "mantine") { - base._app.refineMantineImports.push("ThemedTitleV2"); - } - if (answers["ui-framework"] === "mui") { - base._app.refineMuiImports.push("ThemedTitleV2"); - } - if (answers["ui-framework"] === "chakra") { - base._app.refineChakraImports.push("ThemedTitleV2"); - } - } - - if ( - answers["ui-framework"] !== "no" && - (answers["title"] || answers["svg"]) - ) { - base._app.localImport.push( - 'import { AppIcon } from "components/app-icon";', - ); - } - - if (answers["ui-framework"] === "no") { - base._app.localImport.push( - `import { Layout } from "./components/layout";`, - ); - base._app.localImport.push(`import "./App.css";`); - } - - // ## localImport - return base; - }, -}; diff --git a/refine-react/plugins/_base/public/images/flags/de.svg b/refine-react/plugins/_base/public/images/flags/de.svg deleted file mode 100644 index 949404e5b..000000000 --- a/refine-react/plugins/_base/public/images/flags/de.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/refine-react/plugins/_base/public/images/flags/en.svg b/refine-react/plugins/_base/public/images/flags/en.svg deleted file mode 100644 index 76b105652..000000000 --- a/refine-react/plugins/_base/public/images/flags/en.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/refine-react/plugins/_base/public/locales/de/common.json b/refine-react/plugins/_base/public/locales/de/common.json deleted file mode 100644 index ee59c3d39..000000000 --- a/refine-react/plugins/_base/public/locales/de/common.json +++ /dev/null @@ -1,204 +0,0 @@ -{ - "pages": { - "login": { - "title": "Melden Sie sich bei Ihrem Konto an", - "signin": "Einloggen", - "signup": "Anmelden", - "divider": "oder", - "fields": { - "email": "Email", - "password": "Passwort" - }, - "errors": { - "validEmail": "Ungültige E-Mail-Adresse" - }, - "buttons": { - "submit": "Anmeldung", - "forgotPassword": "Passwort vergessen?", - "noAccount": "Sie haben kein Konto?", - "rememberMe": "Erinnere dich an mich" - } - }, - "forgotPassword": { - "title": "Haben Sie Ihr Passwort vergessen?", - "fields": { - "email": "Email" - }, - "errors": { - "validEmail": "Ungültige E-Mail-Adresse" - }, - "buttons": { - "submit": "Anweisungen zum Zurücksetzen senden" - } - }, - "register": { - "title": "Registrieren Sie sich für Ihr Konto", - "fields": { - "email": "Email", - "password": "Passwort" - }, - "errors": { - "validEmail": "Ungültige E-Mail-Adresse" - }, - "buttons": { - "submit": "Registrieren", - "haveAccount": "Ein Konto haben?" - } - }, - "updatePassword": { - "title": "Kennwort aktualisieren", - "fields": { - "password": "Neues Passwort", - "confirmPassword": "Bestätige neues Passwort" - }, - "errors": { - "confirmPasswordNotMatch": "Passwörter stimmen nicht überein" - }, - "buttons": { - "submit": "Aktualisieren" - } - }, - "error": { - "info": "Sie haben vergessen, {{action}} component zu {{resource}} hinzufügen.", - "404": "Leider existiert diese Seite nicht.", - "resource404": "Haben Sie die {{resource}} resource erstellt?", - "backHome": "Zurück" - } - }, - "actions": { - "list": "Aufführen", - "create": "Erstellen", - "edit": "Bearbeiten", - "show": "Zeigen" - }, - "buttons": { - "create": "Erstellen", - "save": "Speichern", - "logout": "Abmelden", - "delete": "Löschen", - "edit": "Bearbeiten", - "cancel": "Abbrechen", - "confirm": "Sicher?", - "filter": "Filter", - "clear": "Löschen", - "refresh": "Erneuern", - "show": "Zeigen", - "undo": "Undo", - "import": "Importieren", - "clone": "Klon", - "notAccessTitle": "Sie haben keine zugriffsberechtigung" - }, - "warnWhenUnsavedChanges": "Nicht gespeicherte Änderungen werden nicht übernommen.", - "notifications": { - "success": "Erfolg", - "error": "Fehler (status code: {{statusCode}})", - "undoable": "Sie haben {{seconds}} Sekunden Zeit für Undo.", - "createSuccess": "{{resource}} erfolgreich erstellt.", - "createError": "Fehler beim Erstellen {{resource}} (status code: {{statusCode}})", - "deleteSuccess": "{{resource}} erfolgreich gelöscht.", - "deleteError": "Fehler beim Löschen {{resource}} (status code: {{statusCode}})", - "editSuccess": "{{resource}} erfolgreich bearbeitet.", - "editError": "Fehler beim Bearbeiten {{resource}} (status code: {{statusCode}})", - "importProgress": "{{processed}}/{{total}} importiert" - }, - "loading": "Wird geladen", - "tags": { - "clone": "Klon" - }, - "dashboard": { - "title": "Dashboard" - }, - <%_ if (answers["data-provider"] === 'data-provider-strapi-v4') { _%> - "blog-posts": { - "blog-posts": "Blogbeiträge", - <%_ } else { _%> - "blog_posts": { - "blog_posts": "Blogbeiträge", - <%_ } _%> - "fields": { - "id": "Id", - "title": "Titel", - "content": "Inhalt", - "status": "Status", - <%_ if (answers["data-provider"] === "data-provider-appwrite" || answers["data-provider"] === "data-provider-supabase" || answers["data-provider"] === "data-provider-hasura") { _%> - "created_at": "Erstellt am", - <%_ } else { _%> - "createdAt": "Erstellt am", - <%_ } _%> - <%_ if (answers["data-provider"] === "data-provider-appwrite" || answers["data-provider"] === "data-provider-nestjsx-crud") { _%> - "updatedAt": "Aktualisiert am", - <%_ } _%> - <%_ if (answers["data-provider"] === "data-provider-supabase" || answers["data-provider"] === "data-provider-appwrite") { _%> - "categoryId": "Kategorien" - <%_ } else if (answers["data-provider"] === "data-provider-hasura") { _%> - "category_id": "Kategorien", - "category": "Kategorien" - <%_ } else { _%> - "category": "Kategorien" - <%_ } _%> - }, - "titles": { - "create": "Erstellen", - "edit": "Bearbeiten", - "list": "Einträge", - "show": "Eintrag zeigen" - } - }, - "categories": { - "categories": "Kategorien", - "fields": { - "id": "Id", - "title": "Titel", - <%_ if (answers["data-provider"] === "data-provider-airtable") { _%> - "Posts": "Einträge", - <%_ } _%> - <%_ if (answers["data-provider"] === "data-provider-appwrite" || answers["data-provider"] === "data-provider-nestjsx-crud") { _%> - "updatedAt": "Aktualisiert am", - <%_ } _%> - <%_ if (answers["data-provider"] === "data-provider-appwrite" || answers["data-provider"] === "data-provider-supabase" || answers["data-provider"] === "data-provider-hasura") { _%> - "created_at": "Erstellt am" - <%_ } else { _%> - "createdAt": "Erstellt am" - <%_ } _%> - }, - "titles": { - "create": "Erstellen", - "edit": "Bearbeiten", - "list": "Einträge", - "show": "Eintrag zeigen" - } - }, - "documentTitle": { - "default": "refine", - "suffix": " | refine", - <%_ if (answers["data-provider"] === 'data-provider-strapi-v4') { _%> - "blog-posts": { - <%_ } else { _%> - "blog_posts": { - <%_ } _%> - "list": "Blogbeiträge | refine", - "show": "#{{id}} Show Blogeintrag | refine", - "edit": "#{{id}} Edit Blogeintrag | refine", - "create": "Create new Blogeintrag | refine", - "clone": "#{{id}} Clone Blogeintrag | refine" - }, - "categories": { - "list": "Kategorien | refine", - "show": "#{{id}} Zeigen Kategorien | refine", - "edit": "#{{id}} Bearbeiten Kategorien | refine", - "create": "Neue Kategorie Erstellen | refine", - "clone": "#{{id}} Klon Kategorie | refine" - } - }, - "table": { - "actions": "Aktionen" - <%_ if (answers["ui-framework"] === "no") { _%> - }, - "pagination": { - "go": "Gehen Sie zur Seite", - "show": "Zeigen" - } - <%_ } else { _%> - } - <%_ } _%> -} diff --git a/refine-react/plugins/_base/public/locales/en/common.json b/refine-react/plugins/_base/public/locales/en/common.json deleted file mode 100644 index 744a4a6b2..000000000 --- a/refine-react/plugins/_base/public/locales/en/common.json +++ /dev/null @@ -1,205 +0,0 @@ -{ - "pages": { - "login": { - "title": "Sign in to your account", - "signin": "Sign in", - "signup": "Sign up", - "divider": "or", - "fields": { - "email": "Email", - "password": "Password" - }, - "errors": { - "validEmail": "Invalid email address" - }, - "buttons": { - "submit": "Login", - "forgotPassword": "Forgot password?", - "noAccount": "Don’t have an account?", - "rememberMe": "Remember me" - } - }, - "forgotPassword": { - "title": "Forgot your password?", - "fields": { - "email": "Email" - }, - "errors": { - "validEmail": "Invalid email address" - }, - "buttons": { - "submit": "Send reset instructions" - } - }, - "register": { - "title": "Sign up for your account", - "fields": { - "email": "Email", - "password": "Password" - }, - "errors": { - "validEmail": "Invalid email address" - }, - "buttons": { - "submit": "Register", - "haveAccount": "Have an account?" - } - }, - "updatePassword": { - "title": "Update password", - "fields": { - "password": "New Password", - "confirmPassword": "Confirm new password" - }, - "errors": { - "confirmPasswordNotMatch": "Passwords do not match" - }, - "buttons": { - "submit": "Update" - } - }, - "error": { - "info": "You may have forgotten to add the {{action}} component to {{resource}} resource.", - "404": "Sorry, the page you visited does not exist.", - "resource404": "Are you sure you have created the {{resource}} resource.", - "backHome": "Back Home" - } - }, - "actions": { - "list": "List", - "create": "Create", - "edit": "Edit", - "show": "Show" - }, - "buttons": { - "create": "Create", - "save": "Save", - "logout": "Logout", - "delete": "Delete", - "edit": "Edit", - "cancel": "Cancel", - "confirm": "Are you sure?", - "filter": "Filter", - "clear": "Clear", - "refresh": "Refresh", - "show": "Show", - "undo": "Undo", - "import": "Import", - "clone": "Clone", - "notAccessTitle": "You don't have permission to access" - }, - "warnWhenUnsavedChanges": "Are you sure you want to leave? You have unsaved changes.", - "notifications": { - "success": "Successful", - "error": "Error (status code: {{statusCode}})", - "undoable": "You have {{seconds}} seconds to undo", - "createSuccess": "Successfully created {{resource}}", - "createError": "There was an error creating {{resource}} (status code: {{statusCode}})", - "deleteSuccess": "Successfully deleted {{resource}}", - "deleteError": "Error when deleting {{resource}} (status code: {{statusCode}})", - "editSuccess": "Successfully edited {{resource}}", - "editError": "Error when editing {{resource}} (status code: {{statusCode}})", - "importProgress": "Importing: {{processed}}/{{total}}" - }, - "loading": "Loading", - "tags": { - "clone": "Clone" - }, - "dashboard": { - "title": "Dashboard" - }, - <%_ if (answers["data-provider"] === 'data-provider-strapi-v4') { _%> - "blog-posts": { - "blog-posts": "Blog Posts", - <%_ } else { _%> - "blog_posts": { - "blog_posts": "Blog Posts", - <%_ } _%> - "fields": { - "id": "Id", - "title": "Title", - "content": "Content", - "status": "Status", - <%_ if (answers["data-provider"] === "data-provider-appwrite" || answers["data-provider"] === "data-provider-supabase" || answers["data-provider"] === "data-provider-hasura") { _%> - "created_at": "Created At", - <%_ } else { _%> - "createdAt": "Created At", - <%_ } _%> - <%_ if (answers["data-provider"] === "data-provider-appwrite" || answers["data-provider"] === "data-provider-nestjsx-crud") { _%> - "updatedAt": "Updated At", - <%_ } _%> - <%_ if (answers["data-provider"] === "data-provider-supabase" || answers["data-provider"] === "data-provider-appwrite") { _%> - "categoryId": "Category" - <%_ } else if (answers["data-provider"] === "data-provider-hasura") { _%> - "category_id": "Category", - "category": "Category" - <%_ } else { _%> - "category": "Category" - <%_ } _%> - }, - "titles": { - "create": "Create Blog Post", - "edit": "Edit Blog Post", - "list": "Blog Posts", - "show": "Show Blog Post" - } - }, - "categories": { - "categories": "Categories", - "fields": { - "id": "Id", - "title": "Title", - <%_ if (answers["data-provider"] === "data-provider-airtable") { _%> - "Posts": "Posts", - <%_ } _%> - <%_ if (answers["data-provider"] === "data-provider-appwrite" || answers["data-provider"] === "data-provider-nestjsx-crud") { _%> - "updatedAt": "Updated At", - <%_ } _%> - <%_ if (answers["data-provider"] === "data-provider-appwrite" || answers["data-provider"] === "data-provider-supabase" || answers["data-provider"] === "data-provider-hasura") { _%> - "created_at": "Created At" - <%_ } else { _%> - "createdAt": "Created At" - <%_ } _%> - }, - "titles": { - "create": "Create Category", - "edit": "Edit Category", - "list": "Categories", - "show": "Show Category" - } - }, - "documentTitle": { - "default": "refine", - "suffix": " | refine", - <%_ if (answers["data-provider"] === 'data-provider-strapi-v4') { _%> - "blog-posts": { - <%_ } else { _%> - "blog_posts": { - <%_ } _%> - "list": "Blog Posts | refine", - "show": "#{{id}} Show Blog Post | refine", - "edit": "#{{id}} Edit Blog Post | refine", - "create": "Create new Blog Post | refine", - "clone": "#{{id}} Clone Blog Post | refine" - }, - "categories": { - "list": "Categories | refine", - "show": "#{{id}} Show Category | refine", - "edit": "#{{id}} Edit Category | refine", - "create": "Create new Category | refine", - "clone": "#{{id}} Clone Category | refine" - } - - }, - "table": { - "actions": "Actions" - <%_ if (answers["ui-framework"] === "no") { _%> - }, - "pagination": { - "go": "Go to Page", - "show": "Show" - } - <%_ } else { _%> - } - <%_ } _%> -} diff --git a/refine-react/plugins/_base/src/App.css b/refine-react/plugins/_base/src/App.css deleted file mode 100644 index 7d0bec252..000000000 --- a/refine-react/plugins/_base/src/App.css +++ /dev/null @@ -1,88 +0,0 @@ -body { - margin: 0px; -} - -table { - border-spacing: 0; - border: 1px solid black; -} - -table th, -td { - margin: 0; - padding: 0.5rem; - border-bottom: 1px solid black; - border-right: 1px solid black; -} - -table tr:last-child td { - border-bottom: 0; -} - -table th, -td { - margin: 0; - padding: 0.5rem; - border-bottom: 1px solid black; - border-right: 1px solid black; -} - -table th:last-child, -td:last-child { - border-right: 0; -} - -.layout { - display: flex; - gap: 16px; -} - -@media screen and (max-width: 751px) { - .layout { - display: block; - } -} - -.layout .content { - display: flex; - flex-direction: column; - flex-grow: 1; -} - -.breadcrumb { - display: flex; - gap: 24px; - list-style-type: "/ "; - padding: 8px 16px; - border-bottom: 1px solid lightgray; -} - -.breadcrumb a { - color: blue; - text-decoration: none; -} - -.menu { - flex-shrink: 0; - padding: 8px 16px; - border-right: 1px solid lightgray; -} - -.menu a { - color: black; -} - -.menu .active { - font-weight: bold; -} - -@media screen and (max-width: 751px) { - .menu { - border-right: none; - border-bottom: 1px solid lightgray; - } -} - -.menu ul { - padding-left: 16px; -} diff --git a/refine-react/plugins/_base/src/components/app-icon/index.tsx b/refine-react/plugins/_base/src/components/app-icon/index.tsx deleted file mode 100644 index 7c6d8b375..000000000 --- a/refine-react/plugins/_base/src/components/app-icon/index.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import React from "react"; - -export const AppIcon: React.FC = () => { - return ( - <%_ if (selectedSvg) { _%> - <%- selectedSvg %> - <%_ } _%> - ) -} \ No newline at end of file diff --git a/refine-react/plugins/_base/src/components/breadcrumb/index.tsx b/refine-react/plugins/_base/src/components/breadcrumb/index.tsx deleted file mode 100644 index d8e79ea91..000000000 --- a/refine-react/plugins/_base/src/components/breadcrumb/index.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { useBreadcrumb } from "@refinedev/core"; -import { Link } from "react-router-dom"; - -export const Breadcrumb = () => { - const { breadcrumbs } = useBreadcrumb(); - - return ( - - ); -}; diff --git a/refine-react/plugins/_base/src/components/layout/index.tsx b/refine-react/plugins/_base/src/components/layout/index.tsx deleted file mode 100644 index a0d73d763..000000000 --- a/refine-react/plugins/_base/src/components/layout/index.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { PropsWithChildren } from "react"; -import { Breadcrumb } from "../breadcrumb"; -import { Menu } from "../menu"; - -export const Layout: React.FC = ({ children }) => { - return ( -
- -
- -
{children}
-
-
- ); -}; diff --git a/refine-react/plugins/_base/src/components/menu/index.tsx b/refine-react/plugins/_base/src/components/menu/index.tsx deleted file mode 100644 index 174fe7ebc..000000000 --- a/refine-react/plugins/_base/src/components/menu/index.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { - <%_ if (_app.isAuthRoutes) { _%> - useLogout, - <%_ } _%> - useMenu -} from "@refinedev/core"; -import { NavLink } from "react-router-dom"; - -export const Menu = () => { - <%_ if (_app.isAuthRoutes) { _%> - const { mutate: logout } = useLogout(); - <%_ } _%> - const { menuItems } = useMenu(); - - return ( - - ); -}; diff --git a/refine-react/plugins/antd/extend.js b/refine-react/plugins/antd/extend.js deleted file mode 100644 index 20fec102e..000000000 --- a/refine-react/plugins/antd/extend.js +++ /dev/null @@ -1,22 +0,0 @@ -const base = { - _app: { - import: [`import { App as AntdApp } from "antd"`], - refineImports: [], - refineAntdImports: ["useNotificationProvider", "ThemedLayoutV2"], - refineProps: ["notificationProvider={useNotificationProvider}"], - wrapper: [ - [``, ``], - [``, ``], - ], - localImport: [ - `import { ColorModeContextProvider } from "./contexts/color-mode";`, - `import { Header } from "./components/header";`, - ], - }, -}; - -module.exports = { - extend() { - return base; - }, -}; diff --git a/refine-react/plugins/antd/meta.json b/refine-react/plugins/antd/meta.json deleted file mode 100644 index cf09020d0..000000000 --- a/refine-react/plugins/antd/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Ant Design", - "url": "https://refine.dev/docs/ui-frameworks/antd/tutorial/" -} diff --git a/refine-react/plugins/antd/package.json b/refine-react/plugins/antd/package.json deleted file mode 100644 index a490611f5..000000000 --- a/refine-react/plugins/antd/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "dependencies": { - "@refinedev/antd": "^5.37.1", - "antd": "^5.0.5", - "@ant-design/icons": "^5.0.1" - } -} diff --git a/refine-react/plugins/antd/src/components/header/index.tsx b/refine-react/plugins/antd/src/components/header/index.tsx deleted file mode 100644 index 6ce06add5..000000000 --- a/refine-react/plugins/antd/src/components/header/index.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import type { RefineThemedLayoutV2HeaderProps } from "@refinedev/antd"; -import { useGetIdentity } from "@refinedev/core"; -import { - Avatar, - Layout as AntdLayout, - Space, - Switch, - theme, - Typography, -} from "antd"; -import React, { useContext } from "react"; -import { ColorModeContext } from "../../contexts/color-mode"; - -const { Text } = Typography; -const { useToken } = theme; - -type IUser = { - id: number; - name: string; - avatar: string; -}; - -export const Header: React.FC = ({ - isSticky, -}) => { - const { token } = useToken(); - const { data: user } = useGetIdentity(); - const { mode, setMode } = useContext(ColorModeContext); - - const headerStyles: React.CSSProperties = { - backgroundColor: token.colorBgElevated, - display: "flex", - justifyContent: "flex-end", - alignItems: "center", - padding: "0px 24px", - height: "64px", - }; - - if (isSticky) { - headerStyles.position = "sticky"; - headerStyles.top = 0; - headerStyles.zIndex = 1; - } - - return ( - - - - setMode(mode === "light" ? "dark" : "light") - } - defaultChecked={mode === "dark"} - /> - - {user?.name && {user.name}} - {user?.avatar && ( - - )} - - - - ); -}; diff --git a/refine-react/plugins/antd/src/components/index.ts b/refine-react/plugins/antd/src/components/index.ts deleted file mode 100644 index 924cc88d1..000000000 --- a/refine-react/plugins/antd/src/components/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { Header } from "./header"; diff --git a/refine-react/plugins/antd/src/contexts/color-mode/index.tsx b/refine-react/plugins/antd/src/contexts/color-mode/index.tsx deleted file mode 100644 index a87c318b1..000000000 --- a/refine-react/plugins/antd/src/contexts/color-mode/index.tsx +++ /dev/null @@ -1,60 +0,0 @@ -import { PropsWithChildren, createContext, useEffect, useState } from "react"; -import { ConfigProvider, theme } from "antd"; -import { RefineThemes } from "@refinedev/antd"; - -type ColorModeContextType = { - mode: string; - setMode: (mode: string) => void; -}; - -export const ColorModeContext = createContext( - {} as ColorModeContextType, -); - -export const ColorModeContextProvider: React.FC = ({ - children, -}) => { - const colorModeFromLocalStorage = localStorage.getItem("colorMode"); - const isSystemPreferenceDark = window?.matchMedia( - "(prefers-color-scheme: dark)", - ).matches; - - const systemPreference = isSystemPreferenceDark ? "dark" : "light"; - const [mode, setMode] = useState( - colorModeFromLocalStorage || systemPreference, - ); - - useEffect(() => { - window.localStorage.setItem("colorMode", mode); - }, [mode]); - - const setColorMode = () => { - if (mode === "light") { - setMode("dark"); - } else { - setMode("light"); - } - }; - - const { darkAlgorithm, defaultAlgorithm } = theme; - - return ( - - , - algorithm: - mode === "light" ? defaultAlgorithm : darkAlgorithm, - }} - > - {children} - - - ); -}; diff --git a/refine-react/plugins/auth-provider-auth0/extend.js b/refine-react/plugins/auth-provider-auth0/extend.js deleted file mode 100644 index 6444e4b28..000000000 --- a/refine-react/plugins/auth-provider-auth0/extend.js +++ /dev/null @@ -1,96 +0,0 @@ -const base = { - _app: { - refineImports: [`Authenticated`, `AuthBindings`], - import: [ - `import axios from "axios";`, - `import { useAuth0 } from "@auth0/auth0-react";`, - ], - localImport: [`import { Login } from "pages/login";`], - innerHooks: [ - `const { isLoading, user, logout, getIdTokenClaims } = useAuth0();`, - ], - inner: [ - ` - if (isLoading) { - return loading... - }`, - ` - const authProvider: AuthBindings = { - login: async () => { - return { - success: true, - }; - }, - logout: async () => { - logout({ returnTo: window.location.origin }); - return { - success: true, - }; - }, - onError: async (error) => { - console.error(error); - return { error }; - }, - check: async () => { - try { - const token = await getIdTokenClaims(); - if (token) { - axios.defaults.headers.common = {`, - "Authorization: `Bearer ${token.__raw}`", - ` - }; - return { - authenticated: true, - }; - } else { - return { - authenticated: false, - error: { - message: "Check failed", - name: "Token not found", - }, - redirectTo: "/login", - logout: true, - }; - } - } catch (error: any) { - return { - authenticated: false, - error: new Error(error), - redirectTo: "/login", - logout: true, - }; - } - }, - getPermissions: async () => null, - getIdentity: async () => { - if (user) { - return { - ...user, - avatar: user.picture, - }; - } - return null; - }, - }; - `, - ], - refineProps: ["authProvider={authProvider}"], - mainWrapper: [ - [ - ``, - ``, - ], - ], - }, -}; - -module.exports = { - extend(answers) { - return base; - }, -}; diff --git a/refine-react/plugins/auth-provider-auth0/meta.json b/refine-react/plugins/auth-provider-auth0/meta.json deleted file mode 100644 index 5b8a4f236..000000000 --- a/refine-react/plugins/auth-provider-auth0/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Auth0 Auth Providder", - "url": "https://refine.dev/docs/guides-and-concepts/auth/auth0/" -} diff --git a/refine-react/plugins/auth-provider-auth0/package.json b/refine-react/plugins/auth-provider-auth0/package.json deleted file mode 100644 index 111f42a19..000000000 --- a/refine-react/plugins/auth-provider-auth0/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "dependencies": { - "@auth0/auth0-react": "^1.5.0", - "axios": "^1.6.2" - } -} \ No newline at end of file diff --git a/refine-react/plugins/auth-provider-auth0/public/refine.svg b/refine-react/plugins/auth-provider-auth0/public/refine.svg deleted file mode 100644 index 2eb16e9ed..000000000 --- a/refine-react/plugins/auth-provider-auth0/public/refine.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/refine-react/plugins/auth-provider-auth0/src/pages/login.tsx b/refine-react/plugins/auth-provider-auth0/src/pages/login.tsx deleted file mode 100644 index b66d151df..000000000 --- a/refine-react/plugins/auth-provider-auth0/src/pages/login.tsx +++ /dev/null @@ -1,265 +0,0 @@ -<%_ if (answers[`i18n-${answers["ui-framework"]}`] !== "no") { _%> -import { useTranslate } from "@refinedev/core"; -<%_ } _%> -<%_ if (answers["ui-framework"] === "antd") { _%> -import { ThemedTitleV2 } from "@refinedev/antd"; -import { Button, Typography, Layout, Space } from "antd"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'mui') { _%> -import Box from "@mui/material/Box"; -import Button from "@mui/material/Button"; -import Container from "@mui/material/Container"; -import Typography from "@mui/material/Typography"; -import { ThemedTitleV2 } from "@refinedev/mui"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'mantine') { _%> -import { Button, Box, Space, Text } from "@mantine/core"; -import { ThemedTitleV2 } from "@refinedev/mantine"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'chakra') { _%> -import { Button, Box, Text, VStack } from "@chakra-ui/react"; -import { ThemedTitleV2 } from "@refinedev/chakra-ui"; -<%_ } _%> - -import { useAuth0 } from "@auth0/auth0-react"; - -<%_ if (selectedSvg && answers["ui-framework"] !== "no" ) { _%> -import { AppIcon } from "components/app-icon"; -<%_ } _%> - -export const Login: React.FC = () => { - const { loginWithRedirect } = useAuth0(); - - <%_ if (answers[`i18n-${answers["ui-framework"]}`] !== "no") { _%> - const t = useTranslate(); - <%_ } _%> - - <%_ if (answers["ui-framework"] === "antd") { _%> - return ( - - - - text="<%= selectedTitle %>" - <%_ } _%> - <%_ if (selectedSvg) { _%> - icon={} - <%_ } _%> - /> - - - Powered by - Auth0 - Auth0 - - - - ); - <%_ } _%> - - <%_ if (answers["ui-framework"] === 'mui') { _%> - return ( - - - - text="<%= selectedTitle %>" - <%_ } _%> - <%_ if (selectedSvg) { _%> - icon={} - <%_ } _%> - /> - - - - Powered by - Auth0 - Auth0 - - - - ); - <%_ } _%> - - <%_ if (answers["ui-framework"] === 'mantine') { _%> - return ( - - - text="<%= selectedTitle %>" - <%_ } _%> - <%_ if (selectedSvg) { _%> - icon={} - <%_ } _%> - /> - - - - - - Powered by - Auth0 - Auth0 - - - ); - <%_ } _%> - - <%_ if (answers["ui-framework"] === 'chakra') { _%> - return ( - - - - text="<%= selectedTitle %>" - <%_ } _%> - <%_ if (selectedSvg) { _%> - icon={} - <%_ } _%> - /> - - - - - Powered by - Auth0 - Auth0 - - - - ); - <%_ } _%> - - <%_ if (answers["ui-framework"] === "no") { _%> - return( -
- -

- Powered by - Auth0 - Auth0 -

-
- ); - <%_ } _%> -}; diff --git a/refine-react/plugins/auth-provider-custom/extend.js b/refine-react/plugins/auth-provider-custom/extend.js deleted file mode 100644 index 7c139027c..000000000 --- a/refine-react/plugins/auth-provider-custom/extend.js +++ /dev/null @@ -1,22 +0,0 @@ -const base = { - _app: { - relativeImport: ['import { authProvider } from "./authProvider";'], - refineProps: ["authProvider={authProvider}"], - refineImports: [`Authenticated`], - refineAntdImports: [], - refineMantineImports: [], - refineMuiImports: [], - refineChakraImports: [], - localImport: [ - `import { Login } from "pages/login";`, - `import { Register } from "pages/register";`, - `import { ForgotPassword } from "pages/forgotPassword";`, - ], - }, -}; - -module.exports = { - extend() { - return base; - }, -}; diff --git a/refine-react/plugins/auth-provider-custom/meta.json b/refine-react/plugins/auth-provider-custom/meta.json deleted file mode 100644 index 3e4d4d11f..000000000 --- a/refine-react/plugins/auth-provider-custom/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Custom Auth Provider", - "url": "https://refine.dev/docs/core/providers/auth-provider/" -} diff --git a/refine-react/plugins/auth-provider-custom/src/authProvider.ts b/refine-react/plugins/auth-provider-custom/src/authProvider.ts deleted file mode 100644 index f5581e2a8..000000000 --- a/refine-react/plugins/auth-provider-custom/src/authProvider.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { AuthBindings } from "@refinedev/core"; - -export const TOKEN_KEY = "refine-auth"; - -export const authProvider: AuthBindings = { - login: async ({ username, email, password }) => { - if ((username || email) && password) { - localStorage.setItem(TOKEN_KEY, username); - return { - success: true, - redirectTo: "/", - }; - } - - return { - success: false, - error: { - name: "LoginError", - message: "Invalid username or password", - }, - }; - }, - logout: async () => { - localStorage.removeItem(TOKEN_KEY); - return { - success: true, - redirectTo: "/login" - }; - }, - check: async () => { - const token = localStorage.getItem(TOKEN_KEY); - if (token) { - return { - authenticated: true - }; - } - - return { - authenticated: false, - redirectTo: "/login" - }; - }, - getPermissions: async () => null, - getIdentity: async () => { - const token = localStorage.getItem(TOKEN_KEY); - if (token) { - return { - id: 1, - name: "John Doe", - avatar: "https://i.pravatar.cc/300", - }; - } - return null; - }, - onError: async (error) => { - console.error(error); - return { error }; - }, -}; diff --git a/refine-react/plugins/auth-provider-custom/src/pages/forgotPassword/index.tsx b/refine-react/plugins/auth-provider-custom/src/pages/forgotPassword/index.tsx deleted file mode 100644 index eaca24291..000000000 --- a/refine-react/plugins/auth-provider-custom/src/pages/forgotPassword/index.tsx +++ /dev/null @@ -1,59 +0,0 @@ -<%_ if (answers[`ui-framework`] === "no") { _%> - import { AuthPage } from "@refinedev/core"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'antd') { _%> -import { - AuthPage, - <%_ if (selectedSvg || selectedTitle) { _%> - ThemedTitleV2, - <%_ } _%> -} from "@refinedev/antd"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'mui') { _%> -import { - AuthPage, - <%_ if (selectedSvg || selectedTitle) { _%> - ThemedTitleV2, - <%_ } _%> -} from "@refinedev/mui"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'mantine') { _%> -import { - AuthPage, - <%_ if (selectedSvg || selectedTitle) { _%> - ThemedTitleV2, - <%_ } _%> -} from "@refinedev/mantine"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'chakra') { _%> -import { - AuthPage, - <%_ if (selectedSvg || selectedTitle) { _%> - ThemedTitleV2, - <%_ } _%> -} from "@refinedev/chakra-ui"; -<%_ } _%> -<%_ if (selectedSvg && answers["ui-framework"] !== "no") { _%> -import { AppIcon } from "components/app-icon"; -<%_ } _%> - -export const ForgotPassword = () => { - return ( - - title={( - - text="<%= selectedTitle %>" - <%_ } _%> - <%_ if (selectedSvg) { _%> - icon={} - <%_ } _%> - /> - )} - <%_ } _%> - /> - ); -}; diff --git a/refine-react/plugins/auth-provider-custom/src/pages/login/index.tsx b/refine-react/plugins/auth-provider-custom/src/pages/login/index.tsx deleted file mode 100644 index 9e86ec8b8..000000000 --- a/refine-react/plugins/auth-provider-custom/src/pages/login/index.tsx +++ /dev/null @@ -1,60 +0,0 @@ -<%_ if (answers[`ui-framework`] === "no") { _%> - import { AuthPage } from "@refinedev/core"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'antd') { _%> -import { - AuthPage, - <%_ if (selectedSvg || selectedTitle) { _%> - ThemedTitleV2, - <%_ } _%> -} from "@refinedev/antd"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'mui') { _%> -import { - AuthPage, - <%_ if (selectedSvg || selectedTitle) { _%> - ThemedTitleV2, - <%_ } _%> -} from "@refinedev/mui"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'mantine') { _%> -import { - AuthPage, - <%_ if (selectedSvg || selectedTitle) { _%> - ThemedTitleV2, - <%_ } _%> -} from "@refinedev/mantine"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'chakra') { _%> -import { - AuthPage, - <%_ if (selectedSvg || selectedTitle) { _%> - ThemedTitleV2, - <%_ } _%> -} from "@refinedev/chakra-ui"; -<%_ } _%> -<%_ if (selectedSvg && answers["ui-framework"] !== "no") { _%> -import { AppIcon } from "components/app-icon"; -<%_ } _%> - -export const Login = () => { - return ( - - title={( - - text="<%= selectedTitle %>" - <%_ } _%> - <%_ if (selectedSvg) { _%> - icon={} - <%_ } _%> - /> - )} - <%_ } _%> - <%- (_app.authPageProps || []).join("\n") %> - /> - ); -}; diff --git a/refine-react/plugins/auth-provider-custom/src/pages/register/index.tsx b/refine-react/plugins/auth-provider-custom/src/pages/register/index.tsx deleted file mode 100644 index 23dd17fc2..000000000 --- a/refine-react/plugins/auth-provider-custom/src/pages/register/index.tsx +++ /dev/null @@ -1,59 +0,0 @@ -<%_ if (answers[`ui-framework`] === "no") { _%> - import { AuthPage } from "@refinedev/core"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'antd') { _%> -import { - AuthPage, - <%_ if (selectedSvg || selectedTitle) { _%> - ThemedTitleV2, - <%_ } _%> -} from "@refinedev/antd"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'mui') { _%> -import { - AuthPage, - <%_ if (selectedSvg || selectedTitle) { _%> - ThemedTitleV2, - <%_ } _%> -} from "@refinedev/mui"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'mantine') { _%> -import { - AuthPage, - <%_ if (selectedSvg || selectedTitle) { _%> - ThemedTitleV2, - <%_ } _%> -} from "@refinedev/mantine"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'chakra') { _%> -import { - AuthPage, - <%_ if (selectedSvg || selectedTitle) { _%> - ThemedTitleV2, - <%_ } _%> -} from "@refinedev/chakra-ui"; -<%_ } _%> -<%_ if (selectedSvg && answers["ui-framework"] !== "no") { _%> -import { AppIcon } from "components/app-icon"; -<%_ } _%> - -export const Register = () => { - return ( - - title={( - - text="<%= selectedTitle %>" - <%_ } _%> - <%_ if (selectedSvg) { _%> - icon={} - <%_ } _%> - /> - )} - <%_ } _%> - /> - ); -}; diff --git a/refine-react/plugins/auth-provider-google/extend.js b/refine-react/plugins/auth-provider-google/extend.js deleted file mode 100644 index 9c025a92e..000000000 --- a/refine-react/plugins/auth-provider-google/extend.js +++ /dev/null @@ -1,110 +0,0 @@ -const base = { - _app: { - refineImports: [`AuthBindings`], - import: [`import axios from "axios";`], - localImport: [ - `import { Login } from "pages/login";`, - `import { CredentialResponse } from "interfaces/google";`, - `import { parseJwt } from "utils/parse-jwt";`, - ], - afterImport: [ - "const axiosInstance = axios.create();", - "axiosInstance.interceptors.request.use((config) => {", - 'const token = localStorage.getItem("token");', - "if (config.headers) {", - ' config.headers["Authorization"] = `Bearer ${token}`;', - "}", - "", - "return config;", - "});", - ], - inner: [ - ` - const authProvider: AuthBindings = { - login: async ({ credential }: CredentialResponse) => { - const profileObj = credential ? parseJwt(credential) : null; - - if (profileObj) { - localStorage.setItem( - "user", - JSON.stringify({ - ...profileObj, - avatar: profileObj.picture, - }), - ); - `, - 'localStorage.setItem("token", `${ credential }`);', - ` - return { - success: true, - redirectTo: "/", - }; - } - - return { - success: false, - }; - }, - logout: async () => { - const token = localStorage.getItem("token"); - - if (token && typeof window !== "undefined") { - localStorage.removeItem("token"); - localStorage.removeItem("user"); - axios.defaults.headers.common = {}; - window.google?.accounts.id.revoke(token, () => { - return {}; - }); - } - - return { - success: true, - redirectTo: "/login", - }; - }, - onError: async (error) => { - console.error(error); - return { error }; - }, - check: async () => { - const token = localStorage.getItem("token"); - - if (token) { - return { - authenticated: true, - }; - } - - return { - authenticated: false, - error: { - message: "Check failed", - name: "Token not found", - }, - logout: true, - redirectTo: "/login", - }; - }, - getPermissions: async () => null, - getIdentity: async () => { - const user = localStorage.getItem("user"); - if (user) { - return JSON.parse(user); - } - - return null; - }, - }; - `, - ], - refineProps: ["authProvider={authProvider}"], - publicScripts: [ - ``, - ], - }, -}; -module.exports = { - extend() { - return base; - }, -}; diff --git a/refine-react/plugins/auth-provider-google/meta.json b/refine-react/plugins/auth-provider-google/meta.json deleted file mode 100644 index 679b33b92..000000000 --- a/refine-react/plugins/auth-provider-google/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Google Auth Provider", - "url": "https://refine.dev/docs/core/providers/auth-provider/" -} diff --git a/refine-react/plugins/auth-provider-google/package.json b/refine-react/plugins/auth-provider-google/package.json deleted file mode 100644 index 7b977dc89..000000000 --- a/refine-react/plugins/auth-provider-google/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "axios": "^1.6.2" - } -} diff --git a/refine-react/plugins/auth-provider-google/public/refine.svg b/refine-react/plugins/auth-provider-google/public/refine.svg deleted file mode 100644 index 2eb16e9ed..000000000 --- a/refine-react/plugins/auth-provider-google/public/refine.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/refine-react/plugins/auth-provider-google/src/interfaces/google.d.ts b/refine-react/plugins/auth-provider-google/src/interfaces/google.d.ts deleted file mode 100644 index 5c4deec25..000000000 --- a/refine-react/plugins/auth-provider-google/src/interfaces/google.d.ts +++ /dev/null @@ -1,126 +0,0 @@ -export interface IdConfiguration { - client_id: string; - auto_select?: boolean; - callback: (handleCredentialResponse: CredentialResponse) => void; - login_uri?: string; - native_callback?: (...args: any[]) => void; - cancel_on_tap_outside?: boolean; - prompt_parent_id?: string; - nonce?: string; - context?: string; - state_cookie_domain?: string; - ux_mode?: "popup" | "redirect"; - allowed_parent_origin?: string | string[]; - intermediate_iframe_close_callback?: (...args: any[]) => void; -} - -export interface CredentialResponse { - credential?: string; - select_by?: - | "auto" - | "user" - | "user_1tap" - | "user_2tap" - | "btn" - | "btn_confirm" - | "brn_add_session" - | "btn_confirm_add_session"; - clientId?: string; -} - -export interface GsiButtonConfiguration { - type: "standard" | "icon"; - theme?: "outline" | "filled_blue" | "filled_black"; - size?: "large" | "medium" | "small"; - text?: "signin_with" | "signup_with" | "continue_with" | "signup_with"; - shape?: "rectangular" | "pill" | "circle" | "square"; - logo_alignment?: "left" | "center"; - width?: string; - local?: string; -} - -export interface PromptMomentNotification { - isDisplayMoment: () => boolean; - isDisplayed: () => boolean; - isNotDisplayed: () => boolean; - getNotDisplayedReason: () => - | "browser_not_supported" - | "invalid_client" - | "missing_client_id" - | "opt_out_or_no_session" - | "secure_http_required" - | "suppressed_by_user" - | "unregistered_origin" - | "unknown_reason"; - isSkippedMoment: () => boolean; - getSkippedReason: () => - | "auto_cancel" - | "user_cancel" - | "tap_outside" - | "issuing_failed"; - isDismissedMoment: () => boolean; - getDismissedReason: () => - | "credential_returned" - | "cancel_called" - | "flow_restarted"; - getMomentType: () => "display" | "skipped" | "dismissed"; -} - -export interface RevocationResponse { - successful: boolean; - error: string; -} - -export interface Credential { - id: string; - password: string; -} - -export interface Google { - accounts: { - id: { - initialize: (input: IdConfiguration) => void; - prompt: ( - momentListener?: (res: PromptMomentNotification) => void, - ) => void; - renderButton: ( - parent: HTMLElement, - options: GsiButtonConfiguration, - ) => void; - disableAutoSelect: () => void; - storeCredential: ( - credentials: Credential, - callback: () => void, - ) => void; - cancel: () => void; - onGoogleLibraryLoad: () => void; - revoke: ( - hint: string, - callback: (done: RevocationResponse) => void, - ) => void; - }; - }; -} - -declare global { - interface Window { - google: Google; - } -} - -export interface UserPayload { - iss: string; - nbf: number; - aud: string; - sub: string; - email: string; - email_verified: boolean; - azp: string; - name: string; - picture: string; - given_name: string; - family_name: string; - iat: number; - exp: number; - jti: string; -} diff --git a/refine-react/plugins/auth-provider-google/src/pages/login.tsx b/refine-react/plugins/auth-provider-google/src/pages/login.tsx deleted file mode 100644 index 1a621bc56..000000000 --- a/refine-react/plugins/auth-provider-google/src/pages/login.tsx +++ /dev/null @@ -1,261 +0,0 @@ -import { useEffect, useRef } from "react"; -import { useLogin } from "@refinedev/core"; - -<%_ if (answers["ui-framework"] === "antd") { _%> -import { ThemedTitleV2 } from "@refinedev/antd"; -import { Typography, Layout, Space } from "antd"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'mui') { _%> -import Box from "@mui/material/Box"; -import Container from "@mui/material/Container"; -import Typography from "@mui/material/Typography"; -import { ThemedTitleV2 } from "@refinedev/mui"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'mantine') { _%> -import { Box, Space, Text } from "@mantine/core"; -import { ThemedTitleV2 } from "@refinedev/mantine"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'chakra') { _%> -import { Box, Text, VStack } from "@chakra-ui/react"; -import { ThemedTitleV2 } from "@refinedev/chakra-ui"; -<%_ } _%> - -import { CredentialResponse } from "../interfaces/google"; - -<%_ if (selectedSvg && answers["ui-framework"] !== "no" ) { _%> -import { AppIcon } from "components/app-icon"; -<%_ } _%> - -// Todo: Update your Google Client ID here -const GOOGLE_CLIENT_ID = "1041339102270-e1fpe2b6v6u1didfndh7jkjmpcashs4f.apps.googleusercontent.com"; - -export const Login: React.FC = () => { - const { mutate: login } = useLogin(); - - const GoogleButton = (): JSX.Element => { - const divRef = useRef(null); - - useEffect(() => { - if ( - typeof window === "undefined" || - !window.google || - !divRef.current - ) { - return; - } - - try { - window.google.accounts.id.initialize({ - ux_mode: "popup", - client_id: GOOGLE_CLIENT_ID, - callback: async (res: CredentialResponse) => { - if (res.credential) { - login(res); - } - }, - }); - window.google.accounts.id.renderButton(divRef.current, { - theme: "filled_blue", - size: "medium", - type: "standard", - }); - } catch (error) { - console.log(error); - } - }, []); - - return
; - }; - - - <%_ if (answers["ui-framework"] === "antd") { _%> - return ( - - - - text="<%= selectedTitle %>" - <%_ } _%> - <%_ if (selectedSvg) { _%> - icon={} - <%_ } _%> - /> - - - Powered by - Google - Google - - - - ); - <%_ } _%> - - <%_ if (answers["ui-framework"] === 'mui') { _%> - return ( - - - - text="<%= selectedTitle %>" - <%_ } _%> - <%_ if (selectedSvg) { _%> - icon={} - <%_ } _%> - /> - - - - - Powered by - Google - Google - - - - ); - <%_ } _%> - - <%_ if (answers["ui-framework"] === 'mantine') { _%> - return ( - - - text="<%= selectedTitle %>" - <%_ } _%> - <%_ if (selectedSvg) { _%> - icon={} - <%_ } _%> - /> - - - - - - - Powered by - Google - Google - - - ); - <%_ } _%> - - <%_ if (answers["ui-framework"] === 'chakra') { _%> - return ( - - - - text="<%= selectedTitle %>" - <%_ } _%> - <%_ if (selectedSvg) { _%> - icon={} - <%_ } _%> - /> - - - - - Powered by - Google - Google - - - - ); - <%_ } _%> - - <%_ if (answers["ui-framework"] === "no") { _%> - return( -
- -

- Powered by - Google - Google -

-
- ); - <%_ } _%> -}; diff --git a/refine-react/plugins/auth-provider-google/src/utils/parse-jwt.ts b/refine-react/plugins/auth-provider-google/src/utils/parse-jwt.ts deleted file mode 100644 index 7befc83d9..000000000 --- a/refine-react/plugins/auth-provider-google/src/utils/parse-jwt.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { UserPayload } from "interfaces/google"; - -export function parseJwt(token: string): UserPayload { - const base64Url = token.split(".")[1]; - const base64 = base64Url.replace(/-/g, "+").replace(/_/g, "/"); - const jsonPayload = decodeURIComponent( - window - .atob(base64) - .split("") - .map(function (c) { - return "%" + ("00" + c.charCodeAt(0).toString(16)).slice(-2); - }) - .join(""), - ); - - return JSON.parse(jsonPayload); -} diff --git a/refine-react/plugins/auth-provider-keycloak/extend.js b/refine-react/plugins/auth-provider-keycloak/extend.js deleted file mode 100644 index e160a4d46..000000000 --- a/refine-react/plugins/auth-provider-keycloak/extend.js +++ /dev/null @@ -1,107 +0,0 @@ -const base = { - _app: { - refineImports: [`Authenticated`, `AuthBindings`], - import: [ - `import axios from "axios";`, - `import { useKeycloak } from "@react-keycloak/web";`, - ], - localImport: [`import { Login } from "pages/login";`], - innerHooks: [`const { keycloak, initialized } = useKeycloak();`], - inner: [ - ` - if (!initialized) { - return
Loading...
; - } - `, - ` - const authProvider: AuthBindings = { - login: async () => { - const urlSearchParams = new URLSearchParams(window.location.search); - const { to } = Object.fromEntries(urlSearchParams.entries()); - await keycloak.login({`, - "redirectUri: to ? `${ window.location.origin }${ to }` : undefined", - `}); - return { - success: true, - }; - }, - logout: async () => { - try { - await keycloak.logout({ - redirectUri: window.location.origin, - }); - return { - success: true, - redirectTo: "/login", - }; - } catch (error) { - return { - success: false, - error: new Error("Logout failed"), - }; - } - }, - onError: async (error) => { - console.error(error); - return { error }; - }, - check: async () => { - try { - const { token } = keycloak; - if (token) { - axios.defaults.headers.common = {`, - "Authorization: `Bearer ${ token }`", - `}; - return { - authenticated: true, - }; - } else { - return { - authenticated: false, - logout: true, - redirectTo: "/login", - error: { - message: "Check failed", - name: "Token not found", - }, - }; - } - } catch (error) { - return { - authenticated: false, - logout: true, - redirectTo: "/login", - error: { - message: "Check failed", - name: "Token not found", - }, - }; - } - }, - getPermissions: async () => null, - getIdentity: async () => { - if (keycloak?.tokenParsed) { - return { - name: keycloak.tokenParsed.family_name, - }; - } - return null; - }, - }; - `, - ], - refineProps: ["authProvider={authProvider}"], - mainWrapper: [ - [ - ``, - ``, - ], - ], - }, -}; - -module.exports = { - extend() { - return base; - }, -}; diff --git a/refine-react/plugins/auth-provider-keycloak/meta.json b/refine-react/plugins/auth-provider-keycloak/meta.json deleted file mode 100644 index 426641985..000000000 --- a/refine-react/plugins/auth-provider-keycloak/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Keycloak Auth Providder", - "url": "https://refine.dev/docs/guides-and-concepts/auth/auth0/" -} diff --git a/refine-react/plugins/auth-provider-keycloak/package.json b/refine-react/plugins/auth-provider-keycloak/package.json deleted file mode 100644 index 5243b325b..000000000 --- a/refine-react/plugins/auth-provider-keycloak/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "dependencies": { - "keycloak-js": "^20.0.3", - "@react-keycloak/web": "^3.4.0", - "axios": "^1.6.2" - } -} \ No newline at end of file diff --git a/refine-react/plugins/auth-provider-keycloak/public/refine.svg b/refine-react/plugins/auth-provider-keycloak/public/refine.svg deleted file mode 100644 index 2eb16e9ed..000000000 --- a/refine-react/plugins/auth-provider-keycloak/public/refine.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/refine-react/plugins/auth-provider-keycloak/src/pages/login.tsx b/refine-react/plugins/auth-provider-keycloak/src/pages/login.tsx deleted file mode 100644 index d7ae0e934..000000000 --- a/refine-react/plugins/auth-provider-keycloak/src/pages/login.tsx +++ /dev/null @@ -1,260 +0,0 @@ -import { useTranslate, useLogin } from "@refinedev/core"; -<%_ if (answers["ui-framework"] === "antd") { _%> -import { ThemedTitleV2 } from "@refinedev/antd"; -import { Button, Typography, Layout, Space } from "antd"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'mui') { _%> -import Box from "@mui/material/Box"; -import Button from "@mui/material/Button"; -import Container from "@mui/material/Container"; -import Typography from "@mui/material/Typography"; -import { ThemedTitleV2 } from "@refinedev/mui"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'mantine') { _%> -import { Button, Box, Space, Text } from "@mantine/core"; -import { ThemedTitleV2 } from "@refinedev/mantine"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'chakra') { _%> -import { Button, Box, Text, VStack } from "@chakra-ui/react"; -import { ThemedTitleV2 } from "@refinedev/chakra-ui"; -<%_ } _%> -<%_ if (selectedSvg && answers["ui-framework"] !== "no" ) { _%> -import { AppIcon } from "components/app-icon"; -<%_ } _%> - -export const Login: React.FC = () => { - const { mutate: login } = useLogin(); - - <%_ if (answers[`i18n-${answers["ui-framework"]}`] !== "no") { _%> - const t = useTranslate(); - <%_ } _%> - - <%_ if (answers["ui-framework"] === "antd") { _%> - return ( - - - - text="<%= selectedTitle %>" - <%_ } _%> - <%_ if (selectedSvg) { _%> - icon={} - <%_ } _%> - /> - - - Powered by - Keycloak - Keycloak - - - - ); - <%_ } _%> - - <%_ if (answers["ui-framework"] === 'mui') { _%> - return ( - - - - text="<%= selectedTitle %>" - <%_ } _%> - <%_ if (selectedSvg) { _%> - icon={} - <%_ } _%> - /> - - - - Powered by - Keycloak - Keycloak - - - - ); - <%_ } _%> - - <%_ if (answers["ui-framework"] === 'mantine') { _%> - return ( - - - text="<%= selectedTitle %>" - <%_ } _%> - <%_ if (selectedSvg) { _%> - icon={} - <%_ } _%> - /> - - - - - - Powered by - Keycloak - Keycloak - - - ); - <%_ } _%> - - <%_ if (answers["ui-framework"] === 'chakra') { _%> - return ( - - - - text="<%= selectedTitle %>" - <%_ } _%> - <%_ if (selectedSvg) { _%> - icon={} - <%_ } _%> - /> - - - - - Powered by - Keycloak - Keycloak - - - - ); - <%_ } _%> - - <%_ if (answers["ui-framework"] === "no") { _%> - return( -
- -

- Powered by - Keycloak - Keycloak -

-
- ); - <%_ } _%> -}; diff --git a/refine-react/plugins/chakra/extend.js b/refine-react/plugins/chakra/extend.js deleted file mode 100644 index 036fd6f2e..000000000 --- a/refine-react/plugins/chakra/extend.js +++ /dev/null @@ -1,35 +0,0 @@ -const base = { - _app: { - refineProps: ["notificationProvider={notificationProvider}"], - import: [`import { ChakraProvider } from "@chakra-ui/react";`], - refineChakraImports: [ - "notificationProvider", - "RefineThemes", - "ThemedLayoutV2", - ], - localImport: [`import { Header } from "./components/header";`], - }, -}; - -module.exports = { - extend(answers) { - const selectedTheme = answers["theme"] ? answers["theme"] : "Blue"; - - return { - ...base, - _app: { - ...base._app, - wrapper: [ - [ - "{/* You can change the theme colors here. example: theme={RefineThemes.Magenta} */}", - "", - ], - [ - ``, - "", - ], - ], - }, - }; - }, -}; diff --git a/refine-react/plugins/chakra/meta.json b/refine-react/plugins/chakra/meta.json deleted file mode 100644 index 454e96c88..000000000 --- a/refine-react/plugins/chakra/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Chakra UI", - "url": "https://refine.dev/docs/" -} diff --git a/refine-react/plugins/chakra/package.json b/refine-react/plugins/chakra/package.json deleted file mode 100644 index 0d6ddc13a..000000000 --- a/refine-react/plugins/chakra/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "dependencies": { - "@refinedev/chakra-ui": "^2.27.1", - "@refinedev/react-hook-form": "^4.8.13", - "@refinedev/react-table": "^5.6.5", - "@tabler/icons": "^1.1.0", - "@chakra-ui/react": "^2.5.1", - "react-hook-form": "^7.30.0" - } -} diff --git a/refine-react/plugins/chakra/src/components/header/index.tsx b/refine-react/plugins/chakra/src/components/header/index.tsx deleted file mode 100644 index ef0f4292b..000000000 --- a/refine-react/plugins/chakra/src/components/header/index.tsx +++ /dev/null @@ -1,93 +0,0 @@ -import { - Avatar, - Box, - BoxProps, - HStack, - Icon, - IconButton, - Text, - useColorMode, - useColorModeValue, -} from "@chakra-ui/react"; -import { - HamburgerMenu, - RefineThemedLayoutV2HeaderProps, -} from "@refinedev/chakra-ui"; -import { useGetIdentity } from "@refinedev/core"; -import { IconMoon, IconSun } from "@tabler/icons"; -import React from "react"; - -type IUser = { - id: number; - name: string; - avatar: string; -}; - -export const Header: React.FC = ({ - isSticky, -}) => { - const { data: user } = useGetIdentity(); - - const { colorMode, toggleColorMode } = useColorMode(); - - const bgColor = useColorModeValue( - "refine.header.bg.light", - "refine.header.bg.dark", - ); - - let stickyProps: BoxProps = {}; - if (isSticky) { - stickyProps = { - position: "sticky", - top: 0, - zIndex: 1, - }; - } - - return ( - - - - - - - - {(user?.avatar || user?.name) && ( - - {user?.name && ( - - {user.name} - - )} - - - )} - - - ); -}; diff --git a/refine-react/plugins/chakra/src/components/index.ts b/refine-react/plugins/chakra/src/components/index.ts deleted file mode 100644 index 924cc88d1..000000000 --- a/refine-react/plugins/chakra/src/components/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { Header } from "./header"; diff --git a/refine-react/plugins/data-provider-airtable/extend.js b/refine-react/plugins/data-provider-airtable/extend.js deleted file mode 100644 index 3961a170d..000000000 --- a/refine-react/plugins/data-provider-airtable/extend.js +++ /dev/null @@ -1,16 +0,0 @@ -const base = { - _app: { - import: [`import dataProvider from "@refinedev/airtable";`], - inner: [ - `const API_TOKEN = "keyI18pnBeEMfPAIb";`, - `const BASE_ID = "appKYl1H4k9g73sBT";`, - "", - ], - refineProps: ["dataProvider={dataProvider(API_TOKEN, BASE_ID)}"], - }, -}; -module.exports = { - extend() { - return base; - }, -}; diff --git a/refine-react/plugins/data-provider-airtable/meta.json b/refine-react/plugins/data-provider-airtable/meta.json deleted file mode 100644 index 4d265d44b..000000000 --- a/refine-react/plugins/data-provider-airtable/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Airtable Data Provider", - "url": "https://refine.dev/docs/core/providers/auth-provider/" -} diff --git a/refine-react/plugins/data-provider-airtable/package.json b/refine-react/plugins/data-provider-airtable/package.json deleted file mode 100644 index 8eec56d7a..000000000 --- a/refine-react/plugins/data-provider-airtable/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "@refinedev/airtable": "^4.4.6" - } -} \ No newline at end of file diff --git a/refine-react/plugins/data-provider-altogic/extend.js b/refine-react/plugins/data-provider-altogic/extend.js deleted file mode 100644 index ce70856ee..000000000 --- a/refine-react/plugins/data-provider-altogic/extend.js +++ /dev/null @@ -1,44 +0,0 @@ -const base = { - _app: { - refineImports: [`HttpError`], - import: [ - `import dataProvider from "@refinedev/altogic";`, - `import axios from "axios";`, - ], - afterImport: [ - "", - `const API_URL = "https://dev001.na-dev-engine.altogic.com";`, - `const YOUR_SECRET_API_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbnZJZCI6IjYxMzczZGVkMjQ5NWMzMDAxOTliZTAxNiIsImtleUlkIjoiNjEzNzNlMzYyNDk1YzMwMDE5OWJlMDJkIiwiaWF0IjoxNjMxMDEwMzU4LCJleHAiOjI0OTUwMTAzNTh9.2fL28Bzd97mqfAvcsTrYj1mZ_hqf3WRnr2DOtV3lsc0";`, - "", - `const axiosInstance = axios.create();`, - `axiosInstance.defaults.headers.common = { - Authorization: YOUR_SECRET_API_KEY - };`, - "", - `axiosInstance.interceptors.response.use( - (response) => { - return response; - }, - (error) => { - const customError: HttpError = { - ...error, - message: error.response?.data?.map((p: any) => p.message).join(", "), - statusCode: error.response?.status - }; - - return Promise.reject(customError); - } - );`, - ], - refineProps: ["dataProvider={dataProvider(API_URL, axiosInstance)}"], - refineAntdImports: [], - refineMantineImports: [], - refineMuiImports: [], - }, -}; -module.exports = { - extend() { - - return base; - }, -}; diff --git a/refine-react/plugins/data-provider-altogic/meta.json b/refine-react/plugins/data-provider-altogic/meta.json deleted file mode 100644 index 0eda2c9a8..000000000 --- a/refine-react/plugins/data-provider-altogic/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Altogic Data Provider", - "url": "https://refine.dev/docs/core/providers/data-provider/#overview" -} diff --git a/refine-react/plugins/data-provider-altogic/package.json b/refine-react/plugins/data-provider-altogic/package.json deleted file mode 100644 index b013db006..000000000 --- a/refine-react/plugins/data-provider-altogic/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "dependencies": { - "@refinedev/altogic": "^4.1.5", - "axios": "^1.6.2" - } -} \ No newline at end of file diff --git a/refine-react/plugins/data-provider-appwrite/extend.js b/refine-react/plugins/data-provider-appwrite/extend.js deleted file mode 100644 index 1ddc42147..000000000 --- a/refine-react/plugins/data-provider-appwrite/extend.js +++ /dev/null @@ -1,30 +0,0 @@ -const base = { - _app: { - import: [ - `import { dataProvider, liveProvider } from "@refinedev/appwrite";`, - ], - localImport: [`import { appwriteClient } from "utility";`], - relativeImport: [`import { authProvider } from "./authProvider";`], - refineProps: [ - `dataProvider={dataProvider(appwriteClient, { - databaseId: "database", - })}`, - `liveProvider={liveProvider(appwriteClient, { - databaseId: "database", - })}`, - `authProvider={authProvider}`, - ], - refineOptions: [`liveMode: "auto",`], - refineImports: [ - `Authenticated` - ], - refineAntdImports: [], - refineMantineImports: [], - refineMuiImports: [], - }, -}; -module.exports = { - extend() { - return base; - }, -}; diff --git a/refine-react/plugins/data-provider-appwrite/meta.json b/refine-react/plugins/data-provider-appwrite/meta.json deleted file mode 100644 index fa561e69f..000000000 --- a/refine-react/plugins/data-provider-appwrite/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Appwrite Data Provider", - "url": "https://refine.dev/docs/core/providers/data-provider/#overview" -} diff --git a/refine-react/plugins/data-provider-appwrite/package.json b/refine-react/plugins/data-provider-appwrite/package.json deleted file mode 100644 index b5a42d2ce..000000000 --- a/refine-react/plugins/data-provider-appwrite/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "dependencies": { - "@refinedev/appwrite": "^6.4.6", - "uuid": "^9.0.0" - }, - "devDependencies": { - "@types/uuid": "^9.0.2" - } -} \ No newline at end of file diff --git a/refine-react/plugins/data-provider-appwrite/src/authProvider.ts b/refine-react/plugins/data-provider-appwrite/src/authProvider.ts deleted file mode 100644 index 01ffba185..000000000 --- a/refine-react/plugins/data-provider-appwrite/src/authProvider.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { AppwriteException } from "@refinedev/appwrite"; -import { AuthBindings } from "@refinedev/core"; -import { v4 as uuidv4 } from "uuid"; -import { account } from "./utility"; - -export const authProvider: AuthBindings = { - login: async ({ email, password }) => { - try { - await account.createEmailSession(email, password); - return { - success: true, - redirectTo: "/", - }; - } catch (error) { - const { type, message, code } = error as AppwriteException; - return { - success: false, - error: { - message, - name: `${code} - ${type}`, - }, - }; - } - }, - logout: async () => { - try { - await account.deleteSession("current"); - } catch (error: any) { - return { - success: false, - error, - }; - } - - return { - success: true, - redirectTo: "/login", - }; - }, - register: async ({ email, password }) => { - try { - await account.create(uuidv4(), email, password); - return { - success: true, - redirectTo: "/login", - }; - } catch (error) { - const { type, message, code } = error as AppwriteException; - return { - success: false, - error: { - message, - name: `${code} - ${type}`, - }, - }; - } - }, - onError: async (error) => { - console.error(error); - return { error }; - }, - check: async () => { - try { - const session = await account.get(); - - if (session) { - return { - authenticated: true, - }; - } - } catch (error: any) { - return { - authenticated: false, - error: error, - logout: true, - redirectTo: "/login", - }; - } - - return { - authenticated: false, - error: { - message: "Check failed", - name: "Session not found", - }, - logout: true, - redirectTo: "/login", - }; - }, - getPermissions: async () => null, - getIdentity: async () => { - const user = await account.get(); - - if (user) { - return user; - } - - return null; - }, -}; diff --git a/refine-react/plugins/data-provider-appwrite/src/utility/appwriteClient.ts b/refine-react/plugins/data-provider-appwrite/src/utility/appwriteClient.ts deleted file mode 100644 index 6c36280cb..000000000 --- a/refine-react/plugins/data-provider-appwrite/src/utility/appwriteClient.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Account, Appwrite, Storage } from "@refinedev/appwrite"; - -const APPWRITE_URL = "https://refine.appwrite.org/v1"; -const APPWRITE_PROJECT = "61c4368b4e349"; - -const appwriteClient = new Appwrite(); - -appwriteClient.setEndpoint(APPWRITE_URL).setProject(APPWRITE_PROJECT); -const account = new Account(appwriteClient); -const storage = new Storage(appwriteClient); - -export { appwriteClient, account, storage }; diff --git a/refine-react/plugins/data-provider-appwrite/src/utility/index.ts b/refine-react/plugins/data-provider-appwrite/src/utility/index.ts deleted file mode 100644 index b4f6465b1..000000000 --- a/refine-react/plugins/data-provider-appwrite/src/utility/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from "./appwriteClient"; -<%_ if (answers["ui-framework"] === "antd") { _%> -export * from "./normalize"; -<%_ } _%> diff --git a/refine-react/plugins/data-provider-appwrite/src/utility/normalize.ts b/refine-react/plugins/data-provider-appwrite/src/utility/normalize.ts deleted file mode 100644 index 038790ea5..000000000 --- a/refine-react/plugins/data-provider-appwrite/src/utility/normalize.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { UploadFile } from "antd"; - -interface UploadResponse { - url: string; -} -interface EventArgs { - file: UploadFile; - fileList: Array>; -} - -export const normalizeFile = (event: EventArgs) => { - const { fileList } = event; - - return fileList.map((item) => { - const { uid, name, type, size, response, percent, status } = item; - - return { - uid, - name, - url: item.url || response?.url, - type, - size, - percent, - status, - }; - }); -}; \ No newline at end of file diff --git a/refine-react/plugins/data-provider-custom-json-rest/extend.js b/refine-react/plugins/data-provider-custom-json-rest/extend.js deleted file mode 100644 index d381bed14..000000000 --- a/refine-react/plugins/data-provider-custom-json-rest/extend.js +++ /dev/null @@ -1,14 +0,0 @@ -const base = { - _app: { - import: [ - `import dataProvider from "@refinedev/simple-rest";`, - ], - refineProps: [`dataProvider={dataProvider("https://api.fake-rest.refine.dev")}`], - }, -}; - -module.exports = { - extend() { - return base; - }, -}; diff --git a/refine-react/plugins/data-provider-custom-json-rest/meta.json b/refine-react/plugins/data-provider-custom-json-rest/meta.json deleted file mode 100644 index 29d70e045..000000000 --- a/refine-react/plugins/data-provider-custom-json-rest/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "REST Data Provider", - "url": "https://refine.dev/docs/core/providers/data-provider/#overview" -} diff --git a/refine-react/plugins/data-provider-custom-json-rest/package.json b/refine-react/plugins/data-provider-custom-json-rest/package.json deleted file mode 100644 index a67b037a4..000000000 --- a/refine-react/plugins/data-provider-custom-json-rest/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "@refinedev/simple-rest": "^5.0.1" - } -} diff --git a/refine-react/plugins/data-provider-graphql/extend.js b/refine-react/plugins/data-provider-graphql/extend.js deleted file mode 100644 index df36cfaa9..000000000 --- a/refine-react/plugins/data-provider-graphql/extend.js +++ /dev/null @@ -1,25 +0,0 @@ -const base = { - _app: { - import: [ - `import dataProvider, { GraphQLClient } from "@refinedev/graphql";`, - ], - afterImport: [ - `const API_URL = "https://your-graphql-url/graphql";`, - "", - `const client = new GraphQLClient(API_URL);`, - `const gqlDataProvider = dataProvider(client);`, - "", - ], - refineProps: ["dataProvider={gqlDataProvider}"], - refineImports: [], - refineAntdImports: [], - refineMuiImports: [], - refineMantineImports: [], - refineChakraImports: [], - }, -}; -module.exports = { - extend() { - return base; - }, -}; diff --git a/refine-react/plugins/data-provider-graphql/meta.json b/refine-react/plugins/data-provider-graphql/meta.json deleted file mode 100644 index adbc228e9..000000000 --- a/refine-react/plugins/data-provider-graphql/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "GraphQL Data Provider", - "url": "https://refine.dev/docs/core/providers/data-provider/#overview" -} diff --git a/refine-react/plugins/data-provider-graphql/package.json b/refine-react/plugins/data-provider-graphql/package.json deleted file mode 100644 index 626c3cc35..000000000 --- a/refine-react/plugins/data-provider-graphql/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "dependencies": { - "@refinedev/graphql": "^6.4.8", - "graphql": "^15.5.3", - "graphql-request": "^5.2.0" - } -} \ No newline at end of file diff --git a/refine-react/plugins/data-provider-hasura/extend.js b/refine-react/plugins/data-provider-hasura/extend.js deleted file mode 100644 index 1093c7fc4..000000000 --- a/refine-react/plugins/data-provider-hasura/extend.js +++ /dev/null @@ -1,32 +0,0 @@ -const base = { - _app: { - import: [ - `import dataProvider, { GraphQLClient, graphqlWS, liveProvider } from "@refinedev/hasura";`, - ], - afterImport: [ - "", - `const API_URL = "https://flowing-mammal-24.hasura.app/v1/graphql";`, - `const WS_URL = "ws://flowing-mammal-24.hasura.app/v1/graphql";`, - "", - `const client = new GraphQLClient(API_URL, { - headers: { - "x-hasura-role": "public", - }, - });`, - "", - `const webSocketClient = graphqlWS.createClient({ - url: WS_URL, - });`, - ], - refineProps: [ - `dataProvider={dataProvider(client)}`, - `liveProvider={liveProvider(webSocketClient)}`, - ], - refineOptions: [`liveMode: "auto",`], - }, -}; -module.exports = { - extend() { - return base; - }, -}; diff --git a/refine-react/plugins/data-provider-hasura/meta.json b/refine-react/plugins/data-provider-hasura/meta.json deleted file mode 100644 index c101db484..000000000 --- a/refine-react/plugins/data-provider-hasura/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Hasura Data Provider", - "url": "https://refine.dev/docs/core/providers/data-provider/#overview" -} diff --git a/refine-react/plugins/data-provider-hasura/package.json b/refine-react/plugins/data-provider-hasura/package.json deleted file mode 100644 index 2e95a83c2..000000000 --- a/refine-react/plugins/data-provider-hasura/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "dependencies": { - "@refinedev/hasura": "^6.4.12", - "graphql": "^15.6.1", - "graphql-request": "^5.2.0" - } -} \ No newline at end of file diff --git a/refine-react/plugins/data-provider-hasura/src/inferencerPredefinedMeta.ts b/refine-react/plugins/data-provider-hasura/src/inferencerPredefinedMeta.ts deleted file mode 100644 index e55a75c66..000000000 --- a/refine-react/plugins/data-provider-hasura/src/inferencerPredefinedMeta.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * This `meta` object is used to define the necessary metadata for inferencer to work with. - * - * They will be used to infer the fields of the response of the data provider. - * Also they will be included in the generated code, making them easily editable after you generate the boilerplate code for your resource. - */ -export const inferencerPredefinedMeta = { - blog_posts: { - getList: { - fields: [ - "id", - "title", - { - category: ["id", "title"], - }, - "category_id", - "content", - "created_at", - ], - }, - getOne: { - fields: ["id", "title", "content", "category_id"], - }, - }, - categories: { - getList: { - fields: ["id", "title", "created_at"], - }, - default: { - fields: ["id", "title"], - }, - }, -}; diff --git a/refine-react/plugins/data-provider-medusa/extend.js b/refine-react/plugins/data-provider-medusa/extend.js deleted file mode 100644 index f8267892c..000000000 --- a/refine-react/plugins/data-provider-medusa/extend.js +++ /dev/null @@ -1,23 +0,0 @@ -const base = { - _app: { - import: [ - `import dataProvider, { authProvider } from "@refinedev/medusa";`, - ], - afterImport: [ - `const API_URL = "https://your-medusa-url";`, - "", - `const medusaDataProvider = dataProvider(API_URL);`, - `const medusaAuthProvider = authProvider(API_URL);`, - "", - ], - refineProps: [ - "authProvider={medusaAuthProvider}", - "dataProvider={medusaDataProvider}", - ], - }, -}; -module.exports = { - extend() { - return base; - }, -}; diff --git a/refine-react/plugins/data-provider-medusa/package.json b/refine-react/plugins/data-provider-medusa/package.json deleted file mode 100644 index bfc50b17c..000000000 --- a/refine-react/plugins/data-provider-medusa/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "@refinedev/medusa": "^3.0.1" - } -} diff --git a/refine-react/plugins/data-provider-nestjsx-crud/extend.js b/refine-react/plugins/data-provider-nestjsx-crud/extend.js deleted file mode 100644 index 56946ce30..000000000 --- a/refine-react/plugins/data-provider-nestjsx-crud/extend.js +++ /dev/null @@ -1,20 +0,0 @@ -const base = { - _app: { - import: [ - 'import nestjsxCrudDataProvider from "@refinedev/nestjsx-crud";', - ], - inner: [ - ` - const API_URL = "https://api.nestjsx-crud.refine.dev";`, - `const dataProvider = nestjsxCrudDataProvider(API_URL); - `, - ], - refineProps: ["dataProvider={dataProvider}"], - }, -}; - -module.exports = { - extend() { - return base; - }, -}; diff --git a/refine-react/plugins/data-provider-nestjsx-crud/meta.json b/refine-react/plugins/data-provider-nestjsx-crud/meta.json deleted file mode 100644 index fe3a53616..000000000 --- a/refine-react/plugins/data-provider-nestjsx-crud/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "NestJS Data Provider", - "url": "https://refine.dev/docs/core/providers/data-provider/#overview" -} diff --git a/refine-react/plugins/data-provider-nestjsx-crud/package.json b/refine-react/plugins/data-provider-nestjsx-crud/package.json deleted file mode 100644 index 6b3f6355a..000000000 --- a/refine-react/plugins/data-provider-nestjsx-crud/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "@refinedev/nestjsx-crud": "^5.0.1" - } -} diff --git a/refine-react/plugins/data-provider-strapi-v4/extend.js b/refine-react/plugins/data-provider-strapi-v4/extend.js deleted file mode 100644 index 6f0e82d3a..000000000 --- a/refine-react/plugins/data-provider-strapi-v4/extend.js +++ /dev/null @@ -1,25 +0,0 @@ -const base = { - _app: { - import: [`import { DataProvider } from "@refinedev/strapi-v4";`], - relativeImport: [ - `import { authProvider, axiosInstance } from "./authProvider";`, - `import { API_URL } from "./constants";`, - ], - refineProps: [ - "authProvider={authProvider}", - "dataProvider={DataProvider(API_URL + `/api`, axiosInstance)}", - ], - refineImports: [ - `Authenticated` - ], - refineAntdImports: [], - refineMuiImports: [], - refineMantineImports: [], - - }, -}; -module.exports = { - extend() { - return base; - }, -}; diff --git a/refine-react/plugins/data-provider-strapi-v4/meta.json b/refine-react/plugins/data-provider-strapi-v4/meta.json deleted file mode 100644 index 907bb7010..000000000 --- a/refine-react/plugins/data-provider-strapi-v4/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Strapi v4 Data Provider", - "url": "https://refine.dev/docs/core/providers/data-provider/#overview" -} diff --git a/refine-react/plugins/data-provider-strapi-v4/package.json b/refine-react/plugins/data-provider-strapi-v4/package.json deleted file mode 100644 index 9ab085e96..000000000 --- a/refine-react/plugins/data-provider-strapi-v4/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "dependencies": { - "@refinedev/strapi-v4": "^6.0.1", - "axios": "^1.6.2" - } -} \ No newline at end of file diff --git a/refine-react/plugins/data-provider-strapi-v4/src/authProvider.ts b/refine-react/plugins/data-provider-strapi-v4/src/authProvider.ts deleted file mode 100644 index 50362ee1b..000000000 --- a/refine-react/plugins/data-provider-strapi-v4/src/authProvider.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { AuthBindings } from "@refinedev/core"; -import { AuthHelper } from "@refinedev/strapi-v4"; - -import { TOKEN_KEY, API_URL } from "./constants"; - -import axios from "axios"; - -export const axiosInstance = axios.create(); -const strapiAuthHelper = AuthHelper(API_URL + "/api"); - -export const authProvider: AuthBindings = { - login: async ({ email, password }) => { - const { data, status } = await strapiAuthHelper.login(email, password); - if (status === 200) { - localStorage.setItem(TOKEN_KEY, data.jwt); - - // set header axios instance - axiosInstance.defaults.headers.common[ - "Authorization" - ] = `Bearer ${data.jwt}`; - - return { - success: true, - redirectTo: "/", - }; - } - return { - success: false, - error: { - message: "Login failed", - name: "Invalid email or password", - }, - }; - }, - logout: async () => { - localStorage.removeItem(TOKEN_KEY); - return { - success: true, - redirectTo: "/login", - }; - }, - onError: async (error) => { - console.error(error); - return { error }; - }, - check: async () => { - const token = localStorage.getItem(TOKEN_KEY); - if (token) { - axiosInstance.defaults.headers.common[ - "Authorization" - ] = `Bearer ${token}`; - return { - authenticated: true, - }; - } - - return { - authenticated: false, - error: { - message: "Check failed", - name: "Token not found", - }, - logout: true, - redirectTo: "/login", - }; - }, - getPermissions: async () => null, - getIdentity: async () => { - const token = localStorage.getItem(TOKEN_KEY); - if (!token) { - return null; - } - - const { data, status } = await strapiAuthHelper.me(token); - if (status === 200) { - const { id, username, email } = data; - return { - id, - name: username, - email, - }; - } - - return null; - }, -}; diff --git a/refine-react/plugins/data-provider-strapi-v4/src/constants.ts b/refine-react/plugins/data-provider-strapi-v4/src/constants.ts deleted file mode 100644 index eed20ac6a..000000000 --- a/refine-react/plugins/data-provider-strapi-v4/src/constants.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const API_URL = "https://api.strapi-v4.refine.dev"; -export const TOKEN_KEY = "strapi-jwt-token"; diff --git a/refine-react/plugins/data-provider-supabase/extend.js b/refine-react/plugins/data-provider-supabase/extend.js deleted file mode 100644 index 39c40b2d7..000000000 --- a/refine-react/plugins/data-provider-supabase/extend.js +++ /dev/null @@ -1,31 +0,0 @@ -const base = { - _app: { - import: [ - `import { dataProvider, liveProvider } from "@refinedev/supabase";`, - ], - localImport: [ - `import { supabaseClient } from "utility";`, - ], - relativeImport: [`import authProvider from "./authProvider";`], - refineProps: [ - "dataProvider={dataProvider(supabaseClient)}", - "liveProvider={liveProvider(supabaseClient)}", - "authProvider={authProvider}", - "routerProvider={routerBindings}" - ], - refineOptions: [`liveMode: "auto",`], - refineImports: [ - `Authenticated` - ], - refineAntdImports: [], - refineMantineImports: [], - refineMuiImports: [], - refineChakraImports: [], - wrapper: [], - }, -}; -module.exports = { - extend() { - return base; - }, -}; diff --git a/refine-react/plugins/data-provider-supabase/meta.json b/refine-react/plugins/data-provider-supabase/meta.json deleted file mode 100644 index 804c4711d..000000000 --- a/refine-react/plugins/data-provider-supabase/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Supabase Data Provider", - "url": "https://refine.dev/docs/core/providers/data-provider/#overview" -} diff --git a/refine-react/plugins/data-provider-supabase/package.json b/refine-react/plugins/data-provider-supabase/package.json deleted file mode 100644 index a579ff358..000000000 --- a/refine-react/plugins/data-provider-supabase/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "@refinedev/supabase": "^5.7.4" - } -} \ No newline at end of file diff --git a/refine-react/plugins/data-provider-supabase/src/authProvider.ts b/refine-react/plugins/data-provider-supabase/src/authProvider.ts deleted file mode 100644 index 393ceaeb2..000000000 --- a/refine-react/plugins/data-provider-supabase/src/authProvider.ts +++ /dev/null @@ -1,247 +0,0 @@ -import { AuthBindings } from "@refinedev/core"; - -import { supabaseClient } from "utility"; - -const authProvider: AuthBindings = { - login: async ({ email, password, providerName }) => { - // sign in with oauth - try { - if (providerName) { - const { - data, - error, - } = await supabaseClient.auth.signInWithOAuth({ - provider: providerName, - }); - - if (error) { - return { - success: false, - error, - }; - } - - if (data?.url) { - return { - success: true, - redirectTo: "/", - }; - } - } - - // sign in with email and password - const { - data, - error, - } = await supabaseClient.auth.signInWithPassword({ - email, - password, - }); - - if (error) { - return { - success: false, - error, - }; - } - - if (data?.user) { - return { - success: true, - redirectTo: "/", - }; - } - } catch (error: any) { - return { - success: false, - error, - }; - } - - return { - success: false, - error: { - message: "Login failed", - name: "Invalid email or password", - }, - }; - }, - register: async ({ email, password }) => { - try { - const { data, error } = await supabaseClient.auth.signUp({ - email, - password, - }); - - if (error) { - return { - success: false, - error, - }; - } - - if (data) { - return { - success: true, - redirectTo: "/", - }; - } - } catch (error: any) { - return { - success: false, - error, - }; - } - - return { - success: false, - error: { - message: "Register failed", - name: "Invalid email or password", - }, - }; - }, - forgotPassword: async ({ email }) => { - try { - const { - data, - error, - } = await supabaseClient.auth.resetPasswordForEmail(email, { - redirectTo: `${window.location.origin}/update-password`, - }); - - if (error) { - return { - success: false, - error, - }; - } - - if (data) { - return { - success: true, - }; - } - } catch (error: any) { - return { - success: false, - error, - }; - } - - return { - success: false, - error: { - message: "Forgot password failed", - name: "Invalid email", - }, - }; - }, - updatePassword: async ({ password }) => { - try { - const { data, error } = await supabaseClient.auth.updateUser({ - password, - }); - - if (error) { - return { - success: false, - error, - }; - } - - if (data) { - return { - success: true, - redirectTo: "/", - }; - } - } catch (error: any) { - return { - success: false, - error, - }; - } - return { - success: false, - error: { - message: "Update password failed", - name: "Invalid password", - }, - }; - }, - logout: async () => { - const { error } = await supabaseClient.auth.signOut(); - - if (error) { - return { - success: false, - error, - }; - } - - return { - success: true, - redirectTo: "/", - }; - }, - onError: async (error) => { - console.error(error); - return { error }; - }, - check: async () => { - try { - const { data } = await supabaseClient.auth.getSession(); - const { session } = data; - - if (!session) { - return { - authenticated: false, - error: { - message: "Check failed", - name: "Session not found", - }, - logout: true, - redirectTo: "/login", - }; - } - } catch (error: any) { - return { - authenticated: false, - error: error || { - message: "Check failed", - name: "Not authenticated", - }, - logout: true, - redirectTo: "/login", - }; - } - - return { - authenticated: true, - }; - }, - getPermissions: async () => { - const user = await supabaseClient.auth.getUser(); - - if (user) { - return user.data.user?.role; - } - - return null; - }, - getIdentity: async () => { - const { data } = await supabaseClient.auth.getUser(); - - if (data?.user) { - return { - ...data.user, - name: data.user.email, - }; - } - - return null; - }, -}; - -export default authProvider; diff --git a/refine-react/plugins/data-provider-supabase/src/utility/index.ts b/refine-react/plugins/data-provider-supabase/src/utility/index.ts deleted file mode 100644 index 1a2159651..000000000 --- a/refine-react/plugins/data-provider-supabase/src/utility/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./supabaseClient"; diff --git a/refine-react/plugins/data-provider-supabase/src/utility/supabaseClient.ts b/refine-react/plugins/data-provider-supabase/src/utility/supabaseClient.ts deleted file mode 100644 index 4368fd9f1..000000000 --- a/refine-react/plugins/data-provider-supabase/src/utility/supabaseClient.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { createClient } from "@refinedev/supabase"; - -const SUPABASE_URL = "https://iwdfzvfqbtokqetmbmbp.supabase.co"; -const SUPABASE_KEY = - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYzMDU2NzAxMCwiZXhwIjoxOTQ2MTQzMDEwfQ._gr6kXGkQBi9BM9dx5vKaNKYj_DJN1xlkarprGpM_fU"; - -export const supabaseClient = createClient(SUPABASE_URL, SUPABASE_KEY, { - db: { - schema: "public", - }, - auth: { - persistSession: true, - }, -}); \ No newline at end of file diff --git a/refine-react/plugins/i18n-antd/extend.js b/refine-react/plugins/i18n-antd/extend.js deleted file mode 100644 index 9557282f2..000000000 --- a/refine-react/plugins/i18n-antd/extend.js +++ /dev/null @@ -1,23 +0,0 @@ -const base = { - _app: { - import: [`import { useTranslation } from "react-i18next";`], - localImport: [], - innerHooks: [`const { t, i18n } = useTranslation();`], - inner: [ - ` - const i18nProvider = { - translate: (key: string, params: object) => t(key, params), - changeLocale: (lang: string) => i18n.changeLanguage(lang), - getLocale: () => i18n.language, - }; - `, - ], - refineProps: ["i18nProvider={i18nProvider}"], - }, -}; - -module.exports = { - extend() { - return base; - }, -}; diff --git a/refine-react/plugins/i18n-antd/meta.json b/refine-react/plugins/i18n-antd/meta.json deleted file mode 100644 index 3062aa817..000000000 --- a/refine-react/plugins/i18n-antd/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "i18n", - "url": "https://refine.dev/docs/core/providers/i18n-provider/" -} diff --git a/refine-react/plugins/i18n-antd/package.json b/refine-react/plugins/i18n-antd/package.json deleted file mode 100644 index 93046e6de..000000000 --- a/refine-react/plugins/i18n-antd/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "dependencies": { - "i18next": "^20.1.0", - "react-i18next": "^11.8.11", - "i18next-browser-languagedetector": "^6.1.1", - "i18next-xhr-backend": "^3.2.2" - } -} \ No newline at end of file diff --git a/refine-react/plugins/i18n-antd/src/components/header/index.tsx b/refine-react/plugins/i18n-antd/src/components/header/index.tsx deleted file mode 100644 index c26b72d9f..000000000 --- a/refine-react/plugins/i18n-antd/src/components/header/index.tsx +++ /dev/null @@ -1,105 +0,0 @@ -import { DownOutlined } from "@ant-design/icons"; -import type { RefineThemedLayoutV2HeaderProps } from "@refinedev/antd"; -import { useGetIdentity, useGetLocale, useSetLocale } from "@refinedev/core"; -import { - Avatar, - Button, - Dropdown, - Layout as AntdLayout, - MenuProps, - Space, - Switch, - theme, - Typography, -} from "antd"; -import React, { useContext } from "react"; -import { useTranslation } from "react-i18next"; -import { ColorModeContext } from "../../contexts/color-mode"; - -const { Text } = Typography; -const { useToken } = theme; - -type IUser = { - id: number; - name: string; - avatar: string; -}; - -export const Header: React.FC = ({ - isSticky, -}) => { - const { token } = useToken(); - const { i18n } = useTranslation(); - const locale = useGetLocale(); - const changeLanguage = useSetLocale(); - const { data: user } = useGetIdentity(); - const { mode, setMode } = useContext(ColorModeContext); - - const currentLocale = locale(); - - const menuItems: MenuProps["items"] = [...(i18n.languages || [])] - .sort() - .map((lang: string) => ({ - key: lang, - onClick: () => changeLanguage(lang), - icon: ( - - - - ), - label: lang === "en" ? "English" : "German", - })); - - const headerStyles: React.CSSProperties = { - backgroundColor: token.colorBgElevated, - display: "flex", - justifyContent: "flex-end", - alignItems: "center", - padding: "0px 24px", - height: "64px", - }; - - if (isSticky) { - headerStyles.position = "sticky"; - headerStyles.top = 0; - headerStyles.zIndex = 1; - } - - return ( - - - - - - - setMode(mode === "light" ? "dark" : "light") - } - defaultChecked={mode === "dark"} - /> - - {user?.name && {user.name}} - {user?.avatar && ( - - )} - - - - ); -}; diff --git a/refine-react/plugins/i18n-antd/src/components/index.ts b/refine-react/plugins/i18n-antd/src/components/index.ts deleted file mode 100644 index 9727c415d..000000000 --- a/refine-react/plugins/i18n-antd/src/components/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { Header } from "./header" \ No newline at end of file diff --git a/refine-react/plugins/i18n-antd/src/i18n.ts b/refine-react/plugins/i18n-antd/src/i18n.ts deleted file mode 100644 index a0008fbc1..000000000 --- a/refine-react/plugins/i18n-antd/src/i18n.ts +++ /dev/null @@ -1,19 +0,0 @@ -import i18n from "i18next"; -import { initReactI18next } from "react-i18next"; -import Backend from "i18next-xhr-backend"; -import detector from "i18next-browser-languagedetector"; - -i18n.use(Backend) - .use(detector) - .use(initReactI18next) - .init({ - supportedLngs: ["en", "de"], - backend: { - loadPath: "/locales/{{lng}}/{{ns}}.json", - }, - ns: ["common"], - defaultNS: "common", - fallbackLng: ["en", "de"], - }); - -export default i18n; diff --git a/refine-react/plugins/i18n-chakra/extend.js b/refine-react/plugins/i18n-chakra/extend.js deleted file mode 100644 index ea1810188..000000000 --- a/refine-react/plugins/i18n-chakra/extend.js +++ /dev/null @@ -1,23 +0,0 @@ -const base = { - _app: { - import: [`import { useTranslation } from "react-i18next";`], - innerHooks: [`const { t, i18n } = useTranslation();`], - inner: [ - ` - const i18nProvider = { - translate: (key: string, params: object) => t(key, params), - changeLocale: (lang: string) => i18n.changeLanguage(lang), - getLocale: () => i18n.language, - }; - `, - ], - refineProps: ["i18nProvider={i18nProvider}"], - localImport: [], - }, -}; - -module.exports = { - extend() { - return base; - }, -}; diff --git a/refine-react/plugins/i18n-chakra/meta.json b/refine-react/plugins/i18n-chakra/meta.json deleted file mode 100644 index 3062aa817..000000000 --- a/refine-react/plugins/i18n-chakra/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "i18n", - "url": "https://refine.dev/docs/core/providers/i18n-provider/" -} diff --git a/refine-react/plugins/i18n-chakra/package.json b/refine-react/plugins/i18n-chakra/package.json deleted file mode 100644 index 93046e6de..000000000 --- a/refine-react/plugins/i18n-chakra/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "dependencies": { - "i18next": "^20.1.0", - "react-i18next": "^11.8.11", - "i18next-browser-languagedetector": "^6.1.1", - "i18next-xhr-backend": "^3.2.2" - } -} \ No newline at end of file diff --git a/refine-react/plugins/i18n-chakra/src/components/header/index.tsx b/refine-react/plugins/i18n-chakra/src/components/header/index.tsx deleted file mode 100644 index f7b75e05d..000000000 --- a/refine-react/plugins/i18n-chakra/src/components/header/index.tsx +++ /dev/null @@ -1,139 +0,0 @@ -import { - Avatar, - Box, - BoxProps, - HStack, - Icon, - IconButton, - Menu, - MenuButton, - MenuItem, - MenuList, - Text, - useColorMode, - useColorModeValue, -} from "@chakra-ui/react"; -import { - HamburgerMenu, - RefineThemedLayoutV2HeaderProps, -} from "@refinedev/chakra-ui"; -import { useGetIdentity, useGetLocale, useSetLocale } from "@refinedev/core"; -import { IconLanguage, IconMoon, IconSun } from "@tabler/icons"; -import i18n from "i18n"; -import React from "react"; - -type IUser = { - id: number; - name: string; - avatar: string; -}; - -export const Header: React.FC = ({ - isSticky, -}) => { - const { data: user } = useGetIdentity(); - - const { colorMode, toggleColorMode } = useColorMode(); - - const bgColor = useColorModeValue( - "refine.header.bg.light", - "refine.header.bg.dark", - ); - - const changeLanguage = useSetLocale(); - const locale = useGetLocale(); - const currentLocale = locale(); - - let stickyProps: BoxProps = {}; - if (isSticky) { - stickyProps = { - position: "sticky", - top: 0, - zIndex: 1, - }; - } - - return ( - - - - - - } - variant="ghost" - /> - - {[...(i18n.languages ?? [])] - .sort() - .map((lang: string) => ( - { - changeLanguage(lang); - }} - value={lang} - color={ - lang === currentLocale - ? "green" - : undefined - } - icon={ - - } - > - {lang === "en" ? "English" : "German"} - - ))} - - - - - - - - {(user?.avatar || user?.name) && ( - - {user?.name && ( - - {user.name} - - )} - - - )} - - - ); -}; diff --git a/refine-react/plugins/i18n-chakra/src/components/index.ts b/refine-react/plugins/i18n-chakra/src/components/index.ts deleted file mode 100644 index 9727c415d..000000000 --- a/refine-react/plugins/i18n-chakra/src/components/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { Header } from "./header" \ No newline at end of file diff --git a/refine-react/plugins/i18n-chakra/src/i18n.ts b/refine-react/plugins/i18n-chakra/src/i18n.ts deleted file mode 100644 index a0008fbc1..000000000 --- a/refine-react/plugins/i18n-chakra/src/i18n.ts +++ /dev/null @@ -1,19 +0,0 @@ -import i18n from "i18next"; -import { initReactI18next } from "react-i18next"; -import Backend from "i18next-xhr-backend"; -import detector from "i18next-browser-languagedetector"; - -i18n.use(Backend) - .use(detector) - .use(initReactI18next) - .init({ - supportedLngs: ["en", "de"], - backend: { - loadPath: "/locales/{{lng}}/{{ns}}.json", - }, - ns: ["common"], - defaultNS: "common", - fallbackLng: ["en", "de"], - }); - -export default i18n; diff --git a/refine-react/plugins/i18n-mantine/extend.js b/refine-react/plugins/i18n-mantine/extend.js deleted file mode 100644 index f7525d2e5..000000000 --- a/refine-react/plugins/i18n-mantine/extend.js +++ /dev/null @@ -1,23 +0,0 @@ -const base = { - _app: { - import: [`import { useTranslation } from "react-i18next";`], - innerHooks: [`const { t, i18n } = useTranslation();`], - inner: [ - ` - const i18nProvider = { - translate: (key: string, params: object) => t(key, params), - changeLocale: (lang: string) => i18n.changeLanguage(lang), - getLocale: () => i18n.language, - }; - `, - ], - refineProps: ["i18nProvider={i18nProvider}"], - localImport: [], - }, -}; - -module.exports = { - extend() { - return base; - }, -}; \ No newline at end of file diff --git a/refine-react/plugins/i18n-mantine/meta.json b/refine-react/plugins/i18n-mantine/meta.json deleted file mode 100644 index 3062aa817..000000000 --- a/refine-react/plugins/i18n-mantine/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "i18n", - "url": "https://refine.dev/docs/core/providers/i18n-provider/" -} diff --git a/refine-react/plugins/i18n-mantine/package.json b/refine-react/plugins/i18n-mantine/package.json deleted file mode 100644 index 93046e6de..000000000 --- a/refine-react/plugins/i18n-mantine/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "dependencies": { - "i18next": "^20.1.0", - "react-i18next": "^11.8.11", - "i18next-browser-languagedetector": "^6.1.1", - "i18next-xhr-backend": "^3.2.2" - } -} \ No newline at end of file diff --git a/refine-react/plugins/i18n-mantine/src/components/header/index.tsx b/refine-react/plugins/i18n-mantine/src/components/header/index.tsx deleted file mode 100644 index 0d7750c29..000000000 --- a/refine-react/plugins/i18n-mantine/src/components/header/index.tsx +++ /dev/null @@ -1,138 +0,0 @@ -import { - ActionIcon, - Avatar, - Flex, - Group, - Header as MantineHeader, - Menu, - Sx, - Title, - useMantineColorScheme, - useMantineTheme, -} from "@mantine/core"; -import { useGetIdentity, useGetLocale, useSetLocale } from "@refinedev/core"; -import { - HamburgerMenu, - RefineThemedLayoutV2HeaderProps, -} from "@refinedev/mantine"; -import { IconLanguage, IconMoonStars, IconSun } from "@tabler/icons"; -import i18n from "i18n"; -import React from "react"; - -type IUser = { - id: number; - name: string; - avatar: string; -}; - -export const Header: React.FC = ({ - isSticky, -}) => { - const { data: user } = useGetIdentity(); - - const changeLanguage = useSetLocale(); - const locale = useGetLocale(); - const currentLocale = locale(); - - const theme = useMantineTheme(); - - const { colorScheme, toggleColorScheme } = useMantineColorScheme(); - const dark = colorScheme === "dark"; - - const borderColor = dark ? theme.colors.dark[6] : theme.colors.gray[2]; - - let stickyStyles: Sx = {}; - if (isSticky) { - stickyStyles = { - position: `sticky`, - top: 0, - zIndex: 1, - }; - } - - return ( - - - - - - - - - - - - - {[...(i18n.languages ?? [])] - .sort() - .map((lang: string) => ( - { - changeLanguage(lang); - }} - value={lang} - color={ - lang === currentLocale - ? "primary" - : undefined - } - icon={ - - } - > - {lang === "en" ? "English" : "German"} - - ))} - - - - toggleColorScheme()} - title="Toggle color scheme" - > - {dark ? ( - - ) : ( - - )} - - - {(user?.name || user?.avatar) && ( - - {user?.name && ( - {user?.name} - )} - - - )} - - - - ); -}; diff --git a/refine-react/plugins/i18n-mantine/src/components/index.ts b/refine-react/plugins/i18n-mantine/src/components/index.ts deleted file mode 100644 index 9727c415d..000000000 --- a/refine-react/plugins/i18n-mantine/src/components/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { Header } from "./header" \ No newline at end of file diff --git a/refine-react/plugins/i18n-mantine/src/i18n.ts b/refine-react/plugins/i18n-mantine/src/i18n.ts deleted file mode 100644 index a0008fbc1..000000000 --- a/refine-react/plugins/i18n-mantine/src/i18n.ts +++ /dev/null @@ -1,19 +0,0 @@ -import i18n from "i18next"; -import { initReactI18next } from "react-i18next"; -import Backend from "i18next-xhr-backend"; -import detector from "i18next-browser-languagedetector"; - -i18n.use(Backend) - .use(detector) - .use(initReactI18next) - .init({ - supportedLngs: ["en", "de"], - backend: { - loadPath: "/locales/{{lng}}/{{ns}}.json", - }, - ns: ["common"], - defaultNS: "common", - fallbackLng: ["en", "de"], - }); - -export default i18n; diff --git a/refine-react/plugins/i18n-mui/extend.js b/refine-react/plugins/i18n-mui/extend.js deleted file mode 100644 index ea1810188..000000000 --- a/refine-react/plugins/i18n-mui/extend.js +++ /dev/null @@ -1,23 +0,0 @@ -const base = { - _app: { - import: [`import { useTranslation } from "react-i18next";`], - innerHooks: [`const { t, i18n } = useTranslation();`], - inner: [ - ` - const i18nProvider = { - translate: (key: string, params: object) => t(key, params), - changeLocale: (lang: string) => i18n.changeLanguage(lang), - getLocale: () => i18n.language, - }; - `, - ], - refineProps: ["i18nProvider={i18nProvider}"], - localImport: [], - }, -}; - -module.exports = { - extend() { - return base; - }, -}; diff --git a/refine-react/plugins/i18n-mui/meta.json b/refine-react/plugins/i18n-mui/meta.json deleted file mode 100644 index 3062aa817..000000000 --- a/refine-react/plugins/i18n-mui/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "i18n", - "url": "https://refine.dev/docs/core/providers/i18n-provider/" -} diff --git a/refine-react/plugins/i18n-mui/package.json b/refine-react/plugins/i18n-mui/package.json deleted file mode 100644 index 93046e6de..000000000 --- a/refine-react/plugins/i18n-mui/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "dependencies": { - "i18next": "^20.1.0", - "react-i18next": "^11.8.11", - "i18next-browser-languagedetector": "^6.1.1", - "i18next-xhr-backend": "^3.2.2" - } -} \ No newline at end of file diff --git a/refine-react/plugins/i18n-mui/src/components/header/index.tsx b/refine-react/plugins/i18n-mui/src/components/header/index.tsx deleted file mode 100644 index 27ba7981f..000000000 --- a/refine-react/plugins/i18n-mui/src/components/header/index.tsx +++ /dev/null @@ -1,144 +0,0 @@ -import DarkModeOutlined from "@mui/icons-material/DarkModeOutlined"; -import LightModeOutlined from "@mui/icons-material/LightModeOutlined"; -import AppBar from "@mui/material/AppBar"; -import Avatar from "@mui/material/Avatar"; -import FormControl from "@mui/material/FormControl"; -import IconButton from "@mui/material/IconButton"; -import MenuItem from "@mui/material/MenuItem"; -import Select from "@mui/material/Select"; -import Stack from "@mui/material/Stack"; -import Toolbar from "@mui/material/Toolbar"; -import Typography from "@mui/material/Typography"; -import { useGetIdentity, useGetLocale, useSetLocale } from "@refinedev/core"; -import { HamburgerMenu, RefineThemedLayoutV2HeaderProps } from "@refinedev/mui"; -import i18n from "i18n"; -import React, { useContext } from "react"; -import { ColorModeContext } from "../../contexts/color-mode"; - -type IUser = { - id: number; - name: string; - avatar: string; -}; - -export const Header: React.FC = ({ - isSticky = true, -}) => { - const { mode, setMode } = useContext(ColorModeContext); - - const { data: user } = useGetIdentity(); - - const changeLanguage = useSetLocale(); - const locale = useGetLocale(); - const currentLocale = locale(); - - return ( - - - - - - - - - - { - setMode(); - }} - > - {mode === "dark" ? ( - - ) : ( - - )} - - - {(user?.avatar || user?.name) && ( - - {user?.name && ( - - {user?.name} - - )} - - - )} - - - - - ); -}; diff --git a/refine-react/plugins/i18n-mui/src/i18n.ts b/refine-react/plugins/i18n-mui/src/i18n.ts deleted file mode 100644 index a0008fbc1..000000000 --- a/refine-react/plugins/i18n-mui/src/i18n.ts +++ /dev/null @@ -1,19 +0,0 @@ -import i18n from "i18next"; -import { initReactI18next } from "react-i18next"; -import Backend from "i18next-xhr-backend"; -import detector from "i18next-browser-languagedetector"; - -i18n.use(Backend) - .use(detector) - .use(initReactI18next) - .init({ - supportedLngs: ["en", "de"], - backend: { - loadPath: "/locales/{{lng}}/{{ns}}.json", - }, - ns: ["common"], - defaultNS: "common", - fallbackLng: ["en", "de"], - }); - -export default i18n; diff --git a/refine-react/plugins/i18n/extend.js b/refine-react/plugins/i18n/extend.js deleted file mode 100644 index 3cfda082d..000000000 --- a/refine-react/plugins/i18n/extend.js +++ /dev/null @@ -1,22 +0,0 @@ -const base = { - _app: { - import: [`import { useTranslation } from "react-i18next";`], - innerHooks: [`const { t, i18n } = useTranslation();`], - inner: [ - ` - const i18nProvider = { - translate: (key: string, params: object) => t(key, params), - changeLocale: (lang: string) => i18n.changeLanguage(lang), - getLocale: () => i18n.language, - }; - `, - ], - refineProps: ["i18nProvider={i18nProvider}"], - }, -}; - -module.exports = { - extend(answers) { - return base; - }, -}; diff --git a/refine-react/plugins/i18n/meta.json b/refine-react/plugins/i18n/meta.json deleted file mode 100644 index 3062aa817..000000000 --- a/refine-react/plugins/i18n/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "i18n", - "url": "https://refine.dev/docs/core/providers/i18n-provider/" -} diff --git a/refine-react/plugins/i18n/package.json b/refine-react/plugins/i18n/package.json deleted file mode 100644 index 93046e6de..000000000 --- a/refine-react/plugins/i18n/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "dependencies": { - "i18next": "^20.1.0", - "react-i18next": "^11.8.11", - "i18next-browser-languagedetector": "^6.1.1", - "i18next-xhr-backend": "^3.2.2" - } -} \ No newline at end of file diff --git a/refine-react/plugins/i18n/src/i18n.ts b/refine-react/plugins/i18n/src/i18n.ts deleted file mode 100644 index a0008fbc1..000000000 --- a/refine-react/plugins/i18n/src/i18n.ts +++ /dev/null @@ -1,19 +0,0 @@ -import i18n from "i18next"; -import { initReactI18next } from "react-i18next"; -import Backend from "i18next-xhr-backend"; -import detector from "i18next-browser-languagedetector"; - -i18n.use(Backend) - .use(detector) - .use(initReactI18next) - .init({ - supportedLngs: ["en", "de"], - backend: { - loadPath: "/locales/{{lng}}/{{ns}}.json", - }, - ns: ["common"], - defaultNS: "common", - fallbackLng: ["en", "de"], - }); - -export default i18n; diff --git a/refine-react/plugins/inferencer-headless/extend.js b/refine-react/plugins/inferencer-headless/extend.js deleted file mode 100644 index f86f8c950..000000000 --- a/refine-react/plugins/inferencer-headless/extend.js +++ /dev/null @@ -1,21 +0,0 @@ -const base = { - _app: { - import: [], - refineProps: [], - refineAntdImports: [], - wrapper: [], - inferencer: {}, - }, -}; - -module.exports = { - extend() { - base._app.inferencer = { - ui: "no", - folder: "headless", - componentPrefix: "Headless", - }; - - return base; - }, -}; diff --git a/refine-react/plugins/inferencer-headless/meta.json b/refine-react/plugins/inferencer-headless/meta.json deleted file mode 100644 index 96a5431bf..000000000 --- a/refine-react/plugins/inferencer-headless/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Inferencer", - "url": "https://refine.dev/docs/packages/documentation/inferencer" -} diff --git a/refine-react/plugins/inferencer-headless/package.json b/refine-react/plugins/inferencer-headless/package.json deleted file mode 100644 index 5db49f5e7..000000000 --- a/refine-react/plugins/inferencer-headless/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "dependencies": { - "@refinedev/inferencer": "^4.5.16", - "@refinedev/react-hook-form": "^4.8.13", - "@refinedev/react-table": "^5.6.5" - } -} diff --git a/refine-react/plugins/inferencer-headless/src/pages/blog-posts/create.tsx b/refine-react/plugins/inferencer-headless/src/pages/blog-posts/create.tsx deleted file mode 100644 index b9aa6cc2c..000000000 --- a/refine-react/plugins/inferencer-headless/src/pages/blog-posts/create.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { IResourceComponentsProps } from "@refinedev/core"; -import { <%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>CreateInferencer } from "@refinedev/inferencer/<%- (_app.inferencer.folder || "") _%>"; - -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -import { inferencerPredefinedMeta } from "../../inferencerPredefinedMeta"; -<%_ } _%> - -export const BlogPostCreate: React.FC = () => { - return <<%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>CreateInferencer -<%_ if (answers["data-provider"] === 'data-provider-appwrite') { _%> -fieldTransformer={(field) => { - if (["$permissions", "$updatedAt", "$createdAt"].includes(field.key)) { - return false; - } - return field; -}} -<%_ } _%> -<%_ if (answers["data-provider"] === 'data-provider-strapi-v4') { _%> -fieldTransformer={(field) => { - if (["locale", "updatedAt", "publishedAt"].includes(field.key)) { - return false; - } - - return field; -}} -<%_ } _%> -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -meta={inferencerPredefinedMeta} -<%_ } _%> -/>; -}; diff --git a/refine-react/plugins/inferencer-headless/src/pages/blog-posts/edit.tsx b/refine-react/plugins/inferencer-headless/src/pages/blog-posts/edit.tsx deleted file mode 100644 index e99e64f75..000000000 --- a/refine-react/plugins/inferencer-headless/src/pages/blog-posts/edit.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { IResourceComponentsProps } from "@refinedev/core"; -import { <%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>EditInferencer } from "@refinedev/inferencer/<%- (_app.inferencer.folder || "") _%>"; - -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -import { inferencerPredefinedMeta } from "../../inferencerPredefinedMeta"; -<%_ } _%> - -export const BlogPostEdit: React.FC = () => { - return <<%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>EditInferencer -<%_ if (answers["data-provider"] === 'data-provider-appwrite') { _%> -fieldTransformer={(field) => { - if (["$permissions", "$updatedAt", "$createdAt"].includes(field.key)) { - return false; - } - return field; -}} -<%_ } _%> -<%_ if (answers["data-provider"] === 'data-provider-strapi-v4') { _%> -fieldTransformer={(field) => { - if (["locale", "updatedAt", "publishedAt"].includes(field.key)) { - return false; - } - - return field; -}} -<%_ } _%> -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -meta={inferencerPredefinedMeta} -<%_ } _%> -/>; -}; diff --git a/refine-react/plugins/inferencer-headless/src/pages/blog-posts/index.ts b/refine-react/plugins/inferencer-headless/src/pages/blog-posts/index.ts deleted file mode 100644 index 165f05e2c..000000000 --- a/refine-react/plugins/inferencer-headless/src/pages/blog-posts/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { BlogPostList } from "./list"; -export { BlogPostCreate } from "./create"; -export { BlogPostEdit } from "./edit"; -export { BlogPostShow } from "./show"; diff --git a/refine-react/plugins/inferencer-headless/src/pages/blog-posts/list.tsx b/refine-react/plugins/inferencer-headless/src/pages/blog-posts/list.tsx deleted file mode 100644 index d0e297d08..000000000 --- a/refine-react/plugins/inferencer-headless/src/pages/blog-posts/list.tsx +++ /dev/null @@ -1,32 +0,0 @@ - -import { IResourceComponentsProps } from "@refinedev/core"; -import { <%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>ListInferencer } from "@refinedev/inferencer/<%- (_app.inferencer.folder || "") _%>"; - -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -import { inferencerPredefinedMeta } from "../../inferencerPredefinedMeta"; -<%_ } _%> - -export const BlogPostList: React.FC = () => { - return <<%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>ListInferencer -<%_ if (answers["data-provider"] === 'data-provider-appwrite') { _%> -fieldTransformer={(field) => { - if (["$permissions", "$updatedAt", "$createdAt"].includes(field.key)) { - return false; - } - return field; -}} -<%_ } _%> -<%_ if (answers["data-provider"] === 'data-provider-strapi-v4') { _%> -fieldTransformer={(field) => { - if (["locale", "updatedAt", "publishedAt"].includes(field.key)) { - return false; - } - - return field; -}} -<%_ } _%> -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -meta={inferencerPredefinedMeta} -<%_ } _%> -/>; -}; \ No newline at end of file diff --git a/refine-react/plugins/inferencer-headless/src/pages/blog-posts/show.tsx b/refine-react/plugins/inferencer-headless/src/pages/blog-posts/show.tsx deleted file mode 100644 index 9b39b1626..000000000 --- a/refine-react/plugins/inferencer-headless/src/pages/blog-posts/show.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { IResourceComponentsProps } from "@refinedev/core"; -import { <%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>ShowInferencer } from "@refinedev/inferencer/<%- (_app.inferencer.folder || "") _%>"; - -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -import { inferencerPredefinedMeta } from "../../inferencerPredefinedMeta"; -<%_ } _%> - -export const BlogPostShow: React.FC = () => { - return <<%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>ShowInferencer -<%_ if (answers["data-provider"] === 'data-provider-appwrite') { _%> -fieldTransformer={(field) => { - if (["$permissions", "$updatedAt", "$createdAt"].includes(field.key)) { - return false; - } - return field; -}} -<%_ } _%> -<%_ if (answers["data-provider"] === 'data-provider-strapi-v4') { _%> -fieldTransformer={(field) => { - if (["locale", "updatedAt", "publishedAt"].includes(field.key)) { - return false; - } - - return field; -}} -<%_ } _%> -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -meta={inferencerPredefinedMeta} -<%_ } _%> -/>; -}; diff --git a/refine-react/plugins/inferencer-headless/src/pages/categories/create.tsx b/refine-react/plugins/inferencer-headless/src/pages/categories/create.tsx deleted file mode 100644 index 0d2e911fc..000000000 --- a/refine-react/plugins/inferencer-headless/src/pages/categories/create.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { IResourceComponentsProps } from "@refinedev/core"; -import { <%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>CreateInferencer } from "@refinedev/inferencer/<%- (_app.inferencer.folder || "") _%>"; - -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -import { inferencerPredefinedMeta } from "../../inferencerPredefinedMeta"; -<%_ } _%> - -export const CategoryCreate: React.FC = () => { - return <<%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>CreateInferencer - <%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> - meta={inferencerPredefinedMeta} - <%_ } _%> - <%_ if (answers["data-provider"] === 'data-provider-strapi-v4') { _%> - fieldTransformer={(field) => { - if (["locale", "updatedAt", "publishedAt"].includes(field.key)) { - return false; - } - return field; - }} - <%_ } _%> - <%_ if (answers["data-provider"] === 'data-provider-appwrite') { _%> - fieldTransformer={(field) => { - if (["$permissions", "$updatedAt", "$createdAt"].includes(field.key)) { - return false; - } - return field; - }} - <%_ } _%> - />; -}; diff --git a/refine-react/plugins/inferencer-headless/src/pages/categories/edit.tsx b/refine-react/plugins/inferencer-headless/src/pages/categories/edit.tsx deleted file mode 100644 index 61e1659b6..000000000 --- a/refine-react/plugins/inferencer-headless/src/pages/categories/edit.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { IResourceComponentsProps } from "@refinedev/core"; -import { <%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>EditInferencer } from "@refinedev/inferencer/<%- (_app.inferencer.folder || "") _%>"; - -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -import { inferencerPredefinedMeta } from "../../inferencerPredefinedMeta"; -<%_ } _%> - -export const CategoryEdit: React.FC = () => { - return <<%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>EditInferencer - <%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> - meta={inferencerPredefinedMeta} - <%_ } _%> - <%_ if (answers["data-provider"] === 'data-provider-strapi-v4') { _%> - fieldTransformer={(field) => { - if (["locale", "updatedAt", "publishedAt"].includes(field.key)) { - return false; - } - return field; - }} - <%_ } _%> - <%_ if (answers["data-provider"] === 'data-provider-appwrite') { _%> - fieldTransformer={(field) => { - if (["$permissions", "$updatedAt", "$createdAt"].includes(field.key)) { - return false; - } - return field; - }} - <%_ } _%> - />; -}; diff --git a/refine-react/plugins/inferencer-headless/src/pages/categories/index.ts b/refine-react/plugins/inferencer-headless/src/pages/categories/index.ts deleted file mode 100644 index 0690176f7..000000000 --- a/refine-react/plugins/inferencer-headless/src/pages/categories/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { CategoryList } from "./list"; -export { CategoryCreate } from "./create"; -export { CategoryEdit } from "./edit"; -export { CategoryShow } from "./show"; diff --git a/refine-react/plugins/inferencer-headless/src/pages/categories/list.tsx b/refine-react/plugins/inferencer-headless/src/pages/categories/list.tsx deleted file mode 100644 index 47bda7a5a..000000000 --- a/refine-react/plugins/inferencer-headless/src/pages/categories/list.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { IResourceComponentsProps } from "@refinedev/core"; -import { <%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>ListInferencer } from "@refinedev/inferencer/<%- (_app.inferencer.folder || "") _%>"; - -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -import { inferencerPredefinedMeta } from "../../inferencerPredefinedMeta"; -<%_ } _%> - -export const CategoryList: React.FC = () => { - return <<%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>ListInferencer - <%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> - meta={inferencerPredefinedMeta} - <%_ } _%> - <%_ if (answers["data-provider"] === 'data-provider-strapi-v4') { _%> - fieldTransformer={(field) => { - if (["locale", "updatedAt", "publishedAt"].includes(field.key)) { - return false; - } - return field; - }} - <%_ } _%> - <%_ if (answers["data-provider"] === 'data-provider-appwrite') { _%> - fieldTransformer={(field) => { - if (["$permissions", "$updatedAt", "$createdAt"].includes(field.key)) { - return false; - } - return field; - }} - <%_ } _%> - />; -}; diff --git a/refine-react/plugins/inferencer-headless/src/pages/categories/show.tsx b/refine-react/plugins/inferencer-headless/src/pages/categories/show.tsx deleted file mode 100644 index f0dc53b19..000000000 --- a/refine-react/plugins/inferencer-headless/src/pages/categories/show.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { IResourceComponentsProps } from "@refinedev/core"; -import { <%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>ShowInferencer } from "@refinedev/inferencer/<%- (_app.inferencer.folder || "") _%>"; - -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -import { inferencerPredefinedMeta } from "../../inferencerPredefinedMeta"; -<%_ } _%> - -export const CategoryShow: React.FC = () => { - return <<%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>ShowInferencer - <%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> - meta={inferencerPredefinedMeta} - <%_ } _%> - <%_ if (answers["data-provider"] === 'data-provider-strapi-v4') { _%> - fieldTransformer={(field) => { - if (["locale", "updatedAt", "publishedAt"].includes(field.key)) { - return false; - } - return field; - }} - <%_ } _%> - <%_ if (answers["data-provider"] === 'data-provider-appwrite') { _%> - fieldTransformer={(field) => { - if (["$permissions", "$updatedAt", "$createdAt"].includes(field.key)) { - return false; - } - return field; - }} - <%_ } _%> - />; -}; diff --git a/refine-react/plugins/inferencer/extend.js b/refine-react/plugins/inferencer/extend.js deleted file mode 100644 index 728650a1f..000000000 --- a/refine-react/plugins/inferencer/extend.js +++ /dev/null @@ -1,49 +0,0 @@ -const base = { - _app: { - import: [], - refineProps: [], - refineAntdImports: [], - refineImports: [], - wrapper: [], - inferencer: {}, - localImport: [], - }, -}; - -module.exports = { - extend(answers) { - const inferencerPackage = [ - { - ui: "antd", - folder: "antd", - componentPrefix: "Antd", - }, - { - ui: "chakra", - folder: "chakra-ui", - componentPrefix: "ChakraUI", - }, - { - ui: "no", - folder: "headless", - componentPrefix: "Headless", - }, - { - ui: "mantine", - folder: "mantine", - componentPrefix: "Mantine", - }, - { - ui: "mui", - folder: "mui", - componentPrefix: "Mui", - }, - ]; - - base._app.inferencer = inferencerPackage.find( - (item) => item.ui === answers["ui-framework"], - ); - - return base; - }, -}; diff --git a/refine-react/plugins/inferencer/meta.json b/refine-react/plugins/inferencer/meta.json deleted file mode 100644 index 96a5431bf..000000000 --- a/refine-react/plugins/inferencer/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Inferencer", - "url": "https://refine.dev/docs/packages/documentation/inferencer" -} diff --git a/refine-react/plugins/inferencer/src/pages/blog-posts/create.tsx b/refine-react/plugins/inferencer/src/pages/blog-posts/create.tsx deleted file mode 100644 index b9aa6cc2c..000000000 --- a/refine-react/plugins/inferencer/src/pages/blog-posts/create.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { IResourceComponentsProps } from "@refinedev/core"; -import { <%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>CreateInferencer } from "@refinedev/inferencer/<%- (_app.inferencer.folder || "") _%>"; - -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -import { inferencerPredefinedMeta } from "../../inferencerPredefinedMeta"; -<%_ } _%> - -export const BlogPostCreate: React.FC = () => { - return <<%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>CreateInferencer -<%_ if (answers["data-provider"] === 'data-provider-appwrite') { _%> -fieldTransformer={(field) => { - if (["$permissions", "$updatedAt", "$createdAt"].includes(field.key)) { - return false; - } - return field; -}} -<%_ } _%> -<%_ if (answers["data-provider"] === 'data-provider-strapi-v4') { _%> -fieldTransformer={(field) => { - if (["locale", "updatedAt", "publishedAt"].includes(field.key)) { - return false; - } - - return field; -}} -<%_ } _%> -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -meta={inferencerPredefinedMeta} -<%_ } _%> -/>; -}; diff --git a/refine-react/plugins/inferencer/src/pages/blog-posts/edit.tsx b/refine-react/plugins/inferencer/src/pages/blog-posts/edit.tsx deleted file mode 100644 index e99e64f75..000000000 --- a/refine-react/plugins/inferencer/src/pages/blog-posts/edit.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { IResourceComponentsProps } from "@refinedev/core"; -import { <%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>EditInferencer } from "@refinedev/inferencer/<%- (_app.inferencer.folder || "") _%>"; - -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -import { inferencerPredefinedMeta } from "../../inferencerPredefinedMeta"; -<%_ } _%> - -export const BlogPostEdit: React.FC = () => { - return <<%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>EditInferencer -<%_ if (answers["data-provider"] === 'data-provider-appwrite') { _%> -fieldTransformer={(field) => { - if (["$permissions", "$updatedAt", "$createdAt"].includes(field.key)) { - return false; - } - return field; -}} -<%_ } _%> -<%_ if (answers["data-provider"] === 'data-provider-strapi-v4') { _%> -fieldTransformer={(field) => { - if (["locale", "updatedAt", "publishedAt"].includes(field.key)) { - return false; - } - - return field; -}} -<%_ } _%> -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -meta={inferencerPredefinedMeta} -<%_ } _%> -/>; -}; diff --git a/refine-react/plugins/inferencer/src/pages/blog-posts/index.ts b/refine-react/plugins/inferencer/src/pages/blog-posts/index.ts deleted file mode 100644 index 165f05e2c..000000000 --- a/refine-react/plugins/inferencer/src/pages/blog-posts/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { BlogPostList } from "./list"; -export { BlogPostCreate } from "./create"; -export { BlogPostEdit } from "./edit"; -export { BlogPostShow } from "./show"; diff --git a/refine-react/plugins/inferencer/src/pages/blog-posts/list.tsx b/refine-react/plugins/inferencer/src/pages/blog-posts/list.tsx deleted file mode 100644 index d0e297d08..000000000 --- a/refine-react/plugins/inferencer/src/pages/blog-posts/list.tsx +++ /dev/null @@ -1,32 +0,0 @@ - -import { IResourceComponentsProps } from "@refinedev/core"; -import { <%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>ListInferencer } from "@refinedev/inferencer/<%- (_app.inferencer.folder || "") _%>"; - -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -import { inferencerPredefinedMeta } from "../../inferencerPredefinedMeta"; -<%_ } _%> - -export const BlogPostList: React.FC = () => { - return <<%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>ListInferencer -<%_ if (answers["data-provider"] === 'data-provider-appwrite') { _%> -fieldTransformer={(field) => { - if (["$permissions", "$updatedAt", "$createdAt"].includes(field.key)) { - return false; - } - return field; -}} -<%_ } _%> -<%_ if (answers["data-provider"] === 'data-provider-strapi-v4') { _%> -fieldTransformer={(field) => { - if (["locale", "updatedAt", "publishedAt"].includes(field.key)) { - return false; - } - - return field; -}} -<%_ } _%> -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -meta={inferencerPredefinedMeta} -<%_ } _%> -/>; -}; \ No newline at end of file diff --git a/refine-react/plugins/inferencer/src/pages/blog-posts/show.tsx b/refine-react/plugins/inferencer/src/pages/blog-posts/show.tsx deleted file mode 100644 index 9b39b1626..000000000 --- a/refine-react/plugins/inferencer/src/pages/blog-posts/show.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { IResourceComponentsProps } from "@refinedev/core"; -import { <%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>ShowInferencer } from "@refinedev/inferencer/<%- (_app.inferencer.folder || "") _%>"; - -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -import { inferencerPredefinedMeta } from "../../inferencerPredefinedMeta"; -<%_ } _%> - -export const BlogPostShow: React.FC = () => { - return <<%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>ShowInferencer -<%_ if (answers["data-provider"] === 'data-provider-appwrite') { _%> -fieldTransformer={(field) => { - if (["$permissions", "$updatedAt", "$createdAt"].includes(field.key)) { - return false; - } - return field; -}} -<%_ } _%> -<%_ if (answers["data-provider"] === 'data-provider-strapi-v4') { _%> -fieldTransformer={(field) => { - if (["locale", "updatedAt", "publishedAt"].includes(field.key)) { - return false; - } - - return field; -}} -<%_ } _%> -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -meta={inferencerPredefinedMeta} -<%_ } _%> -/>; -}; diff --git a/refine-react/plugins/inferencer/src/pages/categories/create.tsx b/refine-react/plugins/inferencer/src/pages/categories/create.tsx deleted file mode 100644 index 0d2e911fc..000000000 --- a/refine-react/plugins/inferencer/src/pages/categories/create.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { IResourceComponentsProps } from "@refinedev/core"; -import { <%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>CreateInferencer } from "@refinedev/inferencer/<%- (_app.inferencer.folder || "") _%>"; - -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -import { inferencerPredefinedMeta } from "../../inferencerPredefinedMeta"; -<%_ } _%> - -export const CategoryCreate: React.FC = () => { - return <<%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>CreateInferencer - <%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> - meta={inferencerPredefinedMeta} - <%_ } _%> - <%_ if (answers["data-provider"] === 'data-provider-strapi-v4') { _%> - fieldTransformer={(field) => { - if (["locale", "updatedAt", "publishedAt"].includes(field.key)) { - return false; - } - return field; - }} - <%_ } _%> - <%_ if (answers["data-provider"] === 'data-provider-appwrite') { _%> - fieldTransformer={(field) => { - if (["$permissions", "$updatedAt", "$createdAt"].includes(field.key)) { - return false; - } - return field; - }} - <%_ } _%> - />; -}; diff --git a/refine-react/plugins/inferencer/src/pages/categories/edit.tsx b/refine-react/plugins/inferencer/src/pages/categories/edit.tsx deleted file mode 100644 index 88c105855..000000000 --- a/refine-react/plugins/inferencer/src/pages/categories/edit.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { IResourceComponentsProps } from "@refinedev/core"; -import { <%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>EditInferencer } from "@refinedev/inferencer/<%- (_app.inferencer.folder || "") _%>"; - -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -import { inferencerPredefinedMeta } from "../../inferencerPredefinedMeta"; -<%_ } _%> - - -export const CategoryEdit: React.FC = () => { - return <<%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>EditInferencer - <%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> - meta={inferencerPredefinedMeta} - <%_ } _%> - <%_ if (answers["data-provider"] === 'data-provider-strapi-v4') { _%> - fieldTransformer={(field) => { - if (["locale", "updatedAt", "publishedAt"].includes(field.key)) { - return false; - } - return field; - }} - <%_ } _%> - <%_ if (answers["data-provider"] === 'data-provider-appwrite') { _%> - fieldTransformer={(field) => { - if (["$permissions", "$updatedAt", "$createdAt"].includes(field.key)) { - return false; - } - return field; - }} - <%_ } _%> - />; -}; diff --git a/refine-react/plugins/inferencer/src/pages/categories/index.ts b/refine-react/plugins/inferencer/src/pages/categories/index.ts deleted file mode 100644 index 0690176f7..000000000 --- a/refine-react/plugins/inferencer/src/pages/categories/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { CategoryList } from "./list"; -export { CategoryCreate } from "./create"; -export { CategoryEdit } from "./edit"; -export { CategoryShow } from "./show"; diff --git a/refine-react/plugins/inferencer/src/pages/categories/list.tsx b/refine-react/plugins/inferencer/src/pages/categories/list.tsx deleted file mode 100644 index 47bda7a5a..000000000 --- a/refine-react/plugins/inferencer/src/pages/categories/list.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { IResourceComponentsProps } from "@refinedev/core"; -import { <%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>ListInferencer } from "@refinedev/inferencer/<%- (_app.inferencer.folder || "") _%>"; - -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -import { inferencerPredefinedMeta } from "../../inferencerPredefinedMeta"; -<%_ } _%> - -export const CategoryList: React.FC = () => { - return <<%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>ListInferencer - <%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> - meta={inferencerPredefinedMeta} - <%_ } _%> - <%_ if (answers["data-provider"] === 'data-provider-strapi-v4') { _%> - fieldTransformer={(field) => { - if (["locale", "updatedAt", "publishedAt"].includes(field.key)) { - return false; - } - return field; - }} - <%_ } _%> - <%_ if (answers["data-provider"] === 'data-provider-appwrite') { _%> - fieldTransformer={(field) => { - if (["$permissions", "$updatedAt", "$createdAt"].includes(field.key)) { - return false; - } - return field; - }} - <%_ } _%> - />; -}; diff --git a/refine-react/plugins/inferencer/src/pages/categories/show.tsx b/refine-react/plugins/inferencer/src/pages/categories/show.tsx deleted file mode 100644 index fc2e25210..000000000 --- a/refine-react/plugins/inferencer/src/pages/categories/show.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { IResourceComponentsProps } from "@refinedev/core"; -import { <%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>ShowInferencer } from "@refinedev/inferencer/<%- (_app.inferencer.folder || "") _%>"; - -<%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> -import { inferencerPredefinedMeta } from "../../inferencerPredefinedMeta"; -<%_ } _%> - -export const CategoryShow: React.FC = () => { - return <<%- ((_app.inferencer ? _app.inferencer.componentPrefix : "") || "") _%>ShowInferencer - <%_ if (answers["data-provider"] === 'data-provider-hasura') { _%> - meta={inferencerPredefinedMeta} - <%_ } _%> - <%_ if (answers["data-provider"] === 'data-provider-appwrite') { _%> - fieldTransformer={(field) => { - if (["$permissions", "$updatedAt", "$createdAt"].includes(field.key)) { - return false; - } - return field; - }} - <%_ } _%> - <%_ if (answers["data-provider"] === 'data-provider-strapi-v4') { _%> - fieldTransformer={(field) => { - if (["locale", "updatedAt", "publishedAt"].includes(field.key)) { - return false; - } - - return field; - }} - <%_ } _%> - />; -}; diff --git a/refine-react/plugins/mantine/extend.js b/refine-react/plugins/mantine/extend.js deleted file mode 100644 index 8a1c25634..000000000 --- a/refine-react/plugins/mantine/extend.js +++ /dev/null @@ -1,62 +0,0 @@ -const base = { - _app: { - refineProps: ["notificationProvider={notificationProvider}"], - import: [ - `import { MantineProvider, Global, ColorSchemeProvider, ColorScheme } from "@mantine/core";`, - `import { NotificationsProvider } from "@mantine/notifications";`, - `import { useLocalStorage } from "@mantine/hooks";`, - ], - refineMantineImports: [ - "notificationProvider", - "RefineThemes", - "ThemedLayoutV2", - ], - innerHooks: [ - `const [colorScheme, setColorScheme] = useLocalStorage({ - key: "mantine-color-scheme", - defaultValue: "light", - getInitialValueInEffect: true, - });`, - ], - inner: [ - `const toggleColorScheme = (value?: ColorScheme) => - setColorScheme(value || (colorScheme === "dark" ? "light" : "dark"));`, - ], - localImport: [`import { Header } from "./components/header";`], - }, -}; - -module.exports = { - extend(answers) { - const selectedTheme = answers["theme"] ? answers["theme"] : "Blue"; - - return { - ...base, - _app: { - ...base._app, - wrapper: [ - [ - "", - "", - ], - [ - "{/* You can change the theme colors here. example: theme={{ ...RefineThemes.Magenta, colorScheme:colorScheme }} */}", - "", - ], - [ - ``, - "", - ], - [ - ``, - ``, - ], - [ - ``, - ``, - ], - ], - }, - }; - }, -}; diff --git a/refine-react/plugins/mantine/meta.json b/refine-react/plugins/mantine/meta.json deleted file mode 100644 index 23d812719..000000000 --- a/refine-react/plugins/mantine/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Mantine", - "url": "#" -} diff --git a/refine-react/plugins/mantine/package.json b/refine-react/plugins/mantine/package.json deleted file mode 100644 index 74edddced..000000000 --- a/refine-react/plugins/mantine/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "dependencies": { - "@refinedev/mantine": "^2.29.1", - "@refinedev/react-table": "^5.6.5", - "@tabler/icons": "^1.1.0", - "@emotion/react": "^11.8.2", - "@mantine/core": "^5.10.4", - "@mantine/hooks": "^5.10.4", - "@mantine/form": "^5.10.4", - "@mantine/notifications": "^5.10.4" - } -} diff --git a/refine-react/plugins/mantine/src/components/header/index.tsx b/refine-react/plugins/mantine/src/components/header/index.tsx deleted file mode 100644 index db69a8eef..000000000 --- a/refine-react/plugins/mantine/src/components/header/index.tsx +++ /dev/null @@ -1,95 +0,0 @@ -import { - ActionIcon, - Avatar, - Flex, - Group, - Header as MantineHeader, - Sx, - Title, - useMantineColorScheme, - useMantineTheme, -} from "@mantine/core"; -import { useGetIdentity } from "@refinedev/core"; -import { - HamburgerMenu, - RefineThemedLayoutV2HeaderProps, -} from "@refinedev/mantine"; -import { IconMoonStars, IconSun } from "@tabler/icons"; -import React from "react"; - -type IUser = { - id: number; - name: string; - avatar: string; -}; - -export const Header: React.FC = ({ - isSticky, -}) => { - const { data: user } = useGetIdentity(); - - const theme = useMantineTheme(); - - const { colorScheme, toggleColorScheme } = useMantineColorScheme(); - const dark = colorScheme === "dark"; - - const borderColor = dark ? theme.colors.dark[6] : theme.colors.gray[2]; - - let stickyStyles: Sx = {}; - if (isSticky) { - stickyStyles = { - position: `sticky`, - top: 0, - zIndex: 1, - }; - } - - return ( - - - - - toggleColorScheme()} - title="Toggle color scheme" - > - {dark ? ( - - ) : ( - - )} - - {(user?.name || user?.avatar) && ( - - {user?.name && ( - {user?.name} - )} - - - )} - - - - ); -}; diff --git a/refine-react/plugins/mantine/src/components/index.ts b/refine-react/plugins/mantine/src/components/index.ts deleted file mode 100644 index 9727c415d..000000000 --- a/refine-react/plugins/mantine/src/components/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { Header } from "./header" \ No newline at end of file diff --git a/refine-react/plugins/mui/extend.js b/refine-react/plugins/mui/extend.js deleted file mode 100644 index fabb71a34..000000000 --- a/refine-react/plugins/mui/extend.js +++ /dev/null @@ -1,33 +0,0 @@ -const base = { - _app: { - refineProps: ["notificationProvider={notificationProvider}"], - import: [ - `import GlobalStyles from "@mui/material/GlobalStyles";`, - `import CssBaseline from "@mui/material/CssBaseline";`, - ], - refineMuiImports: [ - "notificationProvider", - "RefineSnackbarProvider", - "ThemedLayoutV2", - ], - localImport: [ - `import { ColorModeContextProvider } from "./contexts/color-mode";`, - `import { Header } from "./components/header";`, - ], - wrapper: [ - ["", ""], - [``, ``], - [ - ``, - ``, - ], - [``, ``], - ], - }, -}; - -module.exports = { - extend() { - return base; - }, -}; diff --git a/refine-react/plugins/mui/meta.json b/refine-react/plugins/mui/meta.json deleted file mode 100644 index d22dbdb58..000000000 --- a/refine-react/plugins/mui/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Material UI", - "url": "https://refine.dev/docs/ui-frameworks/mui/tutorial/" -} diff --git a/refine-react/plugins/mui/package.json b/refine-react/plugins/mui/package.json deleted file mode 100644 index f5282bb20..000000000 --- a/refine-react/plugins/mui/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "dependencies": { - "@refinedev/mui": "^5.14.1", - "@refinedev/react-hook-form": "^4.8.13", - "@mui/icons-material": "^5.8.3", - "@emotion/react": "^11.8.2", - "@emotion/styled": "^11.8.1", - "@mui/lab": "^5.0.0-alpha.85", - "@mui/material": "^5.8.6", - "@mui/x-data-grid": "^6.6.0", - "react-hook-form": "^7.30.0" - } -} diff --git a/refine-react/plugins/mui/src/components/header/index.tsx b/refine-react/plugins/mui/src/components/header/index.tsx deleted file mode 100644 index 2926e292b..000000000 --- a/refine-react/plugins/mui/src/components/header/index.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import DarkModeOutlined from "@mui/icons-material/DarkModeOutlined"; -import LightModeOutlined from "@mui/icons-material/LightModeOutlined"; -import AppBar from "@mui/material/AppBar"; -import Avatar from "@mui/material/Avatar"; -import IconButton from "@mui/material/IconButton"; -import Stack from "@mui/material/Stack"; -import Toolbar from "@mui/material/Toolbar"; -import Typography from "@mui/material/Typography"; -import { useGetIdentity } from "@refinedev/core"; -import { HamburgerMenu, RefineThemedLayoutV2HeaderProps } from "@refinedev/mui"; -import React, { useContext } from "react"; -import { ColorModeContext } from "../../contexts/color-mode"; - -type IUser = { - id: number; - name: string; - avatar: string; -}; - -export const Header: React.FC = ({ - isSticky = true, -}) => { - const { mode, setMode } = useContext(ColorModeContext); - - const { data: user } = useGetIdentity(); - - return ( - - - - - - { - setMode(); - }} - > - {mode === "dark" ? ( - - ) : ( - - )} - - - {(user?.avatar || user?.name) && ( - - {user?.name && ( - - {user?.name} - - )} - - - )} - - - - - ); -}; diff --git a/refine-react/plugins/mui/src/components/index.ts b/refine-react/plugins/mui/src/components/index.ts deleted file mode 100644 index e8e15303c..000000000 --- a/refine-react/plugins/mui/src/components/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { Header } from "./header" ; \ No newline at end of file diff --git a/refine-react/plugins/mui/src/contexts/color-mode/index.tsx b/refine-react/plugins/mui/src/contexts/color-mode/index.tsx deleted file mode 100644 index 75bbad44b..000000000 --- a/refine-react/plugins/mui/src/contexts/color-mode/index.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import React, { - PropsWithChildren, - createContext, - useEffect, - useState, -} from "react"; -import { ThemeProvider } from "@mui/material/styles"; -import { RefineThemes } from "@refinedev/mui"; - -type ColorModeContextType = { - mode: string; - setMode: () => void; -}; - -export const ColorModeContext = createContext( - {} as ColorModeContextType, -); - -export const ColorModeContextProvider: React.FC = ({ - children, -}) => { - const colorModeFromLocalStorage = localStorage.getItem("colorMode"); - const isSystemPreferenceDark = window?.matchMedia( - "(prefers-color-scheme: dark)", - ).matches; - - const systemPreference = isSystemPreferenceDark ? "dark" : "light"; - const [mode, setMode] = useState( - colorModeFromLocalStorage || systemPreference, - ); - - useEffect(() => { - window.localStorage.setItem("colorMode", mode); - }, [mode]); - - const setColorMode = () => { - if (mode === "light") { - setMode("dark"); - } else { - setMode("light"); - } - }; - - return ( - - : RefineThemes.<%= selectedTheme %>Dark - } - > - {children} - - - ); -}; diff --git a/refine-react/plugins/react-router-v6/extend.js b/refine-react/plugins/react-router-v6/extend.js deleted file mode 100644 index 754d2fc0c..000000000 --- a/refine-react/plugins/react-router-v6/extend.js +++ /dev/null @@ -1,18 +0,0 @@ -const base = { - _app: { - import: [ - `import { BrowserRouter, Route, Routes, Outlet } from "react-router-dom";`, - `import routerBindings, { NavigateToResource, CatchAllNavigate, UnsavedChangesNotifier, DocumentTitleHandler } from "@refinedev/react-router-v6";` - ], - refineProps: [], - }, -}; -module.exports = { - extend(answers) { - if (answers["data-provider"] !== "data-provider-supabase") { - base._app.refineProps.push("routerProvider={routerBindings}"); - } - - return base; - }, -}; diff --git a/refine-react/plugins/react-router-v6/meta.json b/refine-react/plugins/react-router-v6/meta.json deleted file mode 100644 index 231716f65..000000000 --- a/refine-react/plugins/react-router-v6/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "React Router", - "url": "https://refine.dev/docs/core/providers/router-provider/" -} diff --git a/refine-react/plugins/react-router-v6/package.json b/refine-react/plugins/react-router-v6/package.json deleted file mode 100644 index ff98a789e..000000000 --- a/refine-react/plugins/react-router-v6/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "@refinedev/react-router-v6": "^4.5.5" - } -} diff --git a/refine-react/prompt.js b/refine-react/prompt.js deleted file mode 100644 index 9d73f0abb..000000000 --- a/refine-react/prompt.js +++ /dev/null @@ -1,331 +0,0 @@ -module.exports = { - prompts: [ - { - name: "data-provider", - message: "Choose your backend service to connect:", - type: "select", - pageSize: 2, - choices: [ - { - message: "REST API", - name: "data-provider-custom-json-rest", - hint: "Installs REST API Data Provider.", - }, - { - message: "GraphQL API", - name: "data-provider-graphql", - hint: "Installs GraphQL API Data Provider.", - }, - { - message: "Strapi v4", - name: "data-provider-strapi-v4", - hint: "Installs Strapi v4 Data Provider.", - }, - { - message: "nestjsx-crud", - name: "data-provider-nestjsx-crud", - hint: "Installs Nestjsx-crud Data Provider.", - }, - { - message: "Airtable", - name: "data-provider-airtable", - hint: "Installs Airtable Data Provider.", - }, - { - message: "Supabase", - name: "data-provider-supabase", - hint: "Installs Supabase Data Provider.", - }, - { - message: "Appwrite", - name: "data-provider-appwrite", - hint: "Installs Appwrite Data Provider.", - }, - { - message: "Hasura", - name: "data-provider-hasura", - hint: "Installs Hasura Data Provider.", - }, - { - message: "Medusa", - name: "data-provider-medusa", - hint: "Installs Medusa Data Provider.", - }, - ], - default: "data-provider-custom-json-rest", - }, - { - name: "ui-framework", - message: "Do you want to use a UI Framework?:", - type: "select", - pageSize: 2, - choices: [ - { - message: "Headless", - name: "no", - hint: "No UI framework package will be installed.", - }, - { - message: "Ant Design", - name: "antd", - hint: "Installs Ant Design package.", - }, - { - message: "Material UI", - name: "mui", - hint: "Installs Material UI package.", - }, - { - message: "Mantine", - name: "mantine", - hint: "Installs Mantine package.", - }, - { - message: "Chakra UI", - name: "chakra", - hint: "Installs Chakra UI package.", - }, - ], - default: "no", - }, - { - name: "inferencer", - message: "Do you want to add example pages?:", - type: "select", - choices: [ - { - message: "No", - name: "no", - hint: "No examples will be installed.", - }, - { - message: "Yes (Recommended)", - name: "inferencer", - hint: "Installs example pages.", - }, - ], - skip: ({ answers }) => - answers["ui-framework"] === "no" || - answers["data-provider"] === "data-provider-graphql" || - answers["data-provider"] === "data-provider-medusa", - default: "no", - }, - { - name: "inferencer-headless", - message: "Do you want to add example pages?:", - type: "select", - choices: [ - { - message: "No", - name: "no", - hint: "No examples will be installed.", - }, - { - message: "Yes (Recommended)", - name: "inferencer-headless", - hint: "Installs example pages.", - }, - ], - skip: ({ answers }) => - answers["ui-framework"] !== "no" || - answers["data-provider"] === "data-provider-graphql" || - answers["data-provider"] === "data-provider-medusa", - default: "no", - }, - { - name: "router-provider", - message: "Choose a routing library?:", - type: "select", - choices: [ - { - message: "React Router v6", - name: "react-router-v6", - hint: "React Router v6 will be used as router.", - }, - ], - default: "react-router-v6", - skip: () => true, - }, - { - name: "auth-provider", - message: "Do you need any Authentication logic?:", - type: "select", - choices: [ - { - message: "None", - name: "none", - hint: "No Auth Provider will be installed.", - }, - { - message: "Custom", - name: "auth-provider-custom", - hint: "Installs a mock Auth Provider.", - }, - { - message: "Auth0", - name: "auth-provider-auth0", - hint: "Installs Auth0 Auth Provider.", - }, - { - message: "Google", - name: "auth-provider-google", - hint: "Installs Google Auth Provider.", - }, - { - message: "Keycloak", - name: "auth-provider-keycloak", - hint: "Installs Keycloak Auth Provider.", - }, - ], - skip: ({ answers }) => - answers["data-provider"] === "data-provider-supabase" || - answers["data-provider"] === "data-provider-strapi-v4" || - answers["data-provider"] === "data-provider-appwrite" || - answers["data-provider"] === "data-provider-medusa", - default: "none", - }, - { - name: "i18n-no", - message: "Do you need i18n (Internationalization) support?:", - type: "select", - pageSize: 2, - choices: [ - { - message: "No", - name: "no", - hint: "No i18n packages will be installed.", - }, - { - message: "Yes", - name: "i18n", - hint: "Installs i18n packages.", - }, - ], - default: "no", - skip: ({ answers }) => answers["ui-framework"] !== "no", - }, - { - name: "i18n-antd", - message: "Do you need i18n (Internationalization) support?:", - type: "select", - pageSize: 2, - choices: [ - { - message: "No", - name: "no", - hint: "No i18n packages will be installed.", - }, - { - message: "Yes", - name: "i18n-antd", - hint: "Installs i18n packages.", - }, - ], - default: "no", - skip: ({ answers }) => answers["ui-framework"] !== "antd", - }, - { - name: "i18n-mui", - message: "Do you need i18n (Internationalization) support?:", - type: "select", - pageSize: 2, - choices: [ - { - message: "No", - name: "no", - hint: "No i18n packages will be installed.", - }, - { - message: "Yes", - name: "i18n-mui", - hint: "Installs i18n packages.", - }, - ], - default: "no", - skip: ({ answers }) => answers["ui-framework"] !== "mui", - }, - { - name: "i18n-mantine", - message: "Do you need i18n (Internationalization) support?:", - type: "select", - pageSize: 2, - choices: [ - { - message: "No", - name: "no", - hint: "No i18n packages will be installed.", - }, - { - message: "Yes", - name: "i18n-mantine", - hint: "Installs i18n packages.", - }, - ], - default: "no", - skip: ({ answers }) => answers["ui-framework"] !== "mantine", - }, - { - name: "i18n-chakra", - message: "Do you need i18n (Internationalization) support?:", - type: "select", - pageSize: 2, - choices: [ - { - message: "No", - name: "no", - hint: "No i18n packages will be installed.", - }, - { - message: "Yes", - name: "i18n-chakra", - hint: "Installs i18n packages.", - }, - ], - default: "no", - skip: ({ answers }) => answers["ui-framework"] !== "chakra", - }, - ], - ignores: [ - { - plugin: ["data-provider-appwrite"], - when: function (answers) { - return answers["ui-framework"] !== "antd"; - }, - pattern: ["src/utility/normalize.ts"], - }, - { - plugin: ["_base"], - when: function (answers) { - return ( - typeof answers["svg"] === "undefined" || - answers["ui-framework"] === "no" - ); - }, - pattern: ["src/components/app-icon/index.tsx"], - }, - { - plugin: ["_base"], - when: function (answers) { - return answers["ui-framework"] !== "no"; - }, - pattern: [ - "src/components/breadcrumb/index.tsx", - "src/components/layout/index.tsx", - "src/components/menu/index.tsx", - "src/App.css", - ], - }, - { - plugin: ["_base"], - when: function (answers) { - return answers[`i18n-${answers["ui-framework"]}`] === "no"; - }, - pattern: [ - "public/locales/de/common.json", - "public/locales/en/common.json", - "public/images/flags/de.svg", - "public/images/flags/en.svg", - ], - }, - ], -}; diff --git a/refine-react/template/.npmrc b/refine-react/template/.npmrc deleted file mode 100644 index acb88cc76..000000000 --- a/refine-react/template/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -legacy-peer-deps=true -strict-peer-dependencies=false \ No newline at end of file diff --git a/refine-react/template/README.MD b/refine-react/template/README.MD deleted file mode 100644 index e50ec7766..000000000 --- a/refine-react/template/README.MD +++ /dev/null @@ -1,54 +0,0 @@ -# <%= name %> -<% const refineGitUrl = "https://github.com/refinedev/refine"; -%> -<% const createRefineAppGitUrl = "https://github.com/refinedev/refine/tree/master/packages/create-refine-app"; -%> -<% const refineDocsUrl = "https://refine.dev/docs"; -%> - - -
- -This [Refine](<%- refineGitUrl %>) project was generated with [create refine-app](<%- createRefineAppGitUrl %>). - -## Getting Started - -A React Framework for building internal tools, admin panels, dashboards & B2B apps with unmatched flexibility ✨ - -Refine's hooks and components simplifies the development process and eliminates the repetitive tasks by providing industry-standard solutions for crucial aspects of a project, including authentication, access control, routing, networking, state management, and i18n. - -## Available Scripts - -### Running the development server. - -```bash - <%= pmRun %> dev -``` - -### Building for production. - -```bash - <%= pmRun %> build -``` - -### Running the production server. - -```bash - <%= pmRun %> start -``` - -## Learn More - -To learn more about **Refine**, please check out the [Documentation](<%- refineDocsUrl %>) - -<% const list = pluginsData.filter((plugin) => plugin.url.length > 0) -%> -<% for (var i = 0; i < list.length; i++ ) { -%> -<% if (list[i].url.length > 0) { -%> -- **<%= list[i].name -%>** [Docs](<%- list[i].url %>) -<% } -%> -<% } %> - -## License - -MIT diff --git a/refine-react/template/_package.json b/refine-react/template/_package.json deleted file mode 100644 index 09afa308a..000000000 --- a/refine-react/template/_package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "<%= name %>", - "version": "0.1.0", - "private": true, - "dependencies": { - "@refinedev/cli": "^2.16.21", - "@refinedev/core": "^4.46.1", - "@refinedev/devtools": "^1.1.29", - "@refinedev/inferencer": "^4.5.16", - "@refinedev/kbar": "^1.3.5", - "react": "^18.0.0", - "react-dom": "^18.0.0", - "react-scripts": "^5.0.0", - "react-router-dom": "^6.8.1" - }, - "devDependencies": { - "@types/react": "^18.0.0", - "@types/react-dom": "^18.0.0", - "@types/node": "^12.20.11", - "typescript": "^4.7.4", - "@testing-library/jest-dom": "^5.16.4", - "@testing-library/react": "^13.1.1", - "@testing-library/user-event": "^14.1.1", - "@types/jest": "^29.2.4", - "web-vitals": "^1.1.1" - }, - "scripts": { - "dev": "refine dev", - "build": "refine build", - "test": "react-scripts test", - "eject": "react-scripts eject", - "refine": "refine" - }, - "eslintConfig": { - "extends": ["react-app", "react-app/jest"] - }, - "browserslist": { - "production": [">0.2%", "not dead", "not op_mini all"], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - <%_ if (typeof projectId !== 'undefined' && projectId !== '') { _%> - }, - "refine": { - "projectId": "<%= projectId %>" - } - <%_ } else { _%> - } - <%_ } _%> -} diff --git a/refine-react/template/_tsconfig.json b/refine-react/template/_tsconfig.json deleted file mode 100644 index cfcf343e5..000000000 --- a/refine-react/template/_tsconfig.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "compilerOptions": { - "target": "es5", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], - "allowJs": true, - "strict": true, - "skipLibCheck": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true, - "module": "esnext", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "react-jsx", - "baseUrl": "src", - "paths": { - "*": ["./*"] - } - }, - "include": [ - "src" - ] -} diff --git a/refine-react/template/gitignore b/refine-react/template/gitignore deleted file mode 100644 index 24cdedf82..000000000 --- a/refine-react/template/gitignore +++ /dev/null @@ -1,23 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* \ No newline at end of file diff --git a/refine-react/template/public/favicon.ico b/refine-react/template/public/favicon.ico deleted file mode 100644 index 2f05c5f484fbf720523541519ff0cad4df752a9f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 101076 zcmeHQe{dAl9p5Mx285uHAE#mfD^W2m9Z*1oq-v|q2soYoQE3J0P_RR*R0i#gO+Xn; zEnrA9Q|Tx{MFmGiTUrn)$&CVvL`5hdgcwjzC;_8}Ku9jz?|1KZ@9l>D-d)~h@Al<; zlTUW{zWerlzn{;$z1z3n_g2#~wC`#7%FqUDGcVG#nXtZKL3sO`UKv^qyjN5d*}g^7 zn)+sFBSwU`*Icb>SKJLH2S>L1Yuc818Cri>;_>e9p=rN+B13!f?n$@z?R{BqICS4T z@3`$}XhrnGs(XUsZ%&e|kf8-nl`I)#JuCU8t2_ zrS%^c-{1N{=Q5tE%d9_`_xFYkZ|wUzzqMlbym@CYIrYqvGsVSY_OHBmYIS8pVb#W^ zr$(-sd%=Pc8S(zTx$f4&;6KJ~+%$D%L*83|Xq{CNT2(k--@Ls`Q zp`Sk4bJ~iAeN#r4wvNizdJTyCZ%2L4#!qLrp5EU6`KEtQY~EMde(1r9P^j>&?_S+r zGH&zontglnC!G6YhJN(*)oUj;@2fv}`}{2r)E%7p!$a?n%_v%~#ryY*_6Z9@_l+O1 zf92HAKF)7FxohjViqM8>b!XZdTB-xZc_qKBoi?-ebj^(FAMCw#RcOj1PqeQ3vWNET z3*!E3Y1JluwD(wRTYcN3k3RHIy=~#;Z`{>9y0Ya&ZAGYM^Nwi~n;$7GK5`i1y65AG z&9gr&nLlq*eENo)!QZMgr~j|vg9F1_Kd#rmd1-rlUiF{aR+hH4?JL9b=i_aD}ts7q2-ectM z*8VSd!j;DcwVpX#7HT>1tTyPyBKHucFpP};iV z-O%yprv-nM(5GX>nT*#?zj3(z@bHy$dTsQ%+=7e6zKxWOQ50 z#bXlr7<_t6pE>K)xf87q{!|aHpSrx}OiSKl8-{%`dFsJ~J?9i9;w79TZLh}h-{y@O zI=Af%Ey^aUhZ)G%c zj>B~rh2dZ)kb5H>pTY^SyQ3`UVVyvFvFSf=Xzj6WklJIrAhbstsXev}ckR(eXpc7k zF`ix?v;OI&hu7Y){$4YlUiGp5>7|F)-mv~&GoD`cvHt0$hu7Y){$4ZgZGE6`-x$~l zc6XEwxIrf%8;xF;J(0w+z##S6yK`KGvV+M|CUce^m^;19l2oV0VQqe{k&U zV_+ND-BFg?4{}soA?u&t%L8|;zu!fa@SpXUAWwm!tiJ*xN`%1rOOU5PQPy7p5hX%k z{Uyj#peXCFfQS+yfc{s;KoIN{0$_KAglk4oICen{P`(A>+P@D4S^xZA9=K)w{Vt+} z|E#|Rc?uL|{S^>VA_Uf7f;~s*Uf2XNaq9E(9gp8dIg7xn-bxIUu{gsfh(?PKQou*ESf~>z1GIlx$Y5mIs z0i8gn9g7r%V;7L1a})6Xzw5O>+GPFndwJI1?+VKK&-%;p=l9aAzuy&<^PlyX zaMT#w}TWPp%6 zpG#tK)(bj;kKP~oDuw@iHbJNG_TfUE!hwy~y-Wde6DmoR=U$)_Aj#VO#uCag!1~Ma=l9aAzuy&<^PlyXy?nr>B%U1jicVok_Ik)Mp-=^OcP!3&4zA)?bc4 zzn5nH{jOkY{nwXfT}LB#n7-5pUbC~0oFgY{HMBh)<4w> zq_%$6Keha)x^~t-)e5Axe%3#={HMBh)}K~DPm34&C_3Wtc9^2510HW1!3zYWXxmaC zQa^7;S_Ja}O~D``Oo)PfKuFOKps~T*;^*I>#5_SJn;&dj@G=i?w6$)vjS)wq$2HHk zuK}Wq01E&a+FN20cOAx24J4#g*Gh9t%JGY1?1H0%WRkj+ZH@=vI{G* z#g1IqVn-fqu_G5&?6}^Au6c53j=y`ge`w!jcH|s~b}V8zYzxS}5%w2x0=A+mSiFLfLwu5hC?6@w*j_X$JxE{+N*oWh{a}d=Y+X3s} zPvjt0d+KUCwAU*g2*S3A0Bl=`zI-dVIem|Z61nsdMu>LdywziL-1HZNZ@<0$`h~h6<0bKwcJ)}o0$u6*g<9Gi4 zP4Dxcs6DO=+T%LwPcvX^`}kS#Tl-&<9fTO7SezZu1<=vM=f8AdfelaP1Ys`uD1`66 zwEX=m#*XVk?6}VH(+t?O$F?A9kL#>|dY}InU0My#PP1@y?bQQCynSfGP!YlXHw8qT zd~ry=2xt%0Hl(}$LhQ(c7(1?uvE#ZJJFbhdU?gi^Es`~=dyNq4y)t2t6hJFqig8!oGXss z_FQMy-~JqH)!M)F)8U-g-T53R=X0B!&uMZ#m&y4YCTD%=w$1U|pX+hV$z2m&?_IcW!^RheUVNbWuyVIWz^ICHJ_UAaT{?2DsDAoR*p9kl5$9Y@q^E5j5 zS8bc)ch1|&`ipawdfndb(-WL`%bc^oW!b1{nOM$ksbw}Ac4BEvk^pvpEEh zr5msDzORSr2Z0P397~)hVgz71z?vuG`>??;W*`k2fd0?ud;+$y^tN&I))@M93xWOj zUJ=Nl5yqt3#$yX(v2Ek9qhqjz@z>sa9+=5cTxLc|Kk+Mm49J8kK3Va zV_3xebr18_*#F2Fx^&=Q91|jp2XSpb;us+I-;E~neOvqYJOARC3Sm5j8v(X41mgIC zRGoj=|M2*oRPit5O(tFIvb67V}}nTu?C&TFimAI6_qU@;FlBwRz8lE zOJwB{8978!2alt0s_KX9^GHsNl@Alig|YHr!Z|RJ{FgXFNobc;)erTWc^%=Lh)6z% z(|Ie0Ba*-2w0Cwp4eB@Z63m3AcXIKNBSU9&&h?29)0q0K&M ztN%ID_v!qcB)V<&E2pS_(_gbs((F$)`%=w*RI?A&>_0WjC2N`T`pt3LW`AI`FEHE> zX!Zd{`u~y@w|N|^PcKFFn|_$fXkSpcAIp5-t7Wq4*UcA>_CjE{4C2CfBM8DW0bp0p z`CuN`T(%YJIsp4Auv=mCg zg8lKj(sY7Mjl|e{`kt{Z$e>?VBCS!#`hw8C*t=pei!5SFn$M{ z_Z{8JiSOfg3VxsAcNu<<;dfXf_nnM$GM - - - - - - - - - - - - - refine - Build your React-based CRUD applications, without constraints. - - <%- (_app.publicScripts || []).join("\n") _%> - - - -
- - diff --git a/refine-react/template/src/App.tsx b/refine-react/template/src/App.tsx deleted file mode 100644 index 6196e4e68..000000000 --- a/refine-react/template/src/App.tsx +++ /dev/null @@ -1,273 +0,0 @@ -import { - Refine, - GitHubBanner, - WelcomePage, - <%- (_app.refineImports || []).join("\n,") _%>, -} from '@refinedev/core'; -import { DevtoolsPanel, DevtoolsProvider } from "@refinedev/devtools"; -import { RefineKbar, RefineKbarProvider } from "@refinedev/kbar"; - -<%_ if (answers["ui-framework"] === 'antd') { _%> -import { <%- (_app.refineAntdImports || []).join("\n,") _%> } from '@refinedev/antd'; -import "@refinedev/antd/dist/reset.css"; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'mui') { _%> - import { <%- (_app.refineMuiImports || []).join("\n,") _%> } from '@refinedev/mui'; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'mantine') { _%> - import { <%- (_app.refineMantineImports || []).join("\n,") _%> } from '@refinedev/mantine'; -<%_ } _%> -<%_ if (answers["ui-framework"] === 'chakra') { _%> - import { <%- (_app.refineChakraImports || []).join("\n,") _%> } from '@refinedev/chakra-ui'; -<%_ } _%> - -<%- (_app.import || []).join("\n") _%> - -<%- (_app.localImport || []).join("\n") _%> - -<%- (_app.relativeImport || []).join("\n") _%> - -<%- (_app.afterImport || []).join("\n") _%> - -<% - var top = _app.wrapper.map(wrapper => wrapper[0] || ""); - var bottom = _app.wrapper.map(wrapper => wrapper[1] || "").reverse(); -%> - - -function App() { - <%- (_app.innerHooks || []).join("\n") %> - - <%- (_app.inner || []).join("\n") %> - - return ( - - - - <%- top.join("\n") %> - - - <%_ if (_app.hasRoutes === true) { _%> - resources={[ - <%_ if (answers["data-provider"] === 'data-provider-strapi-v4') { _%> - { - name: "blog-posts", - list: "/blog-posts", - create: "/blog-posts/create", - edit: "/blog-posts/edit/:id", - show: "/blog-posts/show/:id", - meta: { - canDelete: true, - }, - }, - <%_ } else { _%> - { - name: "blog_posts", - list: "/blog-posts", - create: "/blog-posts/create", - edit: "/blog-posts/edit/:id", - show: "/blog-posts/show/:id", - meta: { - canDelete: true, - }, - }, - <%_ } _%> - { - name: "categories", - list: "/categories", - create: "/categories/create", - edit: "/categories/edit/:id", - show: "/categories/show/:id", - meta: { - canDelete: true, - }, - }, - ]} - <%_ } _%> - options={{ - syncWithLocation: true, - warnWhenUnsavedChanges: true, - useNewQueryKeys: true, - <%_ if (typeof projectId !== 'undefined' && projectId !== '') { _%> - projectId: "<%= projectId %>", - <%_ } _%> - <%- (_app.refineOptions || []).join("\n") %> - }} - > - <%_ if (_app.hasRoutes === true && _app.isAuthRoutes) { _%> - - } - > - <%_ if (answers["ui-framework"] === 'no') { _%> - - - - <%_ } else { _%> -
} - <%_ if (selectedSvg || selectedTitle) { _%> - Title={({ collapsed }) => ( - - text="<%= selectedTitle %>" - <%_ } _%> - <%_ if (selectedSvg) { _%> - icon={} - <%_ } _%> - /> - )} - <%_ } _%> - > - - - <%_ } _%> - - } - > - - - <%_ } else { _%> - - <%_ } _%> - } /> - - } /> - } /> - } /> - } /> - - - } /> - } /> - } /> - } /> - - } /> - - }> - - - } - > - <%_ if (_app.isCustomLoginPage) { _%> - } <%- (_app.loginPageProps || []).join("\n") %> /> - <%_ if (answers["auth-provider"] === 'auth-provider-custom') { _%> - } /> - } /> - <%_ } _%> - <%_ } else { _%> - - title={( - - text="<%= selectedTitle %>" - <%_ } _%> - <%_ if (selectedSvg) { _%> - icon={} - <%_ } _%> - /> - )} - <%_ } _%> - <%- (_app.authPageProps || []).join("\n") %> - /> - )} - /> - } - /> - } - /> - <%_ } _%> - - - <%_ } _%> - - <%_ if (_app.hasRoutes === true && _app.isNoAuthRoutes) { _%> - - - - - - <%_ } else { _%> -
} - <%_ if (selectedSvg || selectedTitle) { _%> - Title={({ collapsed }) => ( - - text="<%= selectedTitle %>" - <%_ } _%> - <%_ if (selectedSvg) { _%> - icon={} - <%_ } _%> - /> - )} - <%_ } _%> - > - - - <%_ } _%> - )} - > - - - <%_ } else { _%> - - <%_ } _%> - } /> - - } /> - } /> - } /> - } /> - - - } /> - } /> - } /> - } /> - - } /> - - - <%_ } _%> - - <%_ if (_app.hasRoutes === false) { _%> - - } /> - - <%_ } _%> - - - - - - - <%- bottom.join("\n") %> - - - ); -}; - -export default App; diff --git a/refine-react/template/src/index.tsx b/refine-react/template/src/index.tsx deleted file mode 100644 index a8b56924a..000000000 --- a/refine-react/template/src/index.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import React from "react"; -import { createRoot } from "react-dom/client"; -<%_ if (answers["auth-provider"] === "auth-provider-auth0") { _%> -import { Auth0Provider } from "@auth0/auth0-react"; -<%_ } _%> - -<%_ if (answers["auth-provider"] === "auth-provider-keycloak") { _%> -import Keycloak from "keycloak-js"; -import { ReactKeycloakProvider } from "@react-keycloak/web"; -<%_ } _%> - - -import reportWebVitals from "./reportWebVitals"; -import App from "./App"; -<%_ if (answers[`i18n-${answers["ui-framework"]}`] !== "no") { _%> -import "./i18n"; -<%_ } _%> - -<%_ if (answers["auth-provider"] === "auth-provider-keycloak") { _%> -const keycloak = new Keycloak({ - clientId: "refine-demo", - url: "https://lemur-0.cloud-iam.com/auth", - realm: "refine", -}); -<%_ } _%> - -const container = document.getElementById("root") as HTMLElement; -const root = createRoot(container); - -<% - var mainWrapper = _app.mainWrapper || []; - var top = mainWrapper.map(wrapper => wrapper[0] || ""); - var bottom = mainWrapper.map(wrapper => wrapper[1] || "").reverse(); -%> - - -root.render( - <%_ if (_app.hasStrictMode === true) { _%> - - <%_ } _%> - <%_ if (answers[`i18n-${answers["ui-framework"]}`] !== "no") { _%> - - <%_ } _%> - <%- top.join("\n") %> - - <%- bottom.join("\n") %> - <%_ if (answers[`i18n-${answers["ui-framework"]}`] !== "no") { _%> - - <%_ } _%> - <%_ if (_app.hasStrictMode === true) { _%> - - <%_ } _%> -); - -// If you want to start measuring performance in your app, pass a function -// to log results (for example: reportWebVitals(console.log)) -// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals -reportWebVitals(); diff --git a/refine-react/template/src/meta.json b/refine-react/template/src/meta.json deleted file mode 100644 index b23a9005f..000000000 --- a/refine-react/template/src/meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "<%= name %>", - "plugins": [] -} diff --git a/refine-react/template/src/react-app-env.d.ts b/refine-react/template/src/react-app-env.d.ts deleted file mode 100644 index 6431bc5fc..000000000 --- a/refine-react/template/src/react-app-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/refine-react/template/src/reportWebVitals.ts b/refine-react/template/src/reportWebVitals.ts deleted file mode 100644 index 49a2a16e0..000000000 --- a/refine-react/template/src/reportWebVitals.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ReportHandler } from 'web-vitals'; - -const reportWebVitals = (onPerfEntry?: ReportHandler) => { - if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry); - getFID(onPerfEntry); - getFCP(onPerfEntry); - getLCP(onPerfEntry); - getTTFB(onPerfEntry); - }); - } -}; - -export default reportWebVitals; diff --git a/refine-react/template/src/setupTests.ts b/refine-react/template/src/setupTests.ts deleted file mode 100644 index 8f2609b7b..000000000 --- a/refine-react/template/src/setupTests.ts +++ /dev/null @@ -1,5 +0,0 @@ -// jest-dom adds custom jest matchers for asserting on DOM nodes. -// allows you to do things like: -// expect(element).toHaveTextContent(/react/i) -// learn more: https://github.com/testing-library/jest-dom -import '@testing-library/jest-dom';