Skip to content

Commit 767d5a0

Browse files
committed
Initial commit
1 parent bb7c0b2 commit 767d5a0

File tree

135 files changed

+49190
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+49190
-1
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/pages/ArduinoEditor.js

+15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/pages/ArduinoSimulator.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/pages/ArduinoSimulator.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "Arduino Simulator",
3+
"short_name": "Arduino Simulator",
4+
"lang": "en-US",
5+
"start_url": "https://lrusso.github.io/ArduinoSimulator/index.html",
6+
"display": "standalone",
7+
"orientation": "portrait",
8+
"theme_color": "#F2F2F2",
9+
"background_color": "#000000",
10+
"icons": [
11+
{
12+
"src": "https://lrusso.github.io/ArduinoSimulator/ArduinoSimulatorFavIcon_192x192.png",
13+
"sizes": "192x192",
14+
"type": "image/png"
15+
},
16+
{
17+
"src": "https://lrusso.github.io/ArduinoSimulator/ArduinoSimulatorFavIcon_512x512.png",
18+
"sizes": "512x512",
19+
"type": "image/png"
20+
}
21+
]
22+
}

.github/pages/ArduinoSimulator.svg

+167
Loading
610 Bytes
Loading
Loading
Loading

.github/pages/ArduinoSimulatorInterpreter.js

+2,011
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/pages/ArduinoSimulatorInterpreter.min.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
8.36 KB
Loading

.github/pages/demo1.html

+88
Large diffs are not rendered by default.

.github/pages/demo2.html

+88
Large diffs are not rendered by default.

.github/pages/demo3.html

+88
Large diffs are not rendered by default.

.github/pages/index.html

+85
Large diffs are not rendered by default.

.github/pages/worker.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const filesToCache = [
2+
"ArduinoEditor.js",
3+
"ArduinoSimulator.json",
4+
"ArduinoSimulator.svg",
5+
"ArduinoSimulatorFavIcon_192x192.png",
6+
"ArduinoSimulatorFavIcon_512x512.png",
7+
"ArduinoSimulatorInterpreter.min.js",
8+
"index.html",
9+
]
10+
11+
const staticCacheName = "ArduinoSimulator-v1"
12+
13+
// eslint-disable-next-line no-restricted-globals
14+
self.addEventListener("install", (event) => {
15+
event.waitUntil(
16+
caches.open(staticCacheName).then((cache) => {
17+
return cache.addAll(filesToCache)
18+
})
19+
)
20+
})
21+
22+
// eslint-disable-next-line no-restricted-globals
23+
self.addEventListener("fetch", (event) => {
24+
event.respondWith(
25+
caches
26+
.match(event.request)
27+
.then((response) => {
28+
if (response) {
29+
return response
30+
}
31+
return fetch(event.request)
32+
})
33+
.catch(() => {})
34+
)
35+
})

.github/workflows/cd.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "Continuous Deployment"
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- .github/pages/**
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
concurrency:
16+
group: "continuous-deployment"
17+
cancel-in-progress: true
18+
19+
jobs:
20+
continuous-deployment:
21+
runs-on: ubuntu-latest
22+
environment:
23+
name: github-pages
24+
url: ${{ steps.deployment.outputs.page_url }}
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
with:
29+
ref: ${{ github.ref }}
30+
- name: Setup Pages
31+
uses: actions/configure-pages@v2
32+
- name: Build with Jekyll
33+
uses: actions/jekyll-build-pages@v1
34+
with:
35+
source: ./.github/pages
36+
destination: ./_site
37+
- name: Upload artifact
38+
uses: actions/upload-pages-artifact@v1
39+
- name: Deploy to GitHub Pages
40+
id: deployment
41+
uses: actions/deploy-pages@v1

.github/workflows/ci.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: "Continuous Integration"
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths-ignore:
8+
- README.md
9+
- .github/pages/**
10+
11+
concurrency:
12+
group: "continuous-integration"
13+
cancel-in-progress: true
14+
15+
jobs:
16+
continuous-integration:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
with:
22+
ref: ${{ github.ref }}
23+
- name: Installing packages
24+
run: npm install
25+
- name: Starting the Arduino Simulator Web App in Pipeline mode
26+
run: npm run start:pipeline
27+
- name: Building the Arduino Simulator Web App
28+
run: npm run build
29+
- name: Checking Prettier Rules
30+
run: npm run prettier
31+
- name: Checking Lint Rules
32+
run: npm run lint
33+
- name: Running Dependency Tests
34+
run: npm run test:dependency
35+
- name: Running Benchmark Tests
36+
run: npm run test:benchmark
37+
- name: Running Unit Tests
38+
run: npm run test:unit
39+
- name: Running End-To-End Tests
40+
run: npm run test:e2e
41+
- name: Attaching the Arduino Simulator Web App to this workflow
42+
uses: actions/upload-artifact@v3
43+
with:
44+
name: arduino-simulator-web-app
45+
path: build

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# dependencies
2+
*node_modules
3+
4+
# build folder
5+
*build
6+
7+
# misc
8+
.DS_Store
9+
10+
# logs
11+
npm-debug.log*

.prettierignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
build
2+
.github/pages/ArduinoEditor.js
3+
.github/pages/ArduinoSimulator.js
4+
.github/pages/ArduinoSimulatorInterpreter.js
5+
.github/pages/ArduinoSimulatorInterpreter.min.js
6+
.github\pages\ArduinoEditor.js
7+
.github\pages\ArduinoSimulator.js
8+
.github\pages\ArduinoSimulatorInterpreter.js
9+
.github\pages\ArduinoSimulatorInterpreter.min.js
10+
public/ArduinoEditor.js
11+
public/ArduinoSimulatorInterpreter.js
12+
public/ArduinoSimulatorInterpreter.min.js
13+
public\ArduinoEditor.js
14+
public\ArduinoSimulatorInterpreter.js
15+
public\ArduinoSimulatorInterpreter.min.js

README.md

+31-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,31 @@
1-
# ArduinoSimulator
1+
# Arduino Simulator
2+
3+
Arduino Simulator in JavaScript.
4+
5+
![alt screenshot](https://raw.githubusercontent.com/lrusso/ArduinoSimulator/master/README.png)
6+
7+
## Web:
8+
9+
https://lrusso.github.io/ArduinoSimulator
10+
11+
## Demo using digital and analog pins:
12+
13+
https://lrusso.github.io/ArduinoSimulator/demo1.html
14+
15+
## Demo using the Serial monitor:
16+
17+
https://lrusso.github.io/ArduinoSimulator/demo2.html
18+
19+
## Demo using the EEPROM (work in progress):
20+
21+
https://lrusso.github.io/ArduinoSimulator/demo3.html
22+
23+
## How to set a default sketch in the simulator?
24+
25+
Create the JavaScript `DEFAULT_SKETCH` variable with your Sketch and put it in the HTML file, like it was done in the `demo1.html` file.
26+
27+
## Deploying the project
28+
29+
- Build the Web App and place the files in the `.github/pages` folder.
30+
- Commit and push the changes to the main branch.
31+
- A workflow will be triggered that will publish those changes.

README.png

114 KB
Loading

SAMPLE.jpg

124 KB
Loading

0 commit comments

Comments
 (0)