-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a simply way to force pm config
- Loading branch information
Showing
5 changed files
with
93 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,51 @@ | ||
# pm-keeper | ||
|
||
A keeper of package manager. Make sure a specific version and package manager to be used in project. | ||
A simple way to force package manager in your project. | ||
|
||
# usage | ||
|
||
Add a `preinstall` script in your project's `package.json`. | ||
Add a `preinstall` script in your project's `package.json`, link this: | ||
|
||
```json | ||
{ | ||
"scripts": { | ||
"preinstall": "npx pm-keeper" | ||
"preinstall": "npx pm-keeper npm" | ||
} | ||
} | ||
``` | ||
|
||
And force the pm's version | ||
|
||
```json | ||
{ | ||
"scripts": { | ||
"preinstall": "npx pm-keeper [email protected]" | ||
} | ||
} | ||
``` | ||
|
||
And add a `pmKeeper` options in ypur `package.json`. | ||
or | ||
|
||
```json | ||
{ | ||
"scripts": { | ||
"preinstall": "npx pm-keeper npm 6.14.11" | ||
} | ||
} | ||
``` | ||
|
||
Of course, you can set a options in your `package.json`, link this: | ||
|
||
```json | ||
{ | ||
"scripts": { | ||
"preinstall": "npx pm-keeper" | ||
}, | ||
"pmKeeper": { | ||
"name": "npm", // package manager name | ||
// "version": "6.14.1" // package manager version | ||
"name": "npm", | ||
"version": "6.14.1" // optional | ||
} | ||
} | ||
``` | ||
|
||
enjoy | ||
have fun |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "pm-keeper", | ||
"version": "1.1.1", | ||
"version": "1.1.10", | ||
"description": "package version keeper", | ||
"author": "liwuhou <[email protected]>", | ||
"license": "MIT", | ||
|
@@ -13,9 +13,9 @@ | |
], | ||
"bin": "bin/index.js", | ||
"scripts": { | ||
"test": "test", | ||
"build": "rimraf dist && tsup src --format cjs,esm,iife --dts", | ||
"watch": "npm run build -- --watch" | ||
"dev": "npm run build -- --watch", | ||
"prebuild": "rimraf dist", | ||
"build": "tsup src --format cjs,esm,iife --dts" | ||
}, | ||
"keywords": [ | ||
"npm", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const AGENT = [ | ||
'npm', | ||
'yarn', | ||
'pnpm' | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters