cobalt-ui icon indicating copy to clipboard operation
cobalt-ui copied to clipboard

Error using swift plugin

Open pvignau opened this issue 3 months ago • 3 comments

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

pvignau avatar Sep 10 '25 13:09 pvignau

Seems that the bugs occurs at import time and is not related to the plugin itself

pvignau avatar Sep 11 '25 10:09 pvignau

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 🙏

drwpow avatar Sep 11 '25 15:09 drwpow

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. 👍

pvignau avatar Sep 11 '25 16:09 pvignau