From de0414afbe6ff19dc27bc1bb0d5182ec51060d3e Mon Sep 17 00:00:00 2001 From: Gerard Burns Date: Thu, 22 Feb 2024 13:19:29 +0000 Subject: [PATCH] Update Svelte Major Version to 4 (#13036) * update svelte versions * temporarilly disable svelte warnings * change bbap version pointed to * remove sub module specifying svelte version * point at updated account-portal * add type declaration for svelte in the server * add svelte transformer for server jest tests * remove svelte from bbui package.json * get builder tests working * linting fixes * prettier fixes * fix server test * fix another server test * fix server serverlog test * account-portal-version * pin master version of pro * revert hbs doc file in server to use triple braces, ensures nothing gets escaped --- package.json | 2 +- packages/account-portal | 2 +- packages/bbui/package.json | 3 +- .../bbui/src/ActionButton/ActionButton.svelte | 1 + .../bbui/src/ActionMenu/ActionMenu.svelte | 2 + packages/bbui/src/Badge/Badge.svelte | 2 + .../bbui/src/ColorPicker/ColorPicker.svelte | 4 + .../src/DetailSummary/DetailSummary.svelte | 2 + packages/bbui/src/FancyForm/FancyField.svelte | 2 + packages/bbui/src/Form/Core/Combobox.svelte | 1 + packages/bbui/src/Form/Core/DatePicker.svelte | 3 + packages/bbui/src/Form/Core/Dropzone.svelte | 3 + .../bbui/src/Form/Core/EnvDropdown.svelte | 2 + packages/bbui/src/Form/Core/File.svelte | 2 + .../bbui/src/Form/Core/InputDropdown.svelte | 1 + packages/bbui/src/Form/Core/Picker.svelte | 1 + .../bbui/src/Form/Core/PickerDropdown.svelte | 1 + packages/bbui/src/Icon/Icon.svelte | 2 + .../bbui/src/IconPicker/IconPicker.svelte | 2 + .../src/IconSideNav/IconSideNavItem.svelte | 2 + packages/bbui/src/Input/CopyInput.svelte | 2 + packages/bbui/src/List/ListItem.svelte | 2 + packages/bbui/src/Menu/Item.svelte | 1 + packages/bbui/src/Modal/CustomContent.svelte | 2 + packages/bbui/src/Modal/Modal.svelte | 1 + .../OptionSelectDnD/OptionSelectDnD.svelte | 2 + .../bbui/src/Pagination/Pagination.svelte | 2 + packages/bbui/src/Popover/Popover.svelte | 1 + .../src/ProgressCircle/ProgressCircle.svelte | 2 + packages/bbui/src/SideNavigation/Item.svelte | 2 + .../bbui/src/StatusLight/StatusLight.svelte | 2 + .../bbui/src/Table/InternalRenderer.svelte | 2 + packages/bbui/src/Table/Table.svelte | 2 + packages/bbui/src/Tabs/Tab.svelte | 3 + packages/bbui/src/Tooltip/AbsTooltip.svelte | 1 + .../bbui/src/Tooltip/TooltipWrapper.svelte | 1 + packages/builder/package.json | 5 +- .../FlowChart/ActionModal.svelte | 2 + .../FlowChart/FlowChart.svelte | 2 + .../FlowChart/FlowItem.svelte | 2 + .../FlowChart/FlowItemHeader.svelte | 2 + .../CreateAutomationModal.svelte | 2 + .../automation/SetupPanel/SchemaSetup.svelte | 2 + .../DataTable/modals/CreateEditColumn.svelte | 2 + .../DataTable/modals/ExportModal.test.js | 1 + .../backend/TableNavigator/ListItem.svelte | 2 + .../commandPalette/CommandPalette.svelte | 2 + .../src/components/common/DashCard.svelte | 2 + .../common/Dropdowns/DropdownContainer.svelte | 2 + .../common/Dropdowns/DropdownItem.svelte | 1 + .../src/components/common/EditableIcon.svelte | 2 + .../src/components/common/Icons/Pencil.svelte | 2 + .../src/components/common/NavHeader.svelte | 1 + .../src/components/common/NavItem.svelte | 2 + .../common/bindings/BindingPicker.svelte | 3 + .../bindings/DrawerBindableCombobox.svelte | 2 + .../bindings/DrawerBindableInput.svelte | 2 + .../common/bindings/DrawerBindableSlot.svelte | 2 + .../common/bindings/ModalBindableInput.svelte | 2 + .../src/components/deploy/AppActions.svelte | 2 + .../src/components/design/Panel.svelte | 2 + .../ButtonActionDrawer.svelte | 3 + .../ButtonConfiguration.svelte | 2 + .../controls/ColumnEditor/ColumnDrawer.svelte | 1 + .../DataSourceCategory.svelte | 1 + .../DraggableList/DraggableList.svelte | 3 + .../FlatButtonGroup/FlatButton.svelte | 2 + .../controls/IconSelect/IconSelect.svelte | 3 + .../components/portal/page/SideNavItem.svelte | 2 + .../settings/UserGroupPicker.svelte | 2 + .../src/components/start/AppRow.svelte | 2 + .../components/start/ChooseIconModal.svelte | 2 + .../_components/BuilderSidePanel.svelte | 2 + .../_components/PreviewOverlay.svelte | 2 + .../data/_components/DatasourceOption.svelte | 2 + .../EditDatasourceConfigButton.svelte | 2 + .../data/datasource/bb_internal/index.svelte | 2 + .../index.svelte | 2 + .../Component/ConditionalUIDrawer.svelte | 1 + .../_components/Navigation/LinksDrawer.svelte | 1 + .../_components/Screen/AppThemeSelect.svelte | 2 + .../new/_components/NewComponentPanel.svelte | 2 + .../[screenId]/_components/AppPreview.svelte | 2 + .../ComponentScrollWrapper.svelte | 1 + .../ComponentList/ComponentTree.svelte | 2 + .../_components/ComponentList/index.svelte | 2 + .../ScreenList/RoleIndicator.svelte | 1 + .../NewScreen/DatasourceTemplateRow.svelte | 2 + .../design/_components/NewScreen/index.svelte | 2 + .../src/pages/builder/auth/forgot.svelte | 2 + .../builder/portal/_components/Logo.svelte | 2 + .../portal/_components/MobileMenu.svelte | 4 + .../portal/account/auditLogs/index.svelte | 2 + .../plugins/_components/PluginRow.svelte | 2 + .../portal/settings/auth/google.svelte | 2 + .../builder/portal/settings/auth/index.svelte | 2 + .../builder/portal/settings/auth/scim.svelte | 2 + .../portal/settings/diagnostics.svelte | 2 + .../email/_components/TemplateBindings.svelte | 2 + .../_components/OnboardingTypeModal.svelte | 2 + .../users/_components/PasswordModal.svelte | 2 + .../_components/RoleTableRenderer.svelte | 2 + .../builder/src/stores/builder/datasources.js | 3 +- .../builder/src/stores/builder/queries.js | 3 +- packages/builder/src/stores/builder/views.js | 2 +- .../builder/src/stores/builder/viewsV2.js | 2 +- packages/client/package.json | 25 +- .../src/components/app/Container.svelte | 2 + .../client/src/components/app/Icon.svelte | 2 + .../client/src/components/app/Layout.svelte | 2 + .../src/components/app/SpectrumCard.svelte | 4 + .../components/devtools/DevToolsStat.svelte | 2 + .../MissingRequiredAncestor.svelte | 2 + .../MissingRequiredSetting.svelte | 2 + .../components/preview/SettingsButton.svelte | 2 + packages/frontend-core/package.json | 3 +- .../grid/cells/AttachmentCell.svelte | 2 + .../src/components/grid/cells/GridCell.svelte | 2 + .../components/grid/cells/GutterCell.svelte | 2 + .../components/grid/cells/HeaderCell.svelte | 2 + .../components/grid/cells/LongFormCell.svelte | 2 + .../components/grid/cells/OptionsCell.svelte | 2 + .../grid/cells/RelationshipCell.svelte | 2 + .../grid/layout/ButtonColumn.svelte | 1 + .../src/components/grid/layout/Grid.svelte | 1 + .../components/grid/layout/GridBody.svelte | 2 + .../src/components/grid/layout/GridRow.svelte | 2 + .../grid/layout/GridScrollWrapper.svelte | 2 + .../grid/layout/NewColumnButton.svelte | 2 + .../src/components/grid/layout/NewRow.svelte | 2 + .../grid/layout/StickyColumn.svelte | 2 + .../grid/overlays/ResizeOverlay.svelte | 1 + .../grid/overlays/ScrollOverlay.svelte | 2 + packages/server/jest.config.ts | 14 + packages/server/package.json | 1 - packages/server/scripts/svelteTransformer.js | 11 + .../src/api/controllers/static/index.ts | 9 +- .../static/templates/BudibaseApp.d.svelte.ts | 11 + .../api/controllers/static/templates/app.hbs | 3 +- .../server/src/automations/tests/bash.spec.js | 18 +- .../automations/tests/executeQuery.spec.js | 28 +- .../src/automations/tests/serverLog.spec.js | 1 + packages/server/tsconfig.build.json | 3 +- scripts/build.js | 81 ++- yarn.lock | 506 ++++++++++++++---- 145 files changed, 777 insertions(+), 196 deletions(-) create mode 100644 packages/server/scripts/svelteTransformer.js create mode 100644 packages/server/src/api/controllers/static/templates/BudibaseApp.d.svelte.ts diff --git a/package.json b/package.json index 4407fd33f3..0a20f01d52 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "nx-cloud": "16.0.5", "prettier": "2.8.8", "prettier-plugin-svelte": "^2.3.0", - "svelte": "3.49.0", + "svelte": "^4.2.10", "svelte-eslint-parser": "^0.33.1", "typescript": "5.2.2", "yargs": "^17.7.2" diff --git a/packages/account-portal b/packages/account-portal index 97329c0318..a851eeacab 160000 --- a/packages/account-portal +++ b/packages/account-portal @@ -1 +1 @@ -Subproject commit 97329c0318ef0f4bbbd2b9ce30d6976bc6505272 +Subproject commit a851eeacabfaad8bff6e781f5e5a62063cbc31f3 diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 78eed2b608..a1baa2a38b 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -24,8 +24,7 @@ "rollup": "^2.45.2", "rollup-plugin-postcss": "^4.0.0", "rollup-plugin-svelte": "^7.1.0", - "rollup-plugin-terser": "^7.0.2", - "svelte": "3.49.0" + "rollup-plugin-terser": "^7.0.2" }, "keywords": [ "svelte" diff --git a/packages/bbui/src/ActionButton/ActionButton.svelte b/packages/bbui/src/ActionButton/ActionButton.svelte index 0e6ec3d155..c346e34d54 100644 --- a/packages/bbui/src/ActionButton/ActionButton.svelte +++ b/packages/bbui/src/ActionButton/ActionButton.svelte @@ -41,6 +41,7 @@ } + (showTooltip = true)} diff --git a/packages/bbui/src/ActionMenu/ActionMenu.svelte b/packages/bbui/src/ActionMenu/ActionMenu.svelte index 08425e8f59..642ec4932a 100644 --- a/packages/bbui/src/ActionMenu/ActionMenu.svelte +++ b/packages/bbui/src/ActionMenu/ActionMenu.svelte @@ -33,6 +33,8 @@ setContext("actionMenu", { show, hide }) + +
diff --git a/packages/bbui/src/Badge/Badge.svelte b/packages/bbui/src/Badge/Badge.svelte index 8b54045297..e4ec7d4f33 100644 --- a/packages/bbui/src/Badge/Badge.svelte +++ b/packages/bbui/src/Badge/Badge.svelte @@ -13,6 +13,8 @@ export let hoverable = false + + + +
+ +
diff --git a/packages/bbui/src/DetailSummary/DetailSummary.svelte b/packages/bbui/src/DetailSummary/DetailSummary.svelte index 2cbb6796f3..cbfdcbec9b 100644 --- a/packages/bbui/src/DetailSummary/DetailSummary.svelte +++ b/packages/bbui/src/DetailSummary/DetailSummary.svelte @@ -15,6 +15,8 @@ } + +
{#if name}
diff --git a/packages/bbui/src/FancyForm/FancyField.svelte b/packages/bbui/src/FancyForm/FancyField.svelte index 455f4b38fb..798f486187 100644 --- a/packages/bbui/src/FancyForm/FancyField.svelte +++ b/packages/bbui/src/FancyForm/FancyField.svelte @@ -36,6 +36,8 @@ }) + +
+
+ +
{/key} {#if open} +
{/if} diff --git a/packages/bbui/src/Form/Core/Dropzone.svelte b/packages/bbui/src/Form/Core/Dropzone.svelte index fa0be630ba..2bd95df516 100644 --- a/packages/bbui/src/Form/Core/Dropzone.svelte +++ b/packages/bbui/src/Form/Core/Dropzone.svelte @@ -137,6 +137,9 @@ } + + +
{#if selectedImage} {#if gallery} diff --git a/packages/bbui/src/Form/Core/EnvDropdown.svelte b/packages/bbui/src/Form/Core/EnvDropdown.svelte index c690ffbc6b..ed5878d6b2 100644 --- a/packages/bbui/src/Form/Core/EnvDropdown.svelte +++ b/packages/bbui/src/Form/Core/EnvDropdown.svelte @@ -96,6 +96,8 @@ } + +
+ +
{#if value}
diff --git a/packages/bbui/src/Form/Core/InputDropdown.svelte b/packages/bbui/src/Form/Core/InputDropdown.svelte index 128353b7b9..c1bc2ac7e5 100644 --- a/packages/bbui/src/Form/Core/InputDropdown.svelte +++ b/packages/bbui/src/Form/Core/InputDropdown.svelte @@ -110,6 +110,7 @@ } +
+ +
+ +
(showTooltip = true)} diff --git a/packages/bbui/src/IconPicker/IconPicker.svelte b/packages/bbui/src/IconPicker/IconPicker.svelte index b3cc72daa3..3cd7a16eb0 100644 --- a/packages/bbui/src/IconPicker/IconPicker.svelte +++ b/packages/bbui/src/IconPicker/IconPicker.svelte @@ -58,6 +58,8 @@ } + +
(open = true)}>
+ +
+ +
copyToClipboard(value)}> diff --git a/packages/bbui/src/List/ListItem.svelte b/packages/bbui/src/List/ListItem.svelte index 28015c4c57..76b242cf9c 100644 --- a/packages/bbui/src/List/ListItem.svelte +++ b/packages/bbui/src/List/ListItem.svelte @@ -15,6 +15,8 @@ $: initials = avatar ? title?.[0] : null + +
{#if icon} diff --git a/packages/bbui/src/Menu/Item.svelte b/packages/bbui/src/Menu/Item.svelte index ed759f5b10..05a33adda9 100644 --- a/packages/bbui/src/Menu/Item.svelte +++ b/packages/bbui/src/Menu/Item.svelte @@ -33,6 +33,7 @@ } +
  • + +
    Click me {remaining} diff --git a/packages/bbui/src/Modal/Modal.svelte b/packages/bbui/src/Modal/Modal.svelte index da97bf332e..f891d0584d 100644 --- a/packages/bbui/src/Modal/Modal.svelte +++ b/packages/bbui/src/Modal/Modal.svelte @@ -100,6 +100,7 @@ --> {#if visible} +
    + +
    + +