@sap-ux/repo-app-import-sub-generator 1.1.31 → 1.1.33
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/generators/app/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { t } from '../utils/i18n.js';
|
|
|
7
7
|
import { extractZip } from '../utils/download-utils.js';
|
|
8
8
|
import { EventName } from '../telemetryEvents/index.js';
|
|
9
9
|
import { getDefaultTargetFolder, generateAppGenInfo, sendTelemetry, TelemetryHelper, isCli, setYeomanEnvConflicterForce } from '@sap-ux/fiori-generator-shared';
|
|
10
|
+
import { getFloorplanLabel } from '@sap-ux/fiori-app-sub-generator';
|
|
10
11
|
import { AppDownloadType, PromptNames } from './types.js';
|
|
11
12
|
import { getPrompts } from '../prompts/prompts.js';
|
|
12
13
|
import { generate } from '@sap-ux/fiori-elements-writer';
|
|
@@ -22,7 +23,7 @@ import { generate as generateDeployConfig } from '@sap-ux/abap-deploy-config-wri
|
|
|
22
23
|
import { PromptState } from '../prompts/prompt-state.js';
|
|
23
24
|
import { getAppConfig, getAdtDeployConfig } from './app-config-quick-deploy.js';
|
|
24
25
|
import { getAbapRepoAppConfig, getAbapRepoDeployConfig, writeServiceMetadata } from './app-config-abap-repo.js';
|
|
25
|
-
import { makeValidJson,
|
|
26
|
+
import { makeValidJson, cleanupArtifacts, addPackageJsonIfNotFound } from '../utils/file-helpers.js';
|
|
26
27
|
import { replaceWebappFiles, validateAndUpdateManifestUI5Version } from '../utils/updates.js';
|
|
27
28
|
import { getYUIDetails } from '../prompts/prompt-helpers.js';
|
|
28
29
|
import { isValidPromptState, validateQfaJsonFile } from '../utils/validators.js';
|
|
@@ -127,7 +128,7 @@ export default class extends Generator {
|
|
|
127
128
|
if (serviceProvider) {
|
|
128
129
|
await writeServiceMetadata(serviceProvider, webappPath, this.fs);
|
|
129
130
|
}
|
|
130
|
-
|
|
131
|
+
cleanupArtifacts(webappPath, this.fs);
|
|
131
132
|
const appConfig = getAbapRepoAppConfig(webappPath, this.answers.selectedApp, this.fs);
|
|
132
133
|
// If package.json does not exist in the extracted app, add a minimal one with the appId as the package name.
|
|
133
134
|
addPackageJsonIfNotFound(this.projectPath, appConfig, this.fs);
|
|
@@ -201,7 +202,7 @@ export default class extends Generator {
|
|
|
201
202
|
generatorName: generatorName,
|
|
202
203
|
generatorVersion: this.rootGeneratorVersion(),
|
|
203
204
|
ui5Version: config.ui5?.version ?? '',
|
|
204
|
-
template: config.template.type,
|
|
205
|
+
template: getFloorplanLabel(config.template.type, config.service.version),
|
|
205
206
|
serviceUrl: config.service.url,
|
|
206
207
|
launchText: t('readMe.launchText')
|
|
207
208
|
};
|
|
@@ -17,17 +17,16 @@ export declare function makeValidJson(filePath: string, fs: Editor): QfaJsonConf
|
|
|
17
17
|
*/
|
|
18
18
|
export declare function readManifest(manifestFilePath: string, fs: Editor): Manifest;
|
|
19
19
|
/**
|
|
20
|
-
* Removes
|
|
20
|
+
* Removes build artefacts from the extracted project that should not be present in a local development project.
|
|
21
|
+
* Handles debug files (-dbg.js), preload bundles, source maps, and transpiled JS files for TypeScript apps.
|
|
21
22
|
* For -dbg.js files, copies the unminified content to the corresponding .js file first.
|
|
22
|
-
* These files are build artefacts that cause issues with the UI5 CLI build if left in place.
|
|
23
23
|
*
|
|
24
24
|
* @param {string} extractedProjectPath - The path where the app files are extracted.
|
|
25
25
|
* @param {Editor} fs - The file system editor.
|
|
26
26
|
*/
|
|
27
|
-
export declare function
|
|
27
|
+
export declare function cleanupArtifacts(extractedProjectPath: string, fs: Editor): void;
|
|
28
28
|
/**
|
|
29
29
|
* Writes a minimal package.json to the project path if one does not already exist.
|
|
30
|
-
* Sets `sapux: true` for all apps except freestyle templates.
|
|
31
30
|
*
|
|
32
31
|
* @param {string} projectPath - The project root path.
|
|
33
32
|
* @param {AbapRepoAppConfig} appConfig - The app configuration.
|
|
@@ -43,37 +43,49 @@ export function readManifest(manifestFilePath, fs) {
|
|
|
43
43
|
return manifest;
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
|
-
* Removes
|
|
46
|
+
* Removes build artefacts from the extracted project that should not be present in a local development project.
|
|
47
|
+
* Handles debug files (-dbg.js), preload bundles, source maps, and transpiled JS files for TypeScript apps.
|
|
47
48
|
* For -dbg.js files, copies the unminified content to the corresponding .js file first.
|
|
48
|
-
* These files are build artefacts that cause issues with the UI5 CLI build if left in place.
|
|
49
49
|
*
|
|
50
50
|
* @param {string} extractedProjectPath - The path where the app files are extracted.
|
|
51
51
|
* @param {Editor} fs - The file system editor.
|
|
52
52
|
*/
|
|
53
|
-
export function
|
|
53
|
+
export function cleanupArtifacts(extractedProjectPath, fs) {
|
|
54
54
|
const dbgSuffix = '-dbg.';
|
|
55
|
-
PromptState.admZip?.getEntries()
|
|
55
|
+
const entries = PromptState.admZip?.getEntries() ?? [];
|
|
56
|
+
const tsEntryNames = new Set(entries.filter((e) => e.entryName.endsWith('.ts') && !e.entryName.endsWith('.d.ts')).map((e) => e.entryName));
|
|
57
|
+
entries.forEach((entry) => {
|
|
56
58
|
const name = entry.entryName;
|
|
59
|
+
// Replace debug variants (e.g. component-dbg.js) with their non-debug counterpart
|
|
57
60
|
if (name.includes(dbgSuffix)) {
|
|
58
|
-
// copies contents of -dbg.js to .js file and removes the -dbg.js file
|
|
59
61
|
const extractedDebugPath = join(extractedProjectPath, name.replace(dbgSuffix, '.'));
|
|
60
62
|
const debugPath = join(extractedProjectPath, name);
|
|
61
63
|
fs.write(extractedDebugPath, entry.getData().toString('utf8'));
|
|
62
64
|
fs.delete(debugPath);
|
|
63
|
-
RepoAppDownloadLogger.logger?.debug(`
|
|
65
|
+
RepoAppDownloadLogger.logger?.debug(`cleanupArtifacts: Copied "${debugPath}" -> "${extractedDebugPath}" and removed debug file`);
|
|
66
|
+
return;
|
|
64
67
|
}
|
|
65
|
-
|
|
68
|
+
// Remove preload bundles and source maps — not needed for local development
|
|
69
|
+
if (name.endsWith('-preload.js') || name.endsWith('.js.map')) {
|
|
66
70
|
const filePath = join(extractedProjectPath, name);
|
|
67
71
|
if (fs.exists(filePath)) {
|
|
68
72
|
fs.delete(filePath);
|
|
69
|
-
RepoAppDownloadLogger.logger?.debug(`
|
|
73
|
+
RepoAppDownloadLogger.logger?.debug(`cleanupArtifacts: Removed preload/map file: "${filePath}"`);
|
|
74
|
+
}
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
// Remove transpiled .js files that have a .ts counterpart — TypeScript source takes precedence
|
|
78
|
+
if (tsEntryNames.size > 0 && name.endsWith('.js') && tsEntryNames.has(`${name.slice(0, -3)}.ts`)) {
|
|
79
|
+
const filePath = join(extractedProjectPath, name);
|
|
80
|
+
if (fs.exists(filePath)) {
|
|
81
|
+
fs.delete(filePath);
|
|
82
|
+
RepoAppDownloadLogger.logger?.debug(`cleanupArtifacts: Removed transpiled file: "${filePath}"`);
|
|
70
83
|
}
|
|
71
84
|
}
|
|
72
85
|
});
|
|
73
86
|
}
|
|
74
87
|
/**
|
|
75
88
|
* Writes a minimal package.json to the project path if one does not already exist.
|
|
76
|
-
* Sets `sapux: true` for all apps except freestyle templates.
|
|
77
89
|
*
|
|
78
90
|
* @param {string} projectPath - The project root path.
|
|
79
91
|
* @param {AbapRepoAppConfig} appConfig - The app configuration.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/repo-app-import-sub-generator",
|
|
3
3
|
"description": "Generator to download LROP Fiori applications deployed from an ABAP repository.",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.33",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -25,23 +25,24 @@
|
|
|
25
25
|
"i18next": "25.10.10",
|
|
26
26
|
"inquirer": "8.2.7",
|
|
27
27
|
"yeoman-generator": "5.10.0",
|
|
28
|
-
"@sap-ux/
|
|
29
|
-
"@sap-ux/fiori-generator-shared": "1.0.19",
|
|
30
|
-
"@sap-ux/inquirer-common": "1.0.20",
|
|
28
|
+
"@sap-ux/inquirer-common": "1.0.21",
|
|
31
29
|
"@sap-ux/project-access": "2.1.6",
|
|
32
|
-
"@sap-ux/odata-service-inquirer": "3.0.
|
|
33
|
-
"@sap-ux/
|
|
34
|
-
"@sap-ux/fiori-
|
|
35
|
-
"@sap-ux/
|
|
30
|
+
"@sap-ux/odata-service-inquirer": "3.0.23",
|
|
31
|
+
"@sap-ux/feature-toggle": "1.0.5",
|
|
32
|
+
"@sap-ux/fiori-generator-shared": "1.0.20",
|
|
33
|
+
"@sap-ux/fiori-elements-writer": "3.0.49",
|
|
34
|
+
"@sap-ux/fiori-freestyle-writer": "3.0.44",
|
|
35
|
+
"@sap-ux/fiori-app-sub-generator": "1.1.1",
|
|
36
|
+
"@sap-ux/logger": "1.0.3",
|
|
36
37
|
"@sap-ux/project-input-validator": "1.0.10",
|
|
37
|
-
"@sap-ux/
|
|
38
|
-
"@sap-ux/fiori-tools-settings": "1.0.1",
|
|
39
|
-
"@sap-ux/abap-deploy-config-writer": "1.0.13",
|
|
38
|
+
"@sap-ux/abap-deploy-config-writer": "1.0.14",
|
|
40
39
|
"@sap-ux/btp-utils": "2.0.5",
|
|
41
|
-
"@sap-ux/ui5-info": "1.0.
|
|
42
|
-
"@sap-ux/
|
|
43
|
-
"@sap-ux/
|
|
44
|
-
"@sap-ux/
|
|
40
|
+
"@sap-ux/ui5-info": "1.0.5",
|
|
41
|
+
"@sap-ux/fiori-tools-settings": "1.0.1",
|
|
42
|
+
"@sap-ux/launch-config": "1.0.12",
|
|
43
|
+
"@sap-ux/store": "2.0.4",
|
|
44
|
+
"@sap-ux/system-access": "1.0.7",
|
|
45
|
+
"@sap-ux/axios-extension": "2.0.7",
|
|
45
46
|
"@sap-ux/guided-answers-helper": "1.0.1"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
@@ -67,8 +68,8 @@
|
|
|
67
68
|
"unionfs": "4.6.0",
|
|
68
69
|
"yeoman-environment": "3.19.3",
|
|
69
70
|
"yeoman-test": "6.3.0",
|
|
70
|
-
"@sap-ux/
|
|
71
|
-
"@sap-ux/
|
|
71
|
+
"@sap-ux/store": "2.0.4",
|
|
72
|
+
"@sap-ux/nodejs-utils": "1.0.7",
|
|
72
73
|
"@sap-ux/ui5-config": "1.0.5"
|
|
73
74
|
},
|
|
74
75
|
"engines": {
|