Skip to content

Commit

Permalink
fix: rename cloud-cognitive and simplify component list script
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewgallo committed Aug 20, 2024
1 parent 256c999 commit b381091
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 37 deletions.
2 changes: 1 addition & 1 deletion packages/component-list/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ and submit a pull request.

> 💡 Thinking about maintenance, it's best to find a way to build this data from
> your component library. See how
> [cloud-cognitive](https://github.com/carbon-design-system/devtools/tree/base/packages/component-list/src/library/cloud-cognitive.js)
> [ibm-products](https://github.com/carbon-design-system/devtools/tree/base/packages/component-list/src/library/ibm-products.js)
> set up their components to scale.
5. Add your new library file to the build file
Expand Down
35 changes: 0 additions & 35 deletions packages/component-list/src/libraries/cloud-cognitive.js

This file was deleted.

31 changes: 31 additions & 0 deletions packages/component-list/src/libraries/ibm-products.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import fs from 'fs';
import { pkg } from '@carbon/ibm-products';
import { _initStats } from '../helpers.js';

const { _stats, success } = new _initStats();
const productsDir = '../../node_modules/@carbon/ibm-products/es/components';
const products = {
name: 'Carbon for IBM Products',
components: {},
_stats,
};
const { getDevtoolsId, devtoolsAttribute } = pkg;

try {
const components = fs.readdirSync(productsDir);

components.forEach((file) => {
if (file === '_Canary' || file === 'index.d.ts') {
return;
}

const identifier = `[${devtoolsAttribute}="${getDevtoolsId(file)}]`;

products.components[identifier] = file;
success();
});
} catch (e) {
console.log(e);
}

export { products };
2 changes: 1 addition & 1 deletion packages/component-list/src/libraries/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from './carbon';
export * from './carbon-web-components';
export * from './ibmdotcom';
// export * from './cloud-cognitive';
export * from './ibm-products';
export * from './security';
export * from './cloud-pal';

0 comments on commit b381091

Please sign in to comment.