hashicorp / structure

Structure (aka "PDS") [deprecated]
https://hashicorp-structure.vercel.app
Mozilla Public License 2.0
24 stars 5 forks source link

Remove `Pds:Icon` as dependency for Structure #126

Closed didoo closed 1 year ago

didoo commented 1 year ago

Description

The intent of this PR is to remove all the usages of Pds::Icon within the repo. Once this PR is merged a new version of Structure will be released, adopted in Cloud UI (with the needed changes/fixes that are required by the update), and only at that point we will proceed with the complete removal and deprecation of the Pds::Icon component itself from the repo (this will be done in a follow-up PR, obviusly).

Changes

In this PR I have:

Testing

I have symlinked my local directory package/pds-ember to the cloud-ui/node_modules/@hashicorp/pds-ember folder in Cloud UI, run the application and tested that everything worked as expected.

Relevant links

🚧 TODOs

Once this PR is merged and the new Structure version is adopted in Cloud UI:


Codemod used to check <Pds::Button> instances with @iconStart/@iconEnd arguments:

module.exports = function ({ source, path }, { parse, visit }) {
  const ast = parse(source);

  return visit(ast, (env) => {
    let { builders } = env.syntax;

    return {
      ElementNode(node) {
        if (node.tag.toLowerCase() === 'pds::button') {
          const hasIconArg = node.attributes.find(
            (a) => a.name === '@iconStart' || a.name === '@iconEnd'
          );
          if (hasIconArg) {
            console.info(
              'Found <Pds::Button> with @iconStart/@iconEnd argument',
              `\nFILE: "${path}"`
            );
          }
        }
      },
    };
  });
};

module.exports.type = 'hbs';
vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
structure ✅ Ready (Inspect) Visit Preview Sep 21, 2022 at 5:13PM (UTC)