.hygen.js 961 B

12345678910111213141516171819202122232425262728
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. const config = require('./lib.config.js')
  3. module.exports = {
  4. helpers: {
  5. componentLibrary: (libraryName, path = true) => {
  6. if (libraryName === 'Desktop') return path ? 'apps/desktop' : 'desktop'
  7. if (libraryName === 'Mobile') return path ? 'apps/mobile' : 'mobile'
  8. if (libraryName === 'Shared') return 'shared'
  9. },
  10. composableName: (name, h) => {
  11. return h.changeCase.camel(`use${name}`)
  12. },
  13. componentGenericWitPrefix: (name, h) => {
  14. const nameWithGenericPrefix = name.replace(
  15. new RegExp(`${config.generic.prefix}`, 'i'),
  16. '',
  17. )
  18. return h.changeCase.pascal(
  19. `${config.generic.prefix}${h.changeCase.pascal(nameWithGenericPrefix)}`,
  20. )
  21. },
  22. zammadCopyright: () => {
  23. return `Copyright (C) 2012-${new Date().getFullYear()} Zammad Foundation, https://zammad-foundation.org/`
  24. },
  25. },
  26. }