@ohos-ports/sap-cf-tools 3.3.1-beta.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/LICENSE +201 -0
- package/README.md +73 -0
- package/bin/cf-openharmony-arm64.gz +0 -0
- package/out/src/cf-local.d.ts +33 -0
- package/out/src/cf-local.js +628 -0
- package/out/src/cfServicesUtil.d.ts +6 -0
- package/out/src/cfServicesUtil.js +41 -0
- package/out/src/cli.d.ts +10 -0
- package/out/src/cli.js +87 -0
- package/out/src/index.d.ts +10 -0
- package/out/src/index.js +40 -0
- package/out/src/messages.d.ts +12 -0
- package/out/src/messages.js +16 -0
- package/out/src/task.d.ts +1 -0
- package/out/src/task.js +32 -0
- package/out/src/types.d.ts +214 -0
- package/out/src/types.js +63 -0
- package/out/src/utils.d.ts +18 -0
- package/out/src/utils.js +126 -0
- package/package.json +97 -0
- package/scripts/install-binary.js +45 -0
package/package.json
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ohos-ports/sap-cf-tools",
|
|
3
|
+
"displayName": "cf-tools",
|
|
4
|
+
"version": "3.3.1-beta.0",
|
|
5
|
+
"description": "Cloud Foundry API tools (HarmonyOS/openharmony-arm64 port; bundles source-compiled cf CLI v9 for openharmony-arm64)",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/ohos-ports/ohos-ports/issues"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/ohos-ports/ohos-ports.git",
|
|
12
|
+
"directory": "ports/sap-cf-tools/3.3.1"
|
|
13
|
+
},
|
|
14
|
+
"license": "Apache-2.0",
|
|
15
|
+
"author": "SAP SE",
|
|
16
|
+
"main": "./out/src/index.js",
|
|
17
|
+
"types": "out/src/index.d.ts",
|
|
18
|
+
"files": [
|
|
19
|
+
"out/src/*.js",
|
|
20
|
+
"out/src/*.ts",
|
|
21
|
+
"bin/",
|
|
22
|
+
"scripts/"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "npm-run-all format:validate lint:validate test docs",
|
|
26
|
+
"compile": "tsc -p ./",
|
|
27
|
+
"docs": "shx rm -rf docs/ && typedoc src/index.ts --tsconfig tsconfig.json --out docs/ --name \"Cloud Foundry Tools API\" --excludePrivate --excludeInternal",
|
|
28
|
+
"format:fix": "prettier --write \"**/*.@(js|ts|json|md)\"",
|
|
29
|
+
"format:validate": "prettier --check \"**/*.@(js|ts|json|md)\"",
|
|
30
|
+
"lint:fix": "eslint . --ext=js,ts --fix --max-warnings=0",
|
|
31
|
+
"lint:validate": "eslint . --ext=js,ts --max-warnings=0",
|
|
32
|
+
"release": "standard-version",
|
|
33
|
+
"postinstall": "node scripts/install-binary.js"
|
|
34
|
+
},
|
|
35
|
+
"commitlint": {
|
|
36
|
+
"extends": [
|
|
37
|
+
"@commitlint/config-conventional"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"lint-staged": {
|
|
41
|
+
"*.{js,ts,json,md}": [
|
|
42
|
+
"prettier --write"
|
|
43
|
+
],
|
|
44
|
+
"*.{ts,js}": [
|
|
45
|
+
"eslint --fix --max-warnings=0 --ignore-pattern=!.*"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"config": {
|
|
49
|
+
"commitizen": {
|
|
50
|
+
"path": "cz-conventional-changelog"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"prettier": {
|
|
54
|
+
"printWidth": 120
|
|
55
|
+
},
|
|
56
|
+
"overrides": {
|
|
57
|
+
"serialize-javascript": "^7.0.3",
|
|
58
|
+
"form-data": "^2.5.4",
|
|
59
|
+
"braces": "^3.0.3"
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"comment-json": "4.2.5",
|
|
63
|
+
"lodash": "4.18.1",
|
|
64
|
+
"properties-reader": "2.3.0",
|
|
65
|
+
"url": "0.11.4"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@commitlint/cli": "19.5.0",
|
|
69
|
+
"@commitlint/config-conventional": "19.5.0",
|
|
70
|
+
"@types/chai": "^4.3.3",
|
|
71
|
+
"@types/comment-json": "2.4.5",
|
|
72
|
+
"@types/lodash": "^4.17.24",
|
|
73
|
+
"@types/mocha": "10.0.10",
|
|
74
|
+
"@types/node": "^14.14.10",
|
|
75
|
+
"@types/properties-reader": "2.1.3",
|
|
76
|
+
"@types/sinon": "^17.0.3",
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "5.37.0",
|
|
78
|
+
"@typescript-eslint/parser": "5.37.0",
|
|
79
|
+
"chai": "^4.3.6",
|
|
80
|
+
"coveralls": "^3.1.1",
|
|
81
|
+
"cz-conventional-changelog": "^3.3.0",
|
|
82
|
+
"eslint": "8.23.1",
|
|
83
|
+
"eslint-config-prettier": "8.5.0",
|
|
84
|
+
"eslint-plugin-eslint-comments": "3.2.0",
|
|
85
|
+
"eslint-plugin-import": "2.26.0",
|
|
86
|
+
"husky": "^9.1.7",
|
|
87
|
+
"mocha": "11.7.1",
|
|
88
|
+
"npm-run-all": "4.1.5",
|
|
89
|
+
"nyc": "^17.0.0",
|
|
90
|
+
"prettier": "3.3.3",
|
|
91
|
+
"shx": "0.4.0",
|
|
92
|
+
"sinon": "^19.0.2",
|
|
93
|
+
"standard-version": "^9.5.0",
|
|
94
|
+
"typedoc": "0.26.11",
|
|
95
|
+
"typescript": "^4.8.3"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/**
|
|
4
|
+
* postinstall: unpack the bundled Cloud Foundry CLI (openharmony-arm64)
|
|
5
|
+
* and install it onto PATH so that @sap/cf-tools's spawn('cf') works.
|
|
6
|
+
* Best-effort: never fails the install.
|
|
7
|
+
*/
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
const os = require('os');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const zlib = require('zlib');
|
|
12
|
+
|
|
13
|
+
const pkgBin = path.join(__dirname, '..', 'bin');
|
|
14
|
+
const gz = path.join(pkgBin, 'cf-openharmony-arm64.gz');
|
|
15
|
+
const target = path.join(pkgBin, 'cf-openharmony-arm64');
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
const out = zlib.gunzipSync(fs.readFileSync(gz));
|
|
19
|
+
fs.writeFileSync(target, out, { mode: 0o755 });
|
|
20
|
+
fs.chmodSync(target, 0o755);
|
|
21
|
+
console.log('[ohos-ports/sap-cf-tools] unpacked cf CLI -> ' + target);
|
|
22
|
+
|
|
23
|
+
// The package shells out via child_process.spawn('cf'), so install onto PATH.
|
|
24
|
+
const candidates = [
|
|
25
|
+
path.join(os.homedir(), '.harmonybrew', 'bin'),
|
|
26
|
+
path.join(os.homedir(), '.local', 'bin'),
|
|
27
|
+
];
|
|
28
|
+
for (const dir of candidates) {
|
|
29
|
+
try {
|
|
30
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
31
|
+
const dest = path.join(dir, 'cf');
|
|
32
|
+
try { fs.unlinkSync(dest); } catch (e) { /* not present */ }
|
|
33
|
+
fs.copyFileSync(target, dest);
|
|
34
|
+
fs.chmodSync(dest, 0o755);
|
|
35
|
+
console.log('[ohos-ports/sap-cf-tools] installed cf CLI -> ' + dest);
|
|
36
|
+
process.exit(0);
|
|
37
|
+
} catch (e) { /* try next candidate */ }
|
|
38
|
+
}
|
|
39
|
+
console.warn(
|
|
40
|
+
'[ohos-ports/sap-cf-tools] could not write to a PATH directory; ' +
|
|
41
|
+
'add this to your PATH manually: ' + pkgBin
|
|
42
|
+
);
|
|
43
|
+
} catch (e) {
|
|
44
|
+
console.warn('[ohos-ports/sap-cf-tools] postinstall failed (non-fatal): ' + e.message);
|
|
45
|
+
}
|