Skip to content
This repository has been archived by the owner on Jul 2, 2019. It is now read-only.

Commit

Permalink
chore: add readme and version bump files
Browse files Browse the repository at this point in the history
  • Loading branch information
wangshijun committed May 8, 2019
1 parent e99af84 commit 05189e5
Show file tree
Hide file tree
Showing 11 changed files with 4,711 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .editorconfig
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
32 changes: 32 additions & 0 deletions .gitignore
@@ -0,0 +1,32 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# Deployed apps should consider commenting this line out:
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
node_modules

# Ignore .env configuration files
.env

# Ignore .DS_Store files on OS X
.DS_Store
client/.next
9 changes: 9 additions & 0 deletions .makefiles/bump_lerna_version.sh
@@ -0,0 +1,9 @@
#!/bin/bash

cur_ver=$(cat lerna.json | grep '"version":' | awk '{print $2}' | sed 's/"//g' | sed 's/,//g')
new_ver=$(cat version)
ver_pattern="\"version\": \"$cur_ver\"" # strict match to avoid accidently change dependency version
ver_replacement="\"version\": \"$new_ver\""
cat lerna.json | sed "s/$ver_pattern/$ver_replacement/g" > lerna.json.tmp
mv lerna.json.tmp lerna.json
git add lerna.json
9 changes: 9 additions & 0 deletions .makefiles/bump_node_version.sh
@@ -0,0 +1,9 @@
#!/bin/bash

cur_ver=$(cat package.json | grep '"version":' | awk '{print $2}' | sed 's/"//g' | sed 's/,//g')
new_ver=$(cat version)
ver_pattern="\"version\": \"$cur_ver\"" # strict match to avoid accidently change dependency version
ver_replacement="\"version\": \"$new_ver\""
cat package.json | sed "s/$ver_pattern/$ver_replacement/g" > package.json.tmp
mv package.json.tmp package.json
git add package.json
49 changes: 49 additions & 0 deletions .makefiles/bump_version.sh
@@ -0,0 +1,49 @@
NOW="$(date +'%B %d, %Y')"
# RED="\033[1;31m"
# GREEN="\033[0;32m"
# YELLOW="\033[1;33m"
# BLUE="\033[1;34m"
# PURPLE="\033[1;35m"
# CYAN="\033[1;36m"
# WHITE="\033[1;37m"
# RESET="\033[0m"

LATEST_HASH=`git log --pretty=format:'%h' -n 1`

# QUESTION_FLAG="${GREEN}?"
# WARNING_FLAG="${YELLOW}!"
# NOTICE_FLAG="${CYAN}❯"

VERSION=version

ADJUSTMENTS_MSG="${QUESTION_FLAG} ${CYAN}Now you can make adjustments to ${WHITE}CHANGELOG.md${CYAN}. Then press enter to continue."

if [ -f $VERSION ]; then
BASE_STRING=`cat $VERSION`
BASE_LIST=(`echo $BASE_STRING | tr '.' ' '`)
V_MAJOR=${BASE_LIST[0]}
V_MINOR=${BASE_LIST[1]}
V_PATCH=${BASE_LIST[2]}
echo -e "${NOTICE_FLAG} Current version: ${WHITE}$BASE_STRING"
echo -e "${NOTICE_FLAG} Latest commit hash: ${WHITE}$LATEST_HASH"
V_MINOR=$((V_MINOR + 1))
V_PATCH=0
SUGGESTED_VERSION="$V_MAJOR.$V_MINOR.$V_PATCH"
echo -ne "${QUESTION_FLAG} ${CYAN}Enter a version number [${WHITE}$SUGGESTED_VERSION${CYAN}]: "
read INPUT_STRING
if [ "$INPUT_STRING" = "" ]; then
INPUT_STRING=$SUGGESTED_VERSION
fi
echo -e "${NOTICE_FLAG} Will set new version to be ${WHITE}$INPUT_STRING"
echo $INPUT_STRING > $VERSION
echo "## $INPUT_STRING ($NOW)" > tmpfile
git log --pretty=format:" - %s" "v$BASE_STRING"...HEAD >> tmpfile
echo "" >> tmpfile
echo "" >> tmpfile
cat CHANGELOG.md >> tmpfile
mv tmpfile CHANGELOG.md
echo -e "$ADJUSTMENTS_MSG"
read
git add CHANGELOG.md $VERSION
[ -f package.json ] && .makefiles/bump_node_version.sh
fi
27 changes: 27 additions & 0 deletions .makefiles/release.mk
@@ -0,0 +1,27 @@
RELEASE_VERSION=v$(VERSION)
GIT_BRANCH=$(strip $(shell git symbolic-ref --short HEAD))
GIT_VERSION="$(strip $(shell git rev-parse --short HEAD))"

