@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ts-dev-tools/core",
3
- "version": "1.5.6",
3
+ "version": "1.5.10",
4
4
  "description": "TS dev tools Core",
5
5
  "keywords": [
6
6
  "linter",
@@ -41,26 +41,26 @@
41
41
  "url": "https://github.com/escemi-tech/ts-dev-tools/issues"
42
42
  },
43
43
  "dependencies": {
44
- "@commitlint/cli": "^12.1.4",
45
- "@commitlint/config-conventional": "^12.1.4",
46
- "@types/jest": "^26.0.23",
47
- "@types/node": "^16.0.0",
48
- "@typescript-eslint/eslint-plugin": "^4.28.1",
49
- "@typescript-eslint/parser": "^4.28.1",
50
- "eslint": "^7.30.0",
44
+ "@commitlint/cli": "^16.0.2",
45
+ "@commitlint/config-conventional": "^16.0.0",
46
+ "@types/jest": "^27.4.0",
47
+ "@types/node": "^17.0.8",
48
+ "@typescript-eslint/eslint-plugin": "^5.9.1",
49
+ "@typescript-eslint/parser": "^5.9.1",
50
+ "eslint": "^8.6.0",
51
51
  "eslint-config-prettier": "^8.3.0",
52
- "eslint-plugin-import": "^2.23.4",
53
- "eslint-plugin-jest": "^24.3.6",
52
+ "eslint-plugin-import": "^2.25.4",
53
+ "eslint-plugin-jest": "^25.3.4",
54
54
  "eslint-plugin-node": "^11.1.0",
55
- "eslint-plugin-promise": "^5.1.0",
55
+ "eslint-plugin-promise": "^6.0.0",
56
56
  "import-sort-style-module": "^6.0.0",
57
- "jest": "^27.0.6",
58
- "lint-staged": "^11.0.0",
59
- "prettier": "^2.3.2",
57
+ "jest": "^27.4.7",
58
+ "lint-staged": "^12.1.7",
59
+ "prettier": "^2.5.1",
60
60
  "prettier-plugin-import-sort": "^0.0.7",
61
- "pretty-quick": "^3.1.1",
62
- "ts-jest": "^27.0.3",
63
- "typescript": "^4.3.5"
61
+ "pretty-quick": "^3.1.3",
62
+ "ts-jest": "^27.1.2",
63
+ "typescript": "^4.5.4"
64
64
  },
65
65
  "devDependencies": {
66
66
  "pinst": "^2.1.6"
@@ -106,5 +106,5 @@
106
106
  "**/?(*.)+(spec|test).+(ts|tsx|js)"
107
107
  ]
108
108
  },
109
- "gitHead": "1cf6ab5051d5991b7ce72dbbba2faa9edfa2cab9"
109
+ "gitHead": "275f1411aef5f77caf7fdd21f871f94bf9661bba"
110
110
  }
