@teambit/doctor 0.0.1
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/core-diagnoses/broken-symlink-files.ts +78 -0
- package/core-diagnoses/orphan-symlink-objects.ts +51 -0
- package/core-diagnoses/validate-bit-version.ts +56 -0
- package/core-diagnoses/validate-git-exec.ts +38 -0
- package/core-diagnoses/validate-npm-exec.ts +40 -0
- package/core-diagnoses/validate-workspace-bit-json-syntax.ts +35 -0
- package/core-diagnoses/validate-yarn-exec.ts +40 -0
- package/diagnosis-list-template.ts +28 -0
- package/diagnosis.ts +81 -0
- package/dist/core-diagnoses/broken-symlink-files.d.ts +15 -0
- package/dist/core-diagnoses/broken-symlink-files.js +127 -0
- package/dist/core-diagnoses/broken-symlink-files.js.map +1 -0
- package/dist/core-diagnoses/orphan-symlink-objects.d.ts +10 -0
- package/dist/core-diagnoses/orphan-symlink-objects.js +84 -0
- package/dist/core-diagnoses/orphan-symlink-objects.js.map +1 -0
- package/dist/core-diagnoses/validate-bit-version.d.ts +9 -0
- package/dist/core-diagnoses/validate-bit-version.js +94 -0
- package/dist/core-diagnoses/validate-bit-version.js.map +1 -0
- package/dist/core-diagnoses/validate-git-exec.d.ts +10 -0
- package/dist/core-diagnoses/validate-git-exec.js +69 -0
- package/dist/core-diagnoses/validate-git-exec.js.map +1 -0
- package/dist/core-diagnoses/validate-npm-exec.d.ts +10 -0
- package/dist/core-diagnoses/validate-npm-exec.js +73 -0
- package/dist/core-diagnoses/validate-npm-exec.js.map +1 -0
- package/dist/core-diagnoses/validate-workspace-bit-json-syntax.d.ts +9 -0
- package/dist/core-diagnoses/validate-workspace-bit-json-syntax.js +67 -0
- package/dist/core-diagnoses/validate-workspace-bit-json-syntax.js.map +1 -0
- package/dist/core-diagnoses/validate-yarn-exec.d.ts +10 -0
- package/dist/core-diagnoses/validate-yarn-exec.js +72 -0
- package/dist/core-diagnoses/validate-yarn-exec.js.map +1 -0
- package/dist/diagnosis-list-template.d.ts +2 -0
- package/dist/diagnosis-list-template.js +42 -0
- package/dist/diagnosis-list-template.js.map +1 -0
- package/dist/diagnosis.d.ts +41 -0
- package/dist/diagnosis.js +74 -0
- package/dist/diagnosis.js.map +1 -0
- package/dist/doctor-cmd.d.ts +21 -0
- package/dist/doctor-cmd.js +125 -0
- package/dist/doctor-cmd.js.map +1 -0
- package/dist/doctor-registrar-builder.d.ts +2 -0
- package/dist/doctor-registrar-builder.js +69 -0
- package/dist/doctor-registrar-builder.js.map +1 -0
- package/dist/doctor-registrar.d.ts +21 -0
- package/dist/doctor-registrar.js +63 -0
- package/dist/doctor-registrar.js.map +1 -0
- package/dist/doctor-results-template.d.ts +2 -0
- package/dist/doctor-results-template.js +115 -0
- package/dist/doctor-results-template.js.map +1 -0
- package/dist/doctor.aspect.d.ts +2 -0
- package/dist/doctor.aspect.js +18 -0
- package/dist/doctor.aspect.js.map +1 -0
- package/dist/doctor.d.ts +31 -0
- package/dist/doctor.js +342 -0
- package/dist/doctor.js.map +1 -0
- package/dist/doctor.main.runtime.d.ts +8 -0
- package/dist/doctor.main.runtime.js +44 -0
- package/dist/doctor.main.runtime.js.map +1 -0
- package/dist/esm.mjs +6 -0
- package/dist/exceptions/diagnosis-not-found.d.ts +5 -0
- package/dist/exceptions/diagnosis-not-found.js +30 -0
- package/dist/exceptions/diagnosis-not-found.js.map +1 -0
- package/dist/exceptions/missing-diagnosis-name.d.ts +4 -0
- package/dist/exceptions/missing-diagnosis-name.js +21 -0
- package/dist/exceptions/missing-diagnosis-name.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -0
- package/dist/preview-1719544843434.js +7 -0
- package/doctor-cmd.ts +97 -0
- package/doctor-registrar-builder.ts +22 -0
- package/doctor-registrar.ts +58 -0
- package/doctor-results-template.ts +105 -0
- package/doctor.aspect.ts +5 -0
- package/doctor.main.runtime.ts +17 -0
- package/doctor.ts +250 -0
- package/esm.mjs +6 -0
- package/exceptions/diagnosis-not-found.ts +8 -0
- package/exceptions/missing-diagnosis-name.ts +7 -0
- package/index.ts +7 -0
- package/package.json +54 -0
- package/tsconfig.json +45 -0
- package/types/asset.d.ts +29 -0
- package/types/style.d.ts +42 -0
package/dist/doctor.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import Diagnosis, { ExamineResult } from './diagnosis';
|
|
2
|
+
export type DoctorMetaData = {
|
|
3
|
+
nodeVersion: string;
|
|
4
|
+
runningTimestamp: number;
|
|
5
|
+
platform: string;
|
|
6
|
+
bitVersion: string;
|
|
7
|
+
npmVersion: string;
|
|
8
|
+
yarnVersion: string;
|
|
9
|
+
userDetails: string;
|
|
10
|
+
};
|
|
11
|
+
export type DoctorRunAllResults = {
|
|
12
|
+
examineResults: ExamineResult[];
|
|
13
|
+
savedFilePath: string | null | undefined;
|
|
14
|
+
metaData: DoctorMetaData;
|
|
15
|
+
};
|
|
16
|
+
export type DoctorRunOneResult = {
|
|
17
|
+
examineResult: ExamineResult;
|
|
18
|
+
savedFilePath: string | null | undefined;
|
|
19
|
+
metaData: DoctorMetaData;
|
|
20
|
+
};
|
|
21
|
+
export type DoctorOptions = {
|
|
22
|
+
diagnosisName?: string;
|
|
23
|
+
filePath?: string;
|
|
24
|
+
archiveWorkspace?: boolean;
|
|
25
|
+
includeNodeModules?: boolean;
|
|
26
|
+
includePublic?: boolean;
|
|
27
|
+
excludeLocalScope?: boolean;
|
|
28
|
+
};
|
|
29
|
+
export default function runAll(options: DoctorOptions): Promise<DoctorRunAllResults>;
|
|
30
|
+
export declare function runOne({ diagnosisName, ...options }: DoctorOptions): Promise<DoctorRunOneResult>;
|
|
31
|
+
export declare function listDiagnoses(): Promise<Diagnosis[]>;
|
package/dist/doctor.js
ADDED
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = runAll;
|
|
7
|
+
exports.listDiagnoses = listDiagnoses;
|
|
8
|
+
exports.runOne = runOne;
|
|
9
|
+
function _fsExtra() {
|
|
10
|
+
const data = _interopRequireDefault(require("fs-extra"));
|
|
11
|
+
_fsExtra = function () {
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
return data;
|
|
15
|
+
}
|
|
16
|
+
function _os() {
|
|
17
|
+
const data = _interopRequireDefault(require("os"));
|
|
18
|
+
_os = function () {
|
|
19
|
+
return data;
|
|
20
|
+
};
|
|
21
|
+
return data;
|
|
22
|
+
}
|
|
23
|
+
function _path() {
|
|
24
|
+
const data = _interopRequireDefault(require("path"));
|
|
25
|
+
_path = function () {
|
|
26
|
+
return data;
|
|
27
|
+
};
|
|
28
|
+
return data;
|
|
29
|
+
}
|
|
30
|
+
function _tarStream() {
|
|
31
|
+
const data = _interopRequireDefault(require("tar-stream"));
|
|
32
|
+
_tarStream = function () {
|
|
33
|
+
return data;
|
|
34
|
+
};
|
|
35
|
+
return data;
|
|
36
|
+
}
|
|
37
|
+
function _tarFs() {
|
|
38
|
+
const data = _interopRequireDefault(require("tar-fs"));
|
|
39
|
+
_tarFs = function () {
|
|
40
|
+
return data;
|
|
41
|
+
};
|
|
42
|
+
return data;
|
|
43
|
+
}
|
|
44
|
+
function _bootstrap() {
|
|
45
|
+
const data = require("@teambit/legacy/dist/bootstrap");
|
|
46
|
+
_bootstrap = function () {
|
|
47
|
+
return data;
|
|
48
|
+
};
|
|
49
|
+
return data;
|
|
50
|
+
}
|
|
51
|
+
function _constants() {
|
|
52
|
+
const data = require("@teambit/legacy/dist/constants");
|
|
53
|
+
_constants = function () {
|
|
54
|
+
return data;
|
|
55
|
+
};
|
|
56
|
+
return data;
|
|
57
|
+
}
|
|
58
|
+
function _bitMap() {
|
|
59
|
+
const data = _interopRequireDefault(require("@teambit/legacy/dist/consumer/bit-map"));
|
|
60
|
+
_bitMap = function () {
|
|
61
|
+
return data;
|
|
62
|
+
};
|
|
63
|
+
return data;
|
|
64
|
+
}
|
|
65
|
+
function _workspaceConfig() {
|
|
66
|
+
const data = _interopRequireDefault(require("@teambit/legacy/dist/consumer/config/workspace-config"));
|
|
67
|
+
_workspaceConfig = function () {
|
|
68
|
+
return data;
|
|
69
|
+
};
|
|
70
|
+
return data;
|
|
71
|
+
}
|
|
72
|
+
function _consumerLocator() {
|
|
73
|
+
const data = require("@teambit/legacy/dist/consumer/consumer-locator");
|
|
74
|
+
_consumerLocator = function () {
|
|
75
|
+
return data;
|
|
76
|
+
};
|
|
77
|
+
return data;
|
|
78
|
+
}
|
|
79
|
+
function _doctorRegistrar() {
|
|
80
|
+
const data = _interopRequireDefault(require("./doctor-registrar"));
|
|
81
|
+
_doctorRegistrar = function () {
|
|
82
|
+
return data;
|
|
83
|
+
};
|
|
84
|
+
return data;
|
|
85
|
+
}
|
|
86
|
+
function _doctorRegistrarBuilder() {
|
|
87
|
+
const data = _interopRequireDefault(require("./doctor-registrar-builder"));
|
|
88
|
+
_doctorRegistrarBuilder = function () {
|
|
89
|
+
return data;
|
|
90
|
+
};
|
|
91
|
+
return data;
|
|
92
|
+
}
|
|
93
|
+
function _logger() {
|
|
94
|
+
const data = _interopRequireDefault(require("@teambit/legacy/dist/logger/logger"));
|
|
95
|
+
_logger = function () {
|
|
96
|
+
return data;
|
|
97
|
+
};
|
|
98
|
+
return data;
|
|
99
|
+
}
|
|
100
|
+
function _utils() {
|
|
101
|
+
const data = require("@teambit/legacy/dist/utils");
|
|
102
|
+
_utils = function () {
|
|
103
|
+
return data;
|
|
104
|
+
};
|
|
105
|
+
return data;
|
|
106
|
+
}
|
|
107
|
+
function _scopeModules() {
|
|
108
|
+
const data = require("@teambit/scope.modules.find-scope-path");
|
|
109
|
+
_scopeModules = function () {
|
|
110
|
+
return data;
|
|
111
|
+
};
|
|
112
|
+
return data;
|
|
113
|
+
}
|
|
114
|
+
function globalConfig() {
|
|
115
|
+
const data = _interopRequireWildcard(require("@teambit/legacy/dist/api/consumer/lib/global-config"));
|
|
116
|
+
globalConfig = function () {
|
|
117
|
+
return data;
|
|
118
|
+
};
|
|
119
|
+
return data;
|
|
120
|
+
}
|
|
121
|
+
function _validateNpmExec() {
|
|
122
|
+
const data = require("./core-diagnoses/validate-npm-exec");
|
|
123
|
+
_validateNpmExec = function () {
|
|
124
|
+
return data;
|
|
125
|
+
};
|
|
126
|
+
return data;
|
|
127
|
+
}
|
|
128
|
+
function _validateYarnExec() {
|
|
129
|
+
const data = require("./core-diagnoses/validate-yarn-exec");
|
|
130
|
+
_validateYarnExec = function () {
|
|
131
|
+
return data;
|
|
132
|
+
};
|
|
133
|
+
return data;
|
|
134
|
+
}
|
|
135
|
+
function _diagnosisNotFound() {
|
|
136
|
+
const data = require("./exceptions/diagnosis-not-found");
|
|
137
|
+
_diagnosisNotFound = function () {
|
|
138
|
+
return data;
|
|
139
|
+
};
|
|
140
|
+
return data;
|
|
141
|
+
}
|
|
142
|
+
function _missingDiagnosisName() {
|
|
143
|
+
const data = require("./exceptions/missing-diagnosis-name");
|
|
144
|
+
_missingDiagnosisName = function () {
|
|
145
|
+
return data;
|
|
146
|
+
};
|
|
147
|
+
return data;
|
|
148
|
+
}
|
|
149
|
+
const _excluded = ["diagnosisName"]; // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
|
150
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
151
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
152
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
153
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
154
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
155
|
+
// run specific check
|
|
156
|
+
|
|
157
|
+
let runningTimeStamp;
|
|
158
|
+
async function runAll(options) {
|
|
159
|
+
(0, _doctorRegistrarBuilder().default)();
|
|
160
|
+
runningTimeStamp = _getTimeStamp();
|
|
161
|
+
const doctorRegistrar = _doctorRegistrar().default.getInstance();
|
|
162
|
+
const examineP = doctorRegistrar.diagnoses.map(diagnosis => diagnosis.examine());
|
|
163
|
+
const examineResults = await Promise.all(examineP);
|
|
164
|
+
const envMeta = await _getEnvMeta();
|
|
165
|
+
const savedFilePath = await _saveExamineResultsToFile(examineResults, envMeta, options);
|
|
166
|
+
return {
|
|
167
|
+
examineResults,
|
|
168
|
+
savedFilePath,
|
|
169
|
+
metaData: envMeta
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
async function runOne(_ref) {
|
|
173
|
+
let {
|
|
174
|
+
diagnosisName
|
|
175
|
+
} = _ref,
|
|
176
|
+
options = _objectWithoutProperties(_ref, _excluded);
|
|
177
|
+
if (!diagnosisName) {
|
|
178
|
+
throw new (_missingDiagnosisName().MissingDiagnosisName)();
|
|
179
|
+
}
|
|
180
|
+
(0, _doctorRegistrarBuilder().default)();
|
|
181
|
+
runningTimeStamp = _getTimeStamp();
|
|
182
|
+
const doctorRegistrar = _doctorRegistrar().default.getInstance();
|
|
183
|
+
const diagnosis = doctorRegistrar.getDiagnosisByName(diagnosisName);
|
|
184
|
+
if (!diagnosis) {
|
|
185
|
+
throw new (_diagnosisNotFound().DiagnosisNotFound)(diagnosisName);
|
|
186
|
+
}
|
|
187
|
+
const examineResult = await diagnosis.examine();
|
|
188
|
+
const envMeta = await _getEnvMeta();
|
|
189
|
+
const savedFilePath = await _saveExamineResultsToFile([examineResult], envMeta, options);
|
|
190
|
+
return {
|
|
191
|
+
examineResult,
|
|
192
|
+
savedFilePath,
|
|
193
|
+
metaData: envMeta
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
async function listDiagnoses() {
|
|
197
|
+
(0, _doctorRegistrarBuilder().default)();
|
|
198
|
+
const doctorRegistrar = _doctorRegistrar().default.getInstance();
|
|
199
|
+
return Promise.resolve(doctorRegistrar.diagnoses);
|
|
200
|
+
}
|
|
201
|
+
async function _saveExamineResultsToFile(examineResults, envMeta, options) {
|
|
202
|
+
if (!options.filePath) {
|
|
203
|
+
return Promise.resolve(undefined);
|
|
204
|
+
}
|
|
205
|
+
const finalFilePath = _calculateFinalFileName(options.filePath);
|
|
206
|
+
const packStream = await _generateExamineResultsTarFile(examineResults, envMeta, finalFilePath, options);
|
|
207
|
+
const yourTarball = _fsExtra().default.createWriteStream(finalFilePath);
|
|
208
|
+
packStream.pipe(yourTarball);
|
|
209
|
+
return new Promise(resolve => {
|
|
210
|
+
yourTarball.on('close', function () {
|
|
211
|
+
_logger().default.info(`wrote a file by bit doctor, file path: ${finalFilePath}`);
|
|
212
|
+
resolve(finalFilePath);
|
|
213
|
+
// fs.stat(finalFilePath, function (err, stats) {
|
|
214
|
+
// if (err) throw err
|
|
215
|
+
// console.log(stats)
|
|
216
|
+
// console.log('Got file info successfully!')
|
|
217
|
+
// })
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
function _calculateFinalFileName(fileName) {
|
|
222
|
+
if (fileName === '.') {
|
|
223
|
+
return _getDefaultFileName();
|
|
224
|
+
}
|
|
225
|
+
let finalFileName = fileName;
|
|
226
|
+
if ((0, _utils().getExt)(fileName) !== 'tar' && (0, _utils().getExt)(fileName) !== 'tar.gz') {
|
|
227
|
+
finalFileName = `${(0, _utils().getWithoutExt)(finalFileName)}.tar`;
|
|
228
|
+
}
|
|
229
|
+
return finalFileName;
|
|
230
|
+
}
|
|
231
|
+
function _getDefaultFileName() {
|
|
232
|
+
const timestamp = runningTimeStamp || _getTimeStamp();
|
|
233
|
+
return `doctor-results-${timestamp}.tar`;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// TODO: move to utils
|
|
237
|
+
function _getTimeStamp() {
|
|
238
|
+
const d = new Date();
|
|
239
|
+
const timestamp = d.getTime();
|
|
240
|
+
return timestamp;
|
|
241
|
+
}
|
|
242
|
+
async function _generateExamineResultsTarFile(examineResults, envMeta, tarFilePath, options) {
|
|
243
|
+
const {
|
|
244
|
+
archiveWorkspace,
|
|
245
|
+
includeNodeModules,
|
|
246
|
+
includePublic,
|
|
247
|
+
excludeLocalScope
|
|
248
|
+
} = options;
|
|
249
|
+
const debugLog = await _getDebugLogAsBuffer();
|
|
250
|
+
const consumerInfo = await _getConsumerInfo();
|
|
251
|
+
let bitmap;
|
|
252
|
+
if (consumerInfo && consumerInfo.path) {
|
|
253
|
+
bitmap = _getBitMap(consumerInfo.path);
|
|
254
|
+
}
|
|
255
|
+
const packExamineResults = async pack => {
|
|
256
|
+
pack.entry({
|
|
257
|
+
name: 'env-meta.json'
|
|
258
|
+
}, JSON.stringify(envMeta, null, 2));
|
|
259
|
+
pack.entry({
|
|
260
|
+
name: 'doc-results.json'
|
|
261
|
+
}, JSON.stringify(examineResults, null, 2));
|
|
262
|
+
if (debugLog) {
|
|
263
|
+
pack.entry({
|
|
264
|
+
name: 'debug.log'
|
|
265
|
+
}, debugLog);
|
|
266
|
+
}
|
|
267
|
+
if (!archiveWorkspace && bitmap) {
|
|
268
|
+
pack.entry({
|
|
269
|
+
name: '.bitmap'
|
|
270
|
+
}, bitmap);
|
|
271
|
+
}
|
|
272
|
+
if (consumerInfo && consumerInfo.hasConsumerConfig) {
|
|
273
|
+
// TODO: support new config as well
|
|
274
|
+
const scopePath = (0, _scopeModules().findScopePath)(consumerInfo.path);
|
|
275
|
+
const config = scopePath ? await _workspaceConfig().default.loadIfExist(consumerInfo.path, scopePath) : undefined;
|
|
276
|
+
const legacyPlainConfig = config === null || config === void 0 ? void 0 : config._legacyPlainObject();
|
|
277
|
+
if (legacyPlainConfig) {
|
|
278
|
+
pack.entry({
|
|
279
|
+
name: 'config.json'
|
|
280
|
+
}, JSON.stringify(legacyPlainConfig, null, 4));
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
pack.finalize();
|
|
284
|
+
return pack;
|
|
285
|
+
};
|
|
286
|
+
if (!archiveWorkspace) {
|
|
287
|
+
const pack = _tarStream().default.pack(); // pack is a streams2 stream
|
|
288
|
+
return packExamineResults(pack);
|
|
289
|
+
}
|
|
290
|
+
const ignore = fileName => {
|
|
291
|
+
if (fileName === tarFilePath) return true;
|
|
292
|
+
if (fileName === '.DS_Store') return true;
|
|
293
|
+
if (!includeNodeModules && (fileName.startsWith(`node_modules${_path().default.sep}`) || fileName.includes(`${_path().default.sep}node_modules${_path().default.sep}`))) return true;
|
|
294
|
+
if (!includePublic && (fileName.startsWith(`public${_path().default.sep}`) || fileName.includes(`${_path().default.sep}public${_path().default.sep}`))) return true;
|
|
295
|
+
const isGit = fileName.startsWith(`.git${_path().default.sep}`);
|
|
296
|
+
const isLocalScope = fileName.startsWith(`.bit${_path().default.sep}`) || fileName.startsWith(`.git${_path().default.sep}bit${_path().default.sep}`);
|
|
297
|
+
if (excludeLocalScope && isLocalScope) return true;
|
|
298
|
+
if (isGit && !isLocalScope) return true;
|
|
299
|
+
return false;
|
|
300
|
+
};
|
|
301
|
+
const myPack = _tarFs().default.pack('.', {
|
|
302
|
+
ignore,
|
|
303
|
+
finalize: false,
|
|
304
|
+
finish: packExamineResults
|
|
305
|
+
});
|
|
306
|
+
return myPack;
|
|
307
|
+
}
|
|
308
|
+
async function _getEnvMeta() {
|
|
309
|
+
const env = {
|
|
310
|
+
nodeVersion: process.version,
|
|
311
|
+
runningTimestamp: runningTimeStamp || _getTimeStamp(),
|
|
312
|
+
platform: _os().default.platform(),
|
|
313
|
+
bitVersion: (0, _bootstrap().getHarmonyVersion)(),
|
|
314
|
+
npmVersion: await (0, _validateNpmExec().getNpmVersion)(),
|
|
315
|
+
yarnVersion: await (0, _validateYarnExec().getYarnVersion)(),
|
|
316
|
+
userDetails: _getUserDetails()
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
|
320
|
+
return env;
|
|
321
|
+
}
|
|
322
|
+
function _getUserDetails() {
|
|
323
|
+
const name = globalConfig().getSync(_constants().CFG_USER_NAME_KEY) || '';
|
|
324
|
+
const email = globalConfig().getSync(_constants().CFG_USER_EMAIL_KEY) || '';
|
|
325
|
+
return `${name}<${email}>`;
|
|
326
|
+
}
|
|
327
|
+
async function _getDebugLogAsBuffer() {
|
|
328
|
+
const exists = await _fsExtra().default.pathExists(_constants().DEBUG_LOG);
|
|
329
|
+
if (!exists) return null;
|
|
330
|
+
const log = await _fsExtra().default.readFile(_constants().DEBUG_LOG, 'utf-8');
|
|
331
|
+
const logWithoutChalk = (0, _utils().removeChalkCharacters)(log);
|
|
332
|
+
return Buffer.from(logWithoutChalk);
|
|
333
|
+
}
|
|
334
|
+
async function _getConsumerInfo() {
|
|
335
|
+
const consumerInfo = await (0, _consumerLocator().getConsumerInfo)(process.cwd());
|
|
336
|
+
return consumerInfo;
|
|
337
|
+
}
|
|
338
|
+
function _getBitMap(workspaceDir) {
|
|
339
|
+
return _bitMap().default.loadRawSync(workspaceDir);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_os","_path","_tarStream","_tarFs","_bootstrap","_constants","_bitMap","_workspaceConfig","_consumerLocator","_doctorRegistrar","_doctorRegistrarBuilder","_logger","_utils","_scopeModules","globalConfig","_interopRequireWildcard","_validateNpmExec","_validateYarnExec","_diagnosisNotFound","_missingDiagnosisName","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_objectWithoutProperties","o","_objectWithoutPropertiesLoose","getOwnPropertySymbols","length","indexOf","propertyIsEnumerable","runningTimeStamp","runAll","options","registerCoreAndExtensionsDiagnoses","_getTimeStamp","doctorRegistrar","DoctorRegistrar","getInstance","examineP","diagnoses","map","diagnosis","examine","examineResults","Promise","all","envMeta","_getEnvMeta","savedFilePath","_saveExamineResultsToFile","metaData","runOne","_ref","diagnosisName","MissingDiagnosisName","getDiagnosisByName","DiagnosisNotFound","examineResult","listDiagnoses","resolve","filePath","undefined","finalFilePath","_calculateFinalFileName","packStream","_generateExamineResultsTarFile","yourTarball","fs","createWriteStream","pipe","on","logger","info","fileName","_getDefaultFileName","finalFileName","getExt","getWithoutExt","timestamp","d","Date","getTime","tarFilePath","archiveWorkspace","includeNodeModules","includePublic","excludeLocalScope","debugLog","_getDebugLogAsBuffer","consumerInfo","_getConsumerInfo","bitmap","path","_getBitMap","packExamineResults","pack","entry","name","JSON","stringify","hasConsumerConfig","scopePath","findScopePath","config","WorkspaceConfig","loadIfExist","legacyPlainConfig","_legacyPlainObject","finalize","tar","ignore","startsWith","sep","includes","isGit","isLocalScope","myPack","tarFS","finish","env","nodeVersion","process","version","runningTimestamp","platform","os","bitVersion","getHarmonyVersion","npmVersion","getNpmVersion","yarnVersion","getYarnVersion","userDetails","_getUserDetails","getSync","CFG_USER_NAME_KEY","email","CFG_USER_EMAIL_KEY","exists","pathExists","DEBUG_LOG","log","readFile","logWithoutChalk","removeChalkCharacters","Buffer","from","getConsumerInfo","cwd","workspaceDir","BitMap","loadRawSync"],"sources":["doctor.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport os from 'os';\n// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\nimport Stream from 'stream';\nimport path from 'path';\nimport tar from 'tar-stream';\nimport tarFS from 'tar-fs';\nimport { getHarmonyVersion } from '@teambit/legacy/dist/bootstrap';\nimport { CFG_USER_EMAIL_KEY, CFG_USER_NAME_KEY, DEBUG_LOG } from '@teambit/legacy/dist/constants';\nimport BitMap from '@teambit/legacy/dist/consumer/bit-map';\nimport WorkspaceConfig from '@teambit/legacy/dist/consumer/config/workspace-config';\nimport { ConsumerInfo, getConsumerInfo } from '@teambit/legacy/dist/consumer/consumer-locator';\nimport Diagnosis, { ExamineResult } from './diagnosis';\nimport DoctorRegistrar from './doctor-registrar';\nimport registerCoreAndExtensionsDiagnoses from './doctor-registrar-builder';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport { getExt, getWithoutExt, removeChalkCharacters } from '@teambit/legacy/dist/utils';\nimport { findScopePath } from '@teambit/scope.modules.find-scope-path';\nimport * as globalConfig from '@teambit/legacy/dist/api/consumer/lib/global-config';\nimport { getNpmVersion } from './core-diagnoses/validate-npm-exec';\nimport { getYarnVersion } from './core-diagnoses/validate-yarn-exec';\nimport { DiagnosisNotFound } from './exceptions/diagnosis-not-found';\nimport { MissingDiagnosisName } from './exceptions/missing-diagnosis-name';\n\n// run specific check\nexport type DoctorMetaData = {\n nodeVersion: string;\n runningTimestamp: number;\n platform: string;\n bitVersion: string;\n npmVersion: string;\n yarnVersion: string;\n userDetails: string;\n};\nexport type DoctorRunAllResults = {\n examineResults: ExamineResult[];\n savedFilePath: string | null | undefined;\n metaData: DoctorMetaData;\n};\nexport type DoctorRunOneResult = {\n examineResult: ExamineResult;\n savedFilePath: string | null | undefined;\n metaData: DoctorMetaData;\n};\n\nlet runningTimeStamp;\n\nexport type DoctorOptions = {\n diagnosisName?: string;\n filePath?: string;\n archiveWorkspace?: boolean;\n includeNodeModules?: boolean;\n includePublic?: boolean;\n excludeLocalScope?: boolean;\n};\n\nexport default async function runAll(options: DoctorOptions): Promise<DoctorRunAllResults> {\n registerCoreAndExtensionsDiagnoses();\n runningTimeStamp = _getTimeStamp();\n const doctorRegistrar = DoctorRegistrar.getInstance();\n const examineP = doctorRegistrar.diagnoses.map((diagnosis) => diagnosis.examine());\n const examineResults = await Promise.all(examineP);\n const envMeta = await _getEnvMeta();\n const savedFilePath = await _saveExamineResultsToFile(examineResults, envMeta, options);\n return { examineResults, savedFilePath, metaData: envMeta };\n}\n\nexport async function runOne({ diagnosisName, ...options }: DoctorOptions): Promise<DoctorRunOneResult> {\n if (!diagnosisName) {\n throw new MissingDiagnosisName();\n }\n registerCoreAndExtensionsDiagnoses();\n runningTimeStamp = _getTimeStamp();\n const doctorRegistrar = DoctorRegistrar.getInstance();\n const diagnosis = doctorRegistrar.getDiagnosisByName(diagnosisName);\n if (!diagnosis) {\n throw new DiagnosisNotFound(diagnosisName);\n }\n const examineResult = await diagnosis.examine();\n const envMeta = await _getEnvMeta();\n const savedFilePath = await _saveExamineResultsToFile([examineResult], envMeta, options);\n return { examineResult, savedFilePath, metaData: envMeta };\n}\n\nexport async function listDiagnoses(): Promise<Diagnosis[]> {\n registerCoreAndExtensionsDiagnoses();\n const doctorRegistrar = DoctorRegistrar.getInstance();\n return Promise.resolve(doctorRegistrar.diagnoses);\n}\n\nasync function _saveExamineResultsToFile(\n examineResults: ExamineResult[],\n envMeta: DoctorMetaData,\n options: DoctorOptions\n): Promise<string | null | undefined> {\n if (!options.filePath) {\n return Promise.resolve(undefined);\n }\n const finalFilePath = _calculateFinalFileName(options.filePath);\n const packStream = await _generateExamineResultsTarFile(examineResults, envMeta, finalFilePath, options);\n\n const yourTarball = fs.createWriteStream(finalFilePath);\n\n packStream.pipe(yourTarball);\n\n return new Promise((resolve) => {\n yourTarball.on('close', function () {\n logger.info(`wrote a file by bit doctor, file path: ${finalFilePath}`);\n resolve(finalFilePath);\n // fs.stat(finalFilePath, function (err, stats) {\n // if (err) throw err\n // console.log(stats)\n // console.log('Got file info successfully!')\n // })\n });\n });\n}\n\nfunction _calculateFinalFileName(fileName: string): string {\n if (fileName === '.') {\n return _getDefaultFileName();\n }\n let finalFileName = fileName;\n if (getExt(fileName) !== 'tar' && getExt(fileName) !== 'tar.gz') {\n finalFileName = `${getWithoutExt(finalFileName)}.tar`;\n }\n return finalFileName;\n}\n\nfunction _getDefaultFileName() {\n const timestamp = runningTimeStamp || _getTimeStamp();\n return `doctor-results-${timestamp}.tar`;\n}\n\n// TODO: move to utils\nfunction _getTimeStamp() {\n const d = new Date();\n const timestamp = d.getTime();\n return timestamp;\n}\n\nasync function _generateExamineResultsTarFile(\n examineResults: ExamineResult[],\n envMeta: DoctorMetaData,\n tarFilePath: string,\n options: DoctorOptions\n): Promise<Stream.Readable> {\n const { archiveWorkspace, includeNodeModules, includePublic, excludeLocalScope } = options;\n const debugLog = await _getDebugLogAsBuffer();\n const consumerInfo = await _getConsumerInfo();\n let bitmap;\n if (consumerInfo && consumerInfo.path) {\n bitmap = _getBitMap(consumerInfo.path);\n }\n\n const packExamineResults = async (pack) => {\n pack.entry({ name: 'env-meta.json' }, JSON.stringify(envMeta, null, 2));\n pack.entry({ name: 'doc-results.json' }, JSON.stringify(examineResults, null, 2));\n if (debugLog) {\n pack.entry({ name: 'debug.log' }, debugLog);\n }\n if (!archiveWorkspace && bitmap) {\n pack.entry({ name: '.bitmap' }, bitmap);\n }\n if (consumerInfo && consumerInfo.hasConsumerConfig) {\n // TODO: support new config as well\n const scopePath = findScopePath(consumerInfo.path);\n const config = scopePath ? await WorkspaceConfig.loadIfExist(consumerInfo.path, scopePath) : undefined;\n const legacyPlainConfig = config?._legacyPlainObject();\n if (legacyPlainConfig) {\n pack.entry({ name: 'config.json' }, JSON.stringify(legacyPlainConfig, null, 4));\n }\n }\n\n pack.finalize();\n\n return pack;\n };\n\n if (!archiveWorkspace) {\n const pack = tar.pack(); // pack is a streams2 stream\n return packExamineResults(pack);\n }\n\n const ignore = (fileName: string) => {\n if (fileName === tarFilePath) return true;\n if (fileName === '.DS_Store') return true;\n if (\n !includeNodeModules &&\n (fileName.startsWith(`node_modules${path.sep}`) || fileName.includes(`${path.sep}node_modules${path.sep}`))\n )\n return true;\n if (\n !includePublic &&\n (fileName.startsWith(`public${path.sep}`) || fileName.includes(`${path.sep}public${path.sep}`))\n )\n return true;\n const isGit = fileName.startsWith(`.git${path.sep}`);\n const isLocalScope = fileName.startsWith(`.bit${path.sep}`) || fileName.startsWith(`.git${path.sep}bit${path.sep}`);\n if (excludeLocalScope && isLocalScope) return true;\n if (isGit && !isLocalScope) return true;\n return false;\n };\n\n const myPack = tarFS.pack('.', {\n ignore,\n finalize: false,\n finish: packExamineResults,\n });\n\n return myPack;\n}\n\nasync function _getEnvMeta(): Promise<DoctorMetaData> {\n const env = {\n nodeVersion: process.version,\n runningTimestamp: runningTimeStamp || _getTimeStamp(),\n platform: os.platform(),\n bitVersion: getHarmonyVersion(),\n npmVersion: await getNpmVersion(),\n yarnVersion: await getYarnVersion(),\n userDetails: _getUserDetails(),\n };\n\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n return env;\n}\n\nfunction _getUserDetails(): string {\n const name = globalConfig.getSync(CFG_USER_NAME_KEY) || '';\n const email = globalConfig.getSync(CFG_USER_EMAIL_KEY) || '';\n return `${name}<${email}>`;\n}\n\nasync function _getDebugLogAsBuffer(): Promise<Buffer | null | undefined> {\n const exists = await fs.pathExists(DEBUG_LOG);\n if (!exists) return null;\n const log = await fs.readFile(DEBUG_LOG, 'utf-8');\n const logWithoutChalk = removeChalkCharacters(log) as string;\n return Buffer.from(logWithoutChalk);\n}\n\nasync function _getConsumerInfo(): Promise<ConsumerInfo | null | undefined> {\n const consumerInfo = await getConsumerInfo(process.cwd());\n return consumerInfo;\n}\n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AAC,CAAC;IACnCC,WAAW,EAAEC,eAAe,CAAC;EAC/B,CAAC;;EAED;EACA,OAAOd,GAAG;AACZ;AAEA,SAASc,eAAeA,CAAA,EAAW;EACjC,MAAMpC,IAAI,GAAGrG,YAAY,CAAD,CAAC,CAAC0I,OAAO,CAACC,8BAAiB,CAAC,IAAI,EAAE;EAC1D,MAAMC,KAAK,GAAG5I,YAAY,CAAD,CAAC,CAAC0I,OAAO,CAACG,+BAAkB,CAAC,IAAI,EAAE;EAC5D,OAAO,GAAGxC,IAAI,IAAIuC,KAAK,GAAG;AAC5B;AAEA,eAAehD,oBAAoBA,CAAA,EAAuC;EACxE,MAAMkD,MAAM,GAAG,MAAMvE,kBAAE,CAACwE,UAAU,CAACC,sBAAS,CAAC;EAC7C,IAAI,CAACF,MAAM,EAAE,OAAO,IAAI;EACxB,MAAMG,GAAG,GAAG,MAAM1E,kBAAE,CAAC2E,QAAQ,CAACF,sBAAS,EAAE,OAAO,CAAC;EACjD,MAAMG,eAAe,GAAG,IAAAC,8BAAqB,EAACH,GAAG,CAAW;EAC5D,OAAOI,MAAM,CAACC,IAAI,CAACH,eAAe,CAAC;AACrC;AAEA,eAAerD,gBAAgBA,CAAA,EAA6C;EAC1E,MAAMD,YAAY,GAAG,MAAM,IAAA0D,kCAAe,EAAC1B,OAAO,CAAC2B,GAAG,CAAC,CAAC,CAAC;EACzD,OAAO3D,YAAY;AACrB;AAEA,SAASI,UAAUA,CAACwD,YAAY,EAA6B;EAC3D,OAAOC,iBAAM,CAACC,WAAW,CAACF,YAAY,CAAC;AACzC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CLIMain } from '@teambit/cli';
|
|
2
|
+
export declare class DoctorMain {
|
|
3
|
+
static slots: never[];
|
|
4
|
+
static dependencies: import("@teambit/harmony").Aspect[];
|
|
5
|
+
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
6
|
+
static provider([cliMain]: [CLIMain]): Promise<DoctorMain>;
|
|
7
|
+
}
|
|
8
|
+
export default DoctorMain;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.DoctorMain = void 0;
|
|
7
|
+
function _cli() {
|
|
8
|
+
const data = require("@teambit/cli");
|
|
9
|
+
_cli = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _doctor() {
|
|
15
|
+
const data = require("./doctor.aspect");
|
|
16
|
+
_doctor = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _doctorCmd() {
|
|
22
|
+
const data = require("./doctor-cmd");
|
|
23
|
+
_doctorCmd = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
29
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
30
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
31
|
+
class DoctorMain {
|
|
32
|
+
static async provider([cliMain]) {
|
|
33
|
+
cliMain.register(new (_doctorCmd().DoctorCmd)());
|
|
34
|
+
return new DoctorMain();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.DoctorMain = DoctorMain;
|
|
38
|
+
_defineProperty(DoctorMain, "slots", []);
|
|
39
|
+
_defineProperty(DoctorMain, "dependencies", [_cli().CLIAspect]);
|
|
40
|
+
_defineProperty(DoctorMain, "runtime", _cli().MainRuntime);
|
|
41
|
+
_doctor().DoctorAspect.addRuntime(DoctorMain);
|
|
42
|
+
var _default = exports.default = DoctorMain;
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=doctor.main.runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_doctor","_doctorCmd","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DoctorMain","provider","cliMain","register","DoctorCmd","exports","CLIAspect","MainRuntime","DoctorAspect","addRuntime","_default","default"],"sources":["doctor.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { DoctorAspect } from './doctor.aspect';\nimport { DoctorCmd } from './doctor-cmd';\n\nexport class DoctorMain {\n static slots = [];\n static dependencies = [CLIAspect];\n static runtime = MainRuntime;\n static async provider([cliMain]: [CLIMain]) {\n cliMain.register(new DoctorCmd());\n return new DoctorMain();\n }\n}\n\nDoctorAspect.addRuntime(DoctorMain);\n\nexport default DoctorMain;\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAyC,SAAAI,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,C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true
|
|
5
|
+
});
|
|
6
|
+
exports.DiagnosisNotFound = void 0;
|
|
7
|
+
function _bitError() {
|
|
8
|
+
const data = require("@teambit/bit-error");
|
|
9
|
+
_bitError = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _chalk() {
|
|
15
|
+
const data = _interopRequireDefault(require("chalk"));
|
|
16
|
+
_chalk = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
|
+
class DiagnosisNotFound extends _bitError().BitError {
|
|
23
|
+
constructor(diagnosisName) {
|
|
24
|
+
super(`error: diagnosis ${_chalk().default.bold(diagnosisName)} not found`);
|
|
25
|
+
this.diagnosisName = diagnosisName;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.DiagnosisNotFound = DiagnosisNotFound;
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=diagnosis-not-found.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_bitError","data","require","_chalk","_interopRequireDefault","e","__esModule","default","DiagnosisNotFound","BitError","constructor","diagnosisName","chalk","bold","exports"],"sources":["diagnosis-not-found.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport chalk from 'chalk';\n\nexport class DiagnosisNotFound extends BitError {\n constructor(public diagnosisName: string) {\n super(`error: diagnosis ${chalk.bold(diagnosisName)} not found`);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnB,MAAMG,iBAAiB,SAASC,oBAAQ,CAAC;EAC9CC,WAAWA,CAAQC,aAAqB,EAAE;IACxC,KAAK,CAAC,oBAAoBC,gBAAK,CAACC,IAAI,CAACF,aAAa,CAAC,YAAY,CAAC;IAAC,KADhDA,aAAqB,GAArBA,aAAqB;EAExC;AACF;AAACG,OAAA,CAAAN,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MissingDiagnosisName = void 0;
|
|
7
|
+
function _bitError() {
|
|
8
|
+
const data = require("@teambit/bit-error");
|
|
9
|
+
_bitError = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
class MissingDiagnosisName extends _bitError().BitError {
|
|
15
|
+
constructor() {
|
|
16
|
+
super('error: please provide a diagnosis name');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.MissingDiagnosisName = MissingDiagnosisName;
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=missing-diagnosis-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_bitError","data","require","MissingDiagnosisName","BitError","constructor","exports"],"sources":["missing-diagnosis-name.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\n\nexport class MissingDiagnosisName extends BitError {\n constructor() {\n super('error: please provide a diagnosis name');\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,oBAAoB,SAASC,oBAAQ,CAAC;EACjDC,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,wCAAwC,CAAC;EACjD;AACF;AAACC,OAAA,CAAAH,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DoctorAspect } from './doctor.aspect';
|
|
2
|
+
export type { DoctorMain } from './doctor.main.runtime';
|
|
3
|
+
export { DiagnosisNotFound } from './exceptions/diagnosis-not-found';
|
|
4
|
+
export { DIAGNOSIS_NAME_VALIDATE_GIT_EXEC } from './core-diagnoses/validate-git-exec';
|
|
5
|
+
export default DoctorAspect;
|
|
6
|
+
export { DoctorAspect };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "DIAGNOSIS_NAME_VALIDATE_GIT_EXEC", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _validateGitExec().DIAGNOSIS_NAME_VALIDATE_GIT_EXEC;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "DiagnosisNotFound", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _diagnosisNotFound().DiagnosisNotFound;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "DoctorAspect", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _doctor().DoctorAspect;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
exports.default = void 0;
|
|
25
|
+
function _doctor() {
|
|
26
|
+
const data = require("./doctor.aspect");
|
|
27
|
+
_doctor = function () {
|
|
28
|
+
return data;
|
|
29
|
+
};
|
|
30
|
+
return data;
|
|
31
|
+
}
|
|
32
|
+
function _diagnosisNotFound() {
|
|
33
|
+
const data = require("./exceptions/diagnosis-not-found");
|
|
34
|
+
_diagnosisNotFound = function () {
|
|
35
|
+
return data;
|
|
36
|
+
};
|
|
37
|
+
return data;
|
|
38
|
+
}
|
|
39
|
+
function _validateGitExec() {
|
|
40
|
+
const data = require("./core-diagnoses/validate-git-exec");
|
|
41
|
+
_validateGitExec = function () {
|
|
42
|
+
return data;
|
|
43
|
+
};
|
|
44
|
+
return data;
|
|
45
|
+
}
|
|
46
|
+
var _default = exports.default = _doctor().DoctorAspect;
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_doctor","data","require","_diagnosisNotFound","_validateGitExec","_default","exports","default","DoctorAspect"],"sources":["index.ts"],"sourcesContent":["import { DoctorAspect } from './doctor.aspect';\n\nexport type { DoctorMain } from './doctor.main.runtime';\nexport { DiagnosisNotFound } from './exceptions/diagnosis-not-found';\nexport { DIAGNOSIS_NAME_VALIDATE_GIT_EXEC } from './core-diagnoses/validate-git-exec';\nexport default DoctorAspect;\nexport { DoctorAspect };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,iBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,gBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsF,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACvEC,sBAAY","ignoreList":[]}
|