@shd101wyy/yo 0.1.14 → 0.1.15

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shd101wyy/yo",
3
3
  "displayName": "Yo",
4
- "version": "0.1.14",
4
+ "version": "0.1.15",
5
5
  "main": "./out/cjs/index.cjs",
6
6
  "module": "./out/esm/index.mjs",
7
7
  "types": "./out/types/src/index.d.ts",
@@ -48,6 +48,8 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "markdown_yo": "0.0.4",
51
+ "vscode-languageserver": "^9.0.1",
52
+ "vscode-languageserver-textdocument": "^1.0.12",
51
53
  "yargs": "^17.7.2"
52
54
  },
53
55
  "devDependencies": {
@@ -20,18 +20,19 @@ import * as fs from "fs";
20
20
  import * as path from "path";
21
21
  import { createRenderer } from "markdown_yo";
22
22
  import type { MarkdownRenderer } from "markdown_yo";
23
- import { execSync } from "child_process";
23
+ import { execFileSync } from "child_process";
24
24
 
25
25
  const ROOT = path.resolve(import.meta.dir, "..");
26
26
  const GITHUB_REPO = "https://github.com/shd101wyy/Yo";
27
27
 
28
28
  // Detect the latest release tag for stable links.
29
29
  // Falls back to "main" if no tags exist or git fails.
30
- function getLatestTag(): string {
30
+ export function getLatestTag(rootDir: string = ROOT): string {
31
31
  try {
32
- const result = execSync("git describe --tags --abbrev=0 2>/dev/null", {
33
- cwd: ROOT,
32
+ const result = execFileSync("git", ["describe", "--tags", "--abbrev=0"], {
33
+ cwd: rootDir,
34
34
  encoding: "utf-8",
35
+ stdio: ["ignore", "pipe", "ignore"],
35
36
  timeout: 5000,
36
37
  }).trim();
37
38
  return result || "main";
@@ -43,6 +44,16 @@ function getLatestTag(): string {
43
44
  const GITHUB_REF = getLatestTag();
44
45
  const GITHUB_BLOB = `${GITHUB_REPO}/blob/${GITHUB_REF}`;
45
46
 
47
+ export function getStdDocCommand(rootDir: string = ROOT): {
48
+ command: string;
49
+ args: string[];
50
+ } {
51
+ return {
52
+ command: "node",
53
+ args: [path.join(rootDir, "out", "cjs", "yo-cli.cjs"), "doc", "std/"],
54
+ };
55
+ }
56
+
46
57
  // ── Parse args ───────────────────────────────────────────────────────
47
58
 
48
59
  let outputDir = path.join(ROOT, "site");
@@ -399,7 +410,7 @@ function injectHomeLinks(stdDir: string): void {
399
410
 
400
411
  // ── Main ─────────────────────────────────────────────────────────────
401
412
 
402
- async function main(): Promise<void> {
413
+ export async function main(): Promise<void> {
403
414
  console.log("Building documentation site...");
404
415
  console.log(` Output: ${outputDir}`);
405
416
 
@@ -449,12 +460,16 @@ async function main(): Promise<void> {
449
460
  const stdOutputDir = path.join(outputDir, "std");
450
461
 
451
462
  try {
452
- const yoCli = path.join(ROOT, "yo-cli");
453
- execSync(`${yoCli} doc std/ --output "${stdOutputDir}"`, {
454
- cwd: ROOT,
455
- stdio: ["pipe", "pipe", "inherit"],
456
- timeout: 120_000,
457
- });
463
+ const stdDocCommand = getStdDocCommand();
464
+ execFileSync(
465
+ stdDocCommand.command,
466
+ [...stdDocCommand.args, "--output", stdOutputDir],
467
+ {
468
+ cwd: ROOT,
469
+ stdio: ["ignore", "inherit", "inherit"],
470
+ timeout: 600_000,
471
+ }
472
+ );
458
473
  console.log(" ✓ Standard library docs generated");
459
474
  } catch (err) {
460
475
  console.error(
@@ -492,7 +507,9 @@ function getTotalSize(dir: string): number {
492
507
  return Math.round(total / 1024);
493
508
  }
494
509
 
495
- main().catch((err) => {
496
- console.error("Fatal error:", err);
497
- process.exit(1);
498
- });
510
+ if (import.meta.main) {
511
+ main().catch((err) => {
512
+ console.error("Fatal error:", err);
513
+ process.exit(1);
514
+ });
515
+ }
@@ -9,9 +9,9 @@ const fs = require("fs");
9
9
  function checkLiburing() {
10
10
  const platform = os.platform();
11
11
 
12
- // Only check on Linux
12
+ // Only check on Linux. Other platforms don't use io_uring, so keep postinstall
13
+ // quiet instead of printing a Linux-specific note.
13
14
  if (platform !== "linux") {
14
- console.log("ℹ️ Async I/O with io_uring is only supported on Linux.");
15
15
  return;
16
16
  }
17
17