diff options
author | Max Romanov <max.romanov@nginx.com> | 2021-06-15 10:35:15 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2021-06-15 10:35:15 +0300 |
commit | 1e3f7808b1091d76b80369a93f0361453247f368 (patch) | |
tree | cfdb4314905fc9640115cc6e9bfa910b1b7e2023 | |
parent | fd3558456edc752d43b58a0c0e1b99e5a45edae9 (diff) | |
download | unit-1e3f7808b1091d76b80369a93f0361453247f368.tar.gz unit-1e3f7808b1091d76b80369a93f0361453247f368.tar.bz2 |
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.
-rw-r--r-- | auto/modules/nodejs | 7 | ||||
-rw-r--r-- | src/nodejs/unit-http/package.json | 22 |
2 files changed, 5 insertions, 24 deletions
diff --git a/auto/modules/nodejs b/auto/modules/nodejs index b2309143..7d4f8581 100644 --- a/auto/modules/nodejs +++ b/auto/modules/nodejs @@ -157,6 +157,7 @@ ${NXT_NODE}-copy: ${NXT_NODE_VERSION_FILE} ${NXT_NODE_PACKAGE_FILE} mkdir -p ${NXT_NODE_TMP} cp -rp src/nodejs/unit-http/* ${NXT_NODE_TMP}/ cp -p ${NXT_NODE_VERSION_FILE} ${NXT_NODE_PACKAGE_FILE} ${NXT_NODE_TMP}/ + rm -f ${NXT_NODE_TMP}/binding_pub.gyp ${NXT_NODE}-copy-g: ${NXT_NODE_VERSION_FILE} ${NXT_NODE_PACKAGE_FILE} mkdir -p ${NXT_NODE_TMP_G} @@ -174,10 +175,12 @@ ${NXT_NODE_PACKAGE_FILE}: ${NXT_VERSION_H} src/nodejs/unit-http/package.json src/nodejs/unit-http/package.json > ${NXT_NODE_PACKAGE_FILE} ${NXT_NODE_TARBALL}: ${NXT_NODE}-copy - tar -zcvf ${NXT_NODE_TARBALL} -C ${NXT_NODE_TMP} . + cd ${NXT_NODE_TMP} && npm pack + mv ${NXT_NODE_TMP}/unit-http-\$(NXT_VERSION).tgz ${NXT_NODE_TARBALL} ${NXT_NODE_TARBALL_G}: ${NXT_NODE}-copy-g - tar -zcvf ${NXT_NODE_TARBALL_G} -C ${NXT_NODE_TMP_G} . + cd ${NXT_NODE_TMP_G} && npm pack + mv ${NXT_NODE_TMP_G}/unit-http-\$(NXT_VERSION).tgz ${NXT_NODE_TARBALL_G} install: ${NXT_NODE}-$NXT_NODE_INSTALL diff --git a/src/nodejs/unit-http/package.json b/src/nodejs/unit-http/package.json index f0afe41c..debbd492 100644 --- a/src/nodejs/unit-http/package.json +++ b/src/nodejs/unit-http/package.json @@ -3,28 +3,6 @@ "version": "%%VERSION%%", "description": "HTTP module for NGINX Unit", "main": "http.js", - "files": [ - "unit.h", - "version.h", - "addon.cpp", - "unit.cpp", - "http.js", - "http_server.js", - "loader.js", - "loader.mjs", - "nxt_napi.h", - "package.json", - "socket.js", - "binding.gyp", - "README.md", - "websocket.js", - "websocket_connection.js", - "websocket_frame.js", - "websocket_request.js", - "websocket_router.js", - "websocket_router_request.js", - "websocket_server.js" - ], "scripts": { "clean": "node-gyp clean", "configure": "node-gyp configure", |