@my-devkit/cli 1.0.12 → 1.0.13
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/clean.js +3 -13
- package/dist/clean.js.map +1 -1
- package/package.json +1 -1
- package/src/clean.ts +2 -13
package/dist/clean.js
CHANGED
|
@@ -40,18 +40,10 @@ var fs = require("fs");
|
|
|
40
40
|
var path = require("path");
|
|
41
41
|
var utils_1 = require("./utils");
|
|
42
42
|
var clean = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
43
|
-
var
|
|
43
|
+
var outDir, baseUrl, cleanDirectory;
|
|
44
44
|
return __generator(this, function (_a) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
utils_1.Logger.debug('clean - readFileSync');
|
|
49
|
-
tsConfig = fs.readFileSync('./tsconfig.json', { encoding: 'utf-8' });
|
|
50
|
-
utils_1.Logger.debug('clean - JSON.parse');
|
|
51
|
-
config = JSON.parse(tsConfig);
|
|
52
|
-
utils_1.Logger.debug('clean - JSON.parse done');
|
|
53
|
-
outDir = config.compilerOptions.outDir.replace('./', '');
|
|
54
|
-
baseUrl = config.compilerOptions.baseUrl;
|
|
45
|
+
outDir = 'dist';
|
|
46
|
+
baseUrl = 'src';
|
|
55
47
|
if (!fs.existsSync(baseUrl) || !fs.lstatSync(baseUrl).isDirectory()) {
|
|
56
48
|
throw new Error("".concat(baseUrl, " is not a directory"));
|
|
57
49
|
}
|
|
@@ -60,7 +52,6 @@ var clean = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
|
60
52
|
return [2 /*return*/];
|
|
61
53
|
}
|
|
62
54
|
cleanDirectory = function (dirPath) {
|
|
63
|
-
utils_1.Logger.debug("cleanDirectory - ".concat(dirPath), 4);
|
|
64
55
|
// Get and read the files in the directory
|
|
65
56
|
var files = fs.readdirSync(dirPath);
|
|
66
57
|
files.forEach(function (file) {
|
|
@@ -95,7 +86,6 @@ var clean = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
|
95
86
|
});
|
|
96
87
|
};
|
|
97
88
|
cleanDirectory(outDir);
|
|
98
|
-
utils_1.Logger.debug("cleanDirectory - done", 3);
|
|
99
89
|
return [2 /*return*/];
|
|
100
90
|
});
|
|
101
91
|
}); };
|
package/dist/clean.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean.js","sourceRoot":"","sources":["../src/clean.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uBAAyB;AACzB,2BAA6B;AAE7B,iCAAiC;AAEjC,IAAM,KAAK,GAAG;;;
|
|
1
|
+
{"version":3,"file":"clean.js","sourceRoot":"","sources":["../src/clean.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uBAAyB;AACzB,2BAA6B;AAE7B,iCAAiC;AAEjC,IAAM,KAAK,GAAG;;;QACJ,MAAM,GAAG,MAAM,CAAC;QAChB,OAAO,GAAG,KAAK,CAAC;QAEtB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;YACjE,MAAM,IAAI,KAAK,CAAC,UAAG,OAAO,wBAAqB,CAAC,CAAC;SACpD;QAED,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;YACxB,cAAM,CAAC,IAAI,CAAC,4BAAqB,MAAM,QAAK,EAAE,CAAC,CAAC,CAAC;YACjD,sBAAO;SACV;QAEK,cAAc,GAAG,UAAC,OAAe;YACnC,0CAA0C;YAC1C,IAAM,KAAK,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YACtC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;gBACd,IAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC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gCACpC,EAAE,CAAC,UAAU,CAAC,OAAO,GAAG,WAAW,CAAC,CAAC;4BAEzC,cAAM,CAAC,IAAI,CAAC,iCAA0B,OAAO,CAAE,EAAE,CAAC,CAAC,CAAC;yBACvD;qBACJ;iBACJ;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;QAEF,cAAc,CAAC,MAAM,CAAC,CAAC;;;KAC1B,CAAC;AAEF,kBAAe,KAAK,CAAC"}
|
package/package.json
CHANGED
package/src/clean.ts
CHANGED
|
@@ -4,17 +4,8 @@ import * as path from 'path';
|
|
|
4
4
|
import { Logger } from './utils';
|
|
5
5
|
|
|
6
6
|
const clean = async () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
Logger.debug('clean - readFileSync');
|
|
12
|
-
const tsConfig = fs.readFileSync('./tsconfig.json', { encoding: 'utf-8' });
|
|
13
|
-
Logger.debug('clean - JSON.parse');
|
|
14
|
-
const config = JSON.parse(tsConfig);
|
|
15
|
-
Logger.debug('clean - JSON.parse done');
|
|
16
|
-
const outDir = config.compilerOptions.outDir.replace('./', '');
|
|
17
|
-
const baseUrl = config.compilerOptions.baseUrl;
|
|
7
|
+
const outDir = 'dist';
|
|
8
|
+
const baseUrl = 'src';
|
|
18
9
|
|
|
19
10
|
if (!fs.existsSync(baseUrl) || !fs.lstatSync(baseUrl).isDirectory()) {
|
|
20
11
|
throw new Error(`${baseUrl} is not a directory`);
|
|
@@ -26,7 +17,6 @@ const clean = async () => {
|
|
|
26
17
|
}
|
|
27
18
|
|
|
28
19
|
const cleanDirectory = (dirPath: string) => {
|
|
29
|
-
Logger.debug(`cleanDirectory - ${dirPath}`, 4);
|
|
30
20
|
// Get and read the files in the directory
|
|
31
21
|
const files = fs.readdirSync(dirPath);
|
|
32
22
|
files.forEach(file => {
|
|
@@ -68,7 +58,6 @@ const clean = async () => {
|
|
|
68
58
|
};
|
|
69
59
|
|
|
70
60
|
cleanDirectory(outDir);
|
|
71
|
-
Logger.debug(`cleanDirectory - done`, 3);
|
|
72
61
|
};
|
|
73
62
|
|
|
74
63
|
export default clean;
|