Skip to content

Commit bf9be84

Browse files
author
chenwenhao
committed
update environment
2 parents 051d5d1 + 7d50d95 commit bf9be84

418 files changed

Lines changed: 7542 additions & 4431 deletions

File tree

Some content is hidden

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

.github/workflows/develop.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
8+
jobs:
9+
release:
10+
name: build and release electron app
11+
runs-on: ${{ matrix.os }}
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [windows-latest, macos-latest, macos-12, ubuntu-latest]
17+
18+
steps:
19+
- name: Check out git repository
20+
uses: actions/checkout@v3.0.0
21+
22+
- name: Install Node.js
23+
uses: actions/setup-node@v3.0.0
24+
with:
25+
node-version: '14'
26+
27+
- name: Release for Windows
28+
if: matrix.os == 'windows-latest'
29+
run: |
30+
cd C:\Users
31+
mkdir Downloads
32+
git clone https://github.com/Seeed-Projects/seeed-codecraft D:\Users\Downloads\ws
33+
cd D:
34+
cd D:\Users\Downloads\ws\blocks && npm install -y --unsafe-perm=true
35+
cd D:\Users\Downloads\ws\blocks && npm run build
36+
cd D:\Users\Downloads\ws\l10n && npm install -y --unsafe-perm=true
37+
cd D:\Users\Downloads\ws\l10n && npm run build
38+
cd D:\Users\Downloads\ws\vm && npm install -y --unsafe-perm=true
39+
cd D:\Users\Downloads\ws\vm && npm run build
40+
cd D:\Users\Downloads\ws\gui && npm run build-win
41+
cd D:\Users\Downloads\ws\gui && Xcopy D:\Users\Downloads\ws\gui\build D:\Users\Downloads\ws\main\app\gui /E/H/C/I
42+
cd D:\Users\Downloads\ws\main\app && npm install -y --unsafe-perm=true && .\node_modules\.bin\electron-rebuild serialport
43+
cd D:\Users\Downloads\ws\main && npm install -y --unsafe-perm=true && rm -rf build && npm run publish-win64
44+
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
47+
48+
- name: Release for MacOS arm
49+
if: matrix.os == 'macos-latest'
50+
run: |
51+
echo $PWD
52+
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
53+
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
54+
brew install python@2
55+
export PATH="/usr/local/opt/python@2/libexec/bin:$PATH"
56+
alias python=python2
57+
export script_dir=$PWD
58+
brew install python2
59+
cd ${script_dir}/gui && npm install -y --unsafe-perm=true
60+
cd ${script_dir}/blocks && npm install -y --unsafe-perm=true
61+
cd ${script_dir}/blocks && npm run build
62+
cd ${script_dir}/l10n && npm install -y --unsafe-perm=true
63+
cd ${script_dir}/l10n && npm run build
64+
cd ${script_dir}/vm && npm install -y --unsafe-perm=true
65+
cd ${script_dir}/vm && npm run build
66+
cd ${script_dir}/gui && npm run build-mac
67+
cd ${script_dir}/gui && rm -rf ../main/app/gui && cp -r ./build ../main/app/gui
68+
cd ${script_dir}/main/app && npm install -y --unsafe-perm=true && ./node_modules/.bin/electron-rebuild serialport
69+
cd ${script_dir}/main && npm install -y --unsafe-perm=true && rm -rf build && npm run publish-mac
70+
71+
72+
- name: Release for MacOS x86
73+
if: matrix.os == 'macos-12'
74+
run: |
75+
echo $PWD
76+
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
77+
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
78+
brew install python@2
79+
export PATH="/usr/local/opt/python@2/libexec/bin:$PATH"
80+
alias python=python2
81+
export script_dir=$PWD
82+
brew install python2
83+
cd ${script_dir}/gui && npm install -y --unsafe-perm=true
84+
cd ${script_dir}/blocks && npm install -y --unsafe-perm=true
85+
cd ${script_dir}/blocks && npm run build
86+
cd ${script_dir}/l10n && npm install -y --unsafe-perm=true
87+
cd ${script_dir}/l10n && npm run build
88+
cd ${script_dir}/vm && npm install -y --unsafe-perm=true
89+
cd ${script_dir}/vm && npm run build
90+
cd ${script_dir}/gui && npm run build-mac
91+
cd ${script_dir}/gui && rm -rf ../main/app/gui && cp -r ./build ../main/app/gui
92+
cd ${script_dir}/main/app && npm install -y --unsafe-perm=true && ./node_modules/.bin/electron-rebuild serialport
93+
cd ${script_dir}/main && npm install -y --unsafe-perm=true && rm -rf build && npm run publish-mac
94+
95+
96+
- name: Release for Linux
97+
if: matrix.os == 'ubuntu-latest'
98+
run: |
99+
sudo apt update && sudo apt upgrade -y
100+
sudo apt install python2.7 -y
101+
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2
102+
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10
103+
104+
echo $PWD
105+
export script_dir=$PWD
106+
cd ${script_dir}/gui && npm install -y --unsafe-perm=true
107+
cd ${script_dir}/blocks && npm install -y --unsafe-perm=true
108+
cd ${script_dir}/blocks && npm run build
109+
cd ${script_dir}/l10n && npm install -y --unsafe-perm=true
110+
cd ${script_dir}/l10n && npm run build
111+
cd ${script_dir}/vm && npm install -y --unsafe-perm=true
112+
cd ${script_dir}/vm && npm run build
113+
cd ${script_dir}/gui && npm run build-mac
114+
cd ${script_dir}/gui && rm -rf ../main/app/gui && cp -r ./build ../main/app/gui
115+
cd ${script_dir}/main/app && npm install -y --unsafe-perm=true && ./node_modules/.bin/electron-rebuild serialport
116+
cd ${script_dir}/main && npm install -y --unsafe-perm=true && rm -rf build && npm run publish-linux

