Remove legacy nested builder directory and move screen templates and utils into better locations

This commit is contained in:
Andrew Kingston 2024-02-01 09:55:30 +00:00
parent 69dae35e2a
commit 233df4c27c
70 changed files with 79 additions and 71 deletions

View File

@ -23,7 +23,6 @@
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/internals/mocks/fileMock.js",
"\\.(css|less|sass|scss)$": "identity-obj-proxy",
"components(.*)$": "<rootDir>/src/components$1",
"builder(.*)$": "<rootDir>/src/builder$1",
"stores(.*)$": "<rootDir>/src/stores$1",
"analytics(.*)$": "<rootDir>/src/analytics$1",
"constants/backend": "<rootDir>/src/constants/backend/index.js"

View File

@ -13,7 +13,7 @@
import { admin, licensing } from "stores/portal"
import { externalActions } from "./ExternalActions"
import { TriggerStepID, ActionStepID } from "constants/backend/automations"
import { checkForCollectStep } from "builder/utils"
import { checkForCollectStep } from "helpers/utils"
export let blockIdx
export let lastStep

View File

@ -42,7 +42,7 @@
import {
getSchemaForDatasourcePlus,
getEnvironmentBindings,
} from "builder/dataBinding"
} from "../../../dataBinding"
import { TriggerStepID, ActionStepID } from "constants/backend/automations"
import { onMount } from "svelte"
import { cloneDeep } from "lodash/fp"

View File

@ -28,7 +28,7 @@
PrettyRelationshipDefinitions,
DB_TYPE_EXTERNAL,
} from "constants/backend"
import { getAutoColumnInformation, buildAutoColumn } from "builder/utils"
import { getAutoColumnInformation, buildAutoColumn } from "helpers/utils"
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
import ModalBindableInput from "components/common/bindings/ModalBindableInput.svelte"
import { getBindings } from "components/backend/DataTable/formula"

View File

@ -13,7 +13,7 @@
} from "@budibase/bbui"
import { onMount, createEventDispatcher } from "svelte"
import { FIELDS } from "constants/backend"
import { generate } from "builder/schemaGenerator"
import { generate } from "helpers/schemaGenerator"
export let schema = {}
export let json

View File

@ -3,7 +3,7 @@
import {
readableToRuntimeBinding,
runtimeToReadableBinding,
} from "builder/dataBinding"
} from "../../../dataBinding"
import { createEventDispatcher } from "svelte"
import { isJSBinding } from "@budibase/string-templates"

View File

@ -19,7 +19,7 @@
import {
readableToRuntimeBinding,
runtimeToReadableBinding,
} from "builder/dataBinding"
} from "../../../dataBinding"
import { admin } from "stores/portal"
import CodeEditor from "../CodeEditor/CodeEditor.svelte"

View File

@ -3,7 +3,7 @@
import {
readableToRuntimeBinding,
runtimeToReadableBinding,
} from "builder/dataBinding"
} from "../../../dataBinding"
import ClientBindingPanel from "components/common/bindings/ClientBindingPanel.svelte"
import { createEventDispatcher, setContext } from "svelte"
import { isJSBinding } from "@budibase/string-templates"

View File

@ -3,7 +3,7 @@
import {
readableToRuntimeBinding,
runtimeToReadableBinding,
} from "builder/dataBinding"
} from "../../../dataBinding"
import ClientBindingPanel from "components/common/bindings/ClientBindingPanel.svelte"
import { createEventDispatcher, setContext } from "svelte"

View File

@ -3,7 +3,7 @@
import {
readableToRuntimeBinding,
runtimeToReadableBinding,
} from "builder/dataBinding"
} from "../../../dataBinding"
import ClientBindingPanel from "components/common/bindings/ClientBindingPanel.svelte"
import { createEventDispatcher, setContext } from "svelte"

View File

@ -3,7 +3,7 @@
import {
readableToRuntimeBinding,
runtimeToReadableBinding,
} from "builder/dataBinding"
} from "../../../dataBinding"
import ServerBindingPanel from "components/common/bindings/ServerBindingPanel.svelte"
import { createEventDispatcher } from "svelte"
import { isJSBinding } from "@budibase/string-templates"

View File

@ -1,6 +1,6 @@
<script>
import { ModalContent, Input } from "@budibase/bbui"
import sanitizeUrl from "builder/store/screenTemplates/utils/sanitizeUrl"
import sanitizeUrl from "helpers/sanitizeUrl"
import { get } from "svelte/store"
import { screenStore } from "stores/builder"

View File

