gitsu-cli 1.0.0 → 1.0.3

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.
Binary file
@@ -8,6 +8,8 @@ on:
8
8
 
9
9
  permissions:
10
10
  contents: write
11
+ pull-requests: read
12
+ statuses: write
11
13
 
12
14
  jobs:
13
15
  build:
@@ -38,9 +40,16 @@ jobs:
38
40
  - name: Checkout
39
41
  uses: actions/checkout@v4
40
42
 
43
+ - name: Install Dependencies
44
+ run: npm install
45
+
46
+ - name: Build
47
+ run: npm run build
48
+
41
49
  - name: Semantic Release
42
50
  id: release
43
51
  uses: cycjimmy/semantic-release-action@v4
44
52
  env:
45
53
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46
54
  NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
55
+ HUSKY: 0
package/.husky/pre-push CHANGED
@@ -1 +1 @@
1
- npm run lint && npm run build && npm run test
1
+ npm run lint && npm run build
package/CHANGELOG.md ADDED
@@ -0,0 +1,27 @@
1
+ ## [1.0.3](https://github.com/jamieweavis/gitsu/compare/v1.0.2...v1.0.3) (2025-03-16)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * npm publish ([0f76e46](https://github.com/jamieweavis/gitsu/commit/0f76e463d8208811b07430a7a499988e67ca6e68))
7
+
8
+ ## [1.0.2](https://github.com/jamieweavis/gitsu/compare/v1.0.1...v1.0.2) (2025-03-16)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * save git config globally ([d744f2f](https://github.com/jamieweavis/gitsu/commit/d744f2ff3c39187531c60d41df3269b8f4bd7d7e))
14
+
15
+ ## [1.0.1](https://github.com/jamieweavis/gitsu/compare/v1.0.0...v1.0.1) (2025-03-15)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * description and docs ([4edfd7f](https://github.com/jamieweavis/gitsu/commit/4edfd7fc3b81dc6965a996226171224849efc4a8))
21
+
22
+ # 1.0.0 (2025-03-15)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * description, output & badges ([294bd7b](https://github.com/jamieweavis/gitsu/commit/294bd7bcd2fb7355539d76aae09f546ae63927ef))
package/README.md CHANGED
@@ -1,11 +1,13 @@
1
- # gitsu <img alt="Ninja Emoji" align="right" width=40 height=40 alt="Screenshot" src="./.github/ninja.svg">
1
+ # gitsu
2
2
 
3
- > 🥷 Util for quickly & easily switching git users from a config stored at ~/.gitsurc
3
+ > 🥷 Command line util for quickly & easily switching git users
4
4
 
