How install npm dependency (rsuite) from github repository - github

I'm using next js 11.
I want to edit an rsuite component, so I understand that I need to clone the dependency https://github.com/rsuite/rsuite.git, and in my branch make the changes and then install it.
The problem is that while I can install the dependency ("rsuite": "MYUSER/rsuite"), not all files are installed.
Test installing then directly from rsuite, ("rsuite": "rsuite/rsuite") also probe, "rsuite": "git https://github.com/rsuite/rsuite.git" and other ways, (npm install https://github.com/rsuite/rsuite.git) and (yarn add https://github.com/rsuite/rsuite.git), but there is no case, not everything is installed, only some files.
Does anyone know how they could do it?
Thanks a lot.
image:

Because npm installation will read the information in package.json.
npm install https://github.com/rsuite/rsuite.git
The package.json files configuration is read when the above statement is executed.
So only the README and CHANGELOG files are available. In order to make it more convenient to import components in a modular manner, rsuite adopts the following methods to import.
import Button rsuite/Button
To implement such component import, we make a custom directory when rsuite is released. All components will be copied to the root directory and associated with the cjs and esm directories through soft links. Detailed release scripts can be viewed in the gulpfile configuration.

Related

PyPI install_requires direct links

I have a Python library (https://github.com/jcrozum/PyStableMotifs) that I want to publish on PyPI. It depends on another library (https://github.com/hklarner/PyBoolNet) that I do not control and that is only available on GitHub, and in particular, it is not available on PyPI. My setup.py looks like this:
from setuptools import
setup(
... <other metadata> ...,
install_requires=[
'PyBoolNet # git+https://github.com/hklarner/PyBoolNet#2.3.0',
... <other packages> ...
]
)
Running pip install git+https://github.com/jcrozum/PyStableMotifs works perfectly, but I can't upload this to PyPI because of the following error from twine:
Invalid value for requires_dist. Error: Can't have direct dependency: 'PyBoolNet # git+https://github.com/hklarner/PyBoolNet#2.3.0'
My understanding is that direct links are forbidden by PyPI for security reasons. Nonetheless, PyBoolNet is a hard requirement for PyStableMotifs. What do I do? Give up on PyPI?
I just want pip install PyStableMotifs to work for my users. Ideally, this command should install the dependencies and I should not have to maintain two versions of setup.py.
Failing that, I have considered creating a "dummy" package on PyPI directing users to install using the command pip install git+https://github.com/jcrozum/PyStableMotifs. Is this a bad idea (or even possible)?
Are there already established best practices for this situation or other common workarounds?
EDIT:
For now, I have a clunky and totally unsatisfying workaround. I'm keeping two versions; a GitHub version that works perfectly, and a PyPI version that has the PyBoolNet requirement removed. If the user tries to import PyStableMotifs without PyBoolNet installed, an error message is shown that has install instructions for PyBoolNet. This is far from ideal in my mind, but it will have to do until I can find a better solution or until PyPI fixes this bug (or removes this feature, depending on who you ask).
My recommendation would be to get rid of the direct URL in install_requires, and tell your users where they can find that dependency PyBoolNet since it is not on PyPI. Don't force them on a specific installation method, but show them an example.
Maybe simply tell your users something like:
This project depends on PyBoolNet, which is not available on PyPI. One place where you can find it is at: https://github.com/hklarner/PyBoolNet.
One way to install PyStableMotifs as well as its dependency PyBoolNet is to run the following command:
python -m pip install 'git+https://github.com/hklarner/PyBoolNet#2.3.0#egg=PyBoolNet' PyStableMotifs
You could additionnally prepare a requirements.txt file and tell your users:
Install with the following command:
python -m pip install --requirement https://raw.githubusercontent.com/jcrozum/PyStableMotifs/master/requirements.txt
The content of requirements.txt could be something like:
git+https://github.com/hklarner/PyBoolNet#2.3.0#egg=PyBoolNet
PyStableMotifs
But in the end, you should really let your users choose how to install that dependency. Your project only need to declare that it depends on that library but not how to install it.

Component-preload.js generation

We are about to close a SAPUI5 application, one of the last steps is to make a Component-Preload.js file to improve performance. I read different guides around the web, all of them need Node.js that I have installed. I'm not expert about that package and I can't figure how to make one of that guides work. I'm developing with NetBeans. As far as I see there is not an official tool (am I right?) to generate that file. Can someone with more experience than me suggest a working, well-explained guide to perform that task?
I don't know if this could help, that's my working tree:
There are several main ways of doing it.
You can use SAP Web IDE to generate it. This assumes that you are using WebIDE to develop your application (which is not true based on your question). The regular version of WebIDE generates this file during the "client build" just before application deployment.
The "multi cloud" version of WebIDE can use a grunt build to do it. You can find more info here if you are interested: https://www.sap.com/developer/tutorials/webide-grunt-basic.html.
Use the new UI5 command line tools (https://npmjs.com/package/#ui5/cli):
Run npm i -g #ui5/cli to install the tools globally.
Open the root of your project with your terminal.
Run ui5 build preload to build the preload.
Use the #sap/grunt-sapui5-bestpractice-build pre-configured grunt tasks. The downside is that they are more-or-less black boxes which do not allow that much customisation. You can find an example setup on SAP's GitHub repository jenkins-pipelines. In a nutshell:
You need to define an .npmrc file which adds the #sap npm registry: #sap:registry=https://npm.sap.com.
Run a npm init command such that you generate a package.json file. This file describes your application and your dependencies (runtime dependencies and dev dependencies; you will only have dev dependencies for now, as you just want to build your app). Make sure to mark the package as private. See the npm docu (at the end of the license chapter).
Then you can install grunt and the build configuration: npm i grunt -D and npm i #sap/grunt-sapui5-bestpractice-build -D.
Lastly you need to define a simple Gruntfile (you can then run the build by just running grunt):
module.exports = function (grunt) {
'use strict';
grunt.loadNpmTasks('#sap/grunt-sapui5-bestpractice-build');
grunt.registerTask('default', [
'lint',
'clean',
'build'
]);
};
You can use the official grunt_openui5 plugin to generate the preload file(s). In order to be able to do this, you need to have node installed:
Create a package.json (e.g. through npm init).
Install grunt by writting in the console: npm install grunt-cli --save-dev.
Install the official openui5 grunt plugin: npm install grunt-openui5 --save-dev.
Now you have all the tools necessary, you just need to tell grunt what it has to do. You should create a Gruntfile.js in the root of your project. In this file you should configure the grunt openui5 task as described in the official github page (I linked it above). You can find a similar file here (it has more build steps like minification and copying the result files in a separate directory).
You can then run the grunt build by simply running grunt <task_name> in the console. If you registered your build task as the grunt default task (like in the sample file: grunt.registerTask('default', [...]);) then you just have to write grunt.
I think you should be able to integrate such a command line script (i.e. to run grunt) inside your IDE as an external tool.
You can use the unofficial gulp-openui5 tool to generate it. I would not recommend this if you are not already using gulp for your builds (as it is not a tool built by SAP). The procedure is the same, but using gulp for building the app instead of grunt (so you need to install node, npm init, install gulp, create the Gulpfile, etc).
Note that for most of the above methods, you need nodejs, which you can download and install from here: https://nodejs.org/en/download/.

Error on Yum update

I'm unfortunately not very experienced in CentOS administration, and was hoping someone might be able to help me understand and get past a small hurdle. I was hoping to run yum update on the system, but ran into some Transaction Check Errors:
file /etc/php.ini from install of php55-common-5.5.11-1.el6.x86_64 conflicts with file from package php-common-5.3.3-40.el6_6.x86_64
file /usr/lib64/php/modules/curl.so from install of php55-common-5.5.11-1.el6.x86_64 conflicts with file from package php-common-5.3.3-40.el6_6.x86_64
file /usr/lib64/php/modules/fileinfo.so from install of php55-common-5.5.11-1.el6.x86_64 conflicts with file from package php-common-5.3.3-40.el6_6.x86_64
file /usr/lib64/php/modules/phar.so from install of php55-common-5.5.11-1.el6.x86_64 conflicts with file from package php-common-5.3.3-40.el6_6.x86_64
file /usr/lib64/php/modules/pdo.so from install of php55-pdo-5.5.11-1.el6.x86_64 conflicts with file from package php-pdo-5.3.3-40.el6_6.x86_64
file /usr/lib64/php/modules/pdo_sqlite.so from install of php55-pdo-5.5.11-1.el6.x86_64 conflicts with file from package php-pdo-5.3.3-40.el6_6.x86_64
file /usr/lib64/php/modules/sqlite3.so from install of php55-pdo-5.5.11-1.el6.x86_64 conflicts with file from package php-pdo-5.3.3-40.el6_6.x86_64
It sort of looks like it's saying that some newer version files are conflicting with older version files. Is there a standard way to fix this? I was mainly just trying to update so that I could install Java later, but wasn't expecting to run into these errors. If it helps, the server is mainly being used for hosting a few websites with apache and mysql. Thanks so much for any help, it's greatly appreciated.
Edit: To add some more clarification, I had previously edited the baseurl variable in the /etc/yum.repos.d/centalt.repo file, which was originally set to
baseurl=centos.alt.ru/repository/centos/6/$basearch
The reason I changed the location was because I was previously getting an error when trying to run yum update, mentioned in this other stackoverflow question https://unix.stackexchange.com/questions/132674/repository-metadata-repomd-xml-for-repository-mratwork-centalt which had an answer recommending replacing the URL with
baseurl=mirror.sysadminguide.net/centalt/repository/centos/6/$basearch
Is there a different url I should be using instead?
You have a non-official repository which provides the php55-* packages which conflict with the official php-* packages.
You currently have the php-* versions installed.
If you want to switch you can try manually installing the matching php55-* package for every php-* package you have installed in one yum command (though that may not work).
If it doesn't, you might need to remove all the php packages you have installed first and then install the php55 versions after that.

Why does Yeoman generator not work when installed through npm?

Code
GitHub version: https://github.com/trevordmiller/generator-code-deck
npm version: https://www.npmjs.org/package/generator-code-deck
Background
I have built a Yeoman generator which is working perfectly locally (using npm link after cloning the repo from GitHub). However, when I npm publish the generator to npm and install it via npm install -g generator-code-deck, running the generator throws no such file or directory and cannot find module errors:
These errors don't make sense to me, because 1. the files and folders are obviously there (as shown by the screenshot doodles) and 2. the generator is working via a symbolic link to the local repo; why should the npm package be any different?
I have been searching online to find an answer but I can't find anything. Does anyone know why these errors are happening when trying to install via npm, but not via a symbolic link? Does anyone know how to fix this so that I can release the official npm version of the Yeoman generator? Any help would be much appreciated!
Chances are you're not publishing all files to npm.
This can be caused by a .npmignore file or by the files key of your package.json.

nuget restore fails on build but works manually

VS 2013 fails to restore a package - the package contents are not materialized - although VS/nuget appears to think that it did restore the package successfully.
If I manually uninstall and re-install the same version of that package, it works as it should.
A bare-bones repro can be downloaded as a zip. This repro has a
single solution with a
single project with a
single file, "packages.config", specifying a
single package, "breeze.edmbuilder -version 1.0.4", containing a single file, edmbuilder.cs
single folder, "App_Start", contains nothing but
the .csproj says it should have "edmbuilder.cs" which is ok because
it WILL have "edmbuilder.cs" when the package is restored.
When I build, VS reports that "edmbuilder.cs" is missing ... and indeed it is missing.
However, the package was downloaded; I know this because the build produces a "packages" folder that contains "Breeze.EdmBuilder.1.0.4" wherein I see that "edmbuilder.cs" is present and in the right place.
When I issue the command install-package breeze.edmbuilder -version 1.0.4, nuget reports
'Breeze.EdmBuilder 1.0.4' already installed. NugetRestoreFail already has a reference to 'Breeze.EdmBuilder 1.0.4'.
There is nothing wrong with this package AFAIK. For when I uninstall-package breeze.edmbuilder and then reinstall with install-package breeze.edmbuilder -version 1.0.4, the install works and the missing edmbuilder.cs appears in the "App_Start" folder where it belongs.
The failure is repeatable in place.
close the solution
delete edmbuilder.cs from "App_Start"
delete the "packages" folder
optionally delete the .suo and bin and obj directories
re-open the solution and re-build
You'll get the same failing behavior ... and the same ability to manually uninstall and reinstall.
FWIW, removing the reference to edmbuilder.cs from the .csproj has no effect.
No matter what I do, I have to manually uninstall and re-install the package.
WTF!
p.s.: I am using VS 2013 Update 2 RC. I doubt that the "RC" matters as this problem came to my attention from a customer. You never know.
p.p.s: This is not about the build failing and I don't care that this solution would never run. What you see here is a stripped down version of a real app that would have worked. The only question is "why no restored file?"
Package Restore is NOT the same as installing a package. What you are seeing is by design. It simply downloads any missing packages in the packages folder. No more. No less.
Package Restore was added so you wouldn't need to commit the packages folder to source control.
It is expected that you would install a package then commit the changes made to your project files as well as any files that may have been added like your edmbuilder.cs, essentially anything inside your project folder. You would exclude the packages folder.
Now when you get the source from source control everything would be present except for the package files. Package Restore would download those and now your working copy is complete.
See NuGet's Restore Package insists on specific package versions
Is this stupid or what?
Thanks to #Kiliman for explaining that my horrible experience is "by design".
So how do you actually get the content you thought was being restored? Do you install each package one at a time. That's insane.
I was going to observe that there is no nuget equivalent of an npm install that would fetch all the packages you need ... when I discovered that there actually IS an almost-equivalent. It's just not obvious and I wonder how many people know it exists.
It's a two step process:
FIRST restore the missing packages ... THEN
Issue the command: Update-Package -Reinstall
This re-installs all packages in every project in your solution.
If you only want to re-install for a specific project, try:
Update-Package -ProjectName 'YourProjectName' -Reinstall
In both procedures, the -Reinstall switch strives to install the exact versions of the packages spelled out in your package.config ... and not newer "updated" packages which may or may not work for your project (but see the documentation for exceptions).
Read about update-package -reinstall in the official nuget documentation entitled, "Reinstalling Packages and its Pitfalls".
Do not miss the cautionary remarks. Clearly this technique is but an approximation of what you'd expect from other package managers.
Good luck, peoples.