Skip to content

Commit

Permalink
feat: support frozen production install (#255)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <[email protected]>
  • Loading branch information
BorePlusPlus and antfu authored Jan 30, 2025
1 parent f8e3f20 commit e19af36
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"fzf": "^0.5.2",
"ini": "^5.0.0",
"lint-staged": "^15.4.2",
"package-manager-detector": "^0.2.8",
"package-manager-detector": "^0.2.9",
"picocolors": "^1.1.1",
"simple-git-hooks": "^2.11.1",
"taze": "^18.3.0",
Expand Down
16 changes: 8 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/commands/nci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { parseNi } from '../parse'
import { runCli } from '../runner'

runCli(
(agent, _, hasLock) => parseNi(agent, ['--frozen-if-present'], hasLock),
(agent, args, hasLock) => parseNi(agent, [...args, '--frozen-if-present'], hasLock),
{ autoInstall: true },
)
2 changes: 2 additions & 0 deletions test/ni/bun.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ it('global', _('eslint -g', 'bun add -g eslint'))
it('frozen', _('--frozen', 'bun install --frozen-lockfile'))

it('production', _('-P', 'bun install --production'))

it('frozen production', _('--frozen -P', 'bun install --frozen-lockfile --production'))
2 changes: 2 additions & 0 deletions test/ni/npm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ it('global', _('eslint -g', 'npm i -g eslint'))
it('frozen', _('--frozen', 'npm ci'))

it('production', _('-P', 'npm i --omit=dev'))

it('frozen production', _('--frozen -P', 'npm ci --omit=dev'))
2 changes: 2 additions & 0 deletions test/ni/pnpm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ it('forward1', _('--anything', 'pnpm i --anything'))
it('forward2', _('-a', 'pnpm i -a'))

it('production', _('-P', 'pnpm i --production'))

it('frozen production', _('--frozen -P', 'pnpm i --frozen-lockfile --production'))
2 changes: 2 additions & 0 deletions test/ni/yarn.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ it('global', _('eslint ni -g', 'yarn global add eslint ni'))
it('frozen', _('--frozen', 'yarn install --frozen-lockfile'))

it('production', _('-P', 'yarn install --production'))

it('frozen production', _('--frozen -P', 'yarn install --frozen-lockfile --production'))
2 changes: 2 additions & 0 deletions test/ni/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ it('global', _('eslint ni -g', 'npm i -g eslint ni'))
it('frozen', _('--frozen', 'yarn install --immutable'))

it('production', _('-P', 'yarn install --production'))

it('frozen production', _('--frozen -P', 'yarn install --immutable --production'))

0 comments on commit e19af36

Please sign in to comment.