Update BBUI to use vite and remove old svench config

This commit is contained in:
Andrew Kingston 2021-04-01 21:05:18 +01:00
parent bc821feeff
commit 120c22fdb4
12 changed files with 95 additions and 11452 deletions

View File

@ -1,14 +0,0 @@
import { start } from 'svench'
// svench's theme
import 'svench/themes/default.css'
import 'svench/themes/default-markdown.css'
// your own style
import './svench.css'
start({
// backgrounds: ['red', 'green', 'blue'],
// canvasBackground: 'red',
// background: 'blue',
})

File diff suppressed because it is too large Load Diff

View File

@ -3,22 +3,22 @@
"description": "A UI solution used in the different Budibase projects.",
"version": "1.58.13",
"svelte": "src/index.js",
"module": "dist/bundle.mjs",
"module": "dist/bbui.es.js",
"exports": {
".": {
"import": "./dist/bbui.es.js"
},
"./package.json": "./package.json",
"./dist/style.css": "./dist/style.css"
},
"scripts": {
"start": "sirv public",
"build": "rollup --config",
"prepublishOnly": "npm run build",
"svench:rollup": "cross-env SVENCH=1 rollup -cw",
"svench:nollup": "cross-env SVENCH=1 nollup",
"svench:nollup:dev:help": "echo 'this script is used to dev Svench itself'",
"svench:nollup:dev": "yarn svench:nollup --watch ../svench/src --watch ../svench/themes --watch ../svench/*.js",
"svench": "npm run --silent svench:nollup",
"build:svench": "cross-env SVENCH=1 rollup -c"
"build": "vite build"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^16.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^11.0.0",
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.5",
"cross-env": "^7.0.2",
"nollup": "^0.14.1",
"postcss": "^8.2.9",
@ -31,7 +31,8 @@
"rollup-plugin-svelte-hot": "^0.11.0",
"semantic-release": "^17.0.8",
"svelte": "^3.29.0",
"svench": "^0.0.10-7"
"svench": "^0.0.10-7",
"vite": "^2.1.5"
},
"keywords": [
"svelte"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -1,193 +0,0 @@
.svench-content {
color: #666;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, "Roboto",
Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
h1.svench-content {
font-size: 2em;
}
h2.svench-content {
font-size: 1.66em;
}
h3.svench-content {
font-size: 1.33em;
}
h4.svench-content {
font-size: 1.33em;
font-weight: normal;
}
h5.svench-content {
font-size: 1em;
font-weight: bold;
}
h6.svench-content {
font-size: 1em;
font-weight: normal;
font-style: italic;
}
:root {
--background: #ffffff;
--ink: #000000;
--grey-1: #fafafa;
--grey-2: #f5f5f5;
--grey-3: #eeeeee;
--grey-4: #e0e0e0;
--grey-5: #bdbdbd;
--grey-6: #9e9e9e;
--grey-7: #757575;
--grey-8: #616161;
--grey-9: #424242;
--blue-light: #f1f4fc;
--blue: #4285f4;
--blue-dark: #2f4c9b;
--red-light: #ffe6e6;
--red: #e26d69;
--red-dark: #800400;
--yellow-light: #fff7e6;
--yellow: #ffd26a;
--yellow-dark: #805900;
--orange-light: #fff0e6;
--orange: #f0955a;
--orange-dark: #803300;
--green-light: #e6ffeb;
--green: #84c991;
--green-dark: #008017;
--purple-light: #e9e6ff;
--purple: #806fde;
--purple-dark: #130080;
--rounded-small: 4px;
--rounded-medium: 8px;
--rounded-large: 16px;
--font-normal: "Inter";
--font-black: "Inter Black";
--font-bold: "Inter Bold";
--font-medium: "Inter Medium";
--font-light: "Inter Light";
--font-sans: Inter, -apple-system, BlinkMacSystemFont, Segoe UI, "Inter",
"Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--font-serif: "Georgia", Cambria, Times New Roman, Times, serif;
--font-mono: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
monospace;
font-size: 16px;
--font-size-xs: 0.75rem;
--font-size-s: 0.875rem;
--font-size-m: 1rem;
--font-size-l: 1.15rem;
--font-size-xl: 1.3rem;
--heading-font-size-xs: 0.875rem;
--heading-font-size-s: 1.12rem;
--heading-font-size-m: 1.5rem;
--heading-font-size-l: 2.6rem;
--heading-font-size-xl: 3rem;
--font-render: optimizeLegibility;
--font-smooth: antialiased;
--spacing-xs: 0.25rem;
--spacing-s: 0.5rem;
--spacing-m: 0.75rem;
--spacing-l: 1rem;
--spacing-xl: 1.25rem;
--layout-xs: 1.25rem;
--layout-s: 1.5rem;
--layout-m: 2rem;
--layout-l: 3rem;
--layout-xl: 4rem;
--border-radius-xs: 0.125rem;
--border-radius-s: 0.35rem;
--border-radius-m: 0.5rem;
--border-radius-l: 1rem;
--border-radius-xl: 100rem;
--border-black: 2px var(--ink) solid;
--border-dark: 2px var(--grey-7) solid;
--border-grey: 1px var(--grey-4) solid;
--border-grey-2: 2px var(--grey-4) solid;
--border-light: 1px var(--grey-3) solid;
--border-light-2: 2px var(--grey-3) solid;
--border-blue: 2px var(--blue) solid;
--border-transparent: 2px transparent solid;
}
h1 {
font-size: 3rem;
font-family: var(--font-sans);
font-weight: 700;
text-rendering: var(--text-render);
-webkit-font-smoothing: var(--text-smooth);
color: var(--ink);
}
h2 {
font-size: 2.25rem;
font-family: var(--font-sans);
font-weight: 600;
text-rendering: var(--text-render);
-webkit-font-smoothing: var(--text-smooth);
color: var(--ink);
}
h3 {
font-size: 1.7rem;
font-family: var(--font-sans);
font-weight: 600;
text-rendering: var(--text-render);
-webkit-font-smoothing: var(--text-smooth);
color: var(--ink);
}
h4 {
font-size: var(--font-size-xl);
font-family: var(--font-sans);
font-weight: 500;
text-rendering: var(--text-render);
-webkit-font-smoothing: var(--text-smooth);
color: var(--ink);
}
h5 {
font-size: var(--font-size-l);
font-family: var(--font-sans);
font-weight: 500;
text-rendering: var(--text-render);
-webkit-font-smoothing: var(--text-smooth);
color: var(--ink);
}
h6 {
font-size: var(--font-size-m);
font-family: var(--font-sans);
font-weight: 500;
text-rendering: var(--text-render);
-webkit-font-smoothing: var(--text-smooth);
color: var(--ink);
}
p {
font-size: var(--font-size);
font-family: var(--font-sans);
font-weight: 400;
text-rendering: var(--text-render);
-webkit-font-smoothing: var(--text-smooth);
color: var(--ink);
}
a {
text-decoration: none;
}

View File

@ -1,29 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>BBUI Svench</title>
<link rel="icon" type="image/png" href="/favicon.png" />
<!-- Custom fonts -->
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap"
rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/remixicon@2.5.0/fonts/remixicon.css" rel="stylesheet">
<!-- Our theme (from .svench/svench.css) -->
<link rel="stylesheet" href="/svench/theme.css" />
<script type="module" src="/svench/svench.js"></script>
<!-- Replace the previous script with the following for legacy support -->
<!-- cf https://www.npmjs.com/package/dimport#usage -->
<!-- <script type="module" src="https://unpkg.com/dimport?module" data-main="/svench/svench.js"></script> -->
<!-- <script type="nomodule" src="https://unpkg.com/dimport/nomodule" data-main="/svench/svench.js"></script> -->
</head>
<body />
</html>

View File

@ -1,13 +1,4 @@
import "../.svench/svench.css"
// Single default export
// export { default as default } from './Component.svelte';
// OR multiple named exports
//
// import { Foo, Bar } from 'my-lib'
//
import "./bbui.css"
// Components
export { default as Input } from "./Form/Input.svelte"

View File

@ -1,35 +0,0 @@
<article>
<h1>
<span class="icon">🔬</span>
Svench
</h1>
## This is your workbench.
This is a [Svench](https://github.com/rixo/svench) project, created with [Svench's component template](https://github.com/rixo/svench-component-template).
Edit <code>index.svench.svx</code> to customize this page.
Check `example` for inspiration.
</article>
<style>
article > * {
text-align: center;
margin-top: 3em;
}
h1 {
font-size: 3em;
margin-top: 1em;
color: var(--gray);
}
h1 .icon {
opacity: 0.5;
display: inline-block;
transform: rotateY(180deg);
margin-left: -0.6em;
width: 0.6em;
font-weight: normal;
font-size: 1.25em;
}
</style>

View File

@ -0,0 +1,22 @@
import svelte from "@sveltejs/vite-plugin-svelte"
export default ({ mode }) => {
const isProduction = mode === "production"
return {
build: {
lib: {
entry: "src/index.js",
name: "bbui",
formats: ["es"],
},
minify: isProduction,
},
plugins: [svelte()],
resolve: {
dedupe: ["svelte", "svelte/internal"],
},
rollupOptions: {
external: ["svelte", "svelte/internal"],
},
}
}

View File

@ -318,14 +318,6 @@
is-module "^1.0.0"
resolve "^1.19.0"
"@rollup/pluginutils@4":
version "4.1.0"
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.1.0.tgz#0dcc61c780e39257554feb7f77207dceca13c838"
integrity sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ==
dependencies:
estree-walker "^2.0.1"
picomatch "^2.2.2"
"@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b"
@ -335,6 +327,14 @@
estree-walker "^1.0.1"
picomatch "^2.2.2"
"@rollup/pluginutils@^4.1.0":
version "4.1.0"
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.1.0.tgz#0dcc61c780e39257554feb7f77207dceca13c838"
integrity sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ==
dependencies:
estree-walker "^2.0.1"
picomatch "^2.2.2"
"@semantic-release/commit-analyzer@^8.0.0":
version "8.0.1"
resolved "https://registry.yarnpkg.com/@semantic-release/commit-analyzer/-/commit-analyzer-8.0.1.tgz#5d2a37cd5a3312da0e3ac05b1ca348bf60b90bca"
@ -410,6 +410,20 @@
lodash "^4.17.4"
read-pkg-up "^7.0.0"
"@sveltejs/vite-plugin-svelte@^1.0.0-next.5":
version "1.0.0-next.5"
resolved "https://registry.yarnpkg.com/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-1.0.0-next.5.tgz#8cf608f7a3c33dfa5b648397aae1ba90e6a4883f"
integrity sha512-RVjafsqziWwnQm8VEy2y0qNaugNDvRd8tTaCt9rjgQkqaS/BDiyDCluXxA28PRC+ddZjvwUeq9k+0EfbLVObfg==
dependencies:
"@rollup/pluginutils" "^4.1.0"
chalk "^4.1.0"
debug "^4.3.2"
hash-sum "^2.0.0"
require-relative "^0.8.7"
slash "^3.0.0"
source-map "^0.7.3"
svelte-hmr "^0.13.3"
"@tootallnate/once@1":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82"
@ -1645,6 +1659,13 @@ debug@^3.0.1:
dependencies:
ms "^2.1.1"
debug@^4.3.2:
version "4.3.2"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b"
integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==
dependencies:
ms "2.1.2"
debuglog@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492"
@ -1988,6 +2009,11 @@ es6-promise@^4.1.1:
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a"
integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==
esbuild@^0.9.3:
version "0.9.7"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.9.7.tgz#ea0d639cbe4b88ec25fbed4d6ff00c8d788ef70b"
integrity sha512-VtUf6aQ89VTmMLKrWHYG50uByMF4JQlVysb8dmg6cOgW8JnFCipmz7p+HNBl+RR3LLCuBxFGVauAe2wfnF9bLg==
escalade@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
@ -2551,6 +2577,11 @@ hash-base@^3.0.0:
readable-stream "^3.6.0"
safe-buffer "^5.2.0"
hash-sum@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/hash-sum/-/hash-sum-2.0.0.tgz#81d01bb5de8ea4a214ad5d6ead1b523460b0b45a"
integrity sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==
hash.js@^1.0.0, hash.js@^1.0.3:
version "1.1.7"
resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42"
@ -4932,7 +4963,7 @@ postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.27:
source-map "^0.6.1"
supports-color "^6.1.0"
postcss@^8.2.9:
postcss@^8.2.1, postcss@^8.2.9:
version "8.2.9"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.2.9.tgz#fd95ff37b5cee55c409b3fdd237296ab4096fba3"
integrity sha512-b+TmuIL4jGtCHtoLi+G/PisuIl9avxs8IZMSmlABRwNz5RLUUACrC+ws81dcomz1nRezm5YPdXiMEzBEKgYn+Q==
@ -5411,13 +5442,6 @@ rollup-plugin-copy@^3.3.0:
globby "10.0.1"
is-plain-object "^3.0.0"
rollup-plugin-css-only@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-css-only/-/rollup-plugin-css-only-3.1.0.tgz#6a701cc5b051c6b3f0961e69b108a9a118e1b1df"
integrity sha512-TYMOE5uoD76vpj+RTkQLzC9cQtbnJNktHPB507FzRWBVaofg7KhIqq1kGbcVOadARSozWF883Ho9KpSPKH8gqA==
dependencies:
"@rollup/pluginutils" "4"
rollup-plugin-delete@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-delete/-/rollup-plugin-delete-1.2.0.tgz#a7e45ca4c5480308fa355d11de622f22e7075e12"
@ -5496,7 +5520,7 @@ rollup-pluginutils@^2.8.2:
dependencies:
estree-walker "^0.6.1"
rollup@^2.34.0:
rollup@^2.34.0, rollup@^2.38.5:
version "2.44.0"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.44.0.tgz#8da324d1c4fd12beef9ae6e12f4068265b6d95eb"
integrity sha512-rGSF4pLwvuaH/x4nAS+zP6UNn5YUDWf/TeEU5IoXSZKBbKRNTCI3qMnYXKZgrC0D2KzS2baiOZt1OlqhMu5rnQ==
@ -5748,7 +5772,7 @@ socks@^2.3.3:
ip "^1.1.5"
smart-buffer "^4.1.0"
"source-map-fast@npm:source-map@0.7.3":
"source-map-fast@npm:source-map@0.7.3", source-map@^0.7.3:
version "0.7.3"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383"
integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==
@ -6039,6 +6063,11 @@ svelte-hmr@^0.11.3:
resolved "https://registry.yarnpkg.com/svelte-hmr/-/svelte-hmr-0.11.6.tgz#67f0498e2cdce9e1039631d820c1951bd01caa3f"
integrity sha512-XUYcp7W26q/fF8tABZfCYGklwL4TDH48gc1KOjuBQNlTiMW63l/+rRqmfVOE/qKG5vns0J2NPo3zFjdahkwoHA==
svelte-hmr@^0.13.3:
version "0.13.3"
resolved "https://registry.yarnpkg.com/svelte-hmr/-/svelte-hmr-0.13.3.tgz#fba5739b477ea44caf70e542a24a4352bee2b897"
integrity sha512-gagW62pLQ2lULmvNA3pIZu9pBCYOaGu3rQikUOv6Nokz5VxUgT9/mQLfMxj9phDEKHCg/lgr3i6PkqZDbO9P2Q==
svelte-key@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/svelte-key/-/svelte-key-1.0.0.tgz#8c570667d52b58423a0b0d543cc5323b3db356e8"
@ -6425,6 +6454,18 @@ verror@1.10.0:
core-util-is "1.0.2"
extsprintf "^1.2.0"
vite@^2.1.5:
version "2.1.5"
resolved "https://registry.yarnpkg.com/vite/-/vite-2.1.5.tgz#4857da441c62f7982c83cbd5f42a00330f20c9c1"
integrity sha512-tYU5iaYeUgQYvK/CNNz3tiJ8vYqPWfCE9IQ7K0iuzYovWw7lzty7KRYGWwV3CQPh0NKxWjOczAqiJsCL0Xb+Og==
dependencies:
esbuild "^0.9.3"
postcss "^8.2.1"
resolve "^1.19.0"
rollup "^2.38.5"
optionalDependencies:
fsevents "~2.3.1"
walk-up-path@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/walk-up-path/-/walk-up-path-1.0.0.tgz#d4745e893dd5fd0dbb58dd0a4c6a33d9c9fec53e"

View File

@ -3,6 +3,7 @@ import "./global.css"
import "./fonts.css"
import "./budibase.css"
import "./fonts.css"
import "@budibase/bbui/dist/style.css"
import App from "./App.svelte"