From b2ed13ea36835a62c067eb659a87a61257cea386 Mon Sep 17 00:00:00 2001 From: Sondre Aasemoen Date: Wed, 27 Nov 2024 23:20:14 +0100 Subject: [PATCH] Bump typescript, use @tsconfig/bases packages for config --- package.json | 5 +++-- pnpm-lock.yaml | 41 +++++++++++++++++++++-------------------- src/compress.ts | 4 ++-- tsconfig.json | 9 ++++++--- 4 files changed, 32 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index 4499d17..2e2794b 100644 --- a/package.json +++ b/package.json @@ -27,11 +27,12 @@ }, "devDependencies": { "@biomejs/biome": "1.9.4", - "@sondr3/tsconfig": "0.8.0", + "@tsconfig/recommended": "1.0.8", + "@tsconfig/strictest": "2.0.5", "@types/node": "18.15.3", "astro": "2.1.3", "lefthook": "1.8.4", - "typescript": "4.9.5", + "typescript": "5.7.2", "vitest": "2.1.6" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7a29c32..2be348e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,9 +11,12 @@ importers: '@biomejs/biome': specifier: 1.9.4 version: 1.9.4 - '@sondr3/tsconfig': - specifier: 0.8.0 - version: 0.8.0 + '@tsconfig/recommended': + specifier: 1.0.8 + version: 1.0.8 + '@tsconfig/strictest': + specifier: 2.0.5 + version: 2.0.5 '@types/node': specifier: 18.15.3 version: 18.15.3 @@ -24,8 +27,8 @@ importers: specifier: 1.8.4 version: 1.8.4 typescript: - specifier: 4.9.5 - version: 4.9.5 + specifier: 5.7.2 + version: 5.7.2 vitest: specifier: 2.1.6 version: 2.1.6(@types/node@18.15.3) @@ -641,8 +644,11 @@ packages: cpu: [x64] os: [win32] - '@sondr3/tsconfig@0.8.0': - resolution: {integrity: sha512-8LW4k/nJqr1AMj/3sav8IJlya5HYrEml+Z3mUqKWm87StB9PPwDrcKiE8uVMnVnv/gDPcTgDO2uBPr+gwdWlUQ==} + '@tsconfig/recommended@1.0.8': + resolution: {integrity: sha512-TotjFaaXveVUdsrXCdalyF6E5RyG6+7hHHQVZonQtdlk1rJZ1myDIvPUUKPhoYv+JAzThb2lQJh9+9ZfF46hsA==} + + '@tsconfig/strictest@2.0.5': + resolution: {integrity: sha512-ec4tjL2Rr0pkZ5hww65c+EEPYwxOi4Ryv+0MtjeaSQRJyq322Q27eOQiFbuNgw2hpL4hB1/W/HBGk3VKS43osg==} '@types/babel__core@7.20.0': resolution: {integrity: sha512-+n8dL/9GWblDO0iU6eZAwEIJVr5DWigtle+Q6HLOrh/pdbXOhOtqzq8VPPE2zvNJzSKY4vH/z3iT3tn0A3ypiQ==} @@ -1926,14 +1932,9 @@ packages: resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} engines: {node: '>=12.20'} - typescript@4.9.5: - resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} - engines: {node: '>=4.2.0'} - hasBin: true - - typescript@5.0.2: - resolution: {integrity: sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==} - engines: {node: '>=12.20'} + typescript@5.7.2: + resolution: {integrity: sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==} + engines: {node: '>=14.17'} hasBin: true undici@5.20.0: @@ -2687,7 +2688,9 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.27.4': optional: true - '@sondr3/tsconfig@0.8.0': {} + '@tsconfig/recommended@1.0.8': {} + + '@tsconfig/strictest@2.0.5': {} '@types/babel__core@7.20.0': dependencies: @@ -2876,7 +2879,7 @@ snapshots: strip-ansi: 7.0.1 supports-esm: 1.0.0 tsconfig-resolver: 3.0.1 - typescript: 5.0.2 + typescript: 5.7.2 unist-util-visit: 4.1.2 vfile: 5.3.7 vite: 4.2.0(@types/node@18.15.3) @@ -4217,9 +4220,7 @@ snapshots: type-fest@2.19.0: {} - typescript@4.9.5: {} - - typescript@5.0.2: {} + typescript@5.7.2: {} undici@5.20.0: dependencies: diff --git a/src/compress.ts b/src/compress.ts index 7c6da76..086f400 100644 --- a/src/compress.ts +++ b/src/compress.ts @@ -41,7 +41,7 @@ export const gzip = async (dir: string, extensions: Array, enabled?: boo } const end = hrtime.bigint(); - logger.success(`finished gzip of ${counter} files in ${(end - start) / 1000000n}ms`); + logger.success(`finished gzip of ${counter} files in ${(end - start) / BigInt(1000000)}ms`); }; export const brotli = async (dir: string, extensions: Array, enabled?: boolean): Promise => { @@ -62,5 +62,5 @@ export const brotli = async (dir: string, extensions: Array, enabled?: b } const end = hrtime.bigint(); - logger.success(`finished brotli of ${counter} files in ${(end - start) / 1000000n}ms`); + logger.success(`finished brotli of ${counter} files in ${(end - start) / BigInt(1000000)}ms`); }; diff --git a/tsconfig.json b/tsconfig.json index 1de0128..97f113f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,12 +1,15 @@ { - "extends": "@sondr3/tsconfig", + "extends": ["@tsconfig/recommended/tsconfig.json", "@tsconfig/strictest/tsconfig.json"], "compilerOptions": { "lib": ["ES2020"], - "skipLibCheck": true, + "target": "ES2020", + "module": "NodeNext", + "moduleResolution": "nodenext", + "noUncheckedSideEffectImports": true, "declaration": true, "declarationMap": true, "outDir": "dist" }, "include": ["src"], - "exclude": ["coverage", "node_modules", "dist"] + "exclude": ["coverage", "node_modules", "dist", "test"] }