Merge pull request #15705 from Budibase/types/check-types-in-client
Check types in client
This commit is contained in:
commit
480db7a884
|
@ -18,7 +18,6 @@
|
||||||
"eslint-plugin-jest": "28.9.0",
|
"eslint-plugin-jest": "28.9.0",
|
||||||
"eslint-plugin-local-rules": "3.0.2",
|
"eslint-plugin-local-rules": "3.0.2",
|
||||||
"eslint-plugin-svelte": "2.46.1",
|
"eslint-plugin-svelte": "2.46.1",
|
||||||
"svelte-preprocess": "^6.0.3",
|
|
||||||
"husky": "^8.0.3",
|
"husky": "^8.0.3",
|
||||||
"kill-port": "^1.6.1",
|
"kill-port": "^1.6.1",
|
||||||
"lerna": "7.4.2",
|
"lerna": "7.4.2",
|
||||||
|
@ -29,7 +28,9 @@
|
||||||
"prettier-plugin-svelte": "^2.3.0",
|
"prettier-plugin-svelte": "^2.3.0",
|
||||||
"proper-lockfile": "^4.1.2",
|
"proper-lockfile": "^4.1.2",
|
||||||
"svelte": "4.2.19",
|
"svelte": "4.2.19",
|
||||||
|
"svelte-check": "^4.1.5",
|
||||||
"svelte-eslint-parser": "0.43.0",
|
"svelte-eslint-parser": "0.43.0",
|
||||||
|
"svelte-preprocess": "^6.0.3",
|
||||||
"typescript": "5.7.2",
|
"typescript": "5.7.2",
|
||||||
"typescript-eslint": "8.17.0",
|
"typescript-eslint": "8.17.0",
|
||||||
"yargs": "^17.7.2"
|
"yargs": "^17.7.2"
|
||||||
|
|
|
@ -100,7 +100,6 @@
|
||||||
"jest": "29.7.0",
|
"jest": "29.7.0",
|
||||||
"jsdom": "^21.1.1",
|
"jsdom": "^21.1.1",
|
||||||
"resize-observer-polyfill": "^1.5.1",
|
"resize-observer-polyfill": "^1.5.1",
|
||||||
"svelte-check": "^4.1.0",
|
|
||||||
"svelte-jester": "^1.3.2",
|
"svelte-jester": "^1.3.2",
|
||||||
"vite": "^4.5.0",
|
"vite": "^4.5.0",
|
||||||
"vite-plugin-static-copy": "^0.17.0",
|
"vite-plugin-static-copy": "^0.17.0",
|
||||||
|
|
|
@ -16,7 +16,8 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"dev": "vite build --watch --mode=dev"
|
"dev": "vite build --watch --mode=dev",
|
||||||
|
"check:types": "yarn svelte-check"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/bbui": "*",
|
"@budibase/bbui": "*",
|
||||||
|
|
|
@ -10,7 +10,9 @@ export const API = createAPIClient({
|
||||||
// Attach client specific headers
|
// Attach client specific headers
|
||||||
attachHeaders: headers => {
|
attachHeaders: headers => {
|
||||||
// Attach app ID header
|
// Attach app ID header
|
||||||
headers["x-budibase-app-id"] = window["##BUDIBASE_APP_ID##"]
|
if (window["##BUDIBASE_APP_ID##"]) {
|
||||||
|
headers["x-budibase-app-id"] = window["##BUDIBASE_APP_ID##"]
|
||||||
|
}
|
||||||
|
|
||||||
// Attach client header if not inside the builder preview
|
// Attach client header if not inside the builder preview
|
||||||
if (!window["##BUDIBASE_IN_BUILDER##"]) {
|
if (!window["##BUDIBASE_IN_BUILDER##"]) {
|
||||||
|
|
|
@ -141,6 +141,7 @@
|
||||||
var(--spectrum-global-dimension-size-300)
|
var(--spectrum-global-dimension-size-300)
|
||||||
);
|
);
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
|
line-clamp: 2;
|
||||||
-webkit-line-clamp: 2;
|
-webkit-line-clamp: 2;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
import { isGridEvent } from "@/utils/grid"
|
import { isGridEvent } from "@/utils/grid"
|
||||||
import { DNDPlaceholderID } from "@/constants"
|
import { DNDPlaceholderID } from "@/constants"
|
||||||
import type { Component } from "@budibase/types"
|
import type { Component } from "@budibase/types"
|
||||||
|
import { DropPosition } from "@budibase/types"
|
||||||
|
|
||||||
type ChildCoords = {
|
type ChildCoords = {
|
||||||
placeholder: boolean
|
placeholder: boolean
|
||||||
|
@ -287,7 +288,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert parent + index into target + mode
|
// Convert parent + index into target + mode
|
||||||
let legacyDropTarget, legacyDropMode
|
let legacyDropTarget, legacyDropMode: DropPosition
|
||||||
const parent: Component | null = findComponentById(
|
const parent: Component | null = findComponentById(
|
||||||
get(screenStore).activeScreen?.props,
|
get(screenStore).activeScreen?.props,
|
||||||
drop.parent
|
drop.parent
|
||||||
|
@ -309,16 +310,16 @@
|
||||||
// Use inside if no existing children
|
// Use inside if no existing children
|
||||||
if (!children?.length) {
|
if (!children?.length) {
|
||||||
legacyDropTarget = parent._id
|
legacyDropTarget = parent._id
|
||||||
legacyDropMode = "inside"
|
legacyDropMode = DropPosition.INSIDE
|
||||||
} else if (drop.index === 0) {
|
} else if (drop.index === 0) {
|
||||||
legacyDropTarget = children[0]?._id
|
legacyDropTarget = children[0]?._id
|
||||||
legacyDropMode = "above"
|
legacyDropMode = DropPosition.ABOVE
|
||||||
} else {
|
} else {
|
||||||
legacyDropTarget = children[drop.index - 1]?._id
|
legacyDropTarget = children[drop.index - 1]?._id
|
||||||
legacyDropMode = "below"
|
legacyDropMode = DropPosition.BELOW
|
||||||
}
|
}
|
||||||
|
|
||||||
if (legacyDropTarget && legacyDropMode) {
|
if (legacyDropTarget && legacyDropMode && source.id) {
|
||||||
dropping = true
|
dropping = true
|
||||||
await builderStore.actions.moveComponent(
|
await builderStore.actions.moveComponent(
|
||||||
source.id,
|
source.id,
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
Devices,
|
Devices,
|
||||||
GridDragMode,
|
GridDragMode,
|
||||||
} from "@/utils/grid"
|
} from "@/utils/grid"
|
||||||
|
import { DropPosition } from "@budibase/types"
|
||||||
|
|
||||||
type GridDragSide =
|
type GridDragSide =
|
||||||
| "top"
|
| "top"
|
||||||
|
@ -222,7 +223,7 @@
|
||||||
|
|
||||||
// If holding ctrl/cmd then leave behind a duplicate of this component
|
// If holding ctrl/cmd then leave behind a duplicate of this component
|
||||||
if (mode === GridDragMode.Move && (e.ctrlKey || e.metaKey)) {
|
if (mode === GridDragMode.Move && (e.ctrlKey || e.metaKey)) {
|
||||||
builderStore.actions.duplicateComponent(id, "above", false)
|
builderStore.actions.duplicateComponent(id, DropPosition.ABOVE, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find grid parent and read from DOM
|
// Find grid parent and read from DOM
|
||||||
|
|
|
@ -115,7 +115,7 @@ const createBuilderStore = () => {
|
||||||
component: string,
|
component: string,
|
||||||
parent: string,
|
parent: string,
|
||||||
index: number,
|
index: number,
|
||||||
props: Record<string, any>
|
props?: Record<string, any>
|
||||||
) => {
|
) => {
|
||||||
eventStore.actions.dispatchEvent("drop-new-component", {
|
eventStore.actions.dispatchEvent("drop-new-component", {
|
||||||
component,
|
component,
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
"target": "ESNext",
|
"target": "ESNext",
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
"paths": {
|
"paths": {
|
||||||
"@budibase/*": [
|
"@budibase/*": [
|
||||||
"../*/src/index.ts",
|
"../*/src/index.ts",
|
||||||
|
|
|
@ -16,8 +16,5 @@
|
||||||
"lodash": "4.17.21",
|
"lodash": "4.17.21",
|
||||||
"shortid": "2.2.15",
|
"shortid": "2.2.15",
|
||||||
"socket.io-client": "^4.7.5"
|
"socket.io-client": "^4.7.5"
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"svelte-check": "^4.1.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
export { createAPIClient } from "./api"
|
export { createAPIClient } from "./api"
|
||||||
export type { APIClient } from "./api"
|
export type { APIClient } from "./api"
|
||||||
export { fetchData, DataFetchMap } from "./fetch"
|
export { fetchData, DataFetchMap, type DataFetchType } from "./fetch"
|
||||||
export * as Constants from "./constants"
|
export * as Constants from "./constants"
|
||||||
export * from "./stores"
|
export * from "./stores"
|
||||||
export * from "./utils"
|
export * from "./utils"
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"
|
||||||
|
|
||||||
|
const config = {
|
||||||
|
preprocess: vitePreprocess(),
|
||||||
|
}
|
||||||
|
|
||||||
|
export default config
|
|
@ -20499,10 +20499,10 @@ supports-preserve-symlinks-flag@^1.0.0:
|
||||||
resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
|
resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
|
||||||
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
|
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
|
||||||
|
|
||||||
svelte-check@^4.1.0:
|
svelte-check@^4.1.5:
|
||||||
version "4.1.0"
|
version "4.1.5"
|
||||||
resolved "https://registry.yarnpkg.com/svelte-check/-/svelte-check-4.1.0.tgz#4389c1c88aa24f3d06fe0df94f9075a55017256d"
|
resolved "https://registry.yarnpkg.com/svelte-check/-/svelte-check-4.1.5.tgz#afdb3f8050c123064124d5aa7821365c7befa7a4"
|
||||||
integrity sha512-AflEZYqI578KuDZcpcorPSf597LStxlkN7XqXi38u09zlHODVKd7c+7OuubGzbhgGRUqNTdQCZ+Ga96iRXEf2g==
|
integrity sha512-Gb0T2IqBNe1tLB9EB1Qh+LOe+JB8wt2/rNBDGvkxQVvk8vNeAoG+vZgFB/3P5+zC7RWlyBlzm9dVjZFph/maIg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@jridgewell/trace-mapping" "^0.3.25"
|
"@jridgewell/trace-mapping" "^0.3.25"
|
||||||
chokidar "^4.0.1"
|
chokidar "^4.0.1"
|
||||||
|
|
Loading…
Reference in New Issue