Skip to content

docs: update README for v8 #834

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

Draft
wants to merge 1 commit into
base: feat/naga-dev-29-05-2025-v2
Choose a base branch
from

Conversation

spacesailor24
Copy link
Contributor

@spacesailor24 spacesailor24 commented Jun 20, 2025

Description

Updating root monorepo README to be relevant to V8

Sections Not Included

The following are sections from the existing README that were removed in the recreation of the README in this PR:

  • I did not include bun run test:local in this PR because when running it I got the following error and the local-tests dir doesn't exist anymore:
Cannot find module local-tests/build.mjs
bun run test:local
$ node ./local-tests/build.mjs && dotenvx run --env-file=.env -- node ./local-tests/build/test.mjs
node:internal/modules/cjs/loader:1252
  throw err;
  ^

Error: Cannot find module '/Users/whyit/code/lit-protocol/js-sdk/local-tests/build.mjs'
    at Function._resolveFilename (node:internal/modules/cjs/loader:1249:15)
    at Function._load (node:internal/modules/cjs/loader:1075:27)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:219:24)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:170:5)
    at node:internal/main/run_main_module:36:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v22.12.0
error: script "test:local" exited with code 1
  • The Creating a new library section that uses the command: nx generate @nx/js:library. I'm not sure if this is still the command to create a library
  • The Create a new react demo app using the Lit JS SDK section that uses the command: yarn tools --create --react contracts-sdk --demo. I'm not sure if this is still relevant
  • The Deleting a package or app section. The following commands this section used are no longer in the package.json:
Deleting a package or app
// delete an app from ./app/<app-name>
yarn delete:app <app-name>

// delete a package from ./packages/<package-name>
yarn delete:package <package-name>
  • The Building Local Changes section which included instruction on how to use npm link to test changes to a package locally. While this command seems useful, I didn't know if we still wanted to include it and if the instructions are accurate:
Building Local Changes

During development you may wish to build your code changes in packages/ in a client application to test the correctness of the functionality.

If you would like to establish a dependency between packages within this monorepo and an external client application that consumes these packages:

  1. Run npm link at the root of the specific package you are making code changes in.
cd ./packages/*/<package-name>
npm link
  1. Build the packages with or without dependencies
yarn build
# or
yarn nx run lit-node-client-nodejs:build --with-deps=false
  1. In the client application, run npm link <package> --save to ensure that the package.json of the client application is updated with a file: link to the dependency. This effectively creates a symlink in the node_modules of the client application to the local dependency in this repository.
cd path/to/client-application
npm link <package> --save

Having done this setup, this is what the development cycle looks like moving forward:

  1. Make code change
  2. Rebuild specific package
  3. Rebuild client application.
  • The Publishing section. I'm not sure if these are still the commands to publish the SDK:
Publishing

You must have at least nodejs v18 to do this.

  1. Install the latest packages with yarn install

  2. Run yarn bump to bump the version

  3. Build all the packages with yarn build

  4. Run the unit tests with yarn test:unit & e2e node tests yarn test:local locally & ensure that they pass

  5. Update the docs with yarn gen:docs --push

  6. Finally, publish with yarn publish:packages

  7. Commit these changes "Published version X.X.X"

  • The Testing with a Local Lit Node section. The commands used by this section no longer exist in package.json:
Testing with a Local Lit Node

First, deploy your Lit Node Contracts, since the correct addresses will be pulled from the ../lit-assets/blockchain/contracts/deployed-lit-node-contracts-temp.json file.

Set these two env vars:

export LIT_JS_SDK_LOCAL_NODE_DEV="true"
export LIT_JS_SDK_FUNDED_WALLET_PRIVATE_KEY="putAFundedPrivateKeyOnChronicleHere"

Run:

yarn update:contracts-sdk --fetch
yarn update:contracts-sdk --gen
yarn build:packages

To run manual tests:

 yarn nx run nodejs:serve

ENV Vars

  • LIT_JS_SDK_GITHUB_ACCESS_TOKEN - a github access token to get the contract ABIs from a private repo
  • LIT_JS_SDK_LOCAL_NODE_DEV - set to true to use a local node
  • LIT_JS_SDK_FUNDED_WALLET_PRIVATE_KEY - set to a funded wallet on Chronicle Testnet
  • The Dockerfile section. This just had ...coming soon
  • The Interactive graph dependencies using NX section. the graph command this section used no longer exists in package.json
  • The FAQs & Common Errors section. The section didn't actually seem useful anymore imo, and it didn't really answer any questions. Maybe the error Command failed with exit code 13. error is worth including?

@Ansonhkg
Copy link
Collaborator

Nice! Here's the new JS-SDK setup steps perhaps we can include it in the README too:
https://www.notion.so/litprotocol/Naga-JS-SDK-Setup-20e6f449b041801b8c01e242ae3fd5c5?source=copy_link

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

Successfully merging this pull request may close these issues.

2 participants