-
Notifications
You must be signed in to change notification settings - Fork 132
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
Hoist markbind package dependencies #1253
Conversation
928e2d2
to
596fdd5
Compare
@@ -1,4 +1,5 @@ | |||
*.min.* | |||
node_modules |
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.
added this as there are still some unhoisted dependencies (moment
) that will be installed in markbind
(lib)
@@ -135,7 +135,6 @@ fs.copySync = (src, dest) => { | |||
*/ | |||
fs.readJsonSync = filePath => JSON.parse(fs.readFileSync(filePath, 'utf8')); | |||
|
|||
|
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.
these occur due to dependency upgrades of eslint
e07e7e6
to
55718c5
Compare
55718c5
to
7075664
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.
@acjh what do you think of this?
The downside is that you'd have to run npm install src/lib/markbind
(provided as npm run install:markbind
) when upgrading the core package's dependencies, something obscure (as opposed to cd src/lib/markbind && npm install
) I noted in the devGuide.
I noticed node's hoisting feature does not hoist devDependencies
as well, which is somewhat of a bummer for deduplicating markbind-cli - frontend/components
dev dependencies later on (in another PR).
"install:components": "cd frontend/components && npm install", | ||
"install:markbind": "npm install src/lib/markbind", |
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.
hence, for example if you only updated the markbind core package's dependencies, simply run install:markbind
.
If multiple packages had their dependencies upgraded, run install:all
instead. (documented under workflow under dev guide)
Thanks for the review @acjh! Pushed the relevant fixups |
@@ -27,6 +27,7 @@ | |||
"markdown-it-emoji": "^1.4.0", | |||
"markdown-it-imsize": "^2.0.1", | |||
"markdown-it-ins": "^2.0.0", | |||
"markdown-it-linkify-images": "^1.1.1", |
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.
Shall we adjust the order of the sections in both package.json in this PR?
Or will it significantly mess up the diff since we're modifying packages too?
Ref: #1248 (comment)
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.
Hmm perhaps the one that would move src/lib/markbind
into packages/markbind
? Would be more suitable relevant I think
The diffs wouldn't be too big if we do it here either though
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 ok with either, if it doesn't significantly mess up the diff in this PR.
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'll give it a try, will stash it if it's too much
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.
The diffs seem ok (Fixup hoist markbind core package dependencies commit); I extracted out the jest
config into a separate file for consistency as well
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.
4da36b4 should be its own commit instead of a fixup.
Otherwise it messes up the diff since it's no longer obvious that we removed several packages.
37b17d3
to
32c0940
Compare
@@ -27,6 +27,7 @@ | |||
"markdown-it-emoji": "^1.4.0", | |||
"markdown-it-imsize": "^2.0.1", | |||
"markdown-it-ins": "^2.0.0", | |||
"markdown-it-linkify-images": "^1.1.1", |
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.
4da36b4 should be its own commit instead of a fixup.
Otherwise it messes up the diff since it's no longer obvious that we removed several packages.
Markbind-cli lists many packages under as its dependencies which are used by markbind but not markbind-cli. Let's use npm install <folder> instead to hoist these packages to markbind-cli's node_modules.
The package.json files of the various packages are not standardised in their ordering and content. Let's add and reorder the appropriate fields to do so.
Fix up use package imports for markbind core library Fix up use package import for markbind
In hoisting markbind dependencies, npm install also caused some of eslint's dependencies' versions in package-lock.json to increase. Let's update the source files affected by npm run lintfix.
Fix up add updating dependencies section to devGuide
32c0940
to
6c734d7
Compare
Done, the new order: |
Thanks again for the review @acjh! 😄 Will be dealing with the
an alternative to (2) being to create another package for |
Sounds good. Alternatives for the record:
Looks like |
I'll go with the latter options, they look more semantic 😁
yup, with the eventual goal being to move |
Let's do it in a later PR. |
What is the purpose of this pull request? (put "X" next to an item, remove the rest)
• [x] Other, please explain: Dependency maintainability
What is the rationale for this request?
markbind-cli
does not use as well.markbind
imports to use themarkbind
package import instead to discourage writing long relative importsWhat changes did you make? (Give an overview)
markbind
markbind
package for one of the tests instead ofmarkdown-it
to remove themarkdown-it
dependency; We have quite a few patches / added plugins for the behaviour inmarkdown-it
which may interfere with the the plugin being tested itself as well.markbind-cli
Proposed commit message: (wrap lines at 72 characters)
Hoist markbind core package dependencies
Markbind-cli lists many packages under as its dependencies which are
used by the core markbind package but not markbind-cli.
Importing files from markbind from markbind-cli also requires writing
long relative imports.
Let's use npm install instead to hoist these packages to
markbind-cli's node_modules.
Let's also use package imports for importing the core markbind library
files.