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

ysyc_miniprogram

v1.8.5

Published

ysyc_miniprogram core

Downloads

18

Readme

介绍

采用taro小程序框架,react底层框架语法

快速开始

安装

  • pnpm -v 如果不存在 npm i -g pnpm
  • npm i -g @tarojs/[email protected] 全局安装taro
  • pnpm i 安装全部依赖

版本说明

  • 本插件版本 v1.4.0 for taro 3.3.19
  • 本插件版本 v1.5.0 for taro 3.6.2

命令

  • 启动 pnpm dev
  • 打包 pnpm build
  • 预发布 pnpm release

技术栈

图片

  • 服务器图片目录
    public/static/miniprogram/
    服务器图片调用相对 public/static/miniprogram/

尺寸单位

  • 使用大写'PX'或者对应1的rem

计算精度(财务方面)

  • 需求使用插件计算
    import calc from 'calculatorjs'
  • 正常计算和插件计算对比
    > 2.1 + 2.2
    4.300000000000001
    > calc(' 2.1 + 2.2 ')
    4.3
  • 其它示例
      calc(' 1 + (2 * 3 - 1) / 4 * -1 ')
      calc.add(0.1, 0.2) // 0.3
      calc.sub(0.1, 0.2) // -0.1
      calc.mul(0.1, 0.2) // 0.02
      calc.div(0.1, 0.2) // 0.5
      calc.round(0.555, 2) // 0.56

eslint配置

module.exports = {
    extends: ['taro/react', './node_modules/ysyc_miniprogram/eslintrc'],
}

config配置

./config/index改为

const getConfig = require('ysyc_miniprogram/config/getConfig')

module.exports = function(merge) {
  const config = getConfig(merge)
  // console.log('config :>> ', config)
  return merge({}, config,)
}

环境变量

  • 运行命令根目录会自动生成.env.development, 开发者需要使用自己的配置
  • development 开发
  • production 生产,线上
  • release 预发布

常见问题

  • eslint Cannot read property 'range' of null
    • 安装最新版本的@babel/eslint-parser
    • 配置eslintrc.js
      parser: "@babel/eslint-parser",
  • 缺少 tml_0_button
    • pages/index/test中将import { Button } from '@tarojs/components'导入,更新下缓存
  • 报3221225477 package.json加
    "resolutions": {
      "@swc/core": "1.3.42"
    }
  • 删除包报错
    • 清空./node_modules/.cache/webpack缓存
  • tabbar相关
    • custom-tab-bar里只能用cover系列标签cover-view, 不然在页面上如果有canvas,z-index不对
    • cover-view 不支持iconfont
    • custom-tab-bar的图标只能用本地图片,base64不行
    • 图标请放在assets/tabbar目录下,打包时会自动复制到dist/assets/tabbar