(widgets) import widgets code from Messages and setup Docker workflow (#33)

This adds Gaufre v2 with source, documentation, examples and built artefacts.
Also includes the feedback widget from Messages.
This commit is contained in:
Sylvain Zimmer
2025-11-19 15:18:21 +01:00
committed by GitHub
parent 3b2f083d3f
commit 720ee9f4f0
53 changed files with 5375 additions and 4 deletions

31
packages/widgets/build.js Normal file
View File

@@ -0,0 +1,31 @@
import { build } from 'vite'
import { readdirSync } from 'node:fs'
import { join } from 'node:path'
import { fileURLToPath } from 'node:url'
const __dirname = fileURLToPath(new URL('.', import.meta.url))
const widgetsDir = join(__dirname, 'src', 'widgets')
function discoverWidgets() {
return readdirSync(widgetsDir, { withFileTypes: true })
.filter(dirent => dirent.isDirectory())
.map(dirent => dirent.name)
}
// Run an independent build for each widget
for (const widget of discoverWidgets()) {
await build({
build: {
emptyOutDir: false,
outDir: join(process.env.WIDGETS_OUTPUT_DIR || "", "dist"),
rollupOptions: {
input: join(widgetsDir, widget, 'main.ts'),
output: {
entryFileNames: widget + '.js',
format: 'iife'
}
}
},
})
}