@teambit/diagnostic 1.0.108 → 1.0.109
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/artifacts/preview/teambit_harmony_diagnostic-preview.js +1 -0
- package/package.json +6 -6
- package/diagnostic.aspect.ts +0 -5
- package/diagnostic.graphql.ts +0 -22
- package/diagnostic.main.runtime.ts +0 -58
- package/diagnostic.route.ts +0 -17
- package/diagnostic.ts +0 -5
- package/index.ts +0 -5
- /package/dist/{preview-1703647408454.js → preview-1703698405864.js} +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports["teambit.harmony/diagnostic-preview"]=o():e["teambit.harmony/diagnostic-preview"]=o()}(self,(()=>(()=>{"use strict";var e={d:(o,t)=>{for(var r in t)e.o(t,r)&&!e.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:t[r]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{compositions:()=>t,compositions_metadata:()=>i,overview:()=>r});const t=[],r=[],i={compositions:[]};return o})()));
|
package/package.json
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/diagnostic",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.109",
|
4
4
|
"homepage": "https://bit.cloud/teambit/harmony/diagnostic",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.harmony",
|
8
8
|
"name": "diagnostic",
|
9
|
-
"version": "1.0.
|
9
|
+
"version": "1.0.109"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"graphql-tag": "2.12.1",
|
13
13
|
"@teambit/harmony": "0.4.6",
|
14
|
-
"@teambit/graphql": "1.0.
|
15
|
-
"@teambit/cli": "0.0.
|
16
|
-
"@teambit/express": "0.0.
|
14
|
+
"@teambit/graphql": "1.0.109",
|
15
|
+
"@teambit/cli": "0.0.841",
|
16
|
+
"@teambit/express": "0.0.940"
|
17
17
|
},
|
18
18
|
"devDependencies": {
|
19
19
|
"@types/mocha": "9.1.0",
|
20
20
|
"@types/jest": "^29.2.2",
|
21
21
|
"@types/testing-library__jest-dom": "^5.9.5",
|
22
|
-
"@teambit/harmony.envs.core-aspect-env": "0.0.
|
22
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.14"
|
23
23
|
},
|
24
24
|
"peerDependencies": {
|
25
25
|
"@teambit/legacy": "1.0.624"
|
package/diagnostic.aspect.ts
DELETED
package/diagnostic.graphql.ts
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
import { Schema } from '@teambit/graphql';
|
2
|
-
import { gql } from 'graphql-tag';
|
3
|
-
import { DiagnosticMain } from './diagnostic.main.runtime';
|
4
|
-
|
5
|
-
export class DiagnosticGraphql implements Schema {
|
6
|
-
constructor(private diagnosticMain: DiagnosticMain) {}
|
7
|
-
|
8
|
-
typeDefs = gql`
|
9
|
-
scalar JSONObject
|
10
|
-
|
11
|
-
type Query {
|
12
|
-
_diagnostic: JSONObject
|
13
|
-
}
|
14
|
-
`;
|
15
|
-
resolvers = {
|
16
|
-
Query: {
|
17
|
-
_diagnostic: () => {
|
18
|
-
return this.diagnosticMain.getDiagnosticData();
|
19
|
-
},
|
20
|
-
},
|
21
|
-
};
|
22
|
-
}
|
@@ -1,58 +0,0 @@
|
|
1
|
-
import { getHarmonyVersion } from '@teambit/legacy/dist/bootstrap';
|
2
|
-
|
3
|
-
import { Slot, SlotRegistry } from '@teambit/harmony';
|
4
|
-
import { MainRuntime } from '@teambit/cli';
|
5
|
-
import { ExpressAspect, ExpressMain } from '@teambit/express';
|
6
|
-
import GraphqlAspect, { GraphqlMain } from '@teambit/graphql';
|
7
|
-
import { DiagnosticAspect } from './diagnostic.aspect';
|
8
|
-
import { DiagnosticRoute } from './diagnostic.route';
|
9
|
-
import { DiagnosticGraphql } from './diagnostic.graphql';
|
10
|
-
import { Diagnostic } from './diagnostic';
|
11
|
-
|
12
|
-
export type DiagnosticSlot = SlotRegistry<Diagnostic[]>;
|
13
|
-
|
14
|
-
export class DiagnosticMain {
|
15
|
-
constructor(
|
16
|
-
/** the diagnostic entity slot */
|
17
|
-
private diagnosticSlot: DiagnosticSlot
|
18
|
-
) {}
|
19
|
-
static slots = [Slot.withType<Diagnostic[]>()];
|
20
|
-
static dependencies = [ExpressAspect, GraphqlAspect];
|
21
|
-
static runtime = MainRuntime;
|
22
|
-
|
23
|
-
register(...diagnostic: Diagnostic[]) {
|
24
|
-
this.diagnosticSlot.register(diagnostic);
|
25
|
-
}
|
26
|
-
|
27
|
-
getDiagnosticData() {
|
28
|
-
const slots = this.diagnosticSlot.toArray();
|
29
|
-
return slots.reduce((prev, cSlot) => {
|
30
|
-
const [aspectId, diagnostic] = cSlot;
|
31
|
-
prev[aspectId] = { reports: [] };
|
32
|
-
diagnostic.forEach((diag) => {
|
33
|
-
const { diagnosticFn } = diag;
|
34
|
-
prev[aspectId].reports.push(diagnosticFn());
|
35
|
-
});
|
36
|
-
return prev;
|
37
|
-
}, {});
|
38
|
-
}
|
39
|
-
|
40
|
-
static getBitVersion() {
|
41
|
-
const version = getHarmonyVersion(true);
|
42
|
-
return { version };
|
43
|
-
}
|
44
|
-
|
45
|
-
static async provider(
|
46
|
-
[express, graphql]: [ExpressMain, GraphqlMain],
|
47
|
-
config: any,
|
48
|
-
[diagnosticSlot]: [DiagnosticSlot]
|
49
|
-
) {
|
50
|
-
const diagnosticMain = new DiagnosticMain(diagnosticSlot);
|
51
|
-
diagnosticMain.register({ diagnosticFn: DiagnosticMain.getBitVersion });
|
52
|
-
express.register([new DiagnosticRoute(diagnosticMain)]);
|
53
|
-
graphql.register(new DiagnosticGraphql(diagnosticMain));
|
54
|
-
return diagnosticMain;
|
55
|
-
}
|
56
|
-
}
|
57
|
-
|
58
|
-
DiagnosticAspect.addRuntime(DiagnosticMain);
|
package/diagnostic.route.ts
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
import { Route, Verb, Request, Response } from '@teambit/express';
|
2
|
-
import type { DiagnosticMain } from './diagnostic.main.runtime';
|
3
|
-
|
4
|
-
export class DiagnosticRoute implements Route {
|
5
|
-
constructor(readonly diagnosticMain: DiagnosticMain) {}
|
6
|
-
|
7
|
-
method = 'GET';
|
8
|
-
route = '/_diagnostic';
|
9
|
-
verb = Verb.READ;
|
10
|
-
|
11
|
-
middlewares = [
|
12
|
-
async (req: Request, res: Response) => {
|
13
|
-
const diagnosticData = this.diagnosticMain.getDiagnosticData();
|
14
|
-
res.json(diagnosticData);
|
15
|
-
},
|
16
|
-
];
|
17
|
-
}
|
package/diagnostic.ts
DELETED
package/index.ts
DELETED
File without changes
|