Skip to content

Commit

Permalink
upgrade node (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-codefresh authored Sep 12, 2023
1 parent be8553c commit 7fbf50e
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 16 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16.20.1-alpine
FROM node:18.17.1-alpine

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

RUN yarn cache clean && \
apk del buildDeps && \
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{
"name": "cf-debugger",
"version": "1.3.3",
"version": "1.3.4",
"main": "index.js",
"license": "MIT",
"resolutions": {
"nan": "2.17.0",
"semver": "7.5.4"
},
"dependencies": {
"node-pty": "git+https://github.com/microsoft/node-pty.git"
"node-pty": "^1.0.0"
}
}
18 changes: 15 additions & 3 deletions src/app.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
const pty = require('node-pty');
const Resizer = require('./Resizer.js');

let exit = false;

const shell = pty.spawn('/bin/bash', [], {
name: 'xterm',
name: 'xterm-color',
cwd: process.env.PWD,
env: process.env
});
shell.on('exit', (code) => {
process.exit(code);

process.on('uncaughtException', (err) => {
if (exit) {
process.exit(0)
}
console.error(err.message);
console.error(err.stack);
});

const resizerStream = new Resizer(shell.resize.bind(shell));

shell.on('close', () => {
exit = true
})

process.stdin
.pipe(resizerStream)
.pipe(shell)
Expand Down
38 changes: 29 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,33 @@
# yarn lockfile v1


nan@^2.14.0:
version "2.16.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.16.0.tgz#664f43e45460fb98faf00edca0bb0d7b8dce7916"
integrity sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA==

"node-pty@git+https://github.com/microsoft/node-pty.git":
version "0.10.0"
resolved "git+https://github.com/microsoft/node-pty.git#1674722e1caf3ff4dd52438b70ed68d46af83a6d"
lru-cache@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==
dependencies:
nan "^2.14.0"
yallist "^4.0.0"

[email protected], nan@^2.17.0:
version "2.17.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.17.0.tgz#c0150a2368a182f033e9aa5195ec76ea41a199cb"
integrity sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==

node-pty@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/node-pty/-/node-pty-1.0.0.tgz#7daafc0aca1c4ca3de15c61330373af4af5861fd"
integrity sha512-wtBMWWS7dFZm/VgqElrTvtfMq4GzJ6+edFI0Y0zyzygUSZMgZdraDUMUhCIvkjhJjme15qWmbyJbtAx4ot4uZA==
dependencies:
nan "^2.17.0"

[email protected]:
version "7.5.4"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
dependencies:
lru-cache "^6.0.0"

yallist@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==

0 comments on commit 7fbf50e

Please sign in to comment.