Skip to content

Commit

Permalink
feat: follow spec 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lonr committed Nov 11, 2024
1 parent 1efc9c9 commit 2b469ea
Show file tree
Hide file tree
Showing 25 changed files with 4,213 additions and 4,080 deletions.
2 changes: 1 addition & 1 deletion .czrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"path": "cz-conventional-changelog"
"path": "@commitlint/cz-commitlint"
}
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
quote_type = single
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

23 changes: 0 additions & 23 deletions .eslintrc.cjs

This file was deleted.

7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# https://semantic-release.gitbook.io/semantic-release/recipes/ci-configurations/github-actions
name: CI
on:
push:
Expand All @@ -13,15 +14,15 @@ jobs:
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Setup pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v4
- name: Install dependencies
run: pnpm i --ignore-scripts
- name: Build
Expand Down
5 changes: 1 addition & 4 deletions .husky/commit-msg
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
# https://github.com/pnpm/pnpm/blob/main/.husky/commit-msg
pnpm commitlint --edit --config=commitlint.config.cjs
pnpm exec commitlint --edit $1
5 changes: 1 addition & 4 deletions .husky/pre-commit
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm lint-staged
pnpm exec lint-staged
4 changes: 2 additions & 2 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"*.{js,ts}": "eslint --fix",
"*.{js,jsc,ts,json,md}": "prettier --write"
"!(*.ts)": "prettier --write --ignore-unknown",
"*.ts": ["eslint --fix", "prettier --write"]
}
4 changes: 3 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{}
{
"singleQuote": true
}
13 changes: 0 additions & 13 deletions .swcrc

This file was deleted.

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 lonr

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
# tldr-ts

> Yet another Node.js based command-line client for tldr.
> More information: <https://tldr.sh>.
- Installing:

`npm i -g tldr-ts`
> A tldr client with turbo speed.
> Display simple help pages for command-line tools from the tldr-pages project.
- Print the tldr page for a specific command:

`tldr {{command}}`

- Print the tldr page for tldr:
- Print the tldr page for a specific subcommand:

`tldr {{command}} {{subcommand}}`

- Print the tldr page for a command in the given [L]anguage (if available, otherwise fall back to English):

`tldr --language {{language_code}} {{command}}`

- Print the tldr page for a command from a specific [p]latform:

`tldr --platform {{android|common|freebsd|linux|osx|netbsd|openbsd|sunos|windows}} {{command}}`

- [u]pdate the local cache of tldr pages:

`tldr tldr`
`tldr --update`
4 changes: 0 additions & 4 deletions bin/tldr.js

This file was deleted.

1 change: 0 additions & 1 deletion commitlint.config.cjs

This file was deleted.

1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default { extends: ['@commitlint/config-conventional'] };
11 changes: 11 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// @ts-check
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintConfigPrettier from 'eslint-config-prettier';

export default tseslint.config(
{ ignores: ['dist'] },
eslint.configs.recommended,
...tseslint.configs.recommended,
eslintConfigPrettier,
);
66 changes: 27 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tldr-ts",
"version": "0.0.0-development",
"description": "Yet another Node.js based command-line client for tldr",
"description": "A tldr client with turbo speed",
"keywords": [
"tldr"
],
Expand All @@ -12,56 +12,44 @@
"license": "MIT",
"author": "lonr",
"type": "module",
"imports": {
"#package.json": "./package.json"
},
"bin": {
"tldr": "bin/tldr.js"
"tldr": "dist/cli.js"
},
"files": [
"bin",
"dist/*.js"
"dist"
],
"scripts": {
"build": "rimraf dist && rollup --config rollup.config.ts --configPlugin typescript",
"build": "tsup src/cli.ts --format=esm --clean --minify",
"check-style": "prettier --check .",
"check-ts": "tsc -noEmit",
"commit": "cz",
"lint": "eslint .",
"prepare": "husky install",
"prepare": "husky",
"semantic-release": "semantic-release",
"test": "echo \"Error: no test specified\" && exit 1",
"watch": "rimraf dist && swc src -d dist -w"
"watch": "tsup src/cli.ts --watch --format=esm --clean --minify"
},
"devDependencies": {
"@commitlint/cli": "^17.8.0",
"@commitlint/config-conventional": "^17.8.0",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.5",
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.93",
"@types/fs-extra": "^11.0.2",
"@types/minimist": "^1.2.4",
"@types/node": "^20.8.7",
"@types/yargs": "^17.0.28",
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
"chokidar": "^3.5.3",
"cz-conventional-changelog": "^3.3.0",
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@commitlint/cz-commitlint": "^19.5.0",
"@eslint/js": "^9.14.0",
"@types/eslint__js": "^8.42.3",
"@types/minimist": "^1.2.5",
"@types/node": "^22.9.0",
"commitizen": "^4.3.1",
"env-paths": "^3.0.0",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"husky": "^8.0.3",
"lint-staged": "^15.0.1",
"eslint": "^9.14.0",
"eslint-config-prettier": "^9.1.0",
"husky": "^9.1.6",
"inquirer": "9",
"lint-staged": "^15.2.10",
"minimist": "^1.2.8",
"picocolors": "^1.0.0",
"prettier": "3.0.3",
"rimraf": "^5.0.5",
"rollup": "^4.1.4",
"semantic-release": "^22.0.5",
"typescript": "^5.2.2"
},
"packageManager": "[email protected]"
"picocolors": "^1.1.1",
"prettier": "3.3.3",
"semantic-release": "^24.2.0",
"tsup": "^8.3.5",
"typescript": "^5.2.2",
"typescript-eslint": "^8.13.0"
}
}
Loading

0 comments on commit 2b469ea

Please sign in to comment.