Skip to content

Commit

Permalink
Feat umi 4 3 11
Browse files Browse the repository at this point in the history
Feat umi 4 3 11
  • Loading branch information
xiaohuoni authored Aug 2, 2024
2 parents ee985f3 + ae9f6e7 commit 928cc5f
Show file tree
Hide file tree
Showing 12 changed files with 209 additions and 173 deletions.
11 changes: 11 additions & 0 deletions .changeset/lucky-lobsters-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@alita/plugin-lowcode': patch
'create-alita': patch
'@alita/plugin-azure': patch
'@alita/autoimport': patch
'@alita/plugins': patch
'@alita/native': patch
'alita': patch
---

feat: upload mako
5 changes: 5 additions & 0 deletions .changeset/thin-turkeys-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@alita/plugins': patch
---

feat: support mako px2rem
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
"@types/react-dom": "^18.0.5",
"@types/resolve": "^1.20.2",
"@types/rimraf": "3.0.2",
"@umijs/plugin-docs": "4.3.10",
"@umijs/utils": "4.3.10",
"@umijs/plugin-docs": "4.3.11",
"@umijs/utils": "4.3.11",
"@vercel/ncc": "0.33.3",
"start-server-and-test": "^1.15.3",
"all-contributors-cli": "^6.20.4",
Expand Down Expand Up @@ -82,7 +82,7 @@
"turbo": "^1.3.1",
"typescript": "^4.7.2",
"uglify-js": "^3.15.4",
"umi": "4.3.10",
"umi": "4.3.11",
"umi-scripts": "workspace:*",
"yorkie": "^2.0.0",
"zx": "^7.2.0",
Expand Down
12 changes: 6 additions & 6 deletions packages/alita/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
"@alita/native": "3.4.1",
"@alita/plugins": "3.5.2",
"@alita/plugin-azure": "3.2.1",
"@umijs/core": "4.3.10",
"@umijs/bundler-webpack": "4.3.10",
"@umijs/babel-preset-umi": "4.3.10",
"@umijs/preset-umi": "4.3.10",
"@umijs/utils": "4.3.10",
"umi": "4.3.10"
"@umijs/core": "4.3.11",
"@umijs/bundler-webpack": "4.3.11",
"@umijs/babel-preset-umi": "4.3.11",
"@umijs/preset-umi": "4.3.11",
"@umijs/utils": "4.3.11",
"umi": "4.3.11"
}
}
4 changes: 2 additions & 2 deletions packages/autoimport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"access": "public"
},
"dependencies": {
"@umijs/bundler-utils": "4.3.10",
"@umijs/utils": "4.3.10"
"@umijs/bundler-utils": "4.3.11",
"@umijs/utils": "4.3.11"
}
}
2 changes: 1 addition & 1 deletion packages/create-alita/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
"create-alita": "bin/create-alita.js"
},
"dependencies": {
"@umijs/utils": "4.3.10"
"@umijs/utils": "4.3.11"
}
}
2 changes: 1 addition & 1 deletion packages/native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"dependencies": {
"@alita/types": "3.1.2",
"@umijs/utils": "4.3.10"
"@umijs/utils": "4.3.11"
},
"license": "MIT"
}
2 changes: 1 addition & 1 deletion packages/plugin-azure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"access": "public"
},
"dependencies": {
"@umijs/utils": "4.3.10",
"@umijs/utils": "4.3.11",
"openai": "^4.19.1"
}
}
2 changes: 1 addition & 1 deletion packages/plugin-lowcode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
},
"dependencies": {
"@alita/types": "3.1.2",
"@umijs/utils": "4.3.10"
"@umijs/utils": "4.3.11"
}
}
6 changes: 3 additions & 3 deletions packages/plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"@alita/inspx": "0.0.2",
"@alita/request": "3.1.2",
"@alita/types": "3.1.2",
"@umijs/bundler-utils": "4.3.10",
"@umijs/plugins": "4.3.10",
"@umijs/utils": "4.3.10",
"@umijs/bundler-utils": "4.3.11",
"@umijs/plugins": "4.3.11",
"@umijs/utils": "4.3.11",
"ahooks": "^3.0.8",
"antd-mobile-alita": "^2.3.4",
"antd-mobile-icons": "^0.2.2",
Expand Down
22 changes: 21 additions & 1 deletion packages/plugins/src/hd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,33 @@ export default (api: AlitaApi) => {
...(configPx2rem || {}),
};
draftConfig.mako = mako;
const hasMagicChars = (pattern: string) => {
return (
pattern.includes('*') ||
pattern.includes('\\') ||
pattern.includes('(') ||
pattern.includes(')') ||
pattern.includes('^') ||
pattern.includes('$')
);
};
draftConfig.mako.px2rem = {
...px2remConfig,
// 将正则转成字符串
selectorDoubleList: px2remConfig.selectorDoubleRemList.map(
(i: string) => `${i}`.replaceAll('/', ''),
(i: string) => {
if (!i.includes('/')) return i;
const reStr = `${i}`.replaceAll('/', '');
if (hasMagicChars(reStr)) {
return reStr;
}
// FIXME: 更新 mako 的时候,需要修改这里,如果那边有修改配置,则要做出对应变动
// https://github.com/umijs/mako/blob/246ffd3440ec2705a1277c64fc0f554d68f0fe83/crates/mako/src/visitors/css_px2rem.rs#L152
return `(${reStr})`;
},
),
};
delete draftConfig.mako.px2rem.selectorDoubleRemList;
}

return draftConfig;
Expand Down
Loading

0 comments on commit 928cc5f

Please sign in to comment.