zoho-widget-packer
v0.2.1
Published
Build and package Zoho widgets from framework builds (React + Vite supported).
Maintainers
Readme
Zoho Widget Packer
Standalone packer for Zoho widgets built with frameworks like React.
Repository: https://github.com/ahmedsaeed195/zoho-widget-packer
How it works
- Runs your build command in the app directory (Defaults:
npm run build,--app-dir=.; change via--build-cmdand--app-dir). - Copies the build output into
widget_dist/app(Defaults:--build-dir=dist,--out-dir=widget_dist; change via--build-dirand--out-dir). - Ensures a valid
plugin-manifest.jsonexists for the target service (Defaults:--manifest-path=.; change via--manifest-path). - Injects the correct Zoho SDK script into the entry HTML file (Defaults:
--entry=index.html, SDK auto-selected by--target; change via--entryand--sdk-url). - Creates a zip archive at
widget_dist.zip(Defaults:--zip-path=widget_dist.zip; change via--zip-path).
The SDK injection step adds a <script src="..."></script> tag to your entry HTML
if it is not already present. The default SDK URL is selected based on --target,
or you can override it with --sdk-url.
Install
npm install -g zoho-widget-packerUsage
zoho-widget-packer --target=creator
zoho-widget-packer --target=crmFlags / env vars
--target(required) orWIDGET_TARGET--root-dirorWIDGET_ROOT_DIR(default: current working dir)--app-dirorWIDGET_APP_DIR(default:.)--build-dirorWIDGET_BUILD_DIR(default:distunder--app-dir)--out-dirorWIDGET_OUT_DIR(default:widget_dist)--zip-pathorWIDGET_ZIP_PATH(default:widget_dist.zip)--manifest-pathorWIDGET_MANIFEST_PATH(default:.; writesplugin-manifest.json)--entryorWIDGET_ENTRY(default:index.html)--sdk-urlorWIDGET_SDK_URL(override default SDK URL)--build-cmdorWIDGET_BUILD_CMD(default:npm run build)
Notes
- Creator uses the v2 SDK by default.
- CRM uses the Embedded JS SDK (v1.5) by default.
- Currently supported Zoho services: Creator and CRM.
- Currently supported: React + Vite only.
