Skip to content

Commit

Permalink
change the schema to support ppx arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
bobzhang committed Jul 30, 2019
1 parent 9157ad0 commit e9f68ec
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
13 changes: 12 additions & 1 deletion docs/docson/build-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,18 @@
"ppx-specs": {
"type": "array",
"items": {
"type": "string"
"oneOf" : [
{
"type": "string"
},
{
"type" : "array",
"items": {
"type" : "string"
}
}
]

}
},
"pp-specs": {
Expand Down
7 changes: 6 additions & 1 deletion jscomp/build_tests/scoped_ppx/bsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"ppx-flags": ["@hongbo/ppx1/test.js"],
"ppx-flags":
[
["@hongbo/ppx1/test.js", "-hello"],
["@hongbo/ppx1/test.js", "-heyy"],
"@hongbo/ppx1/test.js"
],
"sources" : {
"dir": "src"
},
Expand Down
11 changes: 9 additions & 2 deletions jscomp/build_tests/scoped_ppx/input.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
var cp = require('child_process')
var cp = require("child_process");
var assert = require('assert')
cp.execSync(`bsb`, { cwd: __dirname, stdio: [0, 1, 2], encoding: "utf8" });

var output = cp.execSync(`bsb -- -t commands src/hello.mlast`, {
cwd: __dirname,
encoding: "utf8"
});
assert(/-ppx '.*\/test\.js -hello' -ppx '.*\/test\.js -heyy' -ppx .*test\.js/.test(output))

cp.execSync(`bsb -regen`)

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e9f68ec

Please sign in to comment.