Skip to content

Commit

Permalink
Updated imports to make use of aliases for all enums
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofVDB1 committed Jan 18, 2024
1 parent 69d3ded commit dff5958
Show file tree
Hide file tree
Showing 28 changed files with 85 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { fetchFileOrUrl, Logger, ServiceIdentifier } from '@oslo-flanders/core';
import { parse } from 'csv-parse';
import { inject, injectable } from 'inversify';
import { StakeholdersConversionServiceConfiguration } from './config/StakeholdersConversionServiceConfiguration';
import { ContributorType } from './enums/ContributorType';
import { context } from './utils/JsonLdContext';
import { ToJsonLdTransformer } from './utils/ToJsonLdTransformer';
import { ContributorType } from '@oslo-converter-stakeholders/enums/ContributorType';

@injectable()
export class StakeholdersConversionService implements IService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { TransformCallback } from 'stream';
import { Transform } from 'stream';
import { ContributorType } from '../enums/ContributorType';
import { ContributorType } from '@oslo-converter-stakeholders/enums/ContributorType';

export class ToJsonLdTransformer extends Transform {
private readonly columnNames = ['Voornaam', 'Naam', 'Affiliatie', 'E-mail', 'Website'];
Expand Down
36 changes: 18 additions & 18 deletions packages/oslo-converter-uml-ea/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import 'reflect-metadata';
export * from './lib/ConverterHandlerService';
export * from './lib/EaUmlConversionService';
export * from './lib/EaUmlConversionServiceRunner';
export * from './lib/UriRegistry';
export * from './lib/OutputHandlerService';
export * from './lib/converter-handlers/AttributeConverterHandler';
export * from './lib/converter-handlers/ElementConverterHandler';
export * from './lib/converter-handlers/PackageConverterHandler';
export * from './lib/converter-handlers/ConnectorConverterHandler';
export * from './lib/config/DependencyInjectionConfig';
export * from './lib/config/EaUmlConverterConfiguration';
export * from './lib/config/EaUmlConverterServiceIdentifier';
export * from './lib/enums/CasingTypes';
export * from './lib/enums/DataTypes';
export * from './lib/enums/TagNames';
export * from './lib/interfaces/ConverterHandler';
export * from './lib/utils/utils';
export * from './lib/output-handlers/JsonLdOutputHandler';
export * from '@oslo-converter-uml-ea/ConverterHandlerService';
export * from '@oslo-converter-uml-ea/EaUmlConversionService';
export * from '@oslo-converter-uml-ea/EaUmlConversionServiceRunner';
export * from '@oslo-converter-uml-ea/UriRegistry';
export * from '@oslo-converter-uml-ea/OutputHandlerService';
export * from '@oslo-converter-uml-ea/converter-handlers/AttributeConverterHandler';
export * from '@oslo-converter-uml-ea/converter-handlers/ElementConverterHandler';
export * from '@oslo-converter-uml-ea/converter-handlers/PackageConverterHandler';
export * from '@oslo-converter-uml-ea/converter-handlers/ConnectorConverterHandler';
export * from '@oslo-converter-uml-ea/config/DependencyInjectionConfig';
export * from '@oslo-converter-uml-ea/config/EaUmlConverterConfiguration';
export * from '@oslo-converter-uml-ea/config/EaUmlConverterServiceIdentifier';
export * from '@oslo-converter-uml-ea/enums/CasingTypes';
export * from '@oslo-converter-uml-ea/enums/DataTypes';
export * from '@oslo-converter-uml-ea/enums/TagNames';
export * from '@oslo-converter-uml-ea/interfaces/ConverterHandler';
export * from '@oslo-converter-uml-ea/utils/utils';
export * from '@oslo-converter-uml-ea/output-handlers/JsonLdOutputHandler';
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
} from '@oslo-flanders/ea-uml-extractor';
import { inject, injectable } from 'inversify';
import { EaUmlConverterServiceIdentifier } from '../config/EaUmlConverterServiceIdentifier';
import { TagNames } from '../enums/TagNames';
import { getTagValue, toCamelCase, toPascalCase } from '../utils/utils';
import { TagNames } from '@oslo-converter-uml-ea/enums/TagNames';
import type { IConnectorNormalisationCase } from '@oslo-converter-uml-ea/interfaces/IConnectorNormalisationCase';

