refactor: move brother_node development artifact to dev/test-nodes subdirectory
Development Artifact Cleanup: ✅ BROTHER_NODE REORGANIZATION: Moved development test node to appropriate location - dev/test-nodes/brother_node/: Moved from root directory for better organization - Contains development configuration, test logs, and test chain data - No impact on production systems - purely development/testing artifact ✅ DEVELOPMENT ARTIFACTS IDENTIFIED: - Chain ID: aitbc-brother-chain (test/development chain) - Ports: 8010 (P2P) and 8011 (RPC) - different from production - Environment: .env file with test configuration - Logs: rpc.log and node.log from development testing session (March 15, 2026) ✅ ROOT DIRECTORY CLEANUP: Removed development clutter from production directory - brother_node/ moved to dev/test-nodes/brother_node/ - Root directory now contains only production-ready components - Development artifacts properly organized in dev/ subdirectory DIRECTORY STRUCTURE IMPROVEMENT: 📁 dev/test-nodes/: Development and testing node configurations 🏗️ Root Directory: Clean production structure with only essential components 🧪 Development Isolation: Test environments separated from production BENEFITS: ✅ Clean Production Directory: No development artifacts in root ✅ Better Organization: Development nodes grouped in dev/ subdirectory ✅ Clear Separation: Production vs development environments clearly distinguished ✅ Maintainability: Easier to identify and manage development components RESULT: Successfully moved brother_node development artifact to dev/test-nodes/ subdirectory, cleaning up the root directory while preserving development testing environment for future use.
This commit is contained in:
118
dev/env/node_modules/enquirer/lib/prompts/autocomplete.js
generated
vendored
Executable file
118
dev/env/node_modules/enquirer/lib/prompts/autocomplete.js
generated
vendored
Executable file
@@ -0,0 +1,118 @@
|
||||
'use strict';
|
||||
|
||||
const Select = require('./select');
|
||||
|
||||
const highlight = (input, color) => {
|
||||
const regex = input ? new RegExp(input, 'ig') : /$^/;
|
||||
|
||||
return str => {
|
||||
return input ? str.replace(regex, match => color(match)) : str;
|
||||
};
|
||||
};
|
||||
|
||||
class AutoComplete extends Select {
|
||||
constructor(options) {
|
||||
super(options);
|
||||
this.cursorShow();
|
||||
}
|
||||
|
||||
moveCursor(n) {
|
||||
this.state.cursor += n;
|
||||
}
|
||||
|
||||
dispatch(ch) {
|
||||
return this.append(ch);
|
||||
}
|
||||
|
||||
space(ch) {
|
||||
return this.options.multiple ? super.space(ch) : this.append(ch);
|
||||
}
|
||||
|
||||
append(ch) {
|
||||
let { cursor, input } = this.state;
|
||||
this.input = input.slice(0, cursor) + ch + input.slice(cursor);
|
||||
this.moveCursor(1);
|
||||
return this.complete();
|
||||
}
|
||||
|
||||
delete() {
|
||||
let { cursor, input } = this.state;
|
||||
if (!input) return this.alert();
|
||||
this.input = input.slice(0, cursor - 1) + input.slice(cursor);
|
||||
this.moveCursor(-1);
|
||||
return this.complete();
|
||||
}
|
||||
|
||||
deleteForward() {
|
||||
let { cursor, input } = this.state;
|
||||
if (input[cursor] === void 0) return this.alert();
|
||||
this.input = `${input}`.slice(0, cursor) + `${input}`.slice(cursor + 1);
|
||||
return this.complete();
|
||||
}
|
||||
|
||||
number(ch) {
|
||||
return this.append(ch);
|
||||
}
|
||||
|
||||
async complete() {
|
||||
this.completing = true;
|
||||
this.choices = await this.suggest(this.input, this.state._choices);
|
||||
this.state.limit = void 0; // allow getter/setter to reset limit
|
||||
this.index = Math.min(Math.max(this.visible.length - 1, 0), this.index);
|
||||
await this.render();
|
||||
this.completing = false;
|
||||
}
|
||||
|
||||
suggest(input = this.input, choices = this.state._choices) {
|
||||
if (typeof this.options.suggest === 'function') {
|
||||
return this.options.suggest.call(this, input, choices);
|
||||
}
|
||||
let str = input.toLowerCase();
|
||||
return choices.filter(ch => ch.message.toLowerCase().includes(str));
|
||||
}
|
||||
|
||||
pointer() {
|
||||
return '';
|
||||
}
|
||||
|
||||
format() {
|
||||
if (!this.focused) return this.input;
|
||||
|
||||
if (this.options.multiple && this.state.submitted) {
|
||||
return this.selected.map(ch => this.styles.primary(ch.message)).join(', ');
|
||||
}
|
||||
|
||||
if (this.state.submitted) {
|
||||
let value = this.value = this.input = this.focused.value;
|
||||
return this.styles.primary(value);
|
||||
}
|
||||
|
||||
return this.input;
|
||||
}
|
||||
|
||||
async render() {
|
||||
if (this.state.status !== 'pending') return super.render();
|
||||
const hl = this.options.highlight || this.styles.complement;
|
||||
|
||||
const style = (input, color) => {
|
||||
if (!input) return input;
|
||||
if (hl.stack) return hl(input);
|
||||
return hl.call(this, input);
|
||||
};
|
||||
|
||||
const color = highlight(this.input, style);
|
||||
const choices = this.choices;
|
||||
this.choices = choices.map(ch => ({ ...ch, message: color(ch.message) }));
|
||||
await super.render();
|
||||
this.choices = choices;
|
||||
}
|
||||
|
||||
submit() {
|
||||
if (this.options.multiple) {
|
||||
this.value = this.selected.map(ch => ch.name);
|
||||
}
|
||||
return super.submit();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = AutoComplete;
|
||||
Reference in New Issue
Block a user