mirror of
https://github.com/openharmony/developtools_ace-js2bundle.git
synced 2026-07-21 06:05:27 -04:00
!77 sync new modifications
Merge pull request !77 from wangchun17/0914LTS
This commit is contained in:
+23
-3
@@ -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.
|
||||
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
|
||||
@@ -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
|
||||
|
||||
@@ -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': {
|
||||
|
||||
@@ -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 <text style="width:{{1 === count? test(prop):'300px'}}"/>
|
||||
if ('arguments' === attrArr1[i] && parent.arguments[0].type === 'Identifier') {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
};
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -82,5 +82,6 @@
|
||||
}
|
||||
},
|
||||
"actions": {},
|
||||
"data": {}
|
||||
"data": {},
|
||||
"apiVersion": {}
|
||||
}
|
||||
@@ -45,5 +45,6 @@
|
||||
]
|
||||
},
|
||||
"actions": {},
|
||||
"data": {}
|
||||
"data": {},
|
||||
"apiVersion": {}
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -67,4 +67,7 @@
|
||||
|
||||
<!-- URL_VALIDATOR_test_2 -->
|
||||
<div style="background-image: url('https://huawei.com/logo.jpg');">style_test23</div>
|
||||
|
||||
<!-- DATA_BINDING_test_2 -->
|
||||
<text style="width:{{1 === count? test(prop):'300px'}}">This is the index page.</text>
|
||||
</div>
|
||||
Reference in New Issue
Block a user