Skip to content

Commit

Permalink
feat: 🎸 Add banner
Browse files Browse the repository at this point in the history
  • Loading branch information
haozi committed Dec 21, 2023
1 parent cd91642 commit 5583ac3
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![codecov](https://codecov.io/gh/ha0z1/idmp/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ha0z1/idmp/blob/main/src%2Findex.ts)
[![contributors](https://img.shields.io/github/contributors/ha0z1/idmp)](https://github.com/ha0z1/idmp/graphs/contributors)
[![LICENSE](https://img.shields.io/npm/l/idmp)](https://github.com/ha0z1/idmp/blob/main/LICENSE)
[![Size](https://img.shields.io/bundlephobia/minzip/idmp.svg)](https://unpkg.com/idmp/dist/)
[![Size](https://img.shields.io/bundlephobia/minzip/idmp.svg)](https://cdn.jsdelivr.net/npm/idmp/+esm)

An elegant library to solve duplicate and concurrent calls for idempotent functions, pure function. Less than 1 KB after Gzip

Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![codecov](https://codecov.io/gh/ha0z1/idmp/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ha0z1/idmp/blob/main/src%2Findex.ts)
[![contributors](https://img.shields.io/github/contributors/ha0z1/idmp)](https://github.com/ha0z1/idmp/graphs/contributors)
[![LICENSE](https://img.shields.io/npm/l/idmp)](https://github.com/ha0z1/idmp/blob/main/LICENSE)
[![Size](https://img.shields.io/bundlephobia/minzip/idmp.svg)](https://unpkg.com/idmp/dist/)
[![Size](https://img.shields.io/bundlephobia/minzip/idmp.svg)](https://cdn.jsdelivr.net/npm/idmp/+esm)

一个优雅地解决幂等(idempotent) 函数的重复和并发调用的小库,纯函数,Gzip 后不到 1 KB

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "idmp",
"version": "1.9.0",
"version": "1.9.1",
"keywords": [
"cache response",
"swr without hooks",
Expand Down Expand Up @@ -49,6 +49,7 @@
"typescript": "^5.3.3",
"vite": "^5.0.10",
"vite-node": "^1.1.0",
"vite-plugin-banner": "^0.7.1",
"vite-plugin-dts": "^3.6.4",
"vitest": "^1.1.0"
}
Expand Down
7 changes: 7 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { build, mergeConfig, type InlineConfig } from 'vite'
// import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import dts from 'vite-plugin-dts'
import banner from 'vite-plugin-banner'
import { version } from '../package.json'

type DeepPartial<T> = T extends object
? {
Expand All @@ -12,7 +14,13 @@ const buildFile = async (buildOptions: DeepPartial<InlineConfig>) => {
await build(
mergeConfig(
{
plugins: [react(), dts()],
plugins: [
react(),
dts(),
banner(
`/*! idmp v${version} | (c) github/haozi | MIT */`,
),
],
build: {
sourcemap: false,
// target: "chrome51",
Expand Down

0 comments on commit 5583ac3

Please sign in to comment.