From d97c70fb3653f0541383d7c30a1be37d11ccb1f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=AB=8B=E5=B8=AE?= <3294713004@qq.com> Date: Tue, 3 Dec 2024 10:44:30 +0800 Subject: [PATCH] =?UTF-8?q?Update:=20MicroPython=E4=BD=BF=E7=94=A8AST?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E4=B8=8Bpy=E6=96=87=E4=BB=B6=E6=8A=BD?= =?UTF-8?q?=E8=B1=A1=E8=AF=AD=E6=B3=95=E6=A0=91=E4=BB=A5=E7=B2=BE=E7=A1=AE?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=E6=A8=A1=E5=9D=97=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- boards/default/micropython/build/lib/map.json | 814 ++++++++++++++++++ .../micropython_esp32/build/lib/map.json | 40 + .../micropython_esp32c2/build/lib/map.json | 75 ++ .../micropython_esp32c3/build/lib/map.json | 72 ++ .../micropython_esp32s2/build/lib/map.json | 28 + .../micropython_esp32s3/build/lib/map.json | 116 +++ .../build/lib/map.json | 221 +++++ .../build/lib/map.json | 80 ++ .../build/lib/map.json | 24 + .../micropython_robot/build/lib/map.json | 59 ++ boards/default_src/arduino/package.json | 2 +- boards/default_src/arduino_avr/package.json | 2 +- boards/default_src/arduino_esp32/package.json | 2 +- .../default_src/arduino_esp8266/package.json | 2 +- .../micropython/origin/build/lib/map.json | 814 ++++++++++++++++++ boards/default_src/micropython/package.json | 3 +- .../origin/build/lib/map.json | 40 + .../micropython_esp32/package.json | 3 +- .../origin/build/lib/map.json | 75 ++ .../micropython_esp32c2/package.json | 3 +- .../origin/build/lib/map.json | 72 ++ .../micropython_esp32c3/package.json | 3 +- .../origin/build/lib/map.json | 28 + .../micropython_esp32s2/package.json | 3 +- .../origin/build/lib/map.json | 116 +++ .../micropython_esp32s3/package.json | 3 +- .../micropython_k210_mixgoai/package.json | 3 +- .../origin/build/lib/map.json | 80 ++ .../package.json | 3 +- .../origin/build/lib/map.json | 24 + .../package.json | 3 +- .../origin/build/lib/map.json | 59 ++ .../micropython_robot/package.json | 3 +- boards/default_src/python/package.json | 2 +- boards/default_src/python_mixpy/package.json | 2 +- .../default_src/python_pyodide/package.json | 2 +- boards/default_src/python_skulpt/package.json | 2 +- .../python_skulpt_car/package.json | 2 +- .../python_skulpt_mixtoy/package.json | 2 +- package.json | 1 - scripts/build-examples.js | 41 +- scripts/build-libraries.py | 49 ++ 42 files changed, 2938 insertions(+), 40 deletions(-) create mode 100644 boards/default/micropython/build/lib/map.json create mode 100644 boards/default/micropython_esp32/build/lib/map.json create mode 100644 boards/default/micropython_esp32c2/build/lib/map.json create mode 100644 boards/default/micropython_esp32c3/build/lib/map.json create mode 100644 boards/default/micropython_esp32s2/build/lib/map.json create mode 100644 boards/default/micropython_esp32s3/build/lib/map.json create mode 100644 boards/default/micropython_k210_mixgoai/build/lib/map.json create mode 100644 boards/default/micropython_nrf51822_microbit/build/lib/map.json create mode 100644 boards/default/micropython_nrf51822_mithoncc/build/lib/map.json create mode 100644 boards/default/micropython_robot/build/lib/map.json create mode 100644 boards/default_src/micropython/origin/build/lib/map.json create mode 100644 boards/default_src/micropython_esp32/origin/build/lib/map.json create mode 100644 boards/default_src/micropython_esp32c2/origin/build/lib/map.json create mode 100644 boards/default_src/micropython_esp32c3/origin/build/lib/map.json create mode 100644 boards/default_src/micropython_esp32s2/origin/build/lib/map.json create mode 100644 boards/default_src/micropython_esp32s3/origin/build/lib/map.json create mode 100644 boards/default_src/micropython_nrf51822_microbit/origin/build/lib/map.json create mode 100644 boards/default_src/micropython_nrf51822_mithoncc/origin/build/lib/map.json create mode 100644 boards/default_src/micropython_robot/origin/build/lib/map.json create mode 100644 scripts/build-libraries.py diff --git a/boards/default/micropython/build/lib/map.json b/boards/default/micropython/build/lib/map.json new file mode 100644 index 00000000..5a038f77 --- /dev/null +++ b/boards/default/micropython/build/lib/map.json @@ -0,0 +1,814 @@ +{ + "adxl345": { + "__require__": [ + "time", + "ustruct", + "micropython" + ], + "__file__": true, + "__name__": "adxl345.py" + }, + "ahtx0": { + "__require__": [ + "utime", + "micropython" + ], + "__file__": true, + "__name__": "ahtx0.py" + }, + "ap3216c": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "ap3216c.py" + }, + "apds9960": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "apds9960.py" + }, + "baidu_speech": { + "__require__": [ + "json", + "gc", + "urequests", + "array", + "ubinascii", + "machine" + ], + "__file__": true, + "__name__": "baidu_speech.py" + }, + "ble_advertising": { + "__require__": [ + "micropython", + "struct", + "bluetooth" + ], + "__file__": true, + "__name__": "ble_advertising.py" + }, + "ble_central": { + "__require__": [ + "time", + "gc", + "bluetooth", + "micropython", + "ubinascii", + "ble_advertising" + ], + "__file__": true, + "__name__": "ble_central.py" + }, + "ble_handle": { + "__require__": [ + "ble_peripheral" + ], + "__file__": true, + "__name__": "ble_handle.py" + }, + "ble_hid_keyboard": { + "__require__": [ + "bluetooth", + "struct", + "time", + "micropython", + "ubinascii", + "ble_advertising", + "bluetooth", + "ble_hid_key" + ], + "__file__": true, + "__name__": "ble_hid_keyboard.py" + }, + "ble_hid_mouse": { + "__require__": [ + "bluetooth", + "struct", + "time", + "micropython", + "ubinascii", + "ble_advertising", + "bluetooth", + "ble_hid_key" + ], + "__file__": true, + "__name__": "ble_hid_mouse.py" + }, + "ble_peripheral": { + "__require__": [ + "bluetooth", + "micropython", + "ubinascii", + "ble_advertising" + ], + "__file__": true, + "__name__": "ble_peripheral.py" + }, + "ble_uart_peripheral": { + "__require__": [ + "bluetooth", + "ble_advertising", + "micropython" + ], + "__file__": true, + "__name__": "ble_uart_peripheral.py" + }, + "ble_uart_repl": { + "__require__": [ + "io", + "os", + "machine", + "micropython", + "ble_uart_peripheral" + ], + "__file__": true, + "__name__": "ble_uart_repl.py" + }, + "blynklib": { + "__require__": [ + "usocket", + "utime", + "ustruct", + "uselect", + "micropython" + ], + "__file__": true, + "__name__": "blynklib.py" + }, + "blynktimer": { + "__require__": [ + "time", + "select", + "utime", + "uselect" + ], + "__file__": true, + "__name__": "blynktimer.py" + }, + "bmp280": { + "__require__": [ + "ustruct", + "utime" + ], + "__file__": true, + "__name__": "bmp280.py" + }, + "cbr817": { + "__require__": [ + "time", + "machine", + "micropython" + ], + "__file__": true, + "__name__": "cbr817.py" + }, + "cc_g1": { + "__require__": [ + "micropython", + "machine" + ], + "__file__": true, + "__name__": "cc_g1.py" + }, + "ch914x_at": { + "__require__": [ + "machine", + "time" + ], + "__file__": true, + "__name__": "ch914x_at.py" + }, + "ci130x": { + "__require__": [ + "time", + "struct", + "micropython" + ], + "__file__": true, + "__name__": "ci130x.py" + }, + "debugnet": { + "__require__": [ + "time", + "umqtt", + "ubinascii", + "machine", + "urequests", + "usocket", + "mixiot", + "ussl", + "ujson" + ], + "__file__": true, + "__name__": "debugnet.py" + }, + "dhtx": { + "__require__": [ + "time", + "machine", + "esp", + "machine" + ], + "__file__": true, + "__name__": "dhtx.py" + }, + "ds18b20": { + "__require__": [ + "onewire", + "machine", + "micropython" + ], + "__file__": true, + "__name__": "ds18b20.py" + }, + "expression_picture": { + "__require__": [], + "__file__": true, + "__name__": "expression_picture.py" + }, + "eye_picture": { + "__require__": [], + "__file__": true, + "__name__": "eye_picture.py" + }, + "gnss": { + "__require__": [ + "time", + "ubinascii" + ], + "__file__": true, + "__name__": "gnss.py" + }, + "hp203x": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "hp203x.py" + }, + "ht16k33": { + "__require__": [ + "uframebuf", + "micropython" + ], + "__file__": true, + "__name__": "ht16k33.py" + }, + "huskylens": { + "__require__": [ + "time", + "ubinascii" + ], + "__file__": true, + "__name__": "huskylens.py" + }, + "i2cdevice": { + "__require__": [ + "random", + "machine" + ], + "__file__": true, + "__name__": "i2cdevice.py" + }, + "i2clcd": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "i2clcd.py" + }, + "icm42670": { + "__require__": [ + "time", + "micropython", + "math" + ], + "__file__": true, + "__name__": "icm42670.py" + }, + "informatio_picture": { + "__require__": [], + "__file__": true, + "__name__": "informatio_picture.py" + }, + "irremote": { + "__require__": [ + "array", + "time", + "gc", + "esp32", + "machine" + ], + "__file__": true, + "__name__": "irremote.py" + }, + "ltr308al": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "ltr308al.py" + }, + "ltr381rgb": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "ltr381rgb.py" + }, + "ltr390uv": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "ltr390uv.py" + }, + "ltr553als": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "ltr553als.py" + }, + "matcher": { + "__require__": [], + "__file__": true, + "__name__": "matcher.py" + }, + "matrix16x8": { + "__require__": [ + "ht16k33" + ], + "__file__": true, + "__name__": "matrix16x8.py" + }, + "matrix32x12": { + "__require__": [ + "tm1680" + ], + "__file__": true, + "__name__": "matrix32x12.py" + }, + "matrix8x5": { + "__require__": [ + "tm1652" + ], + "__file__": true, + "__name__": "matrix8x5.py" + }, + "max30102": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "max30102.py" + }, + "mixgo_ai": { + "__require__": [ + "time", + "gc" + ], + "__file__": true, + "__name__": "mixgo_ai.py" + }, + "mixiot": { + "__require__": [ + "time", + "usocket", + "ustruct", + "machine", + "ubinascii", + "matcher", + "network", + "urequests", + "ussl" + ], + "__file__": true, + "__name__": "mixiot.py" + }, + "mixpy": { + "__require__": [ + "math", + "urequests", + "json" + ], + "__file__": true, + "__name__": "mixpy.py" + }, + "mmc5603": { + "__require__": [ + "time", + "math", + "micropython", + "magnetic_cal" + ], + "__file__": true, + "__name__": "mmc5603.py" + }, + "mpu9250": { + "__require__": [ + "micropython", + "ustruct", + "time", + "math", + "machine", + "math", + "matrix16x8", + "os", + "compass_cfg", + "compass_cfg" + ], + "__file__": true, + "__name__": "mpu9250.py" + }, + "ms32006": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "ms32006.py" + }, + "msa301": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "msa301.py" + }, + "music": { + "__require__": [ + "time", + "machine" + ], + "__file__": true, + "__name__": "music.py" + }, + "mxc6655xa": { + "__require__": [ + "time", + "math", + "micropython", + "math" + ], + "__file__": true, + "__name__": "mxc6655xa.py" + }, + "ns9300": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "ns9300.py" + }, + "ntptime": { + "__require__": [ + "utime", + "gc", + "machine", + "usocket", + "ustruct" + ], + "__file__": true, + "__name__": "ntptime.py" + }, + "object_picture": { + "__require__": [], + "__file__": true, + "__name__": "object_picture.py" + }, + "oled128x64": { + "__require__": [ + "ssd1106" + ], + "__file__": true, + "__name__": "oled128x64.py" + }, + "onenet": { + "__require__": [ + "ujson", + "umqtt" + ], + "__file__": true, + "__name__": "onenet.py" + }, + "pe_g1": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "pe_g1.py" + }, + "pm2_5": { + "__require__": [ + "time" + ], + "__file__": true, + "__name__": "pm2_5.py" + }, + "progres_picture": { + "__require__": [], + "__file__": true, + "__name__": "progres_picture.py" + }, + "ps2": { + "__require__": [ + "time", + "machine", + "micropython" + ], + "__file__": true, + "__name__": "ps2.py" + }, + "qmc5883l": { + "__require__": [ + "math", + "time", + "micropython" + ], + "__file__": true, + "__name__": "qmc5883l.py" + }, + "qmi8658": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "qmi8658.py" + }, + "radio": { + "__require__": [ + "ubinascii", + "network", + "esp", + "espnow" + ], + "__file__": true, + "__name__": "radio.py" + }, + "rc522": { + "__require__": [ + "machine", + "micropython" + ], + "__file__": true, + "__name__": "rc522.py" + }, + "rfm98": { + "__require__": [ + "gc", + "time", + "machine", + "micropython" + ], + "__file__": true, + "__name__": "rfm98.py" + }, + "rtctime": { + "__require__": [ + "gc", + "time", + "machine", + "usocket", + "ustruct" + ], + "__file__": true, + "__name__": "rtctime.py" + }, + "sc7a20": { + "__require__": [ + "time", + "math", + "micropython", + "math" + ], + "__file__": true, + "__name__": "sc7a20.py" + }, + "sdcard": { + "__require__": [ + "time", + "machine", + "micropython" + ], + "__file__": true, + "__name__": "sdcard.py" + }, + "seniverse_api": { + "__require__": [ + "json", + "urequests" + ], + "__file__": true, + "__name__": "seniverse_api.py" + }, + "servo": { + "__require__": [ + "machine" + ], + "__file__": true, + "__name__": "servo.py" + }, + "sht20": { + "__require__": [ + "struct", + "time" + ], + "__file__": true, + "__name__": "sht20.py" + }, + "shtc3": { + "__require__": [ + "time", + "micropython", + "struct" + ], + "__file__": true, + "__name__": "shtc3.py" + }, + "sonar": { + "__require__": [ + "time", + "machine" + ], + "__file__": true, + "__name__": "sonar.py" + }, + "spl06_001": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "spl06_001.py" + }, + "ssd1106": { + "__require__": [ + "uframebuf", + "micropython" + ], + "__file__": true, + "__name__": "ssd1106.py" + }, + "st7735": { + "__require__": [ + "time", + "uframebuf", + "machine", + "micropython" + ], + "__file__": true, + "__name__": "st7735.py" + }, + "st7789": { + "__require__": [ + "time", + "machine", + "micropython", + "uframebuf", + "ustruct" + ], + "__file__": true, + "__name__": "st7789.py" + }, + "syn6288": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "syn6288.py" + }, + "tm1650": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "tm1650.py" + }, + "tm1652": { + "__require__": [ + "time", + "uframebuf", + "machine", + "micropython" + ], + "__file__": true, + "__name__": "tm1652.py" + }, + "tm1680": { + "__require__": [ + "uframebuf", + "micropython" + ], + "__file__": true, + "__name__": "tm1680.py" + }, + "tm1931": { + "__require__": [ + "time", + "framebuf", + "machine", + "micropython" + ], + "__file__": true, + "__name__": "tm1931.py" + }, + "uart_com": { + "__require__": [], + "__file__": true, + "__name__": "uart_com.py" + }, + "ucs12071": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "ucs12071.py" + }, + "uframebuf": { + "__require__": [ + "esp", + "time", + "gc", + "framebuf" + ], + "__file__": true, + "__name__": "uframebuf.py" + }, + "umqtt": { + "__require__": [ + "usocket", + "ustruct", + "ussl" + ], + "__file__": true, + "__name__": "umqtt.py" + }, + "urequests": { + "__require__": [ + "usocket", + "ujson", + "ssl", + "ujson" + ], + "__file__": true, + "__name__": "urequests.py" + }, + "vl53l0x": { + "__require__": [ + "micropython", + "ustruct", + "utime" + ], + "__file__": true, + "__name__": "vl53l0x.py" + }, + "ws2812": { + "__require__": [ + "time", + "machine" + ], + "__file__": true, + "__name__": "ws2812.py" + }, + "ws_lora": { + "__require__": [ + "json", + "rfm98", + "ubinascii", + "machine", + "hp203x" + ], + "__file__": true, + "__name__": "ws_lora.py" + }, + "ws_solo": { + "__require__": [ + "time", + "math", + "machine" + ], + "__file__": true, + "__name__": "ws_solo.py" + } +} \ No newline at end of file diff --git a/boards/default/micropython_esp32/build/lib/map.json b/boards/default/micropython_esp32/build/lib/map.json new file mode 100644 index 00000000..ba6cb605 --- /dev/null +++ b/boards/default/micropython_esp32/build/lib/map.json @@ -0,0 +1,40 @@ +{ + "mixgo": { + "__require__": [ + "time", + "gc", + "machine", + "ws2812", + "music", + "mpu9250", + "matrix16x8" + ], + "__file__": true, + "__name__": "mixgo.py" + }, + "mixgo_pe": { + "__require__": [ + "time", + "gc", + "machine", + "matrix8x5", + "machine" + ], + "__file__": true, + "__name__": "mixgo_pe.py" + }, + "mpython": { + "__require__": [ + "time", + "gc", + "machine", + "ws2812", + "music", + "oled128x64", + "mmc5603", + "qmi8658" + ], + "__file__": true, + "__name__": "mpython.py" + } +} \ No newline at end of file diff --git a/boards/default/micropython_esp32c2/build/lib/map.json b/boards/default/micropython_esp32c2/build/lib/map.json new file mode 100644 index 00000000..fff3376b --- /dev/null +++ b/boards/default/micropython_esp32c2/build/lib/map.json @@ -0,0 +1,75 @@ +{ + "ble_central": { + "__require__": [ + "time", + "gc", + "bluetooth", + "micropython", + "ubinascii", + "ble_advertising" + ], + "__file__": true, + "__name__": "ble_central.py" + }, + "mini_bot": { + "__require__": [ + "time", + "math", + "esp", + "micropython", + "framebuf" + ], + "__file__": true, + "__name__": "mini_bot.py" + }, + "mini_g2": { + "__require__": [ + "gc", + "machine", + "rc522" + ], + "__file__": true, + "__name__": "mini_g2.py" + }, + "mini_go": { + "__require__": [ + "time", + "gc", + "math", + "tm1931", + "machine" + ], + "__file__": true, + "__name__": "mini_go.py" + }, + "mixgo_mini": { + "__require__": [ + "time", + "gc", + "esp32", + "machine", + "ws2812x", + "musicx", + "sc7a20", + "ap3216c", + "mini_bot" + ], + "__file__": true, + "__name__": "mixgo_mini.py" + }, + "musicx": { + "__require__": [ + "time" + ], + "__file__": true, + "__name__": "musicx.py" + }, + "ws2812x": { + "__require__": [ + "time", + "machine" + ], + "__file__": true, + "__name__": "ws2812x.py" + } +} \ No newline at end of file diff --git a/boards/default/micropython_esp32c3/build/lib/map.json b/boards/default/micropython_esp32c3/build/lib/map.json new file mode 100644 index 00000000..d49b6ed2 --- /dev/null +++ b/boards/default/micropython_esp32c3/build/lib/map.json @@ -0,0 +1,72 @@ +{ + "me_g1": { + "__require__": [ + "time", + "gc", + "machine", + "hp203x", + "ahtx0", + "rc522" + ], + "__file__": true, + "__name__": "me_g1.py" + }, + "me_go": { + "__require__": [ + "time", + "gc", + "math", + "tm1931", + "machine" + ], + "__file__": true, + "__name__": "me_go.py" + }, + "mixgocar_c3": { + "__require__": [ + "time", + "gc", + "ms32006", + "machine", + "ws2812", + "music" + ], + "__file__": true, + "__name__": "mixgocar_c3.py" + }, + "mixgo_cc": { + "__require__": [ + "time", + "gc", + "machine", + "ws2812", + "music", + "mxc6655xa", + "ltr553als", + "rc522", + "matrix32x12", + "mmc5603", + "hp203x", + "spl06_001", + "ahtx0", + "shtc3" + ], + "__file__": true, + "__name__": "mixgo_cc.py" + }, + "mixgo_me": { + "__require__": [ + "time", + "gc", + "machine", + "ws2812", + "music", + "mxc6655xa", + "ltr553als", + "matrix8x5", + "mmc5603" + ], + "__file__": true, + "__name__": "mixgo_me.py" + } +} \ No newline at end of file diff --git a/boards/default/micropython_esp32s2/build/lib/map.json b/boards/default/micropython_esp32s2/build/lib/map.json new file mode 100644 index 00000000..0fdccf19 --- /dev/null +++ b/boards/default/micropython_esp32s2/build/lib/map.json @@ -0,0 +1,28 @@ +{ + "ce_go": { + "__require__": [ + "time", + "gc", + "math", + "tm1931", + "machine" + ], + "__file__": true, + "__name__": "ce_go.py" + }, + "mixgo_ce": { + "__require__": [ + "time", + "gc", + "machine", + "ws2812", + "music", + "matrix16x8", + "msa301", + "mxc6655xa", + "machine" + ], + "__file__": true, + "__name__": "mixgo_ce.py" + } +} \ No newline at end of file diff --git a/boards/default/micropython_esp32s3/build/lib/map.json b/boards/default/micropython_esp32s3/build/lib/map.json new file mode 100644 index 00000000..3455ab17 --- /dev/null +++ b/boards/default/micropython_esp32s3/build/lib/map.json @@ -0,0 +1,116 @@ +{ + "es8374": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "es8374.py" + }, + "mixgo_nova": { + "__require__": [ + "machine", + "time", + "gc", + "st7735", + "math", + "ws2812", + "_boot", + "mxc6655xa", + "ltr553als", + "ltr553als", + "rc522", + "mmc5603", + "hp203x", + "ahtx0", + "shtc3", + "machine" + ], + "__file__": true, + "__name__": "mixgo_nova.py" + }, + "mixgo_nova_voice": { + "__require__": [ + "ustruct", + "time", + "music_spk", + "es8374", + "machine", + "mixgo_nova", + "urequests" + ], + "__file__": true, + "__name__": "mixgo_nova_voice.py" + }, + "mixgo_zero": { + "__require__": [ + "machine", + "time", + "gc", + "st7789_bf", + "math", + "ws2812", + "_boot", + "mxc6655xa", + "ltr553als", + "ltr553als", + "shtc3", + "rc522", + "mmc5603", + "spl06_001", + "machine" + ], + "__file__": true, + "__name__": "mixgo_zero.py" + }, + "mixgo_zero_voice": { + "__require__": [ + "ustruct", + "time", + "music_spk", + "es8374", + "machine", + "mixgo_zero", + "urequests" + ], + "__file__": true, + "__name__": "mixgo_zero_voice.py" + }, + "music_spk": { + "__require__": [ + "time", + "math", + "array", + "struct" + ], + "__file__": true, + "__name__": "music_spk.py" + }, + "nova_g1": { + "__require__": [ + "micropython", + "mixgo_nova" + ], + "__file__": true, + "__name__": "nova_g1.py" + }, + "sdcard": { + "__require__": [ + "time", + "machine", + "micropython" + ], + "__file__": true, + "__name__": "sdcard.py" + }, + "st7789_bf": { + "__require__": [ + "time", + "uframebuf", + "machine", + "micropython" + ], + "__file__": true, + "__name__": "st7789_bf.py" + } +} \ No newline at end of file diff --git a/boards/default/micropython_k210_mixgoai/build/lib/map.json b/boards/default/micropython_k210_mixgoai/build/lib/map.json new file mode 100644 index 00000000..949a7207 --- /dev/null +++ b/boards/default/micropython_k210_mixgoai/build/lib/map.json @@ -0,0 +1,221 @@ +{ + "adxl345": { + "__require__": [ + "machine", + "time", + "ustruct" + ], + "__file__": true, + "__name__": "adxl345.py" + }, + "aionenet": { + "__require__": [ + "network", + "time", + "random", + "request", + "base64", + "json", + "board", + "machine" + ], + "__file__": true, + "__name__": "aionenet.py" + }, + "ai_face": { + "__require__": [ + "KPU", + "gc", + "image", + "time", + "board" + ], + "__file__": true, + "__name__": "ai_face.py" + }, + "base64": { + "__require__": [ + "re", + "struct", + "binascii", + "warnings", + "warnings", + "sys", + "getopt" + ], + "__file__": true, + "__name__": "base64.py" + }, + "bmp280": { + "__require__": [ + "ustruct", + "utime", + "machine" + ], + "__file__": true, + "__name__": "bmp280.py" + }, + "ce_com": { + "__require__": [], + "__file__": true, + "__name__": "ce_com.py" + }, + "dht11": { + "__require__": [ + "time", + "board" + ], + "__file__": true, + "__name__": "dht11.py" + }, + "hcr04": { + "__require__": [ + "time", + "board" + ], + "__file__": true, + "__name__": "hcr04.py" + }, + "irremote": { + "__require__": [ + "time", + "board" + ], + "__file__": true, + "__name__": "irremote.py" + }, + "matcher": { + "__require__": [], + "__file__": true, + "__name__": "matcher.py" + }, + "miot_no": { + "__require__": [ + "usocket", + "ustruct", + "network", + "time", + "board", + "ujson", + "machine", + "ussl" + ], + "__file__": true, + "__name__": "miot_no.py" + }, + "mixiot": { + "__require__": [ + "usocket", + "ustruct", + "time", + "machine", + "ubinascii", + "ujson", + "matcher", + "machine", + "ussl" + ], + "__file__": true, + "__name__": "mixiot.py" + }, + "mixly_tool": { + "__require__": [ + "hashlib", + "os", + "sys" + ], + "__file__": true, + "__name__": "mixly_tool.py" + }, + "mixpy": { + "__require__": [ + "math" + ], + "__file__": true, + "__name__": "mixpy.py" + }, + "mpu9250": { + "__require__": [ + "micropython", + "ustruct", + "utime", + "time", + "math", + "math", + "os", + "compass_cfg" + ], + "__file__": true, + "__name__": "mpu9250.py" + }, + "ms32006": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "ms32006.py" + }, + "net_espat": { + "__require__": [ + "network", + "time", + "board", + "machine", + "time" + ], + "__file__": true, + "__name__": "net_espat.py" + }, + "pid": { + "__require__": [ + "time", + "math" + ], + "__file__": true, + "__name__": "pid.py" + }, + "player": { + "__require__": [ + "board", + "audio", + "video", + "Maix", + "gc", + "sensor", + "lcd", + "lcd" + ], + "__file__": true, + "__name__": "player.py" + }, + "reset": { + "__require__": [ + "image", + "lcd", + "time", + "gc", + "machine", + "gc" + ], + "__file__": true, + "__name__": "reset.py" + }, + "servo": { + "__require__": [ + "math", + "ustruct", + "time" + ], + "__file__": true, + "__name__": "servo.py" + }, + "sht20": { + "__require__": [ + "struct", + "time" + ], + "__file__": true, + "__name__": "sht20.py" + } +} \ No newline at end of file diff --git a/boards/default/micropython_nrf51822_microbit/build/lib/map.json b/boards/default/micropython_nrf51822_microbit/build/lib/map.json new file mode 100644 index 00000000..92d29c90 --- /dev/null +++ b/boards/default/micropython_nrf51822_microbit/build/lib/map.json @@ -0,0 +1,80 @@ +{ + "lcd1602": { + "__require__": [ + "microbit" + ], + "__file__": true, + "__name__": "lcd1602.py" + }, + "mixpy": { + "__require__": [ + "math" + ], + "__file__": true, + "__name__": "mixpy.py" + }, + "motor_control": { + "__require__": [ + "microbit" + ], + "__file__": true, + "__name__": "motor_control.py" + }, + "MP3": { + "__require__": [ + "microbit" + ], + "__file__": true, + "__name__": "MP3.py" + }, + "ntc": { + "__require__": [ + "microbit", + "math" + ], + "__file__": true, + "__name__": "ntc.py" + }, + "oled": { + "__require__": [ + "microbit" + ], + "__file__": true, + "__name__": "oled.py" + }, + "rgb": { + "__require__": [ + "microbit" + ], + "__file__": true, + "__name__": "rgb.py" + }, + "RTC": { + "__require__": [ + "microbit" + ], + "__file__": true, + "__name__": "RTC.py" + }, + "Servo": { + "__require__": [ + "microbit" + ], + "__file__": true, + "__name__": "Servo.py" + }, + "TCS": { + "__require__": [ + "microbit" + ], + "__file__": true, + "__name__": "TCS.py" + }, + "ultrasonic": { + "__require__": [ + "microbit" + ], + "__file__": true, + "__name__": "ultrasonic.py" + } +} \ No newline at end of file diff --git a/boards/default/micropython_nrf51822_mithoncc/build/lib/map.json b/boards/default/micropython_nrf51822_mithoncc/build/lib/map.json new file mode 100644 index 00000000..ab9bc0b4 --- /dev/null +++ b/boards/default/micropython_nrf51822_mithoncc/build/lib/map.json @@ -0,0 +1,24 @@ +{ + "mixpy": { + "__require__": [ + "math" + ], + "__file__": true, + "__name__": "mixpy.py" + }, + "motor_control": { + "__require__": [ + "microbit" + ], + "__file__": true, + "__name__": "motor_control.py" + }, + "rgb_show": { + "__require__": [ + "microbit", + "neopixel" + ], + "__file__": true, + "__name__": "rgb_show.py" + } +} \ No newline at end of file diff --git a/boards/default/micropython_robot/build/lib/map.json b/boards/default/micropython_robot/build/lib/map.json new file mode 100644 index 00000000..1ea531cf --- /dev/null +++ b/boards/default/micropython_robot/build/lib/map.json @@ -0,0 +1,59 @@ +{ + "bot51": { + "__require__": [ + "uframebuf", + "micropython" + ], + "__file__": true, + "__name__": "bot51.py" + }, + "feiyi": { + "__require__": [ + "time", + "gc", + "machine", + "ws2812", + "music", + "mxc6655xa", + "ltr553als", + "rc522", + "bot51", + "mmc5603" + ], + "__file__": true, + "__name__": "feiyi.py" + }, + "mixbot": { + "__require__": [ + "time", + "gc", + "random", + "uframebuf", + "micropython", + "machine", + "ws2812", + "music", + "icm42670" + ], + "__file__": true, + "__name__": "mixbot.py" + }, + "mixbot_ext": { + "__require__": [ + "i2cdevice", + "mixbot" + ], + "__file__": true, + "__name__": "mixbot_ext.py" + }, + "rm_e1": { + "__require__": [ + "time", + "gc", + "machine", + "ws2812" + ], + "__file__": true, + "__name__": "rm_e1.py" + } +} \ No newline at end of file diff --git a/boards/default_src/arduino/package.json b/boards/default_src/arduino/package.json index a0b81d4e..9e4d5d6d 100644 --- a/boards/default_src/arduino/package.json +++ b/boards/default_src/arduino/package.json @@ -4,7 +4,7 @@ "description": "适用于mixly的arduino模块", "scripts": { "build:dev": "webpack --config=webpack.dev.js", - "build:prod": "webpack --config=webpack.prod.js && npm run build:examples", + "build:prod": "npm run build:examples && webpack --config=webpack.prod.js", "build:examples": "node ../../../scripts/build-examples.js -t special", "build:examples:ob": "node ../../../scripts/build-examples.js -t special --obfuscate", "publish:board": "npm publish --registry https://registry.npmjs.org/" diff --git a/boards/default_src/arduino_avr/package.json b/boards/default_src/arduino_avr/package.json index 3fb6c7ef..1bf295e7 100644 --- a/boards/default_src/arduino_avr/package.json +++ b/boards/default_src/arduino_avr/package.json @@ -5,7 +5,7 @@ "scripts": { "serve": "webpack-dev-server --config=webpack.dev.js", "build:dev": "webpack --config=webpack.dev.js", - "build:prod": "webpack --config=webpack.prod.js && npm run build:examples", + "build:prod": "npm run build:examples & webpack --config=webpack.prod.js", "build:examples": "node ../../../scripts/build-examples.js -t special", "build:examples:ob": "node ../../../scripts/build-examples.js -t special --obfuscate", "publish:board": "npm publish --registry https://registry.npmjs.org/" diff --git a/boards/default_src/arduino_esp32/package.json b/boards/default_src/arduino_esp32/package.json index 88f39e47..33de901e 100644 --- a/boards/default_src/arduino_esp32/package.json +++ b/boards/default_src/arduino_esp32/package.json @@ -5,7 +5,7 @@ "scripts": { "serve": "webpack-dev-server --config=webpack.dev.js", "build:dev": "webpack --config=webpack.dev.js", - "build:prod": "webpack --config=webpack.prod.js && npm run build:examples", + "build:prod": "npm run build:examples & webpack --config=webpack.prod.js", "build:examples": "node ../../../scripts/build-examples.js -t special", "build:examples:ob": "node ../../../scripts/build-examples.js -t special --obfuscate", "publish:board": "npm publish --registry https://registry.npmjs.org/" diff --git a/boards/default_src/arduino_esp8266/package.json b/boards/default_src/arduino_esp8266/package.json index 71775b95..4da0ec30 100644 --- a/boards/default_src/arduino_esp8266/package.json +++ b/boards/default_src/arduino_esp8266/package.json @@ -5,7 +5,7 @@ "scripts": { "serve": "webpack-dev-server --config=webpack.dev.js", "build:dev": "webpack --config=webpack.dev.js", - "build:prod": "webpack --config=webpack.prod.js && npm run build:examples", + "build:prod": "npm run build:examples & webpack --config=webpack.prod.js", "build:examples": "node ../../../scripts/build-examples.js -t special", "build:examples:ob": "node ../../../scripts/build-examples.js -t special --obfuscate", "publish:board": "npm publish --registry https://registry.npmjs.org/" diff --git a/boards/default_src/micropython/origin/build/lib/map.json b/boards/default_src/micropython/origin/build/lib/map.json new file mode 100644 index 00000000..5a038f77 --- /dev/null +++ b/boards/default_src/micropython/origin/build/lib/map.json @@ -0,0 +1,814 @@ +{ + "adxl345": { + "__require__": [ + "time", + "ustruct", + "micropython" + ], + "__file__": true, + "__name__": "adxl345.py" + }, + "ahtx0": { + "__require__": [ + "utime", + "micropython" + ], + "__file__": true, + "__name__": "ahtx0.py" + }, + "ap3216c": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "ap3216c.py" + }, + "apds9960": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "apds9960.py" + }, + "baidu_speech": { + "__require__": [ + "json", + "gc", + "urequests", + "array", + "ubinascii", + "machine" + ], + "__file__": true, + "__name__": "baidu_speech.py" + }, + "ble_advertising": { + "__require__": [ + "micropython", + "struct", + "bluetooth" + ], + "__file__": true, + "__name__": "ble_advertising.py" + }, + "ble_central": { + "__require__": [ + "time", + "gc", + "bluetooth", + "micropython", + "ubinascii", + "ble_advertising" + ], + "__file__": true, + "__name__": "ble_central.py" + }, + "ble_handle": { + "__require__": [ + "ble_peripheral" + ], + "__file__": true, + "__name__": "ble_handle.py" + }, + "ble_hid_keyboard": { + "__require__": [ + "bluetooth", + "struct", + "time", + "micropython", + "ubinascii", + "ble_advertising", + "bluetooth", + "ble_hid_key" + ], + "__file__": true, + "__name__": "ble_hid_keyboard.py" + }, + "ble_hid_mouse": { + "__require__": [ + "bluetooth", + "struct", + "time", + "micropython", + "ubinascii", + "ble_advertising", + "bluetooth", + "ble_hid_key" + ], + "__file__": true, + "__name__": "ble_hid_mouse.py" + }, + "ble_peripheral": { + "__require__": [ + "bluetooth", + "micropython", + "ubinascii", + "ble_advertising" + ], + "__file__": true, + "__name__": "ble_peripheral.py" + }, + "ble_uart_peripheral": { + "__require__": [ + "bluetooth", + "ble_advertising", + "micropython" + ], + "__file__": true, + "__name__": "ble_uart_peripheral.py" + }, + "ble_uart_repl": { + "__require__": [ + "io", + "os", + "machine", + "micropython", + "ble_uart_peripheral" + ], + "__file__": true, + "__name__": "ble_uart_repl.py" + }, + "blynklib": { + "__require__": [ + "usocket", + "utime", + "ustruct", + "uselect", + "micropython" + ], + "__file__": true, + "__name__": "blynklib.py" + }, + "blynktimer": { + "__require__": [ + "time", + "select", + "utime", + "uselect" + ], + "__file__": true, + "__name__": "blynktimer.py" + }, + "bmp280": { + "__require__": [ + "ustruct", + "utime" + ], + "__file__": true, + "__name__": "bmp280.py" + }, + "cbr817": { + "__require__": [ + "time", + "machine", + "micropython" + ], + "__file__": true, + "__name__": "cbr817.py" + }, + "cc_g1": { + "__require__": [ + "micropython", + "machine" + ], + "__file__": true, + "__name__": "cc_g1.py" + }, + "ch914x_at": { + "__require__": [ + "machine", + "time" + ], + "__file__": true, + "__name__": "ch914x_at.py" + }, + "ci130x": { + "__require__": [ + "time", + "struct", + "micropython" + ], + "__file__": true, + "__name__": "ci130x.py" + }, + "debugnet": { + "__require__": [ + "time", + "umqtt", + "ubinascii", + "machine", + "urequests", + "usocket", + "mixiot", + "ussl", + "ujson" + ], + "__file__": true, + "__name__": "debugnet.py" + }, + "dhtx": { + "__require__": [ + "time", + "machine", + "esp", + "machine" + ], + "__file__": true, + "__name__": "dhtx.py" + }, + "ds18b20": { + "__require__": [ + "onewire", + "machine", + "micropython" + ], + "__file__": true, + "__name__": "ds18b20.py" + }, + "expression_picture": { + "__require__": [], + "__file__": true, + "__name__": "expression_picture.py" + }, + "eye_picture": { + "__require__": [], + "__file__": true, + "__name__": "eye_picture.py" + }, + "gnss": { + "__require__": [ + "time", + "ubinascii" + ], + "__file__": true, + "__name__": "gnss.py" + }, + "hp203x": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "hp203x.py" + }, + "ht16k33": { + "__require__": [ + "uframebuf", + "micropython" + ], + "__file__": true, + "__name__": "ht16k33.py" + }, + "huskylens": { + "__require__": [ + "time", + "ubinascii" + ], + "__file__": true, + "__name__": "huskylens.py" + }, + "i2cdevice": { + "__require__": [ + "random", + "machine" + ], + "__file__": true, + "__name__": "i2cdevice.py" + }, + "i2clcd": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "i2clcd.py" + }, + "icm42670": { + "__require__": [ + "time", + "micropython", + "math" + ], + "__file__": true, + "__name__": "icm42670.py" + }, + "informatio_picture": { + "__require__": [], + "__file__": true, + "__name__": "informatio_picture.py" + }, + "irremote": { + "__require__": [ + "array", + "time", + "gc", + "esp32", + "machine" + ], + "__file__": true, + "__name__": "irremote.py" + }, + "ltr308al": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "ltr308al.py" + }, + "ltr381rgb": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "ltr381rgb.py" + }, + "ltr390uv": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "ltr390uv.py" + }, + "ltr553als": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "ltr553als.py" + }, + "matcher": { + "__require__": [], + "__file__": true, + "__name__": "matcher.py" + }, + "matrix16x8": { + "__require__": [ + "ht16k33" + ], + "__file__": true, + "__name__": "matrix16x8.py" + }, + "matrix32x12": { + "__require__": [ + "tm1680" + ], + "__file__": true, + "__name__": "matrix32x12.py" + }, + "matrix8x5": { + "__require__": [ + "tm1652" + ], + "__file__": true, + "__name__": "matrix8x5.py" + }, + "max30102": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "max30102.py" + }, + "mixgo_ai": { + "__require__": [ + "time", + "gc" + ], + "__file__": true, + "__name__": "mixgo_ai.py" + }, + "mixiot": { + "__require__": [ + "time", + "usocket", + "ustruct", + "machine", + "ubinascii", + "matcher", + "network", + "urequests", + "ussl" + ], + "__file__": true, + "__name__": "mixiot.py" + }, + "mixpy": { + "__require__": [ + "math", + "urequests", + "json" + ], + "__file__": true, + "__name__": "mixpy.py" + }, + "mmc5603": { + "__require__": [ + "time", + "math", + "micropython", + "magnetic_cal" + ], + "__file__": true, + "__name__": "mmc5603.py" + }, + "mpu9250": { + "__require__": [ + "micropython", + "ustruct", + "time", + "math", + "machine", + "math", + "matrix16x8", + "os", + "compass_cfg", + "compass_cfg" + ], + "__file__": true, + "__name__": "mpu9250.py" + }, + "ms32006": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "ms32006.py" + }, + "msa301": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "msa301.py" + }, + "music": { + "__require__": [ + "time", + "machine" + ], + "__file__": true, + "__name__": "music.py" + }, + "mxc6655xa": { + "__require__": [ + "time", + "math", + "micropython", + "math" + ], + "__file__": true, + "__name__": "mxc6655xa.py" + }, + "ns9300": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "ns9300.py" + }, + "ntptime": { + "__require__": [ + "utime", + "gc", + "machine", + "usocket", + "ustruct" + ], + "__file__": true, + "__name__": "ntptime.py" + }, + "object_picture": { + "__require__": [], + "__file__": true, + "__name__": "object_picture.py" + }, + "oled128x64": { + "__require__": [ + "ssd1106" + ], + "__file__": true, + "__name__": "oled128x64.py" + }, + "onenet": { + "__require__": [ + "ujson", + "umqtt" + ], + "__file__": true, + "__name__": "onenet.py" + }, + "pe_g1": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "pe_g1.py" + }, + "pm2_5": { + "__require__": [ + "time" + ], + "__file__": true, + "__name__": "pm2_5.py" + }, + "progres_picture": { + "__require__": [], + "__file__": true, + "__name__": "progres_picture.py" + }, + "ps2": { + "__require__": [ + "time", + "machine", + "micropython" + ], + "__file__": true, + "__name__": "ps2.py" + }, + "qmc5883l": { + "__require__": [ + "math", + "time", + "micropython" + ], + "__file__": true, + "__name__": "qmc5883l.py" + }, + "qmi8658": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "qmi8658.py" + }, + "radio": { + "__require__": [ + "ubinascii", + "network", + "esp", + "espnow" + ], + "__file__": true, + "__name__": "radio.py" + }, + "rc522": { + "__require__": [ + "machine", + "micropython" + ], + "__file__": true, + "__name__": "rc522.py" + }, + "rfm98": { + "__require__": [ + "gc", + "time", + "machine", + "micropython" + ], + "__file__": true, + "__name__": "rfm98.py" + }, + "rtctime": { + "__require__": [ + "gc", + "time", + "machine", + "usocket", + "ustruct" + ], + "__file__": true, + "__name__": "rtctime.py" + }, + "sc7a20": { + "__require__": [ + "time", + "math", + "micropython", + "math" + ], + "__file__": true, + "__name__": "sc7a20.py" + }, + "sdcard": { + "__require__": [ + "time", + "machine", + "micropython" + ], + "__file__": true, + "__name__": "sdcard.py" + }, + "seniverse_api": { + "__require__": [ + "json", + "urequests" + ], + "__file__": true, + "__name__": "seniverse_api.py" + }, + "servo": { + "__require__": [ + "machine" + ], + "__file__": true, + "__name__": "servo.py" + }, + "sht20": { + "__require__": [ + "struct", + "time" + ], + "__file__": true, + "__name__": "sht20.py" + }, + "shtc3": { + "__require__": [ + "time", + "micropython", + "struct" + ], + "__file__": true, + "__name__": "shtc3.py" + }, + "sonar": { + "__require__": [ + "time", + "machine" + ], + "__file__": true, + "__name__": "sonar.py" + }, + "spl06_001": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "spl06_001.py" + }, + "ssd1106": { + "__require__": [ + "uframebuf", + "micropython" + ], + "__file__": true, + "__name__": "ssd1106.py" + }, + "st7735": { + "__require__": [ + "time", + "uframebuf", + "machine", + "micropython" + ], + "__file__": true, + "__name__": "st7735.py" + }, + "st7789": { + "__require__": [ + "time", + "machine", + "micropython", + "uframebuf", + "ustruct" + ], + "__file__": true, + "__name__": "st7789.py" + }, + "syn6288": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "syn6288.py" + }, + "tm1650": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "tm1650.py" + }, + "tm1652": { + "__require__": [ + "time", + "uframebuf", + "machine", + "micropython" + ], + "__file__": true, + "__name__": "tm1652.py" + }, + "tm1680": { + "__require__": [ + "uframebuf", + "micropython" + ], + "__file__": true, + "__name__": "tm1680.py" + }, + "tm1931": { + "__require__": [ + "time", + "framebuf", + "machine", + "micropython" + ], + "__file__": true, + "__name__": "tm1931.py" + }, + "uart_com": { + "__require__": [], + "__file__": true, + "__name__": "uart_com.py" + }, + "ucs12071": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "ucs12071.py" + }, + "uframebuf": { + "__require__": [ + "esp", + "time", + "gc", + "framebuf" + ], + "__file__": true, + "__name__": "uframebuf.py" + }, + "umqtt": { + "__require__": [ + "usocket", + "ustruct", + "ussl" + ], + "__file__": true, + "__name__": "umqtt.py" + }, + "urequests": { + "__require__": [ + "usocket", + "ujson", + "ssl", + "ujson" + ], + "__file__": true, + "__name__": "urequests.py" + }, + "vl53l0x": { + "__require__": [ + "micropython", + "ustruct", + "utime" + ], + "__file__": true, + "__name__": "vl53l0x.py" + }, + "ws2812": { + "__require__": [ + "time", + "machine" + ], + "__file__": true, + "__name__": "ws2812.py" + }, + "ws_lora": { + "__require__": [ + "json", + "rfm98", + "ubinascii", + "machine", + "hp203x" + ], + "__file__": true, + "__name__": "ws_lora.py" + }, + "ws_solo": { + "__require__": [ + "time", + "math", + "machine" + ], + "__file__": true, + "__name__": "ws_solo.py" + } +} \ No newline at end of file diff --git a/boards/default_src/micropython/package.json b/boards/default_src/micropython/package.json index c41eb2e2..8efe95f6 100644 --- a/boards/default_src/micropython/package.json +++ b/boards/default_src/micropython/package.json @@ -4,9 +4,10 @@ "description": "适用于mixly的micropython模块", "scripts": { "build:dev": "webpack --config=webpack.dev.js", - "build:prod": "webpack --config=webpack.prod.js && npm run build:examples", + "build:prod": "npm run build:examples & npm run build:libraries & webpack --config=webpack.prod.js", "build:examples": "node ../../../scripts/build-examples.js -t special", "build:examples:ob": "node ../../../scripts/build-examples.js -t special --obfuscate", + "build:libraries": "python ../../../scripts/build-libraries.py ./origin/build/lib", "publish:board": "npm publish --registry https://registry.npmjs.org/" }, "main": "./export.js", diff --git a/boards/default_src/micropython_esp32/origin/build/lib/map.json b/boards/default_src/micropython_esp32/origin/build/lib/map.json new file mode 100644 index 00000000..ba6cb605 --- /dev/null +++ b/boards/default_src/micropython_esp32/origin/build/lib/map.json @@ -0,0 +1,40 @@ +{ + "mixgo": { + "__require__": [ + "time", + "gc", + "machine", + "ws2812", + "music", + "mpu9250", + "matrix16x8" + ], + "__file__": true, + "__name__": "mixgo.py" + }, + "mixgo_pe": { + "__require__": [ + "time", + "gc", + "machine", + "matrix8x5", + "machine" + ], + "__file__": true, + "__name__": "mixgo_pe.py" + }, + "mpython": { + "__require__": [ + "time", + "gc", + "machine", + "ws2812", + "music", + "oled128x64", + "mmc5603", + "qmi8658" + ], + "__file__": true, + "__name__": "mpython.py" + } +} \ No newline at end of file diff --git a/boards/default_src/micropython_esp32/package.json b/boards/default_src/micropython_esp32/package.json index 990f73fa..ee57a6f3 100644 --- a/boards/default_src/micropython_esp32/package.json +++ b/boards/default_src/micropython_esp32/package.json @@ -5,9 +5,10 @@ "scripts": { "serve": "webpack-dev-server --config=webpack.dev.js", "build:dev": "webpack --config=webpack.dev.js", - "build:prod": "webpack --config=webpack.prod.js && npm run build:examples", + "build:prod": "npm run build:examples & npm run build:libraries & webpack --config=webpack.prod.js", "build:examples": "node ../../../scripts/build-examples.js -t special", "build:examples:ob": "node ../../../scripts/build-examples.js -t special --obfuscate", + "build:libraries": "python ../../../scripts/build-libraries.py ./origin/build/lib", "publish:board": "npm publish --registry https://registry.npmjs.org/" }, "main": "./export.js", diff --git a/boards/default_src/micropython_esp32c2/origin/build/lib/map.json b/boards/default_src/micropython_esp32c2/origin/build/lib/map.json new file mode 100644 index 00000000..fff3376b --- /dev/null +++ b/boards/default_src/micropython_esp32c2/origin/build/lib/map.json @@ -0,0 +1,75 @@ +{ + "ble_central": { + "__require__": [ + "time", + "gc", + "bluetooth", + "micropython", + "ubinascii", + "ble_advertising" + ], + "__file__": true, + "__name__": "ble_central.py" + }, + "mini_bot": { + "__require__": [ + "time", + "math", + "esp", + "micropython", + "framebuf" + ], + "__file__": true, + "__name__": "mini_bot.py" + }, + "mini_g2": { + "__require__": [ + "gc", + "machine", + "rc522" + ], + "__file__": true, + "__name__": "mini_g2.py" + }, + "mini_go": { + "__require__": [ + "time", + "gc", + "math", + "tm1931", + "machine" + ], + "__file__": true, + "__name__": "mini_go.py" + }, + "mixgo_mini": { + "__require__": [ + "time", + "gc", + "esp32", + "machine", + "ws2812x", + "musicx", + "sc7a20", + "ap3216c", + "mini_bot" + ], + "__file__": true, + "__name__": "mixgo_mini.py" + }, + "musicx": { + "__require__": [ + "time" + ], + "__file__": true, + "__name__": "musicx.py" + }, + "ws2812x": { + "__require__": [ + "time", + "machine" + ], + "__file__": true, + "__name__": "ws2812x.py" + } +} \ No newline at end of file diff --git a/boards/default_src/micropython_esp32c2/package.json b/boards/default_src/micropython_esp32c2/package.json index 93ca6555..77f896f7 100644 --- a/boards/default_src/micropython_esp32c2/package.json +++ b/boards/default_src/micropython_esp32c2/package.json @@ -5,9 +5,10 @@ "scripts": { "serve": "webpack-dev-server --config=webpack.dev.js", "build:dev": "webpack --config=webpack.dev.js", - "build:prod": "webpack --config=webpack.prod.js && npm run build:examples", + "build:prod": "npm run build:examples & npm run build:libraries & webpack --config=webpack.prod.js", "build:examples": "node ../../../scripts/build-examples.js -t special", "build:examples:ob": "node ../../../scripts/build-examples.js -t special --obfuscate", + "build:libraries": "python ../../../scripts/build-libraries.py ./origin/build/lib", "publish:board": "npm publish --registry https://registry.npmjs.org/" }, "main": "./export.js", diff --git a/boards/default_src/micropython_esp32c3/origin/build/lib/map.json b/boards/default_src/micropython_esp32c3/origin/build/lib/map.json new file mode 100644 index 00000000..d49b6ed2 --- /dev/null +++ b/boards/default_src/micropython_esp32c3/origin/build/lib/map.json @@ -0,0 +1,72 @@ +{ + "me_g1": { + "__require__": [ + "time", + "gc", + "machine", + "hp203x", + "ahtx0", + "rc522" + ], + "__file__": true, + "__name__": "me_g1.py" + }, + "me_go": { + "__require__": [ + "time", + "gc", + "math", + "tm1931", + "machine" + ], + "__file__": true, + "__name__": "me_go.py" + }, + "mixgocar_c3": { + "__require__": [ + "time", + "gc", + "ms32006", + "machine", + "ws2812", + "music" + ], + "__file__": true, + "__name__": "mixgocar_c3.py" + }, + "mixgo_cc": { + "__require__": [ + "time", + "gc", + "machine", + "ws2812", + "music", + "mxc6655xa", + "ltr553als", + "rc522", + "matrix32x12", + "mmc5603", + "hp203x", + "spl06_001", + "ahtx0", + "shtc3" + ], + "__file__": true, + "__name__": "mixgo_cc.py" + }, + "mixgo_me": { + "__require__": [ + "time", + "gc", + "machine", + "ws2812", + "music", + "mxc6655xa", + "ltr553als", + "matrix8x5", + "mmc5603" + ], + "__file__": true, + "__name__": "mixgo_me.py" + } +} \ No newline at end of file diff --git a/boards/default_src/micropython_esp32c3/package.json b/boards/default_src/micropython_esp32c3/package.json index 8bed96f0..89d6870a 100644 --- a/boards/default_src/micropython_esp32c3/package.json +++ b/boards/default_src/micropython_esp32c3/package.json @@ -5,9 +5,10 @@ "scripts": { "serve": "webpack-dev-server --config=webpack.dev.js", "build:dev": "webpack --config=webpack.dev.js", - "build:prod": "webpack --config=webpack.prod.js && npm run build:examples", + "build:prod": "npm run build:examples & npm run build:libraries & webpack --config=webpack.prod.js", "build:examples": "node ../../../scripts/build-examples.js -t special", "build:examples:ob": "node ../../../scripts/build-examples.js -t special --obfuscate", + "build:libraries": "python ../../../scripts/build-libraries.py ./origin/build/lib", "publish:board": "npm publish --registry https://registry.npmjs.org/" }, "main": "./export.js", diff --git a/boards/default_src/micropython_esp32s2/origin/build/lib/map.json b/boards/default_src/micropython_esp32s2/origin/build/lib/map.json new file mode 100644 index 00000000..0fdccf19 --- /dev/null +++ b/boards/default_src/micropython_esp32s2/origin/build/lib/map.json @@ -0,0 +1,28 @@ +{ + "ce_go": { + "__require__": [ + "time", + "gc", + "math", + "tm1931", + "machine" + ], + "__file__": true, + "__name__": "ce_go.py" + }, + "mixgo_ce": { + "__require__": [ + "time", + "gc", + "machine", + "ws2812", + "music", + "matrix16x8", + "msa301", + "mxc6655xa", + "machine" + ], + "__file__": true, + "__name__": "mixgo_ce.py" + } +} \ No newline at end of file diff --git a/boards/default_src/micropython_esp32s2/package.json b/boards/default_src/micropython_esp32s2/package.json index 43f4a8d2..cc818a03 100644 --- a/boards/default_src/micropython_esp32s2/package.json +++ b/boards/default_src/micropython_esp32s2/package.json @@ -5,9 +5,10 @@ "scripts": { "serve": "webpack-dev-server --config=webpack.dev.js", "build:dev": "webpack --config=webpack.dev.js", - "build:prod": "webpack --config=webpack.prod.js && npm run build:examples", + "build:prod": "npm run build:examples & npm run build:libraries & webpack --config=webpack.prod.js", "build:examples": "node ../../../scripts/build-examples.js -t special", "build:examples:ob": "node ../../../scripts/build-examples.js -t special --obfuscate", + "build:libraries": "python ../../../scripts/build-libraries.py ./origin/build/lib", "publish:board": "npm publish --registry https://registry.npmjs.org/" }, "main": "./export.js", diff --git a/boards/default_src/micropython_esp32s3/origin/build/lib/map.json b/boards/default_src/micropython_esp32s3/origin/build/lib/map.json new file mode 100644 index 00000000..3455ab17 --- /dev/null +++ b/boards/default_src/micropython_esp32s3/origin/build/lib/map.json @@ -0,0 +1,116 @@ +{ + "es8374": { + "__require__": [ + "time", + "micropython" + ], + "__file__": true, + "__name__": "es8374.py" + }, + "mixgo_nova": { + "__require__": [ + "machine", + "time", + "gc", + "st7735", + "math", + "ws2812", + "_boot", + "mxc6655xa", + "ltr553als", + "ltr553als", + "rc522", + "mmc5603", + "hp203x", + "ahtx0", + "shtc3", + "machine" + ], + "__file__": true, + "__name__": "mixgo_nova.py" + }, + "mixgo_nova_voice": { + "__require__": [ + "ustruct", + "time", + "music_spk", + "es8374", + "machine", + "mixgo_nova", + "urequests" + ], + "__file__": true, + "__name__": "mixgo_nova_voice.py" + }, + "mixgo_zero": { + "__require__": [ + "machine", + "time", + "gc", + "st7789_bf", + "math", + "ws2812", + "_boot", + "mxc6655xa", + "ltr553als", + "ltr553als", + "shtc3", + "rc522", + "mmc5603", + "spl06_001", + "machine" + ], + "__file__": true, + "__name__": "mixgo_zero.py" + }, + "mixgo_zero_voice": { + "__require__": [ + "ustruct", + "time", + "music_spk", + "es8374", + "machine", + "mixgo_zero", + "urequests" + ], + "__file__": true, + "__name__": "mixgo_zero_voice.py" + }, + "music_spk": { + "__require__": [ + "time", + "math", + "array", + "struct" + ], + "__file__": true, + "__name__": "music_spk.py" + }, + "nova_g1": { + "__require__": [ + "micropython", + "mixgo_nova" + ], + "__file__": true, + "__name__": "nova_g1.py" + }, + "sdcard": { + "__require__": [ + "time", + "machine", + "micropython" + ], + "__file__": true, + "__name__": "sdcard.py" + }, + "st7789_bf": { + "__require__": [ + "time", + "uframebuf", + "machine", + "micropython" + ], + "__file__": true, + "__name__": "st7789_bf.py" + } +} \ No newline at end of file diff --git a/boards/default_src/micropython_esp32s3/package.json b/boards/default_src/micropython_esp32s3/package.json index 6aeb11b6..d6be204e 100644 --- a/boards/default_src/micropython_esp32s3/package.json +++ b/boards/default_src/micropython_esp32s3/package.json @@ -5,9 +5,10 @@ "scripts": { "serve": "webpack-dev-server --config=webpack.dev.js", "build:dev": "webpack --config=webpack.dev.js", - "build:prod": "webpack --config=webpack.prod.js && npm run build:examples", + "build:prod": "npm run build:examples & npm run build:libraries & webpack --config=webpack.prod.js", "build:examples": "node ../../../scripts/build-examples.js -t special", "build:examples:ob": "node ../../../scripts/build-examples.js -t special --obfuscate", + "build:libraries": "python ../../../scripts/build-libraries.py ./origin/build/lib", "publish:board": "npm publish --registry https://registry.npmjs.org/" }, "main": "./export.js", diff --git a/boards/default_src/micropython_k210_mixgoai/package.json b/boards/default_src/micropython_k210_mixgoai/package.json index 8d22de5d..a5034b56 100644 --- a/boards/default_src/micropython_k210_mixgoai/package.json +++ b/boards/default_src/micropython_k210_mixgoai/package.json @@ -5,9 +5,10 @@ "scripts": { "serve": "webpack-dev-server --config=webpack.dev.js", "build:dev": "webpack --config=webpack.dev.js", - "build:prod": "webpack --config=webpack.prod.js && npm run build:examples", + "build:prod": "npm run build:examples & npm run build:libraries & webpack --config=webpack.prod.js", "build:examples": "node ../../../scripts/build-examples.js -t special", "build:examples:ob": "node ../../../scripts/build-examples.js -t special --obfuscate", + "build:libraries": "python ../../../scripts/build-libraries.py ./origin/build/lib", "publish:board": "npm publish --registry https://registry.npmjs.org/" }, "main": "./export.js", diff --git a/boards/default_src/micropython_nrf51822_microbit/origin/build/lib/map.json b/boards/default_src/micropython_nrf51822_microbit/origin/build/lib/map.json new file mode 100644 index 00000000..92d29c90 --- /dev/null +++ b/boards/default_src/micropython_nrf51822_microbit/origin/build/lib/map.json @@ -0,0 +1,80 @@ +{ + "lcd1602": { + "__require__": [ + "microbit" + ], + "__file__": true, + "__name__": "lcd1602.py" + }, + "mixpy": { + "__require__": [ + "math" + ], + "__file__": true, + "__name__": "mixpy.py" + }, + "motor_control": { + "__require__": [ + "microbit" + ], + "__file__": true, + "__name__": "motor_control.py" + }, + "MP3": { + "__require__": [ + "microbit" + ], + "__file__": true, + "__name__": "MP3.py" + }, + "ntc": { + "__require__": [ + "microbit", + "math" + ], + "__file__": true, + "__name__": "ntc.py" + }, + "oled": { + "__require__": [ + "microbit" + ], + "__file__": true, + "__name__": "oled.py" + }, + "rgb": { + "__require__": [ + "microbit" + ], + "__file__": true, + "__name__": "rgb.py" + }, + "RTC": { + "__require__": [ + "microbit" + ], + "__file__": true, + "__name__": "RTC.py" + }, + "Servo": { + "__require__": [ + "microbit" + ], + "__file__": true, + "__name__": "Servo.py" + }, + "TCS": { + "__require__": [ + "microbit" + ], + "__file__": true, + "__name__": "TCS.py" + }, + "ultrasonic": { + "__require__": [ + "microbit" + ], + "__file__": true, + "__name__": "ultrasonic.py" + } +} \ No newline at end of file diff --git a/boards/default_src/micropython_nrf51822_microbit/package.json b/boards/default_src/micropython_nrf51822_microbit/package.json index ab9200cc..60c6dd9c 100644 --- a/boards/default_src/micropython_nrf51822_microbit/package.json +++ b/boards/default_src/micropython_nrf51822_microbit/package.json @@ -5,9 +5,10 @@ "scripts": { "serve": "webpack-dev-server --config=webpack.dev.js", "build:dev": "webpack --config=webpack.dev.js", - "build:prod": "webpack --config=webpack.prod.js && npm run build:examples", + "build:prod": "npm run build:examples & npm run build:libraries & webpack --config=webpack.prod.js", "build:examples": "node ../../../scripts/build-examples.js -t special", "build:examples:ob": "node ../../../scripts/build-examples.js -t special --obfuscate", + "build:libraries": "python ../../../scripts/build-libraries.py ./origin/build/lib", "publish:board": "npm publish --registry https://registry.npmjs.org/" }, "main": "./export.js", diff --git a/boards/default_src/micropython_nrf51822_mithoncc/origin/build/lib/map.json b/boards/default_src/micropython_nrf51822_mithoncc/origin/build/lib/map.json new file mode 100644 index 00000000..ab9bc0b4 --- /dev/null +++ b/boards/default_src/micropython_nrf51822_mithoncc/origin/build/lib/map.json @@ -0,0 +1,24 @@ +{ + "mixpy": { + "__require__": [ + "math" + ], + "__file__": true, + "__name__": "mixpy.py" + }, + "motor_control": { + "__require__": [ + "microbit" + ], + "__file__": true, + "__name__": "motor_control.py" + }, + "rgb_show": { + "__require__": [ + "microbit", + "neopixel" + ], + "__file__": true, + "__name__": "rgb_show.py" + } +} \ No newline at end of file diff --git a/boards/default_src/micropython_nrf51822_mithoncc/package.json b/boards/default_src/micropython_nrf51822_mithoncc/package.json index 75b8bc77..5df9f922 100644 --- a/boards/default_src/micropython_nrf51822_mithoncc/package.json +++ b/boards/default_src/micropython_nrf51822_mithoncc/package.json @@ -5,9 +5,10 @@ "scripts": { "serve": "webpack-dev-server --config=webpack.dev.js", "build:dev": "webpack --config=webpack.dev.js", - "build:prod": "webpack --config=webpack.prod.js && npm run build:examples", + "build:prod": "npm run build:examples & npm run build:libraries & webpack --config=webpack.prod.js", "build:examples": "node ../../../scripts/build-examples.js -t special", "build:examples:ob": "node ../../../scripts/build-examples.js -t special --obfuscate", + "build:libraries": "python ../../../scripts/build-libraries.py ./origin/build/lib", "publish:board": "npm publish --registry https://registry.npmjs.org/" }, "main": "./export.js", diff --git a/boards/default_src/micropython_robot/origin/build/lib/map.json b/boards/default_src/micropython_robot/origin/build/lib/map.json new file mode 100644 index 00000000..1ea531cf --- /dev/null +++ b/boards/default_src/micropython_robot/origin/build/lib/map.json @@ -0,0 +1,59 @@ +{ + "bot51": { + "__require__": [ + "uframebuf", + "micropython" + ], + "__file__": true, + "__name__": "bot51.py" + }, + "feiyi": { + "__require__": [ + "time", + "gc", + "machine", + "ws2812", + "music", + "mxc6655xa", + "ltr553als", + "rc522", + "bot51", + "mmc5603" + ], + "__file__": true, + "__name__": "feiyi.py" + }, + "mixbot": { + "__require__": [ + "time", + "gc", + "random", + "uframebuf", + "micropython", + "machine", + "ws2812", + "music", + "icm42670" + ], + "__file__": true, + "__name__": "mixbot.py" + }, + "mixbot_ext": { + "__require__": [ + "i2cdevice", + "mixbot" + ], + "__file__": true, + "__name__": "mixbot_ext.py" + }, + "rm_e1": { + "__require__": [ + "time", + "gc", + "machine", + "ws2812" + ], + "__file__": true, + "__name__": "rm_e1.py" + } +} \ No newline at end of file diff --git a/boards/default_src/micropython_robot/package.json b/boards/default_src/micropython_robot/package.json index 413ff2b3..c09c5325 100644 --- a/boards/default_src/micropython_robot/package.json +++ b/boards/default_src/micropython_robot/package.json @@ -5,9 +5,10 @@ "scripts": { "serve": "webpack-dev-server --config=webpack.dev.js", "build:dev": "webpack --config=webpack.dev.js", - "build:prod": "webpack --config=webpack.prod.js && npm run build:examples", + "build:prod": "npm run build:examples & npm run build:libraries & webpack --config=webpack.prod.js", "build:examples": "node ../../../scripts/build-examples.js -t special", "build:examples:ob": "node ../../../scripts/build-examples.js -t special --obfuscate", + "build:libraries": "python ../../../scripts/build-libraries.py ./origin/build/lib", "publish:board": "npm publish --registry https://registry.npmjs.org/" }, "main": "./export.js", diff --git a/boards/default_src/python/package.json b/boards/default_src/python/package.json index 73695bed..8c8d0418 100644 --- a/boards/default_src/python/package.json +++ b/boards/default_src/python/package.json @@ -4,7 +4,7 @@ "description": "适用于mixly的python模块", "scripts": { "build:dev": "webpack --config=webpack.dev.js", - "build:prod": "webpack --config=webpack.prod.js && npm run build:examples", + "build:prod": "npm run build:examples & webpack --config=webpack.prod.js", "build:examples": "node ../../../scripts/build-examples.js -t special", "build:examples:ob": "node ../../../scripts/build-examples.js -t special --obfuscate", "publish:board": "npm publish --registry https://registry.npmjs.org/" diff --git a/boards/default_src/python_mixpy/package.json b/boards/default_src/python_mixpy/package.json index fa242313..201a75b0 100644 --- a/boards/default_src/python_mixpy/package.json +++ b/boards/default_src/python_mixpy/package.json @@ -5,7 +5,7 @@ "scripts": { "serve": "webpack-dev-server --config=webpack.dev.js", "build:dev": "webpack --config=webpack.dev.js", - "build:prod": "webpack --config=webpack.prod.js && npm run build:examples", + "build:prod": "npm run build:examples & webpack --config=webpack.prod.js", "build:examples": "node ../../../scripts/build-examples.js -t special", "build:examples:ob": "node ../../../scripts/build-examples.js -t special --obfuscate", "publish:board": "npm publish --registry https://registry.npmjs.org/" diff --git a/boards/default_src/python_pyodide/package.json b/boards/default_src/python_pyodide/package.json index 632ba302..f1bd0e21 100644 --- a/boards/default_src/python_pyodide/package.json +++ b/boards/default_src/python_pyodide/package.json @@ -5,7 +5,7 @@ "scripts": { "serve": "webpack-dev-server --config=webpack.dev.js", "build:dev": "webpack --config=webpack.dev.js", - "build:prod": "webpack --config=webpack.prod.js && npm run build:examples", + "build:prod": "npm run build:examples & webpack --config=webpack.prod.js", "build:examples": "node ../../../scripts/build-examples.js -t special", "build:examples:ob": "node ../../../scripts/build-examples.js -t special --obfuscate", "build:examples:": "node ../../../scripts/build-examples.js -t special", diff --git a/boards/default_src/python_skulpt/package.json b/boards/default_src/python_skulpt/package.json index 063a77d4..adf04d7b 100644 --- a/boards/default_src/python_skulpt/package.json +++ b/boards/default_src/python_skulpt/package.json @@ -5,7 +5,7 @@ "scripts": { "serve": "webpack-dev-server --config=webpack.dev.js", "build:dev": "webpack --config=webpack.dev.js", - "build:prod": "webpack --config=webpack.prod.js && npm run build:examples", + "build:prod": "npm run build:examples & webpack --config=webpack.prod.js", "build:examples": "node ../../../scripts/build-examples.js -t special", "build:examples:ob": "node ../../../scripts/build-examples.js -t special --obfuscate", "publish:board": "npm publish --registry https://registry.npmjs.org/" diff --git a/boards/default_src/python_skulpt_car/package.json b/boards/default_src/python_skulpt_car/package.json index 3fa9bc54..1b913dc9 100644 --- a/boards/default_src/python_skulpt_car/package.json +++ b/boards/default_src/python_skulpt_car/package.json @@ -5,7 +5,7 @@ "scripts": { "serve": "webpack-dev-server --config=webpack.dev.js", "build:dev": "webpack --config=webpack.dev.js", - "build:prod": "webpack --config=webpack.prod.js && npm run build:examples", + "build:prod": "npm run build:examples & webpack --config=webpack.prod.js", "build:examples": "node ../../../scripts/build-examples.js -t special", "build:examples:ob": "node ../../../scripts/build-examples.js -t special --obfuscate", "publish:board": "npm publish --registry https://registry.npmjs.org/" diff --git a/boards/default_src/python_skulpt_mixtoy/package.json b/boards/default_src/python_skulpt_mixtoy/package.json index 5821c7e1..ae3b62bb 100644 --- a/boards/default_src/python_skulpt_mixtoy/package.json +++ b/boards/default_src/python_skulpt_mixtoy/package.json @@ -5,7 +5,7 @@ "scripts": { "serve": "webpack-dev-server --config=webpack.dev.js", "build:dev": "webpack --config=webpack.dev.js", - "build:prod": "webpack --config=webpack.prod.js && npm run build:examples", + "build:prod": "npm run build:examples & webpack --config=webpack.prod.js", "build:examples": "node ../../../scripts/build-examples.js -t special", "build:examples:ob": "node ../../../scripts/build-examples.js -t special --obfuscate", "publish:board": "npm publish --registry https://registry.npmjs.org/" diff --git a/package.json b/package.json index e2e46b5f..ff6a6491 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,6 @@ "publish:boards:arduino": "node scripts/publish-boards.js --type arduino", "publish:boards:micropython": "node scripts/publish-boards.js --type micropython", "publish:boards:python": "node scripts/publish-boards.js --type python", - "build:examples": "node scripts/build-examples.js -t all", "build:examples:ob": "node scripts/build-examples.js -t all --obfuscate", "boards:lint": "eslint ./boards/default_src/ --ext .js --format stylish" }, diff --git a/scripts/build-examples.js b/scripts/build-examples.js index 5aca1428..02b2d9a1 100644 --- a/scripts/build-examples.js +++ b/scripts/build-examples.js @@ -100,26 +100,29 @@ if (fs_plus.isDirectorySync(DEFAULT_SRC_DIR)) { } } -const DEFAULT_DIR = path.resolve(ORIGIN_DIR, 'boards/default'); -if (fs_plus.isDirectorySync(DEFAULT_DIR)) { - const names = fs.readdirSync(DEFAULT_DIR); - for (let name of names) { - if (!['all', name].includes(options.type)) { - continue; +if (!!options.obfuscate) { + const DEFAULT_DIR = path.resolve(ORIGIN_DIR, 'boards/default'); + + if (fs_plus.isDirectorySync(DEFAULT_DIR)) { + const names = fs.readdirSync(DEFAULT_DIR); + for (let name of names) { + if (!['all', name].includes(options.type)) { + continue; + } + const now = path.resolve(DEFAULT_DIR, name); + if (!fs_plus.isDirectorySync(now)) { + continue; + } + const examplesPath = path.resolve(now, 'examples'); + if (!fs_plus.isDirectorySync(examplesPath)) { + continue; + } + let outputPath = path.resolve(examplesPath, 'map.json'); + let output = getExamples(examplesPath, !!options.obfuscate); + fs_extra.outputJsonSync(outputPath, output, { + spaces: ' ' + }); } - const now = path.resolve(DEFAULT_DIR, name); - if (!fs_plus.isDirectorySync(now)) { - continue; - } - const examplesPath = path.resolve(now, 'examples'); - if (!fs_plus.isDirectorySync(examplesPath)) { - continue; - } - let outputPath = path.resolve(examplesPath, 'map.json'); - let output = getExamples(examplesPath, !!options.obfuscate); - fs_extra.outputJsonSync(outputPath, output, { - spaces: ' ' - }); } } \ No newline at end of file diff --git a/scripts/build-libraries.py b/scripts/build-libraries.py new file mode 100644 index 00000000..0d933172 --- /dev/null +++ b/scripts/build-libraries.py @@ -0,0 +1,49 @@ +import ast +import sys +import json +import os +from os import path + + +def extract_imports(file_path): + with open(file_path, "r", encoding="utf-8") as file: + tree = ast.parse(file.read(), filename=file_path) + + imports = [] + + for node in ast.walk(tree): + if isinstance(node, ast.Import): + for alias in node.names: + imports.append(alias.name) + elif isinstance(node, ast.ImportFrom): + imports.append(node.module) + + return imports + + +if __name__ == "__main__": + working_path = os.getcwd() + target_path = sys.argv[1] + if not path.isabs(target_path): + target_path = path.abspath(path.join(working_path, target_path)) + output = None + if path.isfile(target_path): + exit(0) + output = {} + content = os.listdir(target_path) + for i in content: + if i == "map.json": + continue + name = i[: i.find(".")] + output[name] = {} + extname = i[i.find(".") :] + file_path = path.join(target_path, i) + if path.isfile(file_path) and extname == ".py": + output[name]["__require__"] = extract_imports(file_path) + output[name]["__file__"] = True + else: + output[name]["__file__"] = False + output[name]["__name__"] = i + fw = open(path.join(target_path, "map.json"), "w", encoding="utf-8") + json.dump(output, fw, indent=4, ensure_ascii=False) + fw.close()