From 62a27888d2cfcdebf5c43a0c87e0a48184bec726 Mon Sep 17 00:00:00 2001 From: kewcoder Date: Sun, 1 Oct 2023 02:36:05 +0700 Subject: [PATCH 1/3] update example --- packages/@bootwind-helpers/README.md | 2 +- packages/@bootwind-helpers/package-lock.json | 4 ++-- packages/@bootwind-helpers/package.json | 2 +- packages/@bootwind-helpers/src/App.vue | 19 ++++++++++++++++--- packages/@bootwind-helpers/src/index.js | 7 +++++-- 5 files changed, 25 insertions(+), 9 deletions(-) diff --git a/packages/@bootwind-helpers/README.md b/packages/@bootwind-helpers/README.md index 702dd1c..2fc44b7 100644 --- a/packages/@bootwind-helpers/README.md +++ b/packages/@bootwind-helpers/README.md @@ -1 +1 @@ -Bootwind Template (WIP) +1. getFloating : to create tooltip , dropdown , select \ No newline at end of file diff --git a/packages/@bootwind-helpers/package-lock.json b/packages/@bootwind-helpers/package-lock.json index e69e5d5..3254b3d 100644 --- a/packages/@bootwind-helpers/package-lock.json +++ b/packages/@bootwind-helpers/package-lock.json @@ -1,12 +1,12 @@ { "name": "@bootwind/helpers", - "version": "0.0.2", + "version": "0.0.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@bootwind/helpers", - "version": "0.0.2", + "version": "0.0.4", "dependencies": { "vue": "^3.3.4" }, diff --git a/packages/@bootwind-helpers/package.json b/packages/@bootwind-helpers/package.json index d7bd228..e1b19a7 100644 --- a/packages/@bootwind-helpers/package.json +++ b/packages/@bootwind-helpers/package.json @@ -1,6 +1,6 @@ { "name": "@bootwind/helpers", - "version": "0.0.2", + "version": "0.0.4", "type": "module", "scripts": { "dev": "vite", diff --git a/packages/@bootwind-helpers/src/App.vue b/packages/@bootwind-helpers/src/App.vue index 4d3887e..fd4fbe7 100644 --- a/packages/@bootwind-helpers/src/App.vue +++ b/packages/@bootwind-helpers/src/App.vue @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/packages/@bootwind-react/src/ui/Chip/Chip.js b/packages/@bootwind-react/src/ui/Chip/Chip.js new file mode 100644 index 0000000..c1e4acf --- /dev/null +++ b/packages/@bootwind-react/src/ui/Chip/Chip.js @@ -0,0 +1,5 @@ +import Chip from './Chip.vue' + +export { + Chip +} \ No newline at end of file diff --git a/packages/@bootwind-react/src/ui/Chip/Chip.vue b/packages/@bootwind-react/src/ui/Chip/Chip.vue new file mode 100644 index 0000000..5f76e04 --- /dev/null +++ b/packages/@bootwind-react/src/ui/Chip/Chip.vue @@ -0,0 +1,11 @@ + + \ No newline at end of file diff --git a/packages/@bootwind-react/src/ui/Dropdown/Dropdown.js b/packages/@bootwind-react/src/ui/Dropdown/Dropdown.js new file mode 100644 index 0000000..c74cfc7 --- /dev/null +++ b/packages/@bootwind-react/src/ui/Dropdown/Dropdown.js @@ -0,0 +1,5 @@ +import Dropdown from './Dropdown.vue' + +export { + Dropdown +} \ No newline at end of file diff --git a/packages/@bootwind-react/src/ui/Dropdown/Dropdown.vue b/packages/@bootwind-react/src/ui/Dropdown/Dropdown.vue new file mode 100644 index 0000000..5142b06 --- /dev/null +++ b/packages/@bootwind-react/src/ui/Dropdown/Dropdown.vue @@ -0,0 +1,77 @@ + + + + \ No newline at end of file diff --git a/packages/@bootwind-react/src/ui/Select/Select.js b/packages/@bootwind-react/src/ui/Select/Select.js new file mode 100644 index 0000000..f8f3e7d --- /dev/null +++ b/packages/@bootwind-react/src/ui/Select/Select.js @@ -0,0 +1,4 @@ +import Select from './Select.vue' +export { + Select +} \ No newline at end of file diff --git a/packages/@bootwind-react/src/ui/Select/Select.vue b/packages/@bootwind-react/src/ui/Select/Select.vue new file mode 100644 index 0000000..e8457cc --- /dev/null +++ b/packages/@bootwind-react/src/ui/Select/Select.vue @@ -0,0 +1,65 @@ + + + diff --git a/packages/@bootwind-react/vite.config.js b/packages/@bootwind-react/vite.config.js new file mode 100644 index 0000000..8b855dd --- /dev/null +++ b/packages/@bootwind-react/vite.config.js @@ -0,0 +1,53 @@ +import { defineConfig } from 'vite' +import fg from 'fast-glob' +import vue from '@vitejs/plugin-vue' +import { resolve } from 'path' + + +// Defines an array of entry points to be used to search for files. +const entryPoints = [ + 'src/*.js' +] + +// Searches for files that match the patterns defined in the array of input points. +// Returns an array of absolute file paths. +const files = fg.sync(entryPoints, { absolute: true }) + +// Maps the file paths in the "files" array to an array of key-value pair. +const entities = files.map((file) => { + // Extract the part of the file path after the "src" folder and before the file extension. + const [key] = file.match(/(?<=src\/).*$/) || [] + + // Remove the file extension from the key. + const keyWithoutExt = key.replace(/\.[^.]*$/, '') + + return [keyWithoutExt, file] +}) + +// Convert the array of key-value pairs to an object using the Object.fromEntries() method. +// Returns an object where each key is the file name without the extension and the value is the absolute file path. +const entries = Object.fromEntries(entities) + +export default defineConfig({ + plugins: [vue()], + resolve: { + alias: { + '@': resolve(__dirname, './src/'), + } + }, + build: { + outDir: 'dist', + lib: { + entry: entries, + formats: ['es'] + }, + rollupOptions: { + external: ['vue'], + output: { + globals: { + vue: 'Vue', + } + }, + } + } +}) \ No newline at end of file