Skip to content

Commit

Permalink
[FIX] TypeScript type definition support
Browse files Browse the repository at this point in the history
Lazy-loading breaks the automatic type definition detection from

TypeScript. Therefore we need to manually declare the exported types.
  • Loading branch information
matz3 committed Jun 24, 2020
1 parent 4e75d4d commit 49f3ba3
Showing 1 changed file with 125 additions and 2 deletions.
127 changes: 125 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,72 @@
* @module @ui5/builder
* @public
*/
const modules = {
module.exports = {
/**
* @type {import('./lib/builder/builder')}
*/
builder: "./lib/builder/builder",
/**
* @public
* @alias module:@ui5/builder.processors
* @namespace
*/
processors: {
/**
* @type {import('./lib/processors/bundlers/flexChangesBundler')}
*/
flexChangesBundler: "./lib/processors/bundlers/flexChangesBundler",
/**
* @type {import('./lib/processors/bundlers/manifestBundler')}
*/
manifestBundler: "./lib/processors/bundlers/manifestBundler",
/**
* @type {import('./lib/processors/bundlers/moduleBundler')}
*/
moduleBundler: "./lib/processors/bundlers/moduleBundler",
/**
* @type {import('./lib/processors/jsdoc/apiIndexGenerator')}
*/
apiIndexGenerator: "./lib/processors/jsdoc/apiIndexGenerator",
/**
* @type {import('./lib/processors/jsdoc/jsdocGenerator')}
*/
jsdocGenerator: "./lib/processors/jsdoc/jsdocGenerator",
/**
* @type {import('./lib/processors/jsdoc/sdkTransformer')}
*/
sdkTransformer: "./lib/processors/jsdoc/sdkTransformer",
/**
* @type {import('./lib/processors/bootstrapHtmlTransformer')}
*/
bootstrapHtmlTransformer: "./lib/processors/bootstrapHtmlTransformer",
/**
* @type {import('./lib/processors/debugFileCreator')}
*/
debugFileCreator: "./lib/processors/debugFileCreator",
/**
* @type {import('./lib/processors/resourceCopier')}
*/
resourceCopier: "./lib/processors/resourceCopier",
/**
* @type {import('./lib/processors/nonAsciiEscaper')}
*/
nonAsciiEscaper: "./lib/processors/nonAsciiEscaper",
/**
* @type {import('./lib/processors/stringReplacer')}
*/
stringReplacer: "./lib/processors/stringReplacer",
/**
* @type {import('./lib/processors/themeBuilder')}
*/
themeBuilder: "./lib/processors/themeBuilder",
/**
* @type {import('./lib/processors/uglifier')}
*/
uglifier: "./lib/processors/uglifier",
/**
* @type {import('./lib/processors/versionInfoGenerator')}
*/
versionInfoGenerator: "./lib/processors/versionInfoGenerator"
},
/**
Expand All @@ -31,24 +76,81 @@ const modules = {
* @namespace
*/
tasks: {
/**
* @type {import('./lib/tasks/bundlers/generateComponentPreload')}
*/
generateComponentPreload: "./lib/tasks/bundlers/generateComponentPreload",
/**
* @type {import('./lib/tasks/bundlers/generateFlexChangesBundle')}
*/
generateFlexChangesBundle: "./lib/tasks/bundlers/generateFlexChangesBundle",
/**
* @type {import('./lib/tasks/bundlers/generateLibraryPreload')}
*/
generateLibraryPreload: "./lib/tasks/bundlers/generateLibraryPreload",
/**
* @type {import('./lib/tasks/bundlers/generateManifestBundle')}
*/
generateManifestBundle: "./lib/tasks/bundlers/generateManifestBundle",
/**
* @type {import('./lib/tasks/bundlers/generateStandaloneAppBundle')}
*/
generateStandaloneAppBundle: "./lib/tasks/bundlers/generateStandaloneAppBundle",
/**
* @type {import('./lib/tasks/bundlers/generateBundle')}
*/
generateBundle: "./lib/tasks/bundlers/generateBundle",
/**
* @type {import('./lib/tasks/generateCachebusterInfo')}
*/
generateCachebusterInfo: "./lib/tasks/generateCachebusterInfo",
/**
* @type {import('./lib/tasks/buildThemes')}
*/
buildThemes: "./lib/tasks/buildThemes",
/**
* @type {import('./lib/tasks/createDebugFiles')}
*/
createDebugFiles: "./lib/tasks/createDebugFiles",
/**
* @type {import('./lib/tasks/jsdoc/executeJsdocSdkTransformation')}
*/
executeJsdocSdkTransformation: "./lib/tasks/jsdoc/executeJsdocSdkTransformation",
/**
* @type {import('./lib/tasks/jsdoc/generateApiIndex')}
*/
generateApiIndex: "./lib/tasks/jsdoc/generateApiIndex",
/**
* @type {import('./lib/tasks/jsdoc/generateJsdoc')}
*/
generateJsdoc: "./lib/tasks/jsdoc/generateJsdoc",
/**
* @type {import('./lib/tasks/generateVersionInfo')}
*/
generateVersionInfo: "./lib/tasks/generateVersionInfo",
/**
* @type {import('./lib/tasks/escapeNonAsciiCharacters')}
*/
escapeNonAsciiCharacters: "./lib/tasks/escapeNonAsciiCharacters",
/**
* @type {import('./lib/tasks/replaceCopyright')}
*/
replaceCopyright: "./lib/tasks/replaceCopyright",
/**
* @type {import('./lib/tasks/replaceVersion')}
*/
replaceVersion: "./lib/tasks/replaceVersion",
/**
* @type {import('./lib/tasks/transformBootstrapHtml')}
*/
transformBootstrapHtml: "./lib/tasks/transformBootstrapHtml",
/**
* @type {import('./lib/tasks/uglify')}
*/
uglify: "./lib/tasks/uglify",
/**
* @type {import('./lib/tasks/taskRepository')}
*/
taskRepository: "./lib/tasks/taskRepository"
},
/**
Expand All @@ -57,12 +159,33 @@ const modules = {
* @namespace
*/
types: {
/**
* @type {typeof import('./lib/types/AbstractBuilder')}
*/
AbstractBuilder: "./lib/types/AbstractBuilder",
/**
* @type {typeof import('./lib/types/AbstractFormatter')}
*/
AbstractFormatter: "./lib/types/AbstractFormatter",
/**
* @type {import('./lib/types/application/applicationType')}
*/
application: "./lib/types/application/applicationType",
/**
* @type {import('./lib/types/library/libraryType')}
*/
library: "./lib/types/library/libraryType",
/**
* @type {import('./lib/types/themeLibrary/themeLibraryType')}
*/
themeLibrary: "./lib/types/themeLibrary/themeLibraryType",
/**
* @type {import('./lib/types/module/moduleType')}
*/
module: "./lib/types/module/moduleType",
/**
* @type {import('./lib/types/typeRepository')}
*/
typeRepository: "./lib/types/typeRepository"
}
};
Expand All @@ -82,4 +205,4 @@ function exportModules(exportRoot, modulePaths) {
}
}

exportModules(module.exports, modules);
exportModules(module.exports, JSON.parse(JSON.stringify(module.exports)));

0 comments on commit 49f3ba3

Please sign in to comment.