gitsu-cli 1.0.0 → 1.0.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.
@@ -38,9 +38,16 @@ jobs:
38
38
  - name: Checkout
39
39
  uses: actions/checkout@v4
40
40
 
41
+ - name: Install Dependencies
42
+ run: npm install
43
+
44
+ - name: Build
45
+ run: npm run build
46
+
41
47
  - name: Semantic Release
42
48
  id: release
43
49
  uses: cycjimmy/semantic-release-action@v4
44
50
  env:
45
51
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46
52
  NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
53
+ 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,13 @@
1
+ ## [1.0.1](https://github.com/jamieweavis/gitsu/compare/v1.0.0...v1.0.1) (2025-03-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * description and docs ([4edfd7f](https://github.com/jamieweavis/gitsu/commit/4edfd7fc3b81dc6965a996226171224849efc4a8))
7
+
8
+ # 1.0.0 (2025-03-15)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * description, output & badges ([294bd7b](https://github.com/jamieweavis/gitsu/commit/294bd7bcd2fb7355539d76aae09f546ae63927ef))
package/README.md CHANGED
@@ -1,11 +1,11 @@
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
9
 
10
10
  ## Install
11
11
 
@@ -15,7 +15,7 @@ npm install gitsu-cli -g
15
15
 
16
16
  ## Usage
17
17
 
18
- Open switcher to select a user from your `~/.gitsurc` config
18
+ Open the `gitsu` switcher to select a user from your `~/.gitsurc` config
19
19
  ```sh
20
20
  gitsu
21
21
  ```
@@ -37,27 +37,30 @@ Compiling a production build
37
37
  npm run build
38
38
  ```
39
39
 
40
- Running a production build
40
+ Running in development mode
41
41
  ```sh
42
- npm start
42
+ npm run dev
43
43
  ```
44
44
 
45
- Running in development mode
45
+ Running a production build
46
46
  ```sh
47
- npm run dev
47
+ npm start
48
48
  ```
49
49
 
50
- Linking the package to your global npm modules
50
+ ## Linking
51
+
52
+ Link the local package to your global npm modules
51
53
  ```sh
52
54
  npm link
53
55
  ```
54
56
 
55
- Unlinking the package from your global npm modules
57
+ Unlink the local package from your global npm modules
56
58
  ```sh
57
59
  npm unlink gitsu-cli -g
58
60
  ```
59
61
 
60
62
  ## Built With
61
63
 
62
- - [Node.js](https://nodejs.org/)
63
- - [TypeScript](https://www.typescriptlang.org/)
64
+ - [Node.js](https://github.com/nodejs/node)
65
+ - [TypeScript](https://github.com/microsoft/TypeScript)
66
+ - [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.0",
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,37 @@
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": ["main"],
69
+ "plugins": [
70
+ "@semantic-release/changelog",
71
+ "@semantic-release/commit-analyzer",
72
+ "@semantic-release/npm",
73
+ "@semantic-release/git",
74
+ "@semantic-release/github",
75
+ "@semantic-release/release-notes-generator"
76
+ ]
77
+ },
78
+ "lint-staged": {
79
+ "*.ts": ["biome format --write", "biome lint --write"]
80
+ },
81
+ "commitlint": {
82
+ "extends": ["@commitlint/config-conventional"]
44
83
  }
45
84
  }
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
  }
@@ -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.1",
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();