@ -16,7 +16,7 @@
getActionBindings,
makeStateBinding,
updateReferencesInObject,
} from "builder/dataBinding"
} from "../../../../../dataBinding"
import { cloneDeep } from "lodash/fp"
const flipDurationMs = 150

View File

@ -1,7 +1,7 @@
<script>
import { Select, Label } from "@budibase/bbui"
import { currentAsset, componentStore } from "stores/builder"
import { getActionProviders } from "builder/dataBinding"
import { getActionProviders } from "../../../../../../dataBinding"
import { onMount } from "svelte"
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"

View File

@ -1,7 +1,7 @@
<script>
import { Select, Label } from "@budibase/bbui"
import { currentAsset, componentStore } from "stores/builder"
import { getActionProviders } from "builder/dataBinding"
import { getActionProviders } from "../../../../../../dataBinding"
export let parameters
export let nested

View File

@ -1,7 +1,7 @@
<script>
import { Select, Label, Body, Checkbox, Input } from "@budibase/bbui"
import { currentAsset, componentStore, tables, viewsV2 } from "stores/builder"
import { getSchemaForDatasourcePlus } from "builder/dataBinding"
import { getSchemaForDatasourcePlus } from "../../../../../../dataBinding"
import SaveFields from "./SaveFields.svelte"
import { getDatasourceLikeProviders } from "components/design/settings/controls/ButtonActionEditor/actions/utils"

View File

@ -9,7 +9,7 @@
import {
getDatasourceForProvider,
getSchemaForDatasource,
} from "builder/dataBinding"
} from "../../../../../../dataBinding"
export let parameters

View File

@ -1,7 +1,7 @@
<script>
import { Select, Label } from "@budibase/bbui"
import { currentAsset, componentStore } from "stores/builder"
import { getActionProviders } from "builder/dataBinding"
import { getActionProviders } from "../../../../../../dataBinding"
export let parameters
export let nested

View File

@ -1,7 +1,7 @@
<script>
import { Select, Label, Body, Checkbox, Input } from "@budibase/bbui"
import { currentAsset, componentStore, tables, viewsV2 } from "stores/builder"
import { getSchemaForDatasourcePlus } from "builder/dataBinding"
import { getSchemaForDatasourcePlus } from "../../../../../../dataBinding"
import SaveFields from "./SaveFields.svelte"
import { getDatasourceLikeProviders } from "components/design/settings/controls/ButtonActionEditor/actions/utils"

View File

@ -1,7 +1,10 @@
<script>
import { currentAsset, componentStore } from "stores/builder"
import { Label, Combobox, Select } from "@budibase/bbui"
import { getActionProviders, buildFormSchema } from "builder/dataBinding"
import {
getActionProviders,
buildFormSchema,
} from "../../../../../../dataBinding"
import { findComponent } from "stores/builder/components/utils"
export let parameters

View File

@ -3,7 +3,10 @@
import { onMount } from "svelte"
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
import { currentAsset, componentStore } from "stores/builder"
import { getActionProviders, buildFormSchema } from "builder/dataBinding"
import {
getActionProviders,
buildFormSchema,
} from "../../../../../../dataBinding"
import { findComponent } from "stores/builder/components/utils"
export let parameters

View File

@ -2,7 +2,7 @@
import { Select, Label, Combobox, Checkbox, Body } from "@budibase/bbui"
import { onMount } from "svelte"
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
import { getAllStateVariables } from "builder/dataBinding"
import { getAllStateVariables } from "../../../../../../dataBinding"
export let parameters
export let bindings = []

View File

@ -1,7 +1,7 @@
<script>
import { Select, Label } from "@budibase/bbui"
import { currentAsset, componentStore } from "stores/builder"
import { getActionProviders } from "builder/dataBinding"
import { getActionProviders } from "../../../../../../dataBinding"
export let parameters
export let nested

View File

@ -1,4 +1,4 @@
import { getComponentContexts } from "builder/dataBinding"
import { getComponentContexts } from "../../../../../../dataBinding"
import { capitalise } from "helpers"
// Generates bindings for all components that provider "datasource like"

View File

@ -4,7 +4,7 @@
import { createEventDispatcher } from "svelte"
import { Helpers } from "@budibase/bbui"
import { componentStore } from "stores/builder"
import { getEventContextBindings } from "builder/dataBinding"
import { getEventContextBindings } from "../../../../../dataBinding"
import { cloneDeep, isEqual } from "lodash/fp"
export let componentInstance

View File

@ -1,7 +1,7 @@
<script>
import EditComponentPopover from "../EditComponentPopover.svelte"
import { Icon } from "@budibase/bbui"
import { runtimeToReadableBinding } from "builder/dataBinding"
import { runtimeToReadableBinding } from "../../../../../dataBinding"
import { isJSBinding } from "@budibase/string-templates"
export let item

View File

@ -6,7 +6,7 @@
import {
getDatasourceForProvider,
getSchemaForDatasource,
} from "builder/dataBinding"
} from "../../../../../dataBinding"
import { currentAsset } from "stores/builder"
import { getFields } from "helpers/searchFields"

View File

@ -2,7 +2,7 @@
import {
readableToRuntimeBinding,
runtimeToReadableBinding,
} from "builder/dataBinding"
} from "../../../../../dataBinding"
import {
Button,
Popover,

View File

@ -6,7 +6,7 @@
getSchemaForDatasource,
getBindableProperties,
getComponentBindableProperties,
} from "builder/dataBinding"
} from "../../../../../dataBinding"
import { selectedScreen, currentAsset, componentStore } from "stores/builder"
import DraggableList from "../DraggableList/DraggableList.svelte"
import { createEventDispatcher } from "svelte"

View File

@ -3,7 +3,7 @@
import { Toggle, Icon } from "@budibase/bbui"
import { createEventDispatcher } from "svelte"
import { cloneDeep } from "lodash/fp"
import { runtimeToReadableBinding } from "builder/dataBinding"
import { runtimeToReadableBinding } from "../../../../../dataBinding"
import { isJSBinding } from "@budibase/string-templates"
import { componentStore } from "stores/builder"

View File

@ -3,7 +3,7 @@
import {
getDatasourceForProvider,
getSchemaForDatasource,
} from "builder/dataBinding"
} from "../../../../dataBinding"
import { currentAsset } from "stores/builder"
import { createEventDispatcher } from "svelte"

View File

@ -4,7 +4,7 @@
import {
getDatasourceForProvider,
getSchemaForDatasource,
} from "builder/dataBinding"
} from "../../../../../dataBinding"
import FilterDrawer from "./FilterDrawer.svelte"
import { currentAsset } from "stores/builder"

View File

@ -1,7 +1,7 @@
<script>
import { createEventDispatcher, setContext } from "svelte"
import ComponentSettingsSection from "../../../../pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Component/ComponentSettingsSection.svelte"
import { getDatasourceForProvider } from "builder/dataBinding"
import { getDatasourceForProvider } from "../../../../dataBinding"
import { currentAsset, componentStore, previewStore } from "stores/builder"
import { Helpers } from "@budibase/bbui"
import { derived, writable } from "svelte/store"

View File

@ -2,7 +2,7 @@
import {
getDatasourceForProvider,
getSchemaForDatasource,
} from "builder/dataBinding"
} from "../../../../../dataBinding"
import { currentAsset, componentStore } from "stores/builder"
import DraggableList from "../DraggableList/DraggableList.svelte"
import { createEventDispatcher } from "svelte"

View File

@ -3,7 +3,7 @@
import {
getDatasourceForProvider,
getSchemaForDatasource,
} from "builder/dataBinding"
} from "../../../../dataBinding"
import { currentAsset } from "stores/builder"
import { createEventDispatcher } from "svelte"

View File

@ -3,7 +3,7 @@
import {
readableToRuntimeBinding,
runtimeToReadableBinding,
} from "builder/dataBinding"
} from "../../../../dataBinding"
import { builderStore } from "stores/builder"
import { onDestroy } from "svelte"

View File

@ -6,7 +6,7 @@
import {
getDatasourceForProvider,
getSchemaForDatasource,
} from "builder/dataBinding"
} from "../../../../dataBinding"
import { tables, currentAsset, componentStore } from "stores/builder"
import FilterEditor from "./FilterEditor/FilterEditor.svelte"

View File

@ -2,7 +2,7 @@
import { ActionButton, notifications } from "@budibase/bbui"
import { currentAsset, componentStore } from "stores/builder"
import { findClosestMatchingComponent } from "stores/builder/components/utils"
import { makeDatasourceFormComponents } from "builder/store/screenTemplates/utils/commonComponents"
import { makeDatasourceFormComponents } from "../../../../templates/commonComponents"
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
export let componentInstance

View File

@ -3,7 +3,7 @@
import {
getDatasourceForProvider,
getSchemaForDatasource,
} from "builder/dataBinding"
} from "../../../../dataBinding"
import { currentAsset, tables } from "stores/builder"
import { createEventDispatcher } from "svelte"
import { getFields } from "helpers/searchFields"

View File

@ -3,7 +3,7 @@
import {
getDatasourceForProvider,
getSchemaForDatasource,
} from "builder/dataBinding"
} from "../../../../dataBinding"
import { currentAsset } from "stores/builder"
import { createEventDispatcher } from "svelte"
import { canBeSortColumn } from "@budibase/shared-core"

