Add some new resolution aliases and simplify long nasty relative import paths

This commit is contained in:
Andrew Kingston 2024-02-05 12:08:45 +00:00
parent e7ac33bf43
commit 1efd5725c7
60 changed files with 65 additions and 106 deletions

View File

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

View File

@ -2,7 +2,7 @@
import { tables } from "stores/builder"
import { API } from "api"
import { Select, Label, Multiselect } from "@budibase/bbui"
import { capitalise } from "../../helpers"
import { capitalise } from "helpers"
import { createEventDispatcher } from "svelte"
export let schema

View File

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

View File

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

View File

@ -3,7 +3,7 @@
import {
readableToRuntimeBinding,
runtimeToReadableBinding,
} from "../../../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 "../../../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 "../../../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 "../../../dataBinding"
} from "dataBinding"
import ServerBindingPanel from "components/common/bindings/ServerBindingPanel.svelte"
import { createEventDispatcher } from "svelte"
import { isJSBinding } from "@budibase/string-templates"

View File

@ -1,9 +1,6 @@
<script>
import { Layout, Input } from "@budibase/bbui"
import {
createValidationStore,
requiredValidator,
} from "../../../helpers/validation"
import { createValidationStore, requiredValidator } from "helpers/validation"
export let password
export let error

View File

@ -16,7 +16,7 @@
getActionBindings,
makeStateBinding,
updateReferencesInObject,
} from "../../../../../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 { selectedScreen, componentStore } from "stores/builder"
import { getActionProviders } from "../../../../../../dataBinding"
import { getActionProviders } from "dataBinding"
export let parameters
export let nested

View File

@ -6,7 +6,7 @@
tables,
viewsV2,
} from "stores/builder"
import { getSchemaForDatasourcePlus } from "../../../../../../dataBinding"
import { getSchemaForDatasourcePlus } from "dataBinding"
import SaveFields from "./SaveFields.svelte"
import { getDatasourceLikeProviders } from "components/design/settings/controls/ButtonActionEditor/actions/utils"

View File

@ -3,10 +3,7 @@
import { findAllMatchingComponents, findComponent } from "helpers/components"
import { selectedScreen } from "stores/builder"
import { onMount } from "svelte"
import {
getDatasourceForProvider,
getSchemaForDatasource,
} from "../../../../../../dataBinding"
import { getDatasourceForProvider, getSchemaForDatasource } from "dataBinding"
export let parameters

View File

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

View File

@ -6,7 +6,7 @@
tables,
viewsV2,
} from "stores/builder"
import { getSchemaForDatasourcePlus } from "../../../../../../dataBinding"
import { getSchemaForDatasourcePlus } from "dataBinding"
import SaveFields from "./SaveFields.svelte"
import { getDatasourceLikeProviders } from "components/design/settings/controls/ButtonActionEditor/actions/utils"

View File

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

View File

@ -3,10 +3,7 @@
import { onMount } from "svelte"
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
import { selectedScreen, componentStore } from "stores/builder"
import {
getActionProviders,
buildFormSchema,
} from "../../../../../../dataBinding"
import { getActionProviders, buildFormSchema } from "dataBinding"
import { findComponent } from "helpers/components"
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 "../../../../../../dataBinding"
import { getAllStateVariables } from "dataBinding"
export let parameters
export let bindings = []

View File

@ -1,4 +1,4 @@
import { getComponentContexts } from "../../../../../../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 "../../../../../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 "../../../../../dataBinding"
import { runtimeToReadableBinding } from "dataBinding"
import { isJSBinding } from "@budibase/string-templates"
export let item

View File

@ -3,10 +3,7 @@
import { createEventDispatcher } from "svelte"
import ColumnDrawer from "./ColumnDrawer.svelte"
import { cloneDeep } from "lodash/fp"
import {
getDatasourceForProvider,
getSchemaForDatasource,
} from "../../../../../dataBinding"
import { getDatasourceForProvider, getSchemaForDatasource } from "dataBinding"
import { selectedScreen } from "stores/builder"
import { getFields } from "helpers/searchFields"

View File

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

View File

@ -3,7 +3,7 @@
import { componentStore } from "stores/builder"
import { cloneDeep } from "lodash/fp"
import { createEventDispatcher, getContext } from "svelte"
import ComponentSettingsSection from "../../../../pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Component/ComponentSettingsSection.svelte"
import ComponentSettingsSection from "pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Component/ComponentSettingsSection.svelte"
export let anchor
export let componentInstance

