-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathpublish-local.sh
50 lines (35 loc) · 1.13 KB
/
publish-local.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
set -e
echo "$0";
echo "$1";
rm -rf npm
mkdir npm
cp package.json npm
cp amis.config.js npm
cp tsconfig.json npm
# npm run build2esm
cp -rf src npm
cd npm
sed -i '' -e 's/\"name\": \"amis-widget\"/\"name\": \"@fex\/amis-widget\"/g' ./package.json
sed -i '' -e 's/\"amis-editor\":/\"@fex\/amis-editor\":/g' ./package.json
sed -i '' -e 's/\"amis\":/\"@fex\/amis\":/g' ./package.json
sed -i '' -e "s/\'amis-editor\'/\'@fex\/amis-editor\'/g" ./amis.config.js
sed -i '' -e "s/\'amis\'/\'@fex\/amis\'/g" ./amis.config.js
for f in $(find ./src -name "*.ts"); do
sed -i '' -e "s/from \'amis/from \'@fex\/amis/g" $f
sed -i '' -e "s/from \'amis-editor/from \'@fex\/amis-editor/g" $f
done
for f in $(find ./src -name "*.tsx"); do
sed -i '' -e "s/from \'amis/from \'@fex\/amis/g" $f
sed -i '' -e "s/from \'amis-editor/from \'@fex\/amis-editor/g" $f
done
for f in $(find ./src -name "*.jsx"); do
sed -i '' -e "s/from \'amis/from \'@fex\/amis/g" $f
sed -i '' -e "s/from \'amis-editor/from \'@fex\/amis-editor/g" $f
done
npm i
amis build2lib
amis build2esm
npm publish --registry=http://registry.npm.baidu-int.com
cd ..
# rm -rf npm