Skip to content

Commit

Permalink
feat: upgrade min node and move to aws-sdk v3 (#57)
Browse files Browse the repository at this point in the history
* ci: update min node version to node 18

BREAKING CHANGE: drop support for older node versions

* build: switch to dynamodb-wrapper fork
  • Loading branch information
crash7 authored Apr 20, 2024
1 parent d101a86 commit 5c1c9d6
Show file tree
Hide file tree
Showing 5 changed files with 914 additions and 173 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Read [the docs][flynamo-jsdoc].
- 🙌 Plays well with functional libraries like [`ramda`][ramda] or [`lodash/fp`][lodashfp].

```sh
# Install AWS SDK
npm i aws-sdk
# Install the DynamoDb client from AWS SDK
npm i @aws-sdk/client-dynamodb

# Install Flynamo
npm i @flybondi/flynamo
Expand All @@ -29,10 +29,10 @@ npm i @flybondi/flynamo
Wrap an instance of an `AWS.DynamoDB` client with `flynamo` and you're good to go. The result will be an object exposing all of Flynamo's own API.

```js
const AWS = require('aws-sdk');
const { DynamoDB } = require('@aws-sdk/client-dynamodb');
const flynamo = require('@flybondi/flynamo');

const { forTable } = flynamo(new AWS.DynamoDB());
const { forTable } = flynamo(new DynamoDB());
const { insert, update, remove } = forTable('SomeTable');

(async function () {
Expand Down
8 changes: 4 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DynamoDB } from 'aws-sdk';
import DynamoDBWrapper from 'dynamodb-wrapper';
import { DynamoDB } from '@aws-sdk/client-dynamodb';
import DynamoDBWrapper from '@flybondi/dynamodb-wrapper';

declare module '@flybondi/flynamo' {
namespace Flynamo {
Expand Down Expand Up @@ -488,14 +488,14 @@ declare module '@flybondi/flynamo' {
*/
forTable(tableName: string): ForFlynamoClient;
}

export type Flynamo = FlynamoClient & ForTable;

/**
* Wraps an `AWS.DynamoDB` instance and returns a new `Flynamo` client.
* Configurable `options` for `dynamodb-wrapper` may be provided.
*
* @see https://github.com/Shadowblazen/dynamodb-wrapper#setup
* @see https://github.com/flybondi/dynamodb-wrapper#setup
* @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html
* @param client - A `AWS.DynamoDB` client.
* @param options - `DynamoDBWrapper` configuration (optional).
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flybondi/flynamo",
"version": "1.5.5",
"version": "2.0.0-alpha.3",
"description": "An AWS DynamoDB client wrapper",
"keywords": [
"flybondi",
Expand Down Expand Up @@ -57,16 +57,16 @@
"dependencies": {
"dynamodb-data-types": "^4.0.0",
"dynamodb-update-expression": "^0.1.21",
"dynamodb-wrapper": "^1.4.1",
"@flybondi/dynamodb-wrapper": "^2.0.0",
"lodash.camelcase": "^4.3.0",
"ramda": "^0.28.0"
},
"devDependencies": {
"@aws-sdk/client-dynamodb": "^3.554.0",
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@types/aws-sdk": "^2.7.0",
"@types/jest": "^29.1.2",
"aws-sdk": "^2.1232.0",
"docdash": "^1.2.0",
"eslint": "^8.25.0",
"eslint-config-prettier": "^8.5.0",
Expand All @@ -87,10 +87,10 @@
"prettier": "^2.7.1"
},
"peerDependencies": {
"aws-sdk": "2.x"
"@aws-sdk/client-dynamodb": "3.x"
},
"engines": {
"node": ">=7"
"node": ">=18"
},
"release": {
"branches": [
Expand Down
2 changes: 1 addition & 1 deletion src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const createUpdater = require('./update');
const createCounter = require('./count');
const createWriteBatcher = require('./batch-write-item');
const createGetBatcher = require('./batch-get-item');
const DynamoDBWrapper = require('dynamodb-wrapper');
const DynamoDBWrapper = require('@flybondi/dynamodb-wrapper');

/**
* Wraps an AWS DynamoDB `client` and returns Flynamo's API to access
Expand Down
Loading

0 comments on commit 5c1c9d6

Please sign in to comment.