-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* switch to github actions * dry run for PRs * update publish
- Loading branch information
Showing
8 changed files
with
87 additions
and
212 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
branches: ["master"] | ||
pull_request: | ||
|
||
permissions: | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- run: npm i && node build.js | ||
- uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: build | ||
if: github.ref == 'refs/heads/master' && github.event_name == 'push' | ||
- uses: actions/deploy-pages@v2 | ||
if: github.ref == 'refs/heads/master' && github.event_name == 'push' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
node_modules | ||
<<<<<<< HEAD | ||
package-lock.json | ||
.DS_Store | ||
.vscode | ||
build/ | ||
======= | ||
.DS_Store | ||
.vscode | ||
>>>>>>> master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
const _ = require('lodash'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const EXTENSIONS_DIR = path.join(__dirname, 'extensions'); | ||
const OUT_DIR = path.join(__dirname, 'build'); | ||
|
||
const extensions = fs.readdirSync(EXTENSIONS_DIR).map(readExtension); | ||
|
||
try { fs.mkdirSync(OUT_DIR); } catch {} | ||
|
||
fs.writeFileSync(path.join(OUT_DIR, 'index.html'), renderTemplate('index.html', { extensions })); | ||
fs.copyFileSync('index.js', path.join(OUT_DIR, 'index.js')); | ||
|
||
// ------------------------------------------ | ||
|
||
function readExtension(name) { | ||
const dirpath = path.join(EXTENSIONS_DIR, name); | ||
const settings = JSON.parse(fs.readFileSync(path.join(dirpath, 'extension.json'), 'utf8')); | ||
const description = settings['description']; | ||
let linkUrl = ""; | ||
let scriptUrl = `https://extensions.netsblox.org/extensions/${name}/index.js`; | ||
|
||
if (!settings['useDev']) { | ||
linkUrl = `https://editor.netsblox.org/?extensions=[%22${scriptUrl}%22]#`; | ||
} else { | ||
linkUrl = `https://dev.netsblox.org/?extensions=[%22${scriptUrl}%22]#`; | ||
} | ||
|
||
return { | ||
name, | ||
displayName : settings['customName'] ?? name, | ||
description, | ||
linkUrl, | ||
scriptUrl, | ||
}; | ||
} | ||
|
||
function renderTemplate(name, data) { | ||
return _.template(fs.readFileSync(name, 'utf8'))(data).trim(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,119 +21,15 @@ <h1>NetsBlox Extensions</h1> | |
<a style="font-size: 12px;" id="showAllDescriptions">Show all descriptions</a> | ||
<a style="font-size: 12px;" id="hideAllDescriptions">Hide all descriptions</a> | ||
|
||
|
||
<% extensions.forEach(ext=> { %> | ||
<details class="extension"> | ||
<summary><input type="checkbox" class="extensionOption" name="AugmentedReality" style="margin-right: 10px" hidden /><a href="https://editor.netsblox.org/?extensions=[%22https://extensions.netsblox.org/extensions/AugmentedReality/index.js%22]" target="_blank"> AugmentedReality </a></summary> | ||
<summary><input type="checkbox" class="extensionOption" name="<%= ext.name %>" style="margin-right: 10px" hidden /><a href="<%= ext.linkUrl %>" target="_blank"> <%= ext.displayName %> </a></summary> | ||
<p> | ||
<input type="hidden" name="AugmentedReality_script" id="AugmentedReality_script" value="https://extensions.netsblox.org/extensions/AugmentedReality/index.js" /> | ||
Use QR codes to pin sprites to the world! | ||
<input type="hidden" name="<%= ext.name %>_script" id="<%= ext.name %>_script" value="<%= ext.scriptUrl %>" /> | ||
<%= ext.description %> | ||
</p> | ||
</details> | ||
|
||
<details class="extension"> | ||
<summary><input type="checkbox" class="extensionOption" name="BeatBlox" style="margin-right: 10px" hidden /><a href="https://editor.netsblox.org/?extensions=[%22https://extensions.netsblox.org/extensions/BeatBlox/index.js%22]" target="_blank"> BeatBlox </a></summary> | ||
<p> | ||
<input type="hidden" name="BeatBlox_script" id="BeatBlox_script" value="https://extensions.netsblox.org/extensions/BeatBlox/index.js" /> | ||
BeatBlox extends Music Functionality within NetsBlox | ||
</p> | ||
</details> | ||
|
||
<details class="extension"> | ||
<summary><input type="checkbox" class="extensionOption" name="BetterShare" style="margin-right: 10px" hidden /><a href="https://editor.netsblox.org/?extensions=[%22https://extensions.netsblox.org/extensions/BetterShare/index.js%22]" target="_blank"> BetterShare </a></summary> | ||
<p> | ||
<input type="hidden" name="BetterShare_script" id="BetterShare_script" value="https://extensions.netsblox.org/extensions/BetterShare/index.js" /> | ||
WIP - Provides a few utilities that can make sharing projects easier | ||
</p> | ||
</details> | ||
|
||
<details class="extension"> | ||
<summary><input type="checkbox" class="extensionOption" name="BlocksToCodeToBlocks" style="margin-right: 10px" hidden /><a href="https://editor.netsblox.org/?extensions=[%22https://extensions.netsblox.org/extensions/BlocksToCodeToBlocks/index.js%22]" target="_blank"> Blocks to Code to Blocks (beta) </a></summary> | ||
<p> | ||
<input type="hidden" name="BlocksToCodeToBlocks_script" id="BlocksToCodeToBlocks_script" value="https://extensions.netsblox.org/extensions/BlocksToCodeToBlocks/index.js" /> | ||
Transform back and forth with LISP-like code and NetsBlox, based on new features in Snap! v10 (WIP) | ||
</p> | ||
</details> | ||
|
||
<details class="extension"> | ||
<summary><input type="checkbox" class="extensionOption" name="FaceLandmarker" style="margin-right: 10px" hidden /><a href="https://editor.netsblox.org/?extensions=[%22https://extensions.netsblox.org/extensions/FaceLandmarker/index.js%22]" target="_blank"> FaceLandmarker </a></summary> | ||
<p> | ||
<input type="hidden" name="FaceLandmarker_script" id="FaceLandmarker_script" value="https://extensions.netsblox.org/extensions/FaceLandmarker/index.js" /> | ||
Track Faces in images/video using MediaPipe! | ||
</p> | ||
</details> | ||
|
||
<details class="extension"> | ||
<summary><input type="checkbox" class="extensionOption" name="HandGestures" style="margin-right: 10px" hidden /><a href="https://editor.netsblox.org/?extensions=[%22https://extensions.netsblox.org/extensions/HandGestures/index.js%22]" target="_blank"> HandGestures </a></summary> | ||
<p> | ||
<input type="hidden" name="HandGestures_script" id="HandGestures_script" value="https://extensions.netsblox.org/extensions/HandGestures/index.js" /> | ||
Track 3D hand gestures in images/video using MediaPipe! | ||
</p> | ||
</details> | ||
|
||
<details class="extension"> | ||
<summary><input type="checkbox" class="extensionOption" name="HideCategories" style="margin-right: 10px" hidden /><a href="https://dev.netsblox.org/?extensions=[%22https://extensions.netsblox.org/extensions/HideCategories/index.js%22]" target="_blank"> HideCategories </a></summary> | ||
<p> | ||
<input type="hidden" name="HideCategories_script" id="HideCategories_script" value="https://extensions.netsblox.org/extensions/HideCategories/index.js" /> | ||
This extension allows you to automatically hide categories and is particularly useful when setting different visible categories for collaborating users. | ||
</p> | ||
</details> | ||
|
||
<details class="extension"> | ||
<summary><input type="checkbox" class="extensionOption" name="PoseLandmarker" style="margin-right: 10px" hidden /><a href="https://editor.netsblox.org/?extensions=[%22https://extensions.netsblox.org/extensions/PoseLandmarker/index.js%22]" target="_blank"> PoseLandmarker </a></summary> | ||
<p> | ||
<input type="hidden" name="PoseLandmarker_script" id="PoseLandmarker_script" value="https://extensions.netsblox.org/extensions/PoseLandmarker/index.js" /> | ||
Track 3D full body poses in images/video using MediaPipe! | ||
</p> | ||
</details> | ||
|
||
<details class="extension"> | ||
<summary><input type="checkbox" class="extensionOption" name="RoboScapeOnline" style="margin-right: 10px" hidden /><a href="https://editor.netsblox.org/?extensions=[%22https://extensions.netsblox.org/extensions/RoboScapeOnline/index.js%22]" target="_blank"> 🤖 RoboScape Online </a></summary> | ||
<p> | ||
<input type="hidden" name="RoboScapeOnline_script" id="RoboScapeOnline_script" value="https://extensions.netsblox.org/extensions/RoboScapeOnline/index.js" /> | ||
Networked robotics simulation in the browser! (WIP) | ||
</p> | ||
</details> | ||
|
||
<details class="extension"> | ||
<summary><input type="checkbox" class="extensionOption" name="RoboScapeOnline2" style="margin-right: 10px" hidden /><a href="https://editor.netsblox.org/?extensions=[%22https://extensions.netsblox.org/extensions/RoboScapeOnline2/index.js%22]" target="_blank"> 🤖 RoboScape Online (beta) </a></summary> | ||
<p> | ||
<input type="hidden" name="RoboScapeOnline2_script" id="RoboScapeOnline2_script" value="https://extensions.netsblox.org/extensions/RoboScapeOnline2/index.js" /> | ||
Networked robotics simulation in the browser! (WIP) | ||
</p> | ||
</details> | ||
|
||
<details class="extension"> | ||
<summary><input type="checkbox" class="extensionOption" name="TimeSync" style="margin-right: 10px" hidden /><a href="https://editor.netsblox.org/?extensions=[%22https://extensions.netsblox.org/extensions/TimeSync/index.js%22]" target="_blank"> TimeSync </a></summary> | ||
<p> | ||
<input type="hidden" name="TimeSync_script" id="TimeSync_script" value="https://extensions.netsblox.org/extensions/TimeSync/index.js" /> | ||
calculate time sync info from the NetsBlox server | ||
</p> | ||
</details> | ||
|
||
<details class="extension"> | ||
<summary><input type="checkbox" class="extensionOption" name="TuneScope" style="margin-right: 10px" hidden /><a href="https://editor.netsblox.org/?extensions=[%22https://extensions.netsblox.org/extensions/TuneScope/index.js%22]" target="_blank"> TuneScope </a></summary> | ||
<p> | ||
<input type="hidden" name="TuneScope_script" id="TuneScope_script" value="https://extensions.netsblox.org/extensions/TuneScope/index.js" /> | ||
Music Notation, Instruments, Drums, Tones, Chords, Tracks, from the University of Virginia (Glen Bull) | ||
</p> | ||
</details> | ||
|
||
<details class="extension"> | ||
<summary><input type="checkbox" class="extensionOption" name="WebSerial" style="margin-right: 10px" hidden /><a href="https://editor.netsblox.org/?extensions=[%22https://extensions.netsblox.org/extensions/WebSerial/index.js%22]" target="_blank"> WebSerial </a></summary> | ||
<p> | ||
<input type="hidden" name="WebSerial_script" id="WebSerial_script" value="https://extensions.netsblox.org/extensions/WebSerial/index.js" /> | ||
Provides blocks for connecting to a device, e.g. an Arduino, over WebSerial | ||
</p> | ||
</details> | ||
|
||
<details class="extension"> | ||
<summary><input type="checkbox" class="extensionOption" name="WhenKeyPressedLogger" style="margin-right: 10px" hidden /><a href="https://editor.netsblox.org/?extensions=[%22https://extensions.netsblox.org/extensions/WhenKeyPressedLogger/index.js%22]" target="_blank"> WhenKeyPressedLogger </a></summary> | ||
<p> | ||
<input type="hidden" name="WhenKeyPressedLogger_script" id="WhenKeyPressedLogger_script" value="https://extensions.netsblox.org/extensions/WhenKeyPressedLogger/index.js" /> | ||
Logs 'When [key] key pressed' block activations for Ben | ||
</p> | ||
</details> | ||
|
||
<% }) %> | ||
|
||
<hr /> | ||
|
||
|
@@ -160,4 +56,4 @@ <h1>NetsBlox Extensions</h1> | |
<script src="./index.js" async defer></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/fuzzysort.min.js" async></script> | ||
</body> | ||
</html> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.