1# JSFramework 2 3**The JSFramework is a framework for building mobile cross-platform UI written in TypeScript.** 4 5## File Structure 6- `runtime/`:all source code 7 - `./main/`:JS bundle parsing, data methods, event methods, reactivity, etc. 8 - `./preparation/`:JS framework initialization 9 - `./utils/`:some utils 10 - `./vdom/`:VM compilation 11- `test/ut/`:unit test file 12- `.eslintrc`:eslint configure 13- `BUILD.gn`:compiling file of JS UI framework for NinjaJS 14- `build_jsmock_system_plugin.js, build_strip_native_min.js`: build JS framework 15- `js_framework_build.sh`:script file for JS framework building 16- `LICENSE`:Apache License 17- `NOTICE`:third party open source software notice 18- `package.json`:define what libraries will be installed into node_modules when you run `npm install` 19- `tsconfig.json`:the compiler options required to compile the project 20 21## Usage 22 23Here are simplified instructions to how to get started. The following commands are the same both on **Windows** and **Mac** platforms. 24 25### 1. Prerequisites 26 27Please make sure that the following commands work before trying to build: 28 29``` 30> npm -v 31 6.14.8 32> node -v 33 v12.18.3 34``` 35Your `npm` and `node` should be of a later version. You can upgrade them to the **latest stable version**. 36### 2. Installing 37 38RollUp tool for packaging has been configured in `build_jsmock_system_plugin.js, build_strip_native_min.js`. So after the preceding conditions are met, we can start installing right now. 39 40First, we go to the root directory of the project: 41``` 42cd .. 43cd third_party/jsframework/ 44``` 45And then install the dependencies: 46``` 47npm install 48``` 49**Note**: If some errors occur, delete the generated package `node_modules ` and run `npm install` again. 50 51### 3. Building 52 53There are two ways for building JS framework: 54``` 551. npm run build 562. in the root dir: run the build.sh script, which is built by gn 57``` 58 59## ESLint 60 61You can config more babel and ESLint plugins in `.eslintrc`. **You'd better make sure there are no errors of esLint rules after you change them.** 62