@nbtca/prompt 1.0.8 → 1.0.13

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 (71) hide show
  1. package/README.md +16 -289
  2. package/dist/config/data.d.ts +1 -1
  3. package/dist/config/data.js +1 -1
  4. package/dist/config/data.js.map +1 -1
  5. package/dist/core/logo.d.ts.map +1 -1
  6. package/dist/core/logo.js +13 -2
  7. package/dist/core/logo.js.map +1 -1
  8. package/dist/core/menu.d.ts +5 -0
  9. package/dist/core/menu.d.ts.map +1 -1
  10. package/dist/core/menu.js +12 -5
  11. package/dist/core/menu.js.map +1 -1
  12. package/dist/core/ui.d.ts.map +1 -1
  13. package/dist/core/ui.js +5 -3
  14. package/dist/core/ui.js.map +1 -1
  15. package/dist/features/calendar.d.ts +13 -14
  16. package/dist/features/calendar.d.ts.map +1 -1
  17. package/dist/features/calendar.js +57 -59
  18. package/dist/features/calendar.js.map +1 -1
  19. package/dist/features/docs.d.ts.map +1 -1
  20. package/dist/features/docs.js +50 -47
  21. package/dist/features/docs.js.map +1 -1
  22. package/dist/features/repair.d.ts +4 -0
  23. package/dist/features/repair.d.ts.map +1 -1
  24. package/dist/features/repair.js +1 -1
  25. package/dist/features/repair.js.map +1 -1
  26. package/dist/features/website.d.ts +10 -0
  27. package/dist/features/website.d.ts.map +1 -1
  28. package/dist/features/website.js +14 -2
  29. package/dist/features/website.js.map +1 -1
  30. package/dist/i18n/index.d.ts +9 -0
  31. package/dist/i18n/index.d.ts.map +1 -1
  32. package/dist/i18n/index.js.map +1 -1
  33. package/dist/i18n/locales/en.json +10 -1
  34. package/dist/i18n/locales/zh.json +10 -1
  35. package/dist/index.d.ts +1 -2
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +133 -4
  38. package/dist/index.js.map +1 -1
  39. package/dist/main.d.ts +4 -1
  40. package/dist/main.d.ts.map +1 -1
  41. package/dist/main.js +7 -3
  42. package/dist/main.js.map +1 -1
  43. package/package.json +8 -2
  44. package/.github/workflows/ci.yml +0 -40
  45. package/.github/workflows/publish.yml +0 -59
  46. package/CHANGELOG.md +0 -125
  47. package/DEVELOPMENT.md +0 -258
  48. package/TERMINAL_UX.md +0 -184
  49. package/assets/Prompt_demo.gif +0 -0
  50. package/src/config/data.js +0 -484
  51. package/src/config/data.ts +0 -28
  52. package/src/config/theme.js +0 -138
  53. package/src/config/theme.ts +0 -26
  54. package/src/core/logo.ts +0 -189
  55. package/src/core/menu.ts +0 -213
  56. package/src/core/ui.ts +0 -89
  57. package/src/core/vim-keys.ts +0 -70
  58. package/src/features/calendar.ts +0 -161
  59. package/src/features/docs.ts +0 -588
  60. package/src/features/repair.ts +0 -36
  61. package/src/features/website.ts +0 -45
  62. package/src/i18n/index.ts +0 -236
  63. package/src/i18n/locales/en.json +0 -107
  64. package/src/i18n/locales/zh.json +0 -107
  65. package/src/index.ts +0 -9
  66. package/src/logo/ascii-logo.txt +0 -6
  67. package/src/logo/logo.txt +0 -2
  68. package/src/logo/printLogo.js +0 -26
  69. package/src/main.ts +0 -45
  70. package/src/types.ts +0 -51
  71. package/tsconfig.json +0 -53
