@sap-ux/project-access 2.1.12 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/project/app-title.d.ts +22 -0
- package/dist/project/app-title.js +41 -0
- package/dist/project/index.d.ts +1 -0
- package/dist/project/index.js +1 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { FileName, DirName, FioriToolsSettings, MinCdsPluginUi5Version, MinCdsVersion, fioriToolsDirectory } from './constants.js';
|
|
2
2
|
export { getFilePaths, findFilesByExtension } from './file/index.js';
|
|
3
3
|
export { normalizePath } from './path/index.js';
|
|
4
|
-
export { addPackageDevDependency, clearCdsModuleCache, createApplicationAccess, createProjectAccess, deleteCapApp, filterDataSourcesByType, findAllApps, findCapProjectRoot, findCapProjects, findFioriArtifacts, findProjectRoot, findRootsForPath, getAllUi5YamlFileNames, getAppRootFromWebappPath, getAppProgrammingLanguage, getAppType, getCapCustomPaths, getCapEnvironment, getCapModelAndServices, getCapServiceName, getCapProjectType, getCdsFiles, getCdsRoots, getCdsServices, getCapI18nFolderNames, getSpecification, getSpecificationModuleFromCache, getSpecificationPath, getI18nPropertiesPaths, getI18nBundles, getMinUI5VersionFromManifest, getMinUI5VersionAsArray, getMinimumUI5Version, getMtaPath, getMockServerConfig, getMockDataPath, getNodeModulesPath, getPathMappings, getProject, getProjectType, getWebappPath, hasUI5CliV3, isCapProject, isCapJavaProject, isCapNodeJsProject, loadModuleFromProject, readCapServiceMetadataEdmx, readUi5Yaml, refreshSpecificationDistTags, toReferenceUri, updatePackageScript, getWorkspaceInfo, hasMinCdsVersion, checkCdsUi5PluginEnabled, readFlexChanges, processServices, getMainService, getGlobalCdsHomePath, isUI5IdUnique, getUsedEntitiesFromManifest } from './project/index.js';
|
|
4
|
+
export { addPackageDevDependency, clearCdsModuleCache, createApplicationAccess, createProjectAccess, deleteCapApp, filterDataSourcesByType, findAllApps, findCapProjectRoot, findCapProjects, findFioriArtifacts, findProjectRoot, findRootsForPath, getAllUi5YamlFileNames, getAppRootFromWebappPath, getAppProgrammingLanguage, getAppType, getCapCustomPaths, getCapEnvironment, getCapModelAndServices, getCapServiceName, getCapProjectType, getCdsFiles, getCdsRoots, getCdsServices, getCapI18nFolderNames, getSpecification, getSpecificationModuleFromCache, getSpecificationPath, getI18nPropertiesPaths, getI18nBundles, getMinUI5VersionFromManifest, getMinUI5VersionAsArray, getMinimumUI5Version, getMtaPath, getMockServerConfig, getMockDataPath, getNodeModulesPath, getPathMappings, getProject, getProjectType, getWebappPath, hasUI5CliV3, isCapProject, isCapJavaProject, isCapNodeJsProject, loadModuleFromProject, readCapServiceMetadataEdmx, readUi5Yaml, refreshSpecificationDistTags, toReferenceUri, updatePackageScript, getWorkspaceInfo, hasMinCdsVersion, checkCdsUi5PluginEnabled, readFlexChanges, processServices, getMainService, getGlobalCdsHomePath, isUI5IdUnique, getUsedEntitiesFromManifest, resolveApplicationTitle } from './project/index.js';
|
|
5
5
|
export type { UsedEntity } from './project/index.js';
|
|
6
6
|
export { execNpmCommand } from './command/npm-command.js';
|
|
7
7
|
export * from './types/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { FileName, DirName, FioriToolsSettings, MinCdsPluginUi5Version, MinCdsVersion, fioriToolsDirectory } from './constants.js';
|
|
2
2
|
export { getFilePaths, findFilesByExtension } from './file/index.js';
|
|
3
3
|
export { normalizePath } from './path/index.js';
|
|
4
|
-
export { addPackageDevDependency, clearCdsModuleCache, createApplicationAccess, createProjectAccess, deleteCapApp, filterDataSourcesByType, findAllApps, findCapProjectRoot, findCapProjects, findFioriArtifacts, findProjectRoot, findRootsForPath, getAllUi5YamlFileNames, getAppRootFromWebappPath, getAppProgrammingLanguage, getAppType, getCapCustomPaths, getCapEnvironment, getCapModelAndServices, getCapServiceName, getCapProjectType, getCdsFiles, getCdsRoots, getCdsServices, getCapI18nFolderNames, getSpecification, getSpecificationModuleFromCache, getSpecificationPath, getI18nPropertiesPaths, getI18nBundles, getMinUI5VersionFromManifest, getMinUI5VersionAsArray, getMinimumUI5Version, getMtaPath, getMockServerConfig, getMockDataPath, getNodeModulesPath, getPathMappings, getProject, getProjectType, getWebappPath, hasUI5CliV3, isCapProject, isCapJavaProject, isCapNodeJsProject, loadModuleFromProject, readCapServiceMetadataEdmx, readUi5Yaml, refreshSpecificationDistTags, toReferenceUri, updatePackageScript, getWorkspaceInfo, hasMinCdsVersion, checkCdsUi5PluginEnabled, readFlexChanges, processServices, getMainService, getGlobalCdsHomePath, isUI5IdUnique, getUsedEntitiesFromManifest } from './project/index.js';
|
|
4
|
+
export { addPackageDevDependency, clearCdsModuleCache, createApplicationAccess, createProjectAccess, deleteCapApp, filterDataSourcesByType, findAllApps, findCapProjectRoot, findCapProjects, findFioriArtifacts, findProjectRoot, findRootsForPath, getAllUi5YamlFileNames, getAppRootFromWebappPath, getAppProgrammingLanguage, getAppType, getCapCustomPaths, getCapEnvironment, getCapModelAndServices, getCapServiceName, getCapProjectType, getCdsFiles, getCdsRoots, getCdsServices, getCapI18nFolderNames, getSpecification, getSpecificationModuleFromCache, getSpecificationPath, getI18nPropertiesPaths, getI18nBundles, getMinUI5VersionFromManifest, getMinUI5VersionAsArray, getMinimumUI5Version, getMtaPath, getMockServerConfig, getMockDataPath, getNodeModulesPath, getPathMappings, getProject, getProjectType, getWebappPath, hasUI5CliV3, isCapProject, isCapJavaProject, isCapNodeJsProject, loadModuleFromProject, readCapServiceMetadataEdmx, readUi5Yaml, refreshSpecificationDistTags, toReferenceUri, updatePackageScript, getWorkspaceInfo, hasMinCdsVersion, checkCdsUi5PluginEnabled, readFlexChanges, processServices, getMainService, getGlobalCdsHomePath, isUI5IdUnique, getUsedEntitiesFromManifest, resolveApplicationTitle } from './project/index.js';
|
|
5
5
|
export { execNpmCommand } from './command/npm-command.js';
|
|
6
6
|
export * from './types/index.js';
|
|
7
7
|
export { checkDependencies, getReuseLibs } from './library/index.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Editor } from 'mem-fs-editor';
|
|
2
|
+
import type { Logger } from '@sap-ux/logger';
|
|
3
|
+
import type { Manifest } from '../types/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Resolves the application title from the manifest, following i18n key references when present.
|
|
6
|
+
*
|
|
7
|
+
* @param params - webapp path and optional pre-parsed manifest
|
|
8
|
+
* @param params.webappPath - path to the webapp directory; used to locate manifest.json and resolve i18n paths
|
|
9
|
+
* @param params.manifest - pre-parsed manifest content; pass to avoid re-reading from disk
|
|
10
|
+
* @param [options] - optional options
|
|
11
|
+
* @param [options.memFs] - optional mem-fs-editor instance
|
|
12
|
+
* @param [options.logger] - optional logger instance
|
|
13
|
+
* @returns the resolved title string, or undefined if it cannot be determined
|
|
14
|
+
*/
|
|
15
|
+
export declare function resolveApplicationTitle(params: {
|
|
16
|
+
webappPath: string;
|
|
17
|
+
manifest?: Manifest;
|
|
18
|
+
}, options?: {
|
|
19
|
+
memFs?: Editor;
|
|
20
|
+
logger?: Logger;
|
|
21
|
+
}): Promise<string | undefined>;
|
|
22
|
+
//# sourceMappingURL=app-title.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { extractDoubleCurlyBracketsKey, getPropertiesI18nBundle } from '@sap-ux/i18n';
|
|
3
|
+
import { FileName } from '../constants.js';
|
|
4
|
+
import { readJSON } from '../file/index.js';
|
|
5
|
+
import { getI18nPropertiesPaths } from './i18n/i18n.js';
|
|
6
|
+
/**
|
|
7
|
+
* Resolves the application title from the manifest, following i18n key references when present.
|
|
8
|
+
*
|
|
9
|
+
* @param params - webapp path and optional pre-parsed manifest
|
|
10
|
+
* @param params.webappPath - path to the webapp directory; used to locate manifest.json and resolve i18n paths
|
|
11
|
+
* @param params.manifest - pre-parsed manifest content; pass to avoid re-reading from disk
|
|
12
|
+
* @param [options] - optional options
|
|
13
|
+
* @param [options.memFs] - optional mem-fs-editor instance
|
|
14
|
+
* @param [options.logger] - optional logger instance
|
|
15
|
+
* @returns the resolved title string, or undefined if it cannot be determined
|
|
16
|
+
*/
|
|
17
|
+
export async function resolveApplicationTitle(params, options) {
|
|
18
|
+
const { webappPath } = params;
|
|
19
|
+
let { manifest } = params;
|
|
20
|
+
const { memFs, logger } = options ?? {};
|
|
21
|
+
const manifestPath = join(webappPath, FileName.Manifest);
|
|
22
|
+
manifest ??= await readJSON(manifestPath, memFs);
|
|
23
|
+
const rawTitle = manifest?.['sap.app']?.title;
|
|
24
|
+
if (!rawTitle) {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
const i18nKey = extractDoubleCurlyBracketsKey(rawTitle);
|
|
28
|
+
if (!i18nKey) {
|
|
29
|
+
return rawTitle;
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
const i18nPaths = await getI18nPropertiesPaths(manifestPath, manifest, memFs);
|
|
33
|
+
const bundle = await getPropertiesI18nBundle(i18nPaths['sap.app'], memFs);
|
|
34
|
+
return bundle[i18nKey]?.[0]?.value?.value;
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
logger?.debug(`Failed to load i18n properties bundle: ${error}`);
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=app-title.js.map
|
package/dist/project/index.d.ts
CHANGED
|
@@ -13,4 +13,5 @@ export { updatePackageScript, hasUI5CliV3 } from './script.js';
|
|
|
13
13
|
export { getSpecification, getSpecificationModuleFromCache, getSpecificationPath, refreshSpecificationDistTags } from './specification.js';
|
|
14
14
|
export { readFlexChanges } from './flex-changes.js';
|
|
15
15
|
export { isUI5IdUnique } from './ui5-xml-id-validator.js';
|
|
16
|
+
export { resolveApplicationTitle } from './app-title.js';
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/project/index.js
CHANGED
|
@@ -12,4 +12,5 @@ export { updatePackageScript, hasUI5CliV3 } from './script.js';
|
|
|
12
12
|
export { getSpecification, getSpecificationModuleFromCache, getSpecificationPath, refreshSpecificationDistTags } from './specification.js';
|
|
13
13
|
export { readFlexChanges } from './flex-changes.js';
|
|
14
14
|
export { isUI5IdUnique } from './ui5-xml-id-validator.js';
|
|
15
|
+
export { resolveApplicationTitle } from './app-title.js';
|
|
15
16
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/project-access",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Library to access SAP Fiori tools projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"mem-fs-editor": "9.4.0",
|
|
33
33
|
"semver": "7.8.5",
|
|
34
34
|
"@sap-ux/i18n": "1.0.3",
|
|
35
|
-
"@sap-ux/ui5-config": "1.0.
|
|
35
|
+
"@sap-ux/ui5-config": "1.0.9"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@jest/globals": "30.4.1",
|