@wocker/core 1.1.1-beta.1 → 1.1.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core/ApplicationContext.js +38 -51
- package/lib/core/Factory.js +4 -15
- package/lib/core/Scanner.js +21 -34
- package/lib/env.d.ts +1 -1
- package/lib/env.js +1 -1
- package/lib/makes/AppConfig.js +3 -3
- package/lib/makes/FileSystem.js +12 -23
- package/lib/makes/FileSystemManager.js +3 -14
- package/lib/makes/Project.js +9 -24
- package/lib/modules/plugin/services/PluginConfigService.js +6 -21
- package/lib/services/EventService.js +8 -19
- package/lib/types/PresetSource.d.ts +10 -4
- package/lib/types/PresetSource.js +10 -4
- package/package.json +1 -1
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.ApplicationContext = void 0;
|
|
13
4
|
const cli_1 = require("@kearisp/cli");
|
|
@@ -31,58 +22,54 @@ class ApplicationContext {
|
|
|
31
22
|
}
|
|
32
23
|
return res;
|
|
33
24
|
}
|
|
34
|
-
run(args) {
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return resolve(this.process(args));
|
|
39
|
-
});
|
|
25
|
+
async run(args) {
|
|
26
|
+
return new Promise((resolve) => {
|
|
27
|
+
AsyncStorage_1.AsyncStorage.run(this.container, () => {
|
|
28
|
+
return resolve(this.process(args));
|
|
40
29
|
});
|
|
41
30
|
});
|
|
42
31
|
}
|
|
43
|
-
process(args) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
for (const [,
|
|
56
|
-
|
|
57
|
-
|
|
32
|
+
async process(args) {
|
|
33
|
+
const cli = this.get(cli_1.Cli), eventService = this.get(EventService_1.EventService);
|
|
34
|
+
cli.command("")
|
|
35
|
+
.option("version", {
|
|
36
|
+
type: "boolean",
|
|
37
|
+
alias: "v"
|
|
38
|
+
})
|
|
39
|
+
.action((input) => {
|
|
40
|
+
if (input.option("version")) {
|
|
41
|
+
return env_1.WOCKER_VERSION;
|
|
42
|
+
}
|
|
43
|
+
for (const [, module] of this.container.modules) {
|
|
44
|
+
for (const [, container] of module.controllers) {
|
|
45
|
+
if (!container.description) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
console.info(`${container.description}:`);
|
|
49
|
+
const spaceLength = container.commands.reduce((space, route) => {
|
|
50
|
+
return route.commandNames.reduce((space, command) => {
|
|
51
|
+
return Math.max(space, command.length + 2);
|
|
52
|
+
}, space);
|
|
53
|
+
}, 0);
|
|
54
|
+
for (const route of container.commands) {
|
|
55
|
+
if (!route.description) {
|
|
58
56
|
continue;
|
|
59
57
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return Math.max(space, command.length + 2);
|
|
64
|
-
}, space);
|
|
65
|
-
}, 0);
|
|
66
|
-
for (const route of container.commands) {
|
|
67
|
-
if (!route.description) {
|
|
68
|
-
continue;
|
|
69
|
-
}
|
|
70
|
-
for (const commandName of route.commandNames) {
|
|
71
|
-
const space = " ".repeat(Math.max(0, spaceLength - commandName.length));
|
|
72
|
-
console.info(` ${commandName} ${space} ${route.description}`);
|
|
73
|
-
}
|
|
58
|
+
for (const commandName of route.commandNames) {
|
|
59
|
+
const space = " ".repeat(Math.max(0, spaceLength - commandName.length));
|
|
60
|
+
console.info(` ${commandName} ${space} ${route.description}`);
|
|
74
61
|
}
|
|
75
|
-
console.info("");
|
|
76
62
|
}
|
|
63
|
+
console.info("");
|
|
77
64
|
}
|
|
78
|
-
});
|
|
79
|
-
try {
|
|
80
|
-
return yield cli.run(args);
|
|
81
|
-
}
|
|
82
|
-
finally {
|
|
83
|
-
yield eventService.emit("finish");
|
|
84
65
|
}
|
|
85
66
|
});
|
|
67
|
+
try {
|
|
68
|
+
return await cli.run(args);
|
|
69
|
+
}
|
|
70
|
+
finally {
|
|
71
|
+
await eventService.emit("finish");
|
|
72
|
+
}
|
|
86
73
|
}
|
|
87
74
|
}
|
|
88
75
|
exports.ApplicationContext = ApplicationContext;
|
package/lib/core/Factory.js
CHANGED
|
@@ -1,25 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.Factory = void 0;
|
|
13
4
|
const ApplicationContext_1 = require("./ApplicationContext");
|
|
14
5
|
const Container_1 = require("./Container");
|
|
15
6
|
const Scanner_1 = require("./Scanner");
|
|
16
7
|
class Factory {
|
|
17
|
-
static create(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return new ApplicationContext_1.ApplicationContext(module, container, options);
|
|
22
|
-
});
|
|
8
|
+
static async create(module, options = {}) {
|
|
9
|
+
const container = new Container_1.Container(), scanner = new Scanner_1.Scanner(container, options);
|
|
10
|
+
await scanner.scan(module);
|
|
11
|
+
return new ApplicationContext_1.ApplicationContext(module, container, options);
|
|
23
12
|
}
|
|
24
13
|
}
|
|
25
14
|
exports.Factory = Factory;
|
package/lib/core/Scanner.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -33,13 +24,11 @@ class Scanner {
|
|
|
33
24
|
useValue: fsDriver
|
|
34
25
|
}));
|
|
35
26
|
}
|
|
36
|
-
scan(moduleDefinition) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
this.scanRoutes();
|
|
42
|
-
});
|
|
27
|
+
async scan(moduleDefinition) {
|
|
28
|
+
this.scanModule(CoreModule_1.CoreModule);
|
|
29
|
+
this.scanModule(moduleDefinition);
|
|
30
|
+
await this.scanDynamicModules();
|
|
31
|
+
this.scanRoutes();
|
|
43
32
|
}
|
|
44
33
|
getMetadata(moduleDefinition) {
|
|
45
34
|
if (this.isDynamicModule(moduleDefinition)) {
|
|
@@ -165,25 +154,23 @@ class Scanner {
|
|
|
165
154
|
}
|
|
166
155
|
}
|
|
167
156
|
}
|
|
168
|
-
scanDynamicModules() {
|
|
169
|
-
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
}));
|
|
185
|
-
yield Promise.all(promises);
|
|
157
|
+
async scanDynamicModules() {
|
|
158
|
+
const promises = ([...this.container.modules.keys()]).map(async (type) => {
|
|
159
|
+
const wrapper = this.container.modules.get(type);
|
|
160
|
+
if (!wrapper) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
if (wrapper.factory) {
|
|
164
|
+
const { imports = [], controllers = [], providers = [], exports = [] } = await wrapper.factory(...(wrapper.factoryInject || []).map((token) => {
|
|
165
|
+
return wrapper.get(token);
|
|
166
|
+
}));
|
|
167
|
+
this.scanImports(wrapper, imports);
|
|
168
|
+
this.scanControllers(wrapper, controllers);
|
|
169
|
+
this.scanProviders(wrapper, providers);
|
|
170
|
+
this.scanExports(wrapper, exports);
|
|
171
|
+
}
|
|
186
172
|
});
|
|
173
|
+
await Promise.all(promises);
|
|
187
174
|
}
|
|
188
175
|
isDynamicModule(moduleDefinition) {
|
|
189
176
|
return moduleDefinition && !!moduleDefinition.module;
|
package/lib/env.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const WOCKER_VERSION = "1.1.
|
|
1
|
+
export declare const WOCKER_VERSION = "1.1.2";
|
|
2
2
|
export declare const WOCKER_VERSION_KEY = "__WOCKER_VERSION__";
|
|
3
3
|
export declare const WOCKER_DATA_DIR: string;
|
|
4
4
|
export declare const WOCKER_DATA_DIR_KEY = "__WOCKER_DATA_DIR__";
|
package/lib/env.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.MODULE_METADATA = exports.PLUGIN_NAME_METADATA = exports.INJECT_TOKEN_METADATA = exports.SELF_DECLARED_DEPS_METADATA = exports.PARAMTYPES_METADATA = exports.ALIAS_METADATA = exports.ARGS_OLD_METADATA = exports.ARGS_METADATA = exports.LISTENER_METADATA = exports.COMPLETION_METADATA = exports.COMMAND_METADATA = exports.DESCRIPTION_METADATA = exports.INJECTABLE_WATERMARK = exports.IS_MODULE_METADATA = exports.IS_GLOBAL_METADATA = exports.IS_CONTROLLER_METADATA = exports.PLUGIN_DIR_KEY = exports.FILE_SYSTEM_DRIVER_KEY = exports.WOCKER_DATA_DIR_KEY = exports.WOCKER_DATA_DIR = exports.WOCKER_VERSION_KEY = exports.WOCKER_VERSION = void 0;
|
|
7
7
|
const os_1 = __importDefault(require("os"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
-
exports.WOCKER_VERSION = "1.1.
|
|
9
|
+
exports.WOCKER_VERSION = "1.1.2";
|
|
10
10
|
exports.WOCKER_VERSION_KEY = "__WOCKER_VERSION__";
|
|
11
11
|
exports.WOCKER_DATA_DIR = process.env.WS_DIR || path_1.default.join(os_1.default.homedir(), ".workspace");
|
|
12
12
|
exports.WOCKER_DATA_DIR_KEY = "__WOCKER_DATA_DIR__";
|
package/lib/makes/AppConfig.js
CHANGED
|
@@ -87,11 +87,11 @@ class AppConfig {
|
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
registerPreset(name, source, path) {
|
|
90
|
-
if (source === types_1.
|
|
90
|
+
if (source === types_1.PresetSource.INTERNAL) {
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
93
|
let presetData = this.presets.find((preset) => {
|
|
94
|
-
if (source === types_1.
|
|
94
|
+
if (source === types_1.PresetSource.EXTERNAL && preset.path === path) {
|
|
95
95
|
return true;
|
|
96
96
|
}
|
|
97
97
|
return preset.name === name;
|
|
@@ -104,7 +104,7 @@ class AppConfig {
|
|
|
104
104
|
this.presets.push(presetData);
|
|
105
105
|
}
|
|
106
106
|
presetData.source = source;
|
|
107
|
-
if (presetData.source === types_1.
|
|
107
|
+
if (presetData.source === types_1.PresetSource.EXTERNAL) {
|
|
108
108
|
presetData.path = path;
|
|
109
109
|
}
|
|
110
110
|
else if (presetData.path) {
|
package/lib/makes/FileSystem.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -66,21 +57,19 @@ class FileSystem {
|
|
|
66
57
|
/**
|
|
67
58
|
* @deprecated
|
|
68
59
|
*/
|
|
69
|
-
readdirFiles() {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return stat.isFile();
|
|
81
|
-
});
|
|
82
|
-
resolve(files);
|
|
60
|
+
async readdirFiles(path = "", options) {
|
|
61
|
+
const fullPath = this.path(path);
|
|
62
|
+
return new Promise((resolve, reject) => {
|
|
63
|
+
this.driver.readdir(fullPath, options, (err, files) => {
|
|
64
|
+
if (err) {
|
|
65
|
+
reject(err);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
files = files.filter((path) => {
|
|
69
|
+
const stat = this.stat(path);
|
|
70
|
+
return stat.isFile();
|
|
83
71
|
});
|
|
72
|
+
resolve(files);
|
|
84
73
|
});
|
|
85
74
|
});
|
|
86
75
|
}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -31,11 +22,9 @@ class FileSystemManager {
|
|
|
31
22
|
copy(path, options) {
|
|
32
23
|
fs_1.default.cpSync(this.source.path(path), this.destination.path(path), options);
|
|
33
24
|
}
|
|
34
|
-
copyFile(path) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
yield (0, promises_1.pipeline)(readStream, writeStream);
|
|
38
|
-
});
|
|
25
|
+
async copyFile(path) {
|
|
26
|
+
const readStream = this.source.createReadStream(path), writeStream = this.destination.createWriteStream(path);
|
|
27
|
+
await (0, promises_1.pipeline)(readStream, writeStream);
|
|
39
28
|
}
|
|
40
29
|
}
|
|
41
30
|
exports.FileSystemManager = FileSystemManager;
|
package/lib/makes/Project.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.Project = void 0;
|
|
13
4
|
const AsyncStorage_1 = require("../core/AsyncStorage");
|
|
@@ -221,23 +212,17 @@ class Project {
|
|
|
221
212
|
get services() {
|
|
222
213
|
return this.configs.app.services;
|
|
223
214
|
}
|
|
224
|
-
getSecret(key, byDefault) {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
return keystoreService.get(`p:${this.name}:${key}`, byDefault);
|
|
228
|
-
});
|
|
215
|
+
async getSecret(key, byDefault) {
|
|
216
|
+
const container = AsyncStorage_1.AsyncStorage.getContainer(), keystoreService = container.get("KEYSTORE_SERVICE");
|
|
217
|
+
return keystoreService.get(`p:${this.name}:${key}`, byDefault);
|
|
229
218
|
}
|
|
230
|
-
setSecret(key, value) {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
return keystoreService.set(`p:${this.name}:${key}`, value);
|
|
234
|
-
});
|
|
219
|
+
async setSecret(key, value) {
|
|
220
|
+
const container = AsyncStorage_1.AsyncStorage.getContainer(), keystoreService = container.get("KEYSTORE_SERVICE");
|
|
221
|
+
return keystoreService.set(`p:${this.name}:${key}`, value);
|
|
235
222
|
}
|
|
236
|
-
unsetSecret(key) {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
return keystoreService.delete(`p:${this.name}:${key}`);
|
|
240
|
-
});
|
|
223
|
+
async unsetSecret(key) {
|
|
224
|
+
const container = AsyncStorage_1.AsyncStorage.getContainer(), keystoreService = container.get("KEYSTORE_SERVICE");
|
|
225
|
+
return keystoreService.delete(`p:${this.name}:${key}`);
|
|
241
226
|
}
|
|
242
227
|
save() {
|
|
243
228
|
const container = AsyncStorage_1.AsyncStorage.getContainer(), projectRepository = container.get(ProjectRepository_1.ProjectRepository);
|
|
@@ -11,15 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
15
|
exports.PluginConfigService = void 0;
|
|
25
16
|
const AppConfigService_1 = require("../../../services/AppConfigService");
|
|
@@ -64,10 +55,8 @@ let PluginConfigService = class PluginConfigService {
|
|
|
64
55
|
this.fs.mkdir(path, options);
|
|
65
56
|
}
|
|
66
57
|
/** @deprecated */
|
|
67
|
-
writeFile(path, data, options) {
|
|
68
|
-
|
|
69
|
-
this.fs.writeFile(path, data, options);
|
|
70
|
-
});
|
|
58
|
+
async writeFile(path, data, options) {
|
|
59
|
+
this.fs.writeFile(path, data, options);
|
|
71
60
|
}
|
|
72
61
|
/** @deprecated */
|
|
73
62
|
writeJSON(path, data, options) {
|
|
@@ -82,16 +71,12 @@ let PluginConfigService = class PluginConfigService {
|
|
|
82
71
|
return this.fs.exists(path);
|
|
83
72
|
}
|
|
84
73
|
/** @deprecated */
|
|
85
|
-
rm(path, options) {
|
|
86
|
-
|
|
87
|
-
this.fs.rm(path, options);
|
|
88
|
-
});
|
|
74
|
+
async rm(path, options) {
|
|
75
|
+
this.fs.rm(path, options);
|
|
89
76
|
}
|
|
90
77
|
/** @deprecated */
|
|
91
|
-
readdir(path) {
|
|
92
|
-
return
|
|
93
|
-
return this.fs.readdir(path);
|
|
94
|
-
});
|
|
78
|
+
async readdir(path) {
|
|
79
|
+
return this.fs.readdir(path);
|
|
95
80
|
}
|
|
96
81
|
/** @deprecated */
|
|
97
82
|
createWriteSteam(path) {
|
|
@@ -8,15 +8,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
13
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
14
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
15
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
16
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
17
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
12
|
exports.EventService = void 0;
|
|
22
13
|
const decorators_1 = require("../decorators");
|
|
@@ -79,16 +70,14 @@ let EventService = class EventService {
|
|
|
79
70
|
}
|
|
80
71
|
this.handles[event].delete(handle);
|
|
81
72
|
}
|
|
82
|
-
emit(event, ...args) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
});
|
|
73
|
+
async emit(event, ...args) {
|
|
74
|
+
this.scanListeners();
|
|
75
|
+
if (!this.handles[event]) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
for (const handle of this.handles[event].values()) {
|
|
79
|
+
await handle(...args);
|
|
80
|
+
}
|
|
92
81
|
}
|
|
93
82
|
};
|
|
94
83
|
exports.EventService = EventService;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
declare enum PresetSourceEnum {
|
|
2
|
+
INTERNAL = "internal",
|
|
3
|
+
EXTERNAL = "external",
|
|
4
|
+
GITHUB = "github"
|
|
5
|
+
}
|
|
6
|
+
export type PresetSource = PresetSourceEnum;
|
|
7
|
+
export declare const PresetSource: typeof PresetSourceEnum & {
|
|
8
|
+
values: () => PresetSourceEnum[];
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
exports.PresetSource = void 0;
|
|
4
|
+
var PresetSourceEnum;
|
|
5
|
+
(function (PresetSourceEnum) {
|
|
6
|
+
PresetSourceEnum["INTERNAL"] = "internal";
|
|
7
|
+
PresetSourceEnum["EXTERNAL"] = "external";
|
|
8
|
+
PresetSourceEnum["GITHUB"] = "github";
|
|
9
|
+
})(PresetSourceEnum || (PresetSourceEnum = {}));
|
|
10
|
+
exports.PresetSource = Object.assign({}, PresetSourceEnum, {
|
|
11
|
+
values: () => Object.values(PresetSourceEnum)
|
|
12
|
+
});
|