npm set latest dependencies in package-lock.json - github

Sorry for my overall dumbness and weak understanding of how npm works.
I now work on a project on Angular 6, and github says that hoek package has vulnerabilities.
Running npm ls hoek I get this dependency tree:
+-- #angular-devkit/build-angular#0.6.8
| `-- node-sass#4.9.0
| +-- node-gyp#3.7.0
| | `-- request#2.81.0
| | `-- hawk#3.1.3
| | +-- boom#2.10.1
| | | `-- hoek#2.16.3 deduped
| | +-- hoek#2.16.3
| | `-- sntp#1.0.9
| | `-- hoek#2.16.3 deduped
| `-- request#2.79.0
| `-- hawk#3.1.3
| +-- boom#2.10.1
| | `-- hoek#2.16.3 deduped
| +-- hoek#2.16.3
| `-- sntp#1.0.9
| `-- hoek#2.16.3 deduped
+-- karma#2.0.4
| `-- log4js#2.9.0
| `-- loggly#1.1.1
| `-- request#2.75.0
| `-- hawk#3.1.3
| +-- boom#2.10.1
| | `-- hoek#2.16.3 deduped
| +-- hoek#2.16.3
| `-- sntp#1.0.9
| `-- hoek#2.16.3 deduped
No matter what I do, npm install recreates this dependency tree. As far as I understand, these dependencies are picked up automatically, and to resolve the problem all packages in this tree should update their dependencies, starting from the bottom: first, new versions of boom and sntp should start use new version of hoek, then new version of hawk should use new versions of boom and sntp...
But as far as I've seen on github, some packages in chain are not yet updated.
So, my question is: how can I fix this problem in this project, as for now? Can I manually change dependency versions in package-lock.json (humbly hoping that later versions of lower packages will be compatible with old versions of higher ones)?
Will it resolve my problem in a way, that hoek 2.16.3 will disappear from the project?

Related

How do you create namespaced or sub-modules in PowerShell?

I'm familiar with writing custom PowerShell modules using the following folder structure:
Modules
| +-- WebUtils
| | +-- WebUtils.psm1
| +-- BuildUtils
| | +-- BuildUtils.psm1
Where you might import the webutils module by doing something like using module WebUtils.
I have a large ongoing project that reuses a lot of the same functionality. Right now I have a hundred or so loosely related functions in a module. The problem is that I usually only need to use 10 - 20 of them depending on the project. I would like to split up the modules in a way similar to this:
Modules
| +-- Utils
| | +-- Web
| | | +-- Web.psm1
| | +-- Build
| | | +-- Build.psm1
| | +-- Utils.psm1
Where I could call them like using module Utils.Web or something similar.
How do I go about doing this? I haven't been able to find any good examples yet. Is this a good way of organizing things?
Large modules geenrally split out into seperate modules which perform a set of related functions. A good example of this Azure or - as below - VMware PowerCLI
If you Import-Module VMware.PowerCLI it will import all the modules. But you can import an individual module and it will only import those functions/commands and any module dependencies via them being named in the .psd1 e.g if you only want VMware.VimAutomation.Core it pulls in VMware.VimAutomation.Cis.Core too
So no, not subfolders of the one module but additional related modules which can be loaded.

How to create github.io pages for a course using rmarkdown::render_site()

I'm confused about the organization of files for a course built
using rmarkdown::render_site() and to be deployed on github
as my_name.github.io/course_name
Github pages creates the web pages from the docs/ directory, whereas
render_site places them in a _site directory. Will it work if
I just use:
output_dir = docs
in my _site.yml file? Or is there a different way to do this?
My local project directory looks like this.
+-- about.Rmd
+-- examples
+-- exercises
+-- fig
+-- footer.html
+-- images
+-- index.Rmd
+-- lectures
| +-- lecture1.pdf
| +-- lecture1.pptx
| +-- lecture1.Rmd
| +-- lecture2.pdf
| +-- lecture2.pptx
| +-- lecture3.pdf
| \-- lecture3.pptx
++-- R
+-- resources.Rmd
+-- styles.css
+-- _site
+-- _site.yml
Ah, I didn't realized it was as easy as just using
output_dir = docs

How to set a root directory for PyRight?

I have a Python project in VSCode. Its structure
root
+-- docs
+-- some_other_folder
+-- src
+-- app
| +-- main.py
+-- tests
+-- conftest.py
conftest.py has import
from app.main import app
My task is to set src as root folder because in otherwise I got a warning Import 'app.main' could not be resolved
Create pyrightconfig.json at the the root directory of your project
Add the following config:
{
"executionEnvironments": [
{"root": "src"}
]
}
Details taken from: https://github.com/Microsoft/pyright/blob/master/docs/configuration.md

my application stopped working with xulrunner 10.0.4

When I upgraded to centos 6 and xulrunner 10.0.4, my app stopped working. Xulrunner just hangs.
My directory structure:
.
|-- application.ini
|-- chrome
| |-- chrome.manifest
| `-- content
| |-- main.xul
| `-- main.xul.tpl.org
|-- defaults
| `-- preferences
| `-- prefs.js
According to example application from developer.mozilla.org, your application is missing the chrome.manifest as a sibling file of application.ini with the content:
manifest chrome/chrome.manifest
The funny thing is it works on xulrunner 12.0 but not on 10.0. Just add the file and your application should work.

Eclipse: Relocating a git repo from project to workspace

I've been working on an Eclipse plug-in project for a while now, and I've run into a situation where I need to split the project up to seperate the test cases from the plug-in package. I'm using git as version control.
To describe this simply, I'm versioning the old project like this:
workspace/
|
+-- myplugin/
|
+-- .git/ <-- Here be the git repository
|
+-- /* Source code, project stuff, etc. */
…and I'm in the situation where I need to work the plugin tests in a seperate project (so that jUnit won't be needed as a required bundle with the plugin). And I'd like the repository to version everything in the workspace. Like this:
workspace/
|
+-- .git/ <-- The repository should be relocated here instead…
|
+-- myplugin/
| |
| +-- /* Source code, project stuff, etc. */
|
+-- myplugin-test/
|
+-- /* Unit tests and stuff… */
Is there a simple way to do this without losing the history of the old project?
Here's the workflow in pseudocode:
cd workspace/myplugin
mkdir myplugin
git mv * myplugin # you might need to do that for all files/folders manualy
mkdir myplugin-test
# move/add files to myplugin-test
git commit -a -m "Reorganization"
cd workspace
mv myplugin myplugin_old
mv myplugin_old/* .
# you should end up with requested structure