Skip to content

Latest commit

 

History

History
113 lines (75 loc) · 4.7 KB

CONTRIBUTE.md

File metadata and controls

113 lines (75 loc) · 4.7 KB

Contributing to Pymakr VSC

Thank you for reading this document. We hope it will aid you in creating one or more PRs.

Requirements

  • VSCode,
  • NodeJS - LTS version 16.14.2, 14.19.1 or later

Hint: For Node, we recommend using a version manager like volta or nvm

Language used in this project

The plugin is written in JavaScript with Type Hints via JSDoc.

Due to this it is not needed (or possible) to use a TypeScript compiler to transpile the code before running as it's already Javascript. Typescript is only used to validate the types an by typedoc when generating the API docs. In this project tsc should vever be run , and the outDir in tsconfig.json is specified only to avoid distracting errors from the TypeScript compiler.

Refs:

Setup

To work on Pymakr VSC, we first need to clone the repo and install its dependencies.

  1. Clone project

    git clone https://github.com/pycom/pymakr-vsc --branch next
    
  2. Install dependencies

    cd pymakr-vsc
    npm install
    

Running the extension

To run the extension, we need to open the project in VSCode and run the source code in debug mode.

  1. Open the repo in VSCode

    Hint: We can do this directly from the terminal by typing code .

  2. Run/Debug the extension

    Click Run and Debug (Ctrl+Shift+D) -> Run Pymakr

    Hint: We can also start the task with F5. This shortcut always starts the last run task.


Testing the extension

Hardware requirements:

  • The integration tests expect two MicroPython devices to be connected to the computer using a USB cable / serial port connection.

Tests can be run directly from the terminal by typing

  • npm run test:types, to test type safety.
  • npm run test:unit, to run the unit tests.
  • npm run test:integration, to run the integration tests.
  • npm run test, to run all tests.

To develop or debug tests use the same way to run/debug the extension. Instead of clicking Run PyMakr, we click the dropdown arrow and choose Integration Tests or Unit Tests.

Hint: F5 can be used to start the last executed task.


File structure

Path Description
example Example projects (may be deleted for a templating approach)
media Media assets
node_modules Node dependencies. Fully managed by npm.
src Source files. See API.md for info.
templates Templates used for erasing device / creating new projects
test Integration tests
types Types used for auto completion

Create a local package [Optional]

You may want to simply package the extension for testing on multiple systems without publishing them to the store. Extensions will always be packaged into a .vsix file. Here's how: vsce package

This will package your extension into a .vsix file and place it in the current directory. It's possible to install .vsix files into Visual Studio Code. See Installing Extensions for more details.

ref: https://vscode-docs.readthedocs.io/en/latest/tools/vscecli/

Submitting a PR

Please submit PRs to the next-staging branch.

We encourage commit messages to follow Angular's Commit Message Format. Eg. fix: some bug, feat: some new feature etc.

API

For API documentation, please see Pymakr API.

Release flow