0.1.5 • Published 5 years ago

ide-function-sets v0.1.5

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

概览

ide-function-sets

安装使用

npm 包方式:

npm install --save ide-function-sets

web 方式:

<script src="https://unpkg.com/ide-function-sets@0.1.0/dist/index.umd.js"></script>

引入之后将会暴露全局变量 ideFunctionSets.

如果你想要在 webpack 中 external 该库,可以使用以下配置:

{
    externals: {
        "ide-function-sets": {
            "commonjs": "ide-function-sets",
            "commonjs2": "ide-function-sets",
            "amd": "ide-function-sets",
            "root": "ideFunctionSets"
        }
    }
}

如何本地开发?

本地调试

首先从 git 仓库拉取代码,安装依赖项:

git clone https://github.com/one-gourd/ide-function-sets.git

npm install

## 安装 peerDependencies 依赖包
npm install ide-code-editor@x.x.x ide-lib-utils@0.x ide-lib-base-component@0.x ide-lib-engine@0.x ette@0.x ette-proxy@0.x ette-router@0.x antd@3.x mobx@4.x mobx-react@5.x mobx-react-lite@1.x mobx-state-tree@3.10.x react@16.x styled-components@4.x.x react-dom@16.x

运行以下命令后,访问 demo 地址: http://localhost:9000

npm run dev

也可访问 storybook 参考具体的使用案例:http://localhost:9001/

npm run storybook

P.S. 由于需要依赖 ide-code-editor 仓库比较特别,需要: 1. 将ide-code-editor 仓库下载到本地 2. 本地运行 npm run build 打出其 dist 目录 3. 开启本地服务器的 9005 端口,推荐使用 http-server

http server

运行测试用例

使用 jest 进行测试,执行:

npm test

打包发布

普通的 npm 发布即可,记得发布前需要手动打包:

npm run build && npm publish