Skip to content

Commit 2435994

Browse files
authored
Dependency updates (#128)
Updated _almost_ all of the dependencies to the latest version. - Bson updates required a few small changes due to es module updates in bson - Did *not* update chai past v4. Looks like moving past chai v4 would require many changes and not all the chai plugins we are using support it yet. Perhaps we should just move away from chai instead. - Moved from ts-node to tsx - Updates for `msw` breaking changes, but nothing special for our use cases. - Github actions with node no longer needs a separate cache step ## Suggested Tests - Locally build and run tests - Try it out with: - `npm i && npm run build && npm run serve` - `cd examples/server && npm i && node app.js` - Then go to `http://localhost:3000`, open up the console and hit some buttons.
1 parent 5db9db4 commit 2435994

File tree

12 files changed

+2005
-5541
lines changed

12 files changed

+2005
-5541
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,15 @@ on:
66
branches: [ '**' ]
77
jobs:
88
test:
9-
runs-on: ubuntu-20.04
9+
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v4
1313

1414
- name: Use Node.js
15-
uses: actions/setup-node@v2
15+
uses: actions/setup-node@v4
1616
with:
17-
node-version: '18.18.2'
18-
19-
- uses: actions/cache@v2
20-
with:
21-
path: ~/.npm
22-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
23-
restore-keys: |
24-
${{ runner.os }}-node-
17+
node-version: 18
2518

2619
- name: Install 💾
2720
run: npm ci

.github/workflows/publish-next.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,17 @@ on:
44
branches: [ main ]
55
jobs:
66
test:
7-
runs-on: ubuntu-20.04
7+
runs-on: ubuntu-latest
88
steps:
99
- name: Checkout
10-
uses: actions/checkout@v2
10+
uses: actions/checkout@v4
1111

1212
- name: Use Node.js
13-
uses: actions/setup-node@v2
13+
uses: actions/setup-node@v4
1414
with:
15-
node-version: '18.18.2'
15+
node-version: 18
1616
registry-url: 'https://registry.npmjs.org'
1717

18-
- uses: actions/cache@v2
19-
with:
20-
path: ~/.npm
21-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
22-
restore-keys: |
23-
${{ runner.os }}-node-
24-
2518
- name: Install 💾
2619
run: npm ci
2720

.github/workflows/release.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,17 @@ on:
44
types: [ released ]
55
jobs:
66
publish-to-npm:
7-
runs-on: ubuntu-20.04
7+
runs-on: ubuntu-latest
88
steps:
99
- name: Checkout
10-
uses: actions/checkout@v2
10+
uses: actions/checkout@v4
1111

1212
- name: Use Node.js
13-
uses: actions/setup-node@v2
13+
uses: actions/setup-node@v4
1414
with:
15-
node-version: '18.18.2'
15+
node-version: 18
1616
registry-url: 'https://registry.npmjs.org'
1717

18-
- uses: actions/cache@v2
19-
with:
20-
path: ~/.npm
21-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
22-
restore-keys: |
23-
${{ runner.os }}-node-
24-
2518
- name: Install 💾
2619
run: npm ci
2720

.mocharc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://json.schemastore.org/mocharc.json",
3+
"require": "tsx"
4+
}

examples/server/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"license": "MIT",
66
"dependencies": {
77
"@dsnp/parquetjs": "../parquetjs",
8-
"ejs": "^3.1.6"
8+
"ejs": "^3.1.10"
99
},
1010
"devDependencies": {
11-
"express": "^4.17.1"
11+
"express": "^4.19.2"
1212
}
1313
}

gen-nodejs/parquet_types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Autogenerated by Thrift Compiler (0.16.0)
2+
// Autogenerated by Thrift Compiler (0.18.1)
33
//
44
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
55
//

gen-nodejs/parquet_types.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/types.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
'use strict';
22
// Thanks to https://github.com/kbajalc/parquets for some of the code.
3-
import * as BSON from "bson"
4-
import { PrimitiveType, OriginalType, ParquetType, FieldDefinition, ParquetField } from "./declare"
3+
import { PrimitiveType, OriginalType, ParquetType, FieldDefinition, ParquetField } from "./declare";
54
import { Options } from "./codec/types";
5+
import type { Document as BsonDocument } from "bson";
6+
// BSON uses top level awaits, so use require for now
7+
const bsonSerialize = require('bson').serialize;
8+
const bsonDeserialize = require('bson').deserialize;
69

710
type ParquetTypeDataObject = {
811
primitiveType?: PrimitiveType,
@@ -439,12 +442,12 @@ function fromPrimitive_JSON(value: string) {
439442
return JSON.parse(value);
440443
}
441444

442-
function toPrimitive_BSON(value: BSON.Document) {
443-
return Buffer.from(BSON.serialize(value));
445+
function toPrimitive_BSON(value: BsonDocument) {
446+
return Buffer.from(bsonSerialize(value));
444447
}
445448

446449
function fromPrimitive_BSON(value: Buffer) {
447-
return BSON.deserialize(value);
450+
return bsonDeserialize(value);
448451
}
449452

450453
function toNumberInternal(typeName: string, value: string | number): number {
@@ -556,4 +559,3 @@ function checkValidValue(lowerRange: number | bigint, upperRange: number | bigin
556559
throw "invalid value"
557560
}
558561
}
559-

0 commit comments

Comments
 (0)