Skip to content

Commit 551428e

Browse files
committed
Final push from react seed repo
1 parent 4cf6f0b commit 551428e

18 files changed

+8723
-400
lines changed

README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# Patternfly Seed
1+
# PatternFly Metrics Dashboard
22

3-
Patternfly Seed is an open source build scaffolding utility for web apps. The primary purpose of this project is to give developers a jump start when creating new projects that will use patternfly. A secondary purpose of this project is to serve as a reference for how to configure various aspects of an application that uses patternfly, webpack, react, typescript, etc.
3+
Adapted from the PatternFly seed app.
4+
5+
This project is a work-in-progress. Developed by the PatternFly Enablement team,
46

57
Out of the box you'll get an app layout with chrome (header/sidebar), routing, build pipeline, test suite, and some code quality tools. Basically, all the essentials.
68

@@ -101,3 +103,32 @@ ENV_2=http://2.myendpoint.com
101103

102104

103105
With that in place, you can use the values in your code like `console.log(process.env.ENV_1);`
106+
107+
## Live NPM Data Integration
108+
109+
The application now includes live NPM download data for design system comparison charts. The data is automatically fetched from the NPM Registry API and updates every 30 minutes.
110+
111+
### Features
112+
- **Real-time Data**: Fetches actual download statistics from npmjs.org
113+
- **Automatic Updates**: Refreshes every 30 minutes
114+
- **Manual Refresh**: Click "Refresh Now" button for immediate updates
115+
- **Fallback Support**: Uses sample data if API is unavailable
116+
- **Visual Indicators**: Shows data source status with color-coded indicators
117+
118+
### Packages Tracked
119+
- `@patternfly/react-core` (PatternFly)
120+
- `@shopify/polaris` (Shopify Polaris)
121+
- `@carbon/react` (Carbon Design)
122+
- `@atlaskit/button` (Atlaskit)
123+
124+
### CORS Considerations
125+
The app uses the public NPM Registry API (`api.npmjs.org`) which supports CORS. If you encounter CORS issues in your environment:
126+
127+
1. **Development**: Run with CORS disabled or use a proxy
128+
2. **Production**: Deploy behind a reverse proxy that handles CORS
129+
3. **Alternative**: The app will gracefully fallback to sample data
130+
131+
### Data Source
132+
- API: `https://api.npmjs.org/downloads/range`
133+
- Documentation: [NPM Registry API](https://github.com/npm/registry/blob/master/docs/download-counts.md)
134+
- Rate Limits: Reasonable usage is acceptable

package-lock.json

Lines changed: 113 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"@types/node": "^22.15.30",
3232
"@types/papaparse": "^5.3.16",
3333
"@types/react-router-dom": "^5.3.3",
34+
"@types/xlsx": "^0.0.35",
3435
"@typescript-eslint/eslint-plugin": "^8.17.0",
3536
"@typescript-eslint/parser": "^8.17.0",
3637
"copy-webpack-plugin": "^12.0.2",
@@ -84,7 +85,8 @@
8485
"react": "^18",
8586
"react-dom": "^18",
8687
"sirv-cli": "^3.0.0",
87-
"victory": "^37.3.6"
88+
"victory": "^37.3.6",
89+
"xlsx": "^0.18.5"
8890
},
8991
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
9092
}

0 commit comments

Comments
 (0)