From 4ba81972326ad82c10e4feca2ab006d122686aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20S=C3=A1nchez?= Date: Tue, 11 Jun 2024 17:47:38 +0200 Subject: [PATCH] refactor: split package exports (#46) --- package.json | 69 +++++++++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index 9587e8c..d343530 100644 --- a/package.json +++ b/package.json @@ -1,37 +1,53 @@ { "name": "tinyspy", - "version": "3.0.0", "type": "module", + "version": "3.0.0", "packageManager": "pnpm@9.1.1", - "scripts": { - "dev": "tsup --watch", - "build": "tsup", - "prepare": "husky", - "publish-test": "clean-publish --without-publish", - "release": "bumpp package.json --commit --push --tag && tsup && clean-publish", - "test": "vitest --no-isolate" + "description": "A minimal fork of nanospy, with more features", + "license": "MIT", + "homepage": "https://github.com/tinylibs/tinyspy#readme", + "repository": { + "type": "git", + "url": "git+https://github.com/tinylibs/tinyspy.git" + }, + "bugs": { + "url": "https://github.com/tinylibs/tinyspy/issues" + }, + "keywords": [ + "spy", + "mock", + "typescript", + "method" + ], + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } }, "main": "./dist/index.cjs", "module": "./dist/index.js", "types": "./dist/index.d.ts", - "exports": { - "types": "./dist/index.d.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs", - "default": "./dist/index.cjs" - }, "files": [ - "dist/**" + "dist" ], - "repository": { - "type": "git", - "url": "git+https://github.com/tinylibs/tinyspy.git" + "engines": { + "node": ">=14.0.0" }, - "license": "MIT", - "bugs": { - "url": "https://github.com/tinylibs/tinyspy/issues" + "scripts": { + "dev": "tsup --watch", + "build": "tsup", + "prepare": "husky", + "publish-test": "clean-publish --without-publish", + "release": "bumpp package.json --commit --push --tag && tsup && clean-publish", + "test": "vitest --no-isolate" }, - "homepage": "https://github.com/tinylibs/tinyspy#readme", "devDependencies": { "@size-limit/preset-small-lib": "^11.1.4", "@size-limit/time": "^11.1.4", @@ -48,14 +64,5 @@ "typescript": "^5.4.5", "vite": "^5.2.1", "vitest": "^1.6.0" - }, - "keywords": [ - "spy", - "mock", - "typescript", - "method" - ], - "engines": { - "node": ">=14.0.0" } }