@@ -1,26 +0,0 @@
1
- // Print the ASCII logo from logo.txt.
2
-
3
- import fs from "fs";
4
- import path from "path";
5
- import { fileURLToPath } from "url";
6
-
7
- const __filename = fileURLToPath(import.meta.url);
8
- const __dirname = path.dirname(__filename);
9
-
10
- /**
11
- * Reads and prints the ASCII logo from logo.txt.
12
- */
13
- export function printLogo() {
14
- const logoPath = path.resolve(__dirname, "./logo.txt");
15
-
16
- try {
17
- const data = fs.readFileSync(logoPath, "utf8");
18
- console.log(data.trim());
19
- } catch (err) {
20
- if (err.code === "ENOENT") {
21
- console.error("Error: logo.txt not found. Please ensure the file exists!");
22
- } else {
23
- console.error("Error reading logo.txt:", err.message);
24
- }
25
- }
26
- }
package/src/main.ts DELETED
@@ -1,45 +0,0 @@
1
- /**
2
- * NBTCA Welcome Tool
3
- * Minimalist startup flow
4
- */
5
-
6
- import chalk from 'chalk';
7
- import { printLogo } from './core/logo.js';
8
- import { printHeader, clearScreen } from './core/ui.js';
9
- import { showMainMenu } from './core/menu.js';
10
- import { APP_INFO } from './config/data.js';
11
- import { enableVimKeys } from './core/vim-keys.js';
12
- import { t } from './i18n/index.js';
13
-
14
- /**
15
- * Main program entry point
16
- */
17
- export async function main(): Promise<void> {
18
- try {
19
- // Enable Vim key bindings
20
- enableVimKeys();
21
-
22
- // Clear screen
23
- clearScreen();
24
-
25
- // Display logo (smart fallback)
26
- await printLogo();
27
-
28
- // Display version info
29
- printHeader(`v${APP_INFO.version}`);
30
-
31
- // Show main menu (loop)
32
- await showMainMenu();
33
-
34
- } catch (err: any) {
35
- // Handle Ctrl+C exit
36
- if (err.message?.includes('SIGINT') || err.message?.includes('User force closed')) {
37
- console.log();
38
- console.log(chalk.dim(t().common.goodbye));
39
- process.exit(0);
40
- } else {
41
- console.error('Error occurred:', err);
42
- process.exit(1);
43
- }
44
- }
45
- }
package/src/types.ts DELETED
@@ -1,51 +0,0 @@
1
- /**
2
- * 极简类型定义
3
- * 只保留核心类型
4
- */
5
-
6
- /**
7
- * 菜单项类型
8
- */
9
- export interface MenuItem {
10
- name: string;
11
- value: string;
12
- description?: string;
13
- short?: string;
14
- disabled?: boolean;
15
- }
16
-
17
- /**
18
- * 活动事件类型
19
- */
20
- export interface Event {
21
- date: string;
22
- time: string;
23
- title: string;
24
- location: string;
25
- startDate: Date;
26
- }
27
-
28
- /**
29
- * URL配置类型
30
- */
31
- export interface URLConfig {
32
- homepage: string;
33
- github: string;
34
- docs: string;
35
- repair: string;
36
- calendar: string;
37
- email: string;
38
- }
39
-
40
- /**
41
- * 应用信息类型
42
- */
43
- export interface AppInfo {
44
- name: string;
45
- version: string;
46
- description: string;
47
- fullDescription: string;
48
- author: string;
49
- license: string;
50
- repository: string;
51
- }
package/tsconfig.json DELETED
@@ -1,53 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- /* Language and Environment */
4
- "target": "ES2022",
5
- "lib": ["ES2022"],
6
- "module": "ES2022",
7
- "moduleResolution": "node",
8
-
9
- /* Emit */
10
- "outDir": "./dist",
11
- "rootDir": "./src",
12
- "declaration": true,
13
- "declarationMap": true,
14
- "sourceMap": true,
15
- "removeComments": false,
16
- "importHelpers": false,
17
- "downlevelIteration": true,
18
-
19
- /* Interop Constraints */
20
- "esModuleInterop": true,
21
- "allowSyntheticDefaultImports": true,
22
- "forceConsistentCasingInFileNames": true,
23
- "resolveJsonModule": true,
24
-
25
- /* Type Checking */
26
- "strict": true,
27
- "noImplicitAny": true,
28
- "strictNullChecks": true,
29
- "strictFunctionTypes": true,
30
- "strictBindCallApply": true,
31
- "strictPropertyInitialization": true,
32
- "noImplicitThis": true,
33
- "alwaysStrict": true,
34
- "noUnusedLocals": true,
35
- "noUnusedParameters": true,
36
- "noImplicitReturns": true,
37
- "noFallthroughCasesInSwitch": true,
38
- "noUncheckedIndexedAccess": true,
39
- "noImplicitOverride": true,
40
- "noPropertyAccessFromIndexSignature": true,
41
-
42
- /* Completeness */
43
- "skipLibCheck": true
44
- },
45
- "include": [
46
- "src/**/*"
47
- ],
48
- "exclude": [
49
- "node_modules",
50
- "dist",
51
- "**/*.spec.ts"
52
- ]
53
- }