!689 adapt to css-what update

Merge pull request !689 from LiWenzhen/adaptcsswhat
This commit is contained in:
openharmony_ci
2022-09-26 12:19:38 +00:00
committed by Gitee
6 changed files with 4077 additions and 26 deletions
+2
View File
@@ -66,6 +66,7 @@ action("gen_snapshot") {
eslint = "//third_party/jsframework/.eslintrc"
babel = "//third_party/jsframework/.babelrc"
test_file = "//third_party/jsframework/test"
css_what = "//third_party/css-what"
args = [
rebase_path(buildfile_jsmock, root_build_dir),
@@ -81,6 +82,7 @@ action("gen_snapshot") {
is_mac,
rebase_path("//prebuilts", root_build_dir),
rebase_path(buildfile_native_min, root_build_dir),
rebase_path(css_what, root_build_dir),
]
inputs = [
+7 -1
View File
@@ -18,8 +18,14 @@ prebuilts_path=${12}
# copy dependency file to generate dir of gn
# the params come from .gn
# copy runtime to target out, and runtime/css-what is solt link, copy it always follow symbolic links in SOURCE
if [ "${11}" == 'true' ];then
cp -R -L $3 $9
else
cp -r -L $3 $9
fi
# $2 => node $4 => node_modules
cp -r $3 $9
cp -f $5 $9
if [ -d "$prebuilts_path" ]; then
+4054 -16
View File
File diff suppressed because it is too large Load Diff
+10 -6
View File
@@ -16,19 +16,13 @@
"css",
"mvvm"
],
"dependencies": {
"css-what": "2.1.3"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.8.2",
"@typescript-eslint/parser": "^4.8.2",
"babel-core": "^6.26.3",
"babel-loader": "^6.4.1",
"babel-plugin-external-helpers": "^6.22.0",
"babel-preset-env": "^1.7.0",
"babel-runtime": "^6.26.0",
"chai": "^4.2.0",
"eslint": "^7.14.0",
"mocha": "^8.2.1",
"rollup": "^2.32.1",
"rollup-plugin-babel": "^3.0.7",
@@ -42,6 +36,16 @@
"sinon": "^9.2.2",
"ts-node": "^9.0.0",
"tslib": "^2.0.3",
"@types/jest": "^27.4.1",
"@types/node": "^17.0.23",
"@typescript-eslint/eslint-plugin": "^4.8.2",
"@typescript-eslint/parser": "^4.8.2",
"eslint": "^7.14.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-node": "^11.1.0",
"jest": "^27.5.1",
"prettier": "^2.6.1",
"ts-jest": "^27.1.4",
"typescript": "4.1.3"
}
}
+1
View File
@@ -0,0 +1 @@
../../css-what/
+3 -3
View File
@@ -19,7 +19,7 @@
import { Log } from '../../utils/index';
import { watch } from './directive';
import cssWhat from 'css-what';
import { parse, Selector } from '../../css-what/src/index';
import Element from '../../vdom/Element';
import Vm from './index';
import { cssType } from './vmOptions';
@@ -318,8 +318,8 @@ function addMetaToStyle(classObject: cssType): cssType {
key !== '@FONT-FACE' &&
key !== '@TRANSITION'
) {
const meta: { ruleDef?: string[] } = {};
const keys = cssWhat(key);
const meta: { ruleDef?: Selector[] } = {};
const keys = parse(key);
meta.ruleDef = keys[0];
if (meta.ruleDef && meta.ruleDef.length >= 3) {
classList[key]['_meta'] = meta;