github-labels-template 0.3.0-staging.4cd350e โ 0.3.0
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.md +2 -15
- package/dist/index.js +6 -113
- package/package.json +3 -7
package/README.md
CHANGED
|
@@ -16,8 +16,7 @@ A CLI tool to apply a curated set of GitHub labels to any repository using `gh`
|
|
|
16
16
|
- ๐ **Smart Conflict Handling**: Skips existing labels by default, `--force` to update
|
|
17
17
|
- ๐งน **Wipe Command**: Remove all existing labels with a confirmation prompt
|
|
18
18
|
- โ
**Pre-Flight Checks**: Validates `gh` CLI is installed and authenticated before doing anything
|
|
19
|
-
- ๐ **Clear Output**:
|
|
20
|
-
- ๐จ **ASCII Banner**: Beautiful ANSI Shadow figlet banner with version and author info
|
|
19
|
+
- ๐ **Clear Output**: Color-coded status for each label with a summary report
|
|
21
20
|
- ๐ **Dual Runtime**: Works with both `npx` and `bunx`
|
|
22
21
|
|
|
23
22
|
## Quick Start
|
|
@@ -150,10 +149,7 @@ Broad software layers โ universal across any project.
|
|
|
150
149
|
ghlt โ GitHub Labels Template CLI
|
|
151
150
|
|
|
152
151
|
USAGE
|
|
153
|
-
ghlt
|
|
154
|
-
|
|
155
|
-
OPTIONS
|
|
156
|
-
-v, --version Show version number
|
|
152
|
+
ghlt apply|wipe
|
|
157
153
|
|
|
158
154
|
COMMANDS
|
|
159
155
|
apply Apply labels from the template to a repository
|
|
@@ -168,15 +164,6 @@ OPTIONS (wipe)
|
|
|
168
164
|
-y, --yes Skip confirmation prompt
|
|
169
165
|
```
|
|
170
166
|
|
|
171
|
-
## Testing
|
|
172
|
-
|
|
173
|
-
This project uses the [Bun test framework](https://bun.sh/docs/cli/test) for testing.
|
|
174
|
-
|
|
175
|
-
```bash
|
|
176
|
-
# Run all tests
|
|
177
|
-
bun test
|
|
178
|
-
```
|
|
179
|
-
|
|
180
167
|
## Contributing
|
|
181
168
|
|
|
182
169
|
Contributions are welcome! This project follows the [Clean Commit](https://github.com/wgtechlabs/clean-commit) convention.
|
package/dist/index.js
CHANGED
|
@@ -114,27 +114,18 @@ async function deleteLabel(repo, name) {
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
// src/utils/logger.ts
|
|
117
|
-
import { LogEngine, LogMode } from "@wgtechlabs/log-engine";
|
|
118
117
|
import pc from "picocolors";
|
|
119
|
-
LogEngine.configure({
|
|
120
|
-
mode: LogMode.INFO,
|
|
121
|
-
format: {
|
|
122
|
-
includeIsoTimestamp: false,
|
|
123
|
-
includeLocalTime: true,
|
|
124
|
-
includeEmoji: true
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
118
|
function success(msg) {
|
|
128
|
-
|
|
119
|
+
console.log(pc.green(` โ ${msg}`));
|
|
129
120
|
}
|
|
130
121
|
function error(msg) {
|
|
131
|
-
|
|
122
|
+
console.log(pc.red(` โ ${msg}`));
|
|
132
123
|
}
|
|
133
124
|
function warn(msg) {
|
|
134
|
-
|
|
125
|
+
console.log(pc.yellow(` โ ${msg}`));
|
|
135
126
|
}
|
|
136
127
|
function info(msg) {
|
|
137
|
-
|
|
128
|
+
console.log(pc.cyan(` โน ${msg}`));
|
|
138
129
|
}
|
|
139
130
|
function heading(msg) {
|
|
140
131
|
console.log(`
|
|
@@ -306,10 +297,7 @@ ${pc2.bold(pc2.red(`This will delete all ${existing.length} labels from ${repo}.
|
|
|
306
297
|
process.stdout.write(`${pc2.dim("Continue? [y/N] ")}`);
|
|
307
298
|
const response = await new Promise((resolve) => {
|
|
308
299
|
process.stdin.setEncoding("utf-8");
|
|
309
|
-
process.stdin.once("data", (data) =>
|
|
310
|
-
process.stdin.pause();
|
|
311
|
-
resolve(data.toString().trim());
|
|
312
|
-
});
|
|
300
|
+
process.stdin.once("data", (data) => resolve(data.toString().trim()));
|
|
313
301
|
process.stdin.resume();
|
|
314
302
|
});
|
|
315
303
|
if (response.toLowerCase() !== "y") {
|
|
@@ -333,111 +321,16 @@ ${pc2.bold(pc2.red(`This will delete all ${existing.length} labels from ${repo}.
|
|
|
333
321
|
}
|
|
334
322
|
});
|
|
335
323
|
|
|
336
|
-
// src/ui/banner.ts
|
|
337
|
-
import figlet from "figlet";
|
|
338
|
-
import pc3 from "picocolors";
|
|
339
|
-
// package.json
|
|
340
|
-
var package_default = {
|
|
341
|
-
name: "github-labels-template",
|
|
342
|
-
version: "0.3.0-staging.4cd350e",
|
|
343
|
-
description: "A CLI tool to apply a curated GitHub labels template to any repository using gh CLI.",
|
|
344
|
-
type: "module",
|
|
345
|
-
bin: {
|
|
346
|
-
ghlt: "dist/index.js"
|
|
347
|
-
},
|
|
348
|
-
files: [
|
|
349
|
-
"dist"
|
|
350
|
-
],
|
|
351
|
-
scripts: {
|
|
352
|
-
build: "bun build src/index.ts --outfile dist/index.js --target node --packages external",
|
|
353
|
-
dev: "bun src/index.ts",
|
|
354
|
-
test: "bun test"
|
|
355
|
-
},
|
|
356
|
-
engines: {
|
|
357
|
-
node: ">=18",
|
|
358
|
-
bun: ">=1.0"
|
|
359
|
-
},
|
|
360
|
-
keywords: [
|
|
361
|
-
"github",
|
|
362
|
-
"labels",
|
|
363
|
-
"template",
|
|
364
|
-
"cli",
|
|
365
|
-
"gh"
|
|
366
|
-
],
|
|
367
|
-
author: "Waren Gonzaga",
|
|
368
|
-
license: "MIT",
|
|
369
|
-
repository: {
|
|
370
|
-
type: "git",
|
|
371
|
-
url: "git+https://github.com/warengonzaga/github-labels-template.git"
|
|
372
|
-
},
|
|
373
|
-
dependencies: {
|
|
374
|
-
"@wgtechlabs/log-engine": "^2.3.1",
|
|
375
|
-
citty: "^0.1.6",
|
|
376
|
-
figlet: "^1.10.0",
|
|
377
|
-
picocolors: "^1.1.1"
|
|
378
|
-
},
|
|
379
|
-
devDependencies: {
|
|
380
|
-
"@types/bun": "latest",
|
|
381
|
-
"@types/figlet": "^1.7.0"
|
|
382
|
-
}
|
|
383
|
-
};
|
|
384
|
-
|
|
385
|
-
// src/ui/banner.ts
|
|
386
|
-
var LOGO;
|
|
387
|
-
try {
|
|
388
|
-
LOGO = figlet.textSync("GHLT", { font: "ANSI Shadow" });
|
|
389
|
-
} catch {
|
|
390
|
-
LOGO = ` โโโโโโโ โโโ โโโโโโ โโโโโโโโโ
|
|
391
|
-
` + `โโโโโโโโ โโโ โโโโโโ โโโโโโโโโ
|
|
392
|
-
` + `โโโ โโโโโโโโโโโโโโโ โโโ
|
|
393
|
-
` + `โโโ โโโโโโโโโโโโโโ โโโ
|
|
394
|
-
` + `โโโโโโโโโโโโ โโโโโโโโโโโ โโโ
|
|
395
|
-
` + ` โโโโโโโ โโโ โโโโโโโโโโโ โโโ `;
|
|
396
|
-
}
|
|
397
|
-
function getVersion() {
|
|
398
|
-
return package_default.version ?? "unknown";
|
|
399
|
-
}
|
|
400
|
-
function getAuthor() {
|
|
401
|
-
return package_default.author ?? "unknown";
|
|
402
|
-
}
|
|
403
|
-
function showBanner(minimal = false) {
|
|
404
|
-
console.log(pc3.cyan(`
|
|
405
|
-
` + LOGO));
|
|
406
|
-
console.log(` ${pc3.dim("v" + getVersion())} ${pc3.dim("โ")} ${pc3.dim("Built by " + getAuthor())}`);
|
|
407
|
-
if (!minimal) {
|
|
408
|
-
console.log(` ${pc3.dim(package_default.description)}`);
|
|
409
|
-
console.log();
|
|
410
|
-
console.log(` ${pc3.yellow("Star")} ${pc3.cyan("https://gh.waren.build/github-labels-template")}`);
|
|
411
|
-
console.log(` ${pc3.green("Contribute")} ${pc3.cyan("https://gh.waren.build/github-labels-template/blob/main/CONTRIBUTING.md")}`);
|
|
412
|
-
console.log(` ${pc3.magenta("Sponsor")} ${pc3.cyan("https://warengonzaga.com/sponsor")}`);
|
|
413
|
-
}
|
|
414
|
-
console.log();
|
|
415
|
-
}
|
|
416
|
-
|
|
417
324
|
// src/index.ts
|
|
418
|
-
var isHelp = process.argv.includes("--help") || process.argv.includes("-h");
|
|
419
|
-
showBanner(isHelp);
|
|
420
325
|
var main = defineCommand3({
|
|
421
326
|
meta: {
|
|
422
327
|
name: "ghlt",
|
|
423
|
-
version:
|
|
328
|
+
version: "0.1.0",
|
|
424
329
|
description: "GitHub Labels Template โ apply a curated set of labels to any repo using gh CLI."
|
|
425
330
|
},
|
|
426
|
-
args: {
|
|
427
|
-
version: {
|
|
428
|
-
type: "boolean",
|
|
429
|
-
alias: "v",
|
|
430
|
-
description: "Show version number"
|
|
431
|
-
}
|
|
432
|
-
},
|
|
433
331
|
subCommands: {
|
|
434
332
|
apply: apply_default,
|
|
435
333
|
wipe: wipe_default
|
|
436
|
-
},
|
|
437
|
-
run({ args }) {
|
|
438
|
-
if (args.version) {
|
|
439
|
-
console.log(`ghlt v${getVersion()}`);
|
|
440
|
-
}
|
|
441
334
|
}
|
|
442
335
|
});
|
|
443
336
|
runMain(main);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "github-labels-template",
|
|
3
|
-
"version": "0.3.0
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "A CLI tool to apply a curated GitHub labels template to any repository using gh CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "bun build src/index.ts --outfile dist/index.js --target node --packages external",
|
|
14
|
-
"dev": "bun src/index.ts"
|
|
15
|
-
"test": "bun test"
|
|
14
|
+
"dev": "bun src/index.ts"
|
|
16
15
|
},
|
|
17
16
|
"engines": {
|
|
18
17
|
"node": ">=18",
|
|
@@ -32,13 +31,10 @@
|
|
|
32
31
|
"url": "git+https://github.com/warengonzaga/github-labels-template.git"
|
|
33
32
|
},
|
|
34
33
|
"dependencies": {
|
|
35
|
-
"@wgtechlabs/log-engine": "^2.3.1",
|
|
36
34
|
"citty": "^0.1.6",
|
|
37
|
-
"figlet": "^1.10.0",
|
|
38
35
|
"picocolors": "^1.1.1"
|
|
39
36
|
},
|
|
40
37
|
"devDependencies": {
|
|
41
|
-
"@types/bun": "latest"
|
|
42
|
-
"@types/figlet": "^1.7.0"
|
|
38
|
+
"@types/bun": "latest"
|
|
43
39
|
}
|
|
44
40
|
}
|