@ts-dev-tools/core 1.5.6 → 1.5.10
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/package.json +18 -18
- package/CHANGELOG.md +0 -280
- package/dist/bin.d.ts +0 -2
- package/dist/bin.js +0 -82
- package/dist/install/command.d.ts +0 -4
- package/dist/install/command.js +0 -74
- package/dist/install/migrations/20201024173398-init.d.ts +0 -2
- package/dist/install/migrations/20201024173398-init.js +0 -134
- package/dist/services/CmdService.d.ts +0 -3
- package/dist/services/CmdService.js +0 -56
- package/dist/services/DuplicateDependenciesService.d.ts +0 -6
- package/dist/services/DuplicateDependenciesService.js +0 -54
- package/dist/services/GitService.d.ts +0 -7
- package/dist/services/GitService.js +0 -89
- package/dist/services/MigrationsService.d.ts +0 -10
- package/dist/services/MigrationsService.js +0 -132
- package/dist/services/PackageJson.d.ts +0 -28
- package/dist/services/PackageJson.js +0 -95
- package/dist/services/PackageJsonMerge.d.ts +0 -8
- package/dist/services/PackageJsonMerge.js +0 -52
- package/dist/services/PackageManagerService.d.ts +0 -7
- package/dist/services/PackageManagerService.js +0 -22
- package/dist/tests/console.d.ts +0 -3
- package/dist/tests/console.js +0 -18
- package/dist/tests/utils.d.ts +0 -5
- package/dist/tests/utils.js +0 -69
package/dist/tests/utils.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeTestProjectDir = exports.restorePackageJson = exports.getTsDevToolsRootPath = exports.createTestProjectDir = exports.testProjectDir = void 0;
|
|
4
|
-
var fs_1 = require("fs");
|
|
5
|
-
var os_1 = require("os");
|
|
6
|
-
var path_1 = require("path");
|
|
7
|
-
exports.testProjectDir = path_1.resolve("__tests__/test-project");
|
|
8
|
-
var getTestProjectDirPath = function (filename) {
|
|
9
|
-
return path_1.join(os_1.tmpdir(), path_1.basename(filename).split(".")[0]);
|
|
10
|
-
};
|
|
11
|
-
var defaultPackageJsonPath = path_1.join(exports.testProjectDir, "package.json");
|
|
12
|
-
function createTestProjectDir(filename) {
|
|
13
|
-
var testProjectDirPath = getTestProjectDirPath(filename);
|
|
14
|
-
if (fs_1.existsSync(testProjectDirPath)) {
|
|
15
|
-
deleteFolderRecursive(testProjectDirPath);
|
|
16
|
-
}
|
|
17
|
-
fs_1.mkdirSync(testProjectDirPath);
|
|
18
|
-
fs_1.mkdirSync(path_1.join(testProjectDirPath, ".git/hooks"), { recursive: true });
|
|
19
|
-
// Fake node_modules
|
|
20
|
-
var tsDevToolsRootPath = getTsDevToolsRootPath(filename);
|
|
21
|
-
fs_1.mkdirSync(tsDevToolsRootPath, { recursive: true });
|
|
22
|
-
fs_1.copyFileSync(path_1.resolve(__dirname, "../../package.json"), path_1.join(tsDevToolsRootPath, "package.json"));
|
|
23
|
-
// Fake migrations
|
|
24
|
-
var tsDevToolsDistPath = path_1.join(tsDevToolsRootPath, "dist");
|
|
25
|
-
fs_1.symlinkSync(path_1.resolve(__dirname, ".."), tsDevToolsDistPath);
|
|
26
|
-
restorePackageJson(filename);
|
|
27
|
-
return testProjectDirPath;
|
|
28
|
-
}
|
|
29
|
-
exports.createTestProjectDir = createTestProjectDir;
|
|
30
|
-
function getTsDevToolsRootPath(filename) {
|
|
31
|
-
var testProjectDirPath = getTestProjectDirPath(filename);
|
|
32
|
-
if (!fs_1.existsSync(testProjectDirPath)) {
|
|
33
|
-
throw new Error("Test project dir \"" + testProjectDirPath + "\" does not exist");
|
|
34
|
-
}
|
|
35
|
-
return path_1.join(testProjectDirPath, "node_modules/@ts-dev-tools/core");
|
|
36
|
-
}
|
|
37
|
-
exports.getTsDevToolsRootPath = getTsDevToolsRootPath;
|
|
38
|
-
function restorePackageJson(filename) {
|
|
39
|
-
var testProjectDirPath = getTestProjectDirPath(filename);
|
|
40
|
-
if (!fs_1.existsSync(testProjectDirPath)) {
|
|
41
|
-
throw new Error("Test project dir \"" + testProjectDirPath + "\" does not exist");
|
|
42
|
-
}
|
|
43
|
-
fs_1.copyFileSync(defaultPackageJsonPath, path_1.join(testProjectDirPath, "package.json"));
|
|
44
|
-
}
|
|
45
|
-
exports.restorePackageJson = restorePackageJson;
|
|
46
|
-
function removeTestProjectDir(filename) {
|
|
47
|
-
var testProjectDirPath = getTestProjectDirPath(filename);
|
|
48
|
-
if (!fs_1.existsSync(testProjectDirPath)) {
|
|
49
|
-
throw new Error("Test project dir \"" + testProjectDirPath + "\" does not exist");
|
|
50
|
-
}
|
|
51
|
-
deleteFolderRecursive(testProjectDirPath);
|
|
52
|
-
}
|
|
53
|
-
exports.removeTestProjectDir = removeTestProjectDir;
|
|
54
|
-
function deleteFolderRecursive(path) {
|
|
55
|
-
if (fs_1.existsSync(path)) {
|
|
56
|
-
fs_1.readdirSync(path).forEach(function (file) {
|
|
57
|
-
var curPath = path_1.join(path, file);
|
|
58
|
-
if (fs_1.lstatSync(curPath).isDirectory()) {
|
|
59
|
-
// recurse
|
|
60
|
-
deleteFolderRecursive(curPath);
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
// delete file
|
|
64
|
-
fs_1.unlinkSync(curPath);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
fs_1.rmdirSync(path);
|
|
68
|
-
}
|
|
69
|
-
}
|