Error using swift plugin
Versions
- @terrazzo/cli: 0.10.2
- @terrazzo/plugin-swift: 0.2.2
Node.js version
22.19.0
OS + version
macOS 15.6.1
Description
Error when building tokens while swift plugin is installed et configured
Reproduction
Initialize a new Terrazzo project:
npx tz init
Select any design system (e.g., "Adobe Spectrum"). When prompted to "Install plugins?", Do not select any plugin. The init command will complete successfully.
Add and configure @terrazzo/plugin-swift plugin accordingly to doc page
Attempt to build the project:
npx tz build
An error occurs :
✗ [config] Cannot read properties of undefined (reading 'channels')
Expected result
Tokens are built correctly
Extra
- [x] I’m willing to open a PR (see CONTRIBUTING.md)
Seems that the bugs occurs at import time and is not related to the plugin itself
If it happens in init, then the examples are pulled from dtcg-examples. The “channels” error almost seems like it’s pulling an old version. But it’s designed to fetch directly from GitHub (bypassing npm).
I’m not sure exactly what the error is but would love a PR if you investigate what’s happening 🙏
It does not happens on init but when you import the plugin, even if you don't use it.
import swift from '@terrazzo/plugin-swift';
triggers the error.
I have a fix in mind, I'll open a PR soon. 👍