@sap-ux/adp-tooling 0.15.17 → 0.15.19
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.
|
@@ -86,13 +86,13 @@ export declare function addControllerExtension(rootPath: string, basePath: strin
|
|
|
86
86
|
/**
|
|
87
87
|
* Asynchronously adds an XML fragment to the project if it doesn't already exist.
|
|
88
88
|
*
|
|
89
|
-
* @param {string}
|
|
89
|
+
* @param {string} webappPath - The path to the webapp of the project.
|
|
90
90
|
* @param {string} projectRoot - The root path of the project.
|
|
91
91
|
* @param {AnnotationFileChange} change - The change data, including the fragment path.
|
|
92
92
|
* @param {Editor} fs - The mem-fs-editor instance.
|
|
93
93
|
* @param {Logger} logger - The logging instance.
|
|
94
94
|
*@param {AbapServiceProvider} provider - abap provider.
|
|
95
95
|
*/
|
|
96
|
-
export declare function addAnnotationFile(
|
|
96
|
+
export declare function addAnnotationFile(webappPath: string, projectRoot: string, change: AnnotationFileChange, fs: Editor, logger: Logger, provider: AbapServiceProvider): Promise<void>;
|
|
97
97
|
export {};
|
|
98
98
|
//# sourceMappingURL=change-handler.d.ts.map
|
|
@@ -283,22 +283,22 @@ async function addControllerExtension(rootPath, basePath, change, fs, logger) {
|
|
|
283
283
|
/**
|
|
284
284
|
* Asynchronously adds an XML fragment to the project if it doesn't already exist.
|
|
285
285
|
*
|
|
286
|
-
* @param {string}
|
|
286
|
+
* @param {string} webappPath - The path to the webapp of the project.
|
|
287
287
|
* @param {string} projectRoot - The root path of the project.
|
|
288
288
|
* @param {AnnotationFileChange} change - The change data, including the fragment path.
|
|
289
289
|
* @param {Editor} fs - The mem-fs-editor instance.
|
|
290
290
|
* @param {Logger} logger - The logging instance.
|
|
291
291
|
*@param {AbapServiceProvider} provider - abap provider.
|
|
292
292
|
*/
|
|
293
|
-
async function addAnnotationFile(
|
|
293
|
+
async function addAnnotationFile(webappPath, projectRoot, change, fs, logger, provider) {
|
|
294
294
|
const { dataSourceId, annotations, dataSource } = change.content;
|
|
295
295
|
const annotationDataSourceKey = annotations[0];
|
|
296
296
|
const annotationUriSegments = dataSource[annotationDataSourceKey].uri.split('/');
|
|
297
297
|
annotationUriSegments.shift();
|
|
298
|
-
const fullPath = (0, path_1.join)(
|
|
298
|
+
const fullPath = (0, path_1.join)(webappPath, project_access_1.DirName.Changes, ...annotationUriSegments);
|
|
299
299
|
try {
|
|
300
|
-
const variant = await (0, helper_1.getVariant)(
|
|
301
|
-
const manifestService = await manifest_service_1.ManifestService.initMergedManifest(provider,
|
|
300
|
+
const variant = await (0, helper_1.getVariant)(projectRoot);
|
|
301
|
+
const manifestService = await manifest_service_1.ManifestService.initMergedManifest(provider, projectRoot, variant, logger);
|
|
302
302
|
const metadata = await manifestService.getDataSourceMetadata(dataSourceId);
|
|
303
303
|
const datasoruces = await manifestService.getManifestDataSources();
|
|
304
304
|
const namespaces = (0, odata_service_writer_1.getAnnotationNamespaces)({ metadata });
|
package/dist/types.d.ts
CHANGED
|
@@ -90,6 +90,10 @@ export interface AdpWriterConfig {
|
|
|
90
90
|
* Optional: if set to true then the generated project will support typescript
|
|
91
91
|
*/
|
|
92
92
|
enableTypeScript?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Optional: path to the template files to be used for generation
|
|
95
|
+
*/
|
|
96
|
+
templatePathOverwrite?: string;
|
|
93
97
|
};
|
|
94
98
|
}
|
|
95
99
|
/**
|
package/dist/writer/index.js
CHANGED
|
@@ -57,8 +57,9 @@ async function generate(basePath, config, fs) {
|
|
|
57
57
|
fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
58
58
|
}
|
|
59
59
|
const fullConfig = setDefaults(config);
|
|
60
|
+
const templatePath = config.options?.templatePathOverwrite ?? baseTmplPath;
|
|
60
61
|
(0, i18n_1.writeI18nModels)(basePath, fullConfig.app.i18nModels, fs);
|
|
61
|
-
(0, project_utils_1.writeTemplateToFolder)(
|
|
62
|
+
(0, project_utils_1.writeTemplateToFolder)(templatePath, (0, path_1.join)(basePath), fullConfig, fs);
|
|
62
63
|
await (0, project_utils_1.writeUI5DeployYaml)(basePath, fullConfig, fs);
|
|
63
64
|
await (0, project_utils_1.writeUI5Yaml)(basePath, fullConfig, fs);
|
|
64
65
|
return fs;
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aadp-tooling"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.15.
|
|
12
|
+
"version": "0.15.19",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|