Add --no-emoji option to disable emoji characters in console output (#1635)

* Add --no-emoji option to disable emoji characters in console output

- Added emoji-util.js utility for conditional emoji formatting
- Updated args.js to include --no-emoji command line option
- Modified script-util.js to use formatMessage() for all emoji output
- Updated startup.js to use emoji utility
- Added documentation and demo scripts
- Resolves issues with stdout when piping to automation tools
- Python no longer chokes on emoji characters in output
- Maintains backward compatibility (emojis enabled by default)

* Fix env.formatMessage() for startup.test.js - add emoji utility wrapper to env.js

* Update src-script/script-util.js

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Fix license header corruption and standardize emoji usage

- Fixed corrupted license header in script-util.js
- Standardized to use emojiUtil.formatMessage() in script files
- Keep env.formatMessage() wrapper for startup.js compatibility
- Both approaches work correctly for their respective module systems

* Fix comprehensive emoji support across ZAP

- Fix broken emoji syntax in startup.js and gsdk-public-regen.js
- Add emoji support to gsdk-public-regen.js and zap-package-metadata.js
- Create fix-emojis.js utility script for systematic emoji conversion
- All emojis now respect --no-emoji flag and NO_EMOJI environment variable

* Complete emoji support implementation across all ZAP scripts

- Add emoji utility to zap-start.js and zap-uitest.js
- Fix remaining hardcoded emojis in zap-start.js, zap-uitest.js, and gsdk-public-regen.js
- All console output now respects --no-emoji flag and NO_EMOJI environment variable
- Comprehensive solution ensures automation-friendly output for CI/CD pipelines

* Make emoji utility stateful and testable

- Replace static constant with dynamic isEmojiDisabled() function
- Add setEmojiDisabled() and resetEmojiState() for testing
- Export testing functions through env.js wrapper
- Fix test to use CommonJS emoji-util directly
- Maintains environment variable and command line flag detection
- Enables proper unit testing of emoji functionality

* Restore accidentally deleted API documentation

- Restore docs/api.md from commit 48de0060 (before emoji changes)
- File was accidentally truncated in commit 5f8ef3e8 due to JSDoc generation failure
- JSDoc fails with Node.js v24 due to util.isRegExp compatibility issue
- Restores all 28,406 lines of API documentation

* Remove EMOJI_IMPLEMENTATION_SUMMARY.md

- Remove redundant summary file
- Documentation is already covered in docs/no-emoji-implementation.md

* Remove temporary development files

- Remove demo-no-emoji.js (was just a demonstration script)
- Remove fix-emojis.js (was a utility script for development)
- Keep only the production implementation files

* Refactor: Consolidate formatMessage function to follow DRY principle

- Remove duplicate formatMessage function from emoji-util.js
- Keep single formatMessage implementation in env.js for general message formatting
- Update all imports and function calls across codebase from emojiUtil.formatMessage to env.formatMessage
- Maintain emoji-util.js focus on emoji state management only
- Improve code organization by placing message formatting in general utilities module

Fixes code duplication and follows best practices for single responsibility principle.

* Fix module syntax in env.js: convert ES modules to CommonJS

- Convert 42 'export function' declarations to regular functions
- Convert 'export const environmentVariable' to regular const
- Add all exports to module.exports object for CommonJS compatibility
- Resolves CI failure caused by mixed ES/CommonJS module syntax
- Maintains all existing functionality while fixing Node.js module loading

* Fix formatMessage implementation in env.js

- Implement formatMessage logic directly instead of calling non-existent emojiUtil.formatMessage
- Use emojiUtil.isEmojiDisabled() to check state and format accordingly
- Resolves TypeError: emojiUtil.formatMessage is not a function

* Address PR review: Fix emoji corruption and rename formatMessage to formatEmojiMessage

- Fix corrupted emojis (� symbols) that appeared due to encoding issues during sed operations
- Rename formatMessage() to formatEmojiMessage() for better semantic clarity
- Restore proper Unicode emojis: 👈 for read operations, 👉 for write operations, 🔧 for processing
- Update all 94+ function call sites across startup.js, script utilities, and tests
- Verify emoji functionality works correctly with comprehensive test coverage
- Remove obsolete test files and documentation per cleanup requirements

Addresses feedback from PR review regarding function naming and emoji display issues.

* Clean up empty development files

Remove empty files that were created during development:
- EMOJI_IMPLEMENTATION_SUMMARY.md
- demo-no-emoji.js
- fix-emojis.js

These were temporary files that never got populated with content.

* update apack.json

* remove package-lock.json

* cleanup

* cleanup

* adding helper functions because they are needed for the tests

* add tests and cleanup

* more emojies

* bug fix

* fix ci

* fix to new format

* fix emoji

* fix tests

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
28 files changed
tree: e0536fafb712f80f620ef590ce3d2fe6ce280abe
  1. .github/
  2. .husky/
  3. cypress/
  4. docs/
  5. public/
  6. resource-build/
  7. src/
  8. src-electron/
  9. src-script/
  10. src-shared/
  11. test/
  12. zcl-builtin/
  13. .editorconfig
  14. .eslintignore
  15. .eslintrc.js
  16. .gitignore
  17. .gitmodules
  18. .postcssrc.js
  19. .prettierrc
  20. .stylintrc
  21. apack.json
  22. babel.config.js
  23. cypress.config.js
  24. Jenkinsfile
  25. jest.config.js
  26. jsconfig.json
  27. LICENSE.txt
  28. package-lock.json
  29. package.json
  30. quasar.conf.js
  31. quasar.extensions.json
  32. quasar.testing.json
  33. README.md
  34. sonar-project.properties
  35. tsconfig.json
  36. zap-schema.dot
  37. zap-schema.svg
README.md

ZCL Advanced Platform

ZCL Advanced Platform

Build and release packages Zigbee code regeneration Matter code regeneration

What is ZAP?

ZAP is a generic generation engine and user interface for applications and libraries based on Zigbee Cluster Library, the specification developed by the Connectivity Standards Alliance.

ZAP allows you to perform the following:

  • perform SDK-specific customized generation of all global artifacts (constants, types, IDs, etc) based on the ZCL specification
  • provide UI for the end-user to select specific application configuration (clusters, attributes, commands, etc.)
  • perform SDK-specific customized generation of all user selected configuration artifacts (application configuration, endpoint configuration, etc) based on ZCL specification and customer-provided application configuration.

ZAP is a generic templating engine. Examples are provided for how to generate artifacts for the C language environment, but one could easily add new templates for other language environments, such as C++, java, node.js, python or any other.

Quick setup

Refer to Setup Instructions

Source code

Refer to development instructions for more details.

License

This software is licensed under Apache 2.0 license.

Usage Documentation

Detailed Developer Documentation