Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove support for node 16 #266

Merged
merged 5 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
max-parallel: 1
matrix:
node-version: [16.13.0, 18]
node-version: [18, 20]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -51,7 +51,6 @@ jobs:
--force
influx write --bucket dyne --file test/fixtures/influxdb_data.lp
- run: yarn
- run: yarn add -W zenroom
- run: yarn build
- run: yarn test
- uses: codecov/codecov-action@v3
Expand Down Expand Up @@ -85,4 +84,3 @@ jobs:
lerna publish --no-verify-access -c -y --pre-dist-tag next --preid $(git rev-parse --short HEAD) --force-publish=*
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
]
},
"engines": {
"node": "^16.13.0 || ^18.0.0"
"node": "^18.0.0 || ^20.0.0"
},
"scripts": {
"prerelease": "yarn build && yarn doc && git add docs && git commit -m 'docs: 📚️ 📝 Update docs'",
Expand Down Expand Up @@ -79,6 +79,7 @@
"husky": "^5.0.9",
"lerna": "^4.0.0",
"morgan": "^1.10.0",
"node-gyp": "^10.0.0",
"nodemon": "^2.0.18",
"prettier": "^2.2.1",
"qs": "^6.9.6",
Expand Down
4 changes: 2 additions & 2 deletions packages/files/tests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ test.serial('List content of directory', async (t) => {
const { app } = t.context;
const res = await app.post("/files_ls");
t.is(res.status, 200, res.text);
t.is(res.body.test_dir.length, 7);
t.is(res.body.test_dir.length, 8);
for(const file of res.body.test_dir) {
t.is(file.blksize, 4096);
t.is(file.mode.substr(0, 2), '40'); // All directory
}
t.is(res.body.packages_dir.length, 18);
t.is(res.body.packages_dir.length, 19);
})
11 changes: 7 additions & 4 deletions packages/logger/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default (req: Request, res: Response, next: NextFunction) => {
rr.onSuccess(async (params) => {
const {result, zencode} = params;

const addLog = (sentences: string[], where: string) => {
const addLog = async (sentences: string[], where: string) => {
const absolutePath = path.resolve(path.join(LOGGER_DIR, where));
validatePath(absolutePath);
const ws = fs.createWriteStream(absolutePath, {flags: "a"});
Expand All @@ -34,12 +34,15 @@ export default (req: Request, res: Response, next: NextFunction) => {
`[LOGGER] An error occurred while writing to ${where}\n${error}`)
});
sentences.forEach( (v) => ws.write(`${v}\n`) )
await new Promise<void>((resolve, reject) => {
ws.close(() => resolve())
})
}

if (zencode.match(Action.APPEND)) {
const params = zencode.chunkedParamsOf(Action.APPEND, 2);
for(const [ sentence, where ] of params) {
addLog([ result[sentence] || input[sentence] || sentence ], where);
await addLog([ result[sentence] || input[sentence] || sentence ], where);
}
}
if (zencode.match(Action.APPEND_NAMED)) {
Expand All @@ -50,7 +53,7 @@ export default (req: Request, res: Response, next: NextFunction) => {
throw new Error(
`[LOGGER] Could not find path to log ${pathName}`)
}
addLog([ result[sentence] || input[sentence] || sentence ], logPath);
await addLog([ result[sentence] || input[sentence] || sentence ], logPath);
}
}
if (zencode.match(Action.APPEND_ARRAY)) {
Expand All @@ -61,7 +64,7 @@ export default (req: Request, res: Response, next: NextFunction) => {
throw new Error(
`[LOGGER] Could not find sentences array to log ${arrayName}`)
}
addLog(sentences,
await addLog(sentences,
result[where] || input[where] || where);
}
}
Expand Down