Documentation of Vuejs compnents
Documentation of vue components can be done with
September 9, 2018
Documentation of vue components can be done with
September 8, 2018
This contains the current status of my repo
Probably will end up using https://www.npmjs.com/package/vue-chartjs for charts (who owns the tokens) and https://www.npmjs.com/package/vee-validate to verify inputs and I will use vuetifyjs partly to experiment with a new ui framework and become more familar with front-end development in addition to copying the "login-form lol".
Used
A truffle box
to serve as the foundation of any Truffle
and Vue.js
dApp. Comes with Vue.js
, vue-router
, Vuex
and sass-loader
. A minimalist user authentication smart contract is also provided.
This truffle box is crafted to enforce a clean directory structure.
/
|
+-- build/
| |
| +-- contracts/
| | |
| | + truffle compiled contracts
|
+-- config/
| |
| +-- babel/
| | |
| | + babel config files - to come (babel does not allow to specify a custom config file path - yet - so the babel configuration occurs in the package.json file for now)
| |
| +-- eslint/
| | |
| | + estlint config files
| |
| +-- postcss/
| | |
| | + postcss config files
| |
| +-- vue-loader
| | |
| | + vue-loader config files
| |
| +-- webpack/
| | |
| | + webpack config files
|
+-- contracts/
| |
| + solidity contracts
|
+-- migrations/
| |
| + truffle migrations files
|
+-- scripts/
| |
| + webpack scripts
|
+-- src/
| |
| + vue.js dapp files
|
+-- static/
| |
| + vue.js dapp static files
|
+-- test/
| |
| +-- e2e/
| | |
| | + e2e test files
| |
| +-- truffle/
| | |
| | + truffle test files
| |
| +-- unit/
| | |
| | + unit test files
Install Truffle and an Ethereum client - like EthereumJS TestRPC.
npm install -g truffle // Version 3.0.5+ required.
npm install -g ganache0cli
Download this repo
Launch testrpc
.
testrpc <options>
Compile and migrate the contracts.
truffle compile
truffle migrate
Run the webpack server for front-end hot reloading. Smart contract changes do not support hot reloading for now.
npm run start
This box comes with everything bundled for unit
, e2e
and truffle
contracts testing.
unit
and e2e
tests.
npm run test/dapp
truffle
contracts tests.
npm run test/truffle
and you can run the tests by using
truffle test --network development test/truffle/TestUsers.sol test/truffle/user.js
Alternatively you can directly run unit
, e2e
and truffle
contracts tests in one command.
npm run test
To build the application for production, use the build command. A production build will be compiled in the dist
folder.
npm run build
Viewing the docs can be build using the npm package http-server, because I'm using the plant-uml plugin, files must be built and then viewed.
http-server ./build -i
August 25, 2018
This blog post will test file name parsing issues when periods are present.
Test goes here.
October 24, 2017
Previously, I had used a ad-hoc method of documentation.js and jsdoc to generate documentation for this project. Icons are from free website all-free-download and I assume since I am doing open source projects, I can use it for free.
Using vuedoc is superior for a number of reasons, including documentating vue components, etc ...
#!/bin/bash
path=docs/components
mkdir -p $path
vuedoc.md src/components/* --output $path
echo "Done writing vue components with vuedoc."
echo "----------------------"
cd $path
for filename in *.md; do
echo "Working on $filename"
name=$(echo "$filename" | cut -f 1 -d '.')
echo "$name"
echo "Using file $filename"
echo "----------------------"
baseFileName=$(basename $filename)
echo "Adding docusarus headers"
echo "----------------------"
sed -i '1s/^/---\n/' "$name.md"
sed -i '1s/^/title: ${TitleReplace} \n/' "$name.md"
sed -i '1s/^/id: ${nameNone} \n/' "$name.md"
sed -i '1s/^/---\n/' "$name.md"
# Replace the garbage with Actually content
sed -i -e 's/${TitleReplace}/'${name}'/g' "$name.md"
sed -i -e 's/${nameNone}/'${baseFileName}'/g' "$name.md"
done