package/CHANGELOG.md DELETED
@@ -1,280 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## 1.5.6 (2021-07-03)
7
-
8
- **Note:** Version bump only for package @ts-dev-tools/core
9
-
10
-
11
-
12
-
13
-
14
- ## 1.5.5 (2021-05-28)
15
-
16
- **Note:** Version bump only for package @ts-dev-tools/core
17
-
18
-
19
-
20
-
21
-
22
- ## 1.5.4 (2021-04-30)
23
-
24
- **Note:** Version bump only for package @ts-dev-tools/core
25
-
26
-
27
-
28
-
29
-
30
- ## 1.5.3 (2021-04-09)
31
-
32
- **Note:** Version bump only for package @ts-dev-tools/core
33
-
34
-
35
-
36
-
37
-
38
- ## 1.5.2 (2021-03-26)
39
-
40
- **Note:** Version bump only for package @ts-dev-tools/core
41
-
42
-
43
-
44
-
45
-
46
- ## 1.5.1 (2021-03-23)
47
-
48
-
49
- ### Bug Fixes
50
-
51
- * **core:** commit-msg hooks wrongly escaped argument ([4e648a8](https://github.com/escemi-tech/ts-dev-tools/commit/4e648a8aaa858b67130871e10f8db2fda345cdc6))
52
-
53
-
54
-
55
-
56
-
57
- # 1.5.0 (2021-03-23)
58
-
59
-
60
- ### Features
61
-
62
- * **core:** remove husky dependency ([00d47b4](https://github.com/escemi-tech/ts-dev-tools/commit/00d47b461f0a0f4e69ce14c5f08ad8fbaeee8896))
63
-
64
-
65
-
66
-
67
-
68
- ## 1.4.10 (2021-03-17)
69
-
70
-
71
- ### Bug Fixes
72
-
73
- * **react:** various issues for first migration ([0d09c44](https://github.com/escemi-tech/ts-dev-tools/commit/0d09c44a8dc144c1ffc2bed7290faf365c34e6a0))
74
-
75
-
76
-
77
-
78
-
79
- ## 1.4.9 (2021-03-12)
80
-
81
- **Note:** Version bump only for package @ts-dev-tools/core
82
-
83
-
84
-
85
-
86
-
87
- ## 1.4.8 (2020-12-26)
88
-
89
- **Note:** Version bump only for package @ts-dev-tools/core
90
-
91
-
92
-
93
-
94
-
95
- ## 1.4.7 (2020-12-18)
96
-
97
- **Note:** Version bump only for package @ts-dev-tools/core
98
-
99
-
100
-
101
-
102
-
103
- ## 1.4.6 (2020-12-18)
104
-
105
- **Note:** Version bump only for package @ts-dev-tools/core
106
-
107
-
108
-
109
-
110
-
111
- ## 1.4.5 (2020-12-11)
112
-
113
- **Note:** Version bump only for package @ts-dev-tools/core
114
-
115
-
116
-
117
-
118
-
119
- ## 1.4.4 (2020-12-04)
120
-
121
- **Note:** Version bump only for package @ts-dev-tools/core
122
-
123
-
124
-
125
-
126
-
127
- ## 1.4.3 (2020-11-27)
128
-
129
- **Note:** Version bump only for package @ts-dev-tools/core
130
-
131
-
132
-
133
-
134
-
135
- ## 1.4.2 (2020-11-24)
136
-
137
- **Note:** Version bump only for package @ts-dev-tools/core
138
-
139
-
140
-
141
-
142
-
143
- ## 1.4.1 (2020-11-19)
144
-
145
- **Note:** Version bump only for package @ts-dev-tools/core
146
-
147
-
148
-
149
-
150
-
151
- # 1.4.0 (2020-11-17)
152
-
153
-
154
- ### Features
155
-
156
- * **desp:** upgrade eslint deps ([8c730f5](https://github.com/escemi-tech/ts-dev-tools/commit/8c730f5baa8944a2eb2c542a3b02253c989cce61))
157
-
158
-
159
-
160
-
161
-
162
- ## 1.3.7 (2020-11-13)
163
-
164
- **Note:** Version bump only for package @ts-dev-tools/core
165
-
166
-
167
-
168
-
169
-
170
- ## 1.3.6 (2020-11-13)
171
-
172
-
173
- ### Bug Fixes
174
-
175
- * **react:** add missing dependency for @testing-library/react-hooks ([f94882a](https://github.com/escemi-tech/ts-dev-tools/commit/f94882a34c79f789fcef5ee2ec42c8399c7acd21))
176
-
177
-
178
-
179
-
180
-
181
- ## 1.3.5 (2020-11-12)
182
-
183
- **Note:** Version bump only for package @ts-dev-tools/core
184
-
185
-
186
-
187
-
188
-
189
- ## 1.3.4 (2020-11-11)
190
-
191
- **Note:** Version bump only for package @ts-dev-tools/core
192
-
193
-
194
-
195
-
196
-
197
- ## 1.3.3 (2020-11-11)
198
-
199
-
200
- ### Bug Fixes
201
-
202
- * typescript build config ignore dist dir ([993bbb8](https://github.com/escemi-tech/ts-dev-tools/commit/993bbb8b45c8e234d6964aaead5d0ce0eac8901d))
203
-
204
-
205
-
206
-
207
-
208
- ## 1.3.2 (2020-11-11)
209
-
210
- **Note:** Version bump only for package @ts-dev-tools/core
211
-
212
-
213
-
214
-
215
-
216
- ## 1.3.1 (2020-11-11)
217
-
218
-
219
- ### Bug Fixes
220
-
221
- * **core:** use itself ([fe9fd79](https://github.com/escemi-tech/ts-dev-tools/commit/fe9fd790270d09500a8197c1ae2204492b46aa68))
222
-
223
-
224
-
225
-
226
-
227
- # 1.3.0 (2020-11-09)
228
-
229
-
230
- ### Features
231
-
232
- * add test tools ([a73a3fb](https://github.com/escemi-tech/ts-dev-tools/commit/a73a3fb1a1e7f1ed982356f8d02984d9a09d1f2b))
233
-
234
-
235
-
236
-
237
-
238
- # 1.2.0 (2020-11-09)
239
-
240
-
241
- ### Features
242
-
243
- * prepare for plugin installation ([ab7d4e6](https://github.com/escemi-tech/ts-dev-tools/commit/ab7d4e6203631907c3a0e86255f6866a8a0c7c2a))
244
-
245
-
246
-
247
-
248
-
249
- ## 1.1.3 (2020-11-09)
250
-
251
- **Note:** Version bump only for package @ts-dev-tools/core
252
-
253
-
254
-
255
-
256
-
257
- ## 1.1.2 (2020-11-09)
258
-
259
-
260
- ### Bug Fixes
261
-
262
- * install script ([7bf8a4e](https://github.com/escemi-tech/ts-dev-tools/commit/7bf8a4ed404ba4d18fd9fc75c9753dabe27fdd36))
263
-
264
-
265
-
266
-
267
-
268
- ## 1.1.1 (2020-10-29)
269
-
270
- **Note:** Version bump only for package @ts-dev-tools/core
271
-
272
-
273
-
274
-
275
-
276
- # 1.1.0 (2020-10-29)
277
-
278
- ### Features
279
-
280
- - initialize project ([47760c4](https://github.com/escemi-tech/ts-dev-tools/commit/47760c49ad7823b019cc2e7ae8c06b8f54639b1c))
package/dist/bin.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
package/dist/bin.js DELETED
@@ -1,82 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
- return new (P || (P = Promise))(function (resolve, reject) {
6
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
- step((generator = generator.apply(thisArg, _arguments || [])).next());
10
- });
11
- };
12
- var __generator = (this && this.__generator) || function (thisArg, body) {
13
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
14
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
15
- function verb(n) { return function (v) { return step([n, v]); }; }
16
- function step(op) {
17
- if (f) throw new TypeError("Generator is already executing.");
18
- while (_) try {
19
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
20
- if (y = 0, t) op = [op[0] & 2, t.value];
21
- switch (op[0]) {
22
- case 0: case 1: t = op; break;
23
- case 4: _.label++; return { value: op[1], done: false };
24
- case 5: _.label++; y = op[1]; op = [0]; continue;
25
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
26
- default:
27
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
28
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
29
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
30
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
31
- if (t[2]) _.ops.pop();
32
- _.trys.pop(); continue;
33
- }
34
- op = body.call(thisArg, _);
35
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
36
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
37
- }
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- var path_1 = require("path");
41
- var command_1 = require("./install/command");
42
- var PackageJson_1 = require("./services/PackageJson");
43
- function bin() {
44
- return __awaiter(this, void 0, void 0, function () {
45
- var _a, arg, params, _b;
46
- return __generator(this, function (_c) {
47
- switch (_c.label) {
48
- case 0:
49
- _a = process.argv, arg = _a[2], params = _a.slice(3);
50
- _b = true;
51
- switch (_b) {
52
- case arg === "install": return [3 /*break*/, 1];
53
- case ["--version", "-v"].includes(arg): return [3 /*break*/, 3];
54
- }
55
- return [3 /*break*/, 4];
56
- case 1:
57
- // Check if script is not run by the package himself
58
- if (process.cwd() === path_1.dirname(__dirname)) {
59
- console.info("Do not install itself!");
60
- return [3 /*break*/, 5];
61
- }
62
- return [4 /*yield*/, command_1.install({
63
- cwd: process.cwd(),
64
- dir: params[0],
65
- })];
66
- case 2:
67
- _c.sent();
68
- return [3 /*break*/, 5];
69
- case 3:
70
- console.info(PackageJson_1.PackageJson.fromDirPath(path_1.join(__dirname, "..")).getPackageVersion());
71
- return [3 /*break*/, 5];
72
- case 4:
73
- console.info("Usage\n ts-dev-tools install [path from project root]\n ");
74
- _c.label = 5;
75
- case 5: return [2 /*return*/];
76
- }
77
- });
78
- });
79
- }
80
- bin()
81
- .then()
82
- .catch(function (error) { return console.error(error); });
@@ -1,4 +0,0 @@
1
- export declare function install({ cwd, dir }: {
2
- cwd: string;
3
- dir: string;
4
- }): Promise<void>;
@@ -1,74 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.install = void 0;
40
- var path_1 = require("path");
41
- var DuplicateDependenciesService_1 = require("../services/DuplicateDependenciesService");
42
- var MigrationsService_1 = require("../services/MigrationsService");
43
- var PackageJson_1 = require("../services/PackageJson");
44
- function install(_a) {
45
- var cwd = _a.cwd, _b = _a.dir, dir = _b === void 0 ? "." : _b;
46
- return __awaiter(this, void 0, void 0, function () {
47
- var tsDevToolsRootPath, packageName, absoluteProjectDir, currentVersion;
48
- return __generator(this, function (_c) {
49
- switch (_c.label) {
50
- case 0:
51
- tsDevToolsRootPath = path_1.resolve(__dirname, "../..");
52
- packageName = PackageJson_1.PackageJson.fromDirPath(tsDevToolsRootPath).getPackageName();
53
- absoluteProjectDir = path_1.resolve(cwd, dir);
54
- if (!absoluteProjectDir.startsWith(cwd)) {
55
- throw new Error(".. not allowed");
56
- }
57
- currentVersion = PackageJson_1.PackageJson.fromDirPath(absoluteProjectDir).getTsDevToolsVersion();
58
- if (currentVersion) {
59
- console.info("Updating " + packageName + " installation...");
60
- }
61
- else {
62
- console.info("Installing " + packageName + "...");
63
- }
64
- return [4 /*yield*/, MigrationsService_1.MigrationsService.executeMigrations(tsDevToolsRootPath, absoluteProjectDir, currentVersion)];
65
- case 1:
66
- _c.sent();
67
- DuplicateDependenciesService_1.DuplicateDependenciesService.duplicateDependencies(tsDevToolsRootPath, absoluteProjectDir);
68
- console.info("Installation done!");
69
- return [2 /*return*/];
70
- }
71
- });
72
- });
73
- }
74
- exports.install = install;
@@ -1,2 +0,0 @@
1
- import { MigrationUpFunction } from "../../services/MigrationsService";
2
- export declare const up: MigrationUpFunction;
@@ -1,134 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.up = void 0;
40
- var GitService_1 = require("../../services/GitService");
41
- var PackageJson_1 = require("../../services/PackageJson");
42
- var PackageManagerService_1 = require("../../services/PackageManagerService");
43
- var up = function (absoluteProjectDir) { return __awaiter(void 0, void 0, void 0, function () {
44
- var jest, eslintConfig, prettier, commitlint, lintStaged, importSort, scripts, packageJson, isGitRepository, packageManager, gitHooks, _i, _a, gitHookName, gitHookCommand;
45
- return __generator(this, function (_b) {
46
- switch (_b.label) {
47
- case 0:
48
- jest = {
49
- preset: "ts-jest",
50
- testEnvironment: "node",
51
- testMatch: ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).+(ts|tsx|js)"],
52
- };
53
- eslintConfig = {
54
- root: true,
55
- parser: "@typescript-eslint/parser",
56
- plugins: ["@typescript-eslint", "jest"],
57
- extends: [
58
- "eslint:recommended",
59
- "plugin:@typescript-eslint/recommended",
60
- "plugin:jest/recommended",
61
- "prettier",
62
- ],
63
- env: {
64
- es2021: true,
65
- },
66
- parserOptions: {
67
- ecmaFeatures: {
68
- jsx: true,
69
- },
70
- ecmaVersion: 12,
71
- sourceType: "module",
72
- },
73
- };
74
- prettier = {
75
- semi: true,
76
- printWidth: 100,
77
- trailingComma: "es5",
78
- };
79
- commitlint = {
80
- extends: ["@commitlint/config-conventional"],
81
- };
82
- lintStaged = {
83
- "*.{js,ts,tsx}": ["eslint --fix"],
84
- };
85
- importSort = {
86
- ".js, .jsx, .ts, .tsx": {
87
- style: "module",
88
- parser: "typescript",
89
- },
90
- };
91
- scripts = {
92
- build: "tsc --noEmit",
93
- test: "jest",
94
- lint: 'eslint "src/**/*.{ts,tsx}"',
95
- prepare: "ts-dev-tools install",
96
- };
97
- packageJson = PackageJson_1.PackageJson.fromDirPath(absoluteProjectDir);
98
- packageJson.merge({
99
- eslintConfig: eslintConfig,
100
- prettier: prettier,
101
- commitlint: commitlint,
102
- "lint-staged": lintStaged,
103
- importSort: importSort,
104
- scripts: scripts,
105
- jest: jest,
106
- });
107
- return [4 /*yield*/, GitService_1.GitService.isGitRepository(absoluteProjectDir)];
108
- case 1:
109
- isGitRepository = _b.sent();
110
- if (!isGitRepository) return [3 /*break*/, 5];
111
- packageManager = PackageManagerService_1.PackageManagerService.detectPackageManager(absoluteProjectDir);
112
- gitHooks = {
113
- "pre-commit": "npx --no-install lint-staged && npx --no-install pretty-quick --staged",
114
- "commit-msg": "npx --no-install commitlint --edit $1",
115
- "pre-push": packageManager + " run lint && " + packageManager + " run build && " + packageManager + " run test",
116
- };
117
- _i = 0, _a = Object.keys(gitHooks);
118
- _b.label = 2;
119
- case 2:
120
- if (!(_i < _a.length)) return [3 /*break*/, 5];
121
- gitHookName = _a[_i];
122
- gitHookCommand = gitHooks[gitHookName];
123
- return [4 /*yield*/, GitService_1.GitService.addGitHook(absoluteProjectDir, gitHookName, gitHookCommand)];
124
- case 3:
125
- _b.sent();
126
- _b.label = 4;
127
- case 4:
128
- _i++;
129
- return [3 /*break*/, 2];
130
- case 5: return [2 /*return*/];
131
- }
132
- });
133
- }); };
134
- exports.up = up;
@@ -1,3 +0,0 @@
1
- export declare class CmdService {
2
- static execCmd(args: string | string[], cwd?: string, silent?: boolean): Promise<string>;
3
- }