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

Bumps ion-js peer- and dev-dependency to 5.2.0. #62

Merged
merged 5 commits into from
Dec 5, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
node-version: [10, 12, 14]
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 0 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@ module.exports = function(grunt) {
excludeExternals: true,
excludePrivate: true,
hideGenerator: true,
mode: 'file',
module: 'commonjs',
name: 'ion-hash-js',
out: 'docs/api',
target: 'es5',
},
src: 'src/*.ts',
},
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This library is designed to work with Node 8/ES5/CommonJS.

1. Add dependencies for ion-hash-js and its peerDependencies:
```
npm install --save ion-hash-js ion-js jsbi
npm install --save ion-hash-js ion-js
```

1. Note the examples below assume the availability of
Expand Down
20 changes: 9 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,17 @@
},
"homepage": "https://github.com/amazon-ion/ion-hash-js#readme",
"devDependencies": {
"grunt": "^1.0.1",
"grunt-contrib-clean": "^1.0.0",
"grunt-ts": "^6.0.0-beta.19",
"grunt": "^1.6.1",
"grunt-contrib-clean": "^1.1.0",
"grunt-ts": "^6.0.0-beta.22",
"grunt-typedoc": "^0.2.4",
"intern": "^4.4.3",
"ion-js": "^4.0.0",
"jsbi": "3.1.1",
"typedoc": "^0.17.3",
"typedoc-plugin-no-inherit": "^1.1.10",
"typescript": "^3.5.3"
"intern": "^4.10.1",
"ion-js": "^5.2.0",
"typedoc": "^0.25.3",
"typedoc-plugin-no-inherit": "^1.4.0",
"typescript": "^5.2.2"
},
"peerDependencies": {
"ion-js": "^4.0.0",
"jsbi": "^3.1.1"
"ion-js": "^5.2.0"
}
}
11 changes: 5 additions & 6 deletions src/internal/IonHashImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {Decimal, IntSize, IonType, IonTypes, makeBinaryWriter,
import {createHash, Hash} from 'crypto';

import {Hasher, HasherProvider, HashReader, HashWriter} from "../IonHash";
import JSBI from "jsbi";

export class _CryptoHasher implements Hasher {
private _hash: Hash;
Expand Down Expand Up @@ -57,9 +56,9 @@ export class _HashReaderImpl implements HashReader, _IonValue {

// implements Reader
annotations() : string[] { return this._reader.annotations() }
bigIntValue() : JSBI | null { return this._reader.bigIntValue() }
bigIntValue() : bigint | null { return this._reader.bigIntValue() }
booleanValue() : boolean | null { return this._reader.booleanValue() }
byteValue() : Uint8Array | null { return this._reader.byteValue() }
byteValue() : Uint8Array | null { return this._reader.uInt8ArrayValue() }
decimalValue() : Decimal | null { return this._reader.decimalValue() }
depth() : number { return this._reader.depth() }
fieldName() : string | null { return this._reader.fieldName() }
Expand Down Expand Up @@ -184,7 +183,7 @@ export class _HashWriterImpl implements HashWriter, _IonValue {
this._hashScalar(IonTypes.FLOAT, value);
this._writer.writeFloat64(value);
}
writeInt(value: number | JSBI | null): void {
writeInt(value: number | bigint | null): void {
this._hashScalar(IonTypes.INT, value);
this._writer.writeInt(value);
}
Expand Down Expand Up @@ -255,8 +254,8 @@ export class _HashWriterImpl implements HashWriter, _IonValue {
case IonTypes.TIMESTAMP: this.writeTimestamp(reader.timestampValue()); break;
case IonTypes.SYMBOL: this.writeSymbol(reader.stringValue()); break;
case IonTypes.STRING: this.writeString(reader.stringValue()); break;
case IonTypes.CLOB: this.writeClob(reader.byteValue()); break;
case IonTypes.BLOB: this.writeBlob(reader.byteValue()); break;
case IonTypes.CLOB: this.writeClob(reader.uInt8ArrayValue()); break;
case IonTypes.BLOB: this.writeBlob(reader.uInt8ArrayValue()); break;
case IonTypes.LIST: this.stepIn(IonTypes.LIST); break;
case IonTypes.SEXP: this.stepIn(IonTypes.SEXP); break;
case IonTypes.STRUCT: this.stepIn(IonTypes.STRUCT); break;
Expand Down
11 changes: 5 additions & 6 deletions tests/HashReaderTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* permissions and limitations under the License.
*/

import JSBI from "jsbi";
import intern from 'intern';

const {registerSuite} = intern.getPlugin('interface.object');
Expand All @@ -40,7 +39,7 @@ class ReaderComparer implements Reader {
assert.deepEqual(this.readerA.annotations(), this.readerB.annotations());
return this.readerA.annotations();
}
bigIntValue(): JSBI | null {
bigIntValue(): bigint | null {
assert.deepEqual(this.readerA.bigIntValue(), this.readerB.bigIntValue());
return this.readerA.bigIntValue();
}
Expand All @@ -49,8 +48,8 @@ class ReaderComparer implements Reader {
return this.readerA.booleanValue();
}
byteValue(): Uint8Array | null {
assert.deepEqual(this.readerA.byteValue(), this.readerB.byteValue());
return this.readerA.byteValue()
assert.deepEqual(this.readerA.uInt8ArrayValue(), this.readerB.uInt8ArrayValue());
return this.readerA.uInt8ArrayValue()
}
decimalValue(): Decimal | null {
assert.deepEqual(this.readerA.decimalValue(), this.readerB.decimalValue());
Expand Down Expand Up @@ -132,8 +131,8 @@ function traverse(reader: Reader) {
case IonTypes.TIMESTAMP: { reader.timestampValue(); break }
case IonTypes.SYMBOL: { reader.stringValue(); break }
case IonTypes.STRING: { reader.stringValue(); break }
case IonTypes.CLOB: { reader.byteValue(); break }
case IonTypes.BLOB: { reader.byteValue(); break }
case IonTypes.CLOB: { reader.uInt8ArrayValue(); break }
case IonTypes.BLOB: { reader.uInt8ArrayValue(); break }
}
reader.isNull();
if (!type.isContainer) {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"sourceMap": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"verbose": true
// TODO: Temporarily skipping the type checking of all declaration files in the node_modules directory. More investigations required to resolve the compiling error when setting this option as false
"skipLibCheck": true
Comment on lines +11 to +12
Copy link

Choose a reason for hiding this comment

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

This gives me pause--I'd like to better understand what we're skipping by doing this. Are downstream users of our library impacted by this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When skipLibCheck is set to true, it enables TypeScript to bypass type checking for declaration files. We've encountered a scenario where setting this option to false results in type inconsistency errors originating from the intern dependency. We have updated this dependency to its latest version and found no related issues in its repository. Since this inconsistency stems from the third-party dependency's type declarations, in my opinion, this configuration should not affect our downstream customers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created this issue #63 as a reference point to help identify the root cause in case any typechecking-related issues arise in the future.

}
}