project/index.js

  1. /**
  2. * @module module:@ui5/project
  3. * @public
  4. */
  5. module.exports = {
  6. /**
  7. * @type {import('./lib/normalizer')}
  8. */
  9. normalizer: "./lib/normalizer",
  10. /**
  11. * @type {import('./lib/projectPreprocessor')}
  12. */
  13. projectPreprocessor: "./lib/projectPreprocessor",
  14. /**
  15. * @public
  16. * @alias module:@ui5/project.ui5Framework
  17. * @namespace
  18. */
  19. ui5Framework: {
  20. /**
  21. * @type {typeof import('./lib/ui5Framework/Openui5Resolver')}
  22. */
  23. Openui5Resolver: "./lib/ui5Framework/Openui5Resolver",
  24. /**
  25. * @type {typeof import('./lib/ui5Framework/Sapui5Resolver')}
  26. */
  27. Sapui5Resolver: "./lib/ui5Framework/Sapui5Resolver"
  28. },
  29. /**
  30. * @public
  31. * @alias module:@ui5/project.validation
  32. * @namespace
  33. */
  34. validation: {
  35. /**
  36. * @type {import('./lib/validation/validator')}
  37. */
  38. validator: "./lib/validation/validator",
  39. /**
  40. * @type {typeof import('./lib/validation/ValidationError')}
  41. */
  42. ValidationError: "./lib/validation/ValidationError"
  43. },
  44. /**
  45. * @private
  46. * @alias module:@ui5/project.translators
  47. * @namespace
  48. */
  49. translators: {
  50. /**
  51. * @type {import('./lib/translators/npm')}
  52. */
  53. npm: "./lib/translators/npm",
  54. /**
  55. * @type {import('./lib/translators/static')}
  56. */
  57. static: "./lib/translators/static"
  58. }
  59. };
  60. function exportModules(exportRoot, modulePaths) {
  61. for (const moduleName of Object.keys(modulePaths)) {
  62. if (typeof modulePaths[moduleName] === "object") {
  63. exportRoot[moduleName] = {};
  64. exportModules(exportRoot[moduleName], modulePaths[moduleName]);
  65. } else {
  66. Object.defineProperty(exportRoot, moduleName, {
  67. get() {
  68. return require(modulePaths[moduleName]);
  69. }
  70. });
  71. }
  72. }
  73. }
  74. exportModules(module.exports, JSON.parse(JSON.stringify(module.exports)));