@sap-ux/fiori-generator-shared 0.13.1 → 0.13.3

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,3 +1,4 @@
1
1
  export declare const YUI_EXTENSION_ID = "sapos.yeoman-ui";
2
2
  export declare const YUI_MIN_VER_FILES_GENERATED_MSG = "1.16.6";
3
+ export declare const SCRIPT_FLP_SANDBOX = "/test/flpSandbox.html";
3
4
  //# sourceMappingURL=constants.d.ts.map
package/dist/constants.js CHANGED
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.YUI_MIN_VER_FILES_GENERATED_MSG = exports.YUI_EXTENSION_ID = void 0;
3
+ exports.SCRIPT_FLP_SANDBOX = exports.YUI_MIN_VER_FILES_GENERATED_MSG = exports.YUI_EXTENSION_ID = void 0;
4
4
  exports.YUI_EXTENSION_ID = 'sapos.yeoman-ui';
5
5
  // From YUI version 1.16.6 the message 'The files have been generated.' is not shown unless a top level dir is created
6
6
  exports.YUI_MIN_VER_FILES_GENERATED_MSG = '1.16.6';
7
+ exports.SCRIPT_FLP_SANDBOX = '/test/flpSandbox.html';
7
8
  //# sourceMappingURL=constants.js.map
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getPackageScripts = getPackageScripts;
4
4
  const i18n_1 = require("../i18n");
5
+ const constants_1 = require("../constants");
5
6
  /**
6
7
  * Builds the command for the `start-noflp` script in `package.json`.
7
8
  *
@@ -20,7 +21,7 @@ function buildStartNoFLPCommand(localOnly, searchParams) {
20
21
  if (localOnly) {
21
22
  return `echo \\"${(0, i18n_1.t)('info.mockOnlyWarning')}\\"`;
22
23
  }
23
- return `fiori run --open "index.html${searchParam}"`;
24
+ return `fiori run --open "/index.html${searchParam}"`;
24
25
  }
25
26
  /**
26
27
  * Constructs a URL parameter string from search parameters and an optional FLP app ID.
@@ -43,7 +44,7 @@ function buildParams(searchParams, flpAppId) {
43
44
  * message is returned instead of a command.
44
45
  * @param {string} params - The query parameters to be included in the command URL.
45
46
  * @param {string} [startFile] - The path to the file to be opened with the `start` command.
46
- * If not provided, defaults to `'test/flpSandbox.html'`.
47
+ * If not provided, defaults to `'/test/flpSandbox.html'`.
47
48
  * @returns {string} - The command for the `start` script, including either a warning message or the `fiori run`
48
49
  * command with the specified file and parameters.
49
50
  */
@@ -51,7 +52,7 @@ function buildStartCommand(localOnly, params, startFile) {
51
52
  if (localOnly) {
52
53
  return `echo \\"${(0, i18n_1.t)('info.mockOnlyWarning')}\\"`;
53
54
  }
54
- return `fiori run --open "${startFile ?? 'test/flpSandbox.html'}${params}"`;
55
+ return `fiori run --open "${startFile ?? constants_1.SCRIPT_FLP_SANDBOX}${params}"`;
55
56
  }
56
57
  /**
57
58
  * Generates a variant management script in preview mode.
@@ -74,7 +75,7 @@ function getVariantPreviewAppScript(addSearchParams) {
74
75
  // Please keep the special characters in the below command
75
76
  // as removing them may cause the browser to misinterpret the URI components without the necessary escaping and quotes.
76
77
  // eslint-disable-next-line no-useless-escape
77
- return `fiori run --open \"preview.html${urlParam}${previewAppAnchor}\"`;
78
+ return `fiori run --open \"/preview.html${urlParam}${previewAppAnchor}\"`;
78
79
  }
79
80
  /**
80
81
  * Get an object reflecting the scripts that need to be added to the package.json.
@@ -95,16 +96,16 @@ function getPackageScripts({ localOnly, addMock = true, addTest = false, flpAppI
95
96
  const queryParams = buildParams(supportVirtualEndpoints ? undefined : viewCacheSearchParams, flpAppId);
96
97
  const scripts = {
97
98
  start: buildStartCommand(localOnly, queryParams, startFile),
98
- 'start-local': `fiori run --config ./ui5-local.yaml --open "${localStartFile ?? 'test/flpSandbox.html'}${queryParams}"`
99
+ 'start-local': `fiori run --config ./ui5-local.yaml --open "${localStartFile ?? constants_1.SCRIPT_FLP_SANDBOX}${queryParams}"`
99
100
  };
100
101
  if (generateIndex) {
101
102
  scripts['start-noflp'] = buildStartNoFLPCommand(localOnly, viewCacheSearchParams);
102
103
  }
103
104
  if (addMock) {
104
- scripts['start-mock'] = `fiori run --config ./ui5-mock.yaml --open "${localStartFile ?? 'test/flpSandbox.html'}${queryParams}"`;
105
+ scripts['start-mock'] = `fiori run --config ./ui5-mock.yaml --open "${localStartFile ?? constants_1.SCRIPT_FLP_SANDBOX}${queryParams}"`;
105
106
  }
106
107
  if (addTest) {
107
- scripts['int-test'] = 'fiori run --config ./ui5-mock.yaml --open "test/integration/opaTests.qunit.html"';
108
+ scripts['int-test'] = 'fiori run --config ./ui5-mock.yaml --open "/test/integration/opaTests.qunit.html"';
108
109
  }
109
110
  scripts['start-variants-management'] = localOnly
110
111
  ? `echo \\"${(0, i18n_1.t)('info.mockOnlyWarning')}\\"`
@@ -78,5 +78,32 @@ export interface AppGenInfo {
78
78
  */
79
79
  externalParameters?: ExternalParameters;
80
80
  }
81
+ /**
82
+ * Due to ts(18033) we cannot use the type values directly here:
83
+ * FF_SIMPLE = FFTemplateType.Basic // Once https://github.com/microsoft/TypeScript/pull/59475 is merged we can remove the hardcoded values and directly use the template values
84
+ */
85
+ export declare enum FloorplanFF {
86
+ FF_SIMPLE = "basic"
87
+ }
88
+ /**
89
+ * Due to ts(18033) we cannot use the type values directly here:
90
+ * Once https://github.com/microsoft/TypeScript/pull/59475 is merged we can remove hardcoded values and directly use the template values
91
+ * FE_FPM = FETemplateType.FlexibleProgrammingModel,
92
+ * FE_LROP = FETemplateType.ListReportObjectPage,
93
+ * FE_OVP = FETemplateType.OverviewPage,
94
+ * FE_ALP = FETemplateType.AnalyticalListPage,
95
+ * FE_FEOP = FETemplateType.FormEntryObjectPage,
96
+ * FE_WORKLIST = FETemplateType.Worklist
97
+ */
98
+ export declare enum FloorplanFE {
99
+ FE_FPM = "fpm",
100
+ FE_LROP = "lrop",
101
+ FE_OVP = "ovp",
102
+ FE_ALP = "alp",
103
+ FE_FEOP = "feop",
104
+ FE_WORKLIST = "worklist"
105
+ }
106
+ export type Floorplan = FloorplanFE | FloorplanFF;
107
+ export type FloorplanKey = keyof typeof FloorplanFE | keyof typeof FloorplanFF;
81
108
  export {};
82
109
  //# sourceMappingURL=app-gen.d.ts.map
@@ -1,3 +1,35 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FloorplanFE = exports.FloorplanFF = void 0;
4
+ // Union types to expose a single interface property for Floorplan
5
+ // This provides a layer of abstraction to isolate internal changes from external headless API consumers
6
+ // Since these keys are used as an external API definiton they need to be meaningful
7
+ // Note that ordering here determines rendering order
8
+ /**
9
+ * Due to ts(18033) we cannot use the type values directly here:
10
+ * FF_SIMPLE = FFTemplateType.Basic // Once https://github.com/microsoft/TypeScript/pull/59475 is merged we can remove the hardcoded values and directly use the template values
11
+ */
12
+ var FloorplanFF;
13
+ (function (FloorplanFF) {
14
+ FloorplanFF["FF_SIMPLE"] = "basic";
15
+ })(FloorplanFF || (exports.FloorplanFF = FloorplanFF = {}));
16
+ /**
17
+ * Due to ts(18033) we cannot use the type values directly here:
18
+ * Once https://github.com/microsoft/TypeScript/pull/59475 is merged we can remove hardcoded values and directly use the template values
19
+ * FE_FPM = FETemplateType.FlexibleProgrammingModel,
20
+ * FE_LROP = FETemplateType.ListReportObjectPage,
21
+ * FE_OVP = FETemplateType.OverviewPage,
22
+ * FE_ALP = FETemplateType.AnalyticalListPage,
23
+ * FE_FEOP = FETemplateType.FormEntryObjectPage,
24
+ * FE_WORKLIST = FETemplateType.Worklist
25
+ */
26
+ var FloorplanFE;
27
+ (function (FloorplanFE) {
28
+ FloorplanFE["FE_FPM"] = "fpm";
29
+ FloorplanFE["FE_LROP"] = "lrop";
30
+ FloorplanFE["FE_OVP"] = "ovp";
31
+ FloorplanFE["FE_ALP"] = "alp";
32
+ FloorplanFE["FE_FEOP"] = "feop";
33
+ FloorplanFE["FE_WORKLIST"] = "worklist";
34
+ })(FloorplanFE || (exports.FloorplanFE = FloorplanFE = {}));
3
35
  //# sourceMappingURL=app-gen.js.map
