Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add a meaningful error warning when KDS path is not provided when running yarn run devserver-with-kds #11657

Merged
merged 2 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"app-devserver": "concurrently --passthrough-arguments --kill-others \"yarn:watch --watchonly {1}\" yarn:app-python-devserver yarn:hashi-dev --",
"devserver": "concurrently --passthrough-arguments --kill-others \"yarn:watch --watchonly {1}\" yarn:python-devserver yarn:hashi-dev --",
"devserver-hot": "concurrently --passthrough-arguments --kill-others \"yarn:watch-hot --watchonly {1}\" yarn:python-devserver yarn:hashi-dev --",
"devserver-with-kds": "concurrently --passthrough-arguments --kill-others \"yarn:watch --watchonly --kds-path={1}\" yarn:python-devserver yarn:hashi-dev --",
"devserver-with-kds": "concurrently --passthrough-arguments --kill-others \"yarn:watch --watchonly={2} --require-kds-path --kds-path={1}\" yarn:python-devserver yarn:hashi-dev --",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking as I think this is probably out of scope of the issue you're trying to resolve here, so I'll make a follow-up issue after merging this.

But - I think that we'll need to do some tweaking because when I use the --watchonly flag here with:

yarn devserver-with-kds path/to/kds user_auth then the build system doesn't recognize whenever I make a change in KDS.

But when I don't pass in any plugins for the --watchonly then the front-end rebuilds reactively to changes I make within KDS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that. And yes, it'd be better to have a follow-up for this issue so that it can be focussed on separately. I too am not sure how to move forward with it. I believe this is one important feature to have and requires separate attention.

"bundle-stats": "kolibri-tools build stats --file ./build_tools/build_plugins.txt --transpile",
"clean": "kolibri-tools build clean --file ./build_tools/build_plugins.txt",
"preinstall": "node ./packages/kolibri-tools/lib/npm_deprecation_warning.js",
Expand Down
14 changes: 14 additions & 0 deletions packages/kolibri-tools/lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ function runWebpackBuild(mode, bundleData, devServer, options, cb = null) {
cache: options.cache,
transpile: options.transpile,
devServer,
requireKdsPath: options.requireKdsPath,
kdsPath: options.kdsPath,
};

Expand Down Expand Up @@ -226,8 +227,21 @@ program
list,
[]
)
.option(
'--require-kds-path',
'Flag to check if yarn command is run using devserver-with-kds',
false
)
.option('--kds-path <kdsPath>', 'Full path to local kds directory', String, '')
.action(function(mode, options) {
if (options.requireKdsPath) {
if (!options.kdsPath) {
cliLogging.error(
'The --require-kds-path flag was specified, but no --kds-path value was provided. Please include the path to the local KDS directory.'
);
process.exit(1);
}
}
if (typeof mode !== 'string') {
cliLogging.error('Build mode must be specified');
process.exit(1);
Expand Down
Loading