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

yunzhi

v16.0.0

Published

梦云智开发团队angular开源库。

Downloads

1

Readme

梦云智开发团队angular开源库。

| 名称 | 基本功能 | 适用场景 | | ------ | ------ | ------ | | MockApiInterceptor | 对Http请求进行拦截,返回自定义API数据 | 使用文件统一前后台API、开发组件时抛弃测试桩而用生产环境的服务、避免一些因测试生产数据格式返回不统一造成的问题 | | MockApiTestingInterceptor | 用于单元测试中对http请求拦截、手动控制数据返回时机 | 适用于单元测试 |

更多帮助文档请点击github

安装

npm i @yunzhi/utils npm i @yunzhi/ng-mock-api npm i @yunzhi/ng-router-testing npm i @yunzhi/ng-theme-basic npm i @yunzhi/ng-common

使用文档请参考:MockApiInterceptor

开发步骤

创建新库ng g library my-lib

  1. 进入项目根路径
  2. npm install
  3. 'node mock-api.js' 或 node router-testing.jsnode common.jsnode theme.js
  4. 编写代码,并同步在project/sample中完成相关集成测试。

发布前测试

  1. 进入相关文件夹,执行npm link,比如:cd dist/mock-api && npm link
  2. 建立测试项目,执行npm link xxx,即相当于直接安装了xxx
  3. 进行相关测试
  4. 需要注意的是Angular中默认禁止了这种npm link xxx来直接链接本地库的操作,若要使用测试成功,则需要在angular.json添加如下配置:

in your angular app that depends on your local library, set projects.projectName.architect.build.options.preserveSymlinks with true in angular.json will prevent the angular cli from updating linked local library

projects.projectName.architect.build.options.preserveSymlinks: true

相关设置说明请参考: https://github.com/angular/angular/issues/35586

发布

build项目,比如ng build common.

登录:npm login

然后进入相关文件夹完成发布: cd dist/mock-api && npm publish --access=publiccd dist/router-testing && npm publish --access=public

测试开发中的注意点

mock-api(router-testing).js 监听的还不完美,可能在开发中有一些 BUG。

参考资源

在angular模块中建立子模块