271d819a29
Update nodejs to 14.21.1 Issue:https://gitee.com/openharmony/build/issues/I6TECN Test:build Signed-off-by: lubinglun <lubinglun@huawei.com> Change-Id: I03c35300650072798ee5468d493b763dbb15aedb replace nodejs dir to current Change-Id: I1e3b3c4920d23a6c7c1a2ad0555a202db3e86346 |
||
---|---|---|
runtime | ||
test | ||
.babelrc | ||
.eslintrc | ||
.gitattributes | ||
.gitignore | ||
build_strip_native_min.js | ||
BUILD.gn | ||
bundle.json | ||
gen_snapshot.sh | ||
js_framework_build.sh | ||
LICENSE | ||
NOTICE | ||
OAT.xml | ||
package-lock.json | ||
package.json | ||
prebuild_env.sh | ||
README.md | ||
README.OpenSource | ||
tsconfig.json | ||
tslint.json |
JSFramework
The JSFramework is a framework for building mobile cross-platform UI written in TypeScript.
File Structure
runtime/
:all source code./main/
:JS bundle parsing, data methods, event methods, reactivity, etc../preparation/
:JS framework initialization./utils/
:some utils./vdom/
:VM compilation
test/ut/
:unit test file.eslintrc
:eslint configureBUILD.gn
:compiling file of JS UI framework for NinjaJSbuild_jsmock_system_plugin.js, build_strip_native_min.js
: build JS frameworkjs_framework_build.sh
:script file for JS framework buildingLICENSE
:Apache LicenseNOTICE
:third party open source software noticepackage.json
:define what libraries will be installed into node_modules when you runnpm install
tsconfig.json
:the compiler options required to compile the project
Usage
Here are simplified instructions to how to get started. The following commands are the same both on Windows and Mac platforms.
1. Prerequisites
Please make sure that the following commands work before trying to build:
> npm -v
6.14.8
> node -v
v12.18.3
Your npm
and node
should be of a later version. You can upgrade them to the latest stable version.
2. Installing
RollUp 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.
First, we go to the root directory of the project:
cd ..
cd third_party/jsframework/
And then install the dependencies:
npm install
Note: If some errors occur, delete the generated package node_modules
and run npm install
again.
3. Building
There are two ways for building JS framework:
1. npm run build
2. in the root dir: run the build.sh script, which is built by gn
ESLint
You 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.