Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ndk-cache-redis not built when installed #254

Open
arkin0x opened this issue Aug 1, 2024 · 1 comment
Open

ndk-cache-redis not built when installed #254

arkin0x opened this issue Aug 1, 2024 · 1 comment

Comments

@arkin0x
Copy link
Contributor

arkin0x commented Aug 1, 2024

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

@hzrd149
Copy link

hzrd149 commented Sep 1, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants