zoho-widget-packer
v0.4.0
Published
Build and package Zoho widgets from framework builds (React + Vite/Webpack 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 (Required:
--framework,--bundler; 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 --framework=react --bundler=vite
zoho-widget-packer --target=crm --framework=react --bundler=vite
zoho-widget-packer --target=creator --framework=react --bundler=webpack
zoho-widget-packer --target=creator --framework=vue --bundler=vite
zoho-widget-packer --target=creator --framework=vue --bundler=webpack
zoho-widget-packer --target=creator --framework=angular --bundler=webpack
# Angular CLI builds often need a custom build output path:
zoho-widget-packer --target=creator --framework=angular --bundler=vite --build-dir=dist/<app-name>/browserFlags / env vars
--target(required) orWIDGET_TARGET--framework(required) orWIDGET_FRAMEWORK--bundler(required) orWIDGET_BUNDLER--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 framework/bundler combinations:
- React + Vite
- React + Webpack
- Vue + Vite
- Vue + Webpack
- Angular + Vite
- Angular + Webpack
- Auto-detection is not enabled yet. Pass explicit flags (
--framework,--bundler) when needed.
Roadmap
- Phase 1 (current): React/Vue/Angular + Vite/Webpack
- Phase 2 (planned): Optional auto-detection fallback when framework/bundler flags are not passed
Test Fixtures
Reusable sample projects live under test-fixtures:
react-vite-samplereact-webpack-samplevue-vite-samplevue-webpack-sampleangular-vite-sampleangular-webpack-sample
Use these fixtures for packer validation instead of production widget projects.