5
- [![build](https://github.com/jamieweavis/streaker/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/jamieweavis/streaker/actions)
6
- [![downloads](https://img.shields.io/github/downloads/jamieweavis/streaker/total.svg)](https://github.com/jamieweavis/streaker/releases)
7
- [![version](https://img.shields.io/github/release/jamieweavis/streaker.svg)](https://github.com/jamieweavis/streaker/releases)
8
- [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jamieweavis/streaker/blob/main/LICENSE)
5
+ [![build](https://github.com/jamieweavis/gitsu/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/jamieweavis/gitsu/actions)
6
+ [![downloads](https://img.shields.io/npm/dt/gitsu-cli.svg)](https://npmjs.com/package/gitsu-cli)
7
+ [![version](https://img.shields.io/github/release/jamieweavis/gitsu.svg)](https://github.com/jamieweavis/gitsu/releases)
8
+ [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jamieweavis/gitsu/blob/main/LICENSE)
9
+
10
+ <img width=678 alt="Screenshot" src="./.github/screenshot.png">
9
11
 
10
12
  ## Install
11
13
 
@@ -15,7 +17,7 @@ npm install gitsu-cli -g
15
17
 
16
18
  ## Usage
17
19
 
18
- Open switcher to select a user from your `~/.gitsurc` config
20
+ Open the `gitsu` switcher to select a user from your `~/.gitsurc` config
19
21
  ```sh
20
22
  gitsu
21
23
  ```
@@ -37,27 +39,30 @@ Compiling a production build
37
39
  npm run build
38
40
  ```
39
41
 
40
- Running a production build
42
+ Running in development mode
41
43
  ```sh
42
- npm start
44
+ npm run dev
43
45
  ```
44
46
 
45
- Running in development mode
47
+ Running a production build
46
48
  ```sh
47
- npm run dev
49
+ npm start
48
50
  ```
49
51
 
50
- Linking the package to your global npm modules
52
+ ## Linking
53
+
54
+ Link the local package to your global npm modules
51
55
  ```sh
52
56
  npm link
53
57
  ```
54
58
 
55
- Unlinking the package from your global npm modules
59
+ Unlink the local package from your global npm modules
56
60
  ```sh
57
61
  npm unlink gitsu-cli -g
58
62
  ```
59
63
 
60
64
  ## Built With
61
65
 
62
- - [Node.js](https://nodejs.org/)
63
- - [TypeScript](https://www.typescriptlang.org/)
66
+ - [Node.js](https://github.com/nodejs/node)
67
+ - [TypeScript](https://github.com/microsoft/TypeScript)
68
+ - [Commander.js](https://github.com/tj/commander.js)
package/lib/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gitsu-cli",
3
- "version": "0.0.1",
4
- "description": "Util for quickly & easily switching git users from a config stored at ~/.gitsu",
3
+ "version": "1.0.2",
4
+ "description": "Command line util for quickly & easily switching git users",
5
5
  "author": "Jamie Weavis",
6
6
  "homepage": "https://github.com/jamieweavis/gitsu#readme",
7
7
  "license": "MIT",
@@ -16,7 +16,15 @@
16
16
  "bin": {
17
17
  "gitsu": "./lib/src/app.js"
18
18
  },
19
- "keywords": ["git", "user", "switch", "gitsu", "su", "switch-user"],
19
+ "keywords": [
20
+ "git",
21
+ "gitconfig",
22
+ "user",
23
+ "switch",
24
+ "gitsu",
25
+ "su",
26
+ "switch-user"
27
+ ],
20
28
  "scripts": {
21
29
  "start": "node ./lib/src/app.js",
22
30
  "dev": "ts-node-dev --respawn ./src/app.ts",
@@ -24,7 +32,8 @@
24
32
  "lint": "biome check src",
25
33
  "lint:write": "npm run lint -- --write",
26
34
  "format": "biome format src",
27
- "format:write": "npm run format -- --write"
35
+ "format:write": "npm run format -- --write",
36
+ "prepare": "husky"
28
37
  },
29
38
  "dependencies": {
30
39
  "@types/configstore": "^6.0.2",
@@ -39,7 +48,44 @@
39
48
  },
40
49
  "devDependencies": {
41
50
  "@biomejs/biome": "^1.9.4",
51
+ "@commitlint/cli": "^19.8.0",
52
+ "@commitlint/config-conventional": "^19.8.0",
53
+ "@semantic-release/changelog": "^6.0.3",
54
+ "@semantic-release/commit-analyzer": "^13.0.1",
55
+ "@semantic-release/git": "^10.0.1",
56
+ "@semantic-release/github": "^11.0.1",
57
+ "@semantic-release/npm": "^12.0.1",
58
+ "@semantic-release/release-notes-generator": "^14.0.3",
59
+ "commitizen": "^4.3.1",
60
+ "cz-conventional-changelog": "^3.3.0",
61
+ "husky": "^9.1.7",
62
+ "lint-staged": "^15.5.0",
63
+ "semantic-release": "^24.2.3",
42
64
  "ts-node": "^10.9.2",
43
65
  "ts-node-dev": "^2.0.0"
66
+ },
67
+ "release": {
68
+ "branches": [
69
+ "main"
70
+ ],
71
+ "plugins": [
72
+ "@semantic-release/changelog",
73
+ "@semantic-release/commit-analyzer",
74
+ "@semantic-release/npm",
75
+ "@semantic-release/git",
76
+ "@semantic-release/github",
77
+ "@semantic-release/release-notes-generator"
78
+ ]
79
+ },
80
+ "lint-staged": {
81
+ "*.ts": [
82
+ "biome format --write",
83
+ "biome lint --write"
84
+ ]
85
+ },
86
+ "commitlint": {
87
+ "extends": [
88
+ "@commitlint/config-conventional"
89
+ ]
44
90
  }
45
91
  }
package/lib/src/app.js CHANGED
@@ -4,17 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- const chalk_1 = __importDefault(require("chalk"));
8
7
  const commander_1 = require("commander");
9
8
  const package_json_1 = require("../package.json");
10
9
  const edit_1 = __importDefault(require("./commands/edit"));
11
10
  const init_1 = __importDefault(require("./commands/init"));
12
11
  const list_1 = __importDefault(require("./commands/list"));
13
12
  const bootstrap = () => {
14
- commander_1.program.description(`Util for quickly & easily switching git users from a config stored at ${chalk_1.default.cyan('~/.gitsu')}`);
13
+ commander_1.program.description('Command line util for quickly & easily switching git users');
15
14
  commander_1.program.version(package_json_1.version);
16
- commander_1.program.option('-e, --edit', 'edit the configured list of git users with your preferred EDITOR');
17
- commander_1.program.option('-l, --list', 'list the current user and configured gitsu users');
15
+ commander_1.program.option('-e, --edit', 'edit ~/.gitsurc with your EDITOR');
16
+ commander_1.program.option('-l, --list', 'list users stored in ~/.gitsurc');
18
17
  commander_1.program.parse();
19
18
  const options = commander_1.program.opts();
20
19
  if (options.list)
@@ -12,11 +12,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const chalk_1 = __importDefault(require("chalk"));
16
- const log_symbols_1 = __importDefault(require("log-symbols"));
17
15
  const node_fs_1 = __importDefault(require("node:fs"));
18
16
  const node_os_1 = __importDefault(require("node:os"));
19
17
  const node_path_1 = __importDefault(require("node:path"));
18
+ const chalk_1 = __importDefault(require("chalk"));
19
+ const log_symbols_1 = __importDefault(require("log-symbols"));
20
20
  const choice_1 = require("../utils/choice");
21
21
  const get_config_1 = __importDefault(require("../utils/get-config"));
22
22
  const get_current_choice_1 = __importDefault(require("./get-current-choice"));
@@ -36,11 +36,11 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
36
36
  email: user.email,
37
37
  },
38
38
  ]));
39
- console.info(`${log_symbols_1.default.info} Created initial ${chalk_1.default.cyan('~/.gitsu')} with user ${chalk_1.default.cyan(currentChoice)}`);
39
+ console.info(`${log_symbols_1.default.info} Created initial ${chalk_1.default.cyan('~/.gitsurc')} with user ${chalk_1.default.cyan(currentChoice)}`);
40
40
  return true;
41
41
  }
42
42
  catch (error) {
43
- console.error(`${log_symbols_1.default.error} ${chalk_1.default.red('Failed to create ~/.gitsu config file')}`, error);
43
+ console.error(`${log_symbols_1.default.error} ${chalk_1.default.red('Failed to create ~/.gitsurc config file')}`, error);
44
44
  return false;
45
45
  }
46
46
  }
@@ -16,7 +16,7 @@ const node_child_process_1 = __importDefault(require("node:child_process"));
16
16
  const log_symbols_1 = __importDefault(require("log-symbols"));
17
17
  exports.default = (user) => __awaiter(void 0, void 0, void 0, function* () {
18
18
  try {
19
- yield node_child_process_1.default.exec(`git config user.name "${user.name}" && git config user.email "${user.email}"`);
19
+ yield node_child_process_1.default.exec(`git config --global user.name "${user.name}" && git config --global user.email "${user.email}"`);
20
20
  return true;
21
21
  }
22
22
  catch (error) {
@@ -14,6 +14,6 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
14
14
  const explorer = (0, cosmiconfig_1.cosmiconfig)('gitsu');
15
15
  const result = yield explorer.search();
16
16
  if (!result)
17
- throw new Error('Failed to find ~/.gitsu configuration file');
17
+ throw new Error('Failed to find ~/.gitsurc configuration file');
18
18
  return result;
19
19
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gitsu-cli",
3
- "version": "1.0.0",
4
- "description": "Util for quickly & easily switching git users from a config stored at ~/.gitsurc",
3
+ "version": "1.0.3",
4
+ "description": "Command line util for quickly & easily switching git users",
5
5
  "author": "Jamie Weavis",
6
6
  "homepage": "https://github.com/jamieweavis/gitsu#readme",
7
7
  "license": "MIT",
@@ -16,7 +16,15 @@
16
16
  "bin": {
17
17
  "gitsu": "./lib/src/app.js"
18
18
  },
19
- "keywords": ["git", "user", "switch", "gitsu", "su", "switch-user"],
19
+ "keywords": [
20
+ "git",
21
+ "gitconfig",
22
+ "user",
23
+ "switch",
24
+ "gitsu",
25
+ "su",
26
+ "switch-user"
27
+ ],
20
28
  "scripts": {
21
29
  "start": "node ./lib/src/app.js",
22
30
  "dev": "ts-node-dev --respawn ./src/app.ts",
@@ -57,7 +65,9 @@
57
65
  "ts-node-dev": "^2.0.0"
58
66
  },
59
67
  "release": {
60
- "branches": ["main"],
68
+ "branches": [
69
+ "main"
70
+ ],
61
71
  "plugins": [
62
72
  "@semantic-release/changelog",
63
73
  "@semantic-release/commit-analyzer",
@@ -68,9 +78,14 @@
68
78
  ]
69
79
  },
70
80
  "lint-staged": {
71
- "*.ts": ["biome format --write", "biome lint --write"]
81
+ "*.ts": [
82
+ "biome format --write",
83
+ "biome lint --write"
84
+ ]
72
85
  },
73
86
  "commitlint": {
74
- "extends": ["@commitlint/config-conventional"]
87
+ "extends": [
88
+ "@commitlint/config-conventional"
89
+ ]
75
90
  }
76
91
  }
package/src/app.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import chalk from 'chalk';
4
3
  import { program } from 'commander';
5
4
 
6
5
  import { version } from '../package.json';
@@ -10,19 +9,11 @@ import list from './commands/list';
10
9
 
11
10
  const bootstrap = () => {
12
11
  program.description(
13
- `Util for quickly & easily switching git users from a config stored at ${chalk.cyan(
14
- '~/.gitsurc',
15
- )}`,
12
+ 'Command line util for quickly & easily switching git users',
16
13
  );
17
14
  program.version(version);
18
- program.option(
19
- '-e, --edit',
20
- 'edit the configured list of git users with your preferred EDITOR',
21
- );
22
- program.option(
23
- '-l, --list',
24
- 'list the current user and configured gitsu users',
25
- );
15
+ program.option('-e, --edit', 'edit ~/.gitsurc with your EDITOR');
16
+ program.option('-l, --list', 'list users stored in ~/.gitsurc');
26
17
  program.parse();
27
18
 
28
19
  const options = program.opts();
@@ -6,7 +6,7 @@ import type { IUser } from '../types';
6
6
  export default async (user: IUser): Promise<boolean> => {
7
7
  try {
8
8
  await child_process.exec(
9
- `git config user.name "${user.name}" && git config user.email "${user.email}"`,
9
+ `git config --global user.name "${user.name}" && git config --global user.email "${user.email}"`,
10
10
  );
11
11
 
12
12
  return true;