diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..e083299 --- /dev/null +++ b/renovate.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["config:recommended", ":disableDependencyDashboard"], + "automerge": true, + "rangeStrategy": "replace", + "major": { + "automerge": false + }, + "packageRules": [ + { + "matchDepTypes": ["devDependencies"], + "automerge": true, + "rangeStrategy": "pin" + } + ] +} diff --git a/src/backends/s3/create-s3-client.ts b/src/backends/s3/create-s3-client.ts index 8371545..66409e7 100644 --- a/src/backends/s3/create-s3-client.ts +++ b/src/backends/s3/create-s3-client.ts @@ -1,5 +1,5 @@ -import { S3Client, type S3ClientConfig } from "@aws-sdk/client-s3"; -import { parseS3Uri } from "./parse-s3-uri"; +import { S3Client, type S3ClientConfig } from '@aws-sdk/client-s3'; +import { parseS3Uri } from './parse-s3-uri'; export function createS3Client(uri: string): S3Client { const parsed = parseS3Uri(uri); @@ -13,8 +13,10 @@ export function createS3Client(uri: string): S3Client { } // Credentials precedence: URI > Environment Variables - const accessKeyId = parsed.credentials?.accessKeyId ?? process.env.AWS_ACCESS_KEY_ID; - const secretAccessKey = parsed.credentials?.secretAccessKey ?? process.env.AWS_SECRET_ACCESS_KEY; + const accessKeyId = + parsed.credentials?.accessKeyId ?? process.env.AWS_ACCESS_KEY_ID; + const secretAccessKey = + parsed.credentials?.secretAccessKey ?? process.env.AWS_SECRET_ACCESS_KEY; if (accessKeyId && secretAccessKey) { config.credentials = { @@ -23,7 +25,10 @@ export function createS3Client(uri: string): S3Client { }; } - config.endpoint = parsed.endpoint; + config.endpoint = + parsed.endpoint ?? + process.env.AWS_ENDPOINT_URL_S3 ?? + process.env.AWS_ENDPOINT_URL; return new S3Client(config); } diff --git a/src/backends/s3/parse-s3-uri.ts b/src/backends/s3/parse-s3-uri.ts index 22e9ce6..d7ec3bf 100644 --- a/src/backends/s3/parse-s3-uri.ts +++ b/src/backends/s3/parse-s3-uri.ts @@ -19,13 +19,10 @@ export function parseS3Uri(uri: string): ParsedS3Uri { const [baseUri, queryString] = uri.split('?'); // Parse query params if present - const endpoint = - queryString - ?.split('&') - .map((param) => param.split('=')) - .find(([key]) => key === 'endpoint')?.[1] ?? - process.env.AWS_ENDPOINT_URL_S3 ?? - process.env.AWS_ENDPOINT_URL; + const endpoint = queryString + ?.split('&') + .map((param) => param.split('=')) + .find(([key]) => key === 'endpoint')?.[1]; if (!baseUri.startsWith('s3://')) { throw new Error('Invalid S3 URI format');