View File

@ -6,7 +6,7 @@
getSchemaForDatasource,
getBindableProperties,
getComponentBindableProperties,
} from "../../../../../dataBinding"
} from "dataBinding"
import { selectedScreen, 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 "../../../../../dataBinding"
import { runtimeToReadableBinding } from "dataBinding"
import { isJSBinding } from "@budibase/string-templates"
import { componentStore } from "stores/builder"

View File

@ -1,9 +1,6 @@
<script>
import { Select } from "@budibase/bbui"
import {
getDatasourceForProvider,
getSchemaForDatasource,
} from "../../../../dataBinding"
import { getDatasourceForProvider, getSchemaForDatasource } from "dataBinding"
import { selectedScreen } from "stores/builder"
import { createEventDispatcher } from "svelte"

View File

@ -1,10 +1,7 @@
<script>
import { notifications, ActionButton, Button, Drawer } from "@budibase/bbui"
import { createEventDispatcher } from "svelte"
import {
getDatasourceForProvider,
getSchemaForDatasource,
} from "../../../../../dataBinding"
import { getDatasourceForProvider, getSchemaForDatasource } from "dataBinding"
import FilterDrawer from "./FilterDrawer.svelte"
import { selectedScreen } 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 "../../../../dataBinding"
import ComponentSettingsSection from "pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Component/ComponentSettingsSection.svelte"
import { getDatasourceForProvider } from "dataBinding"
import { selectedScreen, componentStore, previewStore } from "stores/builder"
import { Helpers } from "@budibase/bbui"
import { derived, writable } from "svelte/store"

View File

@ -1,8 +1,5 @@
<script>
import {
getDatasourceForProvider,
getSchemaForDatasource,
} from "../../../../../dataBinding"
import { getDatasourceForProvider, getSchemaForDatasource } from "dataBinding"
import { selectedScreen, componentStore } from "stores/builder"
import DraggableList from "../DraggableList/DraggableList.svelte"
import { createEventDispatcher } from "svelte"

View File

@ -1,9 +1,6 @@
<script>
import { Multiselect } from "@budibase/bbui"
import {
getDatasourceForProvider,
getSchemaForDatasource,
} from "../../../../dataBinding"
import { getDatasourceForProvider, getSchemaForDatasource } from "dataBinding"
import { selectedScreen } from "stores/builder"
import { createEventDispatcher } from "svelte"

View File

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

View File

@ -3,10 +3,7 @@
findClosestMatchingComponent,
findComponent,
} from "helpers/components"
import {
getDatasourceForProvider,
getSchemaForDatasource,
} from "../../../../dataBinding"
import { getDatasourceForProvider, getSchemaForDatasource } from "dataBinding"
import { tables, selectedScreen, componentStore } from "stores/builder"
import FilterEditor from "./FilterEditor/FilterEditor.svelte"

View File

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

View File

@ -1,9 +1,6 @@
<script>
import { Multiselect } from "@budibase/bbui"
import {
getDatasourceForProvider,
getSchemaForDatasource,
} from "../../../../dataBinding"
import { getDatasourceForProvider, getSchemaForDatasource } from "dataBinding"
import { selectedScreen, tables } from "stores/builder"
import { createEventDispatcher } from "svelte"
import { getFields } from "helpers/searchFields"

View File

@ -1,9 +1,6 @@
<script>
import { Select } from "@budibase/bbui"
import {
getDatasourceForProvider,
getSchemaForDatasource,
} from "../../../../dataBinding"
import { getDatasourceForProvider, getSchemaForDatasource } from "dataBinding"
import { selectedScreen } from "stores/builder"
import { createEventDispatcher } from "svelte"
import { canBeSortColumn } from "@budibase/shared-core"

View File

@ -12,10 +12,7 @@
} from "@budibase/bbui"
import { selectedScreen, selectedComponent } from "stores/builder"
import { findClosestMatchingComponent } from "helpers/components"
import {
getSchemaForDatasource,
getDatasourceForProvider,
} from "../../../../../dataBinding"
import { getSchemaForDatasource, getDatasourceForProvider } from "dataBinding"
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
import { generate } from "shortid"

