Skip to content

Commit

Permalink
feat!: calculate file sizes
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Node.js v16.13.0+ is now required.

- This redoes a whole bunch of workflows.
- Publishes types
  • Loading branch information
boneskull committed Aug 9, 2023
1 parent af2654b commit b6d3f15
Show file tree
Hide file tree
Showing 15 changed files with 4,046 additions and 6,212 deletions.
13 changes: 5 additions & 8 deletions .eslintrc.yml
@@ -1,13 +1,10 @@
root: true
extends:
- standard
- plugin:prettier/recommended
rules:
standard/computed-property-even-spacing: off
semi:
- error
- always
no-extra-semi: error
- semistandard
- prettier
env:
node: true
es2021: true
overrides:
- files:
- .mocharc.js
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/commitlint.yml
@@ -0,0 +1,14 @@
name: Validate Commit Messages
on: [pull_request]

permissions:
contents: read

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
- name: Run commitlint
uses: wagoid/commitlint-github-action@6319f54d83768b60acd6fd60e61007ccc583e62f #v5
8 changes: 5 additions & 3 deletions .github/workflows/nodejs.yml
Expand Up @@ -8,15 +8,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [14, 16, 18]
node_version: [16, 18, 20]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@master
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3
with:
version: ${{ matrix.node_version }}
node-version: ${{ matrix.node_version }}
- name: npm install
uses: bahmutov/npm-install@v1
uses: bahmutov/npm-install@c5482d70ec8706408996e31ac94075030694993f # v1
- name: test
run: npm test
- name: lint
run: npm run lint
31 changes: 30 additions & 1 deletion .github/workflows/release.yml
Expand Up @@ -3,11 +3,40 @@ on:
branches:
- main
name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@ca6063f4ed81b55db15b8c42d1b6f7925866342d # v3
- name: Create Release
id: release
uses: google-github-actions/release-please-action@ca6063f4ed81b55db15b8c42d1b6f7925866342d # v3
with:
release-type: node
package-name: nvmermind

# see https://github.com/googleapis/release-please/blob/main/docs/manifest-releaser.md#using-with-github-actions-and-lerna
- name: Checkout Repository
if: ${{ steps.release.outputs.releases_created }}
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
- name: Setup Node
if: ${{ steps.release.outputs.releases_created }}
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- name: Upgrade npm
if: ${{ steps.release.outputs.releases_created }}
run: npm i -g npm@latest
- name: Build Package
if: ${{ steps.release.outputs.releases_created }}
uses: bahmutov/npm-install@c5482d70ec8706408996e31ac94075030694993f # v1

# Release Please has already incremented versions and published tags, so we just
# need to publish all unpublished versions to NPM here
# See: https://github.com/lerna/lerna/tree/main/commands/publish#bump-from-package
- name: Publish to npm
if: ${{ steps.release.outputs.releases_created }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: npm publish
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -59,3 +59,5 @@ typings/

# next.js build output
.next

types
4 changes: 4 additions & 0 deletions .husky/commit-msg
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint:commit -- --edit ${1}
2 changes: 1 addition & 1 deletion .husky/pre-commit
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint-staged
npm run lint:staged
4 changes: 2 additions & 2 deletions .release-please-manifest.json
@@ -1,3 +1,3 @@
{
".": "0.0.0"
}
".": "0.2.3"
}
5 changes: 1 addition & 4 deletions .renovaterc.json
@@ -1,7 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"github>appium/appium//renovate/default"
],
"semanticCommitScope": "{{#if parentDir}}{{parentDir}}{{else}}deps{{/if}}"
"extends": ["github>appium/appium//renovate/default"]
}
29 changes: 21 additions & 8 deletions README.md
@@ -1,8 +1,8 @@
# nvmermind
# 😒 nvmermind

> Uninstall old versions of Node.js as installed by [nvm](https://github.com/nvm-sh/nvm)
> Uninstall old versions of Node.js (as installed by [nvm](https://github.com/nvm-sh/nvm)) while keeping the latest of each major version.
If you have a stinking bonepile of old Node.js versions in your `~/.nvm` folder, this script helps remove them nicely.
If you have a stinking bonepile of old Node.js versions in your `~/.nvm` folder, this script _takes out the trash._

## Install

Expand All @@ -16,21 +16,34 @@ Run:
npx nvmermind
```

`nvmermind` will keep the **latest installed version of _each_ major** it finds, and prompt to remove all the others. So, if you have `14.16.1` and `14.17.0` installed, it will keep `14.17.0`.
`nvmermind` will keep the **latest installed version of _each_ major** it finds.

> Example: if you have `v14.16.1` and `v14.17.0` installed, it will remove `v14.16.1` and keep `v14.17.0`.
`nvmermind` will show you:

- what would be removed
- what will be kept
- how much disk space you'll recover

`nvmermind` will confirm with you (a human) before blasting anything away.

### API

There's an "API." You can `require('nvmermind')`, but I don't feel like documenting it. Maybe next week? There are some docstrings, which is better than nothing.
There's an "API", sure. You can `require('nvmermind')`, but I don't feel like documenting it. ~~Maybe next week? There are some docstrings, which is better than nothing.~~

**New in v1.0.0:** There are types now; look at those if you want. I'm still not gonna document it.

### Usage Notes

- Removal uses `nvm uninstall`, which does its thing safely (_read_: slowly).
- `nvmermind` accepts no options, arguments, flags, cards, cash or checks.
- Removal uses `nvm uninstall`, which does its thing safely and methodically (_read_: slowly).
- `nvmermind` accepts no options, arguments, flags, or anything else. There is no man page and no `--help`.
- This should work on Windows [insofar as `nvm` works on Windows](https://github.com/nvm-sh/nvm#important-notes).

## Acknowledgments

- I stole some code from Wes Todd's [nvmjs](https://github.com/wesleytodd/nvmjs). I should probably send a PR.

## License

Copyright © 2021 Christopher Hiller. Licensed Apache-2.0
Copyright © 2021 Christopher "[boneskull](https://github.com/boneskull)" Hiller. Licensed Apache-2.0
11 changes: 11 additions & 0 deletions commitlint.config.js
@@ -0,0 +1,11 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'body-leading-blank': [0],
'body-max-line-length': [0],
'footer-max-line-length': [0],
'header-max-length': [0],
'subject-case': [0],
'subject-full-stop': [0],
},
};

0 comments on commit b6d3f15

Please sign in to comment.