diff --git a/packages/standard-components/README.md b/packages/client/README.md similarity index 100% rename from packages/standard-components/README.md rename to packages/client/README.md diff --git a/packages/standard-components/manifest.json b/packages/client/manifest.json similarity index 100% rename from packages/standard-components/manifest.json rename to packages/client/manifest.json diff --git a/packages/client/package.json b/packages/client/package.json index fc03753c41..5f8cd0d60c 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -11,7 +11,8 @@ "import": "./dist/budibase-client.js", "require": "./dist/budibase-client.js" }, - "./package.json": "./package.json" + "./package.json": "./package.json", + "./manifest.json": "./manifest.json" }, "scripts": { "build": "rollup -c", @@ -19,15 +20,25 @@ }, "dependencies": { "@budibase/bbui": "^0.9.117-alpha.2", - "@budibase/standard-components": "^0.9.117-alpha.2", "@budibase/string-templates": "^0.9.117-alpha.2", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" }, "devDependencies": { + "@budibase/bbui": "^0.9.117-alpha.2", + "@rollup/plugin-alias": "^3.1.5", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", + "@spectrum-css/button": "^3.0.3", + "@spectrum-css/card": "^3.0.3", + "@spectrum-css/divider": "^1.0.3", + "@spectrum-css/link": "^3.1.3", + "@spectrum-css/page": "^3.0.1", + "@spectrum-css/typography": "^3.0.2", + "@spectrum-css/vars": "^3.0.1", + "apexcharts": "^3.22.1", + "dayjs": "^1.10.5", "fs-extra": "^8.1.0", "jsdom": "^16.0.1", "postcss": "^8.2.10", @@ -39,7 +50,9 @@ "rollup-plugin-svelte": "^7.1.0", "rollup-plugin-svg": "^2.0.0", "rollup-plugin-terser": "^7.0.2", - "svelte": "^3.38.2" + "svelte": "^3.38.2", + "svelte-apexcharts": "^1.0.2", + "svelte-flatpickr": "^3.1.0" }, "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc" } diff --git a/packages/client/rollup.config.js b/packages/client/rollup.config.js index 3d8812087e..f404f93c4c 100644 --- a/packages/client/rollup.config.js +++ b/packages/client/rollup.config.js @@ -1,5 +1,6 @@ import commonjs from "@rollup/plugin-commonjs" import resolve from "@rollup/plugin-node-resolve" +import alias from "@rollup/plugin-alias" import svelte from "rollup-plugin-svelte" import { terser } from "rollup-plugin-terser" import postcss from "rollup-plugin-postcss" @@ -7,6 +8,7 @@ import svg from "rollup-plugin-svg" import json from "rollup-plugin-json" import builtins from "rollup-plugin-node-builtins" import globals from "rollup-plugin-node-globals" +import path from "path" const production = !process.env.ROLLUP_WATCH const ignoredWarnings = [ @@ -26,6 +28,38 @@ export default { }, ], plugins: [ + alias({ + entries: [ + { + find: "manifest.json", + replacement: path.resolve("./manifest.json"), + }, + { + find: "api", + replacement: path.resolve("./src/api"), + }, + { + find: "components", + replacement: path.resolve("./src/components"), + }, + { + find: "stores", + replacement: path.resolve("./src/stores"), + }, + { + find: "utils", + replacement: path.resolve("./src/utils"), + }, + { + find: "constants", + replacement: path.resolve("./src/constants"), + }, + { + find: "sdk", + replacement: path.resolve("./src/sdk"), + }, + ], + }), svelte({ emitCss: true, onwarn: (warning, handler) => { diff --git a/packages/client/src/api/api.js b/packages/client/src/api/api.js index 5449c3f219..2476030eb0 100644 --- a/packages/client/src/api/api.js +++ b/packages/client/src/api/api.js @@ -1,5 +1,5 @@ -import { notificationStore } from "../store" -import { ApiVersion } from "../constants" +import { notificationStore } from "stores" +import { ApiVersion } from "constants" /** * API cache for cached request responses. diff --git a/packages/client/src/api/automations.js b/packages/client/src/api/automations.js index 2b989f85ae..cb3e4623ad 100644 --- a/packages/client/src/api/automations.js +++ b/packages/client/src/api/automations.js @@ -1,5 +1,6 @@ -import { notificationStore } from "../store/notification" +import { notificationStore } from "stores/notification" import API from "./api" + /** * Executes an automation. Must have "App Action" trigger. */ diff --git a/packages/client/src/api/queries.js b/packages/client/src/api/queries.js index a6ef1a763f..8db41ecf5c 100644 --- a/packages/client/src/api/queries.js +++ b/packages/client/src/api/queries.js @@ -1,4 +1,4 @@ -import { notificationStore, dataSourceStore } from "../store" +import { notificationStore, dataSourceStore } from "stores" import API from "./api" /** diff --git a/packages/client/src/api/rows.js b/packages/client/src/api/rows.js index 21f8ec1f98..ba7a4215a9 100644 --- a/packages/client/src/api/rows.js +++ b/packages/client/src/api/rows.js @@ -1,4 +1,4 @@ -import { notificationStore, dataSourceStore } from "../store" +import { notificationStore, dataSourceStore } from "stores" import API from "./api" import { fetchTableDefinition } from "./tables" diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index 11347821a9..e0464764f3 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -1,11 +1,9 @@ diff --git a/packages/client/src/components/NotificationDisplay.svelte b/packages/client/src/components/overlay/NotificationDisplay.svelte similarity index 94% rename from packages/client/src/components/NotificationDisplay.svelte rename to packages/client/src/components/overlay/NotificationDisplay.svelte index f03fb692fd..6e8be21647 100644 --- a/packages/client/src/components/NotificationDisplay.svelte +++ b/packages/client/src/components/overlay/NotificationDisplay.svelte @@ -1,5 +1,5 @@ diff --git a/packages/client/src/components/PeekScreenDisplay.svelte b/packages/client/src/components/overlay/PeekScreenDisplay.svelte similarity index 99% rename from packages/client/src/components/PeekScreenDisplay.svelte rename to packages/client/src/components/overlay/PeekScreenDisplay.svelte index 6d6e8c39c7..0af1ba499e 100644 --- a/packages/client/src/components/PeekScreenDisplay.svelte +++ b/packages/client/src/components/overlay/PeekScreenDisplay.svelte @@ -4,7 +4,7 @@ dataSourceStore, notificationStore, routeStore, - } from "../store" + } from "stores" import { Modal, ModalContent, ActionButton } from "@budibase/bbui" import { onDestroy } from "svelte" diff --git a/packages/client/src/components/preview/HoverIndicator.svelte b/packages/client/src/components/preview/HoverIndicator.svelte index 5cdf3eccff..9518c6d101 100644 --- a/packages/client/src/components/preview/HoverIndicator.svelte +++ b/packages/client/src/components/preview/HoverIndicator.svelte @@ -1,7 +1,7 @@ diff --git a/packages/client/src/components/preview/SettingsBar.svelte b/packages/client/src/components/preview/SettingsBar.svelte index 69197e6ede..bc4f93acda 100644 --- a/packages/client/src/components/preview/SettingsBar.svelte +++ b/packages/client/src/components/preview/SettingsBar.svelte @@ -3,8 +3,8 @@ import SettingsButton from "./SettingsButton.svelte" import SettingsColorPicker from "./SettingsColorPicker.svelte" import SettingsPicker from "./SettingsPicker.svelte" - import { builderStore } from "../../store" - import { domDebounce } from "../../utils/domDebounce" + import { builderStore } from "stores" + import { domDebounce } from "utils/domDebounce" const verticalOffset = 28 const horizontalOffset = 2 diff --git a/packages/client/src/components/preview/SettingsButton.svelte b/packages/client/src/components/preview/SettingsButton.svelte index c074d4e7f4..1490b2c9b7 100644 --- a/packages/client/src/components/preview/SettingsButton.svelte +++ b/packages/client/src/components/preview/SettingsButton.svelte @@ -1,6 +1,6 @@