spyne-cli
v0.5.5
Published
Generates spyne objects and saves them to standard spyne.
Downloads
3
Readme
Spyne CLI
spyne-cli
is a command-line utility designed to streamline the process of generating and managing applications built using the SpyneJS framework. It simplifies the creation of ViewStream
, Channel
, and SpyneTrait
classes, making it easier to build scalable and modular single-page applications.
Features
- Create a new SpyneJS application with a single command.
- Generate
ViewStream
,Channel
, andSpyneTrait
classes based on user prompts. - Easily extend and customize applications.
- Built-in support for channel-driven development.
Installation
To install the spyne-cli
, you need to have Node.js and npm installed on your system.
Install the package globally:
npm install -g @spynejs/spyne-cli
Usage
Creating a New SpyneJS Application
To create a new SpyneJS application, run:
npx spyne-cli create-app <app-name>
This will generate the necessary project files in the specified <app-name>
directory.
Generating Components
You can use spyne-cli
to generate new ViewStream
, Channel
, and SpyneTrait
components:
ViewStream: To generate a new
ViewStream
, use:npx spyne-cli generate viewstream <view-name>
Channel: To generate a new
Channel
, use:npx spyne-cli generate channel <channel-name>
SpyneTrait: To generate a new
SpyneTrait
, use:npx spyne-cli generate spynetrait <trait-name>
Example
To create a new application and add a ViewStream
component:
Create a new application:
npx spyne-cli create-app my-spyne-app
Navigate to the application directory:
cd my-spyne-app
Generate a
ViewStream
component:npx spyne-cli generate viewstream MyView
Configuration
The spyne-cli
supports customization via the spyne.config.js
file located in your project’s root directory. You can modify the config file to control the file structure, template generation, and more.
Example spyne.config.js
module.exports = {
templates: {
viewstream: './templates/viewstream.hbs',
channel: './templates/channel.hbs',
spynetrait: './templates/spynetrait.hbs',
},
outputDir: './src/components',
};
Contributing
Contributions are welcome! Please feel free to submit a Pull Request or open an Issue on the GitHub repository.
License
This project is licensed under the MIT License.
You can now paste this content directly into your `README.md` file. Let me know if you need further assistance!