From a065a4399d5ab3b4a59c8fccaf6e026f6de7f531 Mon Sep 17 00:00:00 2001 From: kevmodrome Date: Thu, 9 Apr 2020 09:04:09 +0200 Subject: [PATCH] update routify to beta 40 and set up correct basepath for application, also fixes some links --- packages/builder/package.json | 4 +-- packages/builder/rollup.config.js | 31 ------------------- packages/builder/src/App.svelte | 4 ++- .../builder/src/components/nav/NavItem.svelte | 2 +- .../src/components/start/AppList.svelte | 2 +- .../src/pages/[application]/_layout.svelte | 6 ++-- 6 files changed, 9 insertions(+), 40 deletions(-) diff --git a/packages/builder/package.json b/packages/builder/package.json index 0f66480972..cc36e98dc1 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -59,7 +59,7 @@ "@babel/preset-env": "^7.5.5", "@babel/runtime": "^7.5.5", "@rollup/plugin-alias": "^3.0.1", - "@sveltech/routify": "1.5.0-beta.26", + "@sveltech/routify": "1.5.0-beta.40", "babel-jest": "^24.8.0", "browser-sync": "^2.26.7", "http-proxy-middleware": "^0.19.1", @@ -81,4 +81,4 @@ "svelte": "^3.0.0" }, "gitHead": "115189f72a850bfb52b65ec61d932531bf327072" -} +} \ No newline at end of file diff --git a/packages/builder/rollup.config.js b/packages/builder/rollup.config.js index 4a4081e53a..4a30e491aa 100644 --- a/packages/builder/rollup.config.js +++ b/packages/builder/rollup.config.js @@ -14,32 +14,6 @@ import replace from "rollup-plugin-replace" import path from "path" -const target = "http://localhost:4001" -const _builderProxy = proxy("/_builder", { - target: "http://localhost:3000", - pathRewrite: { "^/_builder": "" }, -}) - -const apiProxy = proxy( - [ - "/_builder/assets/**", - "/_builder/api/**", - "/_builder/**/componentlibrary", - "/_builder/instance/**", - ], - { - target, - logLevel: "debug", - changeOrigin: true, - cookieDomainRewrite: true, - onProxyReq(proxyReq) { - if (proxyReq.getHeader("origin")) { - proxyReq.setHeader("origin", target) - } - }, - } -) - const production = !process.env.ROLLUP_WATCH const lodash_fp_exports = [ @@ -230,11 +204,6 @@ export default { // Watch the `dist` directory and refresh the // browser on changes when not in production !production && livereload(outputpath), - !production && - browsersync({ - server: outputpath, - middleware: [apiProxy, _builderProxy], - }), // If we're building for production (npm run build // instead of npm run dev), minify diff --git a/packages/builder/src/App.svelte b/packages/builder/src/App.svelte index 4e3a9c1632..6d007631ca 100644 --- a/packages/builder/src/App.svelte +++ b/packages/builder/src/App.svelte @@ -1,7 +1,7 @@ diff --git a/packages/builder/src/components/nav/NavItem.svelte b/packages/builder/src/components/nav/NavItem.svelte index 5c9e6ed725..002c4e0802 100644 --- a/packages/builder/src/components/nav/NavItem.svelte +++ b/packages/builder/src/components/nav/NavItem.svelte @@ -6,7 +6,7 @@
$goto($url(href))} + on:click={() => $goto(href)} class="budibase__nav-item backend-nav-item" class:selected={$isActive(href)}> {label} diff --git a/packages/builder/src/components/start/AppList.svelte b/packages/builder/src/components/start/AppList.svelte index 0a499b80eb..1cad372a26 100644 --- a/packages/builder/src/components/start/AppList.svelte +++ b/packages/builder/src/components/start/AppList.svelte @@ -13,7 +13,7 @@

Choose an Application

{#each apps as app} - {app} + {app} {/each}
diff --git a/packages/builder/src/pages/[application]/_layout.svelte b/packages/builder/src/pages/[application]/_layout.svelte index 3aed040ec0..35e629974a 100644 --- a/packages/builder/src/pages/[application]/_layout.svelte +++ b/packages/builder/src/pages/[application]/_layout.svelte @@ -2,7 +2,7 @@ import { store } from "builderStore" import { fade } from "svelte/transition" - import { isActive, goto, url, context } from "@sveltech/routify" + import { isActive, goto, url, layout } from "@sveltech/routify" import { SettingsIcon, PreviewIcon } from "components/common/Icons/" import IconButton from "components/common/IconButton.svelte" @@ -23,8 +23,6 @@ throw new Error(pkg) } } - $: ({ component } = $context) - $: list = component.parent.children.filter(child => child.isIndexable)
@@ -38,7 +36,7 @@ - {#each list as { path, prettyName, children, meta }} + {#each $layout.children as { path, prettyName, children, meta }}