From 35cb83f30bb683fe9bb2f7c5860157aa4021c2b8 Mon Sep 17 00:00:00 2001 From: Niels Kooiman Date: Tue, 22 May 2018 16:10:33 +0200 Subject: [PATCH] Added dist files --- .gitignore | 1 - dist/adapters/PortResolver.d.ts | 8 ++++ dist/adapters/PortResolver.js | 31 ++++++++++++++ dist/adapters/PortResolver.js.map | 1 + dist/adapters/music/VinylCatalog.d.ts | 10 +++++ dist/adapters/music/VinylCatalog.js | 40 +++++++++++++++++++ dist/adapters/music/VinylCatalog.js.map | 1 + dist/domain/models/Track.d.ts | 7 ++++ dist/domain/models/Track.js | 13 ++++++ dist/domain/models/Track.js.map | 1 + dist/domain/ports/IMusicRepository.d.ts | 8 ++++ dist/domain/ports/IMusicRepository.js | 3 ++ dist/domain/ports/IMusicRepository.js.map | 1 + dist/domain/ports/IPortResolver.d.ts | 5 +++ dist/domain/ports/IPortResolver.js | 4 ++ dist/domain/ports/IPortResolver.js.map | 1 + dist/domain/services/BaseService.d.ts | 5 +++ dist/domain/services/BaseService.js | 11 +++++ dist/domain/services/BaseService.js.map | 1 + dist/domain/services/MusicCatalogService.d.ts | 11 +++++ dist/domain/services/MusicCatalogService.js | 39 ++++++++++++++++++ .../services/MusicCatalogService.js.map | 1 + dist/index.d.ts | 3 ++ dist/index.js | 11 +++++ dist/index.js.map | 1 + dist/wiring/Wiring.d.ts | 3 ++ dist/wiring/Wiring.js | 17 ++++++++ dist/wiring/Wiring.js.map | 1 + package.json | 4 +- src/index.ts | 7 ++++ tsconfig-app.json | 3 +- 31 files changed, 248 insertions(+), 5 deletions(-) create mode 100644 dist/adapters/PortResolver.d.ts create mode 100644 dist/adapters/PortResolver.js create mode 100644 dist/adapters/PortResolver.js.map create mode 100644 dist/adapters/music/VinylCatalog.d.ts create mode 100644 dist/adapters/music/VinylCatalog.js create mode 100644 dist/adapters/music/VinylCatalog.js.map create mode 100644 dist/domain/models/Track.d.ts create mode 100644 dist/domain/models/Track.js create mode 100644 dist/domain/models/Track.js.map create mode 100644 dist/domain/ports/IMusicRepository.d.ts create mode 100644 dist/domain/ports/IMusicRepository.js create mode 100644 dist/domain/ports/IMusicRepository.js.map create mode 100644 dist/domain/ports/IPortResolver.d.ts create mode 100644 dist/domain/ports/IPortResolver.js create mode 100644 dist/domain/ports/IPortResolver.js.map create mode 100644 dist/domain/services/BaseService.d.ts create mode 100644 dist/domain/services/BaseService.js create mode 100644 dist/domain/services/BaseService.js.map create mode 100644 dist/domain/services/MusicCatalogService.d.ts create mode 100644 dist/domain/services/MusicCatalogService.js create mode 100644 dist/domain/services/MusicCatalogService.js.map create mode 100644 dist/index.d.ts create mode 100644 dist/index.js create mode 100644 dist/index.js.map create mode 100644 dist/wiring/Wiring.d.ts create mode 100644 dist/wiring/Wiring.js create mode 100644 dist/wiring/Wiring.js.map diff --git a/.gitignore b/.gitignore index 61f20e3..70ce3ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -dist/ # ---> Node # Logs logs diff --git a/dist/adapters/PortResolver.d.ts b/dist/adapters/PortResolver.d.ts new file mode 100644 index 0000000..8283692 --- /dev/null +++ b/dist/adapters/PortResolver.d.ts @@ -0,0 +1,8 @@ +import { IPortResolver } from '../domain/ports/IPortResolver'; +export declare class PortResolver implements IPortResolver { + private _container; + constructor(); + register(name: string, fn: () => T): void; + registerInstance(name: string, fn: () => T): void; + resolve(name: string): T; +} diff --git a/dist/adapters/PortResolver.js b/dist/adapters/PortResolver.js new file mode 100644 index 0000000..f9fbee3 --- /dev/null +++ b/dist/adapters/PortResolver.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var PortResolver = /** @class */ (function () { + function PortResolver() { + this._container = {}; + } + PortResolver.prototype.register = function (name, fn) { + this._container[name] = fn; + }; + PortResolver.prototype.registerInstance = function (name, fn) { + var _instance = null; + var getInstance = function (fn) { + return function () { + if (!_instance) { + _instance = fn(); + } + return _instance; + }; + }; + this._container[name] = getInstance(fn); + }; + PortResolver.prototype.resolve = function (name) { + if (name in this._container && typeof this._container[name] == 'function') { + return this._container[name](); + } + throw new Error('PortResolver can not resolve ' + name); + }; + return PortResolver; +}()); +exports.PortResolver = PortResolver; +//# sourceMappingURL=PortResolver.js.map \ No newline at end of file diff --git a/dist/adapters/PortResolver.js.map b/dist/adapters/PortResolver.js.map new file mode 100644 index 0000000..165e69f --- /dev/null +++ b/dist/adapters/PortResolver.js.map @@ -0,0 +1 @@ +{"version":3,"file":"PortResolver.js","sourceRoot":"","sources":["../../src/adapters/PortResolver.ts"],"names":[],"mappings":";;AAIA;IAEI;QADQ,eAAU,GAAS,EAAE,CAAC;IAG9B,CAAC;IACD,+BAAQ,GAAR,UAAY,IAAa,EAAE,EAAY;QACnC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;IAC/B,CAAC;IACD,uCAAgB,GAAhB,UAAoB,IAAc,EAAE,EAAY;QAC5C,IAAI,SAAS,GAAS,IAAI,CAAC;QAC3B,IAAI,WAAW,GAAG,UAAC,EAAa;YAC5B,OAAO;gBACH,IAAI,CAAC,SAAS,EAAE;oBACZ,SAAS,GAAG,EAAE,EAAE,CAAC;iBACpB;gBACD,OAAO,SAAS,CAAC;YACrB,CAAC,CAAC;QACN,CAAC,CAAC;QACF,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC;IAC5C,CAAC;IACD,8BAAO,GAAP,UAAW,IAAa;QACpB,IAAI,IAAI,IAAI,IAAI,CAAC,UAAU,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,UAAU,EAAE;YACvE,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;SAClC;QACD,MAAM,IAAI,KAAK,CAAC,+BAA+B,GAAE,IAAI,CAAC,CAAC;IAC3D,CAAC;IACL,mBAAC;AAAD,CAAC,AA1BD,IA0BC;AA1BY,oCAAY"} \ No newline at end of file diff --git a/dist/adapters/music/VinylCatalog.d.ts b/dist/adapters/music/VinylCatalog.d.ts new file mode 100644 index 0000000..c337367 --- /dev/null +++ b/dist/adapters/music/VinylCatalog.d.ts @@ -0,0 +1,10 @@ +import { Track } from "../../domain/models/Track"; +import { IMusicRepository } from "../../domain/ports/IMusicRepository"; +export declare class VinylCatalog implements IMusicRepository { + private vinylList; + get(): Track[]; + getById(id: number): Track; + add(track: Track): number; + edit(id: number, track: Track): Track; + delete(id: number): Track; +} diff --git a/dist/adapters/music/VinylCatalog.js b/dist/adapters/music/VinylCatalog.js new file mode 100644 index 0000000..bb95ca3 --- /dev/null +++ b/dist/adapters/music/VinylCatalog.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var Track_1 = require("../../domain/models/Track"); +var VinylCatalog = /** @class */ (function () { + function VinylCatalog() { + this.vinylList = new Array(new Track_1.Track(1, "DNA.", "Kendrick Lamar", 340), new Track_1.Track(2, "Come Down", "Anderson Paak.", 430), new Track_1.Track(3, "DNA.", "Kendrick Lamar", 340), new Track_1.Track(4, "DNA.", "Kendrick Lamar", 340), new Track_1.Track(5, "DNA.", "Kendrick Lamar", 340)); + } + VinylCatalog.prototype.get = function () { + return this.vinylList; + }; + VinylCatalog.prototype.getById = function (id) { + return this.vinylList.filter(function (track) { return track.id == id; }).pop(); + }; + VinylCatalog.prototype.add = function (track) { + return this.vinylList.push(track); + }; + VinylCatalog.prototype.edit = function (id, track) { + var existingTrack = this.getById(id); + if (existingTrack) { + existingTrack.artist = track.artist; + existingTrack.title = track.title; + existingTrack.duration = track.duration; + return existingTrack; + } + throw new Error("Track not found"); + }; + VinylCatalog.prototype.delete = function (id) { + var track = this.getById(id); + if (track) { + var targetIndex = this.vinylList.indexOf(track); + if (targetIndex < -1) + return null; + return this.vinylList.splice(targetIndex, 1)[0]; + } + return null; + }; + return VinylCatalog; +}()); +exports.VinylCatalog = VinylCatalog; +//# sourceMappingURL=VinylCatalog.js.map \ No newline at end of file diff --git a/dist/adapters/music/VinylCatalog.js.map b/dist/adapters/music/VinylCatalog.js.map new file mode 100644 index 0000000..ba4ac76 --- /dev/null +++ b/dist/adapters/music/VinylCatalog.js.map @@ -0,0 +1 @@ +{"version":3,"file":"VinylCatalog.js","sourceRoot":"","sources":["../../../src/adapters/music/VinylCatalog.ts"],"names":[],"mappings":";;AAAA,mDAAkD;AAGlD;IAAA;QAEY,cAAS,GAAY,IAAI,KAAK,CAClC,IAAI,aAAK,CAAC,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,CAAC,EAC3C,IAAI,aAAK,CAAC,CAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,GAAG,CAAC,EAChD,IAAI,aAAK,CAAC,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,CAAC,EAC3C,IAAI,aAAK,CAAC,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,CAAC,EAC3C,IAAI,aAAK,CAAC,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,CAAC,CAC9C,CAAC;IA8BN,CAAC;IA5BG,0BAAG,GAAH;QACI,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IACD,8BAAO,GAAP,UAAQ,EAAU;QACd,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,UAAA,KAAK,IAAI,OAAA,KAAK,CAAC,EAAE,IAAI,EAAE,EAAd,CAAc,CAAC,CAAC,GAAG,EAAE,CAAC;IAChE,CAAC;IACD,0BAAG,GAAH,UAAI,KAAY;QACZ,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IACD,2BAAI,GAAJ,UAAK,EAAU,EAAE,KAAY;QACzB,IAAI,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACrC,IAAI,aAAa,EAAE;YACf,aAAa,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;YACpC,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;YAClC,aAAa,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;YACxC,OAAO,aAAa,CAAC;SACxB;QACD,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;IACD,6BAAM,GAAN,UAAO,EAAU;QACb,IAAI,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC7B,IAAI,KAAK,EAAE;YACP,IAAI,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAChD,IAAI,WAAW,GAAG,CAAC,CAAC;gBAAE,OAAO,IAAI,CAAC;YAClC,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACnD;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IACL,mBAAC;AAAD,CAAC,AAtCD,IAsCC;AAtCY,oCAAY"} \ No newline at end of file diff --git a/dist/domain/models/Track.d.ts b/dist/domain/models/Track.d.ts new file mode 100644 index 0000000..82782a1 --- /dev/null +++ b/dist/domain/models/Track.d.ts @@ -0,0 +1,7 @@ +export declare class Track { + constructor(id: number, title: string, artist: string, duration: number); + id: number; + title: string; + artist: string; + duration: number; +} diff --git a/dist/domain/models/Track.js b/dist/domain/models/Track.js new file mode 100644 index 0000000..e13ca95 --- /dev/null +++ b/dist/domain/models/Track.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var Track = /** @class */ (function () { + function Track(id, title, artist, duration) { + this.id = id; + this.title = title; + this.artist = artist; + this.duration = duration; + } + return Track; +}()); +exports.Track = Track; +//# sourceMappingURL=Track.js.map \ No newline at end of file diff --git a/dist/domain/models/Track.js.map b/dist/domain/models/Track.js.map new file mode 100644 index 0000000..6090c2e --- /dev/null +++ b/dist/domain/models/Track.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Track.js","sourceRoot":"","sources":["../../../src/domain/models/Track.ts"],"names":[],"mappings":";;AACA;IACI,eAAY,EAAU,EAAE,KAAa,EAAE,MAAc,EAAE,QAAe;QAClE,IAAI,CAAC,EAAE,GAAE,EAAE,CAAC;QACZ,IAAI,CAAC,KAAK,GAAE,KAAK,CAAC;QAClB,IAAI,CAAC,MAAM,GAAE,MAAM,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAE,QAAQ,CAAC;IAC5B,CAAC;IAML,YAAC;AAAD,CAAC,AAZD,IAYC;AAZY,sBAAK"} \ No newline at end of file diff --git a/dist/domain/ports/IMusicRepository.d.ts b/dist/domain/ports/IMusicRepository.d.ts new file mode 100644 index 0000000..f3aa233 --- /dev/null +++ b/dist/domain/ports/IMusicRepository.d.ts @@ -0,0 +1,8 @@ +import { Track } from "../models/Track"; +export interface IMusicRepository { + get(): Track[]; + getById(id: number): Track; + add(track: Track): number; + edit(id: number, track: Track): Track; + delete(id: number): Track; +} diff --git a/dist/domain/ports/IMusicRepository.js b/dist/domain/ports/IMusicRepository.js new file mode 100644 index 0000000..ce44070 --- /dev/null +++ b/dist/domain/ports/IMusicRepository.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=IMusicRepository.js.map \ No newline at end of file diff --git a/dist/domain/ports/IMusicRepository.js.map b/dist/domain/ports/IMusicRepository.js.map new file mode 100644 index 0000000..d735690 --- /dev/null +++ b/dist/domain/ports/IMusicRepository.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IMusicRepository.js","sourceRoot":"","sources":["../../../src/domain/ports/IMusicRepository.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/domain/ports/IPortResolver.d.ts b/dist/domain/ports/IPortResolver.d.ts new file mode 100644 index 0000000..769b28f --- /dev/null +++ b/dist/domain/ports/IPortResolver.d.ts @@ -0,0 +1,5 @@ +export interface IPortResolver { + resolve(name: string): T; +} +export declare let currentPortResolver: IPortResolver; +export declare let setCurrentPortResolver: (resolver: IPortResolver) => IPortResolver; diff --git a/dist/domain/ports/IPortResolver.js b/dist/domain/ports/IPortResolver.js new file mode 100644 index 0000000..a0e7fa6 --- /dev/null +++ b/dist/domain/ports/IPortResolver.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setCurrentPortResolver = function (resolver) { return exports.currentPortResolver = resolver; }; +//# sourceMappingURL=IPortResolver.js.map \ No newline at end of file diff --git a/dist/domain/ports/IPortResolver.js.map b/dist/domain/ports/IPortResolver.js.map new file mode 100644 index 0000000..a645af7 --- /dev/null +++ b/dist/domain/ports/IPortResolver.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IPortResolver.js","sourceRoot":"","sources":["../../../src/domain/ports/IPortResolver.ts"],"names":[],"mappings":";;AAOW,QAAA,sBAAsB,GAAG,UAAC,QAAwB,IAAK,OAAA,2BAAmB,GAAG,QAAQ,EAA9B,CAA8B,CAAC"} \ No newline at end of file diff --git a/dist/domain/services/BaseService.d.ts b/dist/domain/services/BaseService.d.ts new file mode 100644 index 0000000..62d72fa --- /dev/null +++ b/dist/domain/services/BaseService.d.ts @@ -0,0 +1,5 @@ +import { IPortResolver } from '../ports/IPortResolver'; +export declare class BaseService { + protected PortResolver: IPortResolver; + constructor(); +} diff --git a/dist/domain/services/BaseService.js b/dist/domain/services/BaseService.js new file mode 100644 index 0000000..cd5f733 --- /dev/null +++ b/dist/domain/services/BaseService.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var IPortResolver_1 = require("../ports/IPortResolver"); +var BaseService = /** @class */ (function () { + function BaseService() { + this.PortResolver = IPortResolver_1.currentPortResolver; + } + return BaseService; +}()); +exports.BaseService = BaseService; +//# sourceMappingURL=BaseService.js.map \ No newline at end of file diff --git a/dist/domain/services/BaseService.js.map b/dist/domain/services/BaseService.js.map new file mode 100644 index 0000000..25ae53b --- /dev/null +++ b/dist/domain/services/BaseService.js.map @@ -0,0 +1 @@ +{"version":3,"file":"BaseService.js","sourceRoot":"","sources":["../../../src/domain/services/BaseService.ts"],"names":[],"mappings":";;AACA,wDAA4E;AAE5E;IAEI;QACI,IAAI,CAAC,YAAY,GAAG,mCAAmB,CAAC;IAC5C,CAAC;IACL,kBAAC;AAAD,CAAC,AALD,IAKC;AALY,kCAAW"} \ No newline at end of file diff --git a/dist/domain/services/MusicCatalogService.d.ts b/dist/domain/services/MusicCatalogService.d.ts new file mode 100644 index 0000000..899629a --- /dev/null +++ b/dist/domain/services/MusicCatalogService.d.ts @@ -0,0 +1,11 @@ +import { BaseService } from './BaseService'; +import { Track } from "../../domain/models/Track"; +export declare class MusicCatalogService extends BaseService { + private repository; + constructor(); + get(): Track[]; + getById(id: number): Track | null; + add(track: Track): number; + edit(id: number, track: Track): Track; + delete(id: number): Track | null; +} diff --git a/dist/domain/services/MusicCatalogService.js b/dist/domain/services/MusicCatalogService.js new file mode 100644 index 0000000..19277e0 --- /dev/null +++ b/dist/domain/services/MusicCatalogService.js @@ -0,0 +1,39 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var BaseService_1 = require("./BaseService"); +var MusicCatalogService = /** @class */ (function (_super) { + __extends(MusicCatalogService, _super); + function MusicCatalogService() { + var _this = _super.call(this) || this; + _this.repository = _this.PortResolver.resolve('IMusicRepository'); + return _this; + } + MusicCatalogService.prototype.get = function () { + return this.repository.get(); + }; + MusicCatalogService.prototype.getById = function (id) { + return this.repository.getById(id); + }; + MusicCatalogService.prototype.add = function (track) { + return this.repository.add(track); + }; + MusicCatalogService.prototype.edit = function (id, track) { + return this.repository.edit(id, track); + }; + MusicCatalogService.prototype.delete = function (id) { + return this.repository.delete(id); + }; + return MusicCatalogService; +}(BaseService_1.BaseService)); +exports.MusicCatalogService = MusicCatalogService; +//# sourceMappingURL=MusicCatalogService.js.map \ No newline at end of file diff --git a/dist/domain/services/MusicCatalogService.js.map b/dist/domain/services/MusicCatalogService.js.map new file mode 100644 index 0000000..dd6f0d9 --- /dev/null +++ b/dist/domain/services/MusicCatalogService.js.map @@ -0,0 +1 @@ +{"version":3,"file":"MusicCatalogService.js","sourceRoot":"","sources":["../../../src/domain/services/MusicCatalogService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA4C;AAK5C;IAAyC,uCAAW;IAGhD;QAAA,YACI,iBAAO,SAEV;QADG,KAAI,CAAC,UAAU,GAAG,KAAI,CAAC,YAAY,CAAC,OAAO,CAAmB,kBAAkB,CAAC,CAAC;;IACtF,CAAC;IACD,iCAAG,GAAH;QACI,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;IACjC,CAAC;IACD,qCAAO,GAAP,UAAQ,EAAU;QACf,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACtC,CAAC;IACD,iCAAG,GAAH,UAAI,KAAY;QACZ,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IACD,kCAAI,GAAJ,UAAK,EAAU,EAAE,KAAY;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IACD,oCAAM,GAAN,UAAO,EAAU;QACf,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;IACL,0BAAC;AAAD,CAAC,AAtBD,CAAyC,yBAAW,GAsBnD;AAtBY,kDAAmB"} \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..4708902 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,3 @@ +import { MusicCatalogService } from './domain/services/MusicCatalogService'; +import { Track } from './domain/models/Track'; +export { MusicCatalogService, Track }; diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..4176d0f --- /dev/null +++ b/dist/index.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var Wiring_1 = require("./wiring/Wiring"); +var MusicCatalogService_1 = require("./domain/services/MusicCatalogService"); +exports.MusicCatalogService = MusicCatalogService_1.MusicCatalogService; +var Track_1 = require("./domain/models/Track"); +exports.Track = Track_1.Track; +var wiring = new Wiring_1.Wiring(); +wiring.apply(); +// MusicRepository +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 0000000..6abc605 --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,0CAAyC;AACzC,6EAA4E;AAMnE,8BANA,yCAAmB,CAMA;AAL5B,+CAA8C;AAKhB,gBALrB,aAAK,CAKqB;AAHnC,IAAM,MAAM,GAAG,IAAI,eAAM,EAAE,CAAC;AAC5B,MAAM,CAAC,KAAK,EAAE,CAAC;AAIf,kBAAkB"} \ No newline at end of file diff --git a/dist/wiring/Wiring.d.ts b/dist/wiring/Wiring.d.ts new file mode 100644 index 0000000..a1f8109 --- /dev/null +++ b/dist/wiring/Wiring.d.ts @@ -0,0 +1,3 @@ +export declare class Wiring { + apply(): void; +} diff --git a/dist/wiring/Wiring.js b/dist/wiring/Wiring.js new file mode 100644 index 0000000..d888e54 --- /dev/null +++ b/dist/wiring/Wiring.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var IPortResolver_1 = require("../domain/ports/IPortResolver"); +var PortResolver_1 = require("../adapters/PortResolver"); +var VinylCatalog_1 = require("../adapters/music/VinylCatalog"); +var Wiring = /** @class */ (function () { + function Wiring() { + } + Wiring.prototype.apply = function () { + var portResolver = new PortResolver_1.PortResolver(); + portResolver.register('IMusicRepository', function () { return new VinylCatalog_1.VinylCatalog(); }); + IPortResolver_1.setCurrentPortResolver(portResolver); + }; + return Wiring; +}()); +exports.Wiring = Wiring; +//# sourceMappingURL=Wiring.js.map \ No newline at end of file diff --git a/dist/wiring/Wiring.js.map b/dist/wiring/Wiring.js.map new file mode 100644 index 0000000..371e8a5 --- /dev/null +++ b/dist/wiring/Wiring.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Wiring.js","sourceRoot":"","sources":["../../src/wiring/Wiring.ts"],"names":[],"mappings":";;AAAA,+DAAsF;AACtF,yDAAwD;AACxD,+DAA8D;AAG9D;IAAA;IAOA,CAAC;IANU,sBAAK,GAAZ;QACI,IAAM,YAAY,GAAG,IAAI,2BAAY,EAAE,CAAC;QACxC,YAAY,CAAC,QAAQ,CAAmB,kBAAkB,EAAE,cAAM,OAAA,IAAI,2BAAY,EAAE,EAAlB,CAAkB,CAAC,CAAC;QAEtF,sCAAsB,CAAC,YAAY,CAAC,CAAC;IACzC,CAAC;IACL,aAAC;AAAD,CAAC,AAPD,IAOC;AAPY,wBAAM"} \ No newline at end of file diff --git a/package.json b/package.json index 406c13c..f754ec2 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,8 @@ "name": "@nx/typescript-starter", "version": "1.0.0", "description": "Starter project for a typescript app", - "main": "dist/bundle.js", - "types": "dist/bundle.d.ts", + "main": "dist/index.js", + "types": "dist/index.d.ts", "scripts": { "build": "tsc --listEmittedFiles --project tsconfig-app.json", "test": "karma start karma.conf.js -sm=false", diff --git a/src/index.ts b/src/index.ts index 0b060c3..9785425 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,10 @@ import { Wiring } from './wiring/Wiring'; +import { MusicCatalogService } from './domain/services/MusicCatalogService'; +import { Track } from './domain/models/Track'; + const wiring = new Wiring(); wiring.apply(); + +export { MusicCatalogService, Track }; + +// MusicRepository diff --git a/tsconfig-app.json b/tsconfig-app.json index 7dd3697..065e7e3 100644 --- a/tsconfig-app.json +++ b/tsconfig-app.json @@ -1,8 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "module": "amd", - "outFile": "./dist/bundle.js" + }, "files": [ "./src/index.ts"