From 55533944f7ede2ac1e6579668dbf3f8560a40f2b Mon Sep 17 00:00:00 2001 From: LitoMore Date: Sat, 10 Jun 2023 08:32:52 +0800 Subject: [PATCH] Bump dependencies and require Node.js 14 --- .github/workflows/ci.yml | 7 ++++--- .xo-config.json | 6 ++++++ package.json | 37 +++++++++---------------------------- test/fixture/expected.txt | 4 ---- test/test.ts | 18 +++++++----------- tsconfig.json | 2 +- 6 files changed, 27 insertions(+), 47 deletions(-) create mode 100644 .xo-config.json delete mode 100644 test/fixture/expected.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d384f6..6fc6d47 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,14 +10,15 @@ jobs: fail-fast: false matrix: node-version: + - 20 + - 18 - 16 - 14 - - 12 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - run: git --version diff --git a/.xo-config.json b/.xo-config.json new file mode 100644 index 0000000..e4305c4 --- /dev/null +++ b/.xo-config.json @@ -0,0 +1,6 @@ +{ + "pretter": true, + "rules": { + "ava/no-ignored-test-files": "off" + } +} diff --git a/package.json b/package.json index d46e75e..0d36a5b 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "exports": "./distribution/source/index.js", "types": "distribution/source", "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": "^14.18.0 || ^16.14.0 || >=18.0.0" }, "files": [ "distribution/source" @@ -19,34 +19,15 @@ "repository": "git@github.com:LitoMore/releaz.git", "license": "MIT", "dependencies": { - "execa": "^6.0.0" + "execa": "^7.1.1" }, "devDependencies": { - "@ava/typescript": "^3.0.1", - "@sindresorhus/tsconfig": "^2.0.0", - "@types/node": "^17.0.4", - "ava": "^3.15.0", - "c8": "^7.10.0", - "del-cli": "^4.0.1", - "ts-node": "^10.4.0", - "typescript": "^4.5.4", - "xo": "^0.47.0" - }, - "ava": { - "files": [ - "test/test.ts" - ], - "extensions": { - "ts": "module" - }, - "nonSemVerExperiments": { - "configurableModuleFormat": true - }, - "nodeArguments": [ - "--loader=ts-node/esm" - ] - }, - "xo": { - "prettier": true + "@sindresorhus/tsconfig": "^3.0.1", + "@types/node": "^20.2.5", + "ava": "^5.3.0", + "c8": "^7.14.0", + "del-cli": "^5.0.0", + "typescript": "^5.1.3", + "xo": "^0.54.2" } } diff --git a/test/fixture/expected.txt b/test/fixture/expected.txt deleted file mode 100644 index 6dbb743..0000000 --- a/test/fixture/expected.txt +++ /dev/null @@ -1,4 +0,0 @@ -9077124 LitoMore Ignore unused files -54d3a04 LitoMore 0.1.0 -a3eb940 LitoMore Initial commit -6485437 LitoMore Initial commit \ No newline at end of file diff --git a/test/test.ts b/test/test.ts index 140b48f..1b11ab1 100644 --- a/test/test.ts +++ b/test/test.ts @@ -1,17 +1,13 @@ -import fs from 'node:fs'; -import url from 'node:url'; -import path from 'node:path'; import test from 'ava'; import releaz from '../source/index.js'; -console.log(import.meta.url); -const __dirname = path.dirname(url.fileURLToPath(import.meta.url)); - -test('test range and format options', async (t) => { - const expected = fs.readFileSync( - path.join(__dirname, 'fixture/expected.txt'), - 'utf8', - ); +test('test range and format options', async t => { + const expected = [ + '9077124 LitoMore Ignore unused files', + '54d3a04 LitoMore 0.1.0', + 'a3eb940 LitoMore Initial commit', + '6485437 LitoMore Initial commit', + ].join('\n'); const actual = await releaz({ range: '9077124', diff --git a/tsconfig.json b/tsconfig.json index fd23446..1604501 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "@sindresorhus/tsconfig", - "module": "ES2020", + "module": "ESNext", "moduleResolution": "node", "compilerOptions": { "esModuleInterop": true,