Jacdac Documentation Web Site
Перейти к файлу
Peli de Halleux 25c2673eeb add HSTS headers 2024-10-30 21:58:26 +00:00
.devcontainer
.genaiscript
.github/workflows
.vscode
gatsby-remark-makecode@c8ede4d9c3
jacdac-cli@f9e8f0a99e
jacdac-ddk@0bda4ca876
jacdac-dotnet@36e6bd4c59
jacdac-python@86bb959509
jacdac-ts@b52f3ca976
node-red-contrib-jacdac@0e7d585046
pxt-jacdac@9416442fbc
react-jacdac@f5d9d3d29e
scripts
src
static
test
.eslintrc.json
.gitattributes
.gitignore
.gitmodules
.prettierignore
.prettierrc
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md
SECURITY.md
build.bat
buildproxy.sh
bump.sh
dummy.sln
gatsby-browser.js
gatsby-config.js
gatsby-node.js
gatsby-ssr.js
lighthouserc.js
package.json
yarn.lock

README.md

Jacdac Documentation

Jacdac is a plug-and-play hardware and software stack for microcontrollers and their peripherals such as sensors and actuators. Jacdac is primarily designed for “modular electronics” scenarios that support rapid prototyping, creative exploration, making and learning through physical computing. Jacdac is designed to be cheap, flexible and extensible.

This repository contains sources of Jacdac.

The rest of this page is for developers of the jacdac-ts library.

Developer setup

All command line instructions assume a bash-like terminal.

On Windows, you may need to run these commands within Git Bash or Windows Subsystem for Linux (WSL), unless you have bash-like tools available locally. Previous installs have worked on WSL2 with Ubuntu-20.04.

Codespaces

Edit this project directly from your browser using GitHub Codespaces. If you have access to them,

yarn develop
  • click on the generated URL in the terminal output and voila!

Local Setup

  • install node.js ** Have successfully tested with node 14.17.0. There were some errors when using node 16.3.0 (note made on 6/2021, please update if errors with node v16.3.0 are resolved.)
  • install python 2 (if you don't have it already)
  • install yarn globally if needed
npm install -g yarn
  • setup repo
yarn setup

Do not use npm

Updating dependencies

Use npm-check-updates to upgrade all dependencies expect blockly*, tfjs, mdx.

VS Code

You are welcome to use any editor you want! Visual Studio Code provides seamless support for git sub-modules and is our preferred editor.

code .
  • install the recommended extensions (MDX, ESLint and Prettier extensions)
  • in the Git view, click on the jacdac branch and select main so that changes are automatically synched
  • remember that you need a bash-like terminal to run some of these commands - VS Code allows you to start a Git Bash terminal from the new terminals dropdown

Specs build

To regenerate the service definition JSON files from the .md files in jacdac-spec, run

yarn buildspecs

Docs build

  • run the docs web site locally
yarn develop

If you are offline, set the JACDAC_OFFLINE=1 environment variable.

export JACDAC_OFFLINE=1
  • browse to the local server
http://localhost:8000?dbg=1

To analyze the webpack bundle size,

cd docs
gatsby build
gatsby serve
nav to http://127.0.0.1:3001

If the build fails after pulling, try

yarn clean

Jacdac + MakeCode

Local build

Run this command to rebuild the makecode packages

yarn buildpxt

Local debugging

Open the multi editor to test MakeCode devices with the Jacdac view. You can select to run Jacdac and/or MakeCode on localhost/web from the drop downs.

https://makecode.com/multi?jacdac=1&localhost=1&beta=1

Adding a new MakeCode client

Create a new issue in https://github.com/microsoft/jacdac and select the MakeCode client template.

HTML tools

You can do yarn watch to watch/build bundles. Bundles are placed under the dist folder.

yarn watch

On another terminal, launch a small web server and try all the tools under docs/static/tools/* at http://localhost:8080/docs/static/tools/js/console.html . These tools load the files under dist so you'll want to also run yarn watch on the side.

yarn tools

Commits create releases

The releases are automatically created by the build system based on the title of the commit:

  • patch|fix:... patch
  • minor:feature:... minor

NPM scripts

  • yarn watch: Run yarn build in watch mode
  • yarn lint: Lints code
  • yarn develop: Launch docs web service

Microsoft Open Source Code of Conduct

This project is hosted at https://github.com/microsoft/jacdac-ts. This project has adopted the Microsoft Open Source Code of Conduct.

Resources: