MagicScript Components
MagicScript Component Framework
Installation
- Install
magic-script-cli
:
npm install -g magic-script-cli
- Create a new MagicScript application:
magic-script init
- Follow the steps.
- Choose "Components" when application type is requested.
- Install the required
npm
packages from the app folder:
npm install
- Build and install your application:
magic-script build -i
- Refer to the MagicScript Getting Started guide for more information.
Example
Replace app.js
content with this code for a more interactive use case:
;; Component { superprops; thisstate = counter: propscounter ; thisonButtonClick = thisonButtonClick; } { this; } { return <View name="main-view"> <Text textSize=01 textColor=01 1 01 084 localPosition=0 025 0 > thisstatecounter </Text> <Button width=025 height=015 roundness=05 onClick=thisonButtonClick > + </Button> </View> ; }
Documentation
Updating documentation
- Get documentation source code and install dependencies
git clone https://github.com/magic-script/magic-script-components.gitcd magic-script-componentscd websiteyarn
- Make your changes and test them locally
yarn start
- Save your changes
git commit
-
Set system variable GIT_USER with you GitHub user name in e.g.
.bash_profile
or consoleexport GIT_USER=<GitHub user name>
-
Deploy on public website
yarn deploy
- All documentation is in markdown format in
docs
directory. Just add your new markdown files there. - Refer to Docusaurus 2 docs for more advanced content management topics.
License
This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details