@@ -10,6 +10,22 @@ const tasks = {
10
10
output : 'nbclassic/static/notebook/js/main.min.js' ,
11
11
command : [ 'node' , 'tools/build-main.js' , 'notebook' ] ,
12
12
} ,
13
+ tree : {
14
+ output : 'nbclassic/static/tree/js/main.min.js' ,
15
+ command : [ 'node' , 'tools/build-main.js' , 'tree' ] ,
16
+ } ,
17
+ edit : {
18
+ output : 'nbclassic/static/edit/js/main.min.js' ,
19
+ command : [ 'node' , 'tools/build-main.js' , 'edit' ] ,
20
+ } ,
21
+ terminal : {
22
+ output : 'nbclassic/static/terminal/js/main.min.js' ,
23
+ command : [ 'node' , 'tools/build-main.js' , 'terminal' ] ,
24
+ } ,
25
+ auth : {
26
+ output : 'nbclassic/static/auth/js/main.min.js' ,
27
+ command : [ 'node' , 'tools/build-main.js' , 'auth' ] ,
28
+ } ,
13
29
ipythonCss : {
14
30
output : 'nbclassic/static/style/ipython.min.css' ,
15
31
command : [ 'lessc' , '--source-map' , '--include-path=nbclassic/static/style' ,
@@ -31,13 +47,11 @@ const tasks = {
31
47
const langPath = lang . includes ( '_' ) ? lang : lang ;
32
48
const input = `nbclassic/i18n/${ langPath } /LC_MESSAGES/nbjs.po` ;
33
49
const output = `nbclassic/i18n/${ langPath } /LC_MESSAGES/nbjs.json` ;
34
-
35
50
console . log ( `Building translation for ${ lang } ...` ) ;
36
51
const proc = spawn ( 'po2json' , [
37
52
'-p' , '-F' , '-f' , 'jed1.x' , '-d' , 'nbjs' ,
38
53
input , output
39
54
] , { stdio : 'inherit' } ) ;
40
-
41
55
await new Promise ( ( resolve , reject ) => {
42
56
proc . on ( 'close' , code => {
43
57
if ( code === 0 ) resolve ( ) ;
@@ -54,7 +68,6 @@ async function runTask(taskName) {
54
68
if ( ! task ) {
55
69
throw new Error ( `Unknown task: ${ taskName } ` ) ;
56
70
}
57
-
58
71
console . log ( `Building ${ taskName } ...` ) ;
59
72
if ( task . buildFn ) {
60
73
await task . buildFn ( ) ;
@@ -87,15 +100,26 @@ async function clean() {
87
100
}
88
101
}
89
102
103
+ // Define the build order explicitly
104
+ const buildOrder = [
105
+ 'webpack' ,
106
+ 'notebook' ,
107
+ 'tree' ,
108
+ 'edit' ,
109
+ 'terminal' ,
110
+ 'auth' ,
111
+ 'translations' ,
112
+ 'ipythonCss' ,
113
+ 'styleCss'
114
+ ] ;
115
+
90
116
async function runAll ( ) {
91
- for ( const taskName of Object . keys ( tasks ) ) {
92
- if ( taskName !== 'bower' ) {
93
- try {
94
- await runTask ( taskName ) ;
95
- } catch ( err ) {
96
- console . error ( `Error in task ${ taskName } :` , err ) ;
97
- process . exit ( 1 ) ;
98
- }
117
+ for ( const taskName of buildOrder ) {
118
+ try {
119
+ await runTask ( taskName ) ;
120
+ } catch ( err ) {
121
+ console . error ( `Error in task ${ taskName } :` , err ) ;
122
+ process . exit ( 1 ) ;
99
123
}
100
124
}
101
125
}
0 commit comments