Closed thiagodemellobueno closed 6 years ago
Definitely something is up with Twig these days. The namespaces seem wonky.
https://kss-node.github.io/kss-node/api/master/builder_base_twig_kss_builder_base_twig.js.html
Implies that there is in fact namespace support.
Further digging tells me two things.
We have namespaces in kalastatic
console.log(this.options)
in the base twig builder (which we inherit with our builder)
outputs:
namespace:
[ 'kalastatic:src',
'atoms:src/components/atoms',
'molecules:src/components/molecules',
'organisms:src/components/organisms' ]
This means that setting namespace:
or namespaces:
in kalastatic.yml
has no effect (we have a few additional namespaces in that block) so seems like the kstat namespaces are hardcoded and non-configurable
Tried both:
namespace:
- "kstat:src"
- "atoms:src/components/atoms"
- "molecules:src/components/molecules"
- "organisms:src/components/organisms"
- "ecosystems:src/components/ecosystems"
- "environments:src/components/environments"
- "layouts:src/components/layouts"
- "images:src/images"
- "assets:src/assets"
and
namespaces:
- "kstat:src"
- "atoms:src/components/atoms"
- "molecules:src/components/molecules"
- "organisms:src/components/organisms"
- "ecosystems:src/components/ecosystems"
- "environments:src/components/environments"
- "layouts:src/components/layouts"
- "images:src/images"
- "assets:src/assets"
The namespaces that are in, are correct, annd still not working.
This is a pretty serious blocker on some projects right now. Can we rally around it?
@RobLoach to more succinctly describe the issue:
Kss is only cuirrently finding components with relative paths (eg ../../atoms…/
)
The metalsmith prototype is only finding components with namespaces (eg. @atoms/../
) but fails onn ../../atoms
.... i would be happy to have to work either with relative paths or nnamespaces, but we have to have at least one situation that works consistently betweenn both spaces.
Made some progress on this over at https://github.com/kalamuna/kalastatic/pull/578... I'm seeing Twig.js may have dropped relative pathing entirely. Still debugging the issue however.
We've known about KSS not supporting namespaces, But since the latest version of jstransformers-twig it seems like ow the prototype doesn't support relative paths, which puts us in a bit of a bind.