-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[No QA] [TS migration] Migrate 'Config' files to TypeScript #37718
[No QA] [TS migration] Migrate 'Config' files to TypeScript #37718
Conversation
@cead22 made updates! |
@@ -30,7 +30,7 @@ title "Bundling Desktop js Bundle Using Webpack" | |||
info " • ELECTRON_ENV: $ELECTRON_ENV" | |||
info " • ENV file: $ENV_FILE" | |||
info "" | |||
npx webpack --config config/webpack/webpack.desktop.js --env envFile=$ENV_FILE | |||
npx webpack --config config/webpack/webpack.desktop.ts --env file=$ENV_FILE |
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.
NAB, but should we consider updating ENV
everywhere here to ENVIRONMENT
?
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.
It's up to you, let me know what you'd like to do. I didn't think of it
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.
I think we should update it
config/webpack/webpack.desktop.ts
Outdated
// eslint-disable-next-line @dword-design/import-alias/prefer-alias, import/no-relative-packages -- alias imports don't work for webpack | ||
import {dependencies as desktopDependencies} from '../../desktop/package.json'; | ||
import type Environment from './types'; | ||
import getCommonConfig from './webpack.common'; |
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.
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.
I'm going to change it, thanks
import CustomVersionFilePlugin from './CustomVersionFilePlugin'; | ||
import type Environment from './types'; | ||
|
||
// require is necessary, there are no types for this package and the declaration file can't be seen by the build process which causes an error. |
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.
💚
config/webpack/webpack.common.ts
Outdated
production: '', | ||
staging: '-stg', | ||
dev: '-dev', | ||
adhoc: '-adhoc', | ||
}; | ||
|
||
function mapEnvToLogoSuffix(envFile) { | ||
function mapEnvToLogoSuffix(envFile: string): string { |
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.
NAB but envFile
=> environmentFile
. Let's do this for all the truncated variable names in these files (like env
below too)
@cead22 made updates! |
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.
2 more small changes and we can envFile => environmentFile
and the one in the review
config/webpack/webpack.dev.ts
Outdated
import type {Configuration as DevServerConfiguration} from 'webpack-dev-server'; | ||
import {merge} from 'webpack-merge'; | ||
import type Environment from './types'; | ||
import getCommonConfig from './webpack.common'; |
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.
import getCommonConfig from './webpack.common'; | |
import getCommonConfiguration from './webpack.common'; |
@cead22 PR updated again! |
.storybook/webpack.config.ts
Outdated
@@ -31,20 +31,19 @@ switch (process.env.ENV) { | |||
} | |||
|
|||
const env = dotenv.config({path: path.resolve(__dirname, `../${envFile}`)}); | |||
const custom = require('../config/webpack/webpack.common').default({ | |||
const custom: CustomWebpackConfig = require('../config/webpack/webpack.common')({ |
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.
const custom: CustomWebpackConfig = require('../config/webpack/webpack.common')({ | |
const custom: CustomWebpackConfig = require('../config/webpack/webpack.common').default({ |
.storybook/webpack.config.ts
Outdated
...custom.resolve.alias, | ||
}; | ||
const webpackConfig = ({config}: {config: Configuration}) => { | ||
if (config.resolve && config.plugins && config.module) { |
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.
Even if any of the config prop is not set we should still set our props.
if (config.resolve && config.plugins && config.module) { | |
if (!config.resolve) { | |
config.resolve = {}; | |
} | |
if (!config.plugins) { | |
config.plugins = []; | |
} | |
if (!config.module) { | |
config.module = {}; | |
} |
@s77rt done! |
@cead22 looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/cead22 in version: 1.4.59-0 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.60-13 🚀
|
Details
Fixed Issues
$ #25331
PROPOSAL: N/A
Tests
--publish always
from the last line of build-desktop.shnpm run build
npm run build-staging
npm run build-adhoc
npm run web
npm run desktop-build
npm run desktop
Make sure the app builds with no errors, check if both desktop and web app are running correctly.
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.