From 1091d2549063ebf44d02110f1774d20cfb22b397 Mon Sep 17 00:00:00 2001 From: chouchouji <1305974212@qq.com> Date: Tue, 10 Dec 2024 16:39:52 +0800 Subject: [PATCH 1/2] chore: optimize biome config --- biome.json | 2 +- package.json | 2 +- tests/cli.test.ts | 18 ++++++++++++++---- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/biome.json b/biome.json index 81fc9c6..50e9cbd 100644 --- a/biome.json +++ b/biome.json @@ -6,7 +6,7 @@ "useIgnoreFile": true }, "files": { - "ignoreUnknown": false, + "ignoreUnknown": true, "ignore": ["dist", "*.json"] }, "formatter": { diff --git a/package.json b/package.json index 537c855..f082e0a 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "test:watch": "vitest", "changeset:version": "changeset version", "changeset:publish": "changeset publish", - "check": "biome check --write ." + "check": "biome check --write --verbose" }, "keywords": [ "npm", diff --git a/tests/cli.test.ts b/tests/cli.test.ts index 23ae448..8554359 100644 --- a/tests/cli.test.ts +++ b/tests/cli.test.ts @@ -15,8 +15,8 @@ import { } from 'vitest'; import { onHome, onTest } from '../src/actions'; -import { readFile, writeFile } from '../src/helpers'; import { NPMRC, REGISTRIES } from '../src/constants'; +import { readFile, writeFile } from '../src/helpers'; const isWin = process.platform === 'win32'; @@ -98,7 +98,11 @@ it('nrm use local', async () => { expect(npmrc.registry).toBe(REGISTRIES.cnpm.registry); - await coffee.spawn('nrm', ['current'], { shell: isWin }).expect('stdout', /cnpm/g).expect('code', 0).end(); + await coffee + .spawn('nrm', ['current'], { shell: isWin }) + .expect('stdout', /cnpm/g) + .expect('code', 0) + .end(); }); it('nrm use local with user config', async () => { @@ -115,7 +119,11 @@ it('nrm use local with user config', async () => { expect(npmrc.registry).toBe(REGISTRIES.cnpm.registry); expect(npmrc.abc).toBe('123'); - await coffee.spawn('nrm', ['current'], { shell: isWin }).expect('stdout', /cnpm/g).expect('code', 0).end(); + await coffee + .spawn('nrm', ['current'], { shell: isWin }) + .expect('stdout', /cnpm/g) + .expect('code', 0) + .end(); }); it('nrm use without argument', async () => { @@ -127,7 +135,9 @@ it('nrm use without argument', async () => { }); }); - expect(message).toBe(`? Please select the registry you want to use (Use arrow keys) + expect( + message, + ).toBe(`? Please select the registry you want to use (Use arrow keys) ${isWin ? '>' : '❯'} npm yarn tencent From e57a05d505fe16abfd795a3dfa3b8c5df3658dff Mon Sep 17 00:00:00 2001 From: chouchouji <1305974212@qq.com> Date: Fri, 13 Dec 2024 20:31:11 +0800 Subject: [PATCH 2/2] chore: add dev script --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index f082e0a..7dbec1f 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "scripts": { "clean": "rimraf node_modules dist", "test": "pnpm build && vitest run", + "dev": "tsc --watch", "build": "rimraf dist && tsc && rimraf dist/types.js", "test:watch": "vitest", "changeset:version": "changeset version",