Development
Principles
The Javascript SDK wraps the æternity API exposed byNode's Swagger file. It aims to abstract the API, while still providing low-level access to it's endpoints, when necessary.
It uses the following Javascript technologies and principles:
JavaScript the Good Parts (because Crockford is always right)
ES6 modules, using
exportandimportPromises using ES7 async/await syntax, where applicable
Statelessness wherever possible
Loose coupling of modules to enable tree-shaking
Convention over configuration
"Easy things should be easy, and hard things should be possible." source -- Larry Wall
Support for
module access, enabling tree-shaking
direct use in node scripts through bundling
direct use in browser
<script>tags through bundlingbundling through webpack
Requirements
aepp-sdk is transpiled to EcmaScript 5 through WebPack, using Babel and is expected to work in any sufficiently new version of Node.js or modern web browser.
Contributing
Clone the application
Make sure your editor/IDE can read and use the
.editorconfigfileStart hacking (and don't forget to add test for whatever you'll be building).
Documenting
Apart from documenting features and code, there is also documentation automatically generated using TypeDoc for documenting TS files and a script for documenting examples and code partials.
#generate examples and api documentation
npm run docs:examples && npm run docs:apiBuilding
aepp-sdk is built using npm. In order to build a production version, launch the build command.
npm install
npm run buildNote: If you experience errors during the building, you might need to install build tools for your OS.
Windows: Windows Build Tools
npm install -g windows-build-toolsUbuntu / Debian: Build Essential
sudo apt-get update
sudo apt-get install build-essentialMac
Download Xcode from AppStore, then run
xcode-select --installGenerate bundle report
npx webpack --env REPORTTesting
To test, launch the test command. This will run mocha's tests locally.
npm testThis repository also includes a docker-compose file, to allow you to run your own æternity node locally. If you want to do so, from the root of the project:
Run
docker-compose up nodeCongrats! you're now running your own æternity node locally.
The WebPack compilation provides two different build artifacts in dist/, one
for Node.js and one for browsers. When referencing aepp-sdk through any modern
build tooling, it should pick the right one automatically through the entry
points defined in package.json.
Installation / Linking
In order to add a local development version of aepp-sdk to a project, npm link1 can be used.
Releasing
Last updated
Was this helpful?