|
| 1 | +# ProFullStack Modules |
| 2 | + |
| 3 | +This repository contains modular components extracted from the ProFullStack boilerplate application. These modules can be used independently in other projects. |
| 4 | + |
| 5 | +## Available Modules |
| 6 | + |
| 7 | +- **Document Converters** (`@profullstack/document-converters`): A unified API for converting between different document formats. |
| 8 | +- **API Key Manager** (`@profullstack/api-key-manager`): A flexible API key management system. |
| 9 | +- **Enhanced Router** (`@profullstack/enhanced-router`): A client-side router with advanced features. |
| 10 | +- **WebSocket Client** (`@profullstack/websocket-client`): A robust WebSocket client with connection management. |
| 11 | +- **Storage Service** (`@profullstack/storage-service`): A flexible storage service abstraction. |
| 12 | +- **State Manager** (`@profullstack/state-manager`): An enhanced state manager with web component integration. |
| 13 | +- **Payment Gateway** (`@profullstack/payment-gateway`): A unified payment gateway abstraction. |
| 14 | + |
| 15 | +## Module Management Script |
| 16 | + |
| 17 | +The `publish-modules.sh` script provides a comprehensive set of tools for managing and publishing the modules. |
| 18 | + |
| 19 | +### Prerequisites |
| 20 | + |
| 21 | +- Node.js and npm/pnpm/yarn installed |
| 22 | +- npm account with access to the @profullstack organization (for publishing) |
| 23 | + |
| 24 | +### Basic Usage |
| 25 | + |
| 26 | +```bash |
| 27 | +# List all available modules |
| 28 | +./publish-modules.sh --all list |
| 29 | + |
| 30 | +# Build all modules |
| 31 | +./publish-modules.sh --all build |
| 32 | + |
| 33 | +# Link all modules for local development |
| 34 | +./publish-modules.sh --all link |
| 35 | + |
| 36 | +# Publish all modules to npm |
| 37 | +./publish-modules.sh --all publish |
| 38 | + |
| 39 | +# Bump the version of a specific module |
| 40 | +./publish-modules.sh -m document-converters -b minor version |
| 41 | +``` |
| 42 | + |
| 43 | +### Script Options |
| 44 | + |
| 45 | +``` |
| 46 | +Actions: |
| 47 | + publish Publish modules to npm registry |
| 48 | + version Bump version of modules |
| 49 | + link Create symlinks for local development |
| 50 | + unlink Remove symlinks created by link action |
| 51 | + build Build modules |
| 52 | + test Run tests for modules |
| 53 | + list List available modules |
| 54 | +
|
| 55 | +Options: |
| 56 | + -h, --help Show this help message |
| 57 | + -a, --all Apply action to all modules |
| 58 | + -m, --module <name> Apply action to specific module |
| 59 | + -b, --bump <level> Version bump level (patch, minor, major) [default: patch] |
| 60 | + -d, --dir <path> Directory containing modules [default: ../] |
| 61 | + -r, --registry <url> NPM registry URL [default: https://registry.npmjs.org/] |
| 62 | + -p, --package-manager <name> Package manager to use (npm, pnpm, yarn) [default: pnpm] |
| 63 | + --dry-run Show what would be done without making changes |
| 64 | + --skip-build Skip build step before publishing |
| 65 | + --skip-test Skip test step before publishing |
| 66 | + --skip-confirm Skip confirmation prompts |
| 67 | + --scope <scope> Module scope [default: @profullstack] |
| 68 | +``` |
| 69 | + |
| 70 | +### Examples |
| 71 | + |
| 72 | +#### Publishing Modules |
| 73 | + |
| 74 | +```bash |
| 75 | +# Publish all modules |
| 76 | +./publish-modules.sh --all publish |
| 77 | + |
| 78 | +# Publish a specific module |
| 79 | +./publish-modules.sh -m document-converters publish |
| 80 | + |
| 81 | +# Dry run to see what would be published without actually publishing |
| 82 | +./publish-modules.sh --all --dry-run publish |
| 83 | + |
| 84 | +# Publish to a different registry |
| 85 | +./publish-modules.sh --all -r https://npm.pkg.github.com/ publish |
| 86 | +``` |
| 87 | + |
| 88 | +#### Version Management |
| 89 | + |
| 90 | +```bash |
| 91 | +# Bump patch version of all modules |
| 92 | +./publish-modules.sh --all -b patch version |
| 93 | + |
| 94 | +# Bump minor version of a specific module |
| 95 | +./publish-modules.sh -m state-manager -b minor version |
| 96 | + |
| 97 | +# Bump major version of multiple modules |
| 98 | +./publish-modules.sh -m document-converters -m api-key-manager -b major version |
| 99 | +``` |
| 100 | + |
| 101 | +#### Local Development |
| 102 | + |
| 103 | +```bash |
| 104 | +# Link all modules for local development |
| 105 | +./publish-modules.sh --all link |
| 106 | + |
| 107 | +# Link a specific module |
| 108 | +./publish-modules.sh -m enhanced-router link |
| 109 | + |
| 110 | +# Unlink all modules |
| 111 | +./publish-modules.sh --all unlink |
| 112 | +``` |
| 113 | + |
| 114 | +#### Building and Testing |
| 115 | + |
| 116 | +```bash |
| 117 | +# Build all modules |
| 118 | +./publish-modules.sh --all build |
| 119 | + |
| 120 | +# Test all modules |
| 121 | +./publish-modules.sh --all test |
| 122 | + |
| 123 | +# Build a specific module |
| 124 | +./publish-modules.sh -m payment-gateway build |
| 125 | +``` |
| 126 | + |
| 127 | +### Using a Different Package Manager |
| 128 | + |
| 129 | +```bash |
| 130 | +# Use npm instead of pnpm |
| 131 | +./publish-modules.sh --all -p npm publish |
| 132 | + |
| 133 | +# Use yarn |
| 134 | +./publish-modules.sh --all -p yarn publish |
| 135 | +``` |
| 136 | + |
| 137 | +## Using the Modules in Your Project |
| 138 | + |
| 139 | +### Installation |
| 140 | + |
| 141 | +```bash |
| 142 | +# Install a specific module |
| 143 | +npm install @profullstack/document-converters |
| 144 | + |
| 145 | +# Install multiple modules |
| 146 | +npm install @profullstack/enhanced-router @profullstack/state-manager |
| 147 | +``` |
| 148 | + |
| 149 | +### Local Development |
| 150 | + |
| 151 | +For local development, you can link the modules to your project: |
| 152 | + |
| 153 | +```bash |
| 154 | +# Link all modules |
| 155 | +./publish-modules.sh --all link |
| 156 | + |
| 157 | +# In your project directory |
| 158 | +npm link @profullstack/document-converters @profullstack/state-manager |
| 159 | +``` |
| 160 | + |
| 161 | +## Contributing |
| 162 | + |
| 163 | +1. Clone the repository |
| 164 | +2. Make your changes |
| 165 | +3. Build and test the modules |
| 166 | +4. Submit a pull request |
| 167 | + |
| 168 | +## License |
| 169 | + |
| 170 | +MIT |
0 commit comments