Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: runs again in commonJS and ESM #25

Merged
merged 1 commit into from
May 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `used-pm` - What package manager is used?

Simple script what detects what package manager executes the current process.
Lightweight script to detect which package manager executes the current process.

## Installation

Expand All @@ -24,9 +24,9 @@ pnpm add used-pm

## Usage

In `esm` / `typescript`:
In `esm`:

```ts
```js
import currentPackageManager from 'used-pm';

const { name, version } = currentPackageManager();
Expand Down
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,22 @@
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.js"
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
}
},
"files": [
"./dist/"
],
"scripts": {
"build": "tsc -b ./tsconfig.cjs.json ./tsconfig.esm.json",
"build": "rimraf ./dist/* && concurrently \"pnpm build:cjs\" \"pnpm build:esm\"",
"build:cjs": "tsc -b ./tsconfig.cjs.json",
"build:esm": "tsc -b ./tsconfig.esm.json",
"format": "prettier --write \"**/*.{cjs,js,mjs,ts,json,md,mdx,yaml,yml}\"",
"lint": "eslint . --ext .cjs,.js,.mjs,.ts --fix --ignore-path .gitignore",
"prepare": "ts-node ./scripts/prepare.ts && husky install"
Expand All @@ -49,11 +51,13 @@
"@mheob/eslint-config": "^4.2.1",
"@mheob/prettier-config": "^3.0.1",
"@mheob/tsconfig": "^2.0.0",
"@types/node": "^18.16.4",
"eslint": "^8.39.0",
"@types/node": "^18.16.5",
"concurrently": "^8.0.1",
"eslint": "^8.40.0",
"husky": "^8.0.3",
"lint-staged": "^13.2.2",
"prettier": "^2.8.8",
"rimraf": "^5.0.0",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
},
Expand Down
Loading