-
-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Is your feature request related to a problem? Please describe.
Out of the box, nuxt‑apex names composables based solely on the file path and default transformation logic. When I need a specific alias for a particular endpoint—for example, to match an existing naming convention or to simplify frequently used calls—I have to rename the generated files manually or wrap them in another layer. This extra step is tedious and error‑prone, especially as the number of endpoints grows.
Describe the solution you'd like
Allow users to annotate their endpoint handler files with an inline comment to declare a custom alias, and have nuxt‑apex pick up and apply that alias during code generation. For example:
// ~/server/api/users/[id]/get.ts
// as: useFetchUserById
export default defineApexHandler(async (event) => {
// handler logic
})When the module runs, instead of generating useTFetchUsersByIdGet, it would create:
export const useFetchUserById = () => { /* … */ }This feature would:
- Support a simple // as: syntax
- Fall back to the default naming strategy when no alias comment is present
- Surface a clear error or warning if the alias is invalid (e.g. not a valid identifier or duplicated)