@sap-ux/fiori-migration-writer 0.0.0-stage → 0.0.2
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/LICENSE +201 -0
- package/README.md +78 -2
- package/dist/BulkProjectMigrator.d.ts +56 -0
- package/dist/BulkProjectMigrator.js +162 -0
- package/dist/ProjectMigrator.d.ts +97 -0
- package/dist/ProjectMigrator.js +359 -0
- package/dist/adapters/index.d.ts +8 -0
- package/dist/adapters/index.js +8 -0
- package/dist/adapters/ui5-config-adapter.d.ts +62 -0
- package/dist/adapters/ui5-config-adapter.js +232 -0
- package/dist/adapters/ui5-config-helpers.d.ts +28 -0
- package/dist/adapters/ui5-config-helpers.js +85 -0
- package/dist/components/component-mapping.d.ts +14 -0
- package/dist/components/component-mapping.js +51 -0
- package/dist/components/extension.d.ts +10 -0
- package/dist/components/extension.js +61 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +4 -0
- package/dist/config/backend-i18n.d.ts +30 -0
- package/dist/config/backend-i18n.js +52 -0
- package/dist/config/backend.d.ts +24 -0
- package/dist/config/backend.js +86 -0
- package/dist/config/flp/index.d.ts +4 -0
- package/dist/config/flp/index.js +5 -0
- package/dist/config/flp/intent-defaults.d.ts +15 -0
- package/dist/config/flp/intent-defaults.js +47 -0
- package/dist/config/flp/intent.d.ts +50 -0
- package/dist/config/flp/intent.js +82 -0
- package/dist/config/flp/sandbox.d.ts +25 -0
- package/dist/config/flp/sandbox.js +106 -0
- package/dist/config/index.d.ts +10 -0
- package/dist/config/index.js +11 -0
- package/dist/config/launch-config.d.ts +16 -0
- package/dist/config/launch-config.js +60 -0
- package/dist/config/manifest-update-helpers.d.ts +10 -0
- package/dist/config/manifest-update-helpers.js +88 -0
- package/dist/config/manifest-update.d.ts +18 -0
- package/dist/config/manifest-update.js +108 -0
- package/dist/config/manifest.d.ts +10 -0
- package/dist/config/manifest.js +31 -0
- package/dist/config/neoapp.d.ts +37 -0
- package/dist/config/neoapp.js +52 -0
- package/dist/config/package-json.d.ts +12 -0
- package/dist/config/package-json.js +131 -0
- package/dist/config/ui5-yaml.d.ts +85 -0
- package/dist/config/ui5-yaml.js +110 -0
- package/dist/data/index.d.ts +4 -0
- package/dist/data/index.js +5 -0
- package/dist/data/sap-libraries.d.ts +18 -0
- package/dist/data/sap-libraries.js +52 -0
- package/dist/data/ui5-version.d.ts +10 -0
- package/dist/data/ui5-version.js +35 -0
- package/dist/data/yaml.d.ts +29 -0
- package/dist/data/yaml.js +64 -0
- package/dist/files/file-system.d.ts +8 -0
- package/dist/files/file-system.js +15 -0
- package/dist/files/index.d.ts +4 -0
- package/dist/files/index.js +5 -0
- package/dist/files/project-files.d.ts +31 -0
- package/dist/files/project-files.js +137 -0
- package/dist/files/webapp.d.ts +21 -0
- package/dist/files/webapp.js +236 -0
- package/dist/i18n/i18n.json +20 -0
- package/dist/i18n.d.ts +18 -0
- package/dist/i18n.js +33 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.js +82 -0
- package/dist/migration-process/configuration.d.ts +31 -0
- package/dist/migration-process/configuration.js +36 -0
- package/dist/migration-process/index.d.ts +6 -0
- package/dist/migration-process/index.js +7 -0
- package/dist/migration-process/legacy-helpers.d.ts +43 -0
- package/dist/migration-process/legacy-helpers.js +226 -0
- package/dist/migration-process/legacy.d.ts +17 -0
- package/dist/migration-process/legacy.js +310 -0
- package/dist/migration-process/migration-phases.d.ts +94 -0
- package/dist/migration-process/migration-phases.js +127 -0
- package/dist/migration-process/setup.d.ts +26 -0
- package/dist/migration-process/setup.js +54 -0
- package/dist/migration-process/validation.d.ts +33 -0
- package/dist/migration-process/validation.js +56 -0
- package/dist/migration-types.d.ts +558 -0
- package/dist/migration-types.js +55 -0
- package/dist/project/adaptation-project.d.ts +37 -0
- package/dist/project/adaptation-project.js +53 -0
- package/dist/project/index.d.ts +8 -0
- package/dist/project/index.js +9 -0
- package/dist/project/project-data.d.ts +79 -0
- package/dist/project/project-data.js +155 -0
- package/dist/project/project-detection.d.ts +9 -0
- package/dist/project/project-detection.js +35 -0
- package/dist/project/project-extension.d.ts +38 -0
- package/dist/project/project-extension.js +95 -0
- package/dist/project/project-info.d.ts +13 -0
- package/dist/project/project-info.js +33 -0
- package/dist/project/regular-project.d.ts +13 -0
- package/dist/project/regular-project.js +174 -0
- package/dist/project/reuse-library.d.ts +20 -0
- package/dist/project/reuse-library.js +35 -0
- package/dist/project-spec-types.d.ts +89 -0
- package/dist/project-spec-types.js +39 -0
- package/dist/template/application.d.ts +25 -0
- package/dist/template/application.js +95 -0
- package/dist/template/assembly.d.ts +24 -0
- package/dist/template/assembly.js +141 -0
- package/dist/template/base.d.ts +22 -0
- package/dist/template/base.js +64 -0
- package/dist/template/data.d.ts +78 -0
- package/dist/template/data.js +101 -0
- package/dist/template/details.d.ts +25 -0
- package/dist/template/details.js +105 -0
- package/dist/template/index.d.ts +8 -0
- package/dist/template/index.js +9 -0
- package/dist/template/template-helpers.d.ts +12 -0
- package/dist/template/template-helpers.js +40 -0
- package/dist/template/theme.d.ts +11 -0
- package/dist/template/theme.js +37 -0
- package/dist/template-types.d.ts +11 -0
- package/dist/template-types.js +23 -0
- package/dist/types/mem-fs-types.d.ts +60 -0
- package/dist/types/mem-fs-types.js +21 -0
- package/dist/types/project-folder.d.ts +36 -0
- package/dist/types/project-folder.js +32 -0
- package/dist/types.d.ts +4 -0
- package/dist/types.js +4 -0
- package/dist/utils/Project.d.ts +61 -0
- package/dist/utils/Project.js +385 -0
- package/dist/utils/UI5Theme.d.ts +32 -0
- package/dist/utils/UI5Theme.js +100 -0
- package/dist/utils/checkForMigration.d.ts +5 -0
- package/dist/utils/checkForMigration.js +55 -0
- package/dist/utils/common.d.ts +17 -0
- package/dist/utils/common.js +27 -0
- package/dist/utils/constants.d.ts +15 -0
- package/dist/utils/constants.js +38 -0
- package/dist/utils/file-access.d.ts +58 -0
- package/dist/utils/file-access.js +141 -0
- package/dist/utils/file-discovery.d.ts +65 -0
- package/dist/utils/file-discovery.js +252 -0
- package/dist/utils/file-system-utils.d.ts +43 -0
- package/dist/utils/file-system-utils.js +55 -0
- package/dist/utils/fs-adapter.d.ts +80 -0
- package/dist/utils/fs-adapter.js +149 -0
- package/dist/utils/index.d.ts +12 -0
- package/dist/utils/index.js +25 -0
- package/dist/utils/manifest-and-version-utils.d.ts +38 -0
- package/dist/utils/manifest-and-version-utils.js +74 -0
- package/dist/utils/migration-utils.d.ts +83 -0
- package/dist/utils/migration-utils.js +165 -0
- package/dist/utils/path-validation.d.ts +37 -0
- package/dist/utils/path-validation.js +109 -0
- package/dist/utils/project-access-adapters.d.ts +20 -0
- package/dist/utils/project-access-adapters.js +59 -0
- package/dist/utils/project-discovery.d.ts +20 -0
- package/dist/utils/project-discovery.js +106 -0
- package/dist/utils/project-readers/adaptation-project-utils.d.ts +20 -0
- package/dist/utils/project-readers/adaptation-project-utils.js +119 -0
- package/dist/utils/project-readers/backend-utils.d.ts +38 -0
- package/dist/utils/project-readers/backend-utils.js +95 -0
- package/dist/utils/project-readers/extension-project-utils.d.ts +30 -0
- package/dist/utils/project-readers/extension-project-utils.js +113 -0
- package/dist/utils/project-readers/index.d.ts +9 -0
- package/dist/utils/project-readers/index.js +9 -0
- package/dist/utils/project-readers/manifest-reader.d.ts +16 -0
- package/dist/utils/project-readers/manifest-reader.js +26 -0
- package/dist/utils/project-readers/manifest-utils.d.ts +62 -0
- package/dist/utils/project-readers/manifest-utils.js +253 -0
- package/dist/utils/project-readers/package-reader.d.ts +13 -0
- package/dist/utils/project-readers/package-reader.js +23 -0
- package/dist/utils/project-readers/reuse-lib-utils.d.ts +55 -0
- package/dist/utils/project-readers/reuse-lib-utils.js +113 -0
- package/dist/utils/project-readers/webapp-path-resolver.d.ts +11 -0
- package/dist/utils/project-readers/webapp-path-resolver.js +138 -0
- package/dist/utils/read-package-up-compat.d.ts +18 -0
- package/dist/utils/read-package-up-compat.js +18 -0
- package/dist/utils/service-detection.d.ts +13 -0
- package/dist/utils/service-detection.js +33 -0
- package/dist/utils/service.d.ts +7 -0
- package/dist/utils/service.js +71 -0
- package/dist/utils/template/index.d.ts +6 -0
- package/dist/utils/template/index.js +5 -0
- package/dist/utils/template/template-data.d.ts +14 -0
- package/dist/utils/template/template-data.js +19 -0
- package/dist/utils/template/template-paths.d.ts +26 -0
- package/dist/utils/template/template-paths.js +25 -0
- package/dist/utils/template/template-post-processors.d.ts +21 -0
- package/dist/utils/template/template-post-processors.js +40 -0
- package/dist/utils/template/template-renderer.d.ts +17 -0
- package/dist/utils/template/template-renderer.js +47 -0
- package/dist/utils/template-generators/file-handlers.d.ts +24 -0
- package/dist/utils/template-generators/file-handlers.js +182 -0
- package/dist/utils/template-generators/index.d.ts +2 -0
- package/dist/utils/template-generators/index.js +2 -0
- package/dist/utils/template-maps.d.ts +33 -0
- package/dist/utils/template-maps.js +144 -0
- package/dist/utils/validation-severity.d.ts +21 -0
- package/dist/utils/validation-severity.js +43 -0
- package/package.json +76 -3
- package/templates/adaptation-app-settings/package.json.tmpl +17 -0
- package/templates/adaptation-app-settings/ui5.yaml +18 -0
- package/templates/adaptation-app-settings/xs-app.json.tmpl +45 -0
- package/templates/app-settings/README.md +17 -0
- package/templates/app-settings/package.json.tmpl +26 -0
- package/templates/app-settings/static/gitignore.tmpl +10 -0
- package/templates/app-settings/ui5-local.yaml +44 -0
- package/templates/app-settings/ui5-mock.yaml +44 -0
- package/templates/app-settings/ui5.yaml +34 -0
- package/templates/app-settings/webapp/Component.js +7 -0
- package/templates/app-settings/webapp/localService/mockserver.js +125 -0
- package/templates/app-settings/webapp/test/changes_loader.js +39 -0
- package/templates/app-settings/webapp/test/changes_preview.js +189 -0
- package/templates/app-settings/webapp/test/flpSandbox.html +87 -0
- package/templates/app-settings/webapp/test/flpSandboxMockServer.html +88 -0
- package/templates/app-settings/webapp/test/locate-reuse-libs.js +241 -0
- package/templates/app-settings/webapp/v2_index.html +30 -0
- package/templates/app-settings/webapp/v4_index.html +29 -0
- package/templates/app-settings-v4/webapp/test/flpSandbox.html +85 -0
- package/templates/app-to-app/fioriSandboxConfig.json +9 -0
- package/templates/library-settings/gitignore.tmpl +10 -0
- package/templates/library-settings/package.json.tmpl +16 -0
- package/templates/library-settings/ui5.yaml +4 -0
- package/templates/sap-app-settings/webapp/index.html +30 -0
- package/templates/sap-app-settings/webapp/localService/mockserver.js +125 -0
- package/templates/sap-app-settings/webapp/test/ModulePathForTests.js +52 -0
- package/templates/sap-app-settings/webapp/test/flpSandbox.html +84 -0
- package/templates/sap-app-settings/webapp/test/flpSandboxMockServer.html +85 -0
- package/templates/sap-app-settings/webapp/test/locate-reuse-libs.js +241 -0
- package/templates/sap-app-settings/webapp/test/testsuite.qunit.html +22 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,79 @@
|
|
|
1
|
-
|
|
1
|
+
[](https://github.com/SAP/open-ux-tools/blob/main/packages/fiori-migration-writer/CHANGELOG.md) [](https://github.com/SAP/open-ux-tools/tree/main/packages/fiori-migration-writer)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# [`@sap-ux/fiori-migration-writer`](https://github.com/SAP/open-ux-tools/tree/main/packages/fiori-migration-writer)
|
|
4
|
+
|
|
5
|
+
Writer module for migrating Fiori applications from legacy WebIDE format to modern Fiori tools format.
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
This package provides migration capabilities to convert legacy SAP WebIDE Fiori projects to the modern SAP Fiori tools format. It handles:
|
|
10
|
+
|
|
11
|
+
- Project structure transformation
|
|
12
|
+
- Configuration file updates (manifest.json, ui5.yaml, package.json)
|
|
13
|
+
- Template file generation
|
|
14
|
+
- TypeScript setup for migrated projects
|
|
15
|
+
- Launch configuration generation
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install @sap-ux/fiori-migration-writer
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { ProjectMigrator, createMemFsEditor } from '@sap-ux/fiori-migration-writer';
|
|
27
|
+
|
|
28
|
+
// Create a mem-fs editor instance
|
|
29
|
+
const fs = createMemFsEditor();
|
|
30
|
+
|
|
31
|
+
// Migrate a project
|
|
32
|
+
const { fs: updatedFs, result, messages } = await ProjectMigrator.migrate(
|
|
33
|
+
'/path/to/project',
|
|
34
|
+
'https://backend.example.com',
|
|
35
|
+
'https://ui5.sap.com',
|
|
36
|
+
undefined, // optional project info
|
|
37
|
+
undefined, // optional vscode context
|
|
38
|
+
false, // internal toggle
|
|
39
|
+
fs // optional fs editor
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
// Commit changes to disk
|
|
43
|
+
await new Promise((resolve, reject) => {
|
|
44
|
+
updatedFs.commit((err) => {
|
|
45
|
+
if (err) reject(err);
|
|
46
|
+
else resolve();
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// Check results
|
|
51
|
+
if (result) {
|
|
52
|
+
console.log('Migration successful!');
|
|
53
|
+
} else {
|
|
54
|
+
console.error('Migration failed:', messages);
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Bulk Migration
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import { BulkProjectMigrator } from '@sap-ux/fiori-migration-writer';
|
|
62
|
+
|
|
63
|
+
const migrator = new BulkProjectMigrator();
|
|
64
|
+
const results = await migrator.migrate(
|
|
65
|
+
[
|
|
66
|
+
{ rootPath: '/path/to/project1', hostname: 'https://backend.example.com' },
|
|
67
|
+
{ rootPath: '/path/to/project2', hostname: 'https://backend.example.com' }
|
|
68
|
+
],
|
|
69
|
+
'https://ui5.sap.com'
|
|
70
|
+
);
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## API
|
|
74
|
+
|
|
75
|
+
See TypeScript definitions for full API documentation.
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
Apache-2.0
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { MigrationUIProjectInfo } from './types.js';
|
|
2
|
+
export declare class BulkProjectMigrator {
|
|
3
|
+
/**
|
|
4
|
+
* Migrate projects
|
|
5
|
+
*
|
|
6
|
+
* @param projects
|
|
7
|
+
* @param ui5SnapshotUrl
|
|
8
|
+
* @param vscode
|
|
9
|
+
* @param internalToggle
|
|
10
|
+
*/
|
|
11
|
+
migrate(projects: MigrationUIProjectInfo[], ui5SnapshotUrl: string, vscode?: any, internalToggle?: boolean): Promise<MigrationUIProjectInfo[]>;
|
|
12
|
+
/**
|
|
13
|
+
* Migrate a single project
|
|
14
|
+
*
|
|
15
|
+
* @param project
|
|
16
|
+
* @param index
|
|
17
|
+
* @param ui5SnapshotUrl
|
|
18
|
+
* @param vscode
|
|
19
|
+
* @param internalToggle
|
|
20
|
+
*/
|
|
21
|
+
private migrateProject;
|
|
22
|
+
/**
|
|
23
|
+
* Add project folder to VS Code workspace if not already present
|
|
24
|
+
*
|
|
25
|
+
* @param rootPath
|
|
26
|
+
* @param vscode
|
|
27
|
+
*/
|
|
28
|
+
private addProjectToWorkspace;
|
|
29
|
+
/**
|
|
30
|
+
* Build migration result with status and messages
|
|
31
|
+
*
|
|
32
|
+
* @param project
|
|
33
|
+
* @param result
|
|
34
|
+
* @param result.result
|
|
35
|
+
* @param result.messages
|
|
36
|
+
* @param markName
|
|
37
|
+
*/
|
|
38
|
+
private buildMigrationResult;
|
|
39
|
+
/**
|
|
40
|
+
* Determine migration status based on result and messages.
|
|
41
|
+
*
|
|
42
|
+
* Note: A successful migration (result.result === true) may still return 'ERROR' status
|
|
43
|
+
* if the messages array contains ERROR-severity entries for non-fatal issues that were
|
|
44
|
+
* logged during migration but didn't prevent file generation. Callers should check both
|
|
45
|
+
* the result.result field (did migration complete?) and status (were there issues?).
|
|
46
|
+
*
|
|
47
|
+
* @param result - Migration result object
|
|
48
|
+
* @param result.result - Whether migration completed successfully
|
|
49
|
+
* @param result.messages - Array of messages generated during migration
|
|
50
|
+
* @returns 'ERROR' if result is false OR messages contain errors,
|
|
51
|
+
* 'WARNING' if result is true and messages contain warnings but no errors,
|
|
52
|
+
* 'SUCCESS' if result is true and no errors or warnings
|
|
53
|
+
*/
|
|
54
|
+
private determineStatus;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=BulkProjectMigrator.d.ts.map
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { ProjectMigrator } from './ProjectMigrator.js';
|
|
2
|
+
import { URI } from 'vscode-uri';
|
|
3
|
+
import { i18nText } from './i18n.js';
|
|
4
|
+
import { createMemFsEditor } from './utils/fs-adapter.js';
|
|
5
|
+
// Telemetry stub - @sap-ux/telemetry is an optional dependency for performance measurement
|
|
6
|
+
// This provides a no-op implementation for open-source usage
|
|
7
|
+
const uxTelemetryPerf = {
|
|
8
|
+
startMark: (name) => name,
|
|
9
|
+
endMark: (_name) => { },
|
|
10
|
+
measure: (_name) => { },
|
|
11
|
+
getMeasurementDuration: (_name) => 0
|
|
12
|
+
};
|
|
13
|
+
export class BulkProjectMigrator {
|
|
14
|
+
/**
|
|
15
|
+
* Migrate projects
|
|
16
|
+
*
|
|
17
|
+
* @param projects
|
|
18
|
+
* @param ui5SnapshotUrl
|
|
19
|
+
* @param vscode
|
|
20
|
+
* @param internalToggle
|
|
21
|
+
*/
|
|
22
|
+
async migrate(projects, ui5SnapshotUrl, vscode, internalToggle = false) {
|
|
23
|
+
// Migrate projects sequentially to avoid mem-fs adapter races
|
|
24
|
+
// The shared module-global mem-fs adapter is enabled/disabled per migration
|
|
25
|
+
const results = [];
|
|
26
|
+
for (const [index, project] of (projects ?? []).entries()) {
|
|
27
|
+
try {
|
|
28
|
+
results.push(await this.migrateProject(project, index, ui5SnapshotUrl, vscode, internalToggle)); // NOSONAR: Sequential migration required to prevent mem-fs adapter race conditions
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
// Catch per-project errors to allow remaining projects to be processed
|
|
32
|
+
results.push({
|
|
33
|
+
...project,
|
|
34
|
+
status: 'ERROR',
|
|
35
|
+
messages: [{ type: 'ERROR', description: error instanceof Error ? error.message : String(error) }]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return results;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Migrate a single project
|
|
43
|
+
*
|
|
44
|
+
* @param project
|
|
45
|
+
* @param index
|
|
46
|
+
* @param ui5SnapshotUrl
|
|
47
|
+
* @param vscode
|
|
48
|
+
* @param internalToggle
|
|
49
|
+
*/
|
|
50
|
+
async migrateProject(project, index, ui5SnapshotUrl, vscode, internalToggle) {
|
|
51
|
+
const markName = uxTelemetryPerf.startMark('project' + index);
|
|
52
|
+
// Create editor here and pass explicitly so ownsEditor is false inside ProjectMigrator.migrate
|
|
53
|
+
// This prevents double-commit (migrate() won't auto-commit when editor is passed)
|
|
54
|
+
const editor = createMemFsEditor();
|
|
55
|
+
const { fs, result, messages } = await ProjectMigrator.migrate({
|
|
56
|
+
projectRoot: project.rootPath,
|
|
57
|
+
baseUri: project.hostname,
|
|
58
|
+
ui5SnapshotUrl,
|
|
59
|
+
importProjectInfo: project,
|
|
60
|
+
vscode,
|
|
61
|
+
internalToggle,
|
|
62
|
+
fs: editor
|
|
63
|
+
});
|
|
64
|
+
// Commit changes to disk for this project
|
|
65
|
+
if (result) {
|
|
66
|
+
try {
|
|
67
|
+
await new Promise((resolve, reject) => {
|
|
68
|
+
fs.commit((err) => {
|
|
69
|
+
if (err) {
|
|
70
|
+
reject(err);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
resolve();
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
// Handle both callback errors and synchronous throws from fs.commit
|
|
80
|
+
throw new Error(`Failed to commit migration changes: ${error instanceof Error ? error.message : String(error)}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
uxTelemetryPerf.endMark(markName);
|
|
84
|
+
uxTelemetryPerf.measure(markName);
|
|
85
|
+
this.addProjectToWorkspace(project.rootPath, vscode);
|
|
86
|
+
return this.buildMigrationResult(project, { result, messages }, markName);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Add project folder to VS Code workspace if not already present
|
|
90
|
+
*
|
|
91
|
+
* @param rootPath
|
|
92
|
+
* @param vscode
|
|
93
|
+
*/
|
|
94
|
+
addProjectToWorkspace(rootPath, vscode) {
|
|
95
|
+
if (!vscode?.workspace?.workspaceFile) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const uri = URI.file(rootPath);
|
|
99
|
+
if (!vscode.workspace.getWorkspaceFolder(uri)) {
|
|
100
|
+
const folderCount = vscode.workspace.workspaceFolders?.length ?? 0;
|
|
101
|
+
vscode.workspace.updateWorkspaceFolders(folderCount, null, { uri });
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Build migration result with status and messages
|
|
106
|
+
*
|
|
107
|
+
* @param project
|
|
108
|
+
* @param result
|
|
109
|
+
* @param result.result
|
|
110
|
+
* @param result.messages
|
|
111
|
+
* @param markName
|
|
112
|
+
*/
|
|
113
|
+
buildMigrationResult(project, result, markName) {
|
|
114
|
+
const messages = [...result.messages];
|
|
115
|
+
const migrationResult = {
|
|
116
|
+
...project,
|
|
117
|
+
migrationTime: uxTelemetryPerf.getMeasurementDuration(markName),
|
|
118
|
+
status: this.determineStatus(result),
|
|
119
|
+
messages
|
|
120
|
+
};
|
|
121
|
+
if (result.result === true) {
|
|
122
|
+
messages.unshift({
|
|
123
|
+
type: 'SUCCESS',
|
|
124
|
+
description: i18nText('SUCCESSFULLY_MIGRATED_MSG')
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
return migrationResult;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Determine migration status based on result and messages.
|
|
131
|
+
*
|
|
132
|
+
* Note: A successful migration (result.result === true) may still return 'ERROR' status
|
|
133
|
+
* if the messages array contains ERROR-severity entries for non-fatal issues that were
|
|
134
|
+
* logged during migration but didn't prevent file generation. Callers should check both
|
|
135
|
+
* the result.result field (did migration complete?) and status (were there issues?).
|
|
136
|
+
*
|
|
137
|
+
* @param result - Migration result object
|
|
138
|
+
* @param result.result - Whether migration completed successfully
|
|
139
|
+
* @param result.messages - Array of messages generated during migration
|
|
140
|
+
* @returns 'ERROR' if result is false OR messages contain errors,
|
|
141
|
+
* 'WARNING' if result is true and messages contain warnings but no errors,
|
|
142
|
+
* 'SUCCESS' if result is true and no errors or warnings
|
|
143
|
+
*/
|
|
144
|
+
determineStatus(result) {
|
|
145
|
+
// If migration result is false, it's definitely an error
|
|
146
|
+
if (result.result === false) {
|
|
147
|
+
return 'ERROR';
|
|
148
|
+
}
|
|
149
|
+
// Migration succeeded (result.result === true), now check message severity
|
|
150
|
+
if (result.messages.some((message) => message.type === 'ERROR')) {
|
|
151
|
+
// Has ERROR messages even though migration succeeded - likely non-fatal errors
|
|
152
|
+
return 'ERROR';
|
|
153
|
+
}
|
|
154
|
+
else if (result.messages.some((message) => message.type === 'WARNING')) {
|
|
155
|
+
// Has warnings but no errors
|
|
156
|
+
return 'WARNING';
|
|
157
|
+
}
|
|
158
|
+
// No errors or warnings
|
|
159
|
+
return 'SUCCESS';
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=BulkProjectMigrator.js.map
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { ImportProjectInfo, Message } from './types.js';
|
|
2
|
+
import type { Editor } from 'mem-fs-editor';
|
|
3
|
+
/**
|
|
4
|
+
* Configuration options for the migrate method
|
|
5
|
+
*/
|
|
6
|
+
export interface MigrateOptions {
|
|
7
|
+
/** Root path of the project to migrate */
|
|
8
|
+
projectRoot: string;
|
|
9
|
+
/** Base URI for backend services */
|
|
10
|
+
baseUri: string;
|
|
11
|
+
/** URL for UI5 snapshot version */
|
|
12
|
+
ui5SnapshotUrl: string;
|
|
13
|
+
/** Optional partial project information */
|
|
14
|
+
importProjectInfo?: Partial<ImportProjectInfo>;
|
|
15
|
+
/** Optional VS Code context */
|
|
16
|
+
vscode?: any;
|
|
17
|
+
/** Enable internal features (default: false) */
|
|
18
|
+
internalToggle?: boolean;
|
|
19
|
+
/** Optional mem-fs editor instance. If not provided, a new one will be created */
|
|
20
|
+
fs?: Editor;
|
|
21
|
+
/** Enable strict validation mode - WARNINGs become ERRORs for critical issues (default: false) */
|
|
22
|
+
strict?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare class ProjectMigrator {
|
|
25
|
+
/**
|
|
26
|
+
* migrate project
|
|
27
|
+
*
|
|
28
|
+
* @param options - Migration options object
|
|
29
|
+
* @returns Promise with fs editor, migration result, and messages
|
|
30
|
+
*/
|
|
31
|
+
static migrate(// NOSONAR - Overload for backward compatibility; use options object signature instead
|
|
32
|
+
projectRoot: string, baseUri?: string, ui5SnapshotUrl?: string, importProjectInfo?: ImportProjectInfo, vscode?: any, internalToggle?: boolean, fs?: Editor, strict?: boolean): Promise<{
|
|
33
|
+
fs: Editor;
|
|
34
|
+
result: boolean;
|
|
35
|
+
messages: Message[];
|
|
36
|
+
}>;
|
|
37
|
+
static migrate(options: MigrateOptions): Promise<{
|
|
38
|
+
fs: Editor;
|
|
39
|
+
result: boolean;
|
|
40
|
+
messages: Message[];
|
|
41
|
+
}>;
|
|
42
|
+
/**
|
|
43
|
+
* Copy files from templates into the project
|
|
44
|
+
* Orchestrates the migration process through distinct phases
|
|
45
|
+
*
|
|
46
|
+
* @param projectInfo - Project information
|
|
47
|
+
* @param vscode - VS Code context
|
|
48
|
+
* @param ui5SnapshotUrl - UI5 snapshot URL
|
|
49
|
+
* @param internalToggle - Internal feature toggle
|
|
50
|
+
* @param strict - Enable strict validation mode (WARNINGs become ERRORs for critical issues)
|
|
51
|
+
* @returns Migration result with status and messages
|
|
52
|
+
*/
|
|
53
|
+
private static copyCommonFiles;
|
|
54
|
+
/**
|
|
55
|
+
* Copy files from templates into the project
|
|
56
|
+
*
|
|
57
|
+
* @param projectInfo
|
|
58
|
+
* @param snapshotUrl
|
|
59
|
+
*/
|
|
60
|
+
private static copyAdaptationFiles;
|
|
61
|
+
/**
|
|
62
|
+
* Copy files from templates into the project
|
|
63
|
+
*
|
|
64
|
+
* @param projectInfo
|
|
65
|
+
*/
|
|
66
|
+
private static copyLibraryFiles;
|
|
67
|
+
/**
|
|
68
|
+
* Configures a downloaded TypeScript app for local development.
|
|
69
|
+
* Generates tsconfig.json and TypeScript devDependencies via {@link enableTypescript},
|
|
70
|
+
* then patches ui5-local.yaml and ui5-mock.yaml with the transpile middleware and task.
|
|
71
|
+
*
|
|
72
|
+
* @param rootPath - The project root path.
|
|
73
|
+
* @returns Messages to surface to the user after setup.
|
|
74
|
+
*/
|
|
75
|
+
private static setupTypeScript;
|
|
76
|
+
/**
|
|
77
|
+
* Detects whether the project is a TypeScript application.
|
|
78
|
+
* First attempts detection via {@link getAppProgrammingLanguage}, which relies on tsconfig.json being present.
|
|
79
|
+
* Falls back to scanning the webapp folder for .ts files directly, since after a download from ABAP
|
|
80
|
+
* the project will not yet have a tsconfig.json — it is added as part of the migration itself.
|
|
81
|
+
*
|
|
82
|
+
* @param rootPath - The project root path.
|
|
83
|
+
* @param webappPath - The relative path to the webapp folder.
|
|
84
|
+
* @returns True if the project contains TypeScript source files.
|
|
85
|
+
*/
|
|
86
|
+
private static detectTypeScriptApp;
|
|
87
|
+
/**
|
|
88
|
+
* Scans the webapp folder for a TypeScript source file (.ts, excluding .d.ts).
|
|
89
|
+
* During migration the downloaded files live in the uncommitted mem-fs editor, so when an
|
|
90
|
+
* editor with a store is in context the mem-fs store is scanned; otherwise the real disk is read.
|
|
91
|
+
*
|
|
92
|
+
* @param webappFullPath - Absolute path to the webapp folder.
|
|
93
|
+
* @returns True if a non-declaration .ts file is present under the webapp folder.
|
|
94
|
+
*/
|
|
95
|
+
private static webappHasTypeScriptFile;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=ProjectMigrator.d.ts.map
|