@tolinax/ayoune-cli 2026.8.1 → 2026.8.2
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.
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
//Initializes settings for system environment and inquirer
|
|
2
|
-
//
|
|
3
|
-
// Only register them when
|
|
2
|
+
// Plugins are lazy-loaded: inquirer-table-input, inquirer-fuzzy-path, etc.
|
|
3
|
+
// are heavy (~3000 modules). Only register them when interactive prompts are needed.
|
|
4
|
+
import inquirer from "inquirer";
|
|
4
5
|
import { createRequire } from "module";
|
|
5
6
|
let _initialized = false;
|
|
6
7
|
export function initializeSettings() {
|
|
7
8
|
if (_initialized)
|
|
8
9
|
return;
|
|
9
10
|
_initialized = true;
|
|
11
|
+
// Lazy-load only the heavy plugins via createRequire (ESM dynamic require)
|
|
10
12
|
const require = createRequire(import.meta.url);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const inquirerTableInput = require("inquirer-table-input");
|
|
13
|
+
inquirer.registerPrompt("fuzzypath", require("inquirer-fuzzy-path"));
|
|
14
|
+
inquirer.registerPrompt("search-list", require("inquirer-search-list"));
|
|
15
|
+
inquirer.registerPrompt("file-tree-selection", require("inquirer-file-tree-selection-prompt"));
|
|
16
|
+
inquirer.registerPrompt("table-input", require("inquirer-table-input"));
|
|
16
17
|
const InterruptedPrompt = require("inquirer-interrupted-prompt");
|
|
17
|
-
inquirer.registerPrompt("fuzzypath", inquirerFuzzyPath);
|
|
18
|
-
inquirer.registerPrompt("search-list", inquirerSearchList);
|
|
19
|
-
inquirer.registerPrompt("file-tree-selection", inquirerFileTreeSelection);
|
|
20
|
-
inquirer.registerPrompt("table-input", inquirerTableInput);
|
|
21
18
|
InterruptedPrompt.fromAll(inquirer);
|
|
22
19
|
}
|