@sap-cloud-sdk/generator-common 2.0.0-beta.0 → 2.0.0-beta.1-20220107172351.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/dist/file-writer/copy-file.d.ts +16 -0
- package/dist/file-writer/copy-file.d.ts.map +1 -0
- package/dist/file-writer/copy-file.js +34 -0
- package/dist/file-writer/copy-file.js.map +1 -0
- package/dist/file-writer/index.d.ts +2 -0
- package/dist/file-writer/index.d.ts.map +1 -0
- package/dist/file-writer/index.js +14 -0
- package/dist/file-writer/index.js.map +1 -0
- package/dist/internal.d.ts +1 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +1 -0
- package/dist/internal.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copy a file from a given path.
|
|
3
|
+
* @param src - Path to the source file.
|
|
4
|
+
* @param dest - Path to the destination file
|
|
5
|
+
* @param overwrite - Whether or not existing files should be overwritten.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare function copyFile(src: string, dest: string, overwrite?: boolean): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* @param files - List of files to be copied
|
|
11
|
+
* @param dest - Path to where the files are copied
|
|
12
|
+
* @param overwrite - Overwrite flag
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function copyFiles(files: string[], dest: string, overwrite: boolean): Promise<void[]>;
|
|
16
|
+
//# sourceMappingURL=copy-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-file.d.ts","sourceRoot":"","sources":["../../src/file-writer/copy-file.ts"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,wBAAsB,QAAQ,CAC5B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,SAAS,UAAQ,GAChB,OAAO,CAAC,IAAI,CAAC,CAKf;AAED;;;;;GAKG;AACH,wBAAsB,SAAS,CAC7B,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,OAAO,GACjB,OAAO,CAAC,IAAI,EAAE,CAAC,CAQjB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.copyFiles = exports.copyFile = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const util_1 = require("@sap-cloud-sdk/util");
|
|
7
|
+
const { copyFile: fsCopyFile } = fs_1.promises;
|
|
8
|
+
const logger = (0, util_1.createLogger)('generator-common');
|
|
9
|
+
/**
|
|
10
|
+
* Copy a file from a given path.
|
|
11
|
+
* @param src - Path to the source file.
|
|
12
|
+
* @param dest - Path to the destination file
|
|
13
|
+
* @param overwrite - Whether or not existing files should be overwritten.
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
async function copyFile(src, dest, overwrite = false) {
|
|
17
|
+
if (!overwrite && (0, fs_1.existsSync)(dest)) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
return fsCopyFile(src, dest);
|
|
21
|
+
}
|
|
22
|
+
exports.copyFile = copyFile;
|
|
23
|
+
/**
|
|
24
|
+
* @param files - List of files to be copied
|
|
25
|
+
* @param dest - Path to where the files are copied
|
|
26
|
+
* @param overwrite - Overwrite flag
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
async function copyFiles(files, dest, overwrite) {
|
|
30
|
+
logger.verbose(`Copying additional files ${files} into ${dest}.`);
|
|
31
|
+
return Promise.all(files.map(filePath => copyFile((0, path_1.resolve)(filePath), (0, path_1.join)(dest, (0, path_1.basename)(filePath)), overwrite)));
|
|
32
|
+
}
|
|
33
|
+
exports.copyFiles = copyFiles;
|
|
34
|
+
//# sourceMappingURL=copy-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-file.js","sourceRoot":"","sources":["../../src/file-writer/copy-file.ts"],"names":[],"mappings":";;;AAAA,2BAA0C;AAC1C,+BAA+C;AAC/C,8CAAmD;AACnD,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,aAAQ,CAAC;AAE1C,MAAM,MAAM,GAAG,IAAA,mBAAY,EAAC,kBAAkB,CAAC,CAAC;AAEhD;;;;;;GAMG;AACI,KAAK,UAAU,QAAQ,CAC5B,GAAW,EACX,IAAY,EACZ,SAAS,GAAG,KAAK;IAEjB,IAAI,CAAC,SAAS,IAAI,IAAA,eAAU,EAAC,IAAI,CAAC,EAAE;QAClC,OAAO;KACR;IACD,OAAO,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAC/B,CAAC;AATD,4BASC;AAED;;;;;GAKG;AACI,KAAK,UAAU,SAAS,CAC7B,KAAe,EACf,IAAY,EACZ,SAAkB;IAElB,MAAM,CAAC,OAAO,CAAC,4BAA4B,KAAK,SAAS,IAAI,GAAG,CAAC,CAAC;IAElE,OAAO,OAAO,CAAC,GAAG,CAChB,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CACnB,QAAQ,CAAC,IAAA,cAAO,EAAC,QAAQ,CAAC,EAAE,IAAA,WAAI,EAAC,IAAI,EAAE,IAAA,eAAQ,EAAC,QAAQ,CAAC,CAAC,EAAE,SAAS,CAAC,CACvE,CACF,CAAC;AACJ,CAAC;AAZD,8BAYC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/file-writer/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./copy-file"), exports);
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/file-writer/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAA4B"}
|
package/dist/internal.d.ts
CHANGED
package/dist/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC"}
|
package/dist/internal.js
CHANGED
|
@@ -15,4 +15,5 @@ __exportStar(require("./compiler"), exports);
|
|
|
15
15
|
__exportStar(require("./readme"), exports);
|
|
16
16
|
__exportStar(require("./reserved-words"), exports);
|
|
17
17
|
__exportStar(require("./util"), exports);
|
|
18
|
+
__exportStar(require("./file-writer"), exports);
|
|
18
19
|
//# sourceMappingURL=internal.js.map
|
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA+B;AAC/B,6CAA2B;AAC3B,2CAAyB;AACzB,mDAAiC;AACjC,yCAAuB"}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA+B;AAC/B,6CAA2B;AAC3B,2CAAyB;AACzB,mDAAiC;AACjC,yCAAuB;AACvB,gDAA8B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-cloud-sdk/generator-common",
|
|
3
|
-
"version": "2.0.0-beta.0+
|
|
3
|
+
"version": "2.0.0-beta.1-20220107172351.0+5aa365c5",
|
|
4
4
|
"description": "SAP Cloud SDK for JavaScript common functions of OData client generator and OpenAPI clint generator.",
|
|
5
5
|
"homepage": "https://sap.github.io/cloud-sdk/docs/js/overview-cloud-sdk-for-javascript",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"check:dependencies": "depcheck ."
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@sap-cloud-sdk/util": "^2.0.0-beta.0+
|
|
35
|
+
"@sap-cloud-sdk/util": "^2.0.0-beta.1-20220107172351.0+5aa365c5",
|
|
36
36
|
"axios": "^0.24.0",
|
|
37
37
|
"fast-levenshtein": "~3.0.0",
|
|
38
38
|
"fs-extra": "^10.0.0",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"mock-fs": "^5.0.0",
|
|
45
45
|
"nock": "^13.0.11"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "5aa365c5b2416abd83a962b6751e7f5c55f3bf17"
|
|
48
48
|
}
|