View File

@ -15,7 +15,7 @@
import {
getSchemaForDatasource,
getDatasourceForProvider,
} from "builder/dataBinding"
} from "../../../../../dataBinding"
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
import { generate } from "shortid"

View File

@ -3,7 +3,7 @@
import {
readableToRuntimeBinding,
runtimeToReadableBinding,
} from "builder/dataBinding"
} from "../../dataBinding"
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
import { createEventDispatcher } from "svelte"

View File

@ -1,6 +1,6 @@
<script>
import KeyValueBuilder from "components/integration/KeyValueBuilder.svelte"
import { getUserBindings } from "builder/dataBinding"
import { getUserBindings } from "../../dataBinding"
export let queryBindings = []

View File

@ -48,7 +48,7 @@
runtimeToReadableBinding,
runtimeToReadableMap,
toBindingsArray,
} from "builder/dataBinding"
} from "../../dataBinding"
export let queryId

View File

@ -22,7 +22,7 @@ import {
decodeJSBinding,
encodeJSBinding,
} from "@budibase/string-templates"
import { TableNames } from "../constants"
import { TableNames } from "constants"
import { JSONUtils } from "@budibase/frontend-core"
import ActionDefinitions from "components/design/settings/controls/ButtonActionEditor/manifest.json"
import { environment, licensing } from "stores/portal"

View File

@ -3,7 +3,7 @@ import {
runtimeToReadableBinding,
readableToRuntimeBinding,
updateReferencesInObject,
} from "builder/dataBinding"
} from "./dataBinding"
describe("Builder dataBinding", () => {
beforeEach(() => {

View File

@ -2,7 +2,7 @@ import { findClosestMatchingComponent } from "stores/builder/components/utils"
import {
getDatasourceForProvider,
getSchemaForDatasource,
} from "builder/dataBinding"
} from "../dataBinding"
export const getComponentFieldOptions = (asset, id, type, loose = true) => {
const form = findClosestMatchingComponent(

View File

@ -1,11 +1,11 @@
import { ActionStepID } from "constants/backend/automations"
import { TableNames } from "../constants"
import { TableNames } from "constants"
import {
AUTO_COLUMN_DISPLAY_NAMES,
AUTO_COLUMN_SUB_TYPES,
FIELDS,
isAutoColumnUserRelationship,
} from "../constants/backend"
} from "constants/backend"
export function getAutoColumnInformation(enabled = true) {
let info = {}

View File

@ -12,7 +12,10 @@
} from "@budibase/bbui"
import { AUTH_TYPE_LABELS, AUTH_TYPES } from "./authTypes"
import BindableCombobox from "components/common/bindings/BindableCombobox.svelte"
import { getAuthBindings, getEnvironmentBindings } from "builder/dataBinding"
import {
getAuthBindings,
getEnvironmentBindings,
} from "../../../../../../../../../../dataBinding"
import { environment, licensing, auth } from "stores/portal"
import CreateEditVariableModal from "components/portal/environment/CreateEditVariableModal.svelte"

View File

@ -5,7 +5,7 @@
getRestBindings,
readableToRuntimeBinding,
runtimeToReadableMap,
} from "builder/dataBinding"
} from "../../../../../../../../../dataBinding"
import { cloneDeep } from "lodash/fp"
import SaveDatasourceButton from "./SaveDatasourceButton.svelte"
import Panel from "./Panel.svelte"

View File

@ -2,7 +2,7 @@
import { Heading, Layout } from "@budibase/bbui"
import KeyValueBuilder from "components/integration/KeyValueBuilder.svelte"
import ViewDynamicVariables from "./ViewDynamicVariables.svelte"
import { getEnvironmentBindings } from "builder/dataBinding"
import { getEnvironmentBindings } from "../../../../../../../../../../dataBinding"
import { licensing } from "stores/portal"
import { queries } from "stores/builder"
import { cloneDeep } from "lodash/fp"

View File

@ -13,7 +13,7 @@
import {
getBindableProperties,
getComponentBindableProperties,
} from "builder/dataBinding"
} from "../../../../../../../../../dataBinding"
import { ActionButton, notifications } from "@budibase/bbui"
import { capitalise } from "helpers"

View File

@ -15,7 +15,7 @@
getBindableProperties,
readableToRuntimeBinding,
runtimeToReadableBinding,
} from "builder/dataBinding"
} from "../../../../../../../../../dataBinding"
export let componentInstance
export let componentDefinition

View File

