Skip to content

Commit 81dbaf8

Browse files
authored
Port to node js12 (#47)
* port to nodejs 12 api * add support for nodejs 13 in .travis.yml * update appveyor * remove obsolete version of electron
1 parent 95fb2c9 commit 81dbaf8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1750
-1282
lines changed

.travis.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: cpp
2-
dist: trusty
2+
dist: bionic // 18.04
33
os:
44
- linux
55
- osx
@@ -18,6 +18,9 @@ env:
1818
- TRAVIS_NODE_VERSION="8"
1919
- TRAVIS_NODE_VERSION="9"
2020
- TRAVIS_NODE_VERSION="10"
21+
- TRAVIS_NODE_VERSION="11"
22+
- TRAVIS_NODE_VERSION="12"
23+
- TRAVIS_NODE_VERSION="13"
2124

2225
matrix:
2326
exclude:
@@ -40,7 +43,7 @@ addons:
4043
sources:
4144
- ubuntu-toolchain-r-test
4245
packages:
43-
- g++-4.8
46+
- g++
4447
- libtbb2
4548

4649
before_install:
@@ -72,7 +75,7 @@ before_install:
7275
- npm --version
7376

7477
# use g++ on linux
75-
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then export CXX=g++-4.8; fi
78+
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then export CXX=g++; fi
7679
- $CXX --version
7780
- npm install -g node-pre-gyp-github node-pre-gyp
7881

.vscode/settings.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"files.associations": {
3+
"*.lxx": "cpp",
4+
"istream": "cpp",
5+
"ostream": "cpp",
6+
"array": "cpp",
7+
"functional": "cpp",
8+
"tuple": "cpp",
9+
"type_traits": "cpp",
10+
"utility": "cpp",
11+
"atomic": "cpp",
12+
"bit": "cpp",
13+
"*.tcc": "cpp",
14+
"cctype": "cpp",
15+
"clocale": "cpp",
16+
"cmath": "cpp",
17+
"cstdarg": "cpp",
18+
"cstddef": "cpp",
19+
"cstdint": "cpp",
20+
"cstdio": "cpp",
21+
"cstdlib": "cpp",
22+
"cstring": "cpp",
23+
"ctime": "cpp",
24+
"cwchar": "cpp",
25+
"cwctype": "cpp",
26+
"deque": "cpp",
27+
"list": "cpp",
28+
"map": "cpp",
29+
"set": "cpp",
30+
"unordered_map": "cpp",
31+
"vector": "cpp",
32+
"exception": "cpp",
33+
"algorithm": "cpp",
34+
"iterator": "cpp",
35+
"memory": "cpp",
36+
"memory_resource": "cpp",
37+
"numeric": "cpp",
38+
"optional": "cpp",
39+
"random": "cpp",
40+
"string": "cpp",
41+
"string_view": "cpp",
42+
"system_error": "cpp",
43+
"fstream": "cpp",
44+
"initializer_list": "cpp",
45+
"iomanip": "cpp",
46+
"iosfwd": "cpp",
47+
"iostream": "cpp",
48+
"limits": "cpp",
49+
"new": "cpp",
50+
"sstream": "cpp",
51+
"stdexcept": "cpp",
52+
"streambuf": "cpp",
53+
"cinttypes": "cpp",
54+
"typeinfo": "cpp"
55+
}
56+
}

appveyor.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,28 @@ environment:
4242
- nodejs_version: 10
4343
platform: x64
4444

45+
- nodejs_version: 12
46+
platform: x64
47+
4548
# - electron_version: "1.4.14"
4649
# nodejs_version: 6
4750
# platform: x86
4851

49-
- electron_version: "1.4.14"
50-
nodejs_version: 6
51-
platform: x64
52+
# - electron_version: "1.4.14"
53+
# nodejs_version: 6
54+
# platform: x64
5255

5356
# - electron_version: "1.6.10"
5457
# nodejs_version: 6
5558
# platform: x86
5659

57-
- electron_version: "1.6.10"
58-
nodejs_version: 6
59-
platform: x64
60-
6160
# - electron_version: "1.6.10"
62-
# nodejs_version: 7.4
63-
# platform: x86
61+
# nodejs_version: 6
62+
# platform: x64
63+
64+
- electron_version: "7.0.0"
65+
nodejs_version: 12
66+
platform: x64
6467

6568

6669
# clone directory

lib/occ.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ exports.description = "OpenCascade Wrapper for NodeJS";
1111
require("./mesh").init();
1212
require("./shape").init();
1313

14-
1514
// forward native module
1615
Object.keys(occ).forEach(method => exports[method] = occ[method]);
1716

@@ -21,11 +20,13 @@ exports.XDir = [1, 0, 0];
2120
exports.YDir = [0, 1, 0];
2221
exports.ZDir = [0, 0, 1];
2322

23+
/*
2424
exports.demo = function () {
2525
const solid = occ.makeBox([10, 20, 30], [40, 50, 60]);
2626
solid.mesh;
2727
return solid;
2828
}();
29+
*/
2930

3031
function f(a, w, p) {
3132
return (" " + (a + 0).toFixed(p)).substr(-w);
@@ -55,4 +56,3 @@ occ.Edge.prototype.toString = function () {
5556
return f.toString();
5657
}).join(" ") + "}";
5758
};
58-

lib/shapeFactory.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -595,15 +595,15 @@ exports.makeLegoBrick = function (csg, nX, nY, h) {
595595

596596
exports.makePiston = function (occ) {
597597

598-
// create the top wire
599-
// ---|
600-
// . .
601-
// / |
602-
// 2+-----+ .
603-
// | 3 |
604-
// 1+-------------.
605-
// |<------------w--...>
606-
//
598+
// create the top wire
599+
// ---|
600+
// . .
601+
// / |
602+
// 2+-----+ .
603+
// | 3 |
604+
// 1+-------------.
605+
// |<------------w--...>
606+
//
607607

608608
const w = 65;
609609
const r = 20;

0 commit comments

Comments
 (0)