dop-stick
Version:
Source control tooling for versionable-upgradeable smart contracts
60 lines • 2.4 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.LibraryTimelineAdapter = void 0;
const timelineLogAdapter_1 = require("./timelineLogAdapter");
const logFormatters_1 = require("../logFormatters");
const ICONS = {
LIBRARY: '📚',
DEPLOY: '🚀',
LINK: '🔗',
SUCCESS: '✓',
ERROR: '✖',
PENDING: '⏳',
DEPS: '🔄'
};
class LibraryTimelineAdapter {
constructor() {
this.timeline = new timelineLogAdapter_1.TimelineLogAdapter();
}
startLibraryResolution(libraries) {
this.timeline.startSection(`${ICONS.LIBRARY} LIBRARY RESOLUTION`);
this.timeline.logInnerStep(`• Required Libraries: ${libraries.length}`, 1);
libraries.forEach(lib => {
this.timeline.logInnerStep(` - ${lib}`, 2);
});
this.timeline.logEmptyStep();
}
logLibraryResolved(name, address) {
this.timeline.logStep(`${ICONS.SUCCESS} Resolved: ${name}`);
this.timeline.logInnerStep(`• Address: ${logFormatters_1.LogFormatters.makeAddressCopyable(address)}`, 1);
this.timeline.logEmptyStep();
}
logLibraryDeployment(name, status, address, error) {
const icon = status === 'success' ? ICONS.SUCCESS :
status === 'failed' ? ICONS.ERROR :
ICONS.PENDING;
this.timeline.logStep(`${ICONS.DEPLOY} Library: ${name}`);
this.timeline.logInnerStep(`• Status: ${status}`, 1);
if (address) {
this.timeline.logInnerStep(`• Address: ${logFormatters_1.LogFormatters.makeAddressCopyable(address)}`, 1);
}
if (error) {
this.timeline.logInnerStep(`• Error: ${error.message || String(error)}`, 1);
}
this.timeline.logEmptyStep();
}
logDependencyResolution(libName, dependencies) {
this.timeline.logStep(`${ICONS.DEPS} Dependencies for ${libName}`);
dependencies.forEach(dep => {
this.timeline.logInnerStep(`• ${dep}`, 1);
});
this.timeline.logEmptyStep();
}
logLibraryError(name, error) {
this.timeline.logStep(`${ICONS.ERROR} Library Error: ${name}`);
this.timeline.logInnerStep(`• ${error.message || String(error)}`, 1);
this.timeline.logEmptyStep();
}
}
exports.LibraryTimelineAdapter = LibraryTimelineAdapter;
//# sourceMappingURL=libraryTimelineAdapter.js.map