From a4c4a820ec8c4ba21d9d54566f48f1aa59c37c7f Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Wed, 15 Jan 2025 20:53:40 +0800 Subject: [PATCH] feat: esm-only by default --- LICENSE.md | 2 +- README.md | 2 +- build.config.ts | 3 -- package.json | 20 ++++----- pnpm-lock.yaml | 108 ++++++++++++++++++++++++++---------------------- 5 files changed, 69 insertions(+), 66 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 7d71216..29f64e0 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Anthony Fu +Copyright (c) 2025-PRESENT Anthony Fu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 9fbe810..8a9a424 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ _description_ ## License -[MIT](./LICENSE) License © 2024-PRESENT [Anthony Fu](https://github.com/antfu) +[MIT](./LICENSE) License © [Anthony Fu](https://github.com/antfu) diff --git a/build.config.ts b/build.config.ts index 0bd008c..fe73ea0 100644 --- a/build.config.ts +++ b/build.config.ts @@ -6,7 +6,4 @@ export default defineBuildConfig({ ], declaration: true, clean: true, - rollup: { - emitCJS: true, - }, }) diff --git a/package.json b/package.json index 4a4a5e8..0c48382 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "pkg-placeholder", "type": "module", "version": "0.0.0", - "packageManager": "pnpm@9.15.3", + "packageManager": "pnpm@9.15.4", "description": "_description_", "author": "Anthony Fu ", "license": "MIT", @@ -16,15 +16,11 @@ "keywords": [], "sideEffects": false, "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs" - } + ".": "./dist/index.mjs" }, "main": "./dist/index.mjs", "module": "./dist/index.mjs", - "types": "./dist/index.d.ts", + "types": "./dist/index.d.mts", "typesVersions": { "*": { "*": [ @@ -50,16 +46,16 @@ "devDependencies": { "@antfu/eslint-config": "^3.14.0", "@antfu/ni": "^23.2.0", - "@antfu/utils": "^8.0.0", - "@types/node": "^22.10.5", - "bumpp": "^9.10.0", + "@antfu/utils": "^8.1.0", + "@types/node": "^22.10.6", + "bumpp": "^9.10.1", "eslint": "^9.18.0", "lint-staged": "^15.3.0", - "pnpm": "^9.15.3", + "pnpm": "^9.15.4", "simple-git-hooks": "^2.11.1", "tsx": "^4.19.2", "typescript": "^5.7.3", - "unbuild": "^3.3.0", + "unbuild": "^3.3.1", "vite": "^6.0.7", "vitest": "^2.1.8" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 35827f4..4012312 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,19 +10,19 @@ importers: devDependencies: '@antfu/eslint-config': specifier: ^3.14.0 - version: 3.14.0(@typescript-eslint/utils@8.19.1(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3))(@vue/compiler-sfc@3.3.10)(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3)(vitest@2.1.8(@types/node@22.10.5)) + version: 3.14.0(@typescript-eslint/utils@8.19.1(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3))(@vue/compiler-sfc@3.3.10)(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3)(vitest@2.1.8(@types/node@22.10.6)) '@antfu/ni': specifier: ^23.2.0 version: 23.2.0 '@antfu/utils': - specifier: ^8.0.0 - version: 8.0.0 + specifier: ^8.1.0 + version: 8.1.0 '@types/node': - specifier: ^22.10.5 - version: 22.10.5 + specifier: ^22.10.6 + version: 22.10.6 bumpp: - specifier: ^9.10.0 - version: 9.10.0 + specifier: ^9.10.1 + version: 9.10.1 eslint: specifier: ^9.18.0 version: 9.18.0(jiti@2.4.2) @@ -30,8 +30,8 @@ importers: specifier: ^15.3.0 version: 15.3.0 pnpm: - specifier: ^9.15.3 - version: 9.15.3 + specifier: ^9.15.4 + version: 9.15.4 simple-git-hooks: specifier: ^2.11.1 version: 2.11.1 @@ -42,14 +42,14 @@ importers: specifier: ^5.7.3 version: 5.7.3 unbuild: - specifier: ^3.3.0 - version: 3.3.0(typescript@5.7.3) + specifier: ^3.3.1 + version: 3.3.1(typescript@5.7.3) vite: specifier: ^6.0.7 - version: 6.0.7(@types/node@22.10.5)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.6.1) + version: 6.0.7(@types/node@22.10.6)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.6.1) vitest: specifier: ^2.1.8 - version: 2.1.8(@types/node@22.10.5) + version: 2.1.8(@types/node@22.10.6) packages: @@ -113,8 +113,8 @@ packages: '@antfu/utils@0.7.10': resolution: {integrity: sha512-+562v9k4aI80m1+VuMHehNJWLOFjBnXn3tdOitzD0il5b7smkSBal4+a3oKiQTbrwMmN/TBUMDvbdoWDehgOww==} - '@antfu/utils@8.0.0': - resolution: {integrity: sha512-3NfBIlWj8ffBHdNiedaiea1xIy0NIZZaqQwTbmwXa4sGekD5UarRU3NfXScpuC5aw99KCvErew3PHxGJeHqeAg==} + '@antfu/utils@8.1.0': + resolution: {integrity: sha512-XPR7Jfwp0FFl/dFYPX8ZjpmU4/1mIXTjnZ1ba48BLMyKOV62/tiRjdsFcPs2hsYcSud4tzk7w3a3LjX8Fu3huA==} '@babel/code-frame@7.26.2': resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==} @@ -916,8 +916,8 @@ packages: '@types/ms@0.7.34': resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==} - '@types/node@22.10.5': - resolution: {integrity: sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ==} + '@types/node@22.10.6': + resolution: {integrity: sha512-qNiuwC4ZDAUNcY47xgaSuS92cjf8JbSUoaKS77bmLG1rU7MlATVSiw/IlrjtIyyskXBZ8KkNfjK/P5na7rgXbQ==} '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -1111,8 +1111,8 @@ packages: resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} engines: {node: '>=6'} - bumpp@9.10.0: - resolution: {integrity: sha512-gNY3tYEGKyqW8+qtpeLQ2UfQW7G81d/vhCWNGrMlvy0Toq1LZPRs8wk9woAw8o9Tzv7pvjaF/Gno+UN3qiqNxA==} + bumpp@9.10.1: + resolution: {integrity: sha512-KG7oQmv6cz7QQwOvM3x/yPcF8+VBEtuLEEecmohNyb4+bLbtSVpJp8brjzcZYQN7UOyR4i0qIIYThnsBgP8uCA==} engines: {node: '>=10'} hasBin: true @@ -2127,6 +2127,9 @@ packages: mlly@1.7.3: resolution: {integrity: sha512-xUsx5n/mN0uQf4V548PKQ+YShA4/IW0KI1dZhrNrPCLG+xizETbHTkOa1f8/xut9JRPp8kQuMnz0oqwkTiLo/A==} + mlly@1.7.4: + resolution: {integrity: sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw==} + ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} @@ -2272,8 +2275,8 @@ packages: resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} engines: {node: '>=4'} - pnpm@9.15.3: - resolution: {integrity: sha512-H3m8JFpm6wsHxdTYMTEkB3RkLKqobvfQQ0q0fA0W9msE4h4MCG62HmLHfvxNf37Aca+tN5avZIkvrmZQkXOJOg==} + pnpm@9.15.4: + resolution: {integrity: sha512-stwg4vxys+GISEWbNzWaMgZGY+VielHkx0ssKd2OjgSRSDw6u0B4nP1Xi/Ni+2uoJhsF8Dh9dnku1uI+o7G2oA==} engines: {node: '>=18.12'} hasBin: true @@ -2767,11 +2770,11 @@ packages: ufo@1.5.4: resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==} - unbuild@3.3.0: - resolution: {integrity: sha512-DRBK6KpMo4A2gAkQglItfLWbjJtiBfNfS87UCLf0yoDsxUUwU4AgQJru0dGoX0vW8bfMaBynvWgTUtzr4CJcbQ==} + unbuild@3.3.1: + resolution: {integrity: sha512-/5OeeHmW1JlWEyQw3SPkB9BV16lzr6C5i8D+O17NLx6ETgvCZ3ZlyXfWkVVfG2YCsv8xAVQCqJNJtbEAGwHg7A==} hasBin: true peerDependencies: - typescript: ^5.7.2 + typescript: ^5.7.3 peerDependenciesMeta: typescript: optional: true @@ -2984,7 +2987,7 @@ snapshots: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 - '@antfu/eslint-config@3.14.0(@typescript-eslint/utils@8.19.1(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3))(@vue/compiler-sfc@3.3.10)(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3)(vitest@2.1.8(@types/node@22.10.5))': + '@antfu/eslint-config@3.14.0(@typescript-eslint/utils@8.19.1(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3))(@vue/compiler-sfc@3.3.10)(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3)(vitest@2.1.8(@types/node@22.10.6))': dependencies: '@antfu/install-pkg': 1.0.0 '@clack/prompts': 0.9.1 @@ -2993,7 +2996,7 @@ snapshots: '@stylistic/eslint-plugin': 2.13.0(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3) '@typescript-eslint/eslint-plugin': 8.19.1(@typescript-eslint/parser@8.19.1(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3))(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3) '@typescript-eslint/parser': 8.19.1(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3) - '@vitest/eslint-plugin': 1.1.25(@typescript-eslint/utils@8.19.1(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3))(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3)(vitest@2.1.8(@types/node@22.10.5)) + '@vitest/eslint-plugin': 1.1.25(@typescript-eslint/utils@8.19.1(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3))(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3)(vitest@2.1.8(@types/node@22.10.6)) eslint: 9.18.0(jiti@2.4.2) eslint-config-flat-gitignore: 1.0.0(eslint@9.18.0(jiti@2.4.2)) eslint-flat-config-utils: 1.0.0 @@ -3039,7 +3042,7 @@ snapshots: '@antfu/utils@0.7.10': {} - '@antfu/utils@8.0.0': {} + '@antfu/utils@8.1.0': {} '@babel/code-frame@7.26.2': dependencies: @@ -3627,7 +3630,7 @@ snapshots: '@types/ms@0.7.34': {} - '@types/node@22.10.5': + '@types/node@22.10.6': dependencies: undici-types: 6.20.0 @@ -3714,13 +3717,13 @@ snapshots: '@typescript-eslint/types': 8.19.1 eslint-visitor-keys: 4.2.0 - '@vitest/eslint-plugin@1.1.25(@typescript-eslint/utils@8.19.1(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3))(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3)(vitest@2.1.8(@types/node@22.10.5))': + '@vitest/eslint-plugin@1.1.25(@typescript-eslint/utils@8.19.1(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3))(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3)(vitest@2.1.8(@types/node@22.10.6))': dependencies: '@typescript-eslint/utils': 8.19.1(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.3) eslint: 9.18.0(jiti@2.4.2) optionalDependencies: typescript: 5.7.3 - vitest: 2.1.8(@types/node@22.10.5) + vitest: 2.1.8(@types/node@22.10.6) '@vitest/expect@2.1.8': dependencies: @@ -3729,13 +3732,13 @@ snapshots: chai: 5.1.2 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.8(vite@5.4.11(@types/node@22.10.5))': + '@vitest/mocker@2.1.8(vite@5.4.11(@types/node@22.10.6))': dependencies: '@vitest/spy': 2.1.8 estree-walker: 3.0.3 magic-string: 0.30.17 optionalDependencies: - vite: 5.4.11(@types/node@22.10.5) + vite: 5.4.11(@types/node@22.10.6) '@vitest/pretty-format@2.1.8': dependencies: @@ -3871,7 +3874,7 @@ snapshots: builtin-modules@3.3.0: {} - bumpp@9.10.0: + bumpp@9.10.1: dependencies: c12: 2.0.1 cac: 6.7.14 @@ -5170,7 +5173,7 @@ snapshots: defu: 6.1.4 esbuild: 0.24.2 jiti: 1.21.7 - mlly: 1.7.3 + mlly: 1.7.4 pathe: 1.1.2 pkg-types: 1.3.0 postcss: 8.4.49 @@ -5187,6 +5190,13 @@ snapshots: pkg-types: 1.3.0 ufo: 1.5.4 + mlly@1.7.4: + dependencies: + acorn: 8.14.0 + pathe: 2.0.1 + pkg-types: 1.3.0 + ufo: 1.5.4 + ms@2.1.3: {} nanoid@3.3.7: {} @@ -5308,12 +5318,12 @@ snapshots: pkg-types@1.3.0: dependencies: confbox: 0.1.8 - mlly: 1.7.3 + mlly: 1.7.4 pathe: 1.1.2 pluralize@8.0.0: {} - pnpm@9.15.3: {} + pnpm@9.15.4: {} postcss-calc@10.0.2(postcss@8.4.49): dependencies: @@ -5782,7 +5792,7 @@ snapshots: ufo@1.5.4: {} - unbuild@3.3.0(typescript@5.7.3): + unbuild@3.3.1(typescript@5.7.3): dependencies: '@rollup/plugin-alias': 5.1.1(rollup@4.30.1) '@rollup/plugin-commonjs': 28.0.2(rollup@4.30.1) @@ -5798,7 +5808,7 @@ snapshots: jiti: 2.4.2 magic-string: 0.30.17 mkdist: 2.2.0(typescript@5.7.3) - mlly: 1.7.3 + mlly: 1.7.4 pathe: 2.0.1 pkg-types: 1.3.0 pretty-bytes: 6.1.1 @@ -5866,13 +5876,13 @@ snapshots: spdx-correct: 3.2.0 spdx-expression-parse: 3.0.1 - vite-node@2.1.8(@types/node@22.10.5): + vite-node@2.1.8(@types/node@22.10.6): dependencies: cac: 6.7.14 debug: 4.4.0 es-module-lexer: 1.5.4 pathe: 1.1.2 - vite: 5.4.11(@types/node@22.10.5) + vite: 5.4.11(@types/node@22.10.6) transitivePeerDependencies: - '@types/node' - less @@ -5884,31 +5894,31 @@ snapshots: - supports-color - terser - vite@5.4.11(@types/node@22.10.5): + vite@5.4.11(@types/node@22.10.6): dependencies: esbuild: 0.21.5 postcss: 8.4.49 rollup: 4.30.1 optionalDependencies: - '@types/node': 22.10.5 + '@types/node': 22.10.6 fsevents: 2.3.3 - vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.6.1): + vite@6.0.7(@types/node@22.10.6)(jiti@2.4.2)(tsx@4.19.2)(yaml@2.6.1): dependencies: esbuild: 0.24.2 postcss: 8.4.49 rollup: 4.30.1 optionalDependencies: - '@types/node': 22.10.5 + '@types/node': 22.10.6 fsevents: 2.3.3 jiti: 2.4.2 tsx: 4.19.2 yaml: 2.6.1 - vitest@2.1.8(@types/node@22.10.5): + vitest@2.1.8(@types/node@22.10.6): dependencies: '@vitest/expect': 2.1.8 - '@vitest/mocker': 2.1.8(vite@5.4.11(@types/node@22.10.5)) + '@vitest/mocker': 2.1.8(vite@5.4.11(@types/node@22.10.6)) '@vitest/pretty-format': 2.1.8 '@vitest/runner': 2.1.8 '@vitest/snapshot': 2.1.8 @@ -5924,11 +5934,11 @@ snapshots: tinyexec: 0.3.2 tinypool: 1.0.2 tinyrainbow: 1.2.0 - vite: 5.4.11(@types/node@22.10.5) - vite-node: 2.1.8(@types/node@22.10.5) + vite: 5.4.11(@types/node@22.10.6) + vite-node: 2.1.8(@types/node@22.10.6) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 22.10.5 + '@types/node': 22.10.6 transitivePeerDependencies: - less - lightningcss