From b607d2e9332dfee8c8ac0ebe339a00c91c253c0c Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 25 Nov 2020 16:03:52 +0000 Subject: [PATCH] Tidy up dependencies and rollup configs for client and standard components --- packages/client/rollup.config.js | 8 +- packages/standard-components/package.json | 10 +- packages/standard-components/rollup.config.js | 1 - .../standard-components/rollup.testconfig.js | 138 ------------------ 4 files changed, 3 insertions(+), 154 deletions(-) delete mode 100644 packages/standard-components/rollup.testconfig.js diff --git a/packages/client/rollup.config.js b/packages/client/rollup.config.js index ce8289dc8a..30064bde26 100644 --- a/packages/client/rollup.config.js +++ b/packages/client/rollup.config.js @@ -10,14 +10,8 @@ export default { output: [ { sourcemap: true, - format: "iife", - name: "app", - file: `./dist/budibase-client.js`, - }, - { - file: "dist/budibase-client.esm.mjs", format: "esm", - sourcemap: "inline", + file: `./dist/budibase-client.js`, }, ], plugins: [ diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index 90374ae183..d4b65421d4 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -6,7 +6,6 @@ "build": "rollup -c", "prepublishOnly": "npm run build", "postpublish": "node scripts/deploy.js", - "testbuild": "rollup -w -c rollup.testconfig.js", "dev": "run-p start:dev testbuild", "start:dev": "sirv public --single --dev", "dev:builder": "rollup -cw" @@ -23,10 +22,7 @@ "rollup-plugin-postcss": "^3.1.5", "rollup-plugin-svelte": "^6.1.1", "rollup-plugin-terser": "^7.0.2", - "shortid": "^2.2.15", - "sirv-cli": "^0.4.4" - }, - "peerDependencies": { + "sirv-cli": "^0.4.4", "svelte": "^3.29.0" }, "keywords": [ @@ -36,12 +32,10 @@ "license": "MIT", "gitHead": "284cceb9b703c38566c6e6363c022f79a08d5691", "dependencies": { - "@budibase/bbui": "^1.50.1", + "@budibase/bbui": "^1.51.0", "@budibase/svelte-ag-grid": "^0.0.13", "@fortawesome/fontawesome-free": "^5.14.0", - "@svelteschool/svelte-forms": "^0.7.0", "apexcharts": "^3.22.1", - "fast-sort": "^2.2.0", "flatpickr": "^4.6.6", "lodash.debounce": "^4.0.8", "quill": "^1.3.7", diff --git a/packages/standard-components/rollup.config.js b/packages/standard-components/rollup.config.js index c606dea4c7..976b2dd192 100644 --- a/packages/standard-components/rollup.config.js +++ b/packages/standard-components/rollup.config.js @@ -15,7 +15,6 @@ export default { { file: "dist/index.js", format: "esm", - name: "budibaseStandardComponents", sourcemap: false, }, ], diff --git a/packages/standard-components/rollup.testconfig.js b/packages/standard-components/rollup.testconfig.js deleted file mode 100644 index eeb19b7f98..0000000000 --- a/packages/standard-components/rollup.testconfig.js +++ /dev/null @@ -1,138 +0,0 @@ -import svelte from "rollup-plugin-svelte" -import resolve from "rollup-plugin-node-resolve" -import commonjs from "rollup-plugin-commonjs" -import livereload from "rollup-plugin-livereload" -import { terser } from "rollup-plugin-terser" -import json from "rollup-plugin-json" - -const production = !process.env.ROLLUP_WATCH - -const lodash_fp_exports = [ - "find", - "isUndefined", - "split", - "max", - "last", - "union", - "reduce", - "isObject", - "cloneDeep", - "some", - "isArray", - "map", - "filter", - "keys", - "isFunction", - "isEmpty", - "countBy", - "join", - "includes", - "flatten", - "constant", - "first", - "intersection", - "take", - "has", - "mapValues", - "isString", - "isBoolean", - "isNull", - "isNumber", - "isObjectLike", - "isDate", - "clone", - "values", - "keyBy", - "isNaN", - "isInteger", - "toNumber", -] - -const lodash_exports = [ - "flow", - "head", - "find", - "each", - "tail", - "findIndex", - "startsWith", - "dropRight", - "takeRight", - "trim", - "split", - "replace", - "merge", - "assign", -] - -const coreExternal = [ - "lodash", - "lodash/fp", - "date-fns", - "lunr", - "safe-buffer", - "shortid", - "@nx-js/compiler-util", - "bcryptjs", -] - -export default { - input: "src/Test/testMain.js", - output: { - sourcemap: true, - format: "iife", - name: "app", - file: "public/bundle.js", - globals: { - crypto: "crypto", - }, - }, - plugins: [ - svelte({ - // enable run-time checks when not in production - dev: !production, - // we'll extract any component CSS out into - // a separate file — better for performance - css: css => { - css.write("bundle.css") - }, - - hydratable: true, - }), - - // If you have external dependencies installed from - // npm, you'll most likely need these plugins. In - // some cases you'll need additional configuration — - // consult the documentation for details: - // https://github.com/rollup/rollup-plugin-commonjs - resolve({ - browser: true, - dedupe: importee => { - return ( - importee === "svelte" || - importee.startsWith("svelte/") || - coreExternal.includes(importee) - ) - }, - }), - commonjs({ - namedExports: { - "lodash/fp": lodash_fp_exports, - lodash: lodash_exports, - shortid: ["generate"], - }, - }), - json(), - - // Watch the `public` directory and refresh the - // browser on changes when not in production - !production && livereload("public"), - - // If we're building for production (npm run build - // instead of npm run dev), minify - production && terser(), - ], - watch: { - clearScreen: false, - }, -}