@sap-ux/fiori-migration-writer 0.0.16 → 1.1.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.
@@ -1,4 +1,5 @@
1
- import type { BackendConfig, Message, NeoappDestination, TemplateData } from '../types.js';
1
+ import type { FioriToolsProxyConfigBackend } from '@sap-ux/ui5-config';
2
+ import type { Message, NeoappDestination, TemplateData } from '../types.js';
2
3
  /**
3
4
  * Updates YAML backends by removing default /sap backend if no datasource exists
4
5
  * and adding backends for service paths that don't start with /sap
@@ -20,5 +21,5 @@ export declare function updateYamlBackends(proxyConfigInput: any, templateData:
20
21
  * @param strict - Enable strict validation mode (WARNING becomes ERROR)
21
22
  * @returns Array of updated backend configurations
22
23
  */
23
- export declare function updateNeoYamlBackends(neoappDestinations: NeoappDestination[], proxyBackend: BackendConfig[], templateData: TemplateData, messages: Message[], destination: string | undefined, firstNeoAppDestination?: string, strict?: boolean): BackendConfig[];
24
+ export declare function updateNeoYamlBackends(neoappDestinations: NeoappDestination[], proxyBackend: FioriToolsProxyConfigBackend[], templateData: TemplateData, messages: Message[], destination: string | undefined, firstNeoAppDestination?: string, strict?: boolean): FioriToolsProxyConfigBackend[];
24
25
  //# sourceMappingURL=backend.d.ts.map
@@ -63,7 +63,7 @@ export function updateNeoYamlBackends(neoappDestinations, proxyBackend, template
63
63
  };
