Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Introduce kubevirt/{package.json|yarn.lock} #39

Merged
merged 2 commits into from
Oct 10, 2018
Merged

Introduce kubevirt/{package.json|yarn.lock} #39

merged 2 commits into from
Oct 10, 2018

Conversation

mareklibra
Copy link

Kubevirt npm dependencies are independent from openshift's frontend/package.json and frontend/yarn.lock.

With this patch, we can use yarn.lock feature even for kubevirt-specific
dependencies without risk of mergeconflict with openshift package.json/yarn.lock.

@mareklibra
Copy link
Author

Thanks @vojtechszocs for this idea!

@mareklibra mareklibra mentioned this pull request Oct 9, 2018
1 task
Kubevirt npm dependencies are independent from openshift's
frontend/package.json and frontend/yarn.lock.

With this patch
- we can use yarn.lock feature even for kubevirt-specific dependencies
  without risk of mergeconflict with openshift package.json/yarn.lock
- all manipulations with dependencies stay clear at the first glance, as
  all changes are in the preinstall and postinstall scripts only
- still minimum changes to okd code
  - just the one-liner for package.json scripts
  - _no_ additional packages needed for the frontend/package.json
  - _no_ change to webpack.config.ts
@mareklibra
Copy link
Author

mareklibra commented Oct 10, 2018

Linter is failing to resolve kubevirt/node_modules packages when using webpack's
resolver to handle two node_modules directories.

This can be fixed i.e. via https://www.npmjs.com/package/eslint-import-resolver-alias
but it would require modification of
frontend/{package.json|yarn.lock}, frontend/eslintrc and frontend/webpack.config.ts.

So it would still not address our main concern - eliminate conflicts with OKD sources.

Leads to following changes to this PR:

  • frontend/{package.json|yarn.lock} dependencies and frontend/webpack.config.ts stay untouched
  • new frontend/package.json preinstall manages kubevirt/{package.json|yarn.lock}
  • new frontend/package.json postinstall adds all kubevirt/node_modules to frontend/node_modules

With this approach:

  • all manipulations with dependencies stay clear at the first glance, as all changes are
    in the preinstall and postinstall scripts only
  • still minimum changes to okd code
    • just the one-liner for package.json scripts
    • no additional packages needed for the frontend/package.json
    • no change to webpack.config.ts

.gitignore Outdated
@@ -12,3 +12,6 @@
/frontend/npm-debug.log
/frontend/yarn-error.log
/frontend/gui_test_screenshots

/kubevirt/node_modules

Choose a reason for hiding this comment

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

we could create .gitignore in kubevirt dir

@rawagner
Copy link

LGTM

@rawagner rawagner merged commit 6bdffab into kubevirt:master Oct 10, 2018
@mareklibra mareklibra deleted the kubevirtYarnLock branch October 22, 2018 07:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants