Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

fix(docs): retrieve source descriptor dynamically. #7319

Closed

Conversation

devversion
Copy link
Member

At the moment the doc descriptor is retrieved through hard-coding.
This causes problems when a component is not located in the hard-coded folder src/components
After this fix, the doc descriptor will be dynamically parsed (using the last possible descriptor criteria), so this allows components to be located everywhere in the project.
This fixes the wrong GitHub links for the ripple service / component.

Fixes #7131

At the moment the doc descriptor is retrieved through hard-coding.
This causes problems when a component is not located in the hard-coded folder `src/components`
After this fix, the doc descriptor will be dynamically parsed (using the last possible descriptor criteria), so this allows components to be located everywhere in the project.
This fixes the wrong GitHub links for the ripple service / component.

Fixes angular#7131
@devversion devversion added the needs: review This PR is waiting on review from the team label Feb 27, 2016
@ThomasBurleson
Copy link
Contributor

@EladBezalel - can you review ?

@EladBezalel
Copy link
Member

LGTM

// For example it retrieves from `/opt/material/src/core/services/ripple/ripple.js` the following
// source descriptor: `src/core/`.
// This is needed because components are not only located in `src/components`.
var descriptor = doc.fileInfo.filePath.toString().match(/src\/.*?\//g).pop();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like the node fs api might be able to do this more easily, but I'm not that familiar with it.
@robertmesserle ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing comes to mind, but I'm not sure I fully understand the context.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the fs / pathapi has anything for that, it's a really unspecific case.

@jelbourn
Copy link
Member

jelbourn commented Mar 9, 2016

LGTM

@jelbourn jelbourn added pr: merge ready This PR is ready for a caretaker to review and removed needs: review This PR is waiting on review from the team labels Mar 9, 2016
ThomasBurleson pushed a commit that referenced this pull request Apr 1, 2016
At the moment the doc descriptor is retrieved through hard-coding.
This causes problems when a component is not located in the hard-coded folder `src/components`
After this fix, the doc descriptor will be dynamically parsed (using the last possible descriptor criteria), so this allows components to be located everywhere in the project.
This fixes the wrong GitHub links for the ripple service / component.

Fixes #7131. Closes #7319
ThomasBurleson pushed a commit that referenced this pull request Apr 1, 2016
At the moment the doc descriptor is retrieved through hard-coding.
This causes problems when a component is not located in the hard-coded folder `src/components`
After this fix, the doc descriptor will be dynamically parsed (using the last possible descriptor criteria), so this allows components to be located everywhere in the project.
This fixes the wrong GitHub links for the ripple service / component.

Fixes #7131. Closes #7319
@devversion devversion deleted the fix/component-data-descriptor branch April 19, 2016 19:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr: merge ready This PR is ready for a caretaker to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Github links for some API docs are broken
6 participants