diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 89f72bc46d..2caad20bf6 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -3,7 +3,7 @@ "description": "A UI solution used in the different Budibase projects.", "version": "0.0.0", "license": "MPL-2.0", - "svelte": "src/index.js", + "svelte": "src/index.ts", "module": "dist/bbui.mjs", "exports": { ".": { @@ -14,7 +14,8 @@ "./spectrum-icons-vite.js": "./src/spectrum-icons-vite.js" }, "scripts": { - "build": "vite build" + "build": "vite build", + "dev": "vite build --watch --mode=dev" }, "devDependencies": { "@sveltejs/vite-plugin-svelte": "1.4.0", diff --git a/packages/bbui/src/helpers.d.ts b/packages/bbui/src/helpers.d.ts deleted file mode 100644 index d4e2a45186..0000000000 --- a/packages/bbui/src/helpers.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare module "./helpers" { - export const cloneDeep: (obj: T) => T - export const copyToClipboard: (value: any) => Promise -} diff --git a/packages/bbui/src/index.js b/packages/bbui/src/index.ts similarity index 100% rename from packages/bbui/src/index.js rename to packages/bbui/src/index.ts diff --git a/packages/bbui/svelte.config.js b/packages/bbui/svelte.config.js new file mode 100644 index 0000000000..7d908c15d5 --- /dev/null +++ b/packages/bbui/svelte.config.js @@ -0,0 +1,7 @@ +const { vitePreprocess } = require("@sveltejs/vite-plugin-svelte") + +const config = { + preprocess: vitePreprocess(), +} + +module.exports = config diff --git a/packages/bbui/tsconfig.json b/packages/bbui/tsconfig.json new file mode 100644 index 0000000000..0b529c199a --- /dev/null +++ b/packages/bbui/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.build.json", + "compilerOptions": { + "allowJs": true, + "outDir": "./dist", + "lib": ["ESNext"], + "baseUrl": ".", + }, + "include": ["./src/**/*"], + "exclude": ["node_modules", "**/*.json", "**/*.spec.ts", "**/*.spec.js"] +} \ No newline at end of file diff --git a/packages/bbui/vite.config.js b/packages/bbui/vite.config.js index bf0f9fc26d..bccca20e43 100644 --- a/packages/bbui/vite.config.js +++ b/packages/bbui/vite.config.js @@ -9,7 +9,7 @@ export default defineConfig(({ mode }) => { build: { sourcemap: !isProduction, lib: { - entry: "src/index.js", + entry: "src/index.ts", formats: ["es"], }, },