Skip to content

The usage of npm link #36

@CMCDragonkai

Description

@CMCDragonkai

The npm link can be useful when developing multiple packages together without having to go through publishing overhead. The exact steps for our system is a bit complicated.

Tasks

  • 1. Add export npm_config_prefix=~/.npm to shell.nix, this ensures that ~/.npm is used for these links, and so it doesn't try to write it to the read-only path in /nix/store.
  • 2. Provide instructions that you must then provide tsconfig paths for the relevant package like with the package @matrixai/db (this unfortunately must be done manually)
      "paths": {
        "@": ["index"],
        "@/*": ["*"],
        "@matrixai/db": ["../node_modules/@matrixai/db/src"],
        "@matrixai/db/*": ["../node_modules/@matrixai/db/src/*"]
      },
    
  • 3. Explain how you now use npm link ../js-db, or use npm link in the js-db, then go back to js-polykey and use npm link @matrixai/db

Then you don't need to use npm run build, and you can reload window in vscode in case types must be updated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    procedureAction that must be executed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions