kalamuna / kalastatic

:electric_plug: Facilitate the front-end experience through Styleguides and Prototypes
https://kalamuna.github.io/kalastatic/
41 stars 14 forks source link

Critical Pathing issues #577

Closed thiagodemellobueno closed 6 years ago

thiagodemellobueno commented 6 years ago

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.

RobLoach commented 6 years ago

Definitely something is up with Twig these days. The namespaces seem wonky.

thiagodemellobueno commented 6 years ago

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.

thiagodemellobueno commented 6 years ago

Further digging tells me two things.

  1. 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' ]
  2. 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"
  3. 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?

thiagodemellobueno commented 6 years ago

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

RobLoach commented 6 years ago

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.