Skip to content

Commit

Permalink
chore!: drop node 16, bump dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Gomah committed Dec 30, 2023
1 parent 540335c commit fd820d7
Show file tree
Hide file tree
Showing 13 changed files with 6,425 additions and 6,959 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
20
546 changes: 0 additions & 546 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

873 changes: 0 additions & 873 deletions .yarn/releases/yarn-3.5.0.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.2.cjs

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
nodeLinker: node-modules
compressionLevel: mixed

enableGlobalCache: false

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.5.0.cjs
yarnPath: .yarn/releases/yarn-4.0.2.cjs
47 changes: 24 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dist"
],
"engines": {
"node": ">=16"
"node": ">=18"
},
"prettier": {
"printWidth": 100,
Expand All @@ -46,32 +46,33 @@
},
"author": "Gomah",
"devDependencies": {
"@commitlint/cli": "17.6.5",
"@commitlint/config-conventional": "17.6.5",
"@swc/core": "1.3.61",
"@tsconfig/recommended": "1.0.2",
"@types/node": "18.16.16",
"@typescript-eslint/eslint-plugin": "5.59.8",
"@typescript-eslint/parser": "5.59.8",
"@vitest/coverage-c8": "0.31.2",
"@vitest/ui": "0.31.2",
"c8": "7.14.0",
"dotenv": "16.1.1",
"eslint": "8.41.0",
"eslint-config-prettier": "8.8.0",
"eslint-plugin-prettier": "4.2.1",
"@commitlint/cli": "18.4.3",
"@commitlint/config-conventional": "18.4.3",
"@swc/core": "1.3.101",
"@tsconfig/recommended": "1.0.3",
"@types/node": "20.10.6",
"@typescript-eslint/eslint-plugin": "6.16.0",
"@typescript-eslint/parser": "6.16.0",
"@vitest/coverage-c8": "0.33.0",
"@vitest/ui": "1.1.0",
"c8": "8.0.1",
"date-fns": "^3.0.6",
"dotenv": "16.3.1",
"eslint": "8.56.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.1.2",
"husky": "8.0.3",
"prettier": "2.8.8",
"prettier": "3.1.1",
"standard-version": "9.5.0",
"tslib": "2.5.2",
"tsup": "6.7.0",
"typescript": "5.0.4",
"vitest": "0.31.2"
"tslib": "2.6.2",
"tsup": "8.0.1",
"typescript": "5.3.3",
"vitest": "1.1.0"
},
"dependencies": {
"got": "13.0.0",
"hasha": "5.2.2",
"got": "14.0.0",
"hasha": "6.0.0",
"hyperid": "3.1.1"
},
"packageManager": "yarn@3.5.0"
"packageManager": "yarn@4.0.2"
}
6 changes: 3 additions & 3 deletions src/client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Sendle } from './types.js';
import got, { Got, Options as GotOptions } from 'got';
import hasha from 'hasha';
import got, { type Got, type Options as GotOptions } from 'got';
import { hashSync } from 'hasha';
import hyperid from 'hyperid';

/*
Expand Down Expand Up @@ -120,7 +120,7 @@ export class SendleClient {
headers: {
'Idempotency-Key':
idempotencyKey || (customerId && orderId)
? hasha(JSON.stringify(args))
? hashSync(JSON.stringify(args))
: this.#hyperIdInstance(),
'Content-Type': 'application/json',
Accept: 'application/json',
Expand Down
1 change: 1 addition & 0 deletions test/__snapshots__/orders.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ exports[`Orders > should create an international order 1`] = `
"description": "T-shirt",
"value": "20.0",
},
"contents_type": null,
"cubic_metre_volume": "0.01",
"customer_reference": "SupBdayPressie",
"description": "Kryptonite",
Expand Down
2 changes: 1 addition & 1 deletion test/__snapshots__/products.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`Products > should get a list of products 1`] = `
"days_range": Any<Array>,
"for_send_date": Any<String>,
},
"plan": "Sendle Easy",
"plan": Any<String>,
"price_breakdown": {
"base": {
"amount": Any<Number>,
Expand Down
8 changes: 7 additions & 1 deletion test/orders.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { describe, it, expect } from 'vitest';
import { client } from './helpers';
import * as dateFns from 'date-fns';
let orderId: string;
let trackingId: string;

Expand Down Expand Up @@ -100,7 +101,12 @@ describe('Orders', () => {

it('should create an international order', async () => {
const order = await client.orders.create({
pickup_date: '2023-11-24',
pickup_date: dateFns.format(
dateFns.add(new Date(), {
days: 3,
}),
'yyyy-MM-dd'
),
description: 'Kryptonite',
weight: {
value: '1',
Expand Down
3 changes: 2 additions & 1 deletion test/products.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ describe('Products', () => {
});

expect(products[0]).toMatchSnapshot({
plan: expect.any(String),
eta: {
date_range: expect.any(Array),
days_range: expect.any(Array),
for_send_date: expect.any(String)
for_send_date: expect.any(String),
},
price_breakdown: {
base: {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "@tsconfig/recommended/tsconfig.json",
"include": ["src"],
"compilerOptions": {
"module": "esnext",
"module": "Node16",
"moduleResolution": "node16"
}
}
Loading

0 comments on commit fd820d7

Please sign in to comment.