generated from sonofmagic/npm-lib-template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: init project for npm placeholder
- Loading branch information
1 parent
cd2a9a1
commit d9eb8ab
Showing
6 changed files
with
274 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1 @@ | ||
# npm-lib-rollup-template | ||
|
||
[![codecov](https://codecov.io/gh/sonofmagic/npm-lib-rollup-template/branch/main/graph/badge.svg?token=zn05qXYznt)](https://codecov.io/gh/sonofmagic/npm-lib-rollup-template) | ||
|
||
本人用于编写的一个 `npm` 包的一个模板 | ||
|
||
- 使用 `rollup` 打包 (兼容 `tsc`) | ||
- 使用 ~~`jest`~~ `vitest` 作为单元测试框架 | ||
- 使用 `eslint` 来规范代码风格,默认风格为 `standard` | ||
- 输出 `dist` -> `cjs`,`esm` and `.d.ts` | ||
- 使用 `semantic-release` 来发布 `npm`/`github` | ||
|
||
## 为什么使用 `vitest` 而不是原先的 `jest` | ||
|
||
`vitest` 开箱即用,`jest` 在同时遇到 `cjs` 和 `esm` 依赖的时候,支持很差,经常会失败,而且配置复杂,依赖的 `preset` 多,比如 `ts-jest`.. | ||
|
||
## scripts | ||
|
||
### rename | ||
|
||
执行 `npm run init:rename` | ||
|
||
作用为替换 `package.json` 中默认包含的所有名称为 `npm-lib-rollup-template` 的字段 | ||
|
||
默认替换为新建代码仓库的文件夹名称! | ||
|
||
### bin | ||
|
||
执行 `npm run init:bin` | ||
|
||
作用为 `package.json` 添加 `files` 和 `bin`,同时生成 `bin/{{pkg.name}}.js` 和 `src/cli.ts` 文件 | ||
# weapp-pandacss (WIP) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "npm-lib-rollup-template", | ||
"name": "weapp-pandacss", | ||
"version": "0.0.0", | ||
"description": "npm-lib-rollup-template", | ||
"description": "weapp-pandacss (WIP)", | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"types": "types/index.d.ts", | ||
|
@@ -24,7 +24,7 @@ | |
"packageManager": "[email protected]", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/sonofmagic/npm-lib-rollup-template.git" | ||
"url": "https://github.com/sonofmagic/weapp-pandacss.git" | ||
}, | ||
"files": [ | ||
"dist", | ||
|
@@ -38,9 +38,9 @@ | |
"author": "SonOfMagic <[email protected]>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/sonofmagic/npm-lib-rollup-template/issues" | ||
"url": "https://github.com/sonofmagic/weapp-pandacss/issues" | ||
}, | ||
"homepage": "https://github.com/sonofmagic/npm-lib-rollup-template#readme", | ||
"homepage": "https://github.com/sonofmagic/weapp-pandacss#readme", | ||
"devDependencies": { | ||
"@rollup/plugin-alias": "^5.0.0", | ||
"@rollup/plugin-commonjs": "^25.0.3", | ||
|
@@ -77,6 +77,20 @@ | |
"tslib": "^2.6.1", | ||
"typescript": "^5.1.6", | ||
"typescript-transform-paths": "^3.4.6", | ||
"vitest": "^0.33.0" | ||
"vitest": "^0.33.0", | ||
"postcss": "^8.4.27" | ||
}, | ||
"dependencies": { | ||
"@babel/generator": "^7.22.9", | ||
"@babel/parser": "^7.22.7", | ||
"@babel/traverse": "^7.22.8", | ||
"@babel/types": "^7.22.5", | ||
"@csstools/postcss-cascade-layers": "^4.0.0", | ||
"@pandacss/config": "^0.8.0", | ||
"postcss-selector-parser": "^6.0.13", | ||
"semver": "^7.5.4" | ||
}, | ||
"peerDependencies": { | ||
"postcss": "^8.4" | ||
} | ||
} |
Oops, something went wrong.