Skip to content

Commit

Permalink
Merge pull request #216 from Pana/v2
Browse files Browse the repository at this point in the history
release 2.0
  • Loading branch information
iosh authored Dec 8, 2024
2 parents 92fb7d2 + 8e68916 commit 0f076c5
Show file tree
Hide file tree
Showing 27 changed files with 2,863 additions and 3,646 deletions.
5 changes: 5 additions & 0 deletions .changeset/many-doors-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nrm": minor
---

Migrate to Typescript and vitet. Thanks @chouchouji
25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Lint

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 9

- name: Setup Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x

- name: Install Dependencies
run: pnpm i

- name: Lint
run: pnpm check
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@ jobs:
node-version: 20.x

- name: Install Dependencies
run: yarn
run: pnpm

- name: Build
run: pnpm run build

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: yarn changeset:publish
version: yarn changeset:version
publish: pnpm changeset:publish
version: pnpm changeset:version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
11 changes: 7 additions & 4 deletions .github/workflows/test-Windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Install Yarn
run: npm install yarn -g
- name: Install pnpm
run: npm install pnpm -g

- name: Install Dependencies
run: yarn install
run: pnpm install

- name: Build
run: pnpm run build

- name: Test
run: yarn run test
run: pnpm run test
11 changes: 7 additions & 4 deletions .github/workflows/test-macOS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Install Yarn
run: npm install yarn -g
- name: Install pnpm
run: npm install pnpm -g

- name: Install Dependencies
run: yarn install
run: pnpm install

- name: Build
run: pnpm run build

- name: Test
run: yarn run test
run: pnpm run test
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ TODO.md

# package lock
package-lock.json
pnpm-lock.yaml
yarn.lock

# Output of 'npm pack'
*.tgz
Expand Down Expand Up @@ -45,3 +45,4 @@ lerna-debug.log*
*.gz
.DS_Store
results
dist
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

3 changes: 0 additions & 3 deletions .prettierignore

This file was deleted.

34 changes: 34 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": false,
"ignore": ["dist", "*.json"]
},
"formatter": {
"enabled": true,
"lineWidth": 80,
"useEditorconfig": true
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "off"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "single"
}
}
}
25 changes: 0 additions & 25 deletions constants.js

This file was deleted.

110 changes: 0 additions & 110 deletions helpers.js

This file was deleted.

6 changes: 0 additions & 6 deletions jest.config.js

This file was deleted.

34 changes: 18 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,24 @@
"version": "1.5.0",
"description": "npm registry manager can help you switch different npm registries easily and quickly",
"bin": {
"nrm": "cli.js"
"nrm": "dist/index.js"
},
"type": "commonjs",
"repository": {
"type": "git",
"url": "git+https://github.com/Pana/nrm.git"
},
"files": [
"cli.js",
"actions.js",
"constants.js",
"helpers.js",
"process.js",
"registries.json"
"dist"
],
"scripts": {
"star": "npm star nrm",
"test": "jest",
"test:watch": "jest --watch",
"clean": "rimraf node_modules dist",
"test": "pnpm build && vitest run",
"build": "rimraf dist && tsc && rimraf dist/types.js",
"test:watch": "vitest",
"changeset:version": "changeset version",
"changeset:publish": "changeset publish",
"format": "prettier . --write"
"check": "biome check --write ."
},
"keywords": [
"npm",
Expand All @@ -37,18 +34,23 @@
"homepage": "https://github.com/Pana/nrm",
"dependencies": {
"@inquirer/select": "^4.0.2",
"chalk": "^4.1.2",
"chalk": "4.1.2",
"commander": "^8.3.0",
"ini": "^2.0.0",
"open": "^8.4.2",
"ini": "4.1.3",
"open": "8.4.2",
"undici": "5.28.2"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@changesets/cli": "^2.27.8",
"@types/ini": "^4.1.1",
"@types/node": "18",
"coffee": "^5.4.0",
"jest": "^27.4.0",
"mock-fs": "^5.4.1",
"prettier": "^3.3.3"
"rimraf": "^6.0.1",
"strip-ansi": "^7.1.0",
"typescript": "^5.7.2",
"vitest": "2.1.6"
},
"engines": {
"node": ">=18"
Expand Down
Loading

0 comments on commit 0f076c5

Please sign in to comment.