README.md

Lines changed: 97 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,132 @@
11
# Codecraft
2-
**Codecraft is a graphical programming software which is based on Scratch 3.0. It targets teenagers of age 7-16, compatible with WIN/MAC.**
2+
3+
[![Feature Requests](./misc/main.jpg)](https://www.yuque.com/tinkergen-help-en/codecraft?language=en-us)
4+
5+
**Codecraft is a graphical programming software which is based on [Scratch 3.0](https://scratch.mit.edu/). It targets teenagers of age 7-16, compatible with WIN/MAC.**
6+
By using a drag-and-drop interface, Codecraft has been helping users program without the need to write code in traditional text-based programming languages. Since its’ launch in 2018, it’s designed to make it easier for beginners, especially STEAM classrooms, to embrace coding to create projects and prototypes. With a focus on programming microcontrollers and IoT devices, Codecraft has been adapted and trusted by thousands of users all around the world. In 2022, Codecraft was recognized as [Bett Awards Finalist](https://www.seeedstudio.com/blog/2022/04/06/seeed-studio-codecraft-recognized-finalist-by-edtech-awards-2022/) and [The Edtech Awards Cool Tool Finalist](https://www.seeedstudio.com/blog/2022/04/06/seeed-studio-codecraft-recognized-finalist-by-edtech-awards-2022/), two important and in prestigious awards the education technology industry.
37

48
[Codecraft help online](https://www.yuque.com/tinkergen-help-en/codecraft?language=en-us)
59

610
### Support Devices
7-
Grove Zero,Arduino Uno/Mega,micro:bit,M.A.R.K(CyberEye),Grove Joint,GLINT,Bittle
811

9-
## Download
12+
- [Grove Zero](https://www.seeedstudio.com/Grove-Zero-Starter-Kit-V2-0-p-4352.html)
13+
14+
- [Arduino Mega](https://www.seeedstudio.com/Arduino-Mega2560-Rev3-p-695.html?queryID=4ca214ec6d1c29f11b4fb8ea9b412462&objectID=1868&indexName=bazaar_retailer_products) && [Arduino Uno](https://www.seeedstudio.com/Arduino-Uno-Rev3-p-2995.html?queryID=62ec7ca39b8fe0ebc6e04c773397de71&objectID=196&indexName=bazaar_retailer_products) && [Grove Beginner Kit for Arduinol](https://www.seeedstudio.com/Grove-Beginner-Kit-for-Arduino-p-4549.html)
15+
16+
- [micro:bit](https://www.seeedstudio.com/MICRO-BIT-SBC-BOARD-ONLY-V2-2-p-5294.html?queryID=aa6734c4d3222d27c9fe62e74012ccd3&objectID=5294&indexName=bazaar_retailer_products)
17+
18+
- [M.A.R.K(CyberEye)](https://www.seeedstudio.com/Make-A-Robot-Kit-p-4669.html?queryID=fd7dc3b439a2a85852f4f46efe8bbd2b&objectID=4669&indexName=bazaar_retailer_products)
1019

11-
You can download the latest version from [the download page from our website](https://ide.tinkergen.com/download/en/)
20+
- [GLINT](https://www.seeedstudio.com/Glint-Programmable-Wearable-Bracelet-p-4631.html?queryID=2638256e766bc26fe3165286a556f669&objectID=4631&indexName=bazaar_retailer_products)
1221

13-
## Getting started
22+
- [Bittle](https://www.seeedstudio.com/CH-Bittle-p-4833.html?queryID=fe0d39474704586c27934023f1a5b95a&objectID=4833&indexName=bazaar_retailer_products)
1423

15-
### Prerequisites
24+
- [Wio Terminal](https://www.seeedstudio.com/Wio-Terminal-p-4509.html?queryID=86e04846e7077e38bdc4182aeba96330&objectID=4509&indexName=bazaar_retailer_products)
25+
26+
## Download
27+
28+
You can download the latest version from [the download page from our website](https://ide.tinkergen.com/download/en/) or [Github Release](https://github.com/Seeed-Studio/CodeCraft/releases)
29+
30+
## Prerequisites
1631

1732
This project requires:
18-
- [Node.js](https://nodejs.org/)
33+
- [Node.js 14+](https://nodejs.org/)
1934
- [Python 2.x](https://www.python.org/downloads/release/python-272/), and make it as the default version
2035

21-
### Building
36+
## Build
37+
38+
Clone this repo
39+
40+
```bash
41+
git clone -b main https://github.com/Seeed-Studio/CodeCraft.git ~/seeed-codecraft
42+
export workspace=~/seeed-codecraft
43+
pushd $workspace
44+
```
2245

23-
The following steps will help you build the project locally. It will generate a installer after the building is done.
46+
### Auto Install
2447

2548
Linux/Mac:
2649

27-
bash run-mac.sh
50+
```bash
51+
bash run-mac.sh
52+
```
53+
2854
Windows:
2955

30-
bash run-win64.sh
56+
```bash
57+
bash run-win64.sh
58+
```
59+
60+
### Manual Installation
61+
62+
```bash
63+
cd ${workspace}/blocks
64+
npm install && npm run build
65+
66+
cd ${workspace}/l10n
67+
npm install && npm run build
68+
69+
cd ${workspace}/vm
70+
npm install && npm run build
71+
72+
cd ${workspace}/gui
73+
npm install
74+
```
75+
76+
- For mac or linux like
77+
78+
```bash
79+
npm run build-mac
80+
```
81+
82+
- For win
83+
84+
```bash
85+
npm run build-win
86+
```
87+
88+
#### Build main app
89+
90+
```bash
91+
rm -r ${workspace}/main/app/gui && cp -r ./build ${workspace}/main/app/gui
92+
cd ${workspace}/main/app
93+
npm install
94+
./node_modules/.bin/electron-rebuild serialport
3195

32-
You can also build the project manually:
96+
# If the error message “script is prohibited on this system” appears on the Windows
97+
# system, you need to open powershell as an administrator, and then execute
98+
# Set-ExecutionPolicy RemoteSigned
3399

34-
cd blocks
35-
npm install && npm run build
100+
cd ${workspace}/main
101+
npm install
102+
rm -r build
103+
```
36104

37-
cd ../l10n
38-
npm install && npm run build
105+
- For Mac
39106

40-
cd ../vm
41-
npm install && npm run build
107+
```bash
108+
npm run publish-mac
109+
```
42110

43-
cd ../gui
44-
npm install
45-
// for mac or linux
46-
npm run build-mac
47-
// for win
48-
npm run build-win
49-
rm -r ../main/app/gui && cp -r ./build ../main/app/gui
111+
- For Linux like
50112

51-
cd ../main/app
52-
npm install
53-
./node_modules/.bin/electron-rebuild serialport
113+
```bash
114+
npm run publish-linux
115+
```
54116

55-
// If the error message “script is prohibited on this system” appears on the Windows
56-
// system, you need to open powershell as an administrator, and then execute
57-
// Set-ExecutionPolicy RemoteSigned
117+
- For Windows
58118

59-
cd ..
60-
npm install
61-
rm -r build
62-
// Mac
63-
npm run publish-mac
64-
// Linux
65-
npm run publish-linux
66-
// Windows
67-
npm run publish-win64
119+
```bash
120+
npm run publish-win64
121+
```
68122

69123
Once you finish building, you can find the installer under main/build/
70124

71-
## Architecture
125+
## Contribute
72126

73-
## Contribution
127+
`PR welcome`
74128

75-
We'd love to have people in open source communities help Codecraft grow. If you are interested in contributing, please read this guide.
129+
Here, we’d also love to announce an open call for contributions to Codecraft open source project on GitHub. Whether you're a seasoned programmer or just starting out, we welcome contributions of all levels. From fixing bugs, to implementing new features & new blocks of functions, to make it compatible with more hardware platforms, to improving the overall codebase, there are many ways in which you can contribute to the project. Thanks in advance for your interest in [contributing](./misc/CONTRIBUTING.md) to this project!
76130

77131
## License
78132

blocks/.gitignore

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,37 @@ common.pyc
1818
*.komodoproject
1919
/nbproject/private/
2020

21-
/accessible/*
22-
/dist
21+
# Unused by scratch-blocks
22+
dart_compressed.js
23+
javascript_compressed.js
24+
lua_compressed.js
25+
php_compressed.js
26+
python_compressed.js
2327

24-
/msg/json/synonyms.json
25-
/msg/json/qqq.json
26-
/msg/json/constants.json
27-
/msg/json/en.jso
28-
/msg/js/en.js
28+
# Editor
29+
.vscode
2930

31+
/accessible/*
32+
/dist
33+
/msg/js/*
34+
!/msg/js/en.js
35+
/msg/json/*
36+
!/msg/json/en.json
3037
/blockly_compressed_horizontal.js
3138
/blockly_compressed_vertical.js
3239
/blockly_uncompressed_horizontal.js
3340
/blockly_uncompressed_vertical.js
3441
/blocks_compressed_horizontal.js
3542
/blocks_compressed_vertical.js
3643
/blocks_compressed.js
37-
38-
/c_compressed.js
39-
/dart_compressed.js
40-
/javascript_compressed.js
41-
/lua_compressed.js
42-
/php_compressed.js
43-
/python_compressed.js
44-
4544
/gh-pages
4645
/gh-pages/main.js
4746
/gh-pages/playgrounds
4847
/gh-pages/Gemfile.lock
4948
/gh-pages/closure-library
5049
/gh-pages/_site
50+
/*compiler*.jar
51+
/local_blockly_compressed_vertical.js
52+
/chromedriver
5153

5254
/gen_reqfiles.txt

0 commit comments

Comments
 (0)