Skip to content

Commit

Permalink
chore: update package (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Talljack committed Nov 17, 2023
1 parent b1b8819 commit aa65218
Show file tree
Hide file tree
Showing 12 changed files with 125 additions and 3,654 deletions.
3 changes: 0 additions & 3 deletions .eslintrc

This file was deleted.

22 changes: 22 additions & 0 deletions .eslintrc.cjs
@@ -0,0 +1,22 @@
module.exports = {
root: true,
env: {
browser: true,
node: true,
es2022: true,
},
parser: '@typescript-eslint/parser',
ignorePatterns: ['node_modules/', 'build/', 'dist/', './.eslint.config.cjs'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
},
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
}
50 changes: 25 additions & 25 deletions .github/workflows/ci.yml
Expand Up @@ -15,67 +15,67 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Set node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16.x
cache: pnpm
node-version: 18.x

- name: Install
run: pnpm i
- name: Install dependencies
run: bun install

- name: Lint
run: pnpm run lint
run: bun run lint

typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Set node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16.x
cache: pnpm
node-version: 18.x

- name: Install
run: pnpm i
- name: Install dependencies
run: bun install

- name: Typecheck
run: pnpm run typecheck
run: bun run typecheck

test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
node: [14.x, 16.x]
os: [ubuntu-latest, windows-latest, macos-latest]
node: [18.x]
os: [ubuntu-latest]
fail-fast: false

steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Set node ${{ matrix.node }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: pnpm

- name: Install
run: pnpm i
run: bun install

- name: Build
run: pnpm run build
run: bun run build

- name: Test
run: pnpm run test
run: bun run test
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Expand Up @@ -13,15 +13,15 @@ jobs:
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Set node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16.x
cache: pnpm
node-version: 18.x

- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -9,3 +9,5 @@ lib-cov
logs
node_modules
temp
.eslintcache
.prettiercache
24 changes: 24 additions & 0 deletions README.md
Expand Up @@ -3,3 +3,27 @@
Template of Typescript library

You can use this template to create a Typescript library.

## Usage

```bash
use this template to create a repository

# install dependencies

bun install

# build for production with minification

bun build

# run unit tests

bun test
```

## License

MIT License

Copyright (c) 2022 Yugang Cao
Binary file added bun.lockb
Binary file not shown.
60 changes: 30 additions & 30 deletions package.json
Expand Up @@ -2,7 +2,7 @@
"name": "starter-ts-lib",
"type": "module",
"version": "0.0.4",
"packageManager": "pnpm@7.11.0",
"packageManager": "bun@1.0.11",
"description": "template of typescript library",
"author": "Talljack",
"license": "MIT",
Expand All @@ -15,7 +15,8 @@
"url": "https://github.com/Talljack/starter-ts-lib/issues"
},
"keywords": [
"typescript"
"typescript",
"library"
],
"sideEffects": false,
"exports": {
Expand All @@ -34,48 +35,47 @@
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"lint": "eslint . && prettier --check .",
"prepublishOnly": "pnpm run build",
"lint": "eslint --cache --ext .js,.jsx,.ts,.tsx .",
"lint:fix": "eslint --fix --ext .js,.jsx,.ts,.tsx .",
"format": "prettier --cache --write .",
"prepublishOnly": "bun run build",
"release": "bumpp && npm publish",
"test": "vitest",
"typecheck": "tsc --noEmit",
"clean": "rimraf dist node_modules"
"typecheck": "tsc --incremental --noEmit && rimraf tsconfig.tsbuildinfo",
"clean": "rimraf dist node_modules",
"postinstall": "simple-git-hooks"
},
"devDependencies": {
"@antfu/eslint-config": "^0.26.3",
"@types/node": "^18.7.18",
"bumpp": "^8.2.1",
"eslint": "^8.23.1",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"esno": "^0.16.3",
"lint-staged": "^13.0.3",
"pnpm": "^7.11.0",
"prettier": "^2.7.1",
"rimraf": "^3.0.2",
"tsup": "^6.2.3",
"typescript": "^4.8.3",
"vite": "^3.1.0",
"vitest": "^0.23.2",
"yorkie": "^2.0.0"
"@antfu/eslint-config": "^1.2.1",
"@types/node": "^20.9.1",
"@typescript-eslint/parser": "^6.11.0",
"bumpp": "^9.2.0",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",
"esno": "^4.0.0",
"lint-staged": "^15.1.0",
"picocolors": "^1.0.0",
"prettier": "^3.1.0",
"rimraf": "^5.0.5",
"simple-git-hooks": "^2.9.0",
"tsup": "^7.3.0",
"typescript": "^5.2.2",
"vite": "^5.0.0",
"vitest": "^0.34.6"
},
"gitHooks": {
"pre-commit": "lint-staged",
"simple-git-hooks": {
"pre-commit": "bun run lint && bun run typecheck && bun lint-staged",
"commit-msg": "node scripts/verifyCommit.js"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --fix",
"eslint",
"prettier --write"
],
"package.json": [
"prettier --write"
],
"*.vue": [
"eslint --fix",
"prettier --write",
"stylelint --fix"
],
"*.{scss,less,styl,html}": [
"stylelint --fix",
"prettier --write"
Expand Down

0 comments on commit aa65218

Please sign in to comment.