@ -11,9 +11,9 @@
import PropertyControl from "components/design/settings/controls/PropertyControl.svelte"
import RoleSelect from "components/design/settings/controls/RoleSelect.svelte"
import { selectedScreen, screenStore } from "stores/builder"
import sanitizeUrl from "builder/store/screenTemplates/utils/sanitizeUrl"
import sanitizeUrl from "helpers/sanitizeUrl"
import ButtonActionEditor from "components/design/settings/controls/ButtonActionEditor/ButtonActionEditor.svelte"
import { getBindableProperties } from "builder/dataBinding"
import { getBindableProperties } from "../../../../../../../../../dataBinding"
$: bindings = getBindableProperties($selectedScreen, null)

View File

@ -10,7 +10,7 @@
notifications,
} from "@budibase/bbui"
import ScreenDetailsModal from "components/design/ScreenDetailsModal.svelte"
import sanitizeUrl from "builder/store/screenTemplates/utils/sanitizeUrl"
import sanitizeUrl from "helpers/sanitizeUrl"
import { makeComponentUnique } from "stores/builder/components/utils"
export let screenId

View File

@ -2,11 +2,11 @@
import ScreenDetailsModal from "components/design/ScreenDetailsModal.svelte"
import DatasourceModal from "./DatasourceModal.svelte"
import ScreenRoleModal from "./ScreenRoleModal.svelte"
import sanitizeUrl from "builder/store/screenTemplates/utils/sanitizeUrl"
import sanitizeUrl from "helpers/sanitizeUrl"
import { Modal, notifications } from "@budibase/bbui"
import { screenStore, navigationStore, tables } from "stores/builder"
import { get } from "svelte/store"
import getTemplates from "builder/store/screenTemplates"
import getTemplates from "templates"
import { Roles } from "constants/backend"
import { capitalise } from "helpers"
import { goto } from "@roxi/routify"

View File

@ -4,7 +4,7 @@
import ICONS from "components/backend/DatasourceNavigator/icons"
import { IntegrationNames } from "constants"
import { onMount } from "svelte"
import rowListScreen from "builder/store/screenTemplates/rowListScreen"
import rowListScreen from "../../../../../../../templates/rowListScreen"
import DatasourceTemplateRow from "./DatasourceTemplateRow.svelte"
export let mode

View File

@ -4,7 +4,7 @@ import { cloneDeep } from "lodash/fp"
import { generate } from "shortid"
import { createHistoryStore } from "stores/builder/history"
import { notifications } from "@budibase/bbui"
import { updateReferencesInObject } from "builder/dataBinding"
import { updateReferencesInObject } from "../../dataBinding"
const initialAutomationState = {
automations: [],

View File

@ -15,7 +15,7 @@ import {
import { getComponentFieldOptions } from "helpers/formFields"
import { selectedScreen } from "../screens"
import { screenStore, appStore, previewStore, tables } from "stores/builder"
import { buildFormSchema, getSchemaForDatasource } from "builder/dataBinding"
import { buildFormSchema, getSchemaForDatasource } from "../../../dataBinding"
import {
BUDIBASE_INTERNAL_DB_ID,
DEFAULT_BB_DATASOURCE_ID,

View File

@ -1,6 +1,6 @@
import { v4 } from "uuid"
import { Component } from "builder/store/screenTemplates/utils/Component"
import { Screen } from "builder/store/screenTemplates/utils/Screen"
import { Component } from "../../../../templates/Component"
import { Screen } from "../../../../templates/Screen"
import { get } from "svelte/store"
import {
BUDIBASE_INTERNAL_DB_ID,

View File

@ -1,5 +1,5 @@
import { Component } from "./Component"
import { getSchemaForDatasource } from "../../../dataBinding"
import { getSchemaForDatasource } from "../dataBinding"
const fieldTypeToComponentMap = {
string: "stringfield",

View File

@ -1,4 +1,4 @@
import { Screen } from "./utils/Screen"
import { Screen } from "./Screen"
export default {
name: `Create from scratch`,

View File

@ -1,6 +1,6 @@
import sanitizeUrl from "./utils/sanitizeUrl"
import { Screen } from "./utils/Screen"
import { Component } from "./utils/Component"
import sanitizeUrl from "helpers/sanitizeUrl"
import { Screen } from "./Screen"
import { Component } from "./Component"
export default function (datasources, mode = "table") {
if (!Array.isArray(datasources)) {

View File

@ -99,8 +99,8 @@ export default defineConfig(({ mode }) => {
replacement: path.resolve("./src/components"),
},
{
find: "builder",
replacement: path.resolve("./src/builder"),
find: "templates",
replacement: path.resolve("./src/templates"),
},
{
find: "stores",