Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: antfu-collective/ni
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v23.3.1
Choose a base ref
...
head repository: antfu-collective/ni
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v24.0.0
Choose a head ref
  • 7 commits
  • 10 files changed
  • 4 contributors

Commits on Jan 31, 2025

  1. docs: add info about bun.lock (#257)

    szamanr authored Jan 31, 2025
    Copy the full SHA
    4d15f4e View commit details

Commits on Feb 3, 2025

  1. docs: update How section (#258)

    userquin authored Feb 3, 2025
    Copy the full SHA
    3797d46 View commit details

Commits on Feb 12, 2025

  1. feat: replace picocolors with ansis (#259)

    webdiscus authored Feb 12, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    a948b8b View commit details

Commits on Mar 10, 2025

  1. chore: update deps

    antfu committed Mar 10, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    ae15b07 View commit details
  2. chore: remove fs-extra

    antfu committed Mar 10, 2025
    Copy the full SHA
    fbd6a19 View commit details
  3. Copy the full SHA
    b832b70 View commit details
  4. chore: release v24.0.0

    antfu committed Mar 10, 2025
    Copy the full SHA
    f328fe7 View commit details
Showing with 1,022 additions and 1,357 deletions.
  1. +2 −2 README.md
  2. +1 −5 build.config.ts
  3. +23 −23 package.json
  4. +984 −1,315 pnpm-lock.yaml
  5. +1 −1 src/commands/ni.ts
  6. +2 −2 src/fetch.ts
  7. +3 −3 src/runner.ts
  8. +2 −2 src/utils.ts
  9. +2 −2 test/programmatic/detect.spec.ts
  10. +2 −2 test/programmatic/runCli.spec.ts
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -293,9 +293,9 @@ asdf global ni latest

### How?

**ni** assumes that you work with lockfiles (and you should)
**ni** assumes that you work with lock-files (and you should).

Before it runs, it will detect your `yarn.lock` / `pnpm-lock.yaml` / `package-lock.json` / `bun.lockb` to know current package manager (or `packageManager` field in your packages.json if specified), and runs the [corresponding commands](https://github.com/antfu/ni/blob/main/src/agents.ts).
Before `ni` runs the command, it detects your `yarn.lock` / `pnpm-lock.yaml` / `package-lock.json` / `bun.lock` / `bun.lockb` to know the current package manager (or `packageManager` field in your packages.json if specified) using the [package-manager-detector](https://github.com/antfu-collective/package-manager-detector) package and then runs the corresponding [package-manager-detector command](https://github.com/antfu-collective/package-manager-detector/blob/main/src/commands.ts).

### Trouble shooting

6 changes: 1 addition & 5 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -11,12 +11,8 @@ export default defineBuildConfig({
name: basename(i).slice(0, -3),
})),
clean: true,
declaration: true,
declaration: 'node16',
rollup: {
emitCJS: true,
inlineDependencies: true,
commonjs: {
exclude: ['**/*.d.ts'],
},
},
})
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@antfu/ni",
"type": "module",
"version": "23.3.1",
"packageManager": "pnpm@9.15.4",
"version": "24.0.0",
"packageManager": "pnpm@10.6.2",
"description": "Use the right package manager",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
@@ -15,14 +15,11 @@
"url": "https://github.com/antfu-collective/ni/issues"
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
".": "./dist/index.mjs"
},
"main": "./dist/index.cjs",
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"types": "./dist/index.d.mts",
"bin": {
"ni": "bin/ni.mjs",
"nci": "bin/nci.mjs",
@@ -49,31 +46,34 @@
"test": "vitest"
},
"devDependencies": {
"@antfu/eslint-config": "^4.0.1",
"@antfu/eslint-config": "^4.8.1",
"@posva/prompts": "^2.4.4",
"@types/fs-extra": "^11.0.4",
"@types/ini": "^4.1.1",
"@types/node": "^22.10.10",
"@types/node": "^22.13.10",
"@types/which": "^3.0.4",
"bumpp": "^10.0.1",
"eslint": "^9.19.0",
"fs-extra": "^11.3.0",
"ansis": "^3.17.0",
"bumpp": "^10.0.3",
"eslint": "^9.22.0",
"fzf": "^0.5.2",
"ini": "^5.0.0",
"lint-staged": "^15.4.2",
"package-manager-detector": "^0.2.9",
"picocolors": "^1.1.1",
"lint-staged": "^15.4.3",
"package-manager-detector": "^1.0.0",
"simple-git-hooks": "^2.11.1",
"taze": "^18.3.0",
"taze": "^18.7.1",
"terminal-link": "^3.0.0",
"tinyexec": "^0.3.2",
"tinyglobby": "^0.2.10",
"tsx": "^4.19.2",
"typescript": "^5.7.3",
"unbuild": "^3.3.1",
"vitest": "^3.0.4",
"tinyglobby": "^0.2.12",
"tsx": "^4.19.3",
"typescript": "^5.8.2",
"unbuild": "^3.5.0",
"vitest": "^3.0.8",
"which": "^5.0.0"
},
"pnpm": {
"onlyBuiltDependencies": [
"esbuild"
]
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged"
},
Loading