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

Dependency updates #128

Merged
merged 7 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actions/setup-node@v4 has this included

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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actions/setup-node@v4 has this included

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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actions/setup-node@v4 has this included

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"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching to tsx only requires this!

}
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)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did regen these files with v0.18.1, but nothing was different except this header.

//
// 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;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙄 THANKS BSON

const bsonDeserialize = require('bson').deserialize;
Comment on lines +6 to +8
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really annoying and only impacts esbuild for the browser, but not too bad.

Why the double require? It was clearer than the named version and keeps the linter away from trying to reformat it.


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