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

@tuya-sat/create-micro-app

v0.0.51

Published

micro-app cli

Downloads

29

Readme

关于 Create-Mirco-App

create-micro-app 是一款通过命令行快速生成微应用模板工具

  • 支持生成 react、react-ts、vue、vue-ts 相对应的模板
  • 包含布局权限、国际化、组件使用、mock 数据,图片引用等常用功能
  • 开箱即用 运行yarn start就可以直接快速预览微应用 Demo
  • 支持本地代理,yarn start:proxy就可以代理到域名,运行 SaaS 服务
  • 基于 webpack 打包,并可在其中添加个性化配置

关于微应用

  • 微应用是 SaaS 开发框架引入的一个概念, 是 SaaS 应用的业务组件
  • 详细介绍请看这里

快速开始

安装准备

NodeJs 要求最低版本为v14.0.0

模板命令

默认生成 react 模板

npx @tuya-sat/create-micro-app@latest app

生成 react-ts 模板

npx @tuya-sat/create-micro-app@latest app -t react-ts

生成 vue 模板

npx @tuya-sat/create-micro-app@latest app -t vue

生成 vue-ts 模板

npx @tuya-sat/create-micro-app@latest app -t vue-ts

生成主应用模板

npx @tuya-sat/create-micro-app@latest app -t main

命令

本地开发

配置 mock 数据

| 字段 | 类型 | 备注 | | ---- | ------- | ------------------------- | | mock | boolean | 控制整体接口是否开启 mock | | api | Api[] | 存放所有的 mock 接口 |

Api

| 字段 | 类型 | 备注 | | --- | --- | --- | | path | string | 请求路径 | | method | HTTP request methods | http 的请求方式 | | res | Object | 返回参数,此处数据结构为开发者自己定义,请求对应接口就返回 res 内所有内容 | | mock | boolean | 控制此接口是否开启 mock |

启动项目

yarn start

本地代理 需要配置micro.config.js

yarn statr:proxy
本地代理配置
/** @typedef {import("@tuya-sat/micro-dev-proxy").Config} DebuggerConfig */
/** @typedef {import("@tuya-sat/micro-script/dist/config/webpack.config").WebpackCombineFunction} WebpackCombineFunction */

module.exports = {
  /**@type {DebuggerConfig} */
  debuggerConfig: {
    target: 'xxx', // 需要代理的协议+host
    username: 'xxxx', // 对应域名的超级管理员账户名
    password: 'xxx', //  超级管理员密码
    logSign: true, // 打印请求头
  },
  /**@type {WebpackCombineFunction} */
  webpack(config, { isDev, isBuild }) {
    config.output.publicPath = isDev ? '/' : '.';
    return config;
  },
};

微应用打包

yarn build

扩展命令

| 命令 | 简写 | 类型 | 默认值 | 含义 | | --- | --- | --- | --- | --- | | --run | -r | boolean|'norun' | false | 值为 norun 时,不安装依赖。值为 true 时,不显示依赖安装过程 | | --dir | -d | boolean | false | 值为 true 时,在当前目录安装 | | --yes | -y | boolean | false | 值为 true 时,使用默认配置安装 |

联系我们

欢迎在https://github.com/tuya-sat/discuss/issues向我们提交反馈

资源工具

License

MIT