Skip to content

Few questions about setting up the development environment #327

@Vafa-Andalibi

Description

@Vafa-Andalibi

Hi,

I'm new to typescript and am trying to add some functionality to some packages in this repo. I tried to to create a node/typescript package and add tonaljs as a dependency and develop my package while modifying the tonaljs. To achieve this, I tried to rely on nodemon so that whenever I make any change on the dependency (@tonaljs), they are automatically propagated to my package.

What I did was:

  • Create a new package (my main project)
  • Build tonaljs using yarn install followed by yarn build:all
  • Use npm link on each folder in tonal/packages/ (I also tried this step on all built files in tonal/node_modules/@tonaljs
  • Use npm link <name> to add each package from previous step to my own package
  • [at this point the dependency works fine and I can use the library]
  • Use nodemon on the main tonaljs folder (NOT the one in my package's node_module folder) to monitor changes (tried this on the tonal/packages folder as well as a specific folder like tonal/packages/intervals).

The problem is that nodemon detects changes, but the output of API doesn't change in my package.

Few questions:

  • What am I doing wrong?
  • Is there any easier way to do this?
  • Why doesn't the main file from package.json exist before the build?
  • If I want to create the main file on top of this library and modify the library while developing the main, can I do that right in the tonal folder, or do I have to create another project and add this as a dependency?

Thank you,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions