Skip to content

Commit

Permalink
Initial files for MakeCode project
Browse files Browse the repository at this point in the history
  • Loading branch information
neonerz committed Oct 21, 2020
1 parent f03317c commit 0819892
Show file tree
Hide file tree
Showing 14 changed files with 222 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/cfg-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Check pxt.json

on:
push

jobs:
check-cfg:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [8.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install
run: npm install -g pxt
- name: Checkout current state
run: |
git checkout -- .
git clean -fd
- name: Fix files listed in config if necessary
run: pxt checkpkgcfg
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
title: 'Removing missing files from pxt.json'
commit-message: 'Removing missing files from pxt.json'
delete-branch: true
29 changes: 29 additions & 0 deletions .github/workflows/makecode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: MakeCode

on: [push]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [8.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install
run: |
npm install -g pxt
pxt target minecraft
- name: build
run: |
pxt install
pxt build --cloud
env:
CI: true
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# Initial
# MakeCode
built
node_modules
yotta_modules
yotta_targets
pxt_modules
_site
*.db
*.tgz
.header.json
.simstate.json
23 changes: 23 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"editor.formatOnType": true,
"files.autoSave": "afterDelay",
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/built/**": true,
"**/node_modules/**": true,
"**/yotta_modules/**": true,
"**/yotta_targets": true,
"**/pxt_modules/**": true
},
"files.associations": {
"*.blocks": "html",
"*.jres": "json"
},
"search.exclude": {
"**/built": true,
"**/node_modules": true,
"**/yotta_modules": true,
"**/yotta_targets": true,
"**/pxt_modules": true
}
}
30 changes: 30 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

// A task runner that calls the MakeCode (PXT) compiler
{
"version": "2.0.0",
"tasks": [{
"label": "pxt deploy",
"type": "shell",
"command": "pxt deploy --local",
"group": "build",
"problemMatcher": [ "$tsc" ]
}, {
"label": "pxt build",
"type": "shell",
"command": "pxt build --local",
"group": "build",
"problemMatcher": [ "$tsc" ]
}, {
"label": "pxt install",
"type": "shell",
"command": "pxt install",
"group": "build",
"problemMatcher": [ "$tsc" ]
}, {
"label": "pxt clean",
"type": "shell",
"command": "pxt clean",
"group": "test",
"problemMatcher": [ "$tsc" ]
}]
}
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
all: deploy

build:
pxt build

deploy:
pxt deploy

test:
pxt test
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

> Open this page at [https://neonerz.github.io/hoc2020-ts/](https://neonerz.github.io/hoc2020-ts/)
## Use as Extension

This repository can be added as an **extension** in MakeCode.

* open [https://minecraft.makecode.com/](https://minecraft.makecode.com/)
* click on **New Project**
* click on **Extensions** under the gearwheel menu
* search for **https://github.com/neonerz/hoc2020-ts** and import

## Edit this project ![Build status badge](https://github.com/neonerz/hoc2020-ts/workflows/MakeCode/badge.svg)

To edit this repository in MakeCode.

* open [https://minecraft.makecode.com/](https://minecraft.makecode.com/)
* click on **Import** then click on **Import URL**
* paste **https://github.com/neonerz/hoc2020-ts** and click import

## Blocks preview

This image shows the blocks code from the last commit in master.
This image may take a few minutes to refresh.

![A rendered view of the blocks](https://github.com/neonerz/hoc2020-ts/raw/master/.github/makecode/blocks.png)

#### Metadata (used for search, rendering)

* for PXT/minecraft
<script src="https://makecode.com/gh-pages-embed.js"></script><script>makeCodeRender("{{ site.makecode.home_url }}", "{{ site.github.owner_name }}/{{ site.github.repository_name }}");</script>
8 changes: 8 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
makecode:
target: minecraft
platform: minecraft
home_url: https://minecraft.makecode.com/
theme: jekyll-theme-slate
include:
- assets
- README.md
10 changes: 10 additions & 0 deletions main.blocks
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<xml xmlns="http://www.w3.org/1999/xhtml">
<block type="pxt-on-start"></block>
<block type="minecraftOnChat">
<value name="command">
<shadow type="text">
<field name="TEXT">run</field>
</shadow>
</value>
</block>
</xml>
1 change: 1 addition & 0 deletions main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

26 changes: 26 additions & 0 deletions pxt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "hoc2020-ts",
"version": "0.0.0",
"description": "",
"dependencies": {
"core": "*",
"builder": "*"
},
"files": [
"README.md",
"main.blocks",
"main.ts"
],
"testFiles": [
"test.ts"
],
"public": true,
"targetVersions": {
"target": "1.5.44",
"targetId": "minecraft"
},
"supportedTargets": [
"minecraft"
],
"preferredEditor": "blocksprj"
}
1 change: 1 addition & 0 deletions test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// tests go here; this will not be compiled when this package is used as an extension.
9 changes: 9 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"target": "es5",
"noImplicitAny": true,
"outDir": "built",
"rootDir": "."
},
"exclude": ["pxt_modules/**/*test.ts"]
}

0 comments on commit 0819892

Please sign in to comment.