代码拉取完成,页面将自动刷新
同步操作将从 百度开源/amis 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
###
# @description 文件
# @return {*}
###
#!/bin/bash
editorLatestVersion=`npm info @fex/amis-editor --registry=http://registry.npm.baidu-int.com | grep "latest:"`
editroCoreLatestVersion=`npm info @fex/amis-editor-core --registry=http://registry.npm.baidu-int.com | grep "latest:"`
echo "amis-editor最新版本:${editorLatestVersion}"
echo "amis-editor-core最新版本:${editroCoreLatestVersion}"
read -p "请输入amis-editor版本: " version1
read -p "请输入amis-editor-core版本: " version2
sed -i '' -e 's/\"version\": \".*\"/\"version\": \"'${version1}'\"/g' ./packages/amis-editor/package.json
sed -i '' -e 's/\"version\": \".*\"/\"version\": \"'${version2}'\"/g' ./packages/amis-editor-core/package.json
set -e
rm -rf npm
npm run build --workspace=amis-editor --workspace=amis-editor-core
mkdir -p npm/amis-editor
mkdir -p npm/amis-editor-core
cp -rf packages/amis-editor/lib npm/amis-editor
cp -rf packages/amis-editor/esm npm/amis-editor
cp packages/amis-editor/package.json npm/amis-editor
cp -rf packages/amis-editor-core/lib npm/amis-editor-core
cp -rf packages/amis-editor-core/esm npm/amis-editor-core
cp -rf packages/amis-editor-core/static npm/amis-editor-core
cp packages/amis-editor-core/package.json npm/amis-editor-core
cp packages/amis-editor-core/src/locale/* npm/amis-editor-core/lib/locale
cd npm
funTransContent(){
# 把代码里面import的部分换成内部包名称
for f in $(find $1 -type f -name "*.[tj]s"); do
# 正则那个 | 用不了,还不知道为何
#sed -i '' -e "s#\('|\"\)\(amis|amis-formula|amis-core|amis-ui|amis-editor|amis-editor-core\)\('|\"|\/\)#\1@fex\/\2\3#g" $f
sed -i '' -e "s#'\(amis\)\(['\"/]\)#'@fex\/\1\2#g" $f
sed -i '' -e "s#\"\(amis\)\(['\"/]\)#\"@fex\/\1\2#g" $f
sed -i '' -e "s#'\(amis-formula\)\(['\"/]\)#'@fex\/\1\2#g" $f
sed -i '' -e "s#\"\(amis-formula\)\(['\"/]\)#\"@fex\/\1\2#g" $f
sed -i '' -e "s#'\(amis-core\)\(['\"/]\)#'@fex\/\1\2#g" $f
sed -i '' -e "s#\"\(amis-core\)\(['\"/]\)#\"@fex\/\1\2#g" $f
sed -i '' -e "s#'\(amis-ui\)\(['\"/]\)#'@fex\/\1\2#g" $f
sed -i '' -e "s#\"\(amis-ui\)\(['\"/]\)#\"@fex\/\1\2#g" $f
sed -i '' -e "s#'\(amis-editor\)\(['\"/]\)#'@fex\/\1\2#g" $f
sed -i '' -e "s#\"\(amis-editor\)\(['\"/]\)#\"@fex\/\1\2#g" $f
sed -i '' -e "s#'\(amis-editor-core\)\(['\"/]\)#'@fex\/\1\2#g" $f
sed -i '' -e "s#\"\(amis-editor-core\)\(['\"/]\)#\"@fex\/\1\2#g" $f
sed -i '' -e "s#'\(amis-editor-comp\)\(['\"/]\)#'@fex\/\1\2#g" $f
sed -i '' -e "s#\"\(amis-editor-comp\)\(['\"/]\)#\"@fex\/\1\2#g" $f
sed -i '' -e "s#'\(amis-theme-editor\)\(['\"/]\)#'@fex\/\1\2#g" $f
sed -i '' -e "s#\"\(amis-theme-editor\)\(['\"/]\)#\"@fex\/\1\2#g" $f
sed -i '' -e "s#'\(amis-postcss\)\(['\"/]\)#'@fex\/\1\2#g" $f
sed -i '' -e "s#\"\(amis-postcss\)\(['\"/]\)#\"@fex\/\1\2#g" $f
sed -i '' -e "s#'\(amis-theme-editor-helper\)\(['\"/]\)#'@fex\/\1\2#g" $f
sed -i '' -e "s#\"\(amis-theme-editor-helper\)\(['\"/]\)#\"@fex\/\1\2#g" $f
sed -i '' -e "s#'\(i18n-runtime\)\(['\"/]\)#'@fex\/\1\2#g" $f
sed -i '' -e "s#\"\(i18n-runtime\)\(['\"/]\)#\"@fex\/\1\2#g" $f
done
}
echo "处理 amis-editor 包文件内容中……"
funTransContent './amis-editor'
echo "处理 amis-editor-core 包文件内容中……"
funTransContent './amis-editor-core'
echo '处理pacakge.json文件内容'
# package.json 里面把包名称换了
for f in $(find ./ -name "package.json"); do
sed -i '' -e 's/\"name\": \"amis/\"name\": \"@fex\/amis/g' $f
sed -i '' -e 's/\"amis-/\"@fex\/amis-/g' $f
sed -i '' -e 's/\"amis\":/\"@fex\/amis\":/g' $f
sed -i '' -e 's/\"i18n-runtime\":/\"@fex\/i18n-runtime\":/g' $f
done
echo "正在发版……"
cd ./amis-editor-core
npm publish --registry=http://registry.npm.baidu-int.com
cd ../amis-editor
npm publish --registry=http://registry.npm.baidu-int.com
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。