From 702b1dee8bab9ff8839fad58f5d6ec286a4d1a32 Mon Sep 17 00:00:00 2001 From: Ben Snyder Date: Sun, 21 Apr 2024 19:40:04 -0400 Subject: [PATCH 1/4] feat(webapp): modernize development tooling - replace webpack, craco, with vite and add support for tailwindcss --- lerna.json | 7 +- package.json | 5 +- packages/webapp/.gitignore | 2 + packages/webapp/craco.config.js | 17 - packages/webapp/{public => }/index.html | 13 +- packages/webapp/package.json | 87 +- packages/webapp/postcss.config.js | 10 + packages/webapp/public/lang/ar/index.json | 2022 + packages/webapp/public/lang/en/index.json | 2323 ++ packages/webapp/setupProxy.tsx | 11 - .../webapp/src/components/AppIntlLoader.tsx | 11 +- .../Dashboard/BigcapitalLoading.tsx | 2 +- .../Dashboard/DashboardBackLink.tsx | 2 +- .../Dashboard/DashboardErrorBoundary.tsx | 2 +- .../components/Dashboard/DashboardFooter.tsx | 6 +- .../components/Dashboard/DashboardPage.tsx | 2 +- .../Dashboard/DashboardPageContent.tsx | 2 +- .../DashboardTopbar/DashboardTopbar.tsx | 18 +- .../Dashboard/DashboardTopbar/_components.tsx | 2 +- .../Dashboard/DashboardViewsTabs.tsx | 2 +- .../src/components/Dashboard/TopbarUser.tsx | 4 +- .../webapp/src/components/Datatable/Cells.tsx | 2 +- .../src/components/Datatable/Pagination.tsx | 12 +- .../src/components/Datatable/TableBody.tsx | 2 +- .../src/components/Datatable/TableFooter.tsx | 2 +- .../src/components/Datatable/TableHeader.tsx | 2 +- .../Datatable/TableHeaderSkeleton.tsx | 2 +- .../TableIndeterminateCheckboxRow.tsx | 2 +- .../src/components/Datatable/TableLoading.tsx | 2 +- .../Datatable/TableNoResultsRow.tsx | 2 +- .../src/components/Datatable/TableRow.tsx | 2 +- .../src/components/Datatable/TableTBody.tsx | 2 +- .../Datatable/TableVirtualizedRows.tsx | 2 +- .../webapp/src/components/Details/index.tsx | 2 +- .../webapp/src/components/Dragzone/index.tsx | 2 +- .../src/components/Forms/InputPrepend.tsx | 2 +- .../components/Forms/InputPrependButton.tsx | 2 +- .../src/components/Forms/InputPrependText.tsx | 4 +- .../webapp/src/components/Hint/FieldHint.tsx | 2 +- .../src/components/Hint/FieldRequiredHint.tsx | 2 +- .../src/components/Hint/RequiredHint.tsx | 2 +- .../components/Indicator/LoadingIndicator.tsx | 2 +- packages/webapp/src/components/LazyLoader.tsx | 83 +- .../components/MaterialProgressBar/index.tsx | 6 +- .../src/components/Menu/MenuItemLabel.tsx | 2 +- .../components/PageForm/PageFormBigNumber.tsx | 6 +- .../webapp/src/components/Postbox/index.tsx | 12 +- .../Preferences/PreferencesSidebar.tsx | 2 +- .../PreferencesSidebarContainer.tsx | 4 +- .../Preferences/PreferencesTopbar.tsx | 6 +- .../src/components/TotalLines/index.tsx | 4 +- .../UniversalSearch/UniversalSearch.tsx | 6 +- packages/webapp/src/components/Utils/For.tsx | 5 +- .../src/containers/Accounts/components.tsx | 4 +- .../webapp/src/containers/Accounts/utils.tsx | 4 +- .../Alerts/Estimates/EstimateApproveAlert.tsx | 3 +- .../CashFlow/CashFlowAccounts/components.tsx | 2 +- .../CustomerFormAfterPrimarySection.tsx | 2 +- .../containers/Dashboard/Sidebar/Sidebar.tsx | 4 +- .../Dashboard/Sidebar/SidebarHead.tsx | 8 +- .../BranchActivateFormContent.tsx | 4 +- .../ContactDuplicateForm.tsx | 2 +- .../CreditNotePdfPreviewDialogContent.tsx | 2 +- .../EstimatePdfPreviewDialogContent.tsx | 2 +- .../InventoryAdjustmentQuantityFields.tsx | 2 +- .../InvoicePdfPreviewDialogContent.tsx | 2 +- .../PaymentReceivePdfPreviewContent.tsx | 2 +- .../ReceiptPdfPreviewDialogContent.tsx | 2 +- .../WarehouseActivateFormContent.tsx | 4 +- .../AccountDrawer/AccountDrawerHeader.tsx | 2 +- .../Drawers/BillDrawer/BillDetailHeader.tsx | 2 +- .../CashflowTransactionDrawerHeader.tsx | 2 +- .../CashflowTransactionDrawerTableFooter.tsx | 18 +- .../CreditNoteDetailHeader.tsx | 2 +- .../CustomerDetailsHeader.tsx | 2 +- .../EstimateDetailHeader.tsx | 2 +- .../ExpenseDrawer/ExpenseDrawerHeader.tsx | 2 +- .../InvoiceDetailHeader.tsx | 2 +- .../ItemDetailDrawer/ItemDetailHeader.tsx | 2 +- .../ManualJournalDrawerHeader.tsx | 2 +- .../PaymentMadeDetailHeader.tsx | 2 +- .../PaymentReceiveDetailHeader.tsx | 2 +- .../ReceiptDetailHeader.tsx | 2 +- .../VendorCreditDetailHeader.tsx | 2 +- .../VendorDetailsHeader.tsx | 2 +- .../ARAgingSummary/ARAgingSummaryHeader.tsx | 2 +- .../BalanceSheet/BalanceSheetHeader.tsx | 2 +- .../CashFlowStatementHeader.tsx | 2 +- .../CustomersBalanceSummaryHeader.tsx | 2 +- .../CustomersTransactionsHeader.tsx | 2 +- .../FinancialStatements/FinancialReports.tsx | 14 +- .../GeneralLedger/GeneralLedgerHeader.tsx | 2 +- .../InventoryItemDetailsHeader.tsx | 2 +- .../InventoryValuationHeader.tsx | 2 +- .../Journal/JournalHeader.tsx | 2 +- .../ProfitLossSheet/ProfitLossSheetHeader.tsx | 2 +- .../PurchasesByItemsHeader.tsx | 2 +- .../RealizedGainOrLossHeader.tsx | 2 +- .../SalesByItems/SalesByItemsHeader.tsx | 2 +- .../SalesTaxLiabilitySummaryHeader.tsx | 2 +- .../TrialBalanceSheetHeader.tsx | 2 +- .../UnrealizedGainOrLossHeader.tsx | 2 +- .../VendorsTransactionsHeader.tsx | 2 +- .../src/containers/Items/ItemFormBody.tsx | 2 +- .../src/containers/Items/ItemFormFormik.tsx | 4 +- .../Items/ItemFormInventorySection.tsx | 2 +- .../Items/ItemFormPrimarySection.tsx | 4 +- .../src/containers/Items/ItemsFooter.tsx | 2 +- .../Currencies/CurrenciesActions.tsx | 2 +- .../Users/Roles/RolesForm/components.tsx | 14 +- .../Bills/BillForm/BillFormFooter.tsx | 2 +- .../Purchases/Bills/BillUniversalSearch.tsx | 8 +- .../Bills/BillsLanding/components.tsx | 2 +- .../VendorCreditNoteFormFooter.tsx | 2 +- .../VendorCreditIUniversalSearchBind.tsx | 4 +- .../PaymentForm/PaymentMadeFormHeader.tsx | 6 +- .../PaymentMadeUniversalSearch.tsx | 4 +- .../CreditNotes/CreditNoteUniversalSearch.tsx | 4 +- .../EstimateUniversalSearch.tsx | 12 +- .../Sales/Invoices/InvoiceUniversalSearch.tsx | 8 +- .../Invoices/InvoicesLanding/components.tsx | 4 +- .../PaymentReceiveFormHeader.tsx | 6 +- .../PaymentReceiveUniversalSearch.tsx | 4 +- .../Sales/Receipts/ReceiptUniversalSearch.tsx | 8 +- .../containers/Setup/SetupCongratsPage.tsx | 8 +- .../Setup/SetupInitializingForm.tsx | 12 +- .../src/containers/Setup/SetupLeftSection.tsx | 4 +- .../SetupSubscription/SetupSubscription.tsx | 27 +- .../SetupSubscription/SubscriptionPlan.tsx | 1 - .../containers/Setup/SetupWizardContent.tsx | 2 +- .../src/containers/Setup/WizardSetupPage.tsx | 2 +- .../Subscriptions/BillingPaymentMethod.tsx | 2 +- .../Subscriptions/BillingPeriodsInput.tsx | 6 +- .../Subscriptions/BillingPlansForm.tsx | 2 +- .../Subscriptions/BillingPlansInput.tsx | 6 +- .../DashboardUniversalSearch.tsx | 2 +- .../containers/UniversalSearch/components.tsx | 2 +- .../VendorFormAfterPrimarySection.tsx | 2 +- .../webapp/src/containers/Views/ViewForm.tsx | 26 +- .../webapp/src/hooks/query/organization.tsx | 38 +- packages/webapp/src/index.tsx | 3 +- .../style/components/BigcapitalLoading.scss | 2 +- packages/webapp/tailwind.config.js | 1069 + packages/webapp/tsconfig.base.json | 9 - packages/webapp/tsconfig.json | 16 +- packages/webapp/vite.config.ts | 72 + pnpm-lock.yaml | 34464 +++++++++------- 147 files changed, 25677 insertions(+), 15089 deletions(-) delete mode 100644 packages/webapp/craco.config.js rename packages/webapp/{public => }/index.html (82%) create mode 100644 packages/webapp/postcss.config.js create mode 100644 packages/webapp/public/lang/ar/index.json create mode 100644 packages/webapp/public/lang/en/index.json delete mode 100644 packages/webapp/setupProxy.tsx create mode 100644 packages/webapp/tailwind.config.js delete mode 100644 packages/webapp/tsconfig.base.json create mode 100644 packages/webapp/vite.config.ts diff --git a/lerna.json b/lerna.json index 79bf096a8c..95fcbb2bd2 100644 --- a/lerna.json +++ b/lerna.json @@ -2,6 +2,7 @@ "$schema": "node_modules/lerna/schemas/lerna-schema.json", "version": "independent", "npmClient": "pnpm", - "useWorkspaces": true, - "packages": ["packages/*"] -} \ No newline at end of file + "packages": [ + "packages/*" + ] +} diff --git a/package.json b/package.json index 0976df239c..3ff2f6dfdc 100644 --- a/package.json +++ b/package.json @@ -19,10 +19,11 @@ "@faker-js/faker": "^8.0.2", "@playwright/test": "^1.32.3", "husky": "^8.0.3", - "lerna": "^6.4.1" + "lerna": "^8.1.2", + "pnpm": "^9" }, "engines": { - "node": "16.x || 17.x || 18.x" + "node": "16.x || 17.x || 18.x || 20.x" }, "husky": { "hooks": { diff --git a/packages/webapp/.gitignore b/packages/webapp/.gitignore index ec48acdbc7..b7a5a5d1e1 100644 --- a/packages/webapp/.gitignore +++ b/packages/webapp/.gitignore @@ -21,3 +21,5 @@ npm-debug.log* yarn-debug.log* + +dist \ No newline at end of file diff --git a/packages/webapp/craco.config.js b/packages/webapp/craco.config.js deleted file mode 100644 index 4d444d0657..0000000000 --- a/packages/webapp/craco.config.js +++ /dev/null @@ -1,17 +0,0 @@ -const path = require('path'); - -module.exports = { - webpack: { - alias: { - '@': path.resolve(__dirname, 'src'), - }, - configure: { - resolve: { - fallback: { path: require.resolve('path-browserify') }, - }, - }, - }, - devServer: { - allowedHosts: process.env.GITPOD_HOST ? 'all' : 'auto' - }, -}; diff --git a/packages/webapp/public/index.html b/packages/webapp/index.html similarity index 82% rename from packages/webapp/public/index.html rename to packages/webapp/index.html index 1af330a075..f9c8d6824b 100644 --- a/packages/webapp/public/index.html +++ b/packages/webapp/index.html @@ -4,7 +4,7 @@ @@ -13,27 +13,29 @@ name="description" content="Bigcapital Financial Managment Software" /> - + - + Bigcapital + - +
+