Skip to content

Commit e9f68ec

Browse files
committed
change the schema to support ppx arguments
1 parent 9157ad0 commit e9f68ec

File tree

4 files changed

+30
-5
lines changed

4 files changed

+30
-5
lines changed

docs/docson/build-schema.json

+12-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,18 @@
6767
"ppx-specs": {
6868
"type": "array",
6969
"items": {
70-
"type": "string"
70+
"oneOf" : [
71+
{
72+
"type": "string"
73+
},
74+
{
75+
"type" : "array",
76+
"items": {
77+
"type" : "string"
78+
}
79+
}
80+
]
81+
7182
}
7283
},
7384
"pp-specs": {

jscomp/build_tests/scoped_ppx/bsconfig.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
2-
"ppx-flags": ["@hongbo/ppx1/test.js"],
2+
"ppx-flags":
3+
[
4+
["@hongbo/ppx1/test.js", "-hello"],
5+
["@hongbo/ppx1/test.js", "-heyy"],
6+
"@hongbo/ppx1/test.js"
7+
],
38
"sources" : {
49
"dir": "src"
510
},

jscomp/build_tests/scoped_ppx/input.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1-
var cp = require('child_process')
1+
var cp = require("child_process");
2+
var assert = require('assert')
3+
cp.execSync(`bsb`, { cwd: __dirname, stdio: [0, 1, 2], encoding: "utf8" });
4+
5+
var output = cp.execSync(`bsb -- -t commands src/hello.mlast`, {
6+
cwd: __dirname,
7+
encoding: "utf8"
8+
});
9+
assert(/-ppx '.*\/test\.js -hello' -ppx '.*\/test\.js -heyy' -ppx .*test\.js/.test(output))
210

3-
cp.execSync(`bsb -regen`)

jscomp/build_tests/scoped_ppx/node_modules/@hongbo/ppx1/test.js

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)