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

@deepexi-devops/utils

Package Overview
Dependencies
Maintainers
4
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deepexi-devops/utils

> TODO: description

  • 0.0.9
  • latest
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

@deepexi-devops/utils

一个服务于 devops 项目的通用工具函数库

安装

yarn add @deepexi-devops/utils

使用

import { formatters } from '@deepexi-devops/utils'

const formatDate = formatters.formatDate(Date.now())
console.log(formatDate)

开发流程

  1. 当在微前端项目开发过程中需要使用工具方法时,可自行在原本项目中开发,当有必要作为公用方法处理时,可以clone本项目,进行开发
  2. 通过提 pr 或者 mr 的方式提交代码(引入 单元测试 测试后会有单元测试通过标准)
  3. 由维护者 review (引入 单元测试 测试后需要检验测试用例)
  4. 通过后再进行发包到 npm,之后需要更新的项目自行更新

规范

  1. 本模块默认使用 es 模块规范开发,打包出的模块也是只有 es 模块,目的为了配合其他打包工具更好配合 tree-shaking

  2. 本模块默认不导入第三方模块,若有引入第三方模块,请在 rollup.config.js 中 的 external 字段生命外部模块

计划

  • [] 引入单元测试

rollup 打包踩坑的一些记录

想学 lodash 按需引入方式比如

import cloneDeep from 'lodash/cloneDeep'

lodash 是一个方法打包成一个包,并且放在根目录,且只有一个默认导出

最后发现并不适合当前场景,当前场景需要的把函数分类存放到文件里,一个文件有多个导出

想去除 index.js 这个总入口文件,直接通过在src目录下创建文件就可以进行打包 在 rollup 下可以设置多入口,但是导出的 umd 和 iife 格式的文件无法进行代码分开

Error: UMD and IIFE output formats are not supported for code-splitting builds.

rollup 默认不会解析导入第三方库,需要导入需要用 @rollup/plugin-node-resolve 这个插件,否则就配置 external 字段证明这是外部模块

import * as sum from './sum'

这种写发并不能把 sum.js 下 export default 导出来

复习 https://es6.ruanyifeng.com/#docs/module#import-%E5%91%BD%E4%BB%A4

FAQs

Package last updated on 29 Feb 2020

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc