Skip to content
Merged

V4 #1193

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
9dbd502
- remove `simple-git/promise` and associated `gitP` export
steveukx Aug 26, 2026
cd6f8c6
- switch from yarn to pnpm
steveukx Aug 29, 2026
be07ac8
- convert jest to vitest
steveukx Aug 29, 2026
35f9e81
- upgrade biome
steveukx Aug 29, 2026
c356530
- migrate types into `src`
steveukx Aug 29, 2026
6af986a
- vite build for mjs / cjs outputs, reusing the `baseConfig` helper f…
steveukx Sep 1, 2026
d4d9aae
- apply lint across tests
steveukx Sep 1, 2026
794f4a9
- apply import ordering and type import settings to more packages
steveukx Sep 1, 2026
45946f4
- update package scripts to use pnpm from yarn
steveukx Sep 1, 2026
5e14f4e
- add declaration maps
steveukx Sep 1, 2026
7166044
- enforce the use of `GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS` environm…
steveukx Sep 1, 2026
c403ec6
- enforce the use of `GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS` environm…
steveukx Sep 1, 2026
410ddf6
- split unit and integration tests as `projects` in vitest, apply mod…
steveukx Sep 2, 2026
5dad969
- use pnpm in the github actions
steveukx Sep 2, 2026
e3e358e
- use `pnpm/setup` action in favour of `actions/setup-node`
steveukx Sep 2, 2026
9031765
- use `pnpm/setup` action in favour of `actions/setup-node`
steveukx Sep 2, 2026
89db005
- use `pnpm/setup` action in favour of `actions/setup-node`
steveukx Sep 2, 2026
12d4c16
- update self-referential tests to import from root barrel file (argv…
steveukx Sep 2, 2026
0d4f7e2
- update self-referential tests to import from root barrel file (argv…
steveukx Sep 2, 2026
19d0a5c
- update unit tests to be aware of the constant environment variable,…
steveukx Sep 2, 2026
05a414c
Lint
steveukx Sep 2, 2026
caee1f9
Update unsafe spec - no longer viable to pwn with `--u`
steveukx Sep 2, 2026
7189a9e
Use pnpm in build scripts
steveukx Sep 2, 2026
f600a49
- use `.ts` rather than `.d.ts` in source files
steveukx Sep 4, 2026
ea403b7
- CI runs consumer tests outside of main test flow
steveukx Sep 11, 2026
de92255
- examples directory uses the named import
steveukx Sep 11, 2026
a83b68b
- docs content uses the named import
steveukx Sep 11, 2026
98784ac
- add debug logging to the custom-binary plugin
steveukx Sep 11, 2026
b772078
- remove duplication in exported types
steveukx Sep 11, 2026
a13c511
- remove deprecated build tools
steveukx Sep 11, 2026
0c00296
- remove deprecated interfaces
steveukx Sep 14, 2026
2894ca3
Update lock file
steveukx Sep 14, 2026
2691eaf
- lint
steveukx Sep 14, 2026
24dfdaa
- path to windows test file
steveukx Sep 14, 2026
e2effd5
- path to windows test file
steveukx Sep 14, 2026
4723b66
- path to windows test file
steveukx Sep 14, 2026
1d19d0f
- path to windows test file
steveukx Sep 14, 2026
cb4f886
- path to windows test file
steveukx Sep 14, 2026
81943fd
- path to windows test file
steveukx Sep 14, 2026
7a40c7f
Merge remote-tracking branch 'origin/v4/playground' into v4/playground
steveukx Sep 14, 2026
9404dfc
- path to windows test file
steveukx Sep 14, 2026
4478ad0
- consumer tests allow rewriting lockfile before running
steveukx Sep 14, 2026
333725c
- consumer tests allow rewriting lockfile before running
steveukx Sep 14, 2026
7bb2c1c
- support `build:pkg` only modifying the `export` publish block, rath…
steveukx Sep 16, 2026
c6bd9b4
- add consumer tests asserting both TypeScript compilation and test r…
steveukx Sep 17, 2026
9c9ad81
- apply config-only `build:pkg` switch to the github actions setup
steveukx Sep 17, 2026
8926537
- Include `tar.command` to vulnerable config list
steveukx Sep 17, 2026
c00e651
- Add vulnerability test for use of `include.path`
steveukx Sep 17, 2026
6186230
- Add option to `unsafe.allowAbbreviatedOptions`
steveukx Sep 21, 2026
a4c5484
- Documentation for v4 release
steveukx Sep 21, 2026
b96e2df
- Lint
steveukx Sep 22, 2026
c4b551d
- Add `includeIf.<condition>.path` to the vulnerabilities list
steveukx Sep 22, 2026
3b3168e
Add support for `input` plugin.
steveukx Sep 22, 2026
9d5f9cd
Create the `git.interpretTrailers` interface
steveukx Sep 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions .changeset/calm-birds-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"simple-git": minor
---

Support one-shot stdin via `git.input(data)` (`string` or `Buffer`).

Thanks to @felipecrs for the feature request and initial implementation.
11 changes: 11 additions & 0 deletions .changeset/sha-zam-four.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@simple-git/args-pathspec": patch
"@simple-git/argv-parser": major
---

Updates ahead of the v4 release for `simple-git`.

- Adds support for TypeScript declaration maps
- Exports the `isGitEnvKey` helper to detect whether an environment variable can be used to configure a `git` operation

- Adds detection for `includeIf.<condition>.path`, thanks to @NotAFlightRisk for identifying the vulnerability
74 changes: 74 additions & 0 deletions .changeset/slow-pens-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
"simple-git": major
---

Major upgrade to v4. In this version:

- Removed previously available default export, now uses a consistently named `simpleGit` export.
- Removed previously deprecated import `simple-git/promise` (change to using the main `simple-git` import).
- Removed legacy `gitP` export (change to using the main `simpleGit` export).

```typescript
// v3 - previously supported imports
import simpleGit from 'simple-git';
import { gitP } from 'simple-git';
import simpleGit from 'simple-git/promise';
const simpleGit = require('simple-git');

// v4 - consolidates to a single supported import
import { simpleGit } from 'simple-git';
const { simpleGit } = require('simple-git');
```

- Prevents the use of abbreviated long-form `git` options:

```typescript
// v3 - allowed the use of unambiguous long-form options
git.raw('clone', '--conf=user.name=me', '...');

// v4 - requires full option names, abbreviated option names will now throw a GitConfigurationError
git.raw('fetch', '--config=user.name=me', '...');
```

- Ambient environment variables are filtered before passing into the `git` child process.

```typescript
// v3
process.env.FOO = 'bar';
process.env.GIT_TEMPLATE_DIR = './some/path';
simpleGit().raw('clone'); // git child process can see both environment variables

// v4
process.env.FOO = 'bar';
process.env.GIT_TEMPLATE_DIR = './some/path';
simpleGit().raw('clone'); // git child process now sees only FOO

simpleGit({
// explicitly allow the named environment variable so it can pass through.
allowEnvoronment: ['GIT_TEMPLATE_DIR'],
// and enable the use of an unsafe behaviour
unsafe: { allowUnsafeTemplateDir: true },
})
```

- Explicitly supplied disallowed environment variables will throw when used.

```typescript
// v3 used a single opt-in to potential unsafe actiity
simpleGit({ unsafe: { allowUnsafeTemplateDir: true } })
.env({ GIT_TEMPLATE_DIR: './foo' })
.init();

// v4 uses a double opt-in, allow the behaviour and the mechanism
simpleGit({
allowEnvoronment: ['GIT_TEMPLATE_DIR'],
unsafe: { allowUnsafeTemplateDir: true }
})
.env({ GIT_TEMPLATE_DIR: './foo' }).init();

```

- Removed content deprecated during the v2 to v3 major change
- `simpleGit.silent()` logging is configured through environment variables in the `debug` package
- `simpleGit.clearQueue()` this has been a noop since v3, switch to using the `abort` plugin
- Accessing parsed properties of a `GitResponseError` through a trailing callback function are available only through the `error.git` property (previously properties were also spread onto the `error` itself with a deprecation notice).
13 changes: 6 additions & 7 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@ jobs:
environment: npm
if: github.repository == 'steveukx/git-js'
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
with:
fetch-depth: 0

- uses: actions/setup-node@v6
- uses: pnpm/setup@v2
with:
cache: yarn
node-version: 24
runtime: node@24
cache: true

- run: yarn install --immutable
- run: yarn build
- run: pnpm build

- uses: changesets/action@v1
with:
publish: yarn changeset publish
publish: pnpm changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
49 changes: 30 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,48 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20, 22, 23, 24, 25]
node-version: [20, 22, 24, 25, 26]
steps:
- uses: actions/checkout@v6
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
- uses: actions/checkout@v7
- uses: pnpm/setup@v2
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- run: yarn install --immutable
- run: yarn build
runtime: node@${{ matrix.node-version }}
cache: true
- run: pnpm build
- name: Test
env:
GIT_AUTHOR_NAME: 'Simple Git Tests'
GIT_AUTHOR_EMAIL: 'tests@simple-git.dev'
run: yarn test
- run: yarn build:pkg
- run: yarn test:consumer
run: pnpm test

build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- name: Use Node.js 24
uses: actions/setup-node@v6
- uses: actions/checkout@v7
- uses: pnpm/setup@v2
with:
node-version: 24
cache: yarn
- run: yarn install --immutable
- run: yarn build
runtime: node@24
cache: true
- run: pnpm build
- name: Test
env:
GIT_AUTHOR_NAME: 'Simple Git Tests'
GIT_AUTHOR_EMAIL: 'tests@simple-git.dev'
run: yarn test:win
run: pnpm test:win

consumer:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 22, 24, 26 ]
steps:
- uses: actions/checkout@v7
- uses: pnpm/setup@v2
with:
runtime: node@${{ matrix.node-version }}
cache: true
- name: Build
env:
SIMPLE_GIT_PKG_CONFIG_ONLY: true
run: pnpm build && pnpm build:pkg
- run: pnpm test:consumer
12 changes: 5 additions & 7 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Use Node.js
uses: actions/setup-node@v6
- uses: actions/checkout@v7
- uses: pnpm/setup@v2
with:
node-version: 24
cache: yarn
- run: yarn install --immutable
- run: yarn lint
runtime: node@24
cache: true
- run: pnpm lint
Loading
Loading