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

@ysfe/sentry-webpack-plugin

v1.3.10

Published

基于@sentry/webpack的特定实现. 做了一些简化配置, 主要提供 vue 项目支持.

Downloads

19

Readme

@ysfe/sentry-webpack-plugin

sentry cli 的 webpack 插件集成.

前置依赖

  1. node >= 8.0.0
  2. 4.x <= webpack < 5.x

开发指引

传送门

使用方式

以下结合 vue 应用场景, 整理使用文档

  1. 安装: 执行 yarn add @ysfe/sentry-webpack-plugin --dev 安装插件

  2. 使用:

    1. vue.config.js 中, 引用插件.
       const { SentryAutocWebpackPlugin } = require('@ysfe/sentry-webpack-plugin')
    
       // 通过 configureWebpack 配置
       module.exports = {
           configureWebpack: {
               plugins: [
                  new SentryAutocWebpackPlugin(),
                  // other plugins ...
               ]
           }
       }
    
       // or 通过 chainWebpack 配置
    
       module.exports = {
          chainWebpack: (config) => {
             // add plugin
             config
                .plugin('SentryAutocPlugin')
                .use(new SentryAutocWebpackPlugin({ /* options ... */ }))
          }
       }
    1. 项目根目录下创建配置文件 .sentryclirc
      1. 内容格式: docs
      2. 宇石内部参考: yuque
      3. 文件参考
       [auth]
       ## sentry用户 auth token.
       token=
       ## project dsn -  可在项目设置或创建项目时查看.
       dsn=
       [defaults]
       ## sentry 服务地址, 如: https://sentry.io
       url=
       ## 注意是用户的org
       org=
       ## project name
       project=
       [log]
       # 日志等级, 一般不管
       level=info
  3. 备注:

    1. 关于环境判断: 默认情况下, 仅在 process.env.NODE_ENV === 'production'  时, 启用插件. 可通过 options.disable  在任意场景下禁用插件.

命令行参数

  1. (1.2.1 新增) 执行编译命令时, 如果命令行增加参数 --tag=[git tag], 则直接采用 git tag 名称作为 sentry 版本号, 且不再提交备份的 git tag.

杂项

插件构造函数参数

/** sentry-autoc 配置 */
export interface SentryAutocPluginOptions {
    /** 禁用 sentry autoc 插件, 默认情况下会主动判断当前的NODE_ENV ==='production' */
    disable?: boolean
    /** 禁用 git tag 备份 */
    disableGitTagBackup?: boolean

    /** sentry cli 配置 */

    /** sentry 项目dsn内容, 必填 */
    dsn: string
    /** sentry 要提交哪些文件, 默认值: './dist'  */
    include?: string | Array<string>

    /** 手工指定版本号 */
    release?: string
    /** sentry 服务地址 */
    url?: string
    /** sentry user auth token */
    authToken?: string
    /** user Organization slug */
    org?: string
    /** sentry project name */
    project?: string
    /** VCS remote name, 作用位置 */
    vcsRemote?: string

    /**
     * Determines whether processed release should be automatically finalized after artifacts upload.
     * Defaults to `true`.
     */
    finalize?: boolean

    /** 手工指定 @sentry/cli 配置文件.
     *
     * @doc https://docs.sentry.io/learn/cli/configuration/#properties-files.
     */
    configFilePath?: string
}

release 生成规则

  1. 当指定命令行参数 --tag=[tag name]时, 直接采用 tag 参数作为 sentry.release 版本号. 且不再提交备份 tag.
  2. 当未指定 --tag 参数,
    1. 存在 git repo 时, 生成 sentry_[month][day][index], 例: sentry_033001. 并推送同名 tag
    2. 不存在 git repo 时, 使用 package.json 中的 version 字段作为版本号. (此时版本号不会自动更新)

[其他说明事项]

版本说明

版本说明

起步版本, 1.1.0 以上版本忽略.

1.3.6

  1. 增加sentry错误捕获忽略项

1.3.4

  1. 移除 process.env.NODE_ENV==='production' 判断, 这里这样加开关会引起误解.

1.3.3

  1. 增加 include 检查, 允许 serve 时, 启用 sentry 上报, 但不发布 source map.

1.3.2

  1. 更新 sentry 插件版本

v1.2.2

  1. 更改 webpack 版本, 生成对 webpack4 的支持.

v1.2.1

  1. 更新 sentry.release 生成规则. 引入命令行参数 --tag

v1.1.2

  1. 重写 @sentry/webpack-plugin, 简化不常用的配置项.
  2. 增加 release 字段自动生成. 但最好使用 git tag 来作为版本标记.
  3. 增加 自定义 git tag 备份.
  4. 主动注入 sentry runtime code, 但是要注意, 这个版本并未做去重处理. 请移除手工引入的 sentry.