@@ -0,0 +1,2 @@
1
+ export type CapRuntime = 'Node.js' | 'Java';
2
+ //# sourceMappingURL=cap.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=cap.js.map
@@ -1,3 +1,6 @@
1
+ import type { Annotations } from '@sap-ux/axios-extension';
2
+ import type { FloorplanKey } from './app-gen';
3
+ import type { CapRuntime } from './cap';
1
4
  /**
2
5
  * Shared types used by headless generation from multiple modules
3
6
  */
@@ -67,4 +70,56 @@ export interface FLPConfig {
67
70
  readonly title?: string;
68
71
  readonly semanticObject?: string;
69
72
  }
73
+ /**
74
+ * Defines the external interface used to generate in headless mode (no prompts)
75
+ * This is a deliberate re-definition of internal interfaces to avoid consumers having
76
+ * to update when internal interfaces are changed
77
+ * NOTE: Any breaking changes to this interface require a version bump
78
+ */
79
+ export interface AppConfig {
80
+ readonly version: string;
81
+ readonly floorplan: FloorplanKey;
82
+ project: {
83
+ readonly name: string;
84
+ targetFolder?: string;
85
+ readonly namespace?: string;
86
+ readonly title?: string;
87
+ readonly description?: string;
88
+ readonly ui5Theme?: string;
89
+ readonly ui5Version?: string;
90
+ readonly localUI5Version?: string;
91
+ readonly sapux?: boolean;
92
+ readonly skipAnnotations?: boolean;
93
+ readonly enableCodeAssist?: boolean;
94
+ readonly enableEslint?: boolean;
95
+ readonly enableTypeScript?: boolean;
96
+ };
97
+ service?: {
98
+ readonly host?: string;
99
+ readonly servicePath?: string;
100
+ readonly client?: string;
101
+ readonly scp?: boolean;
102
+ readonly destination?: string;
103
+ readonly destinationInstance?: string;
104
+ readonly edmx?: string;
105
+ readonly annotations?: Annotations | Annotations[];
106
+ readonly capService?: {
107
+ readonly projectPath: string;
108
+ readonly serviceName: string;
109
+ readonly serviceCdsPath: string;
110
+ readonly capType?: CapRuntime;
111
+ readonly appPath?: string;
112
+ };
113
+ readonly apiHubApiKey?: string;
114
+ };
115
+ deployConfig?: DeployConfig;
116
+ flpConfig?: FLPConfig;
117
+ /**
118
+ * Adds telemetry data when passed to generator `@sap/generator-fiori:headless`
119
+ */
120
+ telemetryData?: {
121
+ generationSourceName?: string;
122
+ generationSourceVersion?: string;
123
+ };
124
+ }
70
125
  //# sourceMappingURL=headless.d.ts.map
@@ -1,4 +1,5 @@
1
1
  export * from './app-gen';
2
+ export * from './cap';
2
3
  export * from './environment';
3
4
  export * from './headless';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./app-gen"), exports);
18
+ __exportStar(require("./cap"), exports);
18
19
  __exportStar(require("./environment"), exports);
19
20
  __exportStar(require("./headless"), exports);
20
21
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/fiori-generator-shared",
3
3
  "description": "Commonly used shared functionality and types to support the fiori generator.",
4
- "version": "0.13.1",
4
+ "version": "0.13.3",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -34,6 +34,7 @@
34
34
  "@types/semver": "7.5.2",
35
35
  "@types/vscode": "1.73.1",
36
36
  "@types/yeoman-environment": "2.10.11",
37
+ "@sap-ux/axios-extension": "1.22.3",
37
38
  "@sap-ux/logger": "0.7.0"
38
39
  },
39
40
  "engines": {