release:
@git config --local user.name "wangshijun"
@git config --local user.email "wangshijun2010@gmail.com"
@git tag -a $(RELEASE_VERSION) -m "Release $(RELEASE_VERSION). Revision is: $(GIT_VERSION)" | true
@git push origin $(RELEASE_VERSION) | true

delete-release:
@echo "Delete a release on $(RELEASE_VERSION)"
@git tag -d $(RELEASE_VERSION) | true
@git push -f -d origin $(RELEASE_VERSION) | true

bump-version:
@echo "Bump version..."
@.makefiles/bump_version.sh

create-pr:
@echo "Creating pull request..."
@make bump-version || true
@git add .;git commit -a -m "bump version";git push origin $(GIT_BRANCH)
@hub pull-request

browse-pr:
@hub browse -- pulls
60 changes: 60 additions & 0 deletions Makefile
@@ -0,0 +1,60 @@
TOP_DIR=.
README=$(TOP_DIR)/README.md

VERSION=$(strip $(shell cat version))

build:
@echo "Building the software..."

init: install dep
@echo "Initializing the repo..."

travis-init: install dep
@echo "Initialize software required for travis (normally ubuntu software)"

install:
@echo "Install software required for this repo..."

dep:
@echo "Install dependencies required for this repo..."
@yarn

pre-build: install dep
@echo "Running scripts before the build..."

post-build:
@echo "Running scripts after the build is done..."

all: pre-build build post-build

test:
@echo "Running test suites..."

lint:
@echo "Linting the software..."
@yarn lint

doc:
@echo "Building the documenation..."

precommit: dep lint doc build test

travis: precommit

travis-deploy:
@echo "Deploy the software by travis"

clean:
@echo "Cleaning the build..."

watch:
@make build
@echo "Watching templates and slides changes..."
@fswatch -o packages/ | xargs -n1 -I{} make build

run:
@echo "Running the software..."

include .makefiles/*.mk

.PHONY: build init travis-init install dep pre-build post-build all test doc precommit travis clean watch run bump-version create-pr
23 changes: 23 additions & 0 deletions README.md
@@ -0,0 +1,23 @@
# Forge React Starter

A starter project that integrates forge javascript sdk with mainstream javascript application batteries:

- [Next.js] for crafting pages and SSR
- [React] the framework for view layer
- [Material-UI] for resuable react components
- [Express.js] as custom web server that can serve custom api
- [Mongoose] as database ORM layer

Forge SDK libraries included in the starter project:

- [@arcblock/graphql-client] as communication layer between application and forge powered blockchain
- [@arcblock/did-auth-react] react components that can implements basic UI elements to connect your application with ABT Wallet
- [@arcblock/did-auth-storage] storage engines that powers the magic behind ABT Wallet qrcode scanning

## Documentation

TODO:

## LICENSE

TODO:
7 changes: 6 additions & 1 deletion package.json
Expand Up @@ -3,5 +3,10 @@
"version": "1.0.0",
"main": "index.js",
"author": "wangshijun <wangshijun2010@gmail.com>",
"license": "MIT"
"license": "MIT",
"dependencies": {
"next": "^8.1.0",
"react": "^16.8.6",
"react-dom": "^16.8.6"
}
}
1 change: 1 addition & 0 deletions version
@@ -0,0 +1 @@
0.1.0

0 comments on commit 05189e5

Please sign in to comment.