@wocker/example-plugin
Advanced tools
| import { ProjectService, PluginConfigService } from "@wocker/core"; | ||
| export declare class ExampleService { | ||
| protected readonly pluginConfigService: PluginConfigService; | ||
| protected readonly projectService: ProjectService; | ||
| constructor(pluginConfigService: PluginConfigService, projectService: ProjectService); | ||
| init(name?: string): Promise<string>; | ||
| } |
| "use strict"; | ||
| var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
| var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
| if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
| else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
| return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
| }; | ||
| var __metadata = (this && this.__metadata) || function (k, v) { | ||
| if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
| }; | ||
| var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
| function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
| return new (P || (P = Promise))(function (resolve, reject) { | ||
| function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
| function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
| function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
| step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
| }); | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.ExampleService = void 0; | ||
| const core_1 = require("@wocker/core"); | ||
| let ExampleService = class ExampleService { | ||
| constructor(pluginConfigService, projectService) { | ||
| this.pluginConfigService = pluginConfigService; | ||
| this.projectService = projectService; | ||
| } | ||
| init(name) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| if (name) { | ||
| yield this.projectService.cdProject(name); | ||
| } | ||
| const project = yield this.projectService.get(); | ||
| const pluginDir = this.pluginConfigService.dataPath("/"); | ||
| return `Current project: ${project.name} (${project.containerName})\n Plugin dir: ${pluginDir}`; | ||
| }); | ||
| } | ||
| }; | ||
| exports.ExampleService = ExampleService; | ||
| exports.ExampleService = ExampleService = __decorate([ | ||
| (0, core_1.Injectable)(), | ||
| __metadata("design:paramtypes", [core_1.PluginConfigService, | ||
| core_1.ProjectService]) | ||
| ], ExampleService); |
@@ -1,8 +0,6 @@ | ||
| import { DockerService, ProjectService, PluginConfigService } from "@wocker/core"; | ||
| import { ExampleService } from "../services/ExampleService"; | ||
| export declare class ExampleController { | ||
| protected readonly dockerService: DockerService; | ||
| protected readonly projectService: ProjectService; | ||
| protected readonly pluginConfigService: PluginConfigService; | ||
| constructor(dockerService: DockerService, projectService: ProjectService, pluginConfigService: PluginConfigService); | ||
| protected readonly exampleService: ExampleService; | ||
| constructor(exampleService: ExampleService); | ||
| init(name?: string): Promise<string>; | ||
| } |
@@ -26,15 +26,10 @@ "use strict"; | ||
| const core_1 = require("@wocker/core"); | ||
| const ExampleService_1 = require("../services/ExampleService"); | ||
| let ExampleController = class ExampleController { | ||
| constructor(dockerService, projectService, pluginConfigService) { | ||
| this.dockerService = dockerService; | ||
| this.projectService = projectService; | ||
| this.pluginConfigService = pluginConfigService; | ||
| constructor(exampleService) { | ||
| this.exampleService = exampleService; | ||
| } | ||
| init(name) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| if (name) { | ||
| yield this.projectService.cdProject(name); | ||
| } | ||
| const project = yield this.projectService.get(); | ||
| return `Current project: ${project.name} (${project.containerName})\n`; | ||
| return this.exampleService.init(name); | ||
| }); | ||
@@ -56,5 +51,3 @@ } | ||
| (0, core_1.Controller)(), | ||
| __metadata("design:paramtypes", [core_1.DockerService, | ||
| core_1.ProjectService, | ||
| core_1.PluginConfigService]) | ||
| __metadata("design:paramtypes", [ExampleService_1.ExampleService]) | ||
| ], ExampleController); |
+3
-1
@@ -11,2 +11,3 @@ "use strict"; | ||
| const ExampleController_1 = require("./controllers/ExampleController"); | ||
| const ExampleService_1 = require("./services/ExampleService"); | ||
| let ExamplePlugin = class ExamplePlugin { | ||
@@ -19,3 +20,4 @@ }; | ||
| providers: [ | ||
| core_1.PluginConfigService | ||
| core_1.PluginConfigService, | ||
| ExampleService_1.ExampleService | ||
| ] | ||
@@ -22,0 +24,0 @@ }) |
+1
-1
| { | ||
| "name": "@wocker/example-plugin", | ||
| "version": "1.0.3", | ||
| "version": "1.0.4-dev.0", | ||
| "author": "Kris Papercut <krispcut@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "Wocker example plugin", |
Unpublished package
Supply chain riskPackage version was not found on the registry. It may exist on a different registry and need to be configured to pull from that registry.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Unpopular package
QualityThis package is not very popular.
Found 1 instance in 1 package
9761
32.8%9
28.57%134
48.89%0
-100%3
50%1
Infinity%