Skip to content

Commit

Permalink
fix: move non-mandatory deps to peerDependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgroshkov committed Dec 26, 2023
1 parent 7207966 commit 475c7bb
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 10 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@

This is the fork of [snowflake-connector-nodejs](https://github.com/snowflakedb/snowflake-connector-nodejs)
with the following changes:

- Fixes https://github.com/snowflakedb/snowflake-connector-nodejs/issues/449 by moving non-mandatory dependencies to peerDependencies. So, folks who don't need e.g AWS SDK don't have to "download the whole internet".

Published as [@naturalcycles/snowflake-sdk](https://www.npmjs.com/package/@naturalcycles/snowflake-sdk).

## Readme

********************************************************************************
NodeJS Driver for Snowflake
********************************************************************************
<p>
<a href="https://github.com/snowflakedb/snowflake-connector-nodejs/actions?query=workflow%3A%22Build+and+Test%22+branch%3Amaster" target="_blank"><img src="https://github.com/snowflakedb/snowflake-connector-nodejs/workflows/Build%20and%20Test/badge.svg?branch=master" alt="master" /></a>
<a href="https://www.npmjs.com/package/snowflake-sdk" target="_blank"><img src="https://img.shields.io/npm/v/snowflake-sdk.svg" alt="npm" /></a>
<a href="https://www.npmjs.com/package/@naturalcycles/snowflake-sdk" target="_blank"><img src="https://img.shields.io/npm/v/@naturalcycles/snowflake-sdk.svg" alt="npm" /></a>
<a href="http://www.apache.org/licenses/LICENSE-2.0.txt" target="_blank"><img src="http://img.shields.io/:license-Apache%202-brightgreen.svg" alt="apache" /> </a>
<a href="https://codecov.io/gh/snowflakedb/snowflake-connector-nodejs" target="_blank"><img src="https://codecov.io/gh/snowflakedb/snowflake-connector-nodejs/branch/master/graph/badge.svg?token=QZMWDu35ds" alt="codecov" /></a>
</p>
Expand All @@ -15,7 +25,7 @@ NodeJS Driver for Snowflake
Install
======================================================================

Run `npm i snowflake-sdk` in your existing NodeJs project.
Run `npm i @naturalcycles/snowflake-sdk` in your existing NodeJs project.

Docs
======================================================================
Expand Down
2 changes: 1 addition & 1 deletion lib/file_transfer_agent/s3_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ function S3Location(bucketName, s3path) {
* @constructor
*/
function S3Util(s3, filestream) {
const AWS = typeof s3 !== 'undefined' ? s3 : require('@aws-sdk/client-s3');
const fs = typeof filestream !== 'undefined' ? filestream : require('fs');

// magic number, given from error message.
Expand Down Expand Up @@ -73,6 +72,7 @@ function S3Util(s3, filestream) {
useAccelerateEndpoint: useAccelerateEndpoint,
};

const AWS = typeof s3 !== 'undefined' ? s3 : require('@aws-sdk/client-s3');
return new AWS.S3(config);
};

Expand Down
31 changes: 24 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"name": "snowflake-sdk",
"version": "1.9.2",
"name": "@naturalcycles/snowflake-sdk",
"version": "1.9.4",
"description": "Node.js driver for Snowflake",
"dependencies": {
"@aws-sdk/client-s3": "^3.388.0",
"@azure/storage-blob": "^12.11.0",
"@google-cloud/storage": "^6.9.3",
"@techteamer/ocsp": "1.0.1",
"agent-base": "^6.0.2",
"asn1.js-rfc2560": "^5.0.0",
Expand Down Expand Up @@ -46,14 +43,34 @@
"test-console": "^2.0.0"
},
"peerDependencies": {
"asn1.js": "^5.4.1"
"asn1.js": "^5.4.1",
"@aws-sdk/client-s3": "^3.388.0",
"@azure/storage-blob": "^12.11.0",
"@google-cloud/storage": "^6.9.3"
},
"peerDependenciesMeta": {
"asn1.js": {
"optional": true
},
"@aws-sdk/client-s3": {
"optional": true
},
"@azure/storage-blob": {
"optional": true
},
"@google-cloud/storage": {
"optional": true
}
},
"overrides": {
"semver": "^7.5.2"
},
"repository": {
"type": "git",
"url": "https://github.com/snowflakedb/snowflake-connector-nodejs"
"url": "https://github.com/NaturalCycles/snowflake-connector-nodejs"
},
"publishConfig": {
"access": "public"
},
"scripts": {
"lint:check": "eslint",
Expand Down

0 comments on commit 475c7bb

Please sign in to comment.