From 152586d56e7c9898f188e74629f261675b8536d4 Mon Sep 17 00:00:00 2001 From: Jan Potoms <2109932+Janpot@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:04:31 +0100 Subject: [PATCH 01/12] Update toolpadAppBuilder.ts Signed-off-by: Jan Potoms <2109932+Janpot@users.noreply.github.com> --- .../src/server/toolpadAppBuilder.ts | 102 +++++++++--------- 1 file changed, 50 insertions(+), 52 deletions(-) diff --git a/packages/toolpad-app/src/server/toolpadAppBuilder.ts b/packages/toolpad-app/src/server/toolpadAppBuilder.ts index 84b7df5fef0..a8bf016cdd9 100644 --- a/packages/toolpad-app/src/server/toolpadAppBuilder.ts +++ b/packages/toolpad-app/src/server/toolpadAppBuilder.ts @@ -288,58 +288,56 @@ if (import.meta.hot) { }, optimizeDeps: { include: [ - '@emotion/cache', - '@emotion/react', - '@mui/icons-material', - '@mui/icons-material/ArrowDropDownRounded', - '@mui/icons-material/Close', - '@mui/icons-material/Delete', - '@mui/icons-material/DarkMode', - '@mui/icons-material/Edit', - '@mui/icons-material/Error', - '@mui/icons-material/HelpOutlined', - '@mui/icons-material/LightMode', - '@mui/icons-material/OpenInNew', - '@mui/icons-material/SettingsBrightnessOutlined', - '@mui/lab', - '@mui/material', - '@mui/material/CircularProgress', - '@mui/material/Button', - '@mui/material/colors', - '@mui/material/styles', - '@mui/material/useMediaQuery', - '@mui/utils', - '@mui/utils/useEventCallback', - '@mui/x-data-grid-pro', - '@mui/x-date-pickers/AdapterDayjs', - '@mui/x-date-pickers/DesktopDatePicker', - '@mui/x-date-pickers/LocalizationProvider', - '@mui/x-license-pro', - '@tanstack/react-query', - '@tanstack/react-query-devtools/build/modern/production.js', - 'dayjs', - 'dayjs/locale/en', - 'dayjs/locale/fr', - 'dayjs/locale/nl', - 'fractional-indexing', - 'invariant', - 'lodash-es', - 'markdown-to-jsx', - 'nanoid/non-secure', - 'prop-types', - 'react', - 'react-dom', - 'react-dom/client', - 'react-error-boundary', - 'react-hook-form', - 'react-is', - 'react-router-dom', - 'react/jsx-dev-runtime', - 'react/jsx-runtime', - 'recharts', - 'superjson', - 'title', - 'zod', + '@mui/toolpad > @emotion/cache', + '@mui/toolpad > @emotion/react', + '@mui/toolpad > @mui/icons-material', + '@mui/toolpad > @mui/icons-material/ArrowDropDownRounded', + '@mui/toolpad > @mui/icons-material/Close', + '@mui/toolpad > @mui/icons-material/Delete', + '@mui/toolpad > @mui/icons-material/DarkMode', + '@mui/toolpad > @mui/icons-material/Edit', + '@mui/toolpad > @mui/icons-material/Error', + '@mui/toolpad > @mui/icons-material/HelpOutlined', + '@mui/toolpad > @mui/icons-material/LightMode', + '@mui/toolpad > @mui/icons-material/OpenInNew', + '@mui/toolpad > @mui/icons-material/SettingsBrightnessOutlined', + '@mui/toolpad > @mui/lab', + '@mui/toolpad > @mui/material', + '@mui/toolpad > @mui/material/CircularProgress', + '@mui/toolpad > @mui/material/Button', + '@mui/toolpad > @mui/material/colors', + '@mui/toolpad > @mui/material/styles', + '@mui/toolpad > @mui/material/useMediaQuery', + '@mui/toolpad > @mui/utils', + '@mui/toolpad > @mui/utils/useEventCallback', + '@mui/toolpad > @mui/x-data-grid-pro', + '@mui/toolpad > @mui/x-date-pickers/AdapterDayjs', + '@mui/toolpad > @mui/x-date-pickers/DesktopDatePicker', + '@mui/toolpad > @mui/x-date-pickers/LocalizationProvider', + '@mui/toolpad > @mui/toolpad-components > @mui/x-license-pro', + '@mui/toolpad > @tanstack/react-query', + '@mui/toolpad > @tanstack/react-query-devtools/production', + '@mui/toolpad > dayjs', + '@mui/toolpad > dayjs/locale/en', + '@mui/toolpad > dayjs/locale/fr', + '@mui/toolpad > dayjs/locale/nl', + '@mui/toolpad > fractional-indexing', + '@mui/toolpad > invariant', + '@mui/toolpad > lodash-es', + '@mui/toolpad > markdown-to-jsx', + '@mui/toolpad > nanoid/non-secure', + '@mui/toolpad > @mui/toolpad-components > @mui/x-charts > prop-types', + '@mui/toolpad > react', + '@mui/toolpad > react/jsx-dev-runtime', + '@mui/toolpad > react/jsx-runtime', + '@mui/toolpad > react-dom', + '@mui/toolpad > react-dom/client', + '@mui/toolpad > react-error-boundary', + '@mui/toolpad > react-hook-form', + '@mui/toolpad > react-is', + '@mui/toolpad > react-router-dom', + '@mui/toolpad > superjson', + '@mui/toolpad > @mui/toolpad-utils > title', ], exclude: [ '@mui/toolpad-core', From e18702756f1f86ad175bfc820996ea858d2ba220 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:29:37 +0100 Subject: [PATCH 02/12] coorect rootfolder --- packages/toolpad-app/src/server/toolpadAppBuilder.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/toolpad-app/src/server/toolpadAppBuilder.ts b/packages/toolpad-app/src/server/toolpadAppBuilder.ts index a8bf016cdd9..a69ed6ed984 100644 --- a/packages/toolpad-app/src/server/toolpadAppBuilder.ts +++ b/packages/toolpad-app/src/server/toolpadAppBuilder.ts @@ -279,6 +279,10 @@ if (import.meta.hot) { ? 'virtual:toolpad-files:canvas.tsx' : 'virtual:toolpad-files:main.tsx', }, + { + find: '@mui/toolpad', + replacement: path.resolve(currentDirectory, '../exports'), + }, ], }, server: { @@ -348,7 +352,7 @@ if (import.meta.hot) { }, appType: 'custom', logLevel: 'info', - root, + root: currentDirectory, plugins: [virtualToolpadFiles, react(), toolpadVitePlugin(), ...plugins], base, define: { From fe84be9373e49a4e9f50f2f4b2cc0c6b0134a73e Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Thu, 11 Jan 2024 15:30:04 +0100 Subject: [PATCH 03/12] try this --- .../src/server/toolpadAppBuilder.ts | 61 +------------------ 1 file changed, 1 insertion(+), 60 deletions(-) diff --git a/packages/toolpad-app/src/server/toolpadAppBuilder.ts b/packages/toolpad-app/src/server/toolpadAppBuilder.ts index a69ed6ed984..d89762737e6 100644 --- a/packages/toolpad-app/src/server/toolpadAppBuilder.ts +++ b/packages/toolpad-app/src/server/toolpadAppBuilder.ts @@ -290,66 +290,7 @@ if (import.meta.hot) { allow: [root, path.resolve(currentDirectory, '../../../../')], }, }, - optimizeDeps: { - include: [ - '@mui/toolpad > @emotion/cache', - '@mui/toolpad > @emotion/react', - '@mui/toolpad > @mui/icons-material', - '@mui/toolpad > @mui/icons-material/ArrowDropDownRounded', - '@mui/toolpad > @mui/icons-material/Close', - '@mui/toolpad > @mui/icons-material/Delete', - '@mui/toolpad > @mui/icons-material/DarkMode', - '@mui/toolpad > @mui/icons-material/Edit', - '@mui/toolpad > @mui/icons-material/Error', - '@mui/toolpad > @mui/icons-material/HelpOutlined', - '@mui/toolpad > @mui/icons-material/LightMode', - '@mui/toolpad > @mui/icons-material/OpenInNew', - '@mui/toolpad > @mui/icons-material/SettingsBrightnessOutlined', - '@mui/toolpad > @mui/lab', - '@mui/toolpad > @mui/material', - '@mui/toolpad > @mui/material/CircularProgress', - '@mui/toolpad > @mui/material/Button', - '@mui/toolpad > @mui/material/colors', - '@mui/toolpad > @mui/material/styles', - '@mui/toolpad > @mui/material/useMediaQuery', - '@mui/toolpad > @mui/utils', - '@mui/toolpad > @mui/utils/useEventCallback', - '@mui/toolpad > @mui/x-data-grid-pro', - '@mui/toolpad > @mui/x-date-pickers/AdapterDayjs', - '@mui/toolpad > @mui/x-date-pickers/DesktopDatePicker', - '@mui/toolpad > @mui/x-date-pickers/LocalizationProvider', - '@mui/toolpad > @mui/toolpad-components > @mui/x-license-pro', - '@mui/toolpad > @tanstack/react-query', - '@mui/toolpad > @tanstack/react-query-devtools/production', - '@mui/toolpad > dayjs', - '@mui/toolpad > dayjs/locale/en', - '@mui/toolpad > dayjs/locale/fr', - '@mui/toolpad > dayjs/locale/nl', - '@mui/toolpad > fractional-indexing', - '@mui/toolpad > invariant', - '@mui/toolpad > lodash-es', - '@mui/toolpad > markdown-to-jsx', - '@mui/toolpad > nanoid/non-secure', - '@mui/toolpad > @mui/toolpad-components > @mui/x-charts > prop-types', - '@mui/toolpad > react', - '@mui/toolpad > react/jsx-dev-runtime', - '@mui/toolpad > react/jsx-runtime', - '@mui/toolpad > react-dom', - '@mui/toolpad > react-dom/client', - '@mui/toolpad > react-error-boundary', - '@mui/toolpad > react-hook-form', - '@mui/toolpad > react-is', - '@mui/toolpad > react-router-dom', - '@mui/toolpad > superjson', - '@mui/toolpad > @mui/toolpad-utils > title', - ], - exclude: [ - '@mui/toolpad-core', - '@mui/toolpad/browser', - '@mui/toolpad/runtime', - '@mui/toolpad/canvas', - ], - }, + optimizeDeps: {}, appType: 'custom', logLevel: 'info', root: currentDirectory, From 00ee0c366cb27be44a02a8fe673838f78d3bef28 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Thu, 11 Jan 2024 15:33:01 +0100 Subject: [PATCH 04/12] Update toolpadAppBuilder.ts --- packages/toolpad-app/src/server/toolpadAppBuilder.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/toolpad-app/src/server/toolpadAppBuilder.ts b/packages/toolpad-app/src/server/toolpadAppBuilder.ts index d89762737e6..a5955beb010 100644 --- a/packages/toolpad-app/src/server/toolpadAppBuilder.ts +++ b/packages/toolpad-app/src/server/toolpadAppBuilder.ts @@ -290,7 +290,9 @@ if (import.meta.hot) { allow: [root, path.resolve(currentDirectory, '../../../../')], }, }, - optimizeDeps: {}, + optimizeDeps: { + entries: [MAIN_ENTRY], + }, appType: 'custom', logLevel: 'info', root: currentDirectory, From 3342d9c2d135265c2dd197d9a958d451d14d9c79 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Thu, 11 Jan 2024 15:52:40 +0100 Subject: [PATCH 05/12] Update toolpadAppBuilder.ts --- .../src/server/toolpadAppBuilder.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/toolpad-app/src/server/toolpadAppBuilder.ts b/packages/toolpad-app/src/server/toolpadAppBuilder.ts index a5955beb010..a71753a6516 100644 --- a/packages/toolpad-app/src/server/toolpadAppBuilder.ts +++ b/packages/toolpad-app/src/server/toolpadAppBuilder.ts @@ -3,6 +3,7 @@ import * as url from 'node:url'; import type { InlineConfig, Plugin } from 'vite'; import react from '@vitejs/plugin-react'; import { indent } from '@mui/toolpad-utils/strings'; +import { createRequire } from 'module'; import type { ComponentEntry, PagesManifest } from './localMode'; import { INITIAL_STATE_WINDOW_PROPERTY } from '../constants'; import * as appDom from '../appDom'; @@ -11,6 +12,7 @@ import viteVirtualPlugin, { VirtualFileContent, replaceFiles } from './viteVirtu import.meta.url ??= url.pathToFileURL(__filename).toString(); const currentDirectory = url.fileURLToPath(new URL('.', import.meta.url)); +const require = createRequire(import.meta.url); const MAIN_ENTRY = '/main.tsx'; @@ -240,6 +242,23 @@ if (import.meta.hot) { const virtualToolpadFiles = viteVirtualPlugin(virtualFiles, 'toolpad-files'); + const provideDefaultModule = (id: string) => { + try { + require.resolve(id, { + paths: [root], + }); + // No need to provide default module, the user has this installed + return []; + } catch (err: any) { + if (err.code !== 'MODULE_NOT_FOUND') { + throw err; + } + // eslint-disable-next-line no-console + console.log(`Unable to resolve "${id}" in the user project, providing a default`); + return [{ find: id, replacement: require.resolve(id) }]; + } + }; + return { reloadComponents: async () => { const newFiles = new Map(virtualFiles); @@ -283,6 +302,7 @@ if (import.meta.hot) { find: '@mui/toolpad', replacement: path.resolve(currentDirectory, '../exports'), }, + ...provideDefaultModule('@mui/material'), ], }, server: { From 663072bcd3f18172ddb2927328dad96762dfbd0d Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Thu, 11 Jan 2024 16:41:42 +0100 Subject: [PATCH 06/12] Update toolpadAppBuilder.ts --- .../src/server/toolpadAppBuilder.ts | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/packages/toolpad-app/src/server/toolpadAppBuilder.ts b/packages/toolpad-app/src/server/toolpadAppBuilder.ts index a71753a6516..a5955beb010 100644 --- a/packages/toolpad-app/src/server/toolpadAppBuilder.ts +++ b/packages/toolpad-app/src/server/toolpadAppBuilder.ts @@ -3,7 +3,6 @@ import * as url from 'node:url'; import type { InlineConfig, Plugin } from 'vite'; import react from '@vitejs/plugin-react'; import { indent } from '@mui/toolpad-utils/strings'; -import { createRequire } from 'module'; import type { ComponentEntry, PagesManifest } from './localMode'; import { INITIAL_STATE_WINDOW_PROPERTY } from '../constants'; import * as appDom from '../appDom'; @@ -12,7 +11,6 @@ import viteVirtualPlugin, { VirtualFileContent, replaceFiles } from './viteVirtu import.meta.url ??= url.pathToFileURL(__filename).toString(); const currentDirectory = url.fileURLToPath(new URL('.', import.meta.url)); -const require = createRequire(import.meta.url); const MAIN_ENTRY = '/main.tsx'; @@ -242,23 +240,6 @@ if (import.meta.hot) { const virtualToolpadFiles = viteVirtualPlugin(virtualFiles, 'toolpad-files'); - const provideDefaultModule = (id: string) => { - try { - require.resolve(id, { - paths: [root], - }); - // No need to provide default module, the user has this installed - return []; - } catch (err: any) { - if (err.code !== 'MODULE_NOT_FOUND') { - throw err; - } - // eslint-disable-next-line no-console - console.log(`Unable to resolve "${id}" in the user project, providing a default`); - return [{ find: id, replacement: require.resolve(id) }]; - } - }; - return { reloadComponents: async () => { const newFiles = new Map(virtualFiles); @@ -302,7 +283,6 @@ if (import.meta.hot) { find: '@mui/toolpad', replacement: path.resolve(currentDirectory, '../exports'), }, - ...provideDefaultModule('@mui/material'), ], }, server: { From 6a4b0a578270d4f991f24ff03c318fc816a261f4 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Thu, 11 Jan 2024 16:48:50 +0100 Subject: [PATCH 07/12] Update toolpadAppBuilder.ts --- .../src/server/toolpadAppBuilder.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/toolpad-app/src/server/toolpadAppBuilder.ts b/packages/toolpad-app/src/server/toolpadAppBuilder.ts index a5955beb010..acf9abffc32 100644 --- a/packages/toolpad-app/src/server/toolpadAppBuilder.ts +++ b/packages/toolpad-app/src/server/toolpadAppBuilder.ts @@ -13,6 +13,12 @@ import.meta.url ??= url.pathToFileURL(__filename).toString(); const currentDirectory = url.fileURLToPath(new URL('.', import.meta.url)); const MAIN_ENTRY = '/main.tsx'; +const DEFAULT_MODULES = [ + '@mui/material', + '@mui/icons-material', + '@mui/x-data-grid', + '@mui/x-charts', +]; export function getHtmlContent() { return ` @@ -41,10 +47,19 @@ function toolpadVitePlugin(): Plugin { return { name: 'toolpad', - async resolveId(id) { + async resolveId(id, parent) { if (id.endsWith('.html')) { return id; } + for (const moduleName of DEFAULT_MODULES) { + if (id === moduleName || id.startsWith(`${moduleName}/`)) { + // eslint-disable-next-line no-await-in-loop + const userMod = await this.resolve(id, parent); + // eslint-disable-next-line no-await-in-loop + const fallbackMod = await this.resolve(id, currentDirectory); + return userMod || fallbackMod; + } + } return null; }, @@ -263,6 +278,7 @@ if (import.meta.hot) { }, envFile: false, resolve: { + dedupe: DEFAULT_MODULES, alias: [ { // FIXME(https://github.com/mui/material-ui/issues/35233) @@ -292,6 +308,7 @@ if (import.meta.hot) { }, optimizeDeps: { entries: [MAIN_ENTRY], + include: DEFAULT_MODULES.map((moduleName) => `@mui/toolpad > ${moduleName}`), }, appType: 'custom', logLevel: 'info', From 8b4ad5f5d98433eb08709eb4adf1f3dadcfd6014 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Thu, 11 Jan 2024 18:52:37 +0100 Subject: [PATCH 08/12] Update toolpadAppBuilder.ts --- packages/toolpad-app/src/server/toolpadAppBuilder.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/toolpad-app/src/server/toolpadAppBuilder.ts b/packages/toolpad-app/src/server/toolpadAppBuilder.ts index acf9abffc32..b79891ad03b 100644 --- a/packages/toolpad-app/src/server/toolpadAppBuilder.ts +++ b/packages/toolpad-app/src/server/toolpadAppBuilder.ts @@ -54,9 +54,10 @@ function toolpadVitePlugin(): Plugin { for (const moduleName of DEFAULT_MODULES) { if (id === moduleName || id.startsWith(`${moduleName}/`)) { // eslint-disable-next-line no-await-in-loop - const userMod = await this.resolve(id, parent); - // eslint-disable-next-line no-await-in-loop - const fallbackMod = await this.resolve(id, currentDirectory); + const [userMod, fallbackMod] = await Promise.all([ + this.resolve(id, parent), + this.resolve(id, currentDirectory), + ]); return userMod || fallbackMod; } } From 28958332b7175ad9de3ac0844425ece04106fd14 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Thu, 11 Jan 2024 18:55:07 +0100 Subject: [PATCH 09/12] Update toolpadAppBuilder.ts --- .../src/server/toolpadAppBuilder.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/toolpad-app/src/server/toolpadAppBuilder.ts b/packages/toolpad-app/src/server/toolpadAppBuilder.ts index b79891ad03b..d9f91d2c91d 100644 --- a/packages/toolpad-app/src/server/toolpadAppBuilder.ts +++ b/packages/toolpad-app/src/server/toolpadAppBuilder.ts @@ -51,15 +51,15 @@ function toolpadVitePlugin(): Plugin { if (id.endsWith('.html')) { return id; } - for (const moduleName of DEFAULT_MODULES) { - if (id === moduleName || id.startsWith(`${moduleName}/`)) { - // eslint-disable-next-line no-await-in-loop - const [userMod, fallbackMod] = await Promise.all([ - this.resolve(id, parent), - this.resolve(id, currentDirectory), - ]); - return userMod || fallbackMod; - } + const hasFallback = DEFAULT_MODULES.some( + (moduleName) => moduleName === id || id.startsWith(`${moduleName}/`), + ); + if (hasFallback) { + const [userMod, fallbackMod] = await Promise.all([ + this.resolve(id, parent), + this.resolve(id, currentDirectory), + ]); + return userMod || fallbackMod; } return null; }, From 3ffc5d4d57a64db73f8bb34aa8ed606deff7d9f3 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Thu, 11 Jan 2024 19:20:10 +0100 Subject: [PATCH 10/12] Add prisma generate to the example --- examples/with-prisma-data-provider/package.json | 4 ++-- examples/with-prisma/package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/with-prisma-data-provider/package.json b/examples/with-prisma-data-provider/package.json index 7cc34dff78b..50f4934451b 100644 --- a/examples/with-prisma-data-provider/package.json +++ b/examples/with-prisma-data-provider/package.json @@ -3,8 +3,8 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "toolpad dev", - "build": "toolpad build", + "dev": "prisma generate && toolpad dev", + "build": "prisma generate && toolpad build", "start": "toolpad start", "prisma": "prisma" }, diff --git a/examples/with-prisma/package.json b/examples/with-prisma/package.json index 102f226b26d..1d68b1f1b13 100644 --- a/examples/with-prisma/package.json +++ b/examples/with-prisma/package.json @@ -3,8 +3,8 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "toolpad dev", - "build": "toolpad build", + "dev": "prisma generate && toolpad dev", + "build": "prisma generate && toolpad build", "start": "toolpad start", "prisma": "prisma" }, From a8acf34b95553022ce5103ac6e6170e6f08c354e Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Fri, 12 Jan 2024 10:26:48 +0100 Subject: [PATCH 11/12] dewf --- examples/with-prisma-data-provider/package.json | 4 ++-- examples/with-prisma/package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/with-prisma-data-provider/package.json b/examples/with-prisma-data-provider/package.json index 50f4934451b..7cc34dff78b 100644 --- a/examples/with-prisma-data-provider/package.json +++ b/examples/with-prisma-data-provider/package.json @@ -3,8 +3,8 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "prisma generate && toolpad dev", - "build": "prisma generate && toolpad build", + "dev": "toolpad dev", + "build": "toolpad build", "start": "toolpad start", "prisma": "prisma" }, diff --git a/examples/with-prisma/package.json b/examples/with-prisma/package.json index 1d68b1f1b13..102f226b26d 100644 --- a/examples/with-prisma/package.json +++ b/examples/with-prisma/package.json @@ -3,8 +3,8 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "prisma generate && toolpad dev", - "build": "prisma generate && toolpad build", + "dev": "toolpad dev", + "build": "toolpad build", "start": "toolpad start", "prisma": "prisma" }, From c0dba81728105a1e7a79d3e7a0c486b73aca0772 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Fri, 12 Jan 2024 10:27:21 +0100 Subject: [PATCH 12/12] rename --- packages/toolpad-app/src/server/toolpadAppBuilder.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/toolpad-app/src/server/toolpadAppBuilder.ts b/packages/toolpad-app/src/server/toolpadAppBuilder.ts index d9f91d2c91d..046fa6fcc23 100644 --- a/packages/toolpad-app/src/server/toolpadAppBuilder.ts +++ b/packages/toolpad-app/src/server/toolpadAppBuilder.ts @@ -13,7 +13,7 @@ import.meta.url ??= url.pathToFileURL(__filename).toString(); const currentDirectory = url.fileURLToPath(new URL('.', import.meta.url)); const MAIN_ENTRY = '/main.tsx'; -const DEFAULT_MODULES = [ +const FALLBACK_MODULES = [ '@mui/material', '@mui/icons-material', '@mui/x-data-grid', @@ -51,7 +51,7 @@ function toolpadVitePlugin(): Plugin { if (id.endsWith('.html')) { return id; } - const hasFallback = DEFAULT_MODULES.some( + const hasFallback = FALLBACK_MODULES.some( (moduleName) => moduleName === id || id.startsWith(`${moduleName}/`), ); if (hasFallback) { @@ -279,7 +279,7 @@ if (import.meta.hot) { }, envFile: false, resolve: { - dedupe: DEFAULT_MODULES, + dedupe: FALLBACK_MODULES, alias: [ { // FIXME(https://github.com/mui/material-ui/issues/35233) @@ -309,7 +309,7 @@ if (import.meta.hot) { }, optimizeDeps: { entries: [MAIN_ENTRY], - include: DEFAULT_MODULES.map((moduleName) => `@mui/toolpad > ${moduleName}`), + include: FALLBACK_MODULES.map((moduleName) => `@mui/toolpad > ${moduleName}`), }, appType: 'custom', logLevel: 'info',