Just a whole lot of crap

This commit is contained in:
2025-08-14 16:36:12 -05:00
parent 66b7e42275
commit 62f6d6f279
144 changed files with 41421 additions and 2458 deletions

View File

@@ -1,24 +1,27 @@
# Shopify Price Updater
A Node.js script that bulk updates product prices in your Shopify store based on product tags using Shopify's GraphQL Admin API.
A Node.js application that bulk updates product prices in your Shopify store based on product tags using Shopify's GraphQL Admin API. Features both command-line interface (CLI) and an interactive Terminal User Interface (TUI) for enhanced user experience.
## Features
- **Tag-based filtering**: Update prices only for products with specific tags
- **Percentage-based adjustments**: Increase or decrease prices by a configurable percentage
- **Interactive TUI**: Modern React-based terminal interface with Windows compatibility
- **Batch processing**: Handles large inventories with automatic pagination
- **Error resilience**: Continues processing even if individual products fail
- **Rate limit handling**: Automatic retry logic for API rate limits
- **Progress tracking**: Detailed logging to both console and Progress.md file
- **Environment-based configuration**: Secure credential management via .env file
- **Cross-platform support**: Optimized for Windows, macOS, and Linux terminals
## Prerequisites
- Node.js (version 14 or higher)
- Node.js (version 16 or higher)
- A Shopify store with Admin API access
- Shopify Private App or Custom App with the following permissions:
- `read_products`
- `write_products`
- Modern terminal with Unicode support (recommended: Windows Terminal, iTerm2, or similar)
## Installation
@@ -85,9 +88,26 @@ When `OPERATION_MODE` is not specified, the application defaults to `update` mod
## Usage
### Basic Usage
### Interactive TUI (Recommended)
Run the script with your configured environment:
Launch the interactive Terminal User Interface for a guided experience:
```bash
npm run tui
```
The TUI provides:
- Interactive configuration management
- Real-time progress visualization
- Operation scheduling
- Log viewing and analysis
- Tag analysis tools
- Windows-optimized interface
### Command Line Interface
Run the script directly with your configured environment:
```bash
npm start
@@ -287,11 +307,23 @@ shopify-price-updater/
│ │ ├── shopify.js # Shopify API client
│ │ ├── product.js # Product operations
│ │ └── progress.js # Progress logging
│ ├── tui/ # Terminal User Interface (Ink-based)
│ │ ├── components/
│ │ │ ├── common/ # Reusable UI components
│ │ │ └── screens/ # Screen components
│ │ ├── hooks/ # Custom React hooks
│ │ ├── providers/ # Context providers
│ │ ├── utils/ # TUI utilities
│ │ └── TuiApplication.jsx # Main TUI component
│ ├── utils/
│ │ ├── price.js # Price calculations
│ │ └── logger.js # Logging utilities
── index.js # Main entry point
── index.js # CLI entry point
│ └── tui-entry.js # TUI entry point
├── tests/ # Unit tests for the application
├── docs/ # Documentation
│ ├── windows-compatibility-summary.md
│ └── performance-optimization-summary.md
├── debug-tags.js # Debug script to analyze store tags
├── .env # Your configuration (create from .env.example)
├── .env.example # Configuration template
@@ -300,6 +332,47 @@ shopify-price-updater/
└── README.md # This file
```
## Terminal User Interface (TUI)
### TUI Features
The interactive Terminal User Interface provides a modern, user-friendly way to manage your Shopify price updates:
- **Main Menu**: Central navigation hub with keyboard shortcuts
- **Configuration Screen**: Interactive form for environment settings with real-time validation
- **Operation Screen**: Live progress tracking with visual indicators
- **Scheduling Screen**: Date/time picker for automated operations
- **Log Viewer**: Paginated log display with search and filtering
- **Tag Analysis**: Product tag statistics and recommendations
### TUI Architecture
Built with **Ink** (React for CLI) for superior cross-platform compatibility:
- **Component-based**: Modern React architecture with reusable components
- **State Management**: React Context API with custom hooks
- **Windows Optimized**: Enhanced compatibility with Windows Terminal, Command Prompt, and PowerShell
- **Responsive Design**: Adapts to different terminal sizes and orientations
- **Accessibility**: Screen reader support and high contrast mode compatibility
- **Performance**: Optimized rendering with virtual scrolling and memory management
### TUI Components
- **ProgressBar**: Visual progress indicators with color coding
- **InputField**: Form inputs with real-time validation
- **MenuList**: Keyboard-navigable menus with selection highlighting
- **StatusBar**: Real-time system status and connection information
- **ErrorBoundary**: Graceful error handling and recovery
### Keyboard Navigation
- **Arrow Keys**: Navigate menus and options
- **Enter**: Select/confirm actions
- **Escape/q**: Go back or quit
- **Tab**: Move between form fields
- **Ctrl+C**: Exit application
- **?**: Show help overlay
## Technical Details
### API Implementation
@@ -323,13 +396,17 @@ shopify-price-updater/
## Available Scripts
### Interactive Interface
- `npm run tui` - Launch the interactive Terminal User Interface (recommended)
### Immediate Execution Scripts
- `npm start` - Run the price updater (defaults to update mode for backward compatibility)
- `npm run update` - Run the price update script (explicitly set to update mode)
- `npm run rollback` - Run the price rollback script (set prices to compare-at prices)
- `npm run debug-tags` - Analyze all product tags in your store
- `npm test` - Run the test suite (if implemented)
- `npm test` - Run the test suite
### Scheduled Execution Scripts