-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add fedx-scripts serve #404
Conversation
@@ -35,7 +35,7 @@ | |||
"@babel/preset-react": "7.22.5", | |||
"@edx/eslint-config": "3.2.0", | |||
"@edx/new-relic-source-map-webpack-plugin": "2.1.0", | |||
"@fullhuman/postcss-purgecss": "^5.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pins some dependencies, since majority of dependencies are pinned.
183f5a0
to
c756d23
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sad to see that the .env*
isn't supported, but maybe the catalyst needed to start transitioning to env.config.js
across other MFEs
👍🏽
@@ -1,4 +1,7 @@ | |||
#!/usr/bin/env node | |||
|
|||
const chalk = require('chalk'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love me some chalk. 😋
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it.
a4bd289
a5786ed
to
c48e0f2
Compare
@davidjoy @brobro10000 I've updated this PR to add support for finding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏽
// Add process env vars. Currently used only for setting the | ||
// server port and the publicPath | ||
dotenv.config({ | ||
path: path.resolve(process.cwd(), '.env.development'), | ||
}); | ||
|
||
// Allow private/local overrides of env vars from .env.development for config settings | ||
// that you'd like to persist locally during development, without the risk of checking | ||
// in temporary modifications to .env.development. | ||
resolvePrivateEnvConfig('.env.private'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳 , but good stepping stone to transition over to env.config.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Third times the charm!
🎉 This PR is included in version 12.9.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
* feat: add serve command to fedx-scripts to run production bundle * docs: add ADR about serve command * feat: support .env.development and .env.private * docs: update ADR to include .env* support * chore: update package-lock.json take 3 * chore: pin express devDep
* feat: add serve command to fedx-scripts to run production bundle * docs: add ADR about serve command * feat: support .env.development and .env.private * docs: update ADR to include .env* support * chore: update package-lock.json take 3 * chore: pin express devDep
* feat: add serve command to fedx-scripts to run production bundle * docs: add ADR about serve command * feat: support .env.development and .env.private * docs: update ADR to include .env* support * chore: update package-lock.json take 3 * chore: pin express devDep
* feat: add serve command to fedx-scripts to run production bundle * docs: add ADR about serve command * feat: support .env.development and .env.private * docs: update ADR to include .env* support * chore: update package-lock.json take 3 * chore: pin express devDep
* feat: add serve command to fedx-scripts to run production bundle * docs: add ADR about serve command * feat: support .env.development and .env.private * docs: update ADR to include .env* support * chore: update package-lock.json take 3 * chore: pin express devDep
Description
These changes propose adding a
serve
command to thefedx-scripts
CLI such that consumers can create an NPM script to serve the production Webpack build from the generateddist
directory when runningnpm run build
. By serving the production build locally, engineers can have more confidence in their resulting production builds before it reaches a staging/production environment.As is, there is no documented way to preview a production build of micro-frontends of the files in the
dist
directory. Simply opening theindex.html
does not work as the React routing breaks, amongst other issues.The proposed
serve
command starts an Express.js serve running on thePORT
setting defined inenv.config.js
. Note: the.env*
files to configuration is now deprecated so theserve
command is intentionally not supporting it.ADR
README documentation