From 1a88dec0a5a660910014779ff208c113f93c6b86 Mon Sep 17 00:00:00 2001 From: Till-JS <101404291+Till-JS@users.noreply.github.com> Date: Tue, 2 Dec 2025 14:40:55 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix(shared-storage):=20update=20?= =?UTF-8?q?build=20configuration=20for=20CommonJS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change module from ESNext to CommonJS for NestJS compatibility - Update moduleResolution from bundler to node - Add build script and dist exports to package.json - Remove .js extensions from imports for better compatibility 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- packages/shared-storage/package.json | 14 ++++++++++---- packages/shared-storage/src/client.ts | 2 +- packages/shared-storage/src/factory.ts | 4 ++-- packages/shared-storage/src/index.ts | 8 ++++---- packages/shared-storage/tsconfig.json | 4 ++-- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/packages/shared-storage/package.json b/packages/shared-storage/package.json index 6becf1021..1d0a1f193 100644 --- a/packages/shared-storage/package.json +++ b/packages/shared-storage/package.json @@ -3,14 +3,20 @@ "version": "0.1.0", "private": true, "description": "S3-compatible object storage client for Manacore monorepo (MinIO local, Hetzner production)", - "main": "./src/index.ts", - "types": "./src/index.ts", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "exports": { - ".": "./src/index.ts" + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } }, + "files": ["dist"], "scripts": { + "build": "tsc", "type-check": "tsc --noEmit", - "clean": "rm -rf dist" + "clean": "rm -rf dist", + "prepublishOnly": "pnpm build" }, "dependencies": { "@aws-sdk/client-s3": "^3.700.0", diff --git a/packages/shared-storage/src/client.ts b/packages/shared-storage/src/client.ts index 57c8f06da..2202fbac7 100644 --- a/packages/shared-storage/src/client.ts +++ b/packages/shared-storage/src/client.ts @@ -15,7 +15,7 @@ import type { PresignedUrlOptions, UploadResult, FileInfo, -} from './types.js'; +} from './types'; /** * S3-compatible storage client for MinIO (local) and Hetzner Object Storage (production) diff --git a/packages/shared-storage/src/factory.ts b/packages/shared-storage/src/factory.ts index 133749f2c..d498b94a0 100644 --- a/packages/shared-storage/src/factory.ts +++ b/packages/shared-storage/src/factory.ts @@ -1,5 +1,5 @@ -import { StorageClient } from './client.js'; -import { BUCKETS, type StorageConfig, type BucketConfig, type BucketName } from './types.js'; +import { StorageClient } from './client'; +import { BUCKETS, type StorageConfig, type BucketConfig, type BucketName } from './types'; /** * Environment variable names for storage configuration diff --git a/packages/shared-storage/src/index.ts b/packages/shared-storage/src/index.ts index 42d6e6938..50f7f3e4b 100644 --- a/packages/shared-storage/src/index.ts +++ b/packages/shared-storage/src/index.ts @@ -1,5 +1,5 @@ // Main client -export { StorageClient } from './client.js'; +export { StorageClient } from './client'; // Factory functions export { @@ -13,7 +13,7 @@ export { createCalendarStorage, createContactsStorage, createStorageStorage, -} from './factory.js'; +} from './factory'; // Utilities export { @@ -26,7 +26,7 @@ export { DOCUMENT_EXTENSIONS, AUDIO_EXTENSIONS, VIDEO_EXTENSIONS, -} from './utils.js'; +} from './utils'; // Types export { @@ -38,4 +38,4 @@ export { type PresignedUrlOptions, type UploadResult, type FileInfo, -} from './types.js'; +} from './types'; diff --git a/packages/shared-storage/tsconfig.json b/packages/shared-storage/tsconfig.json index c0db43203..e18253bfa 100644 --- a/packages/shared-storage/tsconfig.json +++ b/packages/shared-storage/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { "target": "ES2022", - "module": "ESNext", - "moduleResolution": "bundler", + "module": "CommonJS", + "moduleResolution": "node", "strict": true, "esModuleInterop": true, "skipLibCheck": true,