Skip to content

Commit 9968179

Browse files
authored
Merge pull request #4690 from rescript-lang/fix_1436
allow . in file names to provide xx.ios.js/xx.android.js (#1436)
2 parents fb60da3 + 8c2db8d commit 9968179

23 files changed

+134
-21
lines changed

jscomp/bsb/templates/basic/bsconfig.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,5 @@
44
"sources": {
55
"dir" : "src",
66
"subdirs" : true
7-
},
8-
"package-specs": {
9-
"module": "commonjs",
10-
"in-source": true
11-
},
12-
"suffix": ".bs.js",
13-
"bs-dependencies": [
14-
],
15-
"refmt": 3
7+
}
168
}

jscomp/build_tests/top/input.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ var cmjTargets = output
1414
.filter(x => x.endsWith(".cmj"))
1515
.map(x => path.basename(x))
1616
.sort();
17-
18-
assert.deepEqual(cmjTargets, ["demo.cmj", "hello00.cmj","hexll.cmj"]);
17+
cmjTargets.sort()
18+
var expected = ["demo.cmj", "hello00.cmj","hexll..cmj",'hexll.cmj']
19+
expected.sort()
20+
assert.deepEqual(cmjTargets, expected);
1921

2022

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
*.exe
2+
*.obj
3+
*.out
4+
*.compile
5+
*.native
6+
*.byte
7+
*.cmo
8+
*.annot
9+
*.cmi
10+
*.cmx
11+
*.cmt
12+
*.cmti
13+
*.cma
14+
*.a
15+
*.cmxa
16+
*.obj
17+
*~
18+
*.annot
19+
*.cmj
20+
*.bak
21+
lib/bs
22+
*.mlast
23+
*.mliast
24+
.vscode
25+
.merlin
26+
.bsb.lock
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
3+
# Build
4+
```
5+
npm run build
6+
```
7+
8+
# Watch
9+
10+
```
11+
npm run watch
12+
```
13+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "weird_names",
3+
"version": "0.1.0",
4+
"sources": {
5+
"dir" : "src",
6+
"subdirs" : true
7+
}
8+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
var cp = require("child_process");
2+
var assert = require("assert");
3+
var path = require("path");
4+
5+
var out = cp.spawnSync(`bsb`, { encoding: "utf8" });
6+
7+
console.log(out.stdout);
8+
assert.ok(out.stderr === "");
9+
10+
let files = [
11+
"_app.res",
12+
"[...params_max_3].res",
13+
"[...params].res",
14+
"[[...params]].res",
15+
"[slug_or_ID].res",
16+
"404.res",
17+
];
18+
19+
for (let f of files) {
20+
let { name } = path.parse(f);
21+
let m = `./lib/js/src/${name}.js`;
22+
// console.log(m);
23+
assert.deepEqual(require(m), { a: 1 });
24+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "weird_names",
3+
"version": "0.1.0",
4+
"scripts": {
5+
"clean": "bsb -clean-world",
6+
"build": "bsb -make-world",
7+
"watch": "bsb -make-world -w"
8+
},
9+
"keywords": [
10+
"BuckleScript"
11+
],
12+
"author": "",
13+
"license": "MIT",
14+
"devDependencies": {
15+
"bs-platform": "^8.3.0-dev.2"
16+
}
17+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let a = 1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let a = 1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let a = 1

0 commit comments

Comments
 (0)