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

soraka

v0.0.1

Published

Soraka is a React packaging tool for dcloud.

Downloads

10

Readme

soraka

soraka 在英雄联盟里面一名强大的持续补血奶妈型辅助,和这个工具的定位一样,是一个强大的 React 开发流程打包工具。

Features

  • 🎲 在无配置下开箱即用
  • 🎮 支持 JSON 和 JS 模块配置文件
  • 🥇 支持 ES6 以及 TypeScript,同时支持 postcss / less / sass / stylus
  • ⛑ 覆盖前端项目初始化、本地调试、编译完整流程
  • 👾 符合 CDC 团队内前端开发规范

Coming Soon Features

  • 🚀 mock 数据
  • 🎡 jest 测试支持
  • 🚧 ESLint & TSLint 支持

Getting Started

## 全局安装 soraka
$ npm i soraka -g

## 查看当前版本号
$ soraka -v

## 初始化项目文件夹
$ soraka init

## 本地开发环境调试
$ soraka serve

## 编译最终文件
$ soraka build

Configuration

soraka 支持 JSON 和 JS 两种配置方式,用户可以根据需要选择适合自己项目的配置方式。使用 JSON 配置方式则在根目录下创建 .sorakarc 配置文件,使用 JS 配置方式则在根目录下创建 .sorakarc.js 配置文件。

.sorakarc

{
  "entry": "./app.js",
  "proxy": {
    "/api": {
      "target": "http://example.com/",
      "changeOrigin": true,
      "pathRewrite": { "^/api": "/projectA/api" }
    }
  },
  "env": {
    "development": {
      "define": {
        "__PUBLIC_PATH__": "/"
      }
    }
  }
}

.sorakarc.js

module.exports = {
  entry: "./app.js",
  proxy: {
    "/api": {
      target: "http://example.com/",
      changeOrigin: true,
      pathRewrite: { "^/api": "/projectA/api" }
    }
  },
  env: {
    development: {
      define: {
        "__PUBLIC_PATH__": "/"
      }
    }
  }
}

port

本地开发环境的端口,默认端口为 10086

autoOpenBrowser

顾名思义,这个选项控制在启动本地开发环境之后是否打开调试地址。

entry

指定 webpack 的入口文件,路径相对于 path/src,支持多个入口文件。

"entry": "./app.js"

proxy

使用 http-proxy-middleware 配置本地开发环境的代理,可以代理线上的接口。

"proxy": {
  "/api": {
    "target": "http://example.com/",
    "changeOrigin": true,
    "pathRewrite": { "^/api": "/projectA/api" }
  }
}

此时访问本地 /api 会将请求代理到 http://example.com/projectA/api

define

通过 webpack 的 DefinePlugin 传递给代码,值会自动做 JSON.stringify 处理。 比如:

"define": {
  "__PUBLIC_PATH__": "/path"
}

alias

配置 webpack 的 resolve.alias 属性。

externals

配置 webpack 的 externals 属性。

html

配置 htmlWebpackPlugin 插件的参数,以下为默认参数配置:

{
  "filename": "index.html",
  "template": "path/src/index.html",
  "inject": true
}

env

根据不同的环境使用不同的配置,soraka serve 会使用 config.env.development 的配置覆盖 config 的配置,soraka build 则会使用 config.env.production