npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tuia/log-hub

v0.1.8

Published

推啊埋点sdk

Downloads

48

Readme

推啊埋点 SDK

推啊前端埋点方案

npm 主页地址

开发

如果已经打包过就直接运行如下命令,开启监听,文件改动会同步打包到 lib 下

yarn watch
# Or 
npm run watch

src/index.ts 是入口文件,方法挂载 更改文件之后,在本地调试的时候运行如下命令,把包链接到本地

yarn link
# Or 
npm link

出现如下提示

You can now run yarn link "@tuia/log-sdk" in the projects where you want to use this package and it will be used instead.

然后在需要调试的项目中(其他使用这个包的项目)yarn link "@tuia/log-sdk" 把本地的包链接到改项目进行调试

打包

打包生产环境sdk (压缩后)

yarn build
# Or 
npm run build

打包开发环境 (压缩前)方便调试

yarn dev
# Or 
npm run dev

发布前准备工作

  1. 首先确保已经登录 npm 账号并且拥有发布权限
  2. 生成版本号、打tag和生成更改日志,其他用法详情见standard-version
  1. 指定版本号,如0.1.0-beta
yarn release -- --release-as <版本号>
# Or 
npm run release -- --release-as <版本号>
  1. 不指定版本号,直接自动累加
yarn release
# Or 
npm run release

成功之后把 tag 推到远程

git push --follow-tags origin master

发布到 npm 和 cdn (谨慎)

发布说明(⚠️)

  1. 🚀 统一在 master 发布!!!
  2. ✅ 发布前检查,打包发布前必须要有 master 分支的最新内容!!!

发布三步:分布命令

  1. 发布版本前 npm run release 会自动累加版本号 + 打 tag + 生成更改日志,不想累加想自定义版本号则 npm run release -- --release-as <版本号>
  2. 然后 npm run build && npm publish --access public 发布 npm 和 npm run pub 发布cdn
  3. 最后把本地tag推到远程 eg: git push --follow-tags

组合命令:直接 npm run deploy 发布,结合了上述所有命令

🚨 注意:请勿用 yarn deploy 代替 npm run deploy,必须要用npm,因为包含npm的登陆发布操作

注意事项

如果直接使用 npm publish --access public 命令发布的话,发布之前要保证根目录下的 lib 包是最新的,版本号是最新的(之前没有已经发布的版本),所有代码都提交到远程 master 在发布npm版本之后,要执行 npm run pub同步最新的版本到 cdn 以便用来script标签引入来使用

TODO

  • [x] elint+prettier+commit 规范代码开发&提交
  • [x] standard-version 生成版本号、打tag和生成更改日志
  • [x] 支持模块化方式导入和script标签方式使用
  • [x] 打包前检查是否有master最新代码
  • [x] 发布成功之后通知到钉钉群@所有人

SDK 使用

推啊埋点SDK使用文档