Socket
Socket
Sign inDemoInstall

seller-listing-service

Package Overview
Dependencies
9
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

seller-listing-service

Seller Centre Listing Service


Version published
Maintainers
1
0

Weekly downloads

Readme

Source

seller-listing-service

dependences

  • { Service } from 'seller-base'

安装

yarn add seller-listing-service

使用

Example:

import { Service } from 'seller-base';
import { CategoryService } from 'seller-listing-service';

Service.$instance.createServiceModule<CategoryService>(CategoryService, 'module-name');

更多示例请参考 src/development/index.ts

按需引入

安装babel-plugin-import,在babel的plugin中加入这段配置

[require('seller-listing-service/dist/babel-config-for-main-project')]

Seller Center 按需引入

Seller Center 由于是多模块模式,因此需要使用的模块需要修改构建配置

{
  externals: [Object.assign(config.getExternalsConfig(), {
    'seller-base': config.getExternalsConfig(['@/framework'])['@/framework']
  })],
  babelPlugin: config.mode === 'production' ? [require('seller-listing-service/dist/babel-config-for-main-project')] : []
}

注意

  1. 不要修改删除.gitignore中已有部分
  2. 不要在本项目local.config.js加入个人定制的开发环境代码
  3. 开发一个模块MyService需要创建src/modules/my-service/index.tssrc/modules/my-service/lib/service.ts至少两个文件,src/modules/my-service/index.ts不能有默认导出。
  4. 跨模块引入只能从其他模块入口index.ts,不能从其他模块的其他文件引入。
  5. Constants 作为 MyService 的静态属性,不要额外导出。
  6. src/modules/index.ts代码不能重命名导入。

开发

开发执行

  1. CLI准备,参考CLI文档安装部分
  2. 初始化项目(scc init -d)
  3. yarn start

构建

构建执行

  1. CLI准备,参考CLI文档安装部分
  2. 初始化项目(scc init -b)
  3. yarn build

Change Logs

0.0.xx升级到从0.1.xx版本,主要的变更如下:

  • product/list
  1. 重新定义OriginListProductListProduct对象字段,具体可以参考新版本的字段定义(0.0.xx版本的部分字段已去掉)。
  2. 去除OriginProductItemModelProductItemModel类型定义,使用OriginListProductItemModelListProductItemModel替代。
  • product/detail
  1. getProductById接口将返回OriginProductDetail对象(0.0.xx版本是OriginProduct),computedProduct接口将返回ProductDetail对象(0.0.xx版本是Product),返回的对象字段有变更,具体可以参考新版本的字段定义(0.0.xx版本的部分字段已去掉)。
  2. updateProducts接口参数变更为Array<Partial<ProductDetail>>(0.0.xx版本是Array<ProductUpdateData>)。
  • 其他
  1. 去除ProductHelpers类型定义,使用ProductHelpers的接口参数均有变更,seller-listing-service不再支持外部传入user、shop字段。
  2. 新增ListingConfigProductConstraints接口及类型定义。

FAQs

Last updated on 07 Nov 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc