Skip to content

Commit 81f54a5

Browse files
author
Ovidiu Barabula
committed
feat(core): add config wizard to frontvue instance and await for plugins
1 parent 012b1d8 commit 81f54a5

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/core.spec.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
import { expect } from 'chai';
22
import 'mocha';
3+
import * as inquirerMock from '../test/inquirer-mock';
34
import frontvue from './core';
45

6+
57
describe('Frontvue', () => {
68
it('instantiates', async () => {
79
const instance = await frontvue;
10+
11+
inquirerMock({
12+
fullName: 'John Doe',
13+
useDefault: false,
14+
});
15+
816
expect(instance).to.be.an('object');
9-
});
17+
}).timeout(12000);
1018
});

src/core.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
import ConfigManager from './config-manager';
9+
import ConfigWizard from './config-wizard';
910
import PluginManager from './plugin-manager';
1011
import TaskManager from './task-manager';
1112
import taskInitProject from './tasks/task-init-project';
@@ -19,16 +20,17 @@ async function Frontvue() {
1920
const name = 'frontvue';
2021
const logger = Logger(name);
2122
const configManager = await ConfigManager(name);
23+
const configWizard = ConfigWizard(configManager);
2224
const taskManager = TaskManager({
2325
hooks: [
2426
'init',
2527
],
2628
});
27-
const pluginManager = PluginManager(taskManager);
29+
const pluginManager = PluginManager(taskManager, configWizard);
2830
const { run } = taskManager;
2931

3032
// Use custom plugin
31-
pluginManager.use(taskInitProject);
33+
await pluginManager.use(taskInitProject);
3234

3335
// Return public API
3436
return Object.freeze({

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy