patternfly / patternfly/patternfly-org
Bug - CodeSandbox - examples fail because package.json includes CSS dependency
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 74
- Forks
- 147
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 2
Description
Describe the problem
The CodeSandbox examples include additional package dependencies via parsing import statements found in PatternFly examples. However, this inadvertently includes CSS imports as well. As a result, multiple CodeSandbox examples fail because a CSS file is not a valid package dependency.
How do you reproduce the problem?
- Run latest code locally
- Navigate to the chart sparkline or tooltip examples
- Open any CodeSandbox example from these pages
- View the package.json file
- See the CSS file as a dependency, for example:
"react-charts/src/victory/components/Sparkline/examples/./sparkline.css": "latest",
Expected behavior
This regex statement in documentation-framework should omit CSS files from the CodeSandbox dependencies
Screenshots
Sparkline examples
http://localhost:8002/charts/sparkline-chart
Any other information?
Even after removing the extra dependency manually, the CSS file no longer loads as expected. CodeSandbox appears to be importing 'react-charts/src/victory/components/Sparkline/examples/./sparkline.css' instead of './sparkline.css'.
Jira Issue: PF-1968
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/documentation-framework/helpers/codesandbox.js at the regex around line 172, then reproduce the sparkline or tooltip CodeSandbox examples and inspect their generated package.json. Verify that CSS imports are omitted as dependencies and that the remaining CSS import uses the expected relative path; the examples should load without the invalid package dependency.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, javascript
- Domain
- documentation, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100