0.3.20-beta.11

中文文档
0.3.19发布于 2021/04/20ISCESM + CJS

Synapse Reusable components library v2

原始使用文档
文档目录4 节
  1. Adding a new component
  2. Testing your new components
  3. Testing your components with Storybook
  4. Publishing

synapse-ui

Reusable ui components for Synapse

Adding a new component

  1. Create your new component inside the src/ folder. You could place your component into any of the existing folders or create a new one.
  2. Create your style files inside its respective component folder.
  3. Create index.js file in the root of the new folder like so src/_your_folder/index.js.
  4. Import and export the new components inside index.js like so
    import Component1 from './Component1/Component1;
    import Component2 from './Component2/Component2;
    import Component3 from './Component3/Component3;
    
    export {
       Component1,
       Component2,
       Component3,
       {... moreComponents}
    };
    

Testing your new components

  1. Go to the package.json of synapse-ui and change the name attribute for synapse-ui-v2.
  2. Run yarn install.
  3. Run yarn build.
  4. Run yarn link.
  5. Then go to the project directory where you will use synapse-ui and run yarn link synapse-ui-v2.

Testing your components with Storybook

  1. Create a stories.jsx file along with your component
  2. Run yarn install
  3. Run yarn storybook
  4. Navigate to your component in Storybook dashboard
  5. For additional context, please refer to official Storybook documentation at https://www.learnstorybook.com/

Publishing

  1. Run yarn install.
  2. If you are not logged in. Run npm login. Make sure to count with a npm account.
  3. Run the npm publish command.
  4. !Done¡.

版本与发布记录

0.3.20-beta.11 共发布 1 个版本,首次发布于 2021/04/20;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.3.19latest2021/04/205 年前

关于 0.3.20-beta.11 的常见问题

0.3.20-beta.11 是什么?

Synapse可重用组件库v2

如何安装 0.3.20-beta.11?

在项目目录运行 npm install 0.3.20-beta.11,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@material-ui/core(4.3.1)、node-sass(^4.13.1)、prop-types(^15.7.2)、react(^16.10.2)、react-dom(^16.10.2)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

0.3.20-beta.11 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/0.3.20-beta.11 是否存在。

0.3.20-beta.11 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

0.3.20-beta.11 可以商用吗?

0.3.20-beta.11 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

0.3.20-beta.11 还在维护吗?

最新版本 0.3.19 发布于 2021/04/20(5 年前);至今共发布 1 个版本,其中过去 12 个月发布了 0 个;首次发布于 2021/04/20。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。