From a5ea5ae82e26d8ade2b9a662543d4662378a9bd8 Mon Sep 17 00:00:00 2001 From: Nato Boram Date: Thu, 10 Oct 2024 17:36:44 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20`rewriteRelativeImportExtensions?= =?UTF-8?q?`=20(#76)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🔧 rewriteRelativeImportExtensions * ⏪ No need to list dist anymore * 🔨 Split test and test:watch * 💚 No need to "run test run" anymore --- .github/workflows/node.js.yaml | 2 +- package.json | 5 ++- pnpm-lock.yaml | 70 +++++++++++++++++----------------- src/index.test.ts | 2 +- src/index.ts | 2 +- tsconfig.json | 1 + 6 files changed, 42 insertions(+), 40 deletions(-) diff --git a/.github/workflows/node.js.yaml b/.github/workflows/node.js.yaml index 517fe4e..8d8650f 100644 --- a/.github/workflows/node.js.yaml +++ b/.github/workflows/node.js.yaml @@ -22,4 +22,4 @@ jobs: - run: pnpm install --frozen-lockfile --strict-peer-dependencies - run: pnpm run build --noEmit - run: pnpm run lint - - run: pnpm run test run + - run: pnpm run test diff --git a/package.json b/package.json index cefdcb5..737f78b 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,8 @@ "lint": "eslint . && markdownlint-cli2 \"**/*.md\" && prettier --check .", "lint:fix": "eslint --fix --quiet .; markdownlint-cli2 \"**/*.md\" --fix; prettier --list-different --write .", "start": "node dist/main.js", - "test": "vitest" + "test": "vitest run", + "test:watch": "vitest" }, "devDependencies": { "@eslint/js": "^9.12.0", @@ -64,7 +65,7 @@ "prettier": "^3.3.3", "tsx": "^4.19.1", "typedoc": "^0.26.8", - "typescript": "^5.6.3", + "typescript": "5.7.0-beta", "typescript-eslint": "^8.8.1", "vitest": "^2.1.2" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c32c2c7..2db809b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -31,13 +31,13 @@ importers: version: 4.19.1 typedoc: specifier: ^0.26.8 - version: 0.26.8(typescript@5.6.3) + version: 0.26.8(typescript@5.7.0-beta) typescript: - specifier: ^5.6.3 - version: 5.6.3 + specifier: 5.7.0-beta + version: 5.7.0-beta typescript-eslint: specifier: ^8.8.1 - version: 8.8.1(eslint@9.12.0)(typescript@5.6.3) + version: 8.8.1(eslint@9.12.0)(typescript@5.7.0-beta) vitest: specifier: ^2.1.2 version: 2.1.2 @@ -1187,8 +1187,8 @@ packages: typescript: optional: true - typescript@5.6.3: - resolution: {integrity: sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==} + typescript@5.7.0-beta: + resolution: {integrity: sha512-opDlmEnzKdl082N5piLS43lsyugg0aORdv+XnNzMv5yP5VtBWuZhFDxU8lizmhW+PEFa/fZiShYRBxKsrkTDMQ==} engines: {node: '>=14.17'} hasBin: true @@ -1608,34 +1608,34 @@ snapshots: '@types/unist@3.0.3': {} - '@typescript-eslint/eslint-plugin@8.8.1(@typescript-eslint/parser@8.8.1(eslint@9.12.0)(typescript@5.6.3))(eslint@9.12.0)(typescript@5.6.3)': + '@typescript-eslint/eslint-plugin@8.8.1(@typescript-eslint/parser@8.8.1(eslint@9.12.0)(typescript@5.7.0-beta))(eslint@9.12.0)(typescript@5.7.0-beta)': dependencies: '@eslint-community/regexpp': 4.11.1 - '@typescript-eslint/parser': 8.8.1(eslint@9.12.0)(typescript@5.6.3) + '@typescript-eslint/parser': 8.8.1(eslint@9.12.0)(typescript@5.7.0-beta) '@typescript-eslint/scope-manager': 8.8.1 - '@typescript-eslint/type-utils': 8.8.1(eslint@9.12.0)(typescript@5.6.3) - '@typescript-eslint/utils': 8.8.1(eslint@9.12.0)(typescript@5.6.3) + '@typescript-eslint/type-utils': 8.8.1(eslint@9.12.0)(typescript@5.7.0-beta) + '@typescript-eslint/utils': 8.8.1(eslint@9.12.0)(typescript@5.7.0-beta) '@typescript-eslint/visitor-keys': 8.8.1 eslint: 9.12.0 graphemer: 1.4.0 ignore: 5.3.2 natural-compare: 1.4.0 - ts-api-utils: 1.3.0(typescript@5.6.3) + ts-api-utils: 1.3.0(typescript@5.7.0-beta) optionalDependencies: - typescript: 5.6.3 + typescript: 5.7.0-beta transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.8.1(eslint@9.12.0)(typescript@5.6.3)': + '@typescript-eslint/parser@8.8.1(eslint@9.12.0)(typescript@5.7.0-beta)': dependencies: '@typescript-eslint/scope-manager': 8.8.1 '@typescript-eslint/types': 8.8.1 - '@typescript-eslint/typescript-estree': 8.8.1(typescript@5.6.3) + '@typescript-eslint/typescript-estree': 8.8.1(typescript@5.7.0-beta) '@typescript-eslint/visitor-keys': 8.8.1 debug: 4.3.7 eslint: 9.12.0 optionalDependencies: - typescript: 5.6.3 + typescript: 5.7.0-beta transitivePeerDependencies: - supports-color @@ -1644,21 +1644,21 @@ snapshots: '@typescript-eslint/types': 8.8.1 '@typescript-eslint/visitor-keys': 8.8.1 - '@typescript-eslint/type-utils@8.8.1(eslint@9.12.0)(typescript@5.6.3)': + '@typescript-eslint/type-utils@8.8.1(eslint@9.12.0)(typescript@5.7.0-beta)': dependencies: - '@typescript-eslint/typescript-estree': 8.8.1(typescript@5.6.3) - '@typescript-eslint/utils': 8.8.1(eslint@9.12.0)(typescript@5.6.3) + '@typescript-eslint/typescript-estree': 8.8.1(typescript@5.7.0-beta) + '@typescript-eslint/utils': 8.8.1(eslint@9.12.0)(typescript@5.7.0-beta) debug: 4.3.7 - ts-api-utils: 1.3.0(typescript@5.6.3) + ts-api-utils: 1.3.0(typescript@5.7.0-beta) optionalDependencies: - typescript: 5.6.3 + typescript: 5.7.0-beta transitivePeerDependencies: - eslint - supports-color '@typescript-eslint/types@8.8.1': {} - '@typescript-eslint/typescript-estree@8.8.1(typescript@5.6.3)': + '@typescript-eslint/typescript-estree@8.8.1(typescript@5.7.0-beta)': dependencies: '@typescript-eslint/types': 8.8.1 '@typescript-eslint/visitor-keys': 8.8.1 @@ -1667,18 +1667,18 @@ snapshots: is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.6.3 - ts-api-utils: 1.3.0(typescript@5.6.3) + ts-api-utils: 1.3.0(typescript@5.7.0-beta) optionalDependencies: - typescript: 5.6.3 + typescript: 5.7.0-beta transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.8.1(eslint@9.12.0)(typescript@5.6.3)': + '@typescript-eslint/utils@8.8.1(eslint@9.12.0)(typescript@5.7.0-beta)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@9.12.0) '@typescript-eslint/scope-manager': 8.8.1 '@typescript-eslint/types': 8.8.1 - '@typescript-eslint/typescript-estree': 8.8.1(typescript@5.6.3) + '@typescript-eslint/typescript-estree': 8.8.1(typescript@5.7.0-beta) eslint: 9.12.0 transitivePeerDependencies: - supports-color @@ -2332,9 +2332,9 @@ snapshots: trim-lines@3.0.1: {} - ts-api-utils@1.3.0(typescript@5.6.3): + ts-api-utils@1.3.0(typescript@5.7.0-beta): dependencies: - typescript: 5.6.3 + typescript: 5.7.0-beta tsx@4.19.1: dependencies: @@ -2347,27 +2347,27 @@ snapshots: dependencies: prelude-ls: 1.2.1 - typedoc@0.26.8(typescript@5.6.3): + typedoc@0.26.8(typescript@5.7.0-beta): dependencies: lunr: 2.3.9 markdown-it: 14.1.0 minimatch: 9.0.5 shiki: 1.22.0 - typescript: 5.6.3 + typescript: 5.7.0-beta yaml: 2.5.1 - typescript-eslint@8.8.1(eslint@9.12.0)(typescript@5.6.3): + typescript-eslint@8.8.1(eslint@9.12.0)(typescript@5.7.0-beta): dependencies: - '@typescript-eslint/eslint-plugin': 8.8.1(@typescript-eslint/parser@8.8.1(eslint@9.12.0)(typescript@5.6.3))(eslint@9.12.0)(typescript@5.6.3) - '@typescript-eslint/parser': 8.8.1(eslint@9.12.0)(typescript@5.6.3) - '@typescript-eslint/utils': 8.8.1(eslint@9.12.0)(typescript@5.6.3) + '@typescript-eslint/eslint-plugin': 8.8.1(@typescript-eslint/parser@8.8.1(eslint@9.12.0)(typescript@5.7.0-beta))(eslint@9.12.0)(typescript@5.7.0-beta) + '@typescript-eslint/parser': 8.8.1(eslint@9.12.0)(typescript@5.7.0-beta) + '@typescript-eslint/utils': 8.8.1(eslint@9.12.0)(typescript@5.7.0-beta) optionalDependencies: - typescript: 5.6.3 + typescript: 5.7.0-beta transitivePeerDependencies: - eslint - supports-color - typescript@5.6.3: {} + typescript@5.7.0-beta: {} uc.micro@2.1.0: {} diff --git a/src/index.test.ts b/src/index.test.ts index 4fc7164..7d82afc 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import * as index from "./index.js" +import * as index from "./index.ts" test("index", ({ expect }) => { expect(index).toBeDefined() diff --git a/src/index.ts b/src/index.ts index adf228a..1aa62c8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,4 +13,4 @@ * @module */ -export type * from "./main.js" +export type * from "./main.ts" diff --git a/tsconfig.json b/tsconfig.json index 7596d13..1baecb2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,6 +15,7 @@ "rootDir": "./src", "moduleResolution": "NodeNext", "typeRoots": ["./node_modules/@types", "./src/types"], + "rewriteRelativeImportExtensions": true, "resolvePackageJsonExports": true, "resolvePackageJsonImports": true, "resolveJsonModule": true,