synapse-wireless-labs / component-lab

A component development and testing tool built for Angular, inspired by React Storybook.
79 stars 16 forks source link

Multiple experiments require unique IDs #18

Closed intellix closed 7 years ago

intellix commented 7 years ago

Created an exp file for 2x components and noticed that I only have a single entry in the navigation. Was debugging why and found that I need to specify a module.id per experiment otherwise the ID names for each experiment defaults to exp: https://github.com/synapse-wireless-labs/component-lab/blob/76533b798e058713bfa2310793014541465a2083/src/index.ts#L22

README.md says to create experiments like:

export default experimentOn('My Button')

But in order to have multiple, they need to include a unique ID:

export default experimentOn('My Button', { id: 'button' })

My guess is that with the webpack configuration included, an ID is always provided, but with Angular CLI there isn't one.

Any idea of how to tackle this?

DarwinSenior commented 7 years ago

Hi, I find this project quite interesting. I forked this directory and had the same problem. I am currently changing this line to

this.id = module ? 'exp'+module.id : 'name'+name;

I think one could just use unique name for this right?

brandonroberts commented 7 years ago

Fixed via #24