@nozomiishii/pm 0.2.0 → 0.2.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.
Files changed (2) hide show
  1. package/dist/cli.js +14 -5
  2. package/package.json +5 -1
package/dist/cli.js CHANGED
@@ -68,7 +68,7 @@ var logo_color_default = `\x1B[38;2;120;180;255m zzzzzzzzzzzzzzzzzzzzzzzzzz\x1B[
68
68
  // package.json
69
69
  var package_default = {
70
70
  name: "@nozomiishii/pm",
71
- version: "0.2.0",
71
+ version: "0.2.1",
72
72
  description: "Project manager CLI — jump to projects via fzf",
73
73
  type: "module",
74
74
  homepage: "https://github.com/nozomiishii/pm#readme",
@@ -91,6 +91,7 @@ var package_default = {
91
91
  scripts: {
92
92
  build: "bun build --compile src/cli.ts --outfile dist/pm",
93
93
  prepublishOnly: "bun build src/cli.ts --outfile dist/cli.js --target=node --banner '#!/usr/bin/env node'",
94
+ prepare: "lefthook install --force",
94
95
  typecheck: "tsc --noEmit",
95
96
  dev: "bun run src/cli.ts",
96
97
  demo: 'docker run --rm -v "$(pwd)":/vhs pm-vhs',
@@ -102,7 +103,10 @@ var package_default = {
102
103
  test: "vitest run"
103
104
  },
104
105
  devDependencies: {
106
+ "@nozomiishii/commitlint-config": "1.0.1",
107
+ "@nozomiishii/lefthook-config": "1.0.1",
105
108
  "@types/node": "25.6.0",
109
+ lefthook: "2.1.6",
106
110
  vitest: "4.1.5"
107
111
  },
108
112
  publishConfig: {
@@ -174,15 +178,20 @@ function plainLabel(name) {
174
178
  }
175
179
  function fzfSelect(projects) {
176
180
  return new Promise((resolve, reject) => {
177
- const labels = projects.map((p) => plainLabel(p.name));
178
- const proc = spawn("fzf", [], {
181
+ const lines = projects.map((p) => `${plainLabel(p.name)} ${expandHome(p.rootPath)}`);
182
+ const proc = spawn("fzf", [
183
+ "--delimiter=\t",
184
+ "--with-nth=1",
185
+ "--preview",
186
+ "bat --color=always --style=header,grid --line-range :80 {2}/README.* 2>/dev/null || echo 'No README found'"
187
+ ], {
179
188
  stdio: ["pipe", "pipe", "inherit"]
180
189
  });
181
190
  let stdout = "";
182
191
  proc.stdout.on("data", (d) => {
183
192
  stdout += d.toString();
184
193
  });
185
- proc.stdin.write(labels.join(`
194
+ proc.stdin.write(lines.join(`
186
195
  `) + `
187
196
  `);
188
197
  proc.stdin.end();
@@ -192,7 +201,7 @@ function fzfSelect(projects) {
192
201
  return;
193
202
  }
194
203
  const selected = stdout.trim();
195
- const idx = labels.indexOf(selected);
204
+ const idx = lines.indexOf(selected);
196
205
  resolve(idx >= 0 ? projects[idx] : undefined);
197
206
  });
198
207
  proc.on("error", (err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nozomiishii/pm",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Project manager CLI — jump to projects via fzf",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/nozomiishii/pm#readme",
@@ -23,6 +23,7 @@
23
23
  "scripts": {
24
24
  "build": "bun build --compile src/cli.ts --outfile dist/pm",
25
25
  "prepublishOnly": "bun build src/cli.ts --outfile dist/cli.js --target=node --banner '#!/usr/bin/env node'",
26
+ "prepare": "lefthook install --force",
26
27
  "typecheck": "tsc --noEmit",
27
28
  "dev": "bun run src/cli.ts",
28
29
  "demo": "docker run --rm -v \"$(pwd)\":/vhs pm-vhs",
@@ -34,7 +35,10 @@
34
35
  "test": "vitest run"
35
36
  },
36
37
  "devDependencies": {
38
+ "@nozomiishii/commitlint-config": "1.0.1",
39
+ "@nozomiishii/lefthook-config": "1.0.1",
37
40
  "@types/node": "25.6.0",
41
+ "lefthook": "2.1.6",
38
42
  "vitest": "4.1.5"
39
43
  },
40
44
  "publishConfig": {