fix(core): update
This commit is contained in:
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartinteract',
|
||||
version: '2.0.12',
|
||||
description: 'smart cli interaction'
|
||||
}
|
@ -1,2 +1,2 @@
|
||||
export * from './smartinteract.classes.smartinteract';
|
||||
export * from './smartinteract.classes.answerbucket';
|
||||
export * from './smartinteract.classes.smartinteract.js';
|
||||
export * from './smartinteract.classes.answerbucket.js';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as plugins from './smartinteract.plugins';
|
||||
import { IAnswerObject } from './smartinteract.classes.smartinteract';
|
||||
import * as plugins from './smartinteract.plugins.js';
|
||||
import { type IAnswerObject } from './smartinteract.classes.smartinteract.js';
|
||||
|
||||
/**
|
||||
* class AnswerBucket holds answers
|
||||
@ -18,7 +18,7 @@ export class AnswerBucket {
|
||||
* gets an answer for a specific name
|
||||
*/
|
||||
public getAnswerFor(nameArg: string) {
|
||||
const answer = this.answerMap.find((answerArg) => {
|
||||
const answer = this.answerMap.findSync((answerArg) => {
|
||||
return answerArg.name === nameArg;
|
||||
});
|
||||
return answer ? answer.value : null;
|
||||
|
@ -1,6 +1,5 @@
|
||||
import * as plugins from './smartinteract.plugins';
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
import { AnswerBucket } from './smartinteract.classes.answerbucket';
|
||||
import * as plugins from './smartinteract.plugins.js';
|
||||
import { AnswerBucket } from './smartinteract.classes.answerbucket.js';
|
||||
|
||||
/**
|
||||
* the availeable question types
|
||||
@ -79,9 +78,9 @@ export class SmartInteract {
|
||||
* skips the queue
|
||||
*/
|
||||
askQuestion(optionsArg: IQuestionObject): Promise<IAnswerObject> {
|
||||
const done = smartpromise.defer<IAnswerObject>();
|
||||
const done = plugins.smartpromise.defer<IAnswerObject>();
|
||||
if (this.isValidEnv()) {
|
||||
plugins.inquirer
|
||||
plugins.inquirer.default
|
||||
.prompt([
|
||||
{
|
||||
name: optionsArg.name,
|
||||
@ -94,7 +93,7 @@ export class SmartInteract {
|
||||
])
|
||||
.then((answers) => {
|
||||
// adjust to the fact that now dots define paths for inquirer
|
||||
const answerValue = plugins.smartparam.smartGet(answers, optionsArg.name);
|
||||
const answerValue = plugins.smartobject.smartGet(answers, optionsArg.name);
|
||||
done.resolve({
|
||||
name: optionsArg.name,
|
||||
value: answerValue,
|
||||
@ -125,7 +124,7 @@ export class SmartInteract {
|
||||
* run the question queue
|
||||
*/
|
||||
runQueue() {
|
||||
const done = smartpromise.defer<AnswerBucket>();
|
||||
const done = plugins.smartpromise.defer<AnswerBucket>();
|
||||
const answerBucket = new AnswerBucket();
|
||||
const handleQuestion = async () => {
|
||||
if (!this.questionMap.isEmpty()) {
|
||||
|
@ -1,8 +1,9 @@
|
||||
// pushrocks scope
|
||||
import * as lik from '@pushrocks/lik';
|
||||
import * as smartparam from '@pushrocks/smartparam';
|
||||
import * as lik from '@push.rocks/lik';
|
||||
import * as smartobject from '@push.rocks/smartobject';
|
||||
import * as smartpromise from '@push.rocks/smartpromise';
|
||||
|
||||
export { lik, smartparam };
|
||||
export { lik, smartobject, smartpromise };
|
||||
|
||||
// third party scope
|
||||
import * as inquirer from 'inquirer';
|
||||
|
Reference in New Issue
Block a user