64
64
  if (destination === backend.destination || firstNeoAppDestination === backend.destination) {
65
65
  //destination from the webview
66
- backend.url = templateData.ui5Yaml?.proxyHost;
66
+ backend.url = templateData.ui5Yaml?.proxyHost ?? '';
67
67
  backend.destination = templateData.ui5Yaml?.destination;
68
68
  if (templateData.ui5Yaml?.client !== '') {
69
69
  backend.client = templateData.ui5Yaml?.client;
@@ -5,7 +5,7 @@ import { basename, join, sep as pathSep } from 'node:path';
5
5
  import { isAppStudio } from '@sap-ux/btp-utils';
6
6
  import { FioriElementsVersion } from '../project-spec-types.js';
7
7
  import { createLaunchConfig } from '@sap-ux/launch-config';
8
- import { ODataVersion } from '../types.js';
8
+ import { ODataVersion } from '@sap-ux/axios-extension';
9
9
  /**
10
10
  * Generate and write VS Code launch configuration for the migrated project
11
11
  *
@@ -4,7 +4,7 @@
4
4
  import type { ManifestNamespace } from '../project-spec-types.js';
5
5
  import { FioriElementsVersion } from '../project-spec-types.js';
6
6
  import type { NeoappDestination } from '../types.js';
7
- import { ODataVersion } from '../types.js';
7
+ import { ODataVersion } from '@sap-ux/axios-extension';
8
8
  /**
9
9
  * Result of neo-app and OData version processing
10
10
  */
@@ -1,5 +1,5 @@
1
1
  import { FioriElementsVersion } from '../project-spec-types.js';
2
- import { ODataVersion } from '../types.js';
2
+ import { ODataVersion } from '@sap-ux/axios-extension';
3
3
  /**
4
4
  * Process neo-app configuration and determine OData version
5
5
  * Handles destination extraction, UI5 version, and OData version determination
@@ -8,7 +8,7 @@ import { FioriElementsVersion } from '../project-spec-types.js';
8
8
  import { propertyEditorTaskProjectTypes, isGenerateIndex } from '../utils/common.js';
9
9
  import { determineSapUxLayer } from '../utils/migration-utils.js';
10
10
  import { MigrationTypes } from '../utils/constants.js';
11
- import { ODataVersion } from '../types.js';
11
+ import { ODataVersion } from '@sap-ux/axios-extension';
12
12
  const TEST_FILES = [
13
13
  { type: 'suite', path: 'test/testsuite.qunit.html' },
14
14
  { type: 'suite', path: 'test/qunit.runner.testsuite.html' },
@@ -1,18 +1,11 @@
1
1
  import type { FioriElementsVersion, SapAppSourceTemplate, Manifest } from './project-spec-types.js';
2
2
  import type { MigrationTypes, postMigrationAction } from './utils/constants.js';
3
- import type { CdsUi5PluginInfo } from '@sap-ux/project-access';
4
- import type { Annotations } from '@sap-ux/axios-extension';
3
+ import type { UI5FlexLayer } from '@sap-ux/project-access';
4
+ import type { ODataVersion } from '@sap-ux/axios-extension';
5
+ import type { BaseProject, BaseService } from '@sap-ux/fiori-generator-shared';
5
6
  import type { Editor } from 'mem-fs-editor';
6
7
  export type { ProjectFolder } from './types/project-folder.js';
7
8
  export { isProjectFolderArray } from './types/project-folder.js';
8
- /**
9
- * OData versions supported by the catalog service
10
- */
11
- export declare const ODataVersion: {
12
- readonly v2: "2";
13
- readonly v4: "4";
14
- };
15
- export type ODataVersion = (typeof ODataVersion)[keyof typeof ODataVersion];
16
9
  /**
17
10
  * package.json script entries (commands and tasks)
18
11
  */
@@ -20,11 +13,6 @@ export type Script = {
20
13
  name: string;
21
14
  command: string;
22
15
  };
23
- export declare const SapUxLayer: {
24
- readonly VENDOR: "VENDOR";
25
- readonly CUSTOMER_BASE: "CUSTOMER_BASE";
26
- };
27
- export type SapUxLayer = (typeof SapUxLayer)[keyof typeof SapUxLayer];
28
16
  /** package.json interface */
29
17
  export interface PackageJson {
30
18
  name: string;
@@ -45,7 +33,7 @@ export interface PackageJson {
45
33
  localStartFile?: string;
46
34
  runTasks?: Script[];
47
35
  enableEslint: boolean;
48
- sapuxLayer?: SapUxLayer;
36
+ sapuxLayer?: UI5FlexLayer;
49
37
  }
50
38
  export declare const DatasourceType: {
51
39
  readonly FILE: "File";
@@ -76,14 +64,6 @@ export type NeoappDestination = {
76
64
  name: string;
77
65
  entryPath?: string;
78
66
  };
79
- export interface BackendConfig {
80
- path: string;
81
- url?: string;
82
- client?: string;
83
- destination?: string;
84
- destinationInstance?: string;
85
- pathPrefix?: string;
86
- }
87
67
  export interface EntityConfig {
88
68
  mainEntity?: {
89
69
  entityName: string;
@@ -96,7 +76,12 @@ export interface EntityConfig {
96
76
  Role?: string;
97
77
  };
98
78
  }
99
- export interface ProjectMigrate extends Project {
79
+ export interface ProjectMigrate extends BaseProject {
80
+ enableCodeAssist: boolean;
81
+ enableEslint: boolean;
82
+ enableTypeScript: boolean;
83
+ manifestVersion: string;
84
+ enableNPMWorkspaces?: boolean;
100
85
  flpAppId?: string;
101
86
  appId?: string;
102
87
  entityConfig?: EntityConfig;
@@ -212,7 +197,6 @@ export type TemplateMap = {
212
197
  export interface TemplateData<P extends ProjectMigrate = ProjectMigrate, S extends Service = Service> {
213
198
  project: Partial<P>;
214
199
  service: Partial<S>;
215
- readMe?: Partial<ReadMe>;
216
200
  ui5Yaml?: Partial<Ui5Yaml> & Partial<Ui5MockYaml>;
217
201
  packageJson?: Partial<PackageJsonMigrate>;
218
202
  appId?: string;
@@ -237,36 +221,14 @@ export type MigratableFolder = {
237
221
  libPath?: string;
238
222
  };
239
223
  export declare const sapWattCommonSetting = "sap.watt.common.setting";
240
- export interface Project {
241
- targetFolder: string;
242
- addDeployConfig?: boolean;
243
- addFlpConfig?: boolean;
244
- name: string;
245
- namespace?: string;
246
- title: string;
247
- description: string;
248
- ui5Theme: string;
249
- ui5Version: string;
250
- ui5FrameworkUrl?: string;
251
- localUI5Version: string;
252
- sapux?: boolean;
253
- skipAnnotations?: boolean;
254
- enableCodeAssist: boolean;
255
- enableEslint: boolean;
256
- enableTypeScript: boolean;
257
- manifestVersion: string;
258
- formEntry?: boolean;
259
- flpAppId?: string;
260
- minSupportedUI5Version?: string;
261
- manifestMinUI5Version?: string;
262
- enableNPMWorkspaces?: boolean;
263
- }
264
224
  /**
265
225
  * User credentials for authentication.
266
226
  *
267
227
  * SECURITY: This interface contains sensitive authentication data.
268
228
  * The `password` field must NEVER be logged, included in error messages,
269
229
  * or transmitted to telemetry systems.
230
+ *
231
+ * @deprecated Not used by the migration writer. Will be removed in a future release.
270
232
  */
271
233
  export interface Credentials {
272
234
  /** Username for authentication */
@@ -284,75 +246,21 @@ export declare const CapType: {
284
246
  readonly JAVA: "Java";
285
247
  };
286
248
  export type CapType = (typeof CapType)[keyof typeof CapType];
287
- export declare const ApiHubType: {
288
- readonly apiHub: "API_HUB";
289
- readonly apiHubEnterprise: "API_HUB_ENTERPRISE";
290
- };
291
- export type ApiHubType = (typeof ApiHubType)[keyof typeof ApiHubType];
292
- /**
293
- * Defines the api hub service properties or enterprise and non-enterprise versions
294
- */
295
- export interface ApiHubConfig {
296
- apiHubKey: string;
297
- apiHubType: ApiHubType;
298
- }
299
- export interface CapService {
300
- projectPath: string;
301
- serviceName: string;
302
- appPath?: string;
303
- serviceCdsPath?: string;
304
- capType?: CapType;
305
- capCdsInfo?: CdsUi5PluginInfo;
306
- }
307
249
  export declare const SapSystemSourceType: {
308
250
  readonly SCP: "SCP";
309
251
  readonly ON_PREM: "ON_PREM";
310
252
  readonly S4HC: "S4HC";
311
253
  };
312
254
  export type SapSystemSourceType = (typeof SapSystemSourceType)[keyof typeof SapSystemSourceType];
313
- export interface Service {
255
+ export interface Service extends BaseService {
314
256
  host: string;
315
- client?: string;
316
257
  scp?: boolean;
317
258
  destination?: string;
318
259
  destinationInstance?: string;
319
- servicePath?: string;
320
260
  edmx: string;
321
- annotations?: Annotations[];
322
261
  version?: ODataVersion;
323
- capService?: CapService;
324
262
  source: DatasourceType;
325
263
  sapSystemSource?: SapSystemSourceType;
326
- localEdmxFilePath?: string;
327
- destinationAuthType?: string;
328
- apiHubConfig?: ApiHubConfig;
329
- ignoreCertError?: boolean;
330
- }
331
- /** README.txt base definition */
332
- export interface ReadMe {
333
- genDate: string;
334
- genPlatform: string;
335
- dataSourceLabel: string;
336
- metadataFilename?: string;
337
- serviceUrl: string;
338
- projectName: string;
339
- projectTitle: string;
340
- projectNamespace: string;
341
- projectDescription: string;
342
- ui5Theme: string;
343
- projectUI5Version: string;
344
- enableCodeAssist: boolean;
345
- enableEslint: boolean;
346
- enableTypeScript: boolean;
347
- showMockDataInfo?: boolean;
348
- genId: string;
349
- genVersion: string;
350
- templateLabel: string;
351
- additionalEntries?: {
352
- label: string;
353
- value: string;
354
- }[];
355
- launchText?: string;
356
264
  }
357
265
  interface Ui5YamlProps {
358
266
  ui5Version: string;
@@ -1,15 +1,4 @@
1
1
  export { isProjectFolderArray } from './types/project-folder.js';
2
- /**
3
- * OData versions supported by the catalog service
4
- */
5
- export const ODataVersion = {
6
- v2: '2',
7
- v4: '4'
8
- };
9
- export const SapUxLayer = {
10
- VENDOR: 'VENDOR',
11
- CUSTOMER_BASE: 'CUSTOMER_BASE'
12
- };
13
2
  // Common constants defs used throughout
14
3
  export const DatasourceType = {
15
4
  FILE: 'File',
@@ -43,10 +32,6 @@ export const CapType = {
43
32
  NODE_JS: 'Node.js',
44
33
  JAVA: 'Java'
45
34
  };
46
- export const ApiHubType = {
47
- apiHub: 'API_HUB',
48
- apiHubEnterprise: 'API_HUB_ENTERPRISE'
49
- };
50
35
  export const SapSystemSourceType = {
51
36
  SCP: 'SCP',
52
37
  ON_PREM: 'ON_PREM',
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Helper functions for processing adaptation project configuration
3
3
  */
4
- import type { Package } from '../project-spec-types.js';
4
+ import type { Package } from '@sap-ux/project-access';
5
5
  import type { ImportProjectInfo, NeoappDestination } from '../types.js';
6
6
  /**
7
7
  * Configuration for processing adaptation project
@@ -5,7 +5,8 @@ import { SapUiLibs } from '../index.js';
5
5
  import { defaultMinUi5Version, minUi5VersionV4Template } from '@sap-ux/ui5-info';
6
6
  import { getManifestVersion } from '@sap-ux/ui5-application-writer';
7
7
  import { getUI5Version, stripSpaces } from '../utils/index.js';
8
- import { DatasourceType, ODataVersion } from '../types.js';
8
+ import { ODataVersion } from '@sap-ux/axios-extension';
9
+ import { DatasourceType } from '../types.js';
9
10
  /**
10
11
  * Prepare sanitized project names and namespaces
11
12
  *
@@ -1,5 +1,6 @@
1
- import type { Manifest, Package } from '../project-spec-types.js';
1
+ import type { Manifest } from '../project-spec-types.js';
2
2
  import type { ImportProjectInfo, NeoappDestination } from '../types.js';
3
+ import type { Package } from '@sap-ux/project-access';
3
4
  /**
4
5
  * Configuration for processing project extension
5
6
  */
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * Helper functions for processing reuse library projects
3
3
  */
4
- import type { Manifest, Package } from '../project-spec-types.js';
4
+ import type { Package } from '@sap-ux/project-access';
5
+ import type { Manifest } from '../project-spec-types.js';
5
6
  import type { ImportProjectInfo, ProjectFolder } from '../types.js';
6
7
  /**
7
8
  * Process reuse library project to build projectInfo
@@ -48,22 +48,6 @@ export declare const DirName: {
48
48
  readonly Sapux: "src";
49
49
  };
50
50
  export type DirName = (typeof DirName)[keyof typeof DirName];
51
- /**
52
- * Package.json structure
53
- */
54
- export interface Package {
55
- name?: string;
56
- version?: string;
57
- description?: string;
58
- scripts?: Record<string, string>;
59
- dependencies?: Record<string, string>;
60
- devDependencies?: Record<string, string>;
61
- ui5?: {
62
- dependencies?: string[];
63
- };
64
- sapux?: string[] | boolean;
65
- [key: string]: unknown;
66
- }
67
51
  /**
68
52
  * UI5 routing target from manifest.json
69
53
  */
@@ -75,15 +59,4 @@ export interface SapUi5RoutingTarget {
75
59
  viewLevel?: number;
76
60
  transition?: string;
77
61
  }
78
- /**
79
- * Middleware proxy configuration for ui5.yaml
80
- */
81
- export interface MiddlewareProxy {
82
- name?: string;
83
- path: string;
84
- url?: string;
85
- destination?: string;
86
- destinationInstance?: string;
87
- client?: string;
88
- }
89
62
  //# sourceMappingURL=project-spec-types.d.ts.map
@@ -1,5 +1,6 @@
1
1
  import { DirName } from '../project-spec-types.js';
2
- import { FLOOR_PLAN, ODataVersion } from '../types.js';
2
+ import { ODataVersion } from '@sap-ux/axios-extension';
3
+ import { FLOOR_PLAN } from '../types.js';
3
4
  import { escapeDoubleQuotes } from '../utils/index.js';
4
5
  /**
5
6
  * Creates Ui5Yaml configuration object
@@ -1,5 +1,6 @@
1
1
  import type { Editor } from 'mem-fs-editor';
2
- import type { Manifest, Package } from '../project-spec-types.js';
2
+ import type { Package } from '@sap-ux/project-access';
3
+ import type { Manifest } from '../project-spec-types.js';
3
4
  import type { ImportProjectInfo, Message, MigratableFolder, ProjectFolder } from '../types.js';
4
5
  import { MigrationTypes } from './constants.js';
5
6
  import { getFirstBackend } from './project-readers/index.js';
@@ -3,7 +3,7 @@ import { createMemFsEditor } from './fs-adapter.js';
3
3
  import { getReuseLibs, findAllProjectRoots, ReuseLibType } from './file-discovery.js';
4
4
  import { DirName } from '../project-spec-types.js';
5
5
  import { legacyPath, findAllWebIDEProjectFolders, findProjectsByManifest } from './common.js';
6
- import { ODataVersion } from '../types.js';
6
+ import { ODataVersion } from '@sap-ux/axios-extension';
7
7
  import { MigrationTypes } from './constants.js';
8
8
  import { URI } from 'vscode-uri';
9
9
  import { processProjectExtension } from '../project/project-extension.js';
@@ -1,7 +1,8 @@
1
1
  import type { Data } from 'ejs';
2
2
  import type { Editor } from 'mem-fs-editor';
3
3
  import type { Manifest, SapAppSourceTemplate } from '../project-spec-types.js';
4
- import type { TemplateProperties, SapUxLayer } from '../types.js';
4
+ import type { UI5FlexLayer } from '@sap-ux/project-access';
5
+ import type { TemplateProperties } from '../types.js';
5
6
  /**
6
7
  * Filter out only SAP libs
7
8
  *
@@ -62,7 +63,7 @@ export declare function generateToolsId(): string;
62
63
  * @param isInternal - Whether the project is internal (SAP-developed)
63
64
  * @returns SAP UX layer identifier
64
65
  */
65
- export declare function determineSapUxLayer(isInternal: boolean): SapUxLayer;
66
+ export declare function determineSapUxLayer(isInternal: boolean): UI5FlexLayer;
66
67
  /**
67
68
  * Format a string url parameter from the input arguments. Accepts empty string as input arguments.
68
69
  *
@@ -131,7 +131,7 @@ export function generateToolsId() {
131
131
  * @returns SAP UX layer identifier
132
132
  */
133
133
  export function determineSapUxLayer(isInternal) {
134
- return (isInternal ? 'VENDOR' : 'CUSTOMER_BASE');
134
+ return isInternal ? 'VENDOR' : 'CUSTOMER_BASE';
135
135
  }
136
136
  /**
137
137
  * Format a string url parameter from the input arguments. Accepts empty string as input arguments.
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "bugs": {
11
11
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Afiori-migration-writer"
12
12
  },
13
- "version": "0.0.16",
13
+ "version": "1.1.0",
14
14
  "license": "Apache-2.0",
15
15
  "main": "dist/index.js",
16
16
  "files": [
@@ -37,9 +37,10 @@
37
37
  "uuid": "11.1.1",
38
38
  "vscode-uri": "3.2.0",
39
39
  "yaml": "2.9.1",
40
- "@sap-ux/adp-tooling": "1.2.0",
40
+ "@sap-ux/adp-tooling": "1.2.1",
41
41
  "@sap-ux/axios-extension": "2.1.6",
42
42
  "@sap-ux/btp-utils": "2.0.8",
43
+ "@sap-ux/fiori-generator-shared": "1.3.0",
43
44
  "@sap-ux/i18n": "1.0.7",
44
45
  "@sap-ux/launch-config": "1.0.28",
45
46
  "@sap-ux/nodejs-utils": "1.0.14",