Skip to content

Commit 7fbf50e

Browse files
upgrade node (#17)
1 parent be8553c commit 7fbf50e

File tree

4 files changed

+53
-16
lines changed

4 files changed

+53
-16
lines changed

Dockerfile

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:16.20.1-alpine
1+
FROM node:18.17.1-alpine
22

33
RUN apk update && apk upgrade && apk add --no-cache bash mc
44
RUN mkdir -p /debugger
@@ -10,7 +10,8 @@ COPY package.json ./
1010
COPY yarn.lock ./
1111
# install cf-runtime required binaries
1212
RUN apk add --no-cache --virtual buildDeps make python3 g++ git && \
13-
yarn install --forzen-lockfile --production
13+
npm update -g npm && \
14+
yarn install --frozen-lockfile --production
1415

1516
RUN yarn cache clean && \
1617
apk del buildDeps && \

package.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
{
22
"name": "cf-debugger",
3-
"version": "1.3.3",
3+
"version": "1.3.4",
44
"main": "index.js",
55
"license": "MIT",
6+
"resolutions": {
7+
"nan": "2.17.0",
8+
"semver": "7.5.4"
9+
},
610
"dependencies": {
7-
"node-pty": "git+https://github.com/microsoft/node-pty.git"
11+
"node-pty": "^1.0.0"
812
}
913
}

src/app.js

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
11
const pty = require('node-pty');
22
const Resizer = require('./Resizer.js');
33

4+
let exit = false;
5+
46
const shell = pty.spawn('/bin/bash', [], {
5-
name: 'xterm',
7+
name: 'xterm-color',
68
cwd: process.env.PWD,
79
env: process.env
810
});
9-
shell.on('exit', (code) => {
10-
process.exit(code);
11+
12+
process.on('uncaughtException', (err) => {
13+
if (exit) {
14+
process.exit(0)
15+
}
16+
console.error(err.message);
17+
console.error(err.stack);
1118
});
1219

1320
const resizerStream = new Resizer(shell.resize.bind(shell));
21+
22+
shell.on('close', () => {
23+
exit = true
24+
})
25+
1426
process.stdin
1527
.pipe(resizerStream)
1628
.pipe(shell)

yarn.lock

+29-9
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,33 @@
22
# yarn lockfile v1
33

44

5-
nan@^2.14.0:
6-
version "2.16.0"
7-
resolved "https://registry.yarnpkg.com/nan/-/nan-2.16.0.tgz#664f43e45460fb98faf00edca0bb0d7b8dce7916"
8-
integrity sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA==
9-
10-
"node-pty@git+https://github.com/microsoft/node-pty.git":
11-
version "0.10.0"
12-
resolved "git+https://github.com/microsoft/node-pty.git#1674722e1caf3ff4dd52438b70ed68d46af83a6d"
5+
lru-cache@^6.0.0:
6+
version "6.0.0"
7+
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
8+
integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==
139
dependencies:
14-
nan "^2.14.0"
10+
yallist "^4.0.0"
11+
12+
[email protected], nan@^2.17.0:
13+
version "2.17.0"
14+
resolved "https://registry.yarnpkg.com/nan/-/nan-2.17.0.tgz#c0150a2368a182f033e9aa5195ec76ea41a199cb"
15+
integrity sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==
16+
17+
node-pty@^1.0.0:
18+
version "1.0.0"
19+
resolved "https://registry.yarnpkg.com/node-pty/-/node-pty-1.0.0.tgz#7daafc0aca1c4ca3de15c61330373af4af5861fd"
20+
integrity sha512-wtBMWWS7dFZm/VgqElrTvtfMq4GzJ6+edFI0Y0zyzygUSZMgZdraDUMUhCIvkjhJjme15qWmbyJbtAx4ot4uZA==
21+
dependencies:
22+
nan "^2.17.0"
23+
24+
25+
version "7.5.4"
26+
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
27+
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
28+
dependencies:
29+
lru-cache "^6.0.0"
30+
31+
yallist@^4.0.0:
32+
version "4.0.0"
33+
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
34+
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==

0 commit comments

Comments
 (0)