@injectable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
} from '@oslo-flanders/ea-uml-extractor';
import { inject, injectable } from 'inversify';
import { EaUmlConverterServiceIdentifier } from '../config/EaUmlConverterServiceIdentifier';
import { TagNames } from '../enums/TagNames';
import { getTagValue, toCamelCase, updateNameTag } from '../utils/utils';
import { TagNames } from '@oslo-converter-uml-ea/enums/TagNames';
import type { IConnectorNormalisationCase } from '@oslo-converter-uml-ea/interfaces/IConnectorNormalisationCase';

@injectable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
} from '@oslo-flanders/ea-uml-extractor';
import { inject, injectable } from 'inversify';
import { EaUmlConverterServiceIdentifier } from '../config/EaUmlConverterServiceIdentifier';
import { TagNames } from '../enums/TagNames';
import { getTagValue, toCamelCase, toPascalCase, updateNameTag } from '../utils/utils';
import { TagNames } from '@oslo-converter-uml-ea/enums/TagNames';
import type { IConnectorNormalisationCase } from '@oslo-converter-uml-ea/interfaces/IConnectorNormalisationCase';

@injectable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
} from '@oslo-flanders/ea-uml-extractor';
import { inject, injectable } from 'inversify';
import { EaUmlConverterServiceIdentifier } from '../config/EaUmlConverterServiceIdentifier';
import { TagNames } from '../enums/TagNames';
import { getTagValue, toCamelCase, updateNameTag } from '../utils/utils';
import { TagNames } from '@oslo-converter-uml-ea/enums/TagNames';
import type { IConnectorNormalisationCase } from '@oslo-converter-uml-ea/interfaces/IConnectorNormalisationCase';

@injectable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
} from '@oslo-flanders/ea-uml-extractor';
import { inject, injectable } from 'inversify';
import { EaUmlConverterServiceIdentifier } from '../config/EaUmlConverterServiceIdentifier';
import { TagNames } from '../enums/TagNames';
import { getTagValue, toCamelCase, toPascalCase } from '../utils/utils';
import { TagNames } from '@oslo-converter-uml-ea/enums/TagNames';
import type { IConnectorNormalisationCase } from '@oslo-converter-uml-ea/interfaces/IConnectorNormalisationCase';

@injectable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import {
} from '@oslo-flanders/ea-uml-extractor';
import { inject, injectable } from 'inversify';
import { EaUmlConverterServiceIdentifier } from '../config/EaUmlConverterServiceIdentifier';
import { TagNames } from '../enums/TagNames';
import {
getTagValue,
toCamelCase,
toPascalCase,
updateNameTag,
} from '../utils/utils';
import { TagNames } from '@oslo-converter-uml-ea/enums/TagNames';
import type { IConnectorNormalisationCase } from '@oslo-converter-uml-ea/interfaces/IConnectorNormalisationCase';

@injectable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import type * as RDF from '@rdfjs/types';
import { inject, injectable } from 'inversify';
import { EaUmlConverterConfiguration } from '../config/EaUmlConverterConfiguration';
import { EaUmlConverterServiceIdentifier } from '../config/EaUmlConverterServiceIdentifier';
import { DataTypes, datatypeIdentifierToHash } from '../enums/DataTypes';
import { TagNames } from '../enums/TagNames';
import type { UriRegistry } from '../UriRegistry';
import { getTagValue, ignore, toCamelCase } from '../utils/utils';
import { DataTypes, datatypeIdentifierToHash } from '@oslo-converter-uml-ea/enums/DataTypes';
import { TagNames } from '@oslo-converter-uml-ea/enums/TagNames';
import { ConverterHandler } from '@oslo-converter-uml-ea/interfaces/ConverterHandler';

@injectable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import type * as RDF from '@rdfjs/types';
import { inject, injectable } from 'inversify';
import { EaUmlConverterServiceIdentifier } from '../config/EaUmlConverterServiceIdentifier';
import { ConnectorNormalisationService } from '../ConnectorNormalisationService';
import { TagNames } from '../enums/TagNames';
import type { UriRegistry } from '../UriRegistry';
import { getTagValue, ignore } from '../utils/utils';
import { TagNames } from '@oslo-converter-uml-ea/enums/TagNames';
import { ConverterHandler } from '@oslo-converter-uml-ea/interfaces/ConverterHandler';

