Skip to content

Commit

Permalink
Initial working, 1.0-beta19
Browse files Browse the repository at this point in the history
  • Loading branch information
bashlund committed May 27, 2018
0 parents commit c5f631b
Show file tree
Hide file tree
Showing 80 changed files with 84,785 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
build
dist
*.log
yarn.lock
674 changes: 674 additions & 0 deletions COPYING

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Copyright 2018 Superblocks AB
#
# This file is part of Superblocks Studio.
#
# Superblocks Studio is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation version 3 of the License.
#
# Superblocks Studio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Superblocks Studio. If not, see <http://www.gnu.org/licenses/>.

PREACT = ./node_modules/preact-cli/lib/index.js

ifndef PORT
PORT=8181
endif

ifndef ORIGIN_DEV
ORIGIN_DEV=http://localhost:$(PORT)
endif

ifndef ORIGIN_DIST
ORIGIN_DIST=https://studio.superblocks.com
endif

watch: build_external_dev
PORT=$(PORT) $(PREACT) watch
build: build_external_dist
$(PREACT) build --no-prerender --service-worker=false --production --clean
build_external_dev:
mkdir -p ./src/components/superprovider/dist
sed 's#ORIGIN#"$(ORIGIN_DEV)"#g' ./src/components/superprovider/web3provider.js | ./node_modules/babel-cli/bin/babel.js --presets es2015 >./src/components/superprovider/dist/web3provider.js
build_external_dist:
mkdir -p ./src/components/superprovider/dist
sed 's#ORIGIN#"$(ORIGIN_DIST)"#g' ./src/components/superprovider/web3provider.js | ./node_modules/babel-cli/bin/babel.js --presets es2015 >./src/components/superprovider/dist/web3provider.js
dist: build
rm -rf dist
mkdir dist
cp -r ./build/static ./dist
cp ./build/*.js ./dist
cp ./build/*.css ./dist
cp ./build/index.html ./dist
cp ./build/favicon.ico ./dist
cp ./build/manifest.json ./dist
cp -r ./build/vs ./dist
cp -r ./build/solc ./dist
cp -r ./build/evm ./dist
rm ./dist/sw.js
@echo "Done."
@echo "You did bump the version (./bump_version.sh) prio, right?"
clean:
rm -rf build
rm -rf dist
npm:
yarn install

.PHONY: npm watch build dist clean build_external
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Superblocks Studio

[Superblocks](https://superblocks.com) Studio is an IDE to learn, build and deploy DApps for Ethereum. It's a full browser experience which requires no installs to run.

Studio has a built in Solidity compiler and Ethereum Virtual Machine, it also works with local and public networks.

To try it out go to [studio.superblocks.com](https://studio.superblocks.com).

Below is described how to get the Studio PreactJS project setup and running locally.

## License
Superblocks Studio is free software and GPLv3 licensed. See the COPYING file for details.

## Install node modules
Use `yarn` [Yarn](yarnpkg.com/).
```sh
yarn install
```

## Run in dev mode
```sh
make
```

Browse to `http://localhost:8181`. Note that if you use any other hostname/IP than `localhost` run instead `ORIGIN_DEV=http://127.0.0.1 make`.

## Make a production build
```sh
make dist
```

The dist files will be inside `./dist`.

## Bumping version
Set version both in app.js and in manifest.json.
```sh
./bump_version "1.1.0"
```
62 changes: 62 additions & 0 deletions bump_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env sh
#
# Copyright 2018 Superblocks AB
#
# This file is part of Superblocks Studio.
#
# Superblocks Studio is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation version 3 of the License.
#
# Superblocks Studio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Superblocks Studio. If not, see <http://www.gnu.org/licenses/>.
#
# Bump studio version
#

set -o errexit
set -o nounset


#
# Check arguments
if [ "$#" -lt 1 ]; then
printf "Missing version name. Example: $0 \"5.1 beta9.9\"\n" >&2
exit 1
fi

#
# Check requirements
if ! command -v sed >/dev/null; then
printf "Missing sed program. Exiting...\n" >&2
exit 1
fi

#
# Data
_version_name="$1"
_version_date=$(date "+%Y-%m-%d")

#
# Files to change
_src_components_app_file="./src/components/app.js"
_src_manifest_file="./src/manifest.json"

# Update files
sed -i.bak "s/\"version\"\:.*/\"version\": \"${_version_name}\"/" "$_src_manifest_file"
sed -i.bak "s/this\.\_version\=\".*/this\.\_version=\"${_version_name}\"\;/" "$_src_components_app_file"

