1.0.2 • Published 9 months ago
@passionio/service-generator v1.0.2
service-generator
A CLI tool to generate new Passion.io microservices from a template repository.
Installation
You can use this tool in two ways:
1. Using npx (recommended)
npx @passionio/service-generator <service-name> [options]2. Global Installation
# Using yarn
yarn global add @passionio/service-generator
# Using npm
npm install -g @passionio/service-generatorUsage
After installation, you can create a new service using:
create-passion-service <service-name> [options]Options
-t, --template <repo>- Template repository (default: "independenc3/service-template")-o, --output-dir <dir>- Output directory (default: current directory)-r, --remote <url>- Remote repository URL to push to (optional)
Examples
- Create a basic service using the default template:
create-passion-service communities- Create a service using a custom template:
create-passion-service notifications \
-t my-org/custom-service-template- Create a service in a specific directory:
create-passion-service payments \
-o ./services- Create a service and link it to a remote repository:
create-passion-service analytics \
-r git@github.com:your-org/analytics-service.gitImportant Notes
- The service name will automatically be converted to plural form if it's singular (e.g., "community" becomes "communities")
- The generator will:
- Clone the template repository
- Initialize git submodules
- Replace all occurrences of placeholder names with your service name
- Initialize a new git repository
- Create an initial commit
- Push to remote repository (if specified)
After Generation
Once your service is generated, follow these steps:
- Navigate to your new service directory:
cd <service-name>- If you haven't specified a remote repository during generation:
- Create a new repository on GitHub
- Add the remote repository:
git remote add origin <repository-url>
git push -u origin main- Update the service's README.md with specific details about your service
- Start developing!
License
UNLICENSED - Proprietary software