Skip to content

Commit

Permalink
Dependency updates (#128)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wilwade authored May 14, 2024
1 parent 5db9db4 commit 2435994
Show file tree
Hide file tree
Showing 12 changed files with 2,005 additions and 5,541 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,15 @@ on:
branches: [ '**' ]
jobs:
test:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '18.18.2'

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
node-version: 18

- name: Install 💾
run: npm ci
Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/publish-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,17 @@ on:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '18.18.2'
node-version: 18
registry-url: 'https://registry.npmjs.org'

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install 💾
run: npm ci

Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,17 @@ on:
types: [ released ]
jobs:
publish-to-npm:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '18.18.2'
node-version: 18
registry-url: 'https://registry.npmjs.org'

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install 💾
run: npm ci

Expand Down
4 changes: 4 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://json.schemastore.org/mocharc.json",
"require": "tsx"
}
4 changes: 2 additions & 2 deletions examples/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"license": "MIT",
"dependencies": {
"@dsnp/parquetjs": "../parquetjs",
"ejs": "^3.1.6"
"ejs": "^3.1.10"
},
"devDependencies": {
"express": "^4.17.1"
"express": "^4.19.2"
}
}
2 changes: 1 addition & 1 deletion gen-nodejs/parquet_types.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Autogenerated by Thrift Compiler (0.16.0)
// Autogenerated by Thrift Compiler (0.18.1)
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
Expand Down
2 changes: 1 addition & 1 deletion gen-nodejs/parquet_types.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

type ParquetTypeDataObject = {
primitiveType?: PrimitiveType,
Expand Down Expand Up @@ -439,12 +442,12 @@ function fromPrimitive_JSON(value: string) {
return JSON.parse(value);
}

function toPrimitive_BSON(value: BSON.Document) {
return Buffer.from(BSON.serialize(value));
function toPrimitive_BSON(value: BsonDocument) {
return Buffer.from(bsonSerialize(value));
}

function fromPrimitive_BSON(value: Buffer) {
return BSON.deserialize(value);
return bsonDeserialize(value);
}

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

Loading

0 comments on commit 2435994

Please sign in to comment.