@teambit/semantics.entities.semantic-schema
Advanced tools
Comparing version 0.0.14 to 0.0.15
import { Transform, plainToInstance } from 'class-transformer'; | ||
import chalk from 'chalk'; | ||
import { ComponentID } from '@teambit/component-id'; | ||
import { | ||
@@ -20,5 +21,8 @@ ClassSchema, | ||
constructor(readonly location: Location, module: Module) { | ||
readonly componentId: ComponentID; | ||
constructor(readonly location: Location, module: Module, componentId: ComponentID) { | ||
super(); | ||
this.module = module; | ||
this.componentId = componentId; | ||
} | ||
@@ -35,2 +39,3 @@ | ||
toStringPerType() { | ||
const title = chalk.inverse(`API Schema of ${this.componentId.toString()}\n`); | ||
const getSection = (ClassObj, sectionName: string) => { | ||
@@ -46,2 +51,3 @@ const objects = this.module.exports.filter((exp) => exp instanceof ClassObj); | ||
return ( | ||
title + | ||
getSection(Module, 'Namespaces') + | ||
@@ -48,0 +54,0 @@ getSection(ClassSchema, 'Classes') + |
@@ -0,1 +1,2 @@ | ||
import { ComponentID } from '@teambit/component-id'; | ||
import { Module } from './schemas'; | ||
@@ -6,3 +7,4 @@ import { Location, SchemaNode } from './schema-node'; | ||
readonly module: Module; | ||
constructor(location: Location, module: Module); | ||
readonly componentId: ComponentID; | ||
constructor(location: Location, module: Module, componentId: ComponentID); | ||
toString(): string; | ||
@@ -9,0 +11,0 @@ toStringPerType(): string; |
@@ -19,6 +19,7 @@ "use strict"; | ||
class APISchema extends schema_node_1.SchemaNode { | ||
constructor(location, module) { | ||
constructor(location, module, componentId) { | ||
super(); | ||
this.location = location; | ||
this.module = module; | ||
this.componentId = componentId; | ||
} | ||
@@ -29,2 +30,3 @@ toString() { | ||
toStringPerType() { | ||
const title = chalk_1.default.inverse(`API Schema of ${this.componentId.toString()}\n`); | ||
const getSection = (ClassObj, sectionName) => { | ||
@@ -37,3 +39,4 @@ const objects = this.module.exports.filter((exp) => exp instanceof ClassObj); | ||
}; | ||
return (getSection(schemas_1.Module, 'Namespaces') + | ||
return (title + | ||
getSection(schemas_1.Module, 'Namespaces') + | ||
getSection(schemas_1.ClassSchema, 'Classes') + | ||
@@ -40,0 +43,0 @@ getSection(schemas_1.InterfaceSchema, 'Interfaces') + |
{ | ||
"name": "@teambit/semantics.entities.semantic-schema", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"homepage": "https://bit.dev/teambit/semantics/entities/semantic-schema", | ||
@@ -9,3 +9,3 @@ "main": "dist/index.js", | ||
"name": "entities/semantic-schema", | ||
"version": "0.0.14" | ||
"version": "0.0.15" | ||
}, | ||
@@ -16,3 +16,4 @@ "dependencies": { | ||
"json-schema": "0.4.0", | ||
"lodash": "4.17.21" | ||
"lodash": "4.17.21", | ||
"@teambit/component-id": "0.0.402" | ||
}, | ||
@@ -19,0 +20,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
153009
2488
5
+ Added@teambit/bit-error@0.0.394(transitive)
+ Added@teambit/component-id@0.0.402(transitive)
+ Added@teambit/component-version@0.0.395(transitive)
+ Added@teambit/legacy-bit-id@0.0.399(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addedlru-cache@6.0.0(transitive)
+ Addedsemver@7.3.4(transitive)
+ Addedyallist@4.0.0(transitive)