This script is designed to facilitate the generation of components and extensions for PWA Studio.
pwagen <command> [--args]...
Create a new React component with css file.
Create a new extension using a template.
- ComponentName: Name of the component to be created.
- -d, --path CustomPath: Custom path to create the component. (default: lib/components)
- -p, --parent ParentComponentName: Name of the parent component (optional).
- -u, --use yarn || npm: Installation tool (default: yarn).
- -t, --template TemplateName: Name of the template to create the extension. (default: @devgfnl/pwa-extension-template)
git clone https://github.com/GabrielFNLima/pwa-studio-generator.git
cd pwa-studio-generator
sudo cp $(pwd)/pwagen.sh /usr/local/bin/pwagen
sudo chmod +x /usr/local/bin/pwagen
Now you can access the CLI globally by using pwagen.
pwagen create-component MyNewComponent -d custom/path
# with parent component
pwagen create-component OtherNewComponent -d custom/path -p MyNewComponent
pwagen create-extension
This script assumes the usage of PWA Studio tools and may require modifications based on your specific project setup. Always review and customize the script according to your project's requirements.
Important: Ensure that you understand the implications of running the script, especially when creating components within an existing project. Always test in a safe environment before deploying to a production environment.