View File

@ -3,7 +3,7 @@
import {
readableToRuntimeBinding,
runtimeToReadableBinding,
} from "../../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 "../../dataBinding"
import { getUserBindings } from "dataBinding"
export let queryBindings = []

View File

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

View File

@ -1,6 +1,6 @@
<script>
import { Body, ProgressBar, Heading, Icon, Link } from "@budibase/bbui"
import { admin, auth } from "../../stores/portal"
import { admin, auth } from "stores/portal"
import { onMount } from "svelte"
export let usage

View File

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

View File

@ -1,8 +1,5 @@
import { findClosestMatchingComponent } from "helpers/components"
import {
getDatasourceForProvider,
getSchemaForDatasource,
} from "../dataBinding"
import { getDatasourceForProvider, getSchemaForDatasource } from "dataBinding"
export const getComponentFieldOptions = (asset, id, type, loose = true) => {
const form = findClosestMatchingComponent(

View File

@ -12,10 +12,7 @@
} from "@budibase/bbui"
import { AUTH_TYPE_LABELS, AUTH_TYPES } from "./authTypes"
import BindableCombobox from "components/common/bindings/BindableCombobox.svelte"
import {
getAuthBindings,
getEnvironmentBindings,
} from "../../../../../../../../../../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 "../../../../../../../../../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 "../../../../../../../../../../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 "../../../../../../../../../dataBinding"
} from "dataBinding"
import { ActionButton, notifications } from "@budibase/bbui"
import { capitalise } from "helpers"

View File

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

View File

@ -13,7 +13,7 @@
import { selectedScreen, screenStore } from "stores/builder"
import sanitizeUrl from "helpers/sanitizeUrl"
import ButtonActionEditor from "components/design/settings/controls/ButtonActionEditor/ButtonActionEditor.svelte"
import { getBindableProperties } from "../../../../../../../../../dataBinding"
import { getBindableProperties } from "dataBinding"
$: bindings = getBindableProperties($selectedScreen, null)

View File

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

View File

@ -16,7 +16,7 @@
import { auth, admin } from "stores/portal"
import { redirect } from "@roxi/routify"
import { processStringSync } from "@budibase/string-templates"
import DeleteLicenseKeyModal from "../../../../components/portal/licensing/DeleteLicenseKeyModal.svelte"
import DeleteLicenseKeyModal from "components/portal/licensing/DeleteLicenseKeyModal.svelte"
import { API } from "api"
import { onMount } from "svelte"
import { sdk } from "@budibase/shared-core"

View File

@ -1,6 +1,6 @@
<script>
import { ModalContent, Body, Layout, Icon } from "@budibase/bbui"
import { OnboardingType } from "../../../../../../constants"
import { OnboardingType } from "constants"
export let chooseCreationType

View File

@ -36,7 +36,7 @@
import { get } from "svelte/store"
import { Constants, Utils, fetchData } from "@budibase/frontend-core"
import { API } from "api"
import { OnboardingType } from "../../../../../constants"
import { OnboardingType } from "constants"
import ScimBanner from "../_components/SCIMBanner.svelte"
import { sdk } from "@budibase/shared-core"

View File

@ -1,6 +1,6 @@
<script>
import { redirect } from "@roxi/routify"
import { auth } from "../stores/portal"
import { auth } from "stores/portal"
import { onMount } from "svelte"
import { notifications } from "@budibase/bbui"

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 "../../dataBinding"
import { updateReferencesInObject } from "dataBinding"
const initialAutomationState = {
automations: [],

View File

@ -20,7 +20,7 @@ import {
previewStore,
tables,
} from "stores/builder/index"
import { buildFormSchema, getSchemaForDatasource } from "../../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 "../../../../templates/Component"
import { Screen } from "../../../../templates/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 { writable } from "svelte/store"
import { AppStatus } from "../../constants"
import { AppStatus } from "constants"
import { API } from "api"
// properties that should always come from the dev app, not the deployed

View File

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

View File

@ -98,6 +98,10 @@ export default defineConfig(({ mode }) => {
find: "components",
replacement: path.resolve("./src/components"),
},
{
find: "pages",
replacement: path.resolve("./src/pages"),
},
{
find: "templates",
replacement: path.resolve("./src/templates"),