@injectable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import type { DataRegistry, EaConnector, EaElement, EaPackage, EaTag } from '@os
import { ConnectorType, ElementType } from '@oslo-flanders/ea-uml-extractor';
import type * as RDF from '@rdfjs/types';
import { injectable } from 'inversify';
import { TagNames } from '../enums/TagNames';
import type { UriRegistry } from '../UriRegistry';
import { getTagValue, ignore, toPascalCase } from '../utils/utils';
import { TagNames } from '@oslo-converter-uml-ea/enums/TagNames';
import { ConverterHandler } from '@oslo-converter-uml-ea/interfaces/ConverterHandler';

@injectable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { ns } from '@oslo-flanders/core';
import type { DataRegistry, EaPackage } from '@oslo-flanders/ea-uml-extractor';
import type * as RDF from '@rdfjs/types';
import { injectable } from 'inversify';
import { TagNames } from '../enums/TagNames';
import type { UriRegistry } from '../UriRegistry';
import { getTagValue, ignore } from '../utils/utils';
import { TagNames } from '@oslo-converter-uml-ea/enums/TagNames';
import { ConverterHandler } from '@oslo-converter-uml-ea/interfaces/ConverterHandler';

@injectable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { inject, injectable } from 'inversify';
import { DataFactory } from 'rdf-data-factory';
import { EaUmlConverterConfiguration } from '../config/EaUmlConverterConfiguration';
import { EaUmlConverterServiceIdentifier } from '../config/EaUmlConverterServiceIdentifier';
import { TagNames } from '../enums/TagNames';
import type { UriRegistry } from '../UriRegistry';
import { TagNames } from '@oslo-converter-uml-ea/enums/TagNames';

