@nozomiishii/pm 0.1.0 → 0.1.4
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/README.ja.md +1 -0
- package/README.md +1 -0
- package/dist/cli.js +58 -1
- package/package.json +1 -1
package/README.ja.md
CHANGED
package/README.md
CHANGED
package/dist/cli.js
CHANGED
|
@@ -94,6 +94,55 @@ var logo_color_default = `\x1B[38;2;120;180;255m zzzzzzzzzzzzzzzzzzzzzzzzzz\x1B[
|
|
|
94
94
|
\x1B[38;2;10;50;185mnozozzzzzzzzzzzzzzzzzzzzzz\x1B[0m
|
|
95
95
|
\x1B[38;2;10;50;185mzzzzzzzzzzzzzzzzzzzzzzzzzz\x1B[0m
|
|
96
96
|
`;
|
|
97
|
+
// package.json
|
|
98
|
+
var package_default = {
|
|
99
|
+
name: "@nozomiishii/pm",
|
|
100
|
+
version: "0.1.4",
|
|
101
|
+
description: "Project manager CLI — jump to projects via fzf",
|
|
102
|
+
type: "module",
|
|
103
|
+
homepage: "https://github.com/nozomiishii/pm#readme",
|
|
104
|
+
bugs: {
|
|
105
|
+
url: "https://github.com/nozomiishii/pm/issues"
|
|
106
|
+
},
|
|
107
|
+
repository: {
|
|
108
|
+
type: "git",
|
|
109
|
+
url: "git+https://github.com/nozomiishii/pm.git"
|
|
110
|
+
},
|
|
111
|
+
license: "MIT",
|
|
112
|
+
author: "Nozomi Ishii",
|
|
113
|
+
bin: {
|
|
114
|
+
pm: "./dist/cli.js"
|
|
115
|
+
},
|
|
116
|
+
files: [
|
|
117
|
+
"dist/cli.js",
|
|
118
|
+
"src/pm.zsh"
|
|
119
|
+
],
|
|
120
|
+
scripts: {
|
|
121
|
+
build: "bun build --compile src/cli.ts --outfile dist/pm",
|
|
122
|
+
prepublishOnly: "bun build src/cli.ts --outfile dist/cli.js --target=node",
|
|
123
|
+
typecheck: "tsc --noEmit",
|
|
124
|
+
dev: "bun run src/cli.ts",
|
|
125
|
+
demo: 'docker run --rm -v "$(pwd)":/vhs pm-vhs',
|
|
126
|
+
"demo:all": "bash demo/create.sh",
|
|
127
|
+
"demo:logo": 'docker run --rm -v "$(pwd)":/vhs pm-vhs demo/logo.tape',
|
|
128
|
+
"logo:colorize": "bun run src/logo/create-logo-color.ts",
|
|
129
|
+
"install:local": "bash install.sh",
|
|
130
|
+
"uninstall:local": "bash uninstall.sh",
|
|
131
|
+
test: "vitest run"
|
|
132
|
+
},
|
|
133
|
+
devDependencies: {
|
|
134
|
+
"@types/node": "22.19.15",
|
|
135
|
+
vitest: "4.1.0"
|
|
136
|
+
},
|
|
137
|
+
publishConfig: {
|
|
138
|
+
access: "public",
|
|
139
|
+
provenance: true
|
|
140
|
+
},
|
|
141
|
+
packageManager: "bun@1.3.11",
|
|
142
|
+
engines: {
|
|
143
|
+
node: "24.14.0"
|
|
144
|
+
}
|
|
145
|
+
};
|
|
97
146
|
|
|
98
147
|
// src/cli.ts
|
|
99
148
|
function defaultConfigPath() {
|
|
@@ -122,6 +171,7 @@ Commands:
|
|
|
122
171
|
Options:
|
|
123
172
|
--config <path> Path to projects.json (or PM_CONFIG)
|
|
124
173
|
--help Show this help
|
|
174
|
+
--version Show version
|
|
125
175
|
|
|
126
176
|
Running \`pm\` without a command opens the fzf picker.`);
|
|
127
177
|
}
|
|
@@ -132,6 +182,7 @@ var SUBCOMMANDS = new Set(["cd", "ls", "create-workspace", "logo", "uninstall"])
|
|
|
132
182
|
function parseArgs(argv) {
|
|
133
183
|
let config = process.env.PM_CONFIG ?? defaultConfigPath();
|
|
134
184
|
let help = false;
|
|
185
|
+
let version = false;
|
|
135
186
|
let subcommand;
|
|
136
187
|
const rest = [];
|
|
137
188
|
for (let i = 0;i < argv.length; i++) {
|
|
@@ -140,13 +191,15 @@ function parseArgs(argv) {
|
|
|
140
191
|
config = argv[++i] ?? "";
|
|
141
192
|
} else if (arg === "--help") {
|
|
142
193
|
help = true;
|
|
194
|
+
} else if (arg === "--version") {
|
|
195
|
+
version = true;
|
|
143
196
|
} else if (!subcommand && SUBCOMMANDS.has(arg)) {
|
|
144
197
|
subcommand = arg;
|
|
145
198
|
} else {
|
|
146
199
|
rest.push(arg);
|
|
147
200
|
}
|
|
148
201
|
}
|
|
149
|
-
return { config, help, subcommand, rest };
|
|
202
|
+
return { config, help, version, subcommand, rest };
|
|
150
203
|
}
|
|
151
204
|
function parseCreateWorkspaceArgs(rest) {
|
|
152
205
|
let workspaceName = "";
|
|
@@ -237,6 +290,10 @@ async function jumpToProject(projects, name) {
|
|
|
237
290
|
}
|
|
238
291
|
async function main() {
|
|
239
292
|
const args = parseArgs(process.argv.slice(2));
|
|
293
|
+
if (args.version) {
|
|
294
|
+
console.log(package_default.version);
|
|
295
|
+
process.exit(0);
|
|
296
|
+
}
|
|
240
297
|
if (args.help) {
|
|
241
298
|
usage();
|
|
242
299
|
process.exit(0);
|