github-labels-template 0.6.0 → 0.6.1-dev.f752fce
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/dist/index.js +7 -85
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
|
-
import { defineCommand as
|
|
4
|
+
import { defineCommand as defineCommand5, runMain } from "citty";
|
|
5
5
|
|
|
6
6
|
// src/commands/apply.ts
|
|
7
7
|
import { defineCommand } from "citty";
|
|
@@ -483,85 +483,8 @@ var wipe_default = defineCommand2({
|
|
|
483
483
|
}
|
|
484
484
|
});
|
|
485
485
|
|
|
486
|
-
// src/commands/preview.ts
|
|
487
|
-
import { defineCommand as defineCommand3 } from "citty";
|
|
488
|
-
import { resolve as resolve2, join } from "path";
|
|
489
|
-
import { readFileSync as readFileSync2, existsSync as existsSync2 } from "fs";
|
|
490
|
-
import { createServer } from "http";
|
|
491
|
-
var MIME_TYPES = {
|
|
492
|
-
".html": "text/html",
|
|
493
|
-
".css": "text/css",
|
|
494
|
-
".js": "application/javascript",
|
|
495
|
-
".json": "application/json",
|
|
496
|
-
".png": "image/png",
|
|
497
|
-
".jpg": "image/jpeg",
|
|
498
|
-
".svg": "image/svg+xml",
|
|
499
|
-
".ico": "image/x-icon",
|
|
500
|
-
".woff": "font/woff",
|
|
501
|
-
".woff2": "font/woff2"
|
|
502
|
-
};
|
|
503
|
-
function getMimeType(filePath) {
|
|
504
|
-
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
505
|
-
return MIME_TYPES[ext] || "application/octet-stream";
|
|
506
|
-
}
|
|
507
|
-
var preview_default = defineCommand3({
|
|
508
|
-
meta: {
|
|
509
|
-
name: "preview",
|
|
510
|
-
description: "Preview the landing page locally in your browser"
|
|
511
|
-
},
|
|
512
|
-
args: {
|
|
513
|
-
port: {
|
|
514
|
-
type: "string",
|
|
515
|
-
alias: "p",
|
|
516
|
-
default: "3000",
|
|
517
|
-
description: "Port to serve on (default: 3000)"
|
|
518
|
-
}
|
|
519
|
-
},
|
|
520
|
-
async run({ args }) {
|
|
521
|
-
const docsDir = resolve2(import.meta.dirname ?? ".", "..", "..", "docs");
|
|
522
|
-
if (!existsSync2(docsDir)) {
|
|
523
|
-
error("docs/ directory not found. Nothing to preview.");
|
|
524
|
-
process.exit(1);
|
|
525
|
-
}
|
|
526
|
-
const indexPath = join(docsDir, "index.html");
|
|
527
|
-
if (!existsSync2(indexPath)) {
|
|
528
|
-
error("docs/index.html not found. Nothing to preview.");
|
|
529
|
-
process.exit(1);
|
|
530
|
-
}
|
|
531
|
-
const port = parseInt(args.port, 10) || 3000;
|
|
532
|
-
const server = createServer((req, res) => {
|
|
533
|
-
const url = req.url === "/" ? "/index.html" : req.url || "/index.html";
|
|
534
|
-
const filePath = join(docsDir, url);
|
|
535
|
-
if (!filePath.startsWith(docsDir)) {
|
|
536
|
-
res.writeHead(403);
|
|
537
|
-
res.end("Forbidden");
|
|
538
|
-
return;
|
|
539
|
-
}
|
|
540
|
-
if (!existsSync2(filePath)) {
|
|
541
|
-
res.writeHead(404);
|
|
542
|
-
res.end("Not Found");
|
|
543
|
-
return;
|
|
544
|
-
}
|
|
545
|
-
try {
|
|
546
|
-
const content = readFileSync2(filePath);
|
|
547
|
-
res.writeHead(200, { "Content-Type": getMimeType(filePath) });
|
|
548
|
-
res.end(content);
|
|
549
|
-
} catch {
|
|
550
|
-
res.writeHead(500);
|
|
551
|
-
res.end("Internal Server Error");
|
|
552
|
-
}
|
|
553
|
-
});
|
|
554
|
-
server.listen(port, () => {
|
|
555
|
-
const url = `http://localhost:${port}`;
|
|
556
|
-
success(`Landing page preview running at ${url}`);
|
|
557
|
-
info("Press Ctrl+C to stop the server");
|
|
558
|
-
});
|
|
559
|
-
await new Promise(() => {});
|
|
560
|
-
}
|
|
561
|
-
});
|
|
562
|
-
|
|
563
486
|
// src/commands/generate.ts
|
|
564
|
-
import { defineCommand as
|
|
487
|
+
import { defineCommand as defineCommand3 } from "citty";
|
|
565
488
|
import { select, input, confirm } from "@inquirer/prompts";
|
|
566
489
|
|
|
567
490
|
// src/utils/copilot.ts
|
|
@@ -705,7 +628,7 @@ var CATEGORIES = [
|
|
|
705
628
|
function formatLabelChoice(label, index) {
|
|
706
629
|
return `${pc4.bold(label.name)} ${pc4.dim(`#${label.color}`)} — ${label.description}`;
|
|
707
630
|
}
|
|
708
|
-
var generate_default =
|
|
631
|
+
var generate_default = defineCommand3({
|
|
709
632
|
meta: {
|
|
710
633
|
name: "generate",
|
|
711
634
|
description: "Generate custom labels using AI (requires GitHub Copilot subscription)"
|
|
@@ -865,9 +788,9 @@ var generate_default = defineCommand4({
|
|
|
865
788
|
});
|
|
866
789
|
|
|
867
790
|
// src/commands/migrate.ts
|
|
868
|
-
import { defineCommand as
|
|
791
|
+
import { defineCommand as defineCommand4 } from "citty";
|
|
869
792
|
import pc5 from "picocolors";
|
|
870
|
-
var migrate_default =
|
|
793
|
+
var migrate_default = defineCommand4({
|
|
871
794
|
meta: {
|
|
872
795
|
name: "migrate",
|
|
873
796
|
description: "Wipe all existing labels and apply the template (clean slate)"
|
|
@@ -976,7 +899,7 @@ import pc6 from "picocolors";
|
|
|
976
899
|
// package.json
|
|
977
900
|
var package_default = {
|
|
978
901
|
name: "github-labels-template",
|
|
979
|
-
version: "0.6.
|
|
902
|
+
version: "0.6.1-dev.f752fce",
|
|
980
903
|
description: "A CLI tool to apply a curated GitHub labels template to any repository using gh CLI.",
|
|
981
904
|
type: "module",
|
|
982
905
|
bin: {
|
|
@@ -1057,7 +980,7 @@ function showBanner(minimal = false) {
|
|
|
1057
980
|
// src/index.ts
|
|
1058
981
|
var isHelp = process.argv.includes("--help") || process.argv.includes("-h");
|
|
1059
982
|
showBanner(isHelp);
|
|
1060
|
-
var main =
|
|
983
|
+
var main = defineCommand5({
|
|
1061
984
|
meta: {
|
|
1062
985
|
name: "ghlt",
|
|
1063
986
|
version: getVersion(),
|
|
@@ -1074,7 +997,6 @@ var main = defineCommand6({
|
|
|
1074
997
|
apply: apply_default,
|
|
1075
998
|
wipe: wipe_default,
|
|
1076
999
|
migrate: migrate_default,
|
|
1077
|
-
preview: preview_default,
|
|
1078
1000
|
generate: generate_default
|
|
1079
1001
|
},
|
|
1080
1002
|
run({ args }) {
|