@7scientists/7s 中文文档教程
7scientists - React UI Toolkit
这个存储库包含我们在所有应用程序中使用的可重用 UI 组件和助手 我们的 React/Electron 应用程序。 可以使用 npm
安装此包。
Installation
只需使用 NPM 安装包:
npm install --save git+ssh://git@gitlab.com:7scientists/7s-ui.git
或者,您可以克隆 git 存储库并手动对其进行符号链接 到 node_modules
目录中的 7s
子目录,这更 更改工具包时很方便:
git clone git@gitlab.com:7scientists/7s-ui.git
ln -s [location-of-7s-ui] node_modules/7s
Usage
所有 JS/JSX 模块都位于 src
文件夹中,以便通过 Webpack 使用它们。 因此,你需要在你的 Webpack 配置中定义一个别名:
var config = {
resolve : {
alias: {
'7s' : '7s/src',
}
}
}
Development Strategy
应用程序的大部分功能应该驻留在 generic
中,并在需要时使用抽象接口与外部世界对话(例如资源载)。 附加功能(例如桌面版)应该通过钩子/提供者方案注入到通用组件中,其中组件接收一个 settings
实例,该实例可能包含实现或覆盖某些功能的各种功能(例如加载文件)。
Contributing
要了解有关开发过程和提交代码的更多信息,请阅读 Contributing.md。
7scientists - React UI Toolkit
This repository contains reusable UI components and helpers that we use in all of our React/Electron apps. This package can be installed using npm
.
Installation
Simply install the package using NPM:
npm install --save git+ssh://git@gitlab.com:7scientists/7s-ui.git
Alternatively, you may clone the git repository and manually symlink it to a 7s
subdirectory in your node_modules
directory, which is more convenient when making changes to the toolkit:
git clone git@gitlab.com:7scientists/7s-ui.git
ln -s [location-of-7s-ui] node_modules/7s
Usage
All JS/JSX modules are located in the src
folder, to use them via Webpack. Therefore, you need to define an alias in your Webpack config:
var config = {
resolve : {
alias: {
'7s' : '7s/src',
}
}
}
Development Strategy
Most of the functionality of the app should reside in generic
and make use of abstract interfaces to speak to the external world, where needed (e.g. for resource loading). Additional functionality (e.g. for the desktop version) should be injected into the generic components via a hooks / provider scheme, where components receive a settings
instance that might contain various functions that implement or override certain functionalities (e.g. for loading files).
Contributing
To learn more about development processes and submitting code, please read Contributing.md.