ndk icon indicating copy to clipboard operation
ndk copied to clipboard

ndk-cache-redis not built when installed

Open arkin0x opened this issue 1 year ago • 1 comments

Issue: ndk-cache-redis package not built after installation

Description

When adding ndk-cache-redis as a dependency, the package is not automatically built with a prepare script after installation. This prevents using the package in a project.

Steps to Reproduce

  1. Create a new Node.js project or use an existing one
  2. Run npm install @nostr-dev-kit/ndk-cache-redis
  3. Attempt to import and use the package in your code
import NDKRedisCacheAdapter from '@nostr-dev-kit/ndk-cache-redis'
Error: Cannot find module '@nostr-dev-kit/ndk-cache-redis' or its corresponding type declarations. ts(2307)

Expected Behavior

The package should be built and ready to use immediately after installation.

Actual Behavior

The package is installed but not built (no /dist folder), leading to errors when trying to use it.

When trying to run the build script manually for ndk-cache-redis, I got an error about the dependency "@nostr-dev-kit/eslint-config-custom": "0.0.0" which does not exist in the repo, NPM registry, nor in the nostr-dev-kit repository AFAIK.

Environment

  • Node.js version: 20.12.1
  • npm version: 10.5.0
  • pnpm version: 8.15.5
  • Operating System: Windows 10

Additional Context

  • Manually building the module was unsuccessful

Possible Solution

Create a proper build script, republish, and make sure the dependencies can resolve

arkin0x avatar Aug 01 '24 20:08 arkin0x

Just ran into this issue. It looks like the latest version of @nostr-dev-kit/[email protected] is missing the dist folder

This could probably easily be solved by adding a "prepare": "pnpm build" to the package.json so it builds the package before its published. similar to what the core ndk package does https://github.com/nostr-dev-kit/ndk/blob/master/ndk/package.json#L42

hzrd149 avatar Sep 01 '24 16:09 hzrd149