@ui5/task-adaptation 1.6.7 → 1.7.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/.github/workflows/codeql.yml +35 -0
- package/.github/workflows/release-please.yml +53 -0
- package/.release-please-manifest.json +3 -0
- package/CHANGELOG.md +42 -36
- package/dist/adapters/abapAdapter.d.ts +3 -3
- package/dist/adapters/abapAdapter.js +19 -8
- package/dist/adapters/adapter.d.ts +3 -2
- package/dist/adapters/adapter.js +9 -3
- package/dist/adapters/cfAdapter.d.ts +2 -2
- package/dist/adapters/cfAdapter.js +12 -12
- package/dist/adapters/commands/command.js +0 -27
- package/dist/adapters/commands/downloadAnnotationsCommand.d.ts +3 -4
- package/dist/adapters/commands/downloadAnnotationsCommand.js +4 -4
- package/dist/adapters/commands/fetchPreviewResourcesCommand.js +1 -1
- package/dist/adapters/commands/omitDeletedResourcesCommand.d.ts +1 -1
- package/dist/adapters/commands/renameFilesCommand.d.ts +0 -22
- package/dist/adapters/commands/renameFilesCommand.js +2 -114
- package/dist/adapters/commands/renameManifestCommand.js +2 -2
- package/dist/adapters/previewAdapter.d.ts +2 -2
- package/dist/adapters/previewAdapter.js +4 -4
- package/dist/annotations/abapAnnotationManager.js +1 -3
- package/dist/annotations/dataSource/dataSource.d.ts +6 -5
- package/dist/annotations/dataSource/dataSource.js +36 -12
- package/dist/annotations/dataSource/dataSourceManager.d.ts +2 -2
- package/dist/annotations/dataSource/dataSourceManager.js +2 -2
- package/dist/annotations/dataSource/dataSourceOData.d.ts +2 -2
- package/dist/annotations/transformers/transformer.d.ts +2 -2
- package/dist/annotations/transformers/traverseReferences.d.ts +1 -1
- package/dist/annotations/transformers/traverseReferences.js +2 -2
- package/dist/appVariant.d.ts +5 -7
- package/dist/appVariant.js +9 -23
- package/dist/baseApp.d.ts +1 -0
- package/dist/baseApp.js +10 -0
- package/dist/bundle.js +86 -53
- package/dist/cache/cacheHolder.d.ts +6 -12
- package/dist/cache/cacheHolder.js +27 -39
- package/dist/cache/cachedResource.d.ts +2 -1
- package/dist/index.d.ts +6 -7
- package/dist/index.js +49 -42
- package/dist/landscapeConfiguration.d.ts +4 -4
- package/dist/landscapeConfiguration.js +48 -44
- package/dist/model/configuration.d.ts +0 -1
- package/dist/model/types.d.ts +1 -3
- package/dist/repositories/abapRepository.d.ts +1 -1
- package/dist/repositories/abapRepository.js +3 -3
- package/dist/repositories/cacheRepository.d.ts +4 -5
- package/dist/repositories/cacheRepository.js +10 -18
- package/dist/repositories/html5Repository.d.ts +1 -1
- package/dist/repositories/html5Repository.js +2 -2
- package/dist/repositories/localRepository.d.ts +1 -1
- package/dist/repositories/localRepository.js +2 -2
- package/dist/repositories/repository.d.ts +1 -1
- package/dist/util/cfUtil.d.ts +6 -24
- package/dist/util/cfUtil.js +36 -93
- package/dist/util/commonUtil.d.ts +1 -9
- package/dist/util/commonUtil.js +27 -29
- package/dist/util/fsUtil.js +1 -2
- package/dist/util/movingHandler/changeFileMoveHandler.d.ts +1 -0
- package/dist/util/movingHandler/changeFileMoveHandler.js +11 -3
- package/dist/util/referencesBuilder.d.ts +15 -0
- package/dist/util/referencesBuilder.js +35 -0
- package/dist/util/renaming/fileRenamer.d.ts +23 -0
- package/dist/util/renaming/fileRenamer.js +120 -0
- package/dist/util/{renamingHandlers → renaming/handlers}/jsonRenamingHandler.d.ts +0 -2
- package/dist/util/{renamingHandlers → renaming/handlers}/jsonRenamingHandler.js +0 -6
- package/dist/util/{renamingUtil.d.ts → renaming/referenceRenaming.d.ts} +4 -4
- package/dist/util/{renamingUtil.js → renaming/referenceRenaming.js} +8 -8
- package/dist/util/resourceUtil.js +6 -2
- package/package.json +11 -4
- package/release-please-config.json +66 -0
- package/dist/annotations/serviceRequestor.d.ts +0 -9
- package/dist/annotations/serviceRequestor.js +0 -62
- /package/dist/util/{renamingHandlers → renaming/handlers}/manifestRenamingHandler.d.ts +0 -0
- /package/dist/util/{renamingHandlers → renaming/handlers}/manifestRenamingHandler.js +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: CodeQL
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ "main", "rc" ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ "main", "rc" ]
|
|
8
|
+
schedule:
|
|
9
|
+
- cron: '0 6 * * 1'
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
analyze:
|
|
13
|
+
name: Analyze (javascript-typescript)
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
permissions:
|
|
16
|
+
security-events: write
|
|
17
|
+
packages: read
|
|
18
|
+
actions: read
|
|
19
|
+
contents: read
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- name: Initialize CodeQL
|
|
25
|
+
uses: github/codeql-action/init@v3
|
|
26
|
+
with:
|
|
27
|
+
languages: javascript-typescript
|
|
28
|
+
|
|
29
|
+
- name: Autobuild
|
|
30
|
+
uses: github/codeql-action/autobuild@v3
|
|
31
|
+
|
|
32
|
+
- name: Perform CodeQL Analysis
|
|
33
|
+
uses: github/codeql-action/analyze@v3
|
|
34
|
+
with:
|
|
35
|
+
category: "/language:javascript-typescript"
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
name: release-please
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- rc
|
|
8
|
+
|
|
9
|
+
permissions: {}
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
pull-request:
|
|
13
|
+
runs-on: ubuntu-24.04
|
|
14
|
+
permissions:
|
|
15
|
+
contents: write
|
|
16
|
+
pull-requests: write
|
|
17
|
+
outputs:
|
|
18
|
+
releases_created: ${{steps.release.outputs.releases_created}}
|
|
19
|
+
paths_released: ${{steps.release.outputs.paths_released}}
|
|
20
|
+
steps:
|
|
21
|
+
- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
|
|
22
|
+
id: release
|
|
23
|
+
with:
|
|
24
|
+
token: ${{secrets.GITHUB_TOKEN}}
|
|
25
|
+
target-branch: ${{github.ref_name}}
|
|
26
|
+
|
|
27
|
+
publish-package:
|
|
28
|
+
needs: pull-request
|
|
29
|
+
if: ${{needs.pull-request.outputs.releases_created && toJson(fromJson(needs.pull-request.outputs.paths_released)) != '[]'}}
|
|
30
|
+
runs-on: ubuntu-24.04
|
|
31
|
+
permissions:
|
|
32
|
+
id-token: write
|
|
33
|
+
environment: npmjs:@ui5/task-adaptation
|
|
34
|
+
steps:
|
|
35
|
+
- name: Checkout
|
|
36
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
37
|
+
- name: Node.js LTS
|
|
38
|
+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
39
|
+
with:
|
|
40
|
+
node-version: 24.x
|
|
41
|
+
- name: Install dependencies
|
|
42
|
+
run: npm ci
|
|
43
|
+
- name: Build
|
|
44
|
+
run: npm run build
|
|
45
|
+
- name: Publish to npm
|
|
46
|
+
env:
|
|
47
|
+
REF: ${{github.ref_name}}
|
|
48
|
+
run: |
|
|
49
|
+
if [ "$REF" = "rc" ]; then
|
|
50
|
+
npm publish --access public --tag next --ignore-scripts
|
|
51
|
+
else
|
|
52
|
+
npm publish --access public --tag latest --ignore-scripts
|
|
53
|
+
fi
|
package/CHANGELOG.md
CHANGED
|
@@ -2,55 +2,68 @@
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
4
4
|
|
|
5
|
-
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-task-adaptation/compare/v1.6.
|
|
6
|
-
|
|
7
|
-
<a name="v1.6.7"></a>
|
|
8
|
-
## [v1.6.7] - 2026-07-28
|
|
5
|
+
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-task-adaptation/compare/v1.6.0...HEAD).
|
|
9
6
|
|
|
10
7
|
<a name="v1.6.6"></a>
|
|
8
|
+
## [1.7.0](https://github.com/SAP/ui5-task-adaptation/compare/v1.6.8...v1.7.0) (2026-10-27)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* Release 1.6.4 ([92ba1f1](https://github.com/SAP/ui5-task-adaptation/commit/92ba1f1adbab2232adcfdc4496f4062ba1f1abc4))
|
|
14
|
+
* Release 1.6.4 ([9467875](https://github.com/SAP/ui5-task-adaptation/commit/94678752561cce607d5e1905f09b4ce78c70844f))
|
|
15
|
+
* Release 1.6.4 ([35f89c8](https://github.com/SAP/ui5-task-adaptation/commit/35f89c838bffb30a1a56ba04ebddeb3ae6c33313))
|
|
16
|
+
* Release 1.6.4 ([1d5d116](https://github.com/SAP/ui5-task-adaptation/commit/1d5d11638cb11a46c39a101cd8425188711fc3de))
|
|
17
|
+
* Release 1.6.4 ([cd28034](https://github.com/SAP/ui5-task-adaptation/commit/cd280341f07d4906aadae9866b980ee67c59b1b1))
|
|
18
|
+
* Release 1.6.4 ([bb12193](https://github.com/SAP/ui5-task-adaptation/commit/bb1219321c96e584eea946a02b53e2af2e28552e))
|
|
19
|
+
* Release 1.6.4 ([c553ea1](https://github.com/SAP/ui5-task-adaptation/commit/c553ea129400e1157c68d5046543e26a35c3649f))
|
|
20
|
+
* Release 1.6.4 ([7549253](https://github.com/SAP/ui5-task-adaptation/commit/75492531c86e0bd1408c23f711249a08c23acf39))
|
|
21
|
+
* Release 1.6.4 ([36c9b3f](https://github.com/SAP/ui5-task-adaptation/commit/36c9b3f664d597ea2f5936f05e8c5c7313f3be2d))
|
|
22
|
+
* Release 1.6.4 ([bc5998d](https://github.com/SAP/ui5-task-adaptation/commit/bc5998d8cec7f257ba4f17e2cc6532469d4785be))
|
|
23
|
+
|
|
11
24
|
## [v1.6.6] - 2026-06-30
|
|
25
|
+
### Fixed
|
|
26
|
+
- CF: await `XsAppJsonEnhanceRoutesCommand` in `ProcessPreviewResourcesCommand` so the reuse-library `xs-app.json` is written with `endpoint`/`service` rewritten from `destination` (previously the enhance ran fire-and-forget and could race against `ResourceUtil.writeInProject`)
|
|
12
27
|
|
|
13
28
|
<a name="v1.6.5"></a>
|
|
14
29
|
## [v1.6.5] - 2026-06-24
|
|
15
|
-
###
|
|
16
|
-
-
|
|
17
|
-
|
|
30
|
+
### Added
|
|
31
|
+
- Use environemnt variables `ADP_BUILDER_MODE=local` and `ADP_BUILDER_DIR=<path-to-base-app-files>` to build the Adaptation Project from local base app files offline - without accessing the remote repositories.
|
|
18
32
|
|
|
19
33
|
<a name="v1.6.4"></a>
|
|
20
34
|
## [v1.6.4] - 2026-04-10
|
|
35
|
+
### Fixed
|
|
36
|
+
- CF: merged xs-app.json is written to .adp/reuse even if no reuse libraries specified for the app
|
|
37
|
+
- Change files are ascending sorted by `creation` timestamp before applying to manifest.json
|
|
38
|
+
- Rollup override for the `appdescr_app_addNewDataSource` descriptor change merger, adding comprehensive validation logic when adding new data sources to the `sap.app.dataSources` section of a manifest
|
|
21
39
|
|
|
22
40
|
<a name="v1.6.3"></a>
|
|
23
41
|
## [v1.6.3] - 2026-03-18
|
|
42
|
+
### Added
|
|
43
|
+
- CF: Enhance xs-app.json with endpoints also for reuse libraries for the preview
|
|
24
44
|
|
|
25
45
|
<a name="v1.6.2"></a>
|
|
26
46
|
## [v1.6.2] - 2026-03-16
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
## [v1.6.1] - 2026-02-26
|
|
47
|
+
### Added
|
|
48
|
+
- CF: Enhance xs-app.json with endpoints from service instance
|
|
30
49
|
|
|
31
50
|
<a name="v1.6.0"></a>
|
|
32
|
-
## [v1.6.0] - 2026-02-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
## [v0.1.0] - 2026-02-20
|
|
51
|
+
## [v1.6.0] - 2026-02-20
|
|
52
|
+
### Added
|
|
53
|
+
- CF: Reuse library content is downloaded for the Adaptation Visual Editor preview.
|
|
54
|
+
- CF: Merging xs-app.json files of the base application with xs-app.json of the Adaptation Project.
|
|
55
|
+
### Fixed
|
|
56
|
+
- Enhanced log coverage.
|
|
39
57
|
|
|
40
58
|
<a name="v1.5.4"></a>
|
|
41
59
|
## [v1.5.4] - 2026-02-16
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
## [v1.5.3] - 2025-09-29
|
|
45
|
-
|
|
46
|
-
<a name="v1.5.2"></a>
|
|
47
|
-
## [v1.5.2] - 2025-08-25
|
|
48
|
-
### Bug Fixes
|
|
49
|
-
- Removed moved changes [`babdc1b`](https://github.com/SAP/ui5-task-adaptation/commit/babdc1bce8e407b2638e014cfaa4e6547bba10ac)
|
|
50
|
-
|
|
60
|
+
### Fixed
|
|
61
|
+
- Should not rename sap.ui5/dependencies/libs and sap.ui5/dependencies/components ids if they contain base application id
|
|
51
62
|
|
|
52
63
|
<a name="v1.5.1"></a>
|
|
53
64
|
## [v1.5.1] - 2025-08-06
|
|
65
|
+
### Bug Fixes
|
|
66
|
+
- Correct handling of manifest changes
|
|
54
67
|
|
|
55
68
|
<a name="v1.4.3"></a>
|
|
56
69
|
## [v1.4.3] - 2025-04-17
|
|
@@ -164,20 +177,13 @@ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-task
|
|
|
164
177
|
<a name="v1.0.0"></a>
|
|
165
178
|
## v1.0.0 - 2020-12-09
|
|
166
179
|
|
|
167
|
-
[v1.6.7]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.6...v1.6.7
|
|
168
180
|
[v1.6.6]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.5...v1.6.6
|
|
169
181
|
[v1.6.5]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.4...v1.6.5
|
|
170
182
|
[v1.6.4]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.3...v1.6.4
|
|
171
183
|
[v1.6.3]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.2...v1.6.3
|
|
172
|
-
[v1.6.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.
|
|
173
|
-
[v1.6.
|
|
174
|
-
[v1.
|
|
175
|
-
[v0.2.0]: https://github.com/SAP/ui5-task-adaptation/compare/v0.1.0...v0.2.0
|
|
176
|
-
[v0.1.0]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.4...v0.1.0
|
|
177
|
-
[v1.5.4]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.3...v1.5.4
|
|
178
|
-
[v1.5.3]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.2...v1.5.3
|
|
179
|
-
[v1.5.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.1...v1.5.2
|
|
180
|
-
[v1.5.1]: https://github.com/SAP/ui5-task-adaptation/compare/v1.4.3...v1.5.1
|
|
184
|
+
[v1.6.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.0...v1.6.2
|
|
185
|
+
[v1.6.0]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.4...v1.6.0
|
|
186
|
+
[v1.5.4]: https://github.com/SAP/ui5-task-adaptation/compare/v1.4.3...v1.5.4
|
|
181
187
|
[v1.4.3]: https://github.com/SAP/ui5-task-adaptation/compare/v1.4.2...v1.4.3
|
|
182
188
|
[v1.4.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.4.0...v1.4.2
|
|
183
189
|
[v1.4.0]: https://github.com/SAP/ui5-task-adaptation/compare/v1.3.3...v1.4.0
|
|
@@ -2,14 +2,14 @@ import { IAdapter } from "./adapter.js";
|
|
|
2
2
|
import { AdaptCommandChain, ManifestUpdateCommandChain, PostCommandChain, SetupCommandChain } from "./commands/command.js";
|
|
3
3
|
import BaseApp from "../baseApp.js";
|
|
4
4
|
import AppVariant from "../appVariant.js";
|
|
5
|
-
import IAnnotationManager from "../annotations/annotationManager.js";
|
|
6
5
|
import { UI5BuilderTools } from "../model/types.js";
|
|
7
6
|
import IRepository from "../repositories/repository.js";
|
|
7
|
+
import IAnnotationManager from "../annotations/annotationManager.js";
|
|
8
8
|
export default class AbapAdapter implements IAdapter {
|
|
9
9
|
private annotationManager;
|
|
10
10
|
constructor(annotationManager: IAnnotationManager);
|
|
11
11
|
createSetupCommandChain(_appId: string, _repository: IRepository): SetupCommandChain;
|
|
12
|
-
createAdaptCommandChain(
|
|
12
|
+
createAdaptCommandChain(files: ReadonlyMap<string, Buffer>, appVariant: AppVariant): AdaptCommandChain;
|
|
13
13
|
createPostCommandChain(references: Map<string, string>, adaptationProject: AppVariant, ui5BuilderTools: UI5BuilderTools): PostCommandChain;
|
|
14
|
-
createManifestPreviewCommandChain(
|
|
14
|
+
createManifestPreviewCommandChain(baseApp: BaseApp, appVariant: AppVariant, references: Map<string, string>): ManifestUpdateCommandChain;
|
|
15
15
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { getCommonManifestUpdateCommands, getCommonPostCommands } from "./adapter.js";
|
|
2
2
|
import { AdaptCommandChain, ManifestUpdateCommandChain, PostCommandChain, SetupCommandChain } from "./commands/command.js";
|
|
3
|
+
import BaseApp from "../baseApp.js";
|
|
3
4
|
import DownloadAnnotationsCommand from "./commands/downloadAnnotationsCommand.js";
|
|
4
5
|
import I18nPropertiesMergeCommand from "./commands/i18nPropertiesMergeCommand.js";
|
|
6
|
+
import RenameManifestCommand from "./commands/renameManifestCommand.js";
|
|
5
7
|
export default class AbapAdapter {
|
|
6
8
|
annotationManager;
|
|
7
9
|
constructor(annotationManager) {
|
|
@@ -10,7 +12,8 @@ export default class AbapAdapter {
|
|
|
10
12
|
createSetupCommandChain(_appId, _repository) {
|
|
11
13
|
return new SetupCommandChain([]);
|
|
12
14
|
}
|
|
13
|
-
createAdaptCommandChain(
|
|
15
|
+
createAdaptCommandChain(files, appVariant) {
|
|
16
|
+
const baseApp = BaseApp.fromFiles(files);
|
|
14
17
|
const appVariantIdHierarchyItem = {
|
|
15
18
|
appVariantId: baseApp.id,
|
|
16
19
|
version: baseApp.version,
|
|
@@ -18,18 +21,26 @@ export default class AbapAdapter {
|
|
|
18
21
|
};
|
|
19
22
|
const manifestChanges = appVariant.getProcessedManifestChanges();
|
|
20
23
|
return new AdaptCommandChain(baseApp.files, appVariant.getProcessedFiles(), [
|
|
21
|
-
new ManifestUpdateCommandChain(
|
|
22
|
-
...getCommonManifestUpdateCommands(baseApp, appVariant, appVariantIdHierarchyItem),
|
|
23
|
-
]),
|
|
24
|
-
new DownloadAnnotationsCommand(appVariant.id, appVariant.prefix, this.annotationManager),
|
|
24
|
+
new ManifestUpdateCommandChain(getCommonManifestUpdateCommands(baseApp, appVariant, appVariantIdHierarchyItem)),
|
|
25
25
|
new I18nPropertiesMergeCommand(baseApp.i18nPath, appVariant.prefix, manifestChanges),
|
|
26
26
|
]);
|
|
27
27
|
}
|
|
28
28
|
createPostCommandChain(references, adaptationProject, ui5BuilderTools) {
|
|
29
|
-
return new PostCommandChain(
|
|
29
|
+
return new PostCommandChain([
|
|
30
|
+
new DownloadAnnotationsCommand(adaptationProject.id, adaptationProject.prefix, this.annotationManager),
|
|
31
|
+
...getCommonPostCommands(references, adaptationProject, ui5BuilderTools)
|
|
32
|
+
]);
|
|
30
33
|
}
|
|
31
|
-
createManifestPreviewCommandChain(
|
|
32
|
-
|
|
34
|
+
createManifestPreviewCommandChain(baseApp, appVariant, references) {
|
|
35
|
+
const appVariantIdHierarchyItem = {
|
|
36
|
+
appVariantId: baseApp.id,
|
|
37
|
+
version: baseApp.version,
|
|
38
|
+
layer: "VENDOR"
|
|
39
|
+
};
|
|
40
|
+
return new ManifestUpdateCommandChain([
|
|
41
|
+
...getCommonManifestUpdateCommands(baseApp, appVariant, appVariantIdHierarchyItem),
|
|
42
|
+
new RenameManifestCommand(references),
|
|
43
|
+
]);
|
|
33
44
|
}
|
|
34
45
|
}
|
|
35
46
|
//# sourceMappingURL=abapAdapter.js.map
|
|
@@ -6,10 +6,11 @@ import IRepository from "../repositories/repository.js";
|
|
|
6
6
|
import { AdaptCommandChain, IPromiseCommand, ManifestUpdateCommand, ManifestUpdateCommandChain, PostCommand, PostCommandChain, SetupCommandChain } from "./commands/command.js";
|
|
7
7
|
export interface IAdapter {
|
|
8
8
|
createSetupCommandChain(appId: string, repository: IRepository): SetupCommandChain;
|
|
9
|
-
createAdaptCommandChain(
|
|
9
|
+
createAdaptCommandChain(files: ReadonlyMap<string, Buffer>, appVariant: AppVariant): AdaptCommandChain;
|
|
10
10
|
createPostCommandChain(references: Map<string, string>, adaptationProject: AppVariant, ui5BuilderTools: UI5BuilderTools): PostCommandChain;
|
|
11
|
-
createManifestPreviewCommandChain(baseApp: BaseApp, appVariant: AppVariant): ManifestUpdateCommandChain;
|
|
11
|
+
createManifestPreviewCommandChain(baseApp: BaseApp, appVariant: AppVariant, references: Map<string, string>): ManifestUpdateCommandChain;
|
|
12
12
|
}
|
|
13
13
|
export declare function getCommonManifestUpdateCommands(baseApp: BaseApp, appVariant: AppVariant, appVariantIdHierarchyItem: IAppVariantIdHierarchyManifestItem): ManifestUpdateCommand[];
|
|
14
|
+
export declare function getCommonPostBaseAdaptCommands(references: Map<string, string>): PostCommand[];
|
|
14
15
|
export declare function getCommonPostCommands(references: Map<string, string>, adaptationProject: AppVariant, ui5BuilderTools: UI5BuilderTools): PostCommand[];
|
|
15
16
|
export declare function dependsOn<T>(promise: IPromiseCommand<T> | null): Promise<T>;
|
package/dist/adapters/adapter.js
CHANGED
|
@@ -17,12 +17,18 @@ export function getCommonManifestUpdateCommands(baseApp, appVariant, appVariantI
|
|
|
17
17
|
new UpdateCloudDevAdaptationCommand(),
|
|
18
18
|
];
|
|
19
19
|
}
|
|
20
|
-
export function
|
|
21
|
-
const { movedFiles, resources } = adaptationProject;
|
|
22
|
-
const { workspace, taskUtil, projectNamespace } = ui5BuilderTools;
|
|
20
|
+
export function getCommonPostBaseAdaptCommands(references) {
|
|
23
21
|
return [
|
|
24
22
|
new FilterFilesCommand(),
|
|
25
23
|
new RenameFilesCommand(references),
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
export function getCommonPostCommands(references, adaptationProject, ui5BuilderTools) {
|
|
27
|
+
const { resources } = adaptationProject;
|
|
28
|
+
const movedFiles = adaptationProject.getMovedFiles();
|
|
29
|
+
const { workspace, taskUtil, projectNamespace } = ui5BuilderTools;
|
|
30
|
+
return [
|
|
31
|
+
...getCommonPostBaseAdaptCommands(references),
|
|
26
32
|
new OmitDeletedResourcesCommand(taskUtil, movedFiles, resources, projectNamespace),
|
|
27
33
|
new WriteResourcesCommand(workspace, projectNamespace),
|
|
28
34
|
];
|
|
@@ -10,7 +10,7 @@ export default class CFAdapter implements IAdapter {
|
|
|
10
10
|
private fetchEndpointsCommand;
|
|
11
11
|
constructor(configuration: IConfiguration);
|
|
12
12
|
createSetupCommandChain(_appId: string, _repository: IRepository): SetupCommandChain;
|
|
13
|
-
createAdaptCommandChain(
|
|
13
|
+
createAdaptCommandChain(files: ReadonlyMap<string, Buffer>, appVariant: AppVariant): AdaptCommandChain;
|
|
14
|
+
createManifestPreviewCommandChain(baseApp: BaseApp, appVariant: AppVariant, references: Map<string, string>): ManifestUpdateCommandChain;
|
|
14
15
|
createPostCommandChain(references: Map<string, string>, adaptationProject: AppVariant, ui5BuilderTools: UI5BuilderTools): PostCommandChain;
|
|
15
|
-
createManifestPreviewCommandChain(baseApp: BaseApp, appVariant: AppVariant): ManifestUpdateCommandChain;
|
|
16
16
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { dependsOn, getCommonManifestUpdateCommands, getCommonPostCommands } from "./adapter.js";
|
|
2
2
|
import { AdaptCommandChain, ManifestUpdateCommandChain, PostCommandChain, SetupCommandChain } from "./commands/command.js";
|
|
3
|
-
import { getReferences } from "../util/commonUtil.js";
|
|
4
3
|
import XsAppJsonEnhanceRoutesCommand from "./commands/xsAppJsonEnhanceRoutesCommand.js";
|
|
4
|
+
import BaseApp from "../baseApp.js";
|
|
5
5
|
import UpdateCloudPlatformCommand from "./commands/updateCloudPlatformCommand.js";
|
|
6
|
-
import RenameManifestCommand from "./commands/renameManifestCommand.js";
|
|
7
6
|
import I18nPropertiesMergeCommand from "./commands/i18nPropertiesMergeCommand.js";
|
|
8
7
|
import XsAppJsonMergeCommand from "./commands/xsAppJsonMergeCommand.js";
|
|
9
8
|
import FetchEndpointsCommand from "./commands/fetchEndpointsCommand.js";
|
|
9
|
+
import RenameManifestCommand from "./commands/renameManifestCommand.js";
|
|
10
10
|
export default class CFAdapter {
|
|
11
11
|
configuration;
|
|
12
12
|
fetchEndpointsCommand = null;
|
|
@@ -19,7 +19,8 @@ export default class CFAdapter {
|
|
|
19
19
|
this.fetchEndpointsCommand
|
|
20
20
|
]);
|
|
21
21
|
}
|
|
22
|
-
createAdaptCommandChain(
|
|
22
|
+
createAdaptCommandChain(files, appVariant) {
|
|
23
|
+
const baseApp = BaseApp.fromFiles(files);
|
|
23
24
|
const appVariantIdHierarchyItem = {
|
|
24
25
|
appVariantId: baseApp.id,
|
|
25
26
|
version: baseApp.version
|
|
@@ -34,24 +35,23 @@ export default class CFAdapter {
|
|
|
34
35
|
new XsAppJsonMergeCommand(),
|
|
35
36
|
]);
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
-
const serviceCredentialsPromise = dependsOn(this.fetchEndpointsCommand);
|
|
39
|
-
return new PostCommandChain([
|
|
40
|
-
new XsAppJsonEnhanceRoutesCommand(serviceCredentialsPromise),
|
|
41
|
-
...getCommonPostCommands(references, adaptationProject, ui5BuilderTools)
|
|
42
|
-
]);
|
|
43
|
-
}
|
|
44
|
-
createManifestPreviewCommandChain(baseApp, appVariant) {
|
|
38
|
+
createManifestPreviewCommandChain(baseApp, appVariant, references) {
|
|
45
39
|
const appVariantIdHierarchyItem = {
|
|
46
40
|
appVariantId: baseApp.id,
|
|
47
41
|
version: baseApp.version
|
|
48
42
|
};
|
|
49
|
-
const references = getReferences([appVariant], appVariant.id);
|
|
50
43
|
return new ManifestUpdateCommandChain([
|
|
51
44
|
...getCommonManifestUpdateCommands(baseApp, appVariant, appVariantIdHierarchyItem),
|
|
52
45
|
new UpdateCloudPlatformCommand(this.configuration.sapCloudService),
|
|
53
46
|
new RenameManifestCommand(references),
|
|
54
47
|
]);
|
|
55
48
|
}
|
|
49
|
+
createPostCommandChain(references, adaptationProject, ui5BuilderTools) {
|
|
50
|
+
const serviceCredentialsPromise = dependsOn(this.fetchEndpointsCommand);
|
|
51
|
+
return new PostCommandChain([
|
|
52
|
+
new XsAppJsonEnhanceRoutesCommand(serviceCredentialsPromise),
|
|
53
|
+
...getCommonPostCommands(references, adaptationProject, ui5BuilderTools)
|
|
54
|
+
]);
|
|
55
|
+
}
|
|
56
56
|
}
|
|
57
57
|
//# sourceMappingURL=cfAdapter.js.map
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { stringToBuffer, bufferToJson } from "../../util/commonUtil.js";
|
|
2
|
-
import { getLogger } from "@ui5/logger";
|
|
3
|
-
const log = getLogger("@ui5/task-adaptation::CommandChain");
|
|
4
2
|
export class SetupCommand {
|
|
5
3
|
commandType = "setup";
|
|
6
4
|
}
|
|
@@ -13,13 +11,9 @@ export class SetupCommandChain {
|
|
|
13
11
|
* Executes all commands in the chain
|
|
14
12
|
*/
|
|
15
13
|
async execute() {
|
|
16
|
-
const timings = [];
|
|
17
14
|
for (const command of this.commands) {
|
|
18
|
-
const start = performance.now();
|
|
19
15
|
await command.execute();
|
|
20
|
-
pushTiming(command, timings, start);
|
|
21
16
|
}
|
|
22
|
-
logTimings(this, timings);
|
|
23
17
|
}
|
|
24
18
|
}
|
|
25
19
|
export class AdaptCommand {
|
|
@@ -44,14 +38,10 @@ export class ManifestUpdateCommandChain extends AdaptCommand {
|
|
|
44
38
|
throw new Error("Original application should have manifest.json in root folder");
|
|
45
39
|
}
|
|
46
40
|
const manifest = bufferToJson(manifestContent);
|
|
47
|
-
const timings = [];
|
|
48
41
|
for (const command of this.commands) {
|
|
49
|
-
const start = performance.now();
|
|
50
42
|
await command.execute(manifest);
|
|
51
|
-
pushTiming(command, timings, start);
|
|
52
43
|
}
|
|
53
44
|
files.set(filename, stringToBuffer(JSON.stringify(manifest)));
|
|
54
|
-
logTimings(this, timings);
|
|
55
45
|
}
|
|
56
46
|
}
|
|
57
47
|
export class PostCommand {
|
|
@@ -72,13 +62,9 @@ export class PostCommandChain {
|
|
|
72
62
|
*/
|
|
73
63
|
async execute(files) {
|
|
74
64
|
const filesCopy = new Map(files);
|
|
75
|
-
const timings = [];
|
|
76
65
|
for (const command of this.commands) {
|
|
77
|
-
const start = performance.now();
|
|
78
66
|
await command.execute(filesCopy);
|
|
79
|
-
pushTiming(command, timings, start);
|
|
80
67
|
}
|
|
81
|
-
logTimings(this, timings);
|
|
82
68
|
return filesCopy;
|
|
83
69
|
}
|
|
84
70
|
}
|
|
@@ -95,24 +81,19 @@ export class AdaptCommandChain {
|
|
|
95
81
|
}
|
|
96
82
|
async execute() {
|
|
97
83
|
const filesCopy = new Map(this.files);
|
|
98
|
-
const timings = [];
|
|
99
84
|
for (const command of this.adaptCommands) {
|
|
100
|
-
const start = performance.now();
|
|
101
85
|
for (const [filename] of filesCopy) {
|
|
102
86
|
if (command.accept(filename)) {
|
|
103
87
|
await command.execute(filesCopy, filename);
|
|
104
88
|
}
|
|
105
89
|
}
|
|
106
|
-
pushTiming(command, timings, start);
|
|
107
90
|
}
|
|
108
91
|
for (const command of this.mergeCommands) {
|
|
109
|
-
const start = performance.now();
|
|
110
92
|
for (const [filename, appVariantContent] of this.appVariantFiles) {
|
|
111
93
|
if (command.accept(filename)) {
|
|
112
94
|
await command.execute(filesCopy, filename, appVariantContent);
|
|
113
95
|
}
|
|
114
96
|
}
|
|
115
|
-
pushTiming(command, timings, start);
|
|
116
97
|
}
|
|
117
98
|
for (const [filename, appVariantContent] of this.appVariantFiles) {
|
|
118
99
|
const accepted = this.mergeCommands.some(command => command.accept(filename));
|
|
@@ -120,15 +101,7 @@ export class AdaptCommandChain {
|
|
|
120
101
|
filesCopy.set(filename, appVariantContent);
|
|
121
102
|
}
|
|
122
103
|
}
|
|
123
|
-
logTimings(this, timings);
|
|
124
104
|
return filesCopy;
|
|
125
105
|
}
|
|
126
106
|
}
|
|
127
|
-
function logTimings(chain, timings) {
|
|
128
|
-
log.info(`${chain.constructor.name}:`);
|
|
129
|
-
timings.forEach(({ name, duration }) => log.info(` ${name}: ${duration.toFixed(2)}ms`));
|
|
130
|
-
}
|
|
131
|
-
function pushTiming(command, timings, start) {
|
|
132
|
-
timings.push({ name: command.constructor.name, duration: performance.now() - start });
|
|
133
|
-
}
|
|
134
107
|
//# sourceMappingURL=command.js.map
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PostCommand } from "./command.js";
|
|
2
2
|
import IAnnotationManager from "../../annotations/annotationManager.js";
|
|
3
|
-
export default class DownloadAnnotationsCommand extends
|
|
3
|
+
export default class DownloadAnnotationsCommand extends PostCommand {
|
|
4
4
|
private appVariantId;
|
|
5
5
|
private prefix;
|
|
6
6
|
private annotationManager;
|
|
7
7
|
constructor(appVariantId: string, prefix: string, annotationManager: IAnnotationManager);
|
|
8
|
-
|
|
9
|
-
execute(files: Map<string, Buffer>, filename: string): Promise<void>;
|
|
8
|
+
execute(files: Map<string, Buffer>): Promise<void>;
|
|
10
9
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PostCommand } from "./command.js";
|
|
2
2
|
import { stringToBuffer, bufferToJson } from "../../util/commonUtil.js";
|
|
3
|
-
export default class DownloadAnnotationsCommand extends
|
|
3
|
+
export default class DownloadAnnotationsCommand extends PostCommand {
|
|
4
4
|
appVariantId;
|
|
5
5
|
prefix;
|
|
6
6
|
annotationManager;
|
|
@@ -10,8 +10,8 @@ export default class DownloadAnnotationsCommand extends AdaptCommand {
|
|
|
10
10
|
this.prefix = prefix;
|
|
11
11
|
this.annotationManager = annotationManager;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
async execute(files) {
|
|
14
|
+
const filename = "manifest.json";
|
|
15
15
|
const baseAppManifest = bufferToJson(files.get(filename));
|
|
16
16
|
let newFiles = await this.annotationManager.process(baseAppManifest, this.appVariantId, this.prefix);
|
|
17
17
|
if (newFiles) {
|
|
@@ -62,7 +62,7 @@ export default class FetchPreviewResourcesCommand extends SetupCommand {
|
|
|
62
62
|
appName: lib.html5AppName,
|
|
63
63
|
appVersion: lib.html5AppVersion,
|
|
64
64
|
appHostId: lib.html5AppHostId,
|
|
65
|
-
|
|
65
|
+
token: Promise.resolve(lib.html5CacheBusterToken)
|
|
66
66
|
};
|
|
67
67
|
const promise = repository
|
|
68
68
|
.fetch(resource)
|
|
@@ -5,6 +5,6 @@ export default class OmitDeletedResourcesCommand extends PostCommand {
|
|
|
5
5
|
private movedFiles;
|
|
6
6
|
private resources;
|
|
7
7
|
private projectNamespace;
|
|
8
|
-
constructor(taskUtil: TaskUtil, movedFiles:
|
|
8
|
+
constructor(taskUtil: TaskUtil, movedFiles: ReadonlyMap<string, string>, resources: ReadonlyArray<Resource> | undefined, projectNamespace: string);
|
|
9
9
|
execute(files: Map<string, Buffer>): Promise<void>;
|
|
10
10
|
}
|
|
@@ -3,26 +3,4 @@ export default class RenameFilesCommand extends PostCommand {
|
|
|
3
3
|
private references;
|
|
4
4
|
constructor(references: Map<string, string>);
|
|
5
5
|
execute(files: Map<string, Buffer>): Promise<void>;
|
|
6
|
-
/**
|
|
7
|
-
* 1p. i18n.properties are not renamed and property keys are ignored during
|
|
8
|
-
* the renaming across the files.
|
|
9
|
-
* @param files - all files both base and appVariants
|
|
10
|
-
* @param references - Reference maps of the app variant
|
|
11
|
-
* @returns A map of renamed files
|
|
12
|
-
*/
|
|
13
|
-
rename(files: Map<string, Buffer>, references: Map<string, string>): void;
|
|
14
|
-
private getManifestSAPUI5DependencyIds;
|
|
15
|
-
private getI18nPropertyKeys;
|
|
16
6
|
}
|
|
17
|
-
/**
|
|
18
|
-
* We might rename appVariantIdHierarchy and dependencies, so we restore them after the renaming.
|
|
19
|
-
*
|
|
20
|
-
* The decorated method may receive either a Map of files (filename → Buffer) or
|
|
21
|
-
* a plain JSON object. Each handler is responsible for a single file (via its
|
|
22
|
-
* `accept`), operating on its parsed JSON content:
|
|
23
|
-
* - Map case: every file a handler accepts is parsed, snapshotted before the
|
|
24
|
-
* renaming, then restored and written back after.
|
|
25
|
-
* - JSON case: the object is mutated in-place (its reference is preserved) and
|
|
26
|
-
* every handler is applied to it.
|
|
27
|
-
*/
|
|
28
|
-
export declare function restoreWhatShouldntBeRenamed(): (_target: any, _propertyKey: string, descriptor: PropertyDescriptor) => void;
|