Skip to content

Commit d05dae6

Browse files
committed
fix: compile the build typescript files for production
1 parent cc55f92 commit d05dae6

File tree

5 files changed

+32
-24
lines changed

5 files changed

+32
-24
lines changed

.eslintrc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717
"node_modules/",
1818
"build/",
1919
"lib/",
20-
"libzmq/",
2120
"tmp/",
22-
"zmq/",
23-
"v5-compat.d.ts",
24-
"draft.d.ts"
21+
"./*.d.ts",
22+
"script/*.js",
23+
"script/*.d.ts"
2524
]
2625
}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@ prebuilds
1313
test.js
1414
.cache/
1515
test/typings-compatibility/
16+
script/*.js
17+
script/*.d.ts
18+
script/*/*.js
19+
script/*/*.d.ts

binding.gyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
'outputs': ['<(module_root_dir)/build/libzmq/lib/libzmq.lib', '<(module_root_dir)/build/libzmq/include/zmq.h', '<(module_root_dir)/build/libzmq/include/zmq_utils.h'],
2626
}],
2727
],
28-
'action': ['ts-node', '<(module_root_dir)/script/build.ts'],
28+
'action': ['node', '<(module_root_dir)/script/build.js'],
2929
}],
3030
}],
3131
],

package.json

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,22 @@
1717
"url": "https://github.com/zeromq/zeromq.js.git"
1818
},
1919
"dependencies": {
20-
"@types/node": "^18.11.9",
21-
"@types/shelljs": "^0.8.11",
22-
"cross-env": "^7.0.3",
2320
"node-addon-api": "^5.0.0",
2421
"node-gyp-build": "^4.5.0",
25-
"shelljs": "^0.8.5",
26-
"ts-node": "10.9"
22+
"shelljs": "^0.8.5"
2723
},
2824
"devDependencies": {
2925
"@gnd/typedoc": "^0.15.0-0",
3026
"@types/chai": ">=4.3",
3127
"@types/fs-extra": "^9.0.13",
3228
"@types/mocha": ">=10.0",
29+
"@types/node": "^18.11.9",
3330
"@types/semver": ">=7",
31+
"@types/shelljs": "^0.8.11",
3432
"@types/weak-napi": "^2.0.1",
3533
"benchmark": ">=2",
3634
"chai": ">=4.3",
35+
"cross-env": "^7.0.3",
3736
"deasync": "^0.1.28",
3837
"eslint-config-atomic": "^1.18.1",
3938
"eslint-plugin-prettier": "^4.2.1",
@@ -50,6 +49,7 @@
5049
"shx": "^0.3.4",
5150
"tar-fs": "^2.1.1",
5251
"ts-morph": "^16.0.0",
52+
"ts-node": "10.9",
5353
"typescript": "4.9",
5454
"weak-napi": "^2.0.2"
5555
},
@@ -61,30 +61,27 @@
6161
"LICENSE",
6262
"README.md",
6363
"binding.gyp",
64-
"draft.d.ts",
65-
"draft.js",
64+
"*.d.ts",
65+
"*.js",
6666
"lib",
67-
"src/util/*.h",
68-
"src/*.cc",
69-
"src/*.h",
70-
"script/build.ts",
67+
"src",
68+
"script",
7169
"prebuilds",
72-
"v5-compat.d.ts",
73-
"v5-compat.js",
74-
"vendor/*.h",
75-
"vendor/LICENSE.md"
70+
"tsconfig.json"
7671
],
7772
"scripts": {
7873
"install": "node-gyp-build",
7974
"clean": "shx rm -rf ./build ./lib/ ./prebuilds",
8075
"clean.temp": "shx rm -rf ./tmp && shx mkdir -p tmp && shx touch tmp/.gitkeep",
81-
"build.js": "tsc --project tsconfig-build.json && node script/ci/downlevel-dts.js",
76+
"build.library": "shx rm -rf ./lib && tsc && node script/ci/downlevel-dts.js",
77+
"build.script": "tsc -p ./script/tsconfig.json",
78+
"build.js": "run-p build.script build.library",
8279
"build.doc": "typedoc --out docs --name zeromq.js --excludeProtected --excludePrivate --excludeNotExported --excludeExternals --externalPattern 'src/+(draft|native|compat).ts' --tsconfig tsconfig-build.json --mode file",
83-
"prebuild": "ts-node -P ./tsconfig.json ./script/prebuild.ts",
80+
"prebuild": "run-s build.js && node ./script/prebuild.js",
8481
"build.native": "node-gyp configure --release && node-gyp build --release",
8582
"build.native.debug": "cross-env CMAKE_BUILD_TYPE=Debug node-gyp configure --debug && cross-env CMAKE_BUILD_TYPE=Debug node-gyp build --debug",
86-
"build": "run-p build.js build.native",
87-
"build.debug": "run-p build.js build.native.debug",
83+
"build": "run-s build.js build.native",
84+
"build.debug": "run-s build.js build.native.debug",
8885
"test": "run-s build && mocha",
8986
"test.skip_gc_tests": "run-s build.debug && cross-env SKIP_GC_TESTS=true mocha",
9087
"lint.clang-format": "clang-format -i -style=file ./src/*.cc ./src/*.h ./src/util/*.h",

script/tsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "./"
5+
},
6+
"include": ["./**/*.ts"],
7+
"exclude": []
8+
}

0 commit comments

Comments
 (0)