Skip to content

Commit 8a84c9c

Browse files
committed
1. fix typos
2. error code when bsb fails 3. consistent schema changes: a. default all public b. sources can be either string/object or an array of string/object (which applies to subdirrs)
1 parent f2cc5f3 commit 8a84c9c

File tree

12 files changed

+388
-360
lines changed

12 files changed

+388
-360
lines changed

bin/bsb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ if (fs.existsSync(bsconfig)) {
1414
try {
1515
child_process.execFileSync(bsb_exe, delegate_args, { stdio: 'inherit' })
1616
} catch (e) {
17-
console.error('Error happend when running command', bsb_exe, 'with args', delegate_args)
17+
console.error('Error happened when running command', bsb_exe, 'with args', delegate_args)
18+
process.exit(2)
1819
}
1920
} else {
2021
var path = require('path')
@@ -32,7 +33,8 @@ if (fs.existsSync(bsconfig)) {
3233
try {
3334
child_process.execFileSync(bsb_exe, delegate_args, { stdio: 'inherit', cwd: search_dir })
3435
} catch (e) {
35-
console.error('Error happend when running command', bsb_exe, 'with args', delegate_args)
36+
console.error('Error happened when running command', bsb_exe, 'with args', delegate_args)
37+
process.exit(2)
3638
}
3739
}
3840
}

bsconfig.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,9 @@
4545
"a4_a5.ml",
4646
"x.ml"
4747
]
48-
},
49-
{
50-
"dir": "glob",
51-
"files": {
52-
"slow-re": "glob.*\\.mli?",
53-
"excludes": [
54-
"glob_test_u.ml"
55-
]
56-
}
5748
}
49+
, "glob"
50+
5851
],
5952
"files": [
6053
// "ppx_lwt.ml",

docs/docson/build-schema.json

Lines changed: 44 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,22 @@
3535
"$ref": "#/definitions/single-ppx-spec"
3636
}
3737
},
38+
"bs-dependency" : {
39+
"type" : "string",
40+
"title": "dependency"
41+
},
3842
"bs-dependencies": {
3943
"type": "array",
4044
"items": {
41-
"type": "string"
45+
"$ref": "#/definitions/bs-dependency"
4246
},
4347
"description": "Bucklescript package dependencies"
4448
},
4549
"sourceItem": {
4650
"title": "sourceItem",
51+
"oneOf" : [
52+
{
53+
"type" : "object",
4754
"properties": {
4855
"dir": {
4956
"type": "string"
@@ -93,15 +100,18 @@
93100
{
94101
"enum": [
95102
"all"
96-
]
103+
],
104+
"description": "All modules in this directory"
97105
},
98106
{
99107
"type": "array",
100108
"items": {
101109
"type": "string"
102-
}
110+
},
111+
"description": "Selected modules, for example, [Module_a, Module_b] "
103112
}
104-
]
113+
],
114+
"description": "default: export all modules by default, it is recommended for library developers to hide some interfaces"
105115
},
106116
"resources": {
107117
"type": "array",
@@ -110,10 +120,8 @@
110120
}
111121
},
112122
"subdirs": {
113-
"type": "array",
114-
"items": {
115-
"$ref": "#/definitions/sourceItem"
116-
}
123+
"$ref" : "#/definitions/sources",
124+
"description": "nested specifications inside"
117125
},
118126
"group": {
119127
"oneOf": [
@@ -132,7 +140,8 @@
132140
}
133141
}
134142
}
135-
]
143+
],
144+
"description": "Not implemented yet"
136145
},
137146
"internal-depends": {
138147
"type": "array",
@@ -145,6 +154,29 @@
145154
"required": [
146155
"dir"
147156
]
157+
},
158+
{
159+
"title": "single non nested directory",
160+
"type" : "string",
161+
"description": "directory name (no nested)"
162+
}
163+
]
164+
},
165+
"sources" : {
166+
"oneOf": [
167+
{
168+
"type": "array",
169+
"items": {
170+
"$ref": "#/definitions/sourceItem"
171+
},
172+
"description" : "A list of source items"
173+
},
174+
{
175+
"$ref": "#/definitions/sourceItem",
176+
"description": "A single source item"
177+
}
178+
],
179+
"description": "can be either a single sourceItem or an array of sourceItems, sourceItem can be either a single string(non nested directory) or an detailed object config"
148180
},
149181
"stringArray": {
150182
"type": "array",
@@ -208,24 +240,13 @@
208240
"description": "external include directories, which will be applied -I to all compilation units, it is *not needed* in most cases"
209241
},
210242
"sources": {
211-
"oneOf": [
212-
{
213-
"type": "array",
214-
"items": {
215-
"$ref": "#/definitions/sourceItem"
216-
},
217-
"description" : "A list of source items"
218-
},
219-
{
220-
"$ref": "#/definitions/sourceItem",
221-
"description": "A single source item"
222-
}
223-
]
243+
"$ref" : "#/definitions/sources",
244+
"description": "specication of where source code is "
224245
},
225246

