Skip to content

Commit ae28783

Browse files
committed
Import inquirerer repository into inquirerer/
This import preserves the full commit history of the inquirerer repository. All files have been placed under inquirerer/ in this monorepo. Source: /Users/pyramation/code/pyramation/inquirerer (branch: main)
2 parents 6a73ca8 + e1b5c30 commit ae28783

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+11289
-0
lines changed

inquirerer/.eslintrc.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true,
5+
"node": true,
6+
"jest": true
7+
},
8+
"extends": [
9+
"eslint:recommended",
10+
"plugin:@typescript-eslint/recommended",
11+
"prettier"
12+
],
13+
"overrides": [],
14+
"parser": "@typescript-eslint/parser",
15+
"parserOptions": {
16+
"ecmaVersion": "latest",
17+
"sourceType": "module"
18+
},
19+
"plugins": ["@typescript-eslint", "simple-import-sort", "unused-imports"],
20+
"rules": {
21+
"simple-import-sort/imports": 1,
22+
"simple-import-sort/exports": 1,
23+
"unused-imports/no-unused-imports": 1,
24+
"@typescript-eslint/no-unused-vars": [
25+
1,
26+
{
27+
"argsIgnorePattern": "React|res|next|^_"
28+
}
29+
],
30+
"@typescript-eslint/no-explicit-any": 0,
31+
"@typescript-eslint/no-var-requires": 0,
32+
"no-console": 0,
33+
"@typescript-eslint/ban-ts-comment": 0,
34+
"prefer-const": 0,
35+
"no-case-declarations": 0,
36+
"no-implicit-globals": 0,
37+
"@typescript-eslint/no-unsafe-declaration-merging": 0
38+
}
39+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
6+
pull_request:
7+
types: [opened, reopened]
8+
9+
workflow_dispatch:
10+
11+
jobs:
12+
run-tests:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Repository 🛎️
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20.x'
22+
23+
- name: Install Dependencies
24+
run: yarn install
25+
26+
- name: Build Project
27+
run: yarn build
28+
29+
- name: Test inquirerer
30+
run: cd packages/inquirerer && yarn test
31+
32+
- name: Test create-gen-app
33+
run: cd packages/create-gen-app && yarn test

inquirerer/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
**/node_modules/
2+
**/.DS_Store
3+
**/dist
4+
**/yarn-error.log
5+
lerna-debug.log

inquirerer/.prettierrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"trailingComma": "es5",
3+
"tabWidth": 2,
4+
"semi": true,
5+
"singleQuote": false
6+
}

inquirerer/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2024 Dan Lynch <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

