New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gov-api-package

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gov-api-package

政务能力扩展库(gov-api-package)是对外提供api能力的扩展库,方便外部小程序快速接入内部能力,前端提供的npm包对内部接口做一层封装,主要提供api能力,没有样式

1.0.0
latest
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

介绍

政务能力扩展库(gov-api-package)是对外提供api能力的扩展库,方便外部小程序快速接入内部能力,前端提供的npm包对内部接口做一层封装,主要提供api能力,没有样式

基本目录结构

├── babel.config.js
├── ci.yml
├── package.json
├── README.md
├── scripts
│   ├── build.js  全局编译逻辑,(压缩、混淆)构建到dist文件夹下
│   └── build.sh
└── src
    └── module name1  每个组件基本目录结构 以 `gov-` 开头
        ├── README.md
        ├── dist
        ├── package.json
        ├── scripts/configs.js 编译配置,如没有特殊配置可没有
        ├── src
        └──.npmignore 豁免不需要发布的文件
    ├── module name2
    ├── module name3
    └── ...

编译

执行编译命令在各lib子包中会生成dist/index.js文件,js会被压缩和混淆

编译执行

  • 可在根目录下执行npm run build,将每个模块都依次编译
  • 可在根目录下执行node scripts/build --module=[module name],可编译具体某个模块

发布

  • 发布的npm包中只包含:dist/index.js、package.json、README.md
  • npm包发到  @gov-api-package 源上,例如  @gov-api-package/subscribe-manager,/ 后面不要有gov字样
  • README.md文件中必须包含:解释说明、示例代码、参数说明等内容
  • 发布npm包时,先更新版本号,再在lib子包中执行以下命令  npm publish --registry=https://registry.npmjs.org --access=public
  • 注意README.md中的示例,包名要与实际发包一致

FAQs

Package last updated on 14 Nov 2022

Did you know?

Socket

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