@inquirer/demo 2.0.11 → 2.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.
@@ -15,6 +15,19 @@ const demo = async () => {
15
15
  default: '# This prompt was automatically opened. You can write anything:\n\n',
16
16
  waitForUserInput: false,
17
17
  }));
18
+ console.log('Answer:', await editor({
19
+ message: 'Custom messages',
20
+ validate: async () => {
21
+ await new Promise((resolve) => setTimeout(resolve, 3000));
22
+ return true;
23
+ },
24
+ theme: {
25
+ style: {
26
+ loadingMessage: () => 'Loading...',
27
+ waitingMessage: (enterKey) => `Press ${enterKey} to write stuff`,
28
+ },
29
+ },
30
+ }));
18
31
  };
19
32
  if (import.meta.url.startsWith('file:')) {
20
33
  const modulePath = url.fileURLToPath(import.meta.url);
@@ -20,6 +20,7 @@ const demo = async () => {
20
20
  message: 'Select an npm package',
21
21
  source: async (input = 'inquirer', { signal }) => {
22
22
  const response = await fetch(`https://registry.npmjs.org/-/v1/search?text=${encodeURIComponent(input)}&size=20`, { signal });
23
+ // oxlint-disable-next-line typescript/no-unsafe-type-assertion
23
24
  const data = (await response.json());
24
25
  return data.objects.map((pkg) => ({
25
26
  name: pkg.package.name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/demo",
3
- "version": "2.0.11",
3
+ "version": "2.0.13",
4
4
  "description": "Inquirer demos",
5
5
  "keywords": [
6
6
  "answer",
@@ -70,13 +70,15 @@
70
70
  "tsc": "tsc && chmod +x ./dist/index.js"
71
71
  },
72
72
  "dependencies": {
73
- "@inquirer/core": "^11.1.7",
74
- "@inquirer/figures": "^2.0.4",
75
- "@inquirer/prompts": "^8.3.2"
73
+ "@inquirer/core": "^11.1.8",
74
+ "@inquirer/figures": "^2.0.5",
75
+ "@inquirer/prompts": "^8.4.1"
76
76
  },
77
77
  "devDependencies": {
78
- "@types/node": "^25.0.2",
79
- "typescript": "^5.9.3"
78
+ "@inquirer/testing": "3.3.4",
79
+ "@repo/tsconfig": "",
80
+ "@types/node": "^25.5.2",
81
+ "typescript": "^6.0.2"
80
82
  },
81
83
  "peerDependencies": {
82
84
  "@types/node": ">=18"
@@ -91,5 +93,5 @@
91
93
  },
92
94
  "main": "./dist/index.js",
93
95
  "types": "./dist/index.d.ts",
94
- "gitHead": "c8d52cef7bd7e36347efe789d58c2c15ad816213"
96
+ "gitHead": "979b130330e8c6f4d51f5b9915c8beae26c7e2df"
95
97
  }