mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-15 12:13:46 +00:00
chore: adopt Biome + Stylelint, modernize CI/CD, add security/support docs, minor JS fixes
- Linting/format - Replace ESLint/Prettier with Biome; remove old configs; add `biome.json`; update scripts - Tailwind-friendly `.stylelintrc.yaml`; Stylelint and Biome pass - Enable Biome across `modules/**`; prune legacy JS globals; ignore oversized `devicon.json` - Code fixes - `hb-theme.js`: avoid assignment-in-expressions; clearer dataset updates - `hugoblox-slides.js`: fix inner var scope (var → let); apply formatting - CI/CD - Split lint/build workflows; add path filters; Node via Corepack (pnpm from package.json) - Hugo pinned to env `HUGO_VERSION`; add consistency check vs `starters/academic-cv/hugoblox.yaml` - Nightly starters matrix build (academic-cv, landing-page); CodeQL weekly; resource caches - Workflows/Community - Greeter: switch to `pull_request_target`; add Contributor Guide to PR message - PR labeler for path-based labels - Repo policies/docs - `CODEOWNERS` for `@gcushen` - `SECURITY.md`, `SUPPORT.md` - Documented branch protection in `.github/settings.yml` - Move `CODE_OF_CONDUCT.md` to `.github/` - docs(zh): update `README.zh.md` translation Notes: - pnpm is sourced from `package.json: packageManager` via Corepack; no hard-coded pnpm versions in CI.
This commit is contained in:
1 parent
db8a975a9f
commit
d5d2f04c2d
91 files changed
+2957
-1993
No files matched your search
+46
-40
@@ -1,86 +1,92 @@
|
||||
/**
|
||||
* Vite Configuration for Vendoring JavaScript Libraries
|
||||
*
|
||||
*
|
||||
* This config is used by Hugo Blox maintainers to copy third-party
|
||||
* JavaScript libraries from node_modules into the Hugo module's assets.
|
||||
*
|
||||
*
|
||||
* Usage: pnpm run vendor:libs
|
||||
*/
|
||||
|
||||
import { defineConfig } from 'vite';
|
||||
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
||||
import { resolve } from 'path';
|
||||
import del from 'rollup-plugin-delete';
|
||||
import { resolve } from "path";
|
||||
import del from "rollup-plugin-delete";
|
||||
import { defineConfig } from "vite";
|
||||
import { viteStaticCopy } from "vite-plugin-static-copy";
|
||||
|
||||
const MODULE_DIR = 'modules/blox-tailwind';
|
||||
const OUTPUT_DIR = resolve(MODULE_DIR, 'assets/dist/lib');
|
||||
const MODULE_DIR = "modules/blox-tailwind";
|
||||
const OUTPUT_DIR = resolve(MODULE_DIR, "assets/dist/lib");
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
emptyOutDir: true,
|
||||
outDir: OUTPUT_DIR,
|
||||
lib: {
|
||||
entry: resolve(MODULE_DIR, 'assets/js/vendor-libs.js'),
|
||||
formats: ['es'],
|
||||
fileName: 'vendor-libs'
|
||||
entry: resolve(MODULE_DIR, "assets/js/vendor-libs.js"),
|
||||
formats: ["es"],
|
||||
fileName: "vendor-libs",
|
||||
},
|
||||
rollupOptions: {
|
||||
// Don't bundle these libraries, just copy them
|
||||
external: ['mermaid', 'plotly.js', 'katex', 'markmap-autoloader', 'alpinejs'],
|
||||
}
|
||||
external: [
|
||||
"mermaid",
|
||||
"plotly.js",
|
||||
"katex",
|
||||
"markmap-autoloader",
|
||||
"alpinejs",
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
plugins: [
|
||||
// Copy vendor libraries to module assets
|
||||
viteStaticCopy({
|
||||
targets: [
|
||||
// Mermaid - Diagram rendering
|
||||
{
|
||||
src: 'node_modules/mermaid/dist/mermaid.min.js',
|
||||
dest: 'mermaid/'
|
||||
src: "node_modules/mermaid/dist/mermaid.min.js",
|
||||
dest: "mermaid/",
|
||||
},
|
||||
|
||||
|
||||
// Plotly - Interactive charts
|
||||
{
|
||||
src: 'node_modules/plotly.js/dist/plotly.min.js',
|
||||
dest: 'plotly/'
|
||||
src: "node_modules/plotly.js/dist/plotly.min.js",
|
||||
dest: "plotly/",
|
||||
},
|
||||
|
||||
|
||||
// KaTeX - Math rendering
|
||||
{
|
||||
src: 'node_modules/katex/dist/katex.min.js',
|
||||
dest: 'katex/'
|
||||
src: "node_modules/katex/dist/katex.min.js",
|
||||
dest: "katex/",
|
||||
},
|
||||
{
|
||||
src: 'node_modules/katex/dist/katex.min.css',
|
||||
dest: 'katex/'
|
||||
src: "node_modules/katex/dist/katex.min.css",
|
||||
dest: "katex/",
|
||||
},
|
||||
{
|
||||
src: 'node_modules/katex/dist/contrib/auto-render.min.js',
|
||||
dest: 'katex/'
|
||||
src: "node_modules/katex/dist/contrib/auto-render.min.js",
|
||||
dest: "katex/",
|
||||
},
|
||||
{
|
||||
src: 'node_modules/katex/dist/fonts/',
|
||||
dest: 'katex/'
|
||||
src: "node_modules/katex/dist/fonts/",
|
||||
dest: "katex/",
|
||||
},
|
||||
|
||||
|
||||
// Markmap - Mind map rendering
|
||||
{
|
||||
src: 'node_modules/markmap-autoloader/dist/index.js',
|
||||
dest: 'markmap/'
|
||||
src: "node_modules/markmap-autoloader/dist/index.js",
|
||||
dest: "markmap/",
|
||||
},
|
||||
// Alpine.js
|
||||
{
|
||||
src: 'node_modules/alpinejs/dist/cdn.min.js',
|
||||
dest: 'alpinejs/'
|
||||
}
|
||||
]
|
||||
src: "node_modules/alpinejs/dist/cdn.min.js",
|
||||
dest: "alpinejs/",
|
||||
},
|
||||
],
|
||||
}),
|
||||
|
||||
|
||||
// Clean up any unwanted build artifacts
|
||||
del({
|
||||
targets: `${OUTPUT_DIR}/vendor-libs.js`, // Remove the dummy entry file
|
||||
hook: 'writeBundle'
|
||||
})
|
||||
]
|
||||
});
|
||||
hook: "writeBundle",
|
||||
}),
|
||||
],
|
||||
});
|
||||
Reference in new issue
Block a user