microsoft / microsoft/pxt-microbit

Question: How can local dependencies be referenced in pxt.json

Open
#6,277 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cli
Dominant language
TypeScript
Stars
804
Forks
721
Avg merge
2d 9h
Merged PRs (30d)
2

Description

Hello,

When developing my micro:bit v2 application using TypeScript, I forked an external dependency on GitHub to make a few changes that I want to propose as a Pull Request.

Now I need to link that local dependency to my application to test my changes.

In the pxt.json, dependencies are defined in this fashion:

{
    "dependencies": {
        "core": "*",
        "sonarbit": "github:elecfreaks/pxt-sonarbit#v1.0.9"
    }
}

I tried to change the above to:

{
    "dependencies": {
        "core": "*",
        "sonarbit": "local:../pxt-sonarbit"
    }
}

However, when running mkc build, I got

Exception: Error: Error: extension sonarbit is missing pxt.json

The pxt.json file is there. Even when changing the relative path to an absolute path, the same happened.

I know it's possible to achieve what I'm after in the online MakeCode editor. Is the same possible locally when using mkc?
The online editor is so inconvenient for day-to-day development.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the application pxt.json and the mkc build command, reproducing the failure with the local:../pxt-sonarbit dependency and checking the referenced dependency's pxt.json. Done means the local fork can be referenced and built successfully with mkc, or the supported limitation and workflow are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system, cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.