File tree Expand file tree Collapse file tree 2 files changed +34
-7
lines changed Expand file tree Collapse file tree 2 files changed +34
-7
lines changed Original file line number Diff line number Diff line change 1
1
import { expect } from 'chai' ;
2
2
import 'mocha' ;
3
+ import frontvue from './core' ;
3
4
4
5
describe ( 'Frontvue' , ( ) => {
5
- it ( 'instantiates' ) ;
6
+ it ( 'instantiates' , async ( ) => {
7
+ const instance = await frontvue ;
8
+ expect ( instance ) . to . be . an ( 'object' ) ;
9
+ } ) ;
6
10
} ) ;
Original file line number Diff line number Diff line change 5
5
* @since 0.1.0
6
6
*/
7
7
8
- import ConfigManagerFactory from './config-manager/index' ;
9
- import TaskManager from './task-manager/index' ;
8
+ import ConfigManager from './config-manager' ;
9
+ import PluginManager from './plugin-manager' ;
10
+ import TaskManager from './task-manager' ;
11
+ import taskInitProject from './tasks/task-init-project' ;
10
12
11
- ( async function frontvue ( ) {
13
+
14
+ /**
15
+ * Main Frontvue constructor
16
+ */
17
+ async function Frontvue ( ) {
12
18
const name = 'frontvue' ;
13
- const configManager = await ConfigManagerFactory ( name ) ;
14
- const taskManager = TaskManager ( ) ;
15
- } ( ) ) ;
19
+ const configManager = await ConfigManager ( name ) ;
20
+ const taskManager = TaskManager ( {
21
+ hooks : [
22
+ 'init' ,
23
+ ] ,
24
+ } ) ;
25
+ const pluginManager = PluginManager ( taskManager ) ;
26
+ const { run } = taskManager ;
27
+
28
+ // Use custom plugin
29
+ pluginManager . use ( taskInitProject ) ;
30
+
31
+ // Return public API
32
+ return Object . freeze ( {
33
+ name,
34
+ run,
35
+ } ) ;
36
+ }
37
+
38
+ export default Frontvue ( ) ;
You can’t perform that action at this time.
0 commit comments