inquirerer/README.md

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
# inquirerer
2+
3+
<p align="center" width="100%">
4+
<img height="90" src="https://user-images.githubusercontent.com/545047/190171475-b416f99e-2831-4786-9ba3-a7ff4d95b0d3.svg" />
5+
</p>
6+
7+
<p align="center" width="100%">
8+
9+
<a href="https://github.com/pyramation/inquirerer/actions/workflows/run-tests.yml">
10+
<img height="20" src="https://github.com/pyramation/inquirerer/actions/workflows/run-tests.yml/badge.svg" />
11+
</a>
12+
<a href="https://github.com/pyramation/inquirerer/blob/main/LICENSE"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
13+
<a href="https://www.npmjs.com/package/inquirerer"><img height="20" src="https://img.shields.io/npm/dt/inquirerer"></a>
14+
<a href="https://www.npmjs.com/package/inquirerer"><img height="20" src="https://img.shields.io/github/package-json/v/pyramation/inquirerer?filename=packages%2Finquirerer%2Fpackage.json"></a>
15+
</p>
16+
17+
This library is designed to facilitate the creation of command-line utilities by providing a robust framework for capturing user input through interactive prompts. It supports a variety of question types, making it highly flexible and suitable for a wide range of applications.
18+
19+
## Install
20+
21+
```sh
22+
npm install inquirerer
23+
```
24+
25+
## Features
26+
27+
- 🖊 **Multiple Question Types:** Support for text, autocomplete, checkbox, and confirm questions.
28+
- 🛠 **Customizable Prompts:** Easily configure prompts to include default values, requirement flags, and custom validation rules.
29+
- 🔎 **Interactive Autocomplete:** Dynamically filter options based on user input.
30+
- ✔️ **Flexible Checkbox Selections:** Allow users to select multiple options from a list.
31+
32+
## Table of Contents
33+
34+
- [Introduction](#inquirerer)
35+
- [Install](#install)
36+
- [Features](#features)
37+
- [Installation](#installation)
38+
- [Usage](#usage)
39+
- [Example Questions](#example-questions)
40+
- [Text Question](#text-question)
41+
- [Confirm Question](#confirm-question)
42+
- [Autocomplete Question](#autocomplete-question)
43+
- [Checkbox Question](#checkbox-question)
44+
- [Executing a Prompt](#executing-a-prompt)
45+
- [Developing](#developing)
46+
- [Credits](#credits)
47+
- [Disclaimer](#disclaimer)
48+
49+
## Installation
50+
51+
To install the library, use `npm` or `yarn`:
52+
53+
```bash
54+
npm install inquirerer
55+
```
56+
57+
## Usage
58+
59+
Import the library and use it to create prompts for your command-line application:
60+
61+
```js
62+
import { Inquirerer } from 'inquirerer';
63+
```
64+
65+
### Example Questions
66+
67+
Here are several examples of different question types you can use:
68+
69+
#### Text Question
70+
71+
```js
72+
{
73+
type: 'text',
74+
name: 'firstName',
75+
message: 'Enter your first name',
76+
}
77+
```
78+
79+
#### Confirm Question
80+
81+
```js
82+
{
83+
type: 'confirm',
84+
name: 'continue',
85+
message: 'Do you wish to continue?',
86+
default: true,
87+
}
88+
```
89+
90+
#### Autocomplete Question
91+
92+
```js
93+
{
94+
type: 'autocomplete',
95+
name: 'fruitChoice',
96+
message: 'Select your favorite fruit',
97+
options: [
98+
'Apple', 'Banana', 'Cherry'
99+
],
100+
maxDisplayLines: 5
101+
}
102+
```
103+
104+
#### Checkbox Question
105+
106+
```js
107+
{
108+
type: 'checkbox',
109+
name: 'techStack',
110+
message: 'Choose your tech stack',
111+
options: [
112+
'Node.js', 'React', 'Angular', 'Vue.js'
113+
],
114+
returnFullResults: false,
115+
required: true
116+
}
117+
```
118+
119+
### Executing a Prompt
120+
121+
To run a prompt and handle the response:
122+
123+
```js
124+
const prompter = new Inquirerer();
125+
126+
async function runPrompt() {
127+
const responses = await prompter.prompt({}, [
128+
{
129+
type: 'text',
130+
name: 'lastName',
131+
message: 'Enter your last name',
132+
required: true
133+
},
134+
{
135+
type: 'checkbox',
136+
name: 'devTools',
137+
message: 'Select development tools:',
138+
options: ['VS Code', 'Sublime', 'Atom'],
139+
required: true
140+
}
141+
]);
142+
143+
console.log(responses);
144+
}
145+
146+
runPrompt();
147+
```
148+
149+
150+
## Developing
151+
152+
153+
When first cloning the repo:
154+
```
155+
yarn
156+
yarn build
157+
```
158+
159+
## Disclaimer
160+
161+
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED “AS IS”, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
162+
163+
No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.

inquirerer/lerna.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"lerna": "6",
3+
"conventionalCommits": true,
4+
"npmClient": "yarn",
5+
"npmClientArgs": [
6+
"--no-lockfile"
7+
],
8+
"packages": [
9+
"packages/*"
10+
],
11+
"version": "independent",
12+
"registry": "https://registry.npmjs.org",
13+
"command": {
14+
"create": {
15+
"homepage": "https://github.com/pyramation/inquirerer",
16+
"license": "SEE LICENSE IN LICENSE",
17+
"access": "restricted"
18+
},
19+
"publish": {
20+
"allowBranch": "main",
21+
"message": "chore(release): publish"
22+
}
23+
}
24+
}

inquirerer/package.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "inquirerer",
3+
"version": "0.0.1",
4+
"author": "Dan Lynch <[email protected]>",
5+
"private": true,
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/pyramation/inquirerer"
9+
},
10+
"license": "SEE LICENSE IN LICENSE",
11+
"publishConfig": {
12+
"access": "restricted"
13+
},
14+
"workspaces": [
15+
"packages/*"
16+
],
17+
"scripts": {
18+
"clean": "lerna run clean",
19+
"build": "lerna run build --stream",
20+
"symlink": "symlink-workspace --logLevel error",
21+
"postinstall": "yarn symlink"
22+
},
23+
"devDependencies": {
24+
"@types/jest": "^29.5.11",
25+
"@types/node": "^20.12.7",
26+
"@typescript-eslint/eslint-plugin": "^6.18.1",
27+
"@typescript-eslint/parser": "^6.18.1",
28+
"copyfiles": "^2.4.1",
29+
"del-cli": "^5.1.0",
30+
"eslint": "^8.56.0",
31+
"eslint-config-prettier": "^9.1.0",
32+
"eslint-plugin-simple-import-sort": "^10.0.0",
33+
"eslint-plugin-unused-imports": "^3.0.0",
34+
"jest": "^29.6.2",
35+
"lerna": "^6",
36+
"prettier": "^3.0.2",
37+
"strip-ansi": "^6",
38+
"symlink-workspace": "^1.1.0",
39+
"ts-jest": "^29.1.1",
40+
"ts-node": "^10.9.2",
41+
"typescript": "^5.1.6"
42+
}
43+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file.
4+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5+
6+
# 0.1.0 (2025-11-16)
7+
8+
**Note:** Version bump only for package create-gen-app

0 commit comments

Comments
 (0)