Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/deploy-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy website to GitHub Pages

on:
push:
branches:
- main
paths:
- 'website/**'
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
cache-dependency-path: website/package-lock.json

- name: Install dependencies
working-directory: ./website
run: npm ci

- name: Build website
working-directory: ./website
run: npm run build

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './website/build'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@

**BlueScript** is a small and efficient programming language designed specifically for microcontrollers.
While it currently supports only the ESP32 board, future updates will include support for a wider range of boards.
You can find the official website at https://csg-tokyo.github.io/bluescript/.

WARNING: this project is in beta stage and is subject to changes of the code-base, including project-wide name changes and API changes.

# Documentation
- [Get started](https://github.com/csg-tokyo/bluescript/wiki)
- [Reference Manual](https://github.com/csg-tokyo/bluescript/wiki/Reference)
- [Get started](https://csg-tokyo.github.io/bluescript/docs/tutorial/get-started)
- [Reference Manual](https://csg-tokyo.github.io/bluescript/docs/reference/language/intro)

- Fumika Mochizuki, Tetsuro Yamazaki, Shigeru Chiba, ["Interactive Programming for Microcontrollers by Offloading Dynamic Incremental Compilation"](https://dl.acm.org/doi/10.1145/3679007.3685062), MPLR 2024, pp. 28-40, ACM, 2024.

Expand Down
7 changes: 0 additions & 7 deletions modules/gpio/CMakeLists.txt

This file was deleted.

10 changes: 10 additions & 0 deletions modules/gpio/bsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

{
"name": "gpio",
"device": {
"kind": "esp32",
"name": "BLUESCRIPT"
},
"espIdfComponents": ["esp_driver_gpio"]
}

16 changes: 0 additions & 16 deletions modules/gpio/gpio.bs

This file was deleted.

53 changes: 0 additions & 53 deletions modules/gpio/gpio.c

This file was deleted.

17 changes: 0 additions & 17 deletions modules/gpio/gpio.h

This file was deleted.

22 changes: 22 additions & 0 deletions modules/gpio/index.bs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@


code`#include "driver/gpio.h"`

export class GPIO {
pin:integer

constructor(pin:integer) {
this.pin = pin;
code`gpio_set_direction(${pin}, GPIO_MODE_OUTPUT);`
}

on() {
const pin = this.pin;
code`gpio_set_level(${pin}, 1);`;
}

off() {
const pin = this.pin;
code`gpio_set_level(${pin}, 0);`;
}
}
5 changes: 3 additions & 2 deletions server/src/cli/install.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { logger, executeCommand } from "./utils";
import { logger, executeCommand, readBsConfig } from "./utils";
import * as fs from 'fs';
import { GLOBAL_PATH, PACKAGE_PATH } from "./path";

export default function installPackage(packageName: string) {
logger.info(`Installing ${packageName}...`);
try {
fs.mkdirSync(PACKAGE_PATH.LOCAL_PACKAGES_DIR('./'), {recursive: true});
const srcDir = PACKAGE_PATH.SUB_PACKAGE_DIR(GLOBAL_PATH.PACKAGES_DIR(), packageName);
const bsconfig = readBsConfig(PACKAGE_PATH.BSCONFIG_FILE('./'));
const srcDir = PACKAGE_PATH.SUB_PACKAGE_DIR(bsconfig.dirs?.packages ?? GLOBAL_PATH.PACKAGES_DIR(), packageName);
if (!fs.existsSync(srcDir)) {
throw new Error(`Cannot find ${packageName}`);
}
Expand Down
20 changes: 20 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
16 changes: 16 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Website

This website is built using [Docusaurus](https://docusaurus.io/).

## Build
```
npm start
```

## Add Documents
1. Add a markdown file to `./docs/`.
See https://docusaurus.io/docs/markdown-features for how to write Markdown specifically for Docusaurus.
2. Change `./sidebars.ts`.

## Deployment
Changes on this directory is automatically deployed to https://csg-tokyo.github.io/bluescript/ by `.github/workflows/deploy-website.yml`.
3 changes: 3 additions & 0 deletions website/docs/reference/cli/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Install

In preparation
Loading