From cfa6d487f85237a64fb8e99f548ef73907516c56 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 26 Nov 2024 16:06:55 +0000 Subject: [PATCH 1/5] Convert client to vite --- packages/client/package.json | 19 ++----- packages/client/rollup.config.js | 22 +++----- packages/client/src/index.js | 2 +- packages/client/tsconfig.json | 6 ++- packages/client/vite.config.mjs | 89 ++++++++++++++++++++++++++++++++ yarn.lock | 82 ++++++----------------------- 6 files changed, 123 insertions(+), 97 deletions(-) create mode 100644 packages/client/vite.config.mjs diff --git a/packages/client/package.json b/packages/client/package.json index fb9851e0a1..0d4932dc0d 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -15,8 +15,8 @@ "./manifest.json": "./manifest.json" }, "scripts": { - "build": "rollup -c", - "dev": "rollup -cw" + "build": "vite build", + "dev": "vite build --watch" }, "dependencies": { "@budibase/bbui": "0.0.0", @@ -36,19 +36,10 @@ "svelte-spa-router": "^4.0.1" }, "devDependencies": { - "@rollup/plugin-alias": "^5.1.0", - "@rollup/plugin-commonjs": "^25.0.7", - "@rollup/plugin-image": "^3.0.3", - "@rollup/plugin-node-resolve": "^15.2.3", + "@sveltejs/vite-plugin-svelte": "1.4.0", "postcss": "^8.4.35", - "rollup": "^4.9.6", - "rollup-plugin-json": "^4.0.0", - "rollup-plugin-polyfill-node": "^0.13.0", - "rollup-plugin-postcss": "^4.0.2", - "rollup-plugin-svelte": "^7.1.6", - "rollup-plugin-svg": "^2.0.0", - "rollup-plugin-terser": "^7.0.2", - "rollup-plugin-visualizer": "^5.12.0" + "vite": "^4.5.0", + "vite-plugin-css-injected-by-js": "3.5.2" }, "resolutions": { "loader-utils": "1.4.1" diff --git a/packages/client/rollup.config.js b/packages/client/rollup.config.js index 9839414f7e..3178a527fe 100644 --- a/packages/client/rollup.config.js +++ b/packages/client/rollup.config.js @@ -10,6 +10,7 @@ import json from "rollup-plugin-json" import nodePolyfills from "rollup-plugin-polyfill-node" import path from "path" import { visualizer } from "rollup-plugin-visualizer" +import typescript from "@rollup/plugin-typescript" const production = !process.env.ROLLUP_WATCH const ignoredWarnings = [ @@ -20,19 +21,6 @@ const ignoredWarnings = [ "a11y-click-events-have-key-events", ] -const devPaths = production - ? [] - : [ - { - find: "@budibase/shared-core", - replacement: path.resolve("../shared-core/dist/index"), - }, - { - find: "@budibase/types", - replacement: path.resolve("../types/dist/index"), - }, - ] - export default { input: "src/index.js", output: [ @@ -53,6 +41,12 @@ export default { warn(warning) }, plugins: [ + typescript({ + include: [ + "src/**/*.ts", + `${path.resolve("..")}/frontend-core/src/**/*.ts`, + ], + }), alias({ entries: [ { @@ -83,7 +77,6 @@ export default { find: "sdk", replacement: path.resolve("./src/sdk"), }, - ...devPaths, ], }), svelte({ @@ -102,6 +95,7 @@ export default { preferBuiltins: true, browser: true, dedupe: ["svelte", "svelte/internal"], + extensions: [".js", ".ts", ".json"], }), svg(), image({ diff --git a/packages/client/src/index.js b/packages/client/src/index.js index de6d1bdc12..9cef52bb1e 100644 --- a/packages/client/src/index.js +++ b/packages/client/src/index.js @@ -10,7 +10,7 @@ import { eventStore, hoverStore, } from "./stores" -import loadSpectrumIcons from "@budibase/bbui/spectrum-icons-rollup.js" +import loadSpectrumIcons from "@budibase/bbui/spectrum-icons-vite.js" import { get } from "svelte/store" import { initWebsocket } from "./websocket.js" diff --git a/packages/client/tsconfig.json b/packages/client/tsconfig.json index 81f1657f48..5bc64cc5c0 100644 --- a/packages/client/tsconfig.json +++ b/packages/client/tsconfig.json @@ -3,6 +3,10 @@ "allowJs": true, "strict": true, "outDir": "dist", + "allowSyntheticDefaultImports": true, + "target": "ESNext", + "moduleResolution": "bundler", + "resolveJsonModule": true, "paths": { "@budibase/*": [ "../*/src/index.ts", @@ -13,5 +17,5 @@ "*": ["./src/*"] } }, - "include": ["src/**/*"] + "include": ["src/**/*.ts", "../frontend-core/src/**/*.ts"] } diff --git a/packages/client/vite.config.mjs b/packages/client/vite.config.mjs new file mode 100644 index 0000000000..9c623b709f --- /dev/null +++ b/packages/client/vite.config.mjs @@ -0,0 +1,89 @@ +import { svelte } from "@sveltejs/vite-plugin-svelte" +import { defineConfig } from "vite" +import path from "path" +import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js" + +const ignoredWarnings = [ + "unused-export-let", + "css-unused-selector", + "module-script-reactive-declaration", + "a11y-no-onchange", + "a11y-click-events-have-key-events", +] + +export default defineConfig(({ mode }) => { + const isProduction = mode === "production" + + return { + server: { + open: false, + }, + build: { + lib: { + entry: "src/index.js", + formats: ["iife"], + outDir: "dist", + name: "budibase_client", + fileName: () => "budibase-client.js", + minify: isProduction, + }, + }, + plugins: [ + svelte({ + emitCss: true, + onwarn: (warning, handler) => { + // Ignore some warnings + if (!ignoredWarnings.includes(warning.code)) { + handler(warning) + } + }, + }), + cssInjectedByJsPlugin(), + ], + resolve: { + dedupe: ["svelte", "svelte/internal"], + alias: [ + { + 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"), + }, + { + find: "@budibase/types", + replacement: path.resolve("../types/src"), + }, + { + find: "@budibase/shared-core", + replacement: path.resolve("../shared-core/src"), + }, + { + find: "@budibase/bbui", + replacement: path.resolve("../bbui/src"), + }, + ], + }, + } +}) diff --git a/yarn.lock b/yarn.lock index dd01832bba..b15f31f7e6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4075,13 +4075,6 @@ resolved "https://registry.yarnpkg.com/@redis/time-series/-/time-series-1.0.4.tgz#af85eb080f6934580e4d3b58046026b6c2b18717" integrity sha512-ThUIgo2U/g7cCuZavucQTQzA9g9JbDDY2f64u3AbAoz/8vE2lt2U37LamDUVChhaDA3IRT9R6VvJwqnUfTJzng== -"@rollup/plugin-alias@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-alias/-/plugin-alias-5.1.0.tgz#99a94accc4ff9a3483be5baeedd5d7da3b597e93" - integrity sha512-lpA3RZ9PdIG7qqhEfv79tBffNaoDuukFDrmhLqg9ifv99u/ehn+lOg30x2zmhf8AQqQUZaMk/B9fZraQ6/acDQ== - dependencies: - slash "^4.0.0" - "@rollup/plugin-commonjs@16.0.0", "@rollup/plugin-commonjs@^16.0.0": version "16.0.0" resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-16.0.0.tgz#169004d56cd0f0a1d0f35915d31a036b0efe281f" @@ -4120,14 +4113,6 @@ is-reference "1.2.1" magic-string "^0.30.3" -"@rollup/plugin-image@^3.0.3": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@rollup/plugin-image/-/plugin-image-3.0.3.tgz#025b557180bae20f2349ff5130ef2114169feaac" - integrity sha512-qXWQwsXpvD4trSb8PeFPFajp8JLpRtqqOeNYRUKnEQNHm7e5UP7fuSRcbjQAJ7wDZBbnJvSdY5ujNBQd9B1iFg== - dependencies: - "@rollup/pluginutils" "^5.0.1" - mini-svg-data-uri "^1.4.4" - "@rollup/plugin-inject@^5.0.4", "@rollup/plugin-inject@^5.0.5": version "5.0.5" resolved "https://registry.yarnpkg.com/@rollup/plugin-inject/-/plugin-inject-5.0.5.tgz#616f3a73fe075765f91c5bec90176608bed277a3" @@ -10885,11 +10870,6 @@ estraverse@^5.1.0, estraverse@^5.2.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== -estree-walker@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.2.1.tgz#bdafe8095383d8414d5dc2ecf4c9173b6db9412e" - integrity sha512-6/I1dwNKk0N9iGOU3ydzAAurz4NPo/ttxZNCqgIVbWFvWyzWBSNonRrJ5CpjDuyBfmM7ENN7WCzUi9aT/UPXXQ== - estree-walker@^0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.5.2.tgz#d3850be7529c9580d815600b53126515e146dd39" @@ -12635,6 +12615,11 @@ husky@^8.0.3: resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184" integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg== +husky@^9.1.4: + version "9.1.7" + resolved "https://registry.yarnpkg.com/husky/-/husky-9.1.7.tgz#d46a38035d101b46a70456a850ff4201344c0b2d" + integrity sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA== + ical-generator@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/ical-generator/-/ical-generator-4.1.0.tgz#2a336c951864c5583a2aa715d16f2edcdfd2d90b" @@ -15653,11 +15638,6 @@ min-indent@^1.0.0: resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== -mini-svg-data-uri@^1.4.4: - version "1.4.4" - resolved "https://registry.yarnpkg.com/mini-svg-data-uri/-/mini-svg-data-uri-1.4.4.tgz#8ab0aabcdf8c29ad5693ca595af19dd2ead09939" - integrity sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg== - minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" @@ -15668,7 +15648,7 @@ minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== -"minimatch@2 || 3", minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: +"minimatch@2 || 3", minimatch@^3.0.3, minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -19245,13 +19225,6 @@ rollup-plugin-inject-process-env@^1.3.1: dependencies: magic-string "^0.25.7" -rollup-plugin-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-json/-/rollup-plugin-json-4.0.0.tgz#a18da0a4b30bf5ca1ee76ddb1422afbb84ae2b9e" - integrity sha512-hgb8N7Cgfw5SZAkb3jf0QXii6QX/FOkiIq2M7BAQIEydjHvTyxXHQiIzZaTFgx1GK0cRCHOCBHIyEkkLdWKxow== - dependencies: - rollup-pluginutils "^2.5.0" - rollup-plugin-node-builtins@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/rollup-plugin-node-builtins/-/rollup-plugin-node-builtins-2.1.2.tgz#24a1fed4a43257b6b64371d8abc6ce1ab14597e9" @@ -19292,7 +19265,7 @@ rollup-plugin-polyfill-node@^0.13.0: dependencies: "@rollup/plugin-inject" "^5.0.4" -rollup-plugin-postcss@^4.0.0, rollup-plugin-postcss@^4.0.2: +rollup-plugin-postcss@^4.0.0: version "4.0.2" resolved "https://registry.yarnpkg.com/rollup-plugin-postcss/-/rollup-plugin-postcss-4.0.2.tgz#15e9462f39475059b368ce0e49c800fa4b1f7050" integrity sha512-05EaY6zvZdmvPUDi3uCcAQoESDcYnv8ogJJQRp6V5kZ6J6P7uAVJlrTZcaaA20wTH527YTnKfkAoPxWI/jPp4w== @@ -19311,7 +19284,7 @@ rollup-plugin-postcss@^4.0.0, rollup-plugin-postcss@^4.0.2: safe-identifier "^0.4.2" style-inject "^0.3.0" -rollup-plugin-svelte@^7.1.0, rollup-plugin-svelte@^7.1.6: +rollup-plugin-svelte@^7.1.0: version "7.1.6" resolved "https://registry.yarnpkg.com/rollup-plugin-svelte/-/rollup-plugin-svelte-7.1.6.tgz#44a4ea6c6e8ed976824d9fd40c78d048515e5838" integrity sha512-nVFRBpGWI2qUY1OcSiEEA/kjCY2+vAjO9BI8SzA7NRrh2GTunLd6w2EYmnMt/atgdg8GvcNjLsmZmbQs/u4SQA== @@ -19319,13 +19292,6 @@ rollup-plugin-svelte@^7.1.0, rollup-plugin-svelte@^7.1.6: "@rollup/pluginutils" "^4.1.0" resolve.exports "^2.0.0" -rollup-plugin-svg@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-svg/-/rollup-plugin-svg-2.0.0.tgz#ce11b55e915d5b2190328c4e6632bd6b4fe12ee9" - integrity sha512-DmE7dSQHo1SC5L2uH2qul3Mjyd5oV6U1aVVkyvTLX/mUsRink7f1b1zaIm+32GEBA6EHu8H/JJi3DdWqM53ySQ== - dependencies: - rollup-pluginutils "^1.3.1" - rollup-plugin-terser@^7.0.2: version "7.0.2" resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d" @@ -19336,30 +19302,12 @@ rollup-plugin-terser@^7.0.2: serialize-javascript "^4.0.0" terser "^5.0.0" -rollup-plugin-visualizer@^5.12.0: - version "5.12.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-visualizer/-/rollup-plugin-visualizer-5.12.0.tgz#661542191ce78ee4f378995297260d0c1efb1302" - integrity sha512-8/NU9jXcHRs7Nnj07PF2o4gjxmm9lXIrZ8r175bT9dK8qoLlvKTwRMArRCMgpMGlq8CTLugRvEmyMeMXIU2pNQ== - dependencies: - open "^8.4.0" - picomatch "^2.3.1" - source-map "^0.7.4" - yargs "^17.5.1" - rollup-plugin-web-worker-loader@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/rollup-plugin-web-worker-loader/-/rollup-plugin-web-worker-loader-1.6.1.tgz#9d7a27575b64b0780fe4e8b3bc87470d217e485f" integrity sha512-4QywQSz1NXFHKdyiou16mH3ijpcfLtLGOrAqvAqu1Gx+P8+zj+3gwC2BSL/VW1d+LW4nIHC8F7d7OXhs9UdR2A== -rollup-pluginutils@^1.3.1: - version "1.5.2" - resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408" - integrity sha512-SjdWWWO/CUoMpDy8RUbZ/pSpG68YHmhk5ROKNIoi2En9bJ8bTt3IhYi254RWiTclQmL7Awmrq+rZFOhZkJAHmQ== - dependencies: - estree-walker "^0.2.1" - minimatch "^3.0.2" - -rollup-pluginutils@^2.3.1, rollup-pluginutils@^2.5.0, rollup-pluginutils@^2.8.1, rollup-pluginutils@^2.8.2: +rollup-pluginutils@^2.3.1, rollup-pluginutils@^2.8.1, rollup-pluginutils@^2.8.2: version "2.8.2" resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== @@ -19817,11 +19765,6 @@ slash@3.0.0, slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slash@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-4.0.0.tgz#2422372176c4c6c5addb5e2ada885af984b396a7" - integrity sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew== - slice-ansi@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-5.0.0.tgz#b73063c57aa96f9cd881654b15294d95d285c42a" @@ -21897,6 +21840,11 @@ vite-node@0.29.8: picocolors "^1.0.0" vite "^3.0.0 || ^4.0.0" +vite-plugin-css-injected-by-js@3.5.2: + version "3.5.2" + resolved "https://registry.yarnpkg.com/vite-plugin-css-injected-by-js/-/vite-plugin-css-injected-by-js-3.5.2.tgz#1f75d16ad5c05b6b49bf18018099a189ec2e46ad" + integrity sha512-2MpU/Y+SCZyWUB6ua3HbJCrgnF0KACAsmzOQt1UvRVJCGF6S8xdA3ZUhWcWdM9ivG4I5az8PnQmwwrkC2CAQrQ== + vite-plugin-static-copy@^0.17.0: version "0.17.0" resolved "https://registry.yarnpkg.com/vite-plugin-static-copy/-/vite-plugin-static-copy-0.17.0.tgz#e45527da186c4a3818d09635797b6fc7cc9e035f" @@ -22534,7 +22482,7 @@ yargs@16.2.0, yargs@^16.1.0, yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" -yargs@^17.3.1, yargs@^17.5.1, yargs@^17.6.2, yargs@^17.7.2: +yargs@^17.3.1, yargs@^17.6.2, yargs@^17.7.2: version "17.7.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== From d4c9e5140d2c4ead19899334e37e6cbd6d576f5e Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 26 Nov 2024 16:13:02 +0000 Subject: [PATCH 2/5] Remove old rollup config and update tsconfig --- packages/client/rollup.config.js | 111 ------------------------------- packages/client/tsconfig.json | 3 +- 2 files changed, 1 insertion(+), 113 deletions(-) delete mode 100644 packages/client/rollup.config.js diff --git a/packages/client/rollup.config.js b/packages/client/rollup.config.js deleted file mode 100644 index 3178a527fe..0000000000 --- a/packages/client/rollup.config.js +++ /dev/null @@ -1,111 +0,0 @@ -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" -import svg from "rollup-plugin-svg" -import image from "@rollup/plugin-image" -import json from "rollup-plugin-json" -import nodePolyfills from "rollup-plugin-polyfill-node" -import path from "path" -import { visualizer } from "rollup-plugin-visualizer" -import typescript from "@rollup/plugin-typescript" - -const production = !process.env.ROLLUP_WATCH -const ignoredWarnings = [ - "unused-export-let", - "css-unused-selector", - "module-script-reactive-declaration", - "a11y-no-onchange", - "a11y-click-events-have-key-events", -] - -export default { - input: "src/index.js", - output: [ - { - sourcemap: false, - format: "iife", - file: `./dist/budibase-client.js`, - }, - ], - onwarn(warning, warn) { - if ( - warning.code === "THIS_IS_UNDEFINED" || - warning.code === "CIRCULAR_DEPENDENCY" || - warning.code === "EVAL" - ) { - return - } - warn(warning) - }, - plugins: [ - typescript({ - include: [ - "src/**/*.ts", - `${path.resolve("..")}/frontend-core/src/**/*.ts`, - ], - }), - 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) => { - // Ignore some warnings - if (!ignoredWarnings.includes(warning.code)) { - handler(warning) - } - }, - }), - postcss(), - commonjs(), - nodePolyfills(), - resolve({ - preferBuiltins: true, - browser: true, - dedupe: ["svelte", "svelte/internal"], - extensions: [".js", ".ts", ".json"], - }), - svg(), - image({ - exclude: "**/*.svg", - }), - json(), - production && terser(), - !production && visualizer(), - ], - watch: { - clearScreen: false, - }, -} diff --git a/packages/client/tsconfig.json b/packages/client/tsconfig.json index 5bc64cc5c0..740b129738 100644 --- a/packages/client/tsconfig.json +++ b/packages/client/tsconfig.json @@ -16,6 +16,5 @@ ], "*": ["./src/*"] } - }, - "include": ["src/**/*.ts", "../frontend-core/src/**/*.ts"] + } } From 0ac507f7946bcf40364335b9173aa01ad0cfbd01 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 26 Nov 2024 16:15:21 +0000 Subject: [PATCH 3/5] Remove postcss --- packages/client/package.json | 1 - yarn.lock | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/client/package.json b/packages/client/package.json index 0d4932dc0d..073869415d 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -37,7 +37,6 @@ }, "devDependencies": { "@sveltejs/vite-plugin-svelte": "1.4.0", - "postcss": "^8.4.35", "vite": "^4.5.0", "vite-plugin-css-injected-by-js": "3.5.2" }, diff --git a/yarn.lock b/yarn.lock index b15f31f7e6..b852c8bb45 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17904,7 +17904,7 @@ postcss-values-parser@^6.0.2: is-url-superb "^4.0.0" quote-unquote "^1.0.0" -postcss@^8.1.7, postcss@^8.2.9, postcss@^8.3.11, postcss@^8.4.12, postcss@^8.4.27, postcss@^8.4.29, postcss@^8.4.35, postcss@^8.4.5: +postcss@^8.1.7, postcss@^8.2.9, postcss@^8.3.11, postcss@^8.4.12, postcss@^8.4.27, postcss@^8.4.29, postcss@^8.4.5: version "8.4.41" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.41.tgz#d6104d3ba272d882fe18fc07d15dc2da62fa2681" integrity sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ== From 99ceba956a0d42554e1faf4a2da4145003237c82 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 27 Nov 2024 10:01:16 +0100 Subject: [PATCH 4/5] Update yarn.lock --- yarn.lock | 5 ----- 1 file changed, 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index b852c8bb45..359eb4e204 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12615,11 +12615,6 @@ husky@^8.0.3: resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184" integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg== -husky@^9.1.4: - version "9.1.7" - resolved "https://registry.yarnpkg.com/husky/-/husky-9.1.7.tgz#d46a38035d101b46a70456a850ff4201344c0b2d" - integrity sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA== - ical-generator@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/ical-generator/-/ical-generator-4.1.0.tgz#2a336c951864c5583a2aa715d16f2edcdfd2d90b" From 4369706b17ac2a07891e6c799d7338f418d8a4bb Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 28 Nov 2024 11:07:43 +0100 Subject: [PATCH 5/5] Update yarn.lock --- yarn.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn.lock b/yarn.lock index 359eb4e204..edf81d1f1e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4075,7 +4075,7 @@ resolved "https://registry.yarnpkg.com/@redis/time-series/-/time-series-1.0.4.tgz#af85eb080f6934580e4d3b58046026b6c2b18717" integrity sha512-ThUIgo2U/g7cCuZavucQTQzA9g9JbDDY2f64u3AbAoz/8vE2lt2U37LamDUVChhaDA3IRT9R6VvJwqnUfTJzng== -"@rollup/plugin-commonjs@16.0.0", "@rollup/plugin-commonjs@^16.0.0": +"@rollup/plugin-commonjs@^16.0.0": version "16.0.0" resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-16.0.0.tgz#169004d56cd0f0a1d0f35915d31a036b0efe281f" integrity sha512-LuNyypCP3msCGVQJ7ki8PqYdpjfEkE/xtFa5DqlF+7IBD0JsfMZ87C58heSwIMint58sAUZbt3ITqOmdQv/dXw== @@ -4153,7 +4153,7 @@ is-module "^1.0.0" resolve "^1.22.1" -"@rollup/plugin-replace@^5.0.2", "@rollup/plugin-replace@^5.0.3": +"@rollup/plugin-replace@^5.0.3": version "5.0.7" resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-5.0.7.tgz#150c9ee9db8031d9e4580a61a0edeaaed3d37687" integrity sha512-PqxSfuorkHz/SPpyngLyg5GCEkOcee9M1bkxiVDr41Pd61mqP1PLOoDPbpl44SB2mQGKwV/In74gqQmGITOhEQ==