Open pratapalakshmi opened 2 weeks ago
Latest commit: 2384ed669220b1c6baf7d91c0db9df457086484f
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
This update to the workflows-dashboard
app introduces significant changes. A new global configuration for environment variables is added, seen in the new TypeScript and JavaScript files. The build process improves with a clean build step added to package.json
, and all base URL references switch to using this new global configuration. Additionally, the main HTML file now includes a new script for these settings. These changes streamline configuration management and ensure a cleaner build setup.
Files | Change Summary |
---|---|
apps/workflows-dashboard/global.d.ts , config.js |
Introduced global declaration for the env variable and its configuration in a new JS file. |
apps/workflows-dashboard/index.html |
Added a script tag to include the config.js file in the HTML document. |
apps/workflows-dashboard/package.json |
Updated the build script to include a clean step by removing the dist directory before building. |
apps/workflows-dashboard/src/.../request.ts , src/main.tsx |
Switched base URLs to use the new global env configuration, ensuring consistent environment setup. |
sequenceDiagram
participant User
participant Browser
participant Server
User->>Browser: Load Dashboard
Browser->>Server: Fetch index.html
Server-->>Browser: Serve index.html
Browser->>Server: Fetch config.js
Server-->>Browser: Serve config.js
Browser->>globalThis: Set env from config.js
Browser->>AxiosInstance: Initialize with globalThis.env.VITE_API_URL
User->>Browser: Request Data
Browser->>AxiosInstance: Fetch Data from API
AxiosInstance->>Server: API Call to VITE_API_URL
Server-->>AxiosInstance: API Response
AxiosInstance-->>Browser: Data Response
Browser-->>User: Display Data
In code, we lay a groundwork firm,
Config set in global term,
A cleaner build with rimraf's aid,
Ensured by scripts so neatly laid.
URLs fetch with global env's might,
Dashboards shine in coded light.
🐇✨🚀
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
env
variable for configuration.Enhancements
env
variable.Configuration
config.js
to manage global configuration settings.