Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
IPC-footer
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Allen Bai
IPC-footer
Commits
67bdb687
Commit
67bdb687
authored
Feb 02, 2021
by
Allen Bai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加readme
parent
e6c45255
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
78 deletions
+17
-78
README.md
README.md
+13
-51
build.js
build.js
+0
-23
h5_customize.html
example/inHTML/h5_customize.html
+2
-2
h5_online.html
example/inHTML/h5_online.html
+2
-2
No files found.
README.md
View file @
67bdb687
<!-- @format -->
# 页脚自动添加备案号
# 页脚自动添加备案号
[
技术方案
](
https://www.yuque.com/tuia/rzutr6/lckv1f
)
[
技术方案
](
https://www.yuque.com/tuia/rzutr6/lckv1f
)
## 使用
方法一:在html底部插入这段脚本,注意根据项目修改配置
`IPCFooterConfig`
```
html
<script>
(
function
(
e
){
var
IPCFooterConfig
=
{
dom
:
".detail-main"
,
footerStyles
:{
position
:
"static"
,
margin
:
"8px 0 60px 0"
}};
function
loadScript
(){
var
r
=
document
.
createElement
(
"script"
);(
r
.
async
=!
0
),(
r
.
src
=
"//yun.tuisnake.com/ipc-footer-sdk/ipc-footer-sdk.js"
),(
r
.
crossOrigin
=
"anonymous"
),(
r
.
onload
=
function
(){
window
.
__TUIA_IPC_HELPER__
&&
window
.
__TUIA_IPC_HELPER__
.
mountIPCFooter
(
IPCFooterConfig
)}),
document
.
body
&&
document
.
body
.
appendChild
(
r
)}
loadScript
()})(
window
);
</script>
```
方法二:通过npm包引入
不好意思,暂不支持
## 开发
## 开发
```
shell
```
shell
...
@@ -34,53 +45,4 @@ npm run build
...
@@ -34,53 +45,4 @@ npm run build
### 发布到 npm
### 发布到 npm
## 发布前准备工作
不好意思,暂不支持
\ No newline at end of file
1.
首先确保已经登录 npm 账号并且拥有发布权限
2.
生成版本号、打 tag 和生成更改日志,其他用法详情见
[
standard-version
](
https://github.com/conventional-changelog/standard-version
)
1) 指定版本号,如 0.1.0-beta
```
yarn release -- --release-as <版本号>
# Or
npm run release -- --release-as <版本号>
```
2.
不指定版本号,直接自动累加
```
yarn release
# Or
npm run release
```
成功之后把 tag 推到远程
```
git push --follow-tags origin master
```
## 发布到 npm (谨慎)
```
yarn deploy
or
npm run deploy
```
## 注意事项
如果直接使用
`npm publish --access public`
命令发布的话,发布之前要保证根目录下的 dist 包是最新的,版本号是最新的(之前没有已经发布的版本),所有代码都提交到远程 master
在发布 npm 版本之后,要执行
`npm run pub`
同步最新的版本到 cdn 以便用来 script 标签引入来使用
`yarn release`
和
`yarn deploy`
是这一系列的组合命令
## TODO
-
[
x
]
elint+prettier+commit 规范代码开发&提交
-
[
x
]
standard-version 生成版本号、打 tag 和生成更改日志
-
[
x
]
支持模块化方式导入和 script 标签方式使用
## SDK 使用
[
推啊埋点 SDK 使用文档
](
https://www.yuque.com/docs/share/444fe742-1624-4298-937d-af8f9a14043d
)
build.js
deleted
100644 → 0
View file @
e6c45255
/** @format */
/**
* 打包发布到npm的时候同步一份该版本到cdn上以便script方式引入 版本得放路径管理不能放文件后缀
*/
const
chalk
=
require
(
'chalk'
)
const
path
=
require
(
'path'
)
const
TuiaAutoUpload
=
require
(
'tuia-auto-upload'
)
const
pkg
=
require
(
'./package.json'
)
const
publicPath
=
`//yun.tuisnake.com/tuia/
${
pkg
.
name
}
/
${
pkg
.
version
}
/dist/`
const
deploy
=
async
()
=>
{
console
.
log
(
chalk
.
cyan
(
'dist文件 开始上传>>>>>>>>>>
\
n'
))
const
uploader
=
await
new
TuiaAutoUpload
({
dir
:
path
.
join
(
__dirname
,
`./dist/`
),
originDir
:
`/tuia/
${
pkg
.
name
}
/
${
pkg
.
version
}
/dist/`
})
await
uploader
.
start
()
console
.
log
(
chalk
.
cyan
(
`入口文件cdn地址为:\n
${
publicPath
}
logHub.main.js`
))
}
deploy
()
example/inHTML/h5_customize.html
View file @
67bdb687
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
position
:
'static'
,
position
:
'static'
,
margin
:
'8px 0 60px 0'
margin
:
'8px 0 60px 0'
}
}
}
}
;
function
loadScript
()
{
function
loadScript
()
{
var
r
=
document
.
createElement
(
"script"
);
var
r
=
document
.
createElement
(
"script"
);
(
r
.
async
=
!
0
),
(
r
.
async
=
!
0
),
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
}),
}),
document
.
body
&&
document
.
body
.
appendChild
(
r
);
document
.
body
&&
document
.
body
.
appendChild
(
r
);
};
};
loadScript
()
loadScript
()
;
})(
window
);
})(
window
);
</script>
</script>
</body>
</body>
...
...
example/inHTML/h5_online.html
View file @
67bdb687
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
<div
style=
"height: 200vh;border:5px slateblue solid"
></div>
<div
style=
"height: 200vh;border:5px slateblue solid"
></div>
<script>
<script>
(
function
(
e
)
{
(
function
(
e
)
{
const
IPCFooterConfig
=
{}
const
IPCFooterConfig
=
{}
;
function
loadScript
()
{
function
loadScript
()
{
var
r
=
document
.
createElement
(
"script"
);
var
r
=
document
.
createElement
(
"script"
);
(
r
.
async
=
!
0
),
(
r
.
async
=
!
0
),
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
}),
}),
document
.
body
&&
document
.
body
.
appendChild
(
r
);
document
.
body
&&
document
.
body
.
appendChild
(
r
);
};
};
loadScript
()
loadScript
()
;
})(
window
);
})(
window
);
</script>
</script>
</body>
</body>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment