{"id":22633,"library":"vite-plugin-custom-functions-metadata","title":"vite-plugin-custom-functions-metadata","description":"Vite plugin (v1.0.1) that generates JSON metadata for custom Excel functions from TypeScript source files, intended for Office Add-ins development. It scans a given input file for JSDoc-annotated functions and outputs a metadata JSON file referencing function names, descriptions, and parameters. The plugin is designed to integrate into the Vite build pipeline, automating metadata generation that would otherwise require manual maintenance. Differentiators: dedicated to Excel custom functions, leverages TypeScript type definitions, and provides a simple plugin interface for modern Vite projects. Release cadence is currently low; no breaking changes known.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"github.com/abrasher/vite-plugin-custom-functions-metadata","tags":["javascript","vite","excel","plugin","officejs","typescript"],"install":[{"cmd":"npm install vite-plugin-custom-functions-metadata","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-custom-functions-metadata","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-custom-functions-metadata","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; the plugin is designed to work with Vite","package":"vite","optional":false}],"imports":[{"note":"ESM-only; CommonJS require will fail.","wrong":"const customFunctionsMetadataPlugin = require('vite-plugin-custom-functions-metadata')","symbol":"default","correct":"import customFunctionsMetadataPlugin from 'vite-plugin-custom-functions-metadata'"},{"note":"The package exports a default export, not a named export.","wrong":"import { customFunctionsMetadataPlugin } from 'vite-plugin-custom-functions-metadata'","symbol":"customFunctionsMetadataPlugin","correct":"import customFunctionsMetadataPlugin from 'vite-plugin-custom-functions-metadata'"},{"note":"TypeScript users can import the type for options when configuring the plugin.","wrong":"","symbol":"PluginOptions","correct":"import type { PluginOptions } from 'vite-plugin-custom-functions-metadata'"}],"quickstart":{"code":"import { defineConfig } from 'vite';\nimport customFunctionsMetadataPlugin from 'vite-plugin-custom-functions-metadata';\nimport { resolve } from 'path';\n\nexport default defineConfig({\n  plugins: [\n    customFunctionsMetadataPlugin({\n      inputFile: resolve(__dirname, 'src/functions/functions.ts'),\n      outputFile: resolve(__dirname, 'src/functions/functions.json'),\n    }),\n  ],\n});","lang":"typescript","description":"Configures the Vite plugin to generate Excel custom functions metadata from a TypeScript input file."},"warnings":[{"fix":"Create a barrel file that re-exports all custom functions from separate modules.","message":"The plugin only processes a single input file; if your functions are split across multiple files, you must manually aggregate them into one input file or use a workaround.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Do not manually edit the output file; treat it as a build artifact.","message":"The output JSON file is overwritten on every build; ensure no manual edits are lost.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Add JSDoc tags like @customfunction, @param, @returns to your functions.","message":"JSDoc annotations are required for function metadata to be generated; plain TypeScript without JSDoc will not produce entries.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Pin to version 1.x and test upgrades.","message":"No breaking changes known yet; however, the plugin is at v1.0.x and may introduce breaking changes in future major versions.","severity":"breaking","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install with 'npm install vite-plugin-custom-functions-metadata --save-dev' and use import syntax.","cause":"Package not installed or using require() in an ESM-only package.","error":"Error: Cannot find module 'vite-plugin-custom-functions-metadata'"},{"fix":"Use 'import customFunctionsMetadataPlugin from ...' instead of destructured import.","cause":"Default import expected but named import used incorrectly.","error":"TypeError: customFunctionsMetadataPlugin is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}