diff --git a/README.en.md b/README.en.md
index e97bd41..bfc3384 100644
--- a/README.en.md
+++ b/README.en.md
@@ -1,8 +1,28 @@
# developtools_ace-js2bundle
-#### 介绍
+## Introduction
Provides syntax compilation conversion, syntax validation, rich and friendly syntax error tips.
-#### 安装教程
+## Install Dependencies under the ace-loader dir.
-1. Run `npm install` under `ace-loader` directory.
\ No newline at end of file
+npm install
+
+## Build built-in sample for Rich devices under the ace-loader dir.
+
+npm run rich
+
+## Build built-in sample for Lite devices under the ace-loader dir.
+
+npm run lite
+
+## How to build custom ace project
+
+Windows:
+Step 1. set aceModuleRoot=path/to/your/ace/project
+Step 2. set aceModuleBuild=path/to/your/jsbundle/build
+Step 3. node ./node_modules/webpack/bin/webpack.js --config webpack.rich.config.js
+
+Linux:
+Step 1. export aceModuleRoot=path/to/your/ace/project
+Step 2. export aceModuleBuild=path/to/your/jsbundle/build
+Step 3. node ./node_modules/webpack/bin/webpack.js --config webpack.rich.config.js
\ No newline at end of file
diff --git a/README.md b/README.md
index ae96804..43733b0 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,28 @@
# developtools_ace-js2bundle
-#### 介绍
+## 介绍
提供类Web范式的语法编译转换、语法验证,丰富友好的语法报错提示。
-#### 安装教程
+## Install Dependencies under the ace-loader dir.
-1. 在ace-loader目录下执行`npm install`
+npm install
+
+## Build built-in sample for Rich devices under the ace-loader dir.
+
+npm run rich
+
+## Build built-in sample for Lite devices under the ace-loader dir.
+
+npm run lite
+
+## How to build custom ace project
+
+Windows:
+Step 1. set aceModuleRoot=path/to/your/ace/project
+Step 2. set aceModuleBuild=path/to/your/jsbundle/build
+Step 3. node ./node_modules/webpack/bin/webpack.js --config webpack.rich.config.js
+
+Linux:
+Step 1. export aceModuleRoot=path/to/your/ace/project
+Step 2. export aceModuleBuild=path/to/your/jsbundle/build
+Step 3. node ./node_modules/webpack/bin/webpack.js --config webpack.rich.config.js
diff --git a/ace-loader/plugin/templater/card_component_map.js b/ace-loader/plugin/templater/card_component_map.js
index 436654b..b1357a4 100644
--- a/ace-loader/plugin/templater/card_component_map.js
+++ b/ace-loader/plugin/templater/card_component_map.js
@@ -224,25 +224,34 @@ var cardNativeTag = {
},
'calendar': {
atomic: true,
- events: [
- 'selectedchange',
- 'requestdata'
- ],
+ selfClosing: true,
+ events: ['selectedchange', 'goto', 'requestdata'],
+ uevents: [],
attrs: {
- date: {},
+ date: {
+ checkFunc: 'date',
+ },
+ dateadapter: {},
+ holidays: {},
cardcalendar: {
- def: 'false',
- enum: ['false', 'true'],
- },
- startdayofweek: {
- def: 6,
- },
- offdays: {},
- calendardata: {},
- showholiday: {
def: 'true',
enum: ['true', 'false'],
},
+ type : {
+ def: 'normal',
+ enum: ['normal', 'simple'],
+ },
+ calendardata: {},
+ holidays: {},
+ offdays: {},
+ showholiday: {},
+ showlunar: {},
+ startdayofweek: {},
+ direction: {
+ def: 'horizontal',
+ enum: ['vertical', 'horizontal'],
+ },
+ workdays: {},
},
},
'clock': {
diff --git a/ace-loader/plugin/templater/content.js b/ace-loader/plugin/templater/content.js
index 65c0642..c4e0c32 100644
--- a/ace-loader/plugin/templater/content.js
+++ b/ace-loader/plugin/templater/content.js
@@ -73,7 +73,8 @@ function addPrefix(node, parent) {
parent[attrArr1[i]].includes(node)) {
return true
}
- if('arguments' === attrArr1[i] && parent.arguments[0].type === 'Identifier') {
+ //support cases like
+ if ('arguments' === attrArr1[i] && parent.arguments[0].type === 'Identifier') {
return true
}
}
diff --git a/ace-loader/plugin/templater/lite_component_map.js b/ace-loader/plugin/templater/lite_component_map.js
index fbe8925..5193d54 100644
--- a/ace-loader/plugin/templater/lite_component_map.js
+++ b/ace-loader/plugin/templater/lite_component_map.js
@@ -192,6 +192,38 @@ const litewearableTag = {
},
},
},
+ 'calendar': {
+ atomic: true,
+ selfClosing: true,
+ events: ['selectedchange', 'goto', 'requestdata'],
+ uevents: [],
+ attrs: {
+ date: {
+ checkFunc: 'date',
+ },
+ dateadapter: {},
+ holidays: {},
+ cardcalendar: {
+ def: 'true',
+ enum: ['true', 'false'],
+ },
+ type : {
+ def: 'normal',
+ enum: ['normal', 'simple'],
+ },
+ calendardata: {},
+ holidays: {},
+ offdays: {},
+ showholiday: {},
+ showlunar: {},
+ startdayofweek: {},
+ direction: {
+ def: 'horizontal',
+ enum: ['vertical', 'horizontal'],
+ },
+ workdays: {},
+ },
+ },
'chart': {
atomic: true,
selfClosing: true,
diff --git a/ace-loader/plugin/templater/rich_component_map.js b/ace-loader/plugin/templater/rich_component_map.js
index 4e14ae1..a7dc564 100644
--- a/ace-loader/plugin/templater/rich_component_map.js
+++ b/ace-loader/plugin/templater/rich_component_map.js
@@ -48,6 +48,38 @@ const richNativeTag = {
},
},
},
+ 'calendar': {
+ atomic: true,
+ selfClosing: true,
+ events: ['selectedchange', 'goto', 'requestdata'],
+ uevents: [],
+ attrs: {
+ date: {
+ checkFunc: 'date',
+ },
+ dateadapter: {},
+ holidays: {},
+ cardcalendar: {
+ def: 'true',
+ enum: ['true', 'false'],
+ },
+ type : {
+ def: 'normal',
+ enum: ['normal', 'simple'],
+ },
+ calendardata: {},
+ holidays: {},
+ offdays: {},
+ showholiday: {},
+ showlunar: {},
+ startdayofweek: {},
+ direction: {
+ def: 'horizontal',
+ enum: ['vertical', 'horizontal'],
+ },
+ workdays: {},
+ },
+ },
'text': {
textContent: true,
children: ['a', 'span', 'tspan', 'textpath', 'animate', 'animatetransform'],
@@ -312,21 +344,6 @@ const richNativeTag = {
children: ['option'],
attrs: {},
},
- 'calendar': {
- atomic: true,
- selfClosing: true,
- events: ['selectedchange'],
- uevents: [],
- attrs: {
- date: {
- checkFunc: 'date',
- },
- dateadapter: {},
- startdayofweek: {},
- workdays: {},
- holidays: {},
- },
- },
'chart': {
atomic: true,
selfClosing: true,
@@ -486,6 +503,7 @@ const richNativeTag = {
rotate: {},
transform: {},
fontSize: {},
+ opacity: {},
},
},
'textpath': {
@@ -501,6 +519,7 @@ const richNativeTag = {
fontSize: {},
path: {},
startOffset: {},
+ opacity: {},
},
},
'rect': {
@@ -729,6 +748,7 @@ const richNativeTag = {
attributename: {},
from: {},
to: {},
+ by: {},
values: {},
},
},
@@ -1115,6 +1135,9 @@ const richNativeTag = {
lunar: {
enum: ['false', 'true'],
},
+ vibrate: {
+ enum: ['false', 'true'],
+ },
},
},
'picker-view': {
@@ -1150,6 +1173,9 @@ const richNativeTag = {
lunar: {
enum: ['false', 'true'],
},
+ vibrate: {
+ enum: ['false', 'true'],
+ },
},
},
'qrcode': {
@@ -1544,7 +1570,7 @@ const richNativeTag = {
'xcomponent': {
atomic: true,
selfClosing: true,
- uevents: ['xcomponentinit', 'xcomponentdestroy'],
+ uevents: ['load', 'destroy'],
uattrs: {
name: {},
type: {
diff --git a/ace-loader/sample/DataAbility/data.js b/ace-loader/sample/DataAbility/data.js
deleted file mode 100644
index 13b64e6..0000000
--- a/ace-loader/sample/DataAbility/data.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (c) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default {
- onInitialize(abilityInfo) {
- console.info('DataAbility onInitialize');
- }
-};
\ No newline at end of file
diff --git a/ace-loader/sample/ServiceAbility/service.js b/ace-loader/sample/ServiceAbility/service.js
deleted file mode 100644
index 44aaf64..0000000
--- a/ace-loader/sample/ServiceAbility/service.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default {
- onStart(want) {
- console.info('ServiceAbility onStart');
- },
- onStop() {
- console.info('ServiceAbility onStop');
- },
- onConnect(want) {
- console.info('ServiceAbility onConnect');
- },
- onReconnect(want) {
- console.info('ServiceAbility onReconnect');
- },
- onDisconnect() {
- console.info('ServiceAbility onDisconnect');
- },
- onCommand(want, restart, startId) {
- console.info('ServiceAbility onCommand');
- },
- onRemoteRequest(code, data, reply) {
- console.info('ServiceAbility onRemoteRequest');
- return true;
- }
-};
\ No newline at end of file
diff --git a/ace-loader/src/resource-plugin.js b/ace-loader/src/resource-plugin.js
index fff88f9..3a763e2 100644
--- a/ace-loader/src/resource-plugin.js
+++ b/ace-loader/src/resource-plugin.js
@@ -73,7 +73,7 @@ function mkDir(path_) {
function circularFile(inputPath, outputPath, ext) {
const realPath = path.join(inputPath, ext);
- const localI18n = path.join(input, 'i18n')
+ const localI18n = path.join(input, 'i18n');
if (!fs.existsSync(realPath) || realPath === output || realPath === localI18n) {
return;
}
@@ -131,7 +131,7 @@ class ResourcePlugin {
compiler.hooks.done.tap('copyManifest', () => {
copyManifest();
if (fs.existsSync(path.join(output, 'app.js'))) {
- fs.utimesSync(path.join(output, 'app.js'), new Date(), new Date())
+ fs.utimesSync(path.join(output, 'app.js'), new Date(), new Date());
}
});
}
@@ -157,18 +157,18 @@ function addPageEntryObj() {
}
pages.forEach((element) => {
const sourcePath = element;
- const hmlPath = path.join(input, sourcePath + '.hml')
- const aceSuperVisualPath = process.env.aceSuperVisualPath || ''
- const visualPath = path.join(aceSuperVisualPath, sourcePath + '.visual')
- const isHml = fs.existsSync(hmlPath)
- const isVisual = fs.existsSync(visualPath)
+ const hmlPath = path.join(input, sourcePath + '.hml');
+ const aceSuperVisualPath = process.env.aceSuperVisualPath || '';
+ const visualPath = path.join(aceSuperVisualPath, sourcePath + '.visual');
+ const isHml = fs.existsSync(hmlPath);
+ const isVisual = fs.existsSync(visualPath);
if (isHml && isVisual) {
logWarn(this, [{
- reason: 'ERROR: ' + sourcePath + ' cannot both have hml && visual'
- }])
+ reason: 'ERROR: ' + sourcePath + ' cannot both have hml && visual',
+ }]);
} else if (isHml) {
entryObj['./' + element] = hmlPath + '?entry';
- } else if (isVisual){
+ } else if (isVisual) {
entryObj['./' + element] = visualPath + '?entry';
}
});
@@ -189,7 +189,7 @@ function loadWorker(entryObj) {
const relativePath = path.relative(workerPath, item).replace(/\.js$/, '');
entryObj[`./workers/` + relativePath] = item;
}
- })
+ });
}
}
@@ -204,7 +204,7 @@ function readFile(dir, utFiles) {
} else {
utFiles.push(filePath);
}
- })
+ });
} catch (e) {
console.error(e.message);
}
diff --git a/ace-loader/test/card/expected/exteriorStyle/exteriorStyle.json b/ace-loader/test/card/expected/exteriorStyle/exteriorStyle.json
index d582c25..439ae5d 100644
--- a/ace-loader/test/card/expected/exteriorStyle/exteriorStyle.json
+++ b/ace-loader/test/card/expected/exteriorStyle/exteriorStyle.json
@@ -82,5 +82,6 @@
}
},
"actions": {},
- "data": {}
+ "data": {},
+ "apiVersion": {}
}
\ No newline at end of file
diff --git a/ace-loader/test/card/expected/mediaQuery/mediaQuery.json b/ace-loader/test/card/expected/mediaQuery/mediaQuery.json
index 4d29fef..2a34a11 100644
--- a/ace-loader/test/card/expected/mediaQuery/mediaQuery.json
+++ b/ace-loader/test/card/expected/mediaQuery/mediaQuery.json
@@ -45,5 +45,6 @@
]
},
"actions": {},
- "data": {}
+ "data": {},
+ "apiVersion": {}
}
\ No newline at end of file
diff --git a/ace-loader/test/rich/expected/inlineStyle.js b/ace-loader/test/rich/expected/inlineStyle.js
index 3866ad1..d4679c2 100644
--- a/ace-loader/test/rich/expected/inlineStyle.js
+++ b/ace-loader/test/rich/expected/inlineStyle.js
@@ -270,6 +270,16 @@
"style": {
"backgroundImage": "logo.jpg"
}
+ },
+ {
+ "attr": {
+ "debugLine": "pages/inlineStyle/inlineStyle:72",
+ "value": "This is the index page."
+ },
+ "style": {
+ "width": "function () {return 1===this.count?this.test(this.prop):'300px'}"
+ },
+ "type": "text"
}
]
}
diff --git a/ace-loader/test/rich/testcase/pages/inlineStyle/inlineStyle.hml b/ace-loader/test/rich/testcase/pages/inlineStyle/inlineStyle.hml
index 26b9fe0..add3767 100644
--- a/ace-loader/test/rich/testcase/pages/inlineStyle/inlineStyle.hml
+++ b/ace-loader/test/rich/testcase/pages/inlineStyle/inlineStyle.hml
@@ -67,4 +67,7 @@
style_test23
+
+
+ This is the index page.
\ No newline at end of file