@injectable()
export abstract class ConverterHandler<T extends EaObject> {
Expand Down
2 changes: 1 addition & 1 deletion packages/oslo-converter-uml-ea/lib/utils/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { URL } from 'url';
import type { EaObject, EaTag } from '@oslo-flanders/ea-uml-extractor';
import { TagNames } from '../enums/TagNames';
import type { UriRegistry } from '../UriRegistry';
import { TagNames } from '@oslo-converter-uml-ea/enums/TagNames';

export function ignore(object: EaObject): boolean {
const ignoreObject = getTagValue(object, TagNames.Ignore, false);
Expand Down
40 changes: 21 additions & 19 deletions packages/oslo-core/index.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import 'reflect-metadata';
export * from './lib/interfaces/AppRunner';
export * from './lib/interfaces/IConfiguration';
export * from './lib/interfaces/IOutputHandler';
export * from './lib/interfaces/IService';
export * from './lib/utils/fetchFileOrUrl';
export * from './lib/utils/namespaces';
export * from './lib/utils/uniqueId';
export * from './lib/store/QuadStore';
export * from './lib/ServiceIdentifier';
export * from './lib/enums/Scope';
export * from './lib/enums/PropertyTypes';
export * from './lib/logging/LogLevel';
export * from './lib/logging/Logger';
export * from './lib/logging/VoidLogger';
export * from './lib/logging/WinstonLogger';
export * from './lib/logging/LogUtil';
export * from './lib/logging/LoggerFactory';
export * from './lib/logging/VoidLoggerFactory';
export * from './lib/logging/WinstonLoggerFactory';
import 'module-alias/register';

export * from '@oslo-core/interfaces/AppRunner';
export * from '@oslo-core/interfaces/IConfiguration';
export * from '@oslo-core/interfaces/IOutputHandler';
export * from '@oslo-core/interfaces/IService';
export * from '@oslo-core/utils/fetchFileOrUrl';
export * from '@oslo-core/utils/namespaces';
export * from '@oslo-core/utils/uniqueId';
export * from '@oslo-core/store/QuadStore';
export * from '@oslo-core/ServiceIdentifier';
export * from '@oslo-core/enums/Scope';
export * from '@oslo-core/enums/PropertyTypes';
export * from '@oslo-core/logging/LogLevel';
export * from '@oslo-core/logging/Logger';
export * from '@oslo-core/logging/VoidLogger';
export * from '@oslo-core/logging/WinstonLogger';
export * from '@oslo-core/logging/LogUtil';
export * from '@oslo-core/logging/LoggerFactory';
export * from '@oslo-core/logging/VoidLoggerFactory';
export * from '@oslo-core/logging/WinstonLoggerFactory';
2 changes: 1 addition & 1 deletion packages/oslo-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "MIT",
"main": "index.js",
"_moduleAliases": {
"@@oslo-core": "./lib"
"@oslo-core": "./lib"
},
"directories": {
"lib": "lib"
Expand Down
30 changes: 16 additions & 14 deletions packages/oslo-extractor-uml-ea/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
export * from './lib/DataRegistry';
export * from './lib/types/EaAttribute';
export * from './lib/types/EaConnector';
export * from './lib/types/NormalizedConnector';
export * from './lib/types/EaDiagram';
export * from './lib/types/EaElement';
export * from './lib/types/EaObject';
export * from './lib/types/EaPackage';
export * from './lib/types/EaTag';
export * from './lib/enums/ConnectorDirection';
export * from './lib/enums/ConnectorType';
export * from './lib/enums/EaTable';
export * from './lib/enums/ElementType';
export * from './lib/enums/NormalizedConnectorTypes';
import 'module-alias/register';

export * from '@oslo-extractor-uml-ea/DataRegistry';
export * from '@oslo-extractor-uml-ea/types/EaAttribute';
export * from '@oslo-extractor-uml-ea/types/EaConnector';
export * from '@oslo-extractor-uml-ea/types/NormalizedConnector';
export * from '@oslo-extractor-uml-ea/types/EaDiagram';
export * from '@oslo-extractor-uml-ea/types/EaElement';
export * from '@oslo-extractor-uml-ea/types/EaObject';
export * from '@oslo-extractor-uml-ea/types/EaPackage';
export * from '@oslo-extractor-uml-ea/types/EaTag';
export * from '@oslo-extractor-uml-ea/enums/ConnectorDirection';
export * from '@oslo-extractor-uml-ea/enums/ConnectorType';
export * from '@oslo-extractor-uml-ea/enums/EaTable';
export * from '@oslo-extractor-uml-ea/enums/ElementType';
export * from '@oslo-extractor-uml-ea/enums/NormalizedConnectorTypes';
2 changes: 1 addition & 1 deletion packages/oslo-extractor-uml-ea/lib/types/EaConnector.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { uniqueId } from '@oslo-flanders/core';
import { ConnectorDirection } from '../enums/ConnectorDirection';
import { EaObject } from './EaObject';
import type { EaTag } from './EaTag';
import { ConnectorDirection } from '@oslo-extractor-uml-ea/enums/ConnectorDirection';

/**
* Represents a connector in Enterprise Architect
Expand Down
2 changes: 1 addition & 1 deletion packages/oslo-extractor-uml-ea/lib/types/EaElement.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { uniqueId } from '@oslo-flanders/core';
import type { ElementType } from '../enums/ElementType';
import { EaObject } from './EaObject';
import type { ElementType } from '@oslo-extractor-uml-ea/enums/ElementType';

/**
* Represents an element in Enterprise Architect
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { uniqueId } from '@oslo-flanders/core';
import { NormalizedConnectorTypes } from '../enums/NormalizedConnectorTypes';
import type { EaConnector } from './EaConnector';
import { EaObject } from './EaObject';
import type { EaTag } from './EaTag';
import { NormalizedConnectorTypes } from '@oslo-extractor-uml-ea/enums/NormalizedConnectorTypes';

export class NormalizedConnector extends EaObject {
private readonly _sourceObjectId: number;
Expand Down
2 changes: 1 addition & 1 deletion packages/oslo-extractor-uml-ea/lib/utils/loadAttributes.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type MDBReader from 'mdb-reader';
import type { DataRegistry } from '../DataRegistry';
import { EaTable } from '../enums/EaTable';
import { EaAttribute } from '../types/EaAttribute';
import type { EaElement } from '../types/EaElement';
import { addEaTagsToElements } from './assignTags';
import { EaTable } from '@oslo-extractor-uml-ea/enums/EaTable';

export function loadAttributes(mdb: MDBReader, model: DataRegistry): DataRegistry {
const attributes = mdb.getTable(EaTable.Attribute).getData();
Expand Down
4 changes: 2 additions & 2 deletions packages/oslo-extractor-uml-ea/lib/utils/loadDiagrams.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import alasql from 'alasql';
import type MDBReader from 'mdb-reader';
import type { DataRegistry } from '../DataRegistry';
import { ConnectorDirection } from '../enums/ConnectorDirection';
import { EaTable } from '../enums/EaTable';
import type { EaConnector } from '../types/EaConnector';
import { EaDiagram } from '../types/EaDiagram';
import type { EaPackage } from '../types/EaPackage';
import { resolveConnectorDirection } from './resolveConnectorDirection';
import { ConnectorDirection } from '@oslo-extractor-uml-ea/enums/ConnectorDirection';
import { EaTable } from '@oslo-extractor-uml-ea/enums/EaTable';

export function loadDiagrams(mdb: MDBReader, model: DataRegistry): DataRegistry {
const diagrams = mdb.getTable(EaTable.Diagram).getData();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import alasql from 'alasql';
import type MDBReader from 'mdb-reader';
import type { DataRegistry } from '../DataRegistry';
import { EaTable } from '../enums/EaTable';
import { EaConnector } from '../types/EaConnector';
import type { EaElement } from '../types/EaElement';
import { addEaTagsToElements, addRoleTagsToElements } from './assignTags';
import { convertToConnectorDirection } from './resolveConnectorDirection';
import { EaTable } from '@oslo-extractor-uml-ea/enums/EaTable';

export function loadElementConnectors(mdb: MDBReader, model: DataRegistry): DataRegistry {
const connectors = mdb.getTable(EaTable.Connector).getData();
Expand Down
4 changes: 2 additions & 2 deletions packages/oslo-extractor-uml-ea/lib/utils/loadElements.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import alasql from 'alasql';
import type MDBReader from 'mdb-reader';
import type { DataRegistry } from '../DataRegistry';
import { EaTable } from '../enums/EaTable';
import { ElementType } from '../enums/ElementType';
import { EaElement } from '../types/EaElement';
import type { EaPackage } from '../types/EaPackage';
import { addEaTagsToElements } from './assignTags';
import { EaTable } from '@oslo-extractor-uml-ea/enums/EaTable';
import { ElementType } from '@oslo-extractor-uml-ea/enums/ElementType';

export function loadElements(mdb: MDBReader, model: DataRegistry): DataRegistry {
const objects = mdb.getTable(EaTable.Object).getData();
Expand Down
2 changes: 1 addition & 1 deletion packages/oslo-extractor-uml-ea/lib/utils/loadPackage.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import alasql from 'alasql';
import type MDBReader from 'mdb-reader';
import type { DataRegistry } from '../DataRegistry';
import { EaTable } from '../enums/EaTable';
import { EaPackage } from '../types/EaPackage';
import { addEaTagsToElements } from './assignTags';
import { EaTable } from '@oslo-extractor-uml-ea/enums/EaTable';

export function loadPackages(mdb: MDBReader, model: DataRegistry): DataRegistry {
const packages = mdb.getTable(EaTable.Package).getData();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConnectorDirection } from '../enums/ConnectorDirection';
import { ConnectorDirection } from '@oslo-extractor-uml-ea/enums/ConnectorDirection';

/**
* Resolves the direction of a connector by applying a regular expression on the geometry field of a connector.
Expand Down
3 changes: 3 additions & 0 deletions packages/oslo-extractor-uml-ea/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"homepage": "https://github.com/informatievlaanderen/OSLO-UML-Transformer/tree/main/packages/oslo-extract-uml-ea#readme",
"license": "MIT",
"main": "index.js",
"_moduleAliases": {
"@oslo-extractor-uml-ea": "./lib"
},
"directories": {
"lib": "lib",
"test": "test"
Expand Down

0 comments on commit dff5958

Please sign in to comment.