#
# Cleanup temporary files
if [ -f "$_src_manifest_file" ]; then
rm "${_src_manifest_file}.bak"
fi

if [ -f "$_src_components_app_file" ]; then
rm "${_src_components_app_file}.bak"
fi
50 changes: 50 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"private": true,
"name": "Superblocks",
"version": "0.0.0",
"license": "GPL",
"scripts": {},
"eslintConfig": {
"extends": "eslint-config-synacor"
},
"eslintIgnore": [
"build/*"
],
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babelify": "^8.0.0",
"browserify": "^16.1.1",
"eslint": "^4.9.0",
"eslint-config-synacor": "^2.0.2",
"ethereumjs-abi": "^0.6.5",
"ethereumjs-account": "^2.0.4",
"ethereumjs-blockchain": "^2.1.0",
"ethereumjs-util": "^5.1.5",
"ethereumjs-vm": "^2.3.3",
"if-env": "^1.0.0",
"merkle-patricia-tree": "^2.3.1",
"preact-cli": "^2.1.1",
"solc": "^0.4.21"
},
"dependencies": {
"@fortawesome/fontawesome": "^1.1.3",
"@fortawesome/fontawesome-free-brands": "^5.0.6",
"@fortawesome/fontawesome-free-regular": "^5.0.6",
"@fortawesome/fontawesome-free-solid": "^5.0.6",
"@fortawesome/react-fontawesome": "^0.0.17",
"classnames": "^2.2.5",
"crypto-js": "^3.1.9-1",
"eth-lightwallet": "^3.0.1",
"ethereumjs-tx": "^1.3.4",
"less": "^2.7.3",
"less-loader": "^4.0.5",
"normalize-css": "^2.3.1",
"preact": "^8.2.6",
"preact-compat": "^3.17.0",
"react-fetch": "^0.0.9",
"react-monaco-editor": "^0.13.0",
"web3": "0.19"
}
}
25 changes: 25 additions & 0 deletions preact.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2018 Superblocks AB
//
// This file is part of Superblocks Studio.
//
// Superblocks Studio is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation version 3 of the License.
//
// Superblocks Studio is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Superblocks Studio. If not, see <http://www.gnu.org/licenses/>.

import CopyWebpackPlugin from 'copy-webpack-plugin';

export default config => {
config.plugins.push( new CopyWebpackPlugin([{ context: `${__dirname}/src/assets`, from: `**/*` }]) );
config.plugins.push( new CopyWebpackPlugin([ { context: `${__dirname}`, from: 'node_modules/monaco-editor/min/vs', to: 'vs', } ]));
config.plugins.push( new CopyWebpackPlugin([ { context: `${__dirname}/src/components/solc/dist`, from: '**/*', to: 'solc', } ]));
config.plugins.push( new CopyWebpackPlugin([ { context: `${__dirname}/src/components/evm/dist`, from: '**/*', to: 'evm', } ]));
config.plugins.push( new CopyWebpackPlugin([ { context: `${__dirname}/src/components/superprovider/dist`, from: 'web3provider.js', to: 'static/js', } ]));
};
Binary file added src/assets/favicon.ico
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/assets/static/img/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/static/img/space-invaders.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/static/img/superblocks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c5f631b

Please sign in to comment.