Skip to content

Commit

Permalink
convert to ESM, convert to TS, compile with tsup, add types, fix #85 (
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina authored Nov 19, 2024
1 parent 98c9882 commit 52362eb
Show file tree
Hide file tree
Showing 14 changed files with 2,184 additions and 2,929 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@ jobs:
strategy:
matrix:
node-version:
- 16
- 22
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Check out code
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test

- run: pnpm i
- run: pnpm build
- run: pnpm test
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.log
node_modules
.vscode
node_modules/
.vscode/
.idea/
dist/
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22
52 changes: 41 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,37 @@
"name": "title",
"version": "3.5.3",
"description": "Capitalize your titles properly",
"main": "./lib/index.js",
"repository": "vercel/title",
"scripts": {
"test": "ava"
"test": "ava && attw --pack .",
"build": "tsup",
"dev": "tsup --watch",
"prepublishOnly": "pnpm build"
},
"type": "module",
"types": "./dist/esm/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"require": {
"types": "./dist/cjs/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
}
},
"./*": {
"require": {
"types": "./dist/cjs/*.d.cts",
"default": "./dist/cjs/*.js"
},
"import": {
"types": "./dist/esm/*.d.ts",
"default": "./dist/esm/*.js"
}
}
},
"keywords": [
"title",
Expand All @@ -16,21 +43,24 @@
"style"
],
"bin": {
"title": "./bin/title.js"
"title": "./dist/bin.js"
},
"files": [
"bin",
"lib"
"dist"
],
"author": "leo",
"license": "MIT",
"dependencies": {
"arg": "1.0.0",
"chalk": "2.3.0",
"clipboardy": "1.2.2",
"titleize": "1.0.0"
"arg": "^5.0.0",
"chalk": "^5.0.0",
"clipboardy": "^4.0.0"
},
"devDependencies": {
"ava": "0.25.0"
}
"@arethetypeswrong/cli": "^0.17.0",
"@types/node": "^22.9.0",
"ava": "6.2.0",
"tsup": "^8.3.5",
"typescript": "^5.6.3"
},
"packageManager": "[email protected]"
}
Loading

0 comments on commit 52362eb

Please sign in to comment.