-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c22bc48
Showing
17 changed files
with
4,188 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"extends": [ | ||
"@commitlint/config-conventional" | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* eslint-env node */ | ||
module.exports = { | ||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint'], | ||
root: true, | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: PR Checker | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- 'ubuntu-latest' | ||
node_version: | ||
- '20' | ||
- '18' | ||
- '16' | ||
- '14' | ||
name: Node.js ${{ matrix.node_version }} on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node_version }} | ||
|
||
- name: Update NPM | ||
run: npm install --global pnpm | ||
|
||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Lint | ||
if: matrix.node_version == '20' | ||
run: pnpm run lint | ||
|
||
# - name: Run Tests | ||
# run: npm run test-coverage |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Release | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
|
||
- name: Update NPM | ||
run: npm install --global pnpm | ||
|
||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: npx semantic-release --branches=main --debug |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
dist |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
npx commitlint --edit $1 |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
npx lint-staged |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"*.{js,ts,tsx}": ["eslint --fix"], | ||
"**/*/package.json": ["sort-package-json"] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Clean Up node_modules | ||
|
||
[![Build Status][github_actions_badge]][github_actions_link] | ||
[![NPM Version][package_version_badge]][package_link] | ||
|
||
[package_version_badge]: https://img.shields.io/npm/v/clear-node-modules.svg | ||
[package_link]: https://www.npmjs.com/package/clear-node-modules | ||
[github_actions_badge]: https://img.shields.io/github/actions/workflow/status/keithamus/clear-node-modules/pr.yml | ||
[github_actions_link]: https://github.com/keithamus/clear-node-modules/actions?query=workflow%3ACI+branch%3Amain | ||
|
||
Find and delete `node_modules` folders (recursively) in your directory. | ||
|
||
## CLI | ||
|
||
### Run via npx | ||
|
||
```bash | ||
npx clear-node-modules | ||
``` | ||
|
||
### Install | ||
|
||
```bash | ||
npm install --global clear-node-modules | ||
``` | ||
|
||
### Usage | ||
|
||
```console | ||
$ npx clear-node-modules | ||
"node_modules" is deleted! ✅ | ||
``` | ||
|
||
CLI also supports a particular path, not only your current directory, so you don't need to change the directory. | ||
|
||
```console | ||
$ npx clear-node-modules src | ||
``` | ||
|
||
## Options | ||
|
||
#### `-r`,`--recursive` flag | ||
|
||
When you want to also delete all nested `node_modules` directory, you can run CLI with the `--recursive` flag (or `-r`). | ||
|
||
```console | ||
$ npx clear-node-modules -r | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"name": "clear-node-modules", | ||
"version": "1.0.0", | ||
"description": "", | ||
"license": "ISC", | ||
"author": "", | ||
"main": "dist/index.js", | ||
"bin": "./dist/cli.mjs", | ||
"scripts": { | ||
"build": "tsup-node", | ||
"dev": "tsup-node --watch", | ||
"lint": "eslint src", | ||
"semantic-release": "semantic-release", | ||
"prepare": "husky" | ||
}, | ||
"dependencies": { | ||
"globby": "^14.0.1", | ||
"tsup": "^8.0.2" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "^19.0.3", | ||
"@commitlint/config-conventional": "^19.0.3", | ||
"@modern-js/tsconfig": "^2.48.0", | ||
"@types/node": "20", | ||
"@typescript-eslint/eslint-plugin": "^7.1.0", | ||
"@typescript-eslint/parser": "^7.1.0", | ||
"eslint": "^8.57.0", | ||
"husky": "^9.0.11", | ||
"lint-staged": "^15.2.2", | ||
"semantic-release": "^23.0.2", | ||
"sort-package-json": "^2.8.0", | ||
"typescript": "^5.3.3" | ||
}, | ||
"tsup": { | ||
"entry": [ | ||
"src" | ||
], | ||
"format": "esm", | ||
"splitting": false, | ||
"sourcemap": true, | ||
"target": "node18", | ||
"clean": true | ||
} | ||
} |
Oops, something went wrong.