@inquirer/demo 1.1.27 → 2.0.1

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,5 +1,5 @@
1
1
  import * as url from 'node:url';
2
- import colors from 'yoctocolors-cjs';
2
+ import { styleText } from 'node:util';
3
3
  import { input } from '@inquirer/prompts';
4
4
  const hexRegEx = /(\d|[a-f])/gim;
5
5
  const isHex = (value) => (value.match(hexRegEx) || []).length === value.length &&
@@ -14,7 +14,7 @@ const demo = async () => {
14
14
  answer = await input({
15
15
  message: 'Enter an hex color?',
16
16
  transformer(value = '', { isFinal }) {
17
- return isFinal ? colors.underline(value) : value;
17
+ return isFinal ? styleText('underline', value) : value;
18
18
  },
19
19
  validate: (value = '') => isHex(value) || 'Pass a valid hex value',
20
20
  });
@@ -39,7 +39,7 @@ const demo = async () => {
39
39
  }
40
40
  const files = await fs.readdir(dirPath, { withFileTypes: true });
41
41
  return files
42
- .sort((a, b) => {
42
+ .toSorted((a, b) => {
43
43
  if (a.isDirectory() === b.isDirectory()) {
44
44
  return a.name.localeCompare(b.name);
45
45
  }
@@ -1,6 +1,6 @@
1
1
  import * as url from 'node:url';
2
2
  import { select, Separator } from '@inquirer/prompts';
3
- import colors from 'yoctocolors-cjs';
3
+ import { styleText } from 'node:util';
4
4
  const alphabet = [
5
5
  { value: 'A' },
6
6
  { value: 'B' },
@@ -71,17 +71,17 @@ const demo = async () => {
71
71
  message: 'Select a recipe',
72
72
  choices: [
73
73
  {
74
- name: `${colors.bold('Spaghetti Carbonara')}\n Eggs, Pecorino Romano, Pancetta\n 30 minutes`,
74
+ name: `${styleText('bold', 'Spaghetti Carbonara')}\n Eggs, Pecorino Romano, Pancetta\n 30 minutes`,
75
75
  short: 'Spaghetti Carbonara',
76
76
  value: 'carbonara',
77
77
  },
78
78
  {
79
- name: `${colors.bold('Margherita Pizza')}\n Tomatoes, Mozzarella, Basil\n 45 minutes`,
79
+ name: `${styleText('bold', 'Margherita Pizza')}\n Tomatoes, Mozzarella, Basil\n 45 minutes`,
80
80
  short: 'Margherita Pizza',
81
81
  value: 'pizza',
82
82
  },
83
83
  {
84
- name: `${colors.bold('Caesar Salad')}\n Romaine, Croutons, Parmesan\n 15 minutes`,
84
+ name: `${styleText('bold', 'Caesar Salad')}\n Romaine, Croutons, Parmesan\n 15 minutes`,
85
85
  short: 'Caesar Salad',
86
86
  value: 'salad',
87
87
  },
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { select } from '@inquirer/prompts';
3
- import colors from 'yoctocolors-cjs';
3
+ import { styleText } from 'node:util';
4
4
  import figures from '@inquirer/figures';
5
5
  import checkboxDemo from "./demos/checkbox.js";
6
6
  import confirmDemo from "./demos/confirm.js";
@@ -47,7 +47,7 @@ async function askNextDemo() {
47
47
  ],
48
48
  theme: {
49
49
  prefix: {
50
- done: colors.magenta(figures.play),
50
+ done: styleText('magenta', figures.play),
51
51
  },
52
52
  },
53
53
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/demo",
3
- "version": "1.1.27",
3
+ "version": "2.0.1",
4
4
  "description": "Inquirer demos",
5
5
  "keywords": [
6
6
  "answer",
@@ -53,51 +53,34 @@
53
53
  "exports": {
54
54
  "./package.json": "./package.json",
55
55
  ".": {
56
- "import": {
57
- "types": "./dist/esm/index.d.ts",
58
- "default": "./dist/esm/index.js"
59
- }
56
+ "types": "./dist/index.d.ts",
57
+ "default": "./dist/index.js"
60
58
  }
61
59
  },
62
- "module": "./dist/esm/index.js",
63
60
  "bin": {
64
- "inquirer-demo": "./dist/esm/index.js"
61
+ "inquirer-demo": "./dist/index.js"
65
62
  },
66
63
  "files": [
67
64
  "dist"
68
65
  ],
69
66
  "scripts": {
70
- "tsc": "tshy"
67
+ "tsc": "tsc && chmod +x ./dist/index.js"
71
68
  },
72
69
  "dependencies": {
73
- "@inquirer/core": "^10.3.2",
74
- "@inquirer/figures": "^1.0.15",
75
- "@inquirer/prompts": "^7.10.1",
76
- "yoctocolors-cjs": "^2.1.3"
70
+ "@inquirer/core": "^11.0.1",
71
+ "@inquirer/figures": "^2.0.1",
72
+ "@inquirer/prompts": "^8.0.1"
77
73
  },
78
74
  "devDependencies": {
79
- "@repo/tsconfig": "0.0.0",
80
- "@types/node": "^24.10.0",
81
- "tshy": "^3.0.3"
75
+ "@types/node": "^24.10.1",
76
+ "typescript": "^5.9.3"
82
77
  },
83
78
  "engines": {
84
- "node": ">=18"
79
+ "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0"
85
80
  },
86
81
  "publishConfig": {
87
82
  "access": "public"
88
83
  },
89
- "tshy": {
90
- "dialects": [
91
- "esm"
92
- ],
93
- "exclude": [
94
- "src/**/*.test.ts"
95
- ],
96
- "exports": {
97
- "./package.json": "./package.json",
98
- ".": "./src/index.ts"
99
- }
100
- },
101
84
  "peerDependencies": {
102
85
  "@types/node": ">=18"
103
86
  },
@@ -106,5 +89,5 @@
106
89
  "optional": true
107
90
  }
108
91
  },
109
- "gitHead": "4731a373881368e2f701c41adc67bc83244bf89f"
92
+ "gitHead": "cce79ce3b9bbdfb4dbb798078cf3b94b9adc7d1b"
110
93
  }
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes