@gengjiawen/os-init 1.28.0 → 1.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.28.1](https://github.com/gengjiawen/os-init/compare/v1.28.0...v1.28.1) (2026-09-15)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * add pnpm global bin dir to PATH ([#45](https://github.com/gengjiawen/os-init/issues/45)) ([cfc175a](https://github.com/gengjiawen/os-init/commit/cfc175ac1559ccfe1d00ce136378e0139c531802))
9
+ * assert pnpm bin PATH entry with forward slash in tests ([#47](https://github.com/gengjiawen/os-init/issues/47)) ([1b10b41](https://github.com/gengjiawen/os-init/commit/1b10b419025fc1b7f5d7c1249b75653e013e37f6))
10
+
3
11
  ## [1.28.0](https://github.com/gengjiawen/os-init/compare/v1.27.0...v1.28.0) (2026-07-16)
4
12
 
5
13
 
@@ -33,6 +33,7 @@ function generateBashrcContent() {
33
33
  const pathEntries = [
34
34
  `${brewPrefix}/bin`,
35
35
  `${brewPrefix}/sbin`,
36
+ `${pnpmHome}/bin`,
36
37
  pnpmHome,
37
38
  `${cargoHome}/bin`,
38
39
  `${home}/.jsvu/bin`,
@@ -38,10 +38,24 @@ describe('setupEnv', () => {
38
38
  bashrcPath,
39
39
  changed: true,
40
40
  })
41
- expect(fs.readFileSync(bashrcPath, 'utf-8')).toContain('export PNPM_HOME=')
41
+ const bashrc = fs.readFileSync(bashrcPath, 'utf-8')
42
+ expect(bashrc).toContain(
43
+ `export PNPM_HOME="${path.join(tempHome, '.pnpm')}"`
44
+ )
45
+ expect(bashrc).toContain(`${path.join(tempHome, '.pnpm')}/bin`)
42
46
  expect(fs.existsSync(path.join(tempHome, '.bash_profile'))).toBe(false)
43
47
  })
44
48
 
49
+ test('adds the pnpm global bin dir to PATH on macOS', () => {
50
+ mockPlatform('darwin')
51
+
52
+ setupEnv()
53
+
54
+ const bashrc = fs.readFileSync(path.join(tempHome, '.bashrc'), 'utf-8')
55
+ // PATH entries are always joined with "/", even when path.join uses "\".
56
+ expect(bashrc).toContain(`${path.join(tempHome, 'Library', 'pnpm')}/bin`)
57
+ })
58
+
45
59
  test('creates macOS bash profile that sources bashrc', () => {
46
60
  mockPlatform('darwin')
47
61
 
package/libs/setup-env.ts CHANGED
@@ -37,6 +37,9 @@ function generateBashrcContent(): string {
37
37
  const pathEntries = [
38
38
  `${brewPrefix}/bin`,
39
39
  `${brewPrefix}/sbin`,
40
+ // pnpm 11+ resolves the global bin dir to $PNPM_HOME/bin; older versions
41
+ // placed binaries directly in $PNPM_HOME.
42
+ `${pnpmHome}/bin`,
40
43
  pnpmHome,
41
44
  `${cargoHome}/bin`,
42
45
  `${home}/.jsvu/bin`,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gengjiawen/os-init",
3
3
  "private": false,
4
- "version": "1.28.0",
4
+ "version": "1.28.1",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "bin": {