Skip to content

Commit a1d2ced

Browse files
committed
Node.js: improving and test packaging.
The patch removes the "files" section from package.json to avoid future issues with missing files. For package testing purposes, 'npm pack' is used instead of plain 'tar' to simulate packaging more accurately.
1 parent 9e711cf commit a1d2ced

File tree

2 files changed

+5
-24
lines changed

2 files changed

+5
-24
lines changed

auto/modules/nodejs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ ${NXT_NODE}-copy: ${NXT_NODE_VERSION_FILE} ${NXT_NODE_PACKAGE_FILE}
157157
mkdir -p ${NXT_NODE_TMP}
158158
cp -rp src/nodejs/unit-http/* ${NXT_NODE_TMP}/
159159
cp -p ${NXT_NODE_VERSION_FILE} ${NXT_NODE_PACKAGE_FILE} ${NXT_NODE_TMP}/
160+
rm -f ${NXT_NODE_TMP}/binding_pub.gyp
160161

161162
${NXT_NODE}-copy-g: ${NXT_NODE_VERSION_FILE} ${NXT_NODE_PACKAGE_FILE}
162163
mkdir -p ${NXT_NODE_TMP_G}
@@ -174,10 +175,12 @@ ${NXT_NODE_PACKAGE_FILE}: ${NXT_VERSION_H} src/nodejs/unit-http/package.json
174175
src/nodejs/unit-http/package.json > ${NXT_NODE_PACKAGE_FILE}
175176

176177
${NXT_NODE_TARBALL}: ${NXT_NODE}-copy
177-
tar -zcvf ${NXT_NODE_TARBALL} -C ${NXT_NODE_TMP} .
178+
cd ${NXT_NODE_TMP} && npm pack
179+
mv ${NXT_NODE_TMP}/unit-http-\$(NXT_VERSION).tgz ${NXT_NODE_TARBALL}
178180

179181
${NXT_NODE_TARBALL_G}: ${NXT_NODE}-copy-g
180-
tar -zcvf ${NXT_NODE_TARBALL_G} -C ${NXT_NODE_TMP_G} .
182+
cd ${NXT_NODE_TMP_G} && npm pack
183+
mv ${NXT_NODE_TMP_G}/unit-http-\$(NXT_VERSION).tgz ${NXT_NODE_TARBALL_G}
181184

182185

183186
install: ${NXT_NODE}-$NXT_NODE_INSTALL

src/nodejs/unit-http/package.json

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,6 @@
33
"version": "%%VERSION%%",
44
"description": "HTTP module for NGINX Unit",
55
"main": "http.js",
6-
"files": [
7-
"unit.h",
8-
"version.h",
9-
"addon.cpp",
10-
"unit.cpp",
11-
"http.js",
12-
"http_server.js",
13-
"loader.js",
14-
"loader.mjs",
15-
"nxt_napi.h",
16-
"package.json",
17-
"socket.js",
18-
"binding.gyp",
19-
"README.md",
20-
"websocket.js",
21-
"websocket_connection.js",
22-
"websocket_frame.js",
23-
"websocket_request.js",
24-
"websocket_router.js",
25-
"websocket_router_request.js",
26-
"websocket_server.js"
27-
],
286
"scripts": {
297
"clean": "node-gyp clean",
308
"configure": "node-gyp configure",

0 commit comments

Comments
 (0)