@sap-ux/create 0.17.6 → 1.0.1
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/dist/cli/add/adp-cf-config.js +14 -17
- package/dist/cli/add/annotations-to-odata.js +20 -23
- package/dist/cli/add/cards-generator.js +11 -14
- package/dist/cli/add/cds-plugin-ui.js +11 -14
- package/dist/cli/add/component-usages.js +13 -17
- package/dist/cli/add/deploy-config.js +23 -25
- package/dist/cli/add/eslint-config.js +13 -16
- package/dist/cli/add/flp-embedded-config.js +8 -11
- package/dist/cli/add/html.js +18 -21
- package/dist/cli/add/index.js +33 -36
- package/dist/cli/add/mockserver-config.js +19 -21
- package/dist/cli/add/navigation-config.js +38 -41
- package/dist/cli/add/new-model.js +11 -14
- package/dist/cli/add/smartlinks-config.js +10 -13
- package/dist/cli/add/system.js +22 -25
- package/dist/cli/add/variants-config.js +13 -16
- package/dist/cli/change/change-data-source.js +18 -21
- package/dist/cli/change/change-inbound.js +13 -16
- package/dist/cli/change/index.js +9 -12
- package/dist/cli/change/system.js +12 -15
- package/dist/cli/convert/eslint-config.js +15 -18
- package/dist/cli/convert/index.js +7 -10
- package/dist/cli/convert/preview.js +10 -13
- package/dist/cli/generate/adaptation-project.js +14 -20
- package/dist/cli/generate/index.js +5 -8
- package/dist/cli/get/index.js +5 -8
- package/dist/cli/get/system.js +10 -13
- package/dist/cli/index.js +27 -29
- package/dist/cli/list/index.js +5 -8
- package/dist/cli/list/system.js +9 -12
- package/dist/cli/remove/index.js +7 -10
- package/dist/cli/remove/mockserver-config.js +12 -18
- package/dist/cli/remove/system.js +8 -11
- package/dist/common/index.d.ts +1 -1
- package/dist/common/index.js +4 -9
- package/dist/common/prompts.js +7 -15
- package/dist/index.js +2 -4
- package/dist/tracing/compare.js +12 -16
- package/dist/tracing/index.d.ts +2 -2
- package/dist/tracing/index.js +2 -8
- package/dist/tracing/logger.js +9 -15
- package/dist/tracing/trace.js +11 -14
- package/dist/validation/index.d.ts +1 -1
- package/dist/validation/index.js +1 -8
- package/dist/validation/validation.js +15 -21
- package/package.json +24 -22
|
@@ -1,27 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports.validateAdpAppType = validateAdpAppType;
|
|
6
|
-
exports.validateCloudAdpProject = validateCloudAdpProject;
|
|
7
|
-
const node_path_1 = require("node:path");
|
|
8
|
-
const node_fs_1 = require("node:fs");
|
|
9
|
-
const project_access_1 = require("@sap-ux/project-access");
|
|
10
|
-
const adp_tooling_1 = require("@sap-ux/adp-tooling");
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { getAppType, getWebappPath } from '@sap-ux/project-access';
|
|
4
|
+
import { getVariant } from '@sap-ux/adp-tooling';
|
|
11
5
|
/**
|
|
12
6
|
* Validate base path of app, throw error if file is missing.
|
|
13
7
|
*
|
|
14
8
|
* @param basePath - base path of the app, where package.json and ui5.yaml resides
|
|
15
9
|
* @param ui5YamlPath - optional path to ui5.yaml file
|
|
16
10
|
*/
|
|
17
|
-
async function validateBasePath(basePath, ui5YamlPath) {
|
|
18
|
-
const packageJsonPath =
|
|
19
|
-
if (!
|
|
11
|
+
export async function validateBasePath(basePath, ui5YamlPath) {
|
|
12
|
+
const packageJsonPath = join(basePath, 'package.json');
|
|
13
|
+
if (!existsSync(packageJsonPath)) {
|
|
20
14
|
throw Error(`Required file '${packageJsonPath}' does not exist.`);
|
|
21
15
|
}
|
|
22
|
-
ui5YamlPath ??=
|
|
23
|
-
const webappPath = await
|
|
24
|
-
if (!
|
|
16
|
+
ui5YamlPath ??= join(basePath, 'ui5.yaml');
|
|
17
|
+
const webappPath = await getWebappPath(basePath);
|
|
18
|
+
if (!existsSync(ui5YamlPath) && !existsSync(webappPath)) {
|
|
25
19
|
throw Error(`There must be either a folder '${webappPath}' or a config file '${ui5YamlPath}'`);
|
|
26
20
|
}
|
|
27
21
|
}
|
|
@@ -31,7 +25,7 @@ async function validateBasePath(basePath, ui5YamlPath) {
|
|
|
31
25
|
* @param fs - the memfs editor instance
|
|
32
26
|
* @returns - true if fs contains deletions; false otherwise
|
|
33
27
|
*/
|
|
34
|
-
function hasFileDeletes(fs) {
|
|
28
|
+
export function hasFileDeletes(fs) {
|
|
35
29
|
const changedFiles = fs.dump() || {};
|
|
36
30
|
return !!Object.keys(changedFiles).find((fileName) => changedFiles[fileName].state === 'deleted');
|
|
37
31
|
}
|
|
@@ -40,8 +34,8 @@ function hasFileDeletes(fs) {
|
|
|
40
34
|
*
|
|
41
35
|
* @param basePath - path to the adaptation project
|
|
42
36
|
*/
|
|
43
|
-
async function validateAdpAppType(basePath) {
|
|
44
|
-
if ((await
|
|
37
|
+
export async function validateAdpAppType(basePath) {
|
|
38
|
+
if ((await getAppType(basePath)) !== 'Fiori Adaptation') {
|
|
45
39
|
throw new Error('This command can only be used for an adaptation project');
|
|
46
40
|
}
|
|
47
41
|
}
|
|
@@ -50,8 +44,8 @@ async function validateAdpAppType(basePath) {
|
|
|
50
44
|
*
|
|
51
45
|
* @param basePath - path to the adaptation project
|
|
52
46
|
*/
|
|
53
|
-
async function validateCloudAdpProject(basePath) {
|
|
54
|
-
const manifest = await
|
|
47
|
+
export async function validateCloudAdpProject(basePath) {
|
|
48
|
+
const manifest = await getVariant(basePath);
|
|
55
49
|
if (!manifest?.content?.some((change) => change.changeType === 'appdescr_app_removeAllInboundsExceptOne')) {
|
|
56
50
|
throw new Error('This command can only be used for Cloud Adaptation Project.');
|
|
57
51
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/create",
|
|
3
3
|
"description": "SAP Fiori tools module to add or remove features",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"bugs": {
|
|
11
11
|
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Acreate"
|
|
12
12
|
},
|
|
13
|
+
"type": "module",
|
|
13
14
|
"license": "Apache-2.0",
|
|
14
15
|
"bin": {
|
|
15
16
|
"sap-ux": "./dist/index.js"
|
|
@@ -25,39 +26,40 @@
|
|
|
25
26
|
],
|
|
26
27
|
"dependencies": {
|
|
27
28
|
"@sap/cf-tools": "3.3.0",
|
|
28
|
-
"chalk": "
|
|
29
|
+
"chalk": "5.3.0",
|
|
29
30
|
"commander": "14.0.3",
|
|
30
31
|
"diff": "8.0.4",
|
|
31
32
|
"dotenv": "17.4.2",
|
|
32
33
|
"mem-fs": "2.1.0",
|
|
33
34
|
"mem-fs-editor": "9.4.0",
|
|
34
35
|
"prompts": "2.4.2",
|
|
35
|
-
"@sap-ux/abap-deploy-config-inquirer": "
|
|
36
|
-
"@sap-ux/abap-deploy-config-writer": "0.
|
|
37
|
-
"@sap-ux/adp-tooling": "0.
|
|
38
|
-
"@sap-ux/btp-utils": "
|
|
39
|
-
"@sap-ux/app-config-writer": "0.
|
|
40
|
-
"@sap-ux/cap-config-writer": "0.
|
|
41
|
-
"@sap-ux/logger": "0.
|
|
42
|
-
"@sap-ux/mockserver-config-writer": "0.
|
|
43
|
-
"@sap-ux/odata-service-writer": "0.
|
|
44
|
-
"@sap-ux/preview-middleware": "0.
|
|
45
|
-
"@sap-ux/project-access": "
|
|
46
|
-
"@sap-ux/system-access": "0.
|
|
47
|
-
"@sap-ux/store": "
|
|
48
|
-
"@sap-ux/ui5-config": "0.
|
|
49
|
-
"@sap-ux/flp-config-inquirer": "0.
|
|
50
|
-
"@sap-ux/nodejs-utils": "0.
|
|
51
|
-
"@sap-ux/axios-extension": "
|
|
36
|
+
"@sap-ux/abap-deploy-config-inquirer": "2.0.1",
|
|
37
|
+
"@sap-ux/abap-deploy-config-writer": "1.0.1",
|
|
38
|
+
"@sap-ux/adp-tooling": "1.0.1",
|
|
39
|
+
"@sap-ux/btp-utils": "2.0.0",
|
|
40
|
+
"@sap-ux/app-config-writer": "1.0.1",
|
|
41
|
+
"@sap-ux/cap-config-writer": "1.0.1",
|
|
42
|
+
"@sap-ux/logger": "1.0.0",
|
|
43
|
+
"@sap-ux/mockserver-config-writer": "1.0.1",
|
|
44
|
+
"@sap-ux/odata-service-writer": "1.0.1",
|
|
45
|
+
"@sap-ux/preview-middleware": "1.0.1",
|
|
46
|
+
"@sap-ux/project-access": "2.0.1",
|
|
47
|
+
"@sap-ux/system-access": "1.0.0",
|
|
48
|
+
"@sap-ux/store": "2.0.0",
|
|
49
|
+
"@sap-ux/ui5-config": "1.0.0",
|
|
50
|
+
"@sap-ux/flp-config-inquirer": "1.0.1",
|
|
51
|
+
"@sap-ux/nodejs-utils": "1.0.0",
|
|
52
|
+
"@sap-ux/axios-extension": "2.0.0"
|
|
52
53
|
},
|
|
53
54
|
"devDependencies": {
|
|
55
|
+
"@jest/globals": "30.3.0",
|
|
54
56
|
"@types/diff": "8.0.0",
|
|
55
57
|
"@types/inquirer": "8.2.6",
|
|
56
58
|
"@types/mem-fs": "1.1.2",
|
|
57
59
|
"@types/mem-fs-editor": "7.0.1",
|
|
58
60
|
"@types/prompts": "2.4.9",
|
|
59
|
-
"@sap-ux/inquirer-common": "0.
|
|
60
|
-
"@sap-ux/store": "
|
|
61
|
+
"@sap-ux/inquirer-common": "1.0.1",
|
|
62
|
+
"@sap-ux/store": "2.0.0"
|
|
61
63
|
},
|
|
62
64
|
"scripts": {
|
|
63
65
|
"build": "tsc --build && node ./scripts/generate-readme.js",
|
|
@@ -65,7 +67,7 @@
|
|
|
65
67
|
"format": "prettier --write '**/*.{js,json,ts,yaml,yml}' --ignore-path ../../.prettierignore",
|
|
66
68
|
"lint": "eslint",
|
|
67
69
|
"lint:fix": "eslint --fix",
|
|
68
|
-
"test": "jest --ci --forceExit --detectOpenHandles --colors",
|
|
70
|
+
"test": "cross-env NODE_OPTIONS='--experimental-vm-modules' jest --ci --forceExit --detectOpenHandles --colors",
|
|
69
71
|
"watch": "tsc --watch"
|
|
70
72
|
}
|
|
71
73
|
}
|