226247
"generate-merlin": {
227248
"type": "boolean",
228-
"description": "default false (generate .merlin)"
249+
"description": "default true (generate .merlin)"
229250
}
230251
},
231252
"additionalProperties": false,

jscomp/all.depend

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,8 +673,8 @@ bsb/bsb_ninja.cmx : ext/string_set.cmx ext/string_map.cmx ext/literals.cmx \
673673
bsb/bsb_build_ui.cmx bsb/bsb_build_schemas.cmx common/binary_cache.cmx \
674674
bsb/bsb_ninja.cmi
675675
bsb/bsb_unix.cmx : bsb/bsb_unix.cmi
676-
bsb/bsb_build_ui.cmi : ext/string_set.cmi ext/string_map.cmi \
677-
ext/ext_json.cmi ext/ext_file_pp.cmi common/binary_cache.cmi
676+
bsb/bsb_build_ui.cmi : ext/string_set.cmi ext/ext_json.cmi \
677+
ext/ext_file_pp.cmi common/binary_cache.cmi
678678
bsb/bsb_build_util.cmi : ext/ext_json.cmi
679679
bsb/bsb_config.cmi :
680680
bsb/bsb_default.cmi : ext/string_set.cmi ext/ext_json.cmi

jscomp/bin/all_ounit_tests.ml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7540,6 +7540,7 @@ type callback =
75407540
| `Arr_loc of (t array -> Lexing.position -> Lexing.position -> unit)
75417541
| `Null of (unit -> unit)
75427542
| `Not_found of (unit -> unit)
7543+
| `Id of (t -> unit )
75437544
]
75447545

75457546
val test:
@@ -8243,6 +8244,7 @@ type callback =
82438244
| `Arr_loc of (t array -> Lexing.position -> Lexing.position -> unit)
82448245
| `Null of (unit -> unit)
82458246
| `Not_found of (unit -> unit)
8247+
| `Id of (t -> unit )
82468248
]
82478249

82488250
let test ?(fail=(fun () -> ())) key
@@ -8252,7 +8254,7 @@ let test ?(fail=(fun () -> ())) key
82528254
| exception Not_found ->
82538255
begin match cb with `Not_found f -> f ()
82548256
| _ -> fail ()
8255-
end
8257+
end
82568258
| `True, `Bool cb -> cb true
82578259
| `False, `Bool cb -> cb false
82588260
| `Flo s , `Flo cb -> cb s
@@ -8263,6 +8265,7 @@ let test ?(fail=(fun () -> ())) key
82638265
| `Null, `Null cb -> cb ()
82648266
| `Str {str = s }, `Str cb -> cb s
82658267
| `Str {str = s ; loc }, `Str_loc cb -> cb s loc
8268+
| any , `Id cb -> cb any
82668269
| _, _ -> fail ()
82678270
end;
82688271
m
@@ -8281,7 +8284,7 @@ let query path (json : t ) =
82818284
end
82828285
in aux [] path json
82838286

8284-
# 733 "ext/ext_json.ml"
8287+
# 735 "ext/ext_json.ml"
82858288

82868289
end
82878290
module Ounit_json_tests

0 commit comments

Comments
 (0)