JHipster 5 availability - jhipster

Is JHipster 5 (with Spring Boot 2) available to play around with? I've noticed that there is mention about work on JHipster 5 in the release notes, but can't see any info on how to install/run a 'preview' version of 5.

You can use directly the master version, no need to wait for a release:
git clone https://github.com/jhipster/generator-jhipster
cd generator-jhipster
yarn install
yarn link
Then, when you want to generate a new project, using master branch:
mkdir newapp
cd newapp
yarn link generator-jhipster
jhipster
Don't forget to update regularly the master branch, as the community is very active and there are new commits every day :-)

If you are using Windows, use npm instead of yarn (yarn seems to be having some issues on Windows).
git clone https://github.com/jhipster/generator-jhipster
cd generator-jhipster
npm install
npm link
Then, when you want to generate a new project, using master branch:
mkdir newapp
cd newapp
npm link generator-jhipster
jhipster

Related

Workflow to checkout single node package for developing a patch / pull request

I want to add a feature to https://github.com/opentripplanner/otp-react-redux/ which is pulled in from the https://github.com/opentripplanner/otp-ui/tree/master/packages/geocoder package (add another geocoder).
Coming from the PHP world and composer, I normally do in such cases
composer install
rm -r vendor/foo/bar
composer install --prefer-source
cd vendor/foo/bar
git remote set-url origin <myforkURL>
git checkout main
Now I can easily edit that package in-place and make a pull request.
My question is: Is there a similar work-flow possible for node packages using yarn?
I already tried
yarn add "#opentripplanner/geocoder#master"
but no .git folder appeared in otp-react-redux/node_modules/#opentripplanner or otp-react-redux/node_modules/#opentripplanner/geocoder
Also it looks like that multiple packages are created from the #opentripplanner repo, which might complicate things.
I could try to simply edit the files in node_modules and then copy them to the a manually checked-out git repository, but when running yarn start everything is also overwritten.
EDIT: As the packages come from a monorepo I tried to delete all the #opentripplanner lines from packages.json and added:
yarn add opentripplanner/otp-ui#main
This now causes the build to fail.
I noticed, that the base package.json requires different package versions from the monorepo, so it will not work to require the complete the full main branch.
EDIT2: I found some clue here:
https://github.com/opentripplanner/otp-ui#development
but that also caused dependencies to not resolve properly.
EDIT3: yarn link actually looked promissing:
cd ..
git clone https://github.com/opentripplanner/otp-ui
cd otp-ui/packages/geocoder
yarn link
Now in the main project code (otp-react-redux)
yarn link "#opentripplanner/geocoder"
This creates a symlink in the node_modules folder to the specific folder in the monorepo I have cloned.
Unfortunately the build does not work:
Module not found: Can't resolve '#opentripplanner/geocoder' in 'otp-react-redux/lib/actions'
I even tried to match the version which is used in the main project by checking out the revision of 1.2.1
yarn link does the job!
cd ..
git clone https://github.com/opentripplanner/otp-ui
cd otp-ui
yarn
cd packages/geocoder
yarn link
Now in the main project code (otp-react-redux)
yarn link "#opentripplanner/geocoder"
This creates a symlink in the node_modules folder to the specific folder in the monorepo I have cloned.
To make the build work, the important part is that we run yarn in the monorepo before!
EDIT: Unfortunately the link process needs to be repeated for each of the #opentripplanner modules which require geocoder:
cd node_modules
$ find -name geocoder -type d
./trip-details/node_modules/#opentripplanner/geocoder
./vehicle-rental-overlay/node_modules/#opentripplanner/geocoder
./transitive-overlay/node_modules/#opentripplanner/geocoder
./endpoints-overlay/node_modules/#opentripplanner/geocoder
./zoom-based-markers/node_modules/#opentripplanner/geocoder
./trip-viewer-overlay/node_modules/#opentripplanner/geocoder
./trip-form/node_modules/#opentripplanner/geocoder
./transit-vehicle-overlay/node_modules/#opentripplanner/geocoder
./itinerary-body/node_modules/#opentripplanner/geocoder
./icons/node_modules/#opentripplanner/geocoder
./route-viewer-overlay/node_modules/#opentripplanner/geocoder
./printable-itinerary/node_modules/#opentripplanner/geocoder
./stop-viewer-overlay/node_modules/#opentripplanner/geocoder
./stops-overlay/node_modules/#opentripplanner/geocoder
./location-field/node_modules/#opentripplanner/geocoder
./park-and-ride-overlay/node_modules/#opentripplanner/geocoder
cd trip-details
yarn link "#opentripplanner/geocoder"
repeat for each of them until they are all links:
otp-react-redux$ find node_modules/ -name geocoder -type l
node_modules/#opentripplanner/trip-details/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/vehicle-rental-overlay/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/transitive-overlay/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/endpoints-overlay/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/zoom-based-markers/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/trip-viewer-overlay/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/trip-form/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/transit-vehicle-overlay/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/itinerary-body/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/icons/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/route-viewer-overlay/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/printable-itinerary/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/stop-viewer-overlay/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/stops-overlay/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/location-field/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/park-and-ride-overlay/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/base-map/node_modules/#opentripplanner/geocoder
node_modules/#opentripplanner/geocoder
yalc seems a good solution for this kind of problem
cd ~/projects/otp-ui/packages/itinerary-body
yarn tsc
yalc publish
cd ~/projects/otp-react-redux
yalc link #opentripplanner/itinerary-body
Now each time you change something in the package:
cd ~/projects/otp-ui/packages/itinerary-body
yarn tsc && yalc publish
cd ~/projects/otp-react-redux
yalc update
yarn start

Npm install doesn't download dependency assets from Git LFS on Ubuntu

Background
I have a project that's split into several smaller projects with one main project that downloads the others as dependencies of the main project.
I'm using Gitlab to host my projects in private repositories, using deploy tokens to allow npm install to download them.
The dependencies are added to the main project using the following format in package.json:
git+https://name:token#gitlab.com/group/project.git
Problem
On Windows when I do a git clone of my main project and run npm install, it does download all the assets using Git LFS, but on Ubuntu the assets aren't getting downloaded. If I check the contents of all the files tracked by Git LFS all I get is the information Git LFS placeholder. I'm using identical commands and software versions on Windows and Ubuntu, but with different results.
I've tried:
Updating to same versions of Node(10.16.0) and Npm(6.10.2) on both Windows and Ubuntu
Updating to the latest versions of Node and Npm (I had to stick to version 10.x for Node because of some dependencies not working with 12.x)
Adding a .lfsconfig file that points to the repository as described in the following issue: https://github.com/npm/npm/issues/11151
Updating Git to the latest version (2.21 on Windows and 2.22 on Ubuntu)
Current workaround
Currently I'm cloning the main project then manually cloning my dependencies into node_modules so that they're all proper git repositories so that I can then use git lfs pull in them. It works, but it's not how it should work, especially not since it's working as it should on Windows.
Question
Why is npm install handling Git LFS differently for dependencies on Ubuntu vs Windows? How do I get npm install to work properly with Git LFS on dependencies, is there a settings somewhere I need to change to e.g. enforce Git LFS downloading?
Step 1. Inside of your repository, run the following command and then commit the resulting .gitconfig and push:
$ git config -f .gitconfig lfs.url https://gitlab.com/group/project.git/info/lfs
Step 2. In the directory in which you want to npm install your project, run for example:
$ npm install -S https://gitlab.com/group/project.git

Plain installation of current version of Wekan on Ubuntu?

Wekan is an open-source Kanban Board which used to be easy to install using nodejs (given that you already set up your MongoDB). I am stumbling upon the actual installation steps of the guide to install Wekan on Ubuntu 16.04:
Download the latest version wekan source code using the wget command and extract it.
wget https://github.com/wekan/wekan/releases/download/v0.63/wekan-0.63.tar.gz
tar xf wekan-0.63.tar.gz
And you will get a new directory named bundle. Go to that directory and install the Wekan dependencies using the npm command as shown below.
cd bundle/programs/server
npm install
Figuring out the last stable version is easy, there are new stable versions nearly every day (as of March 2019), which somehow seem to contradict the common definition.
More importantly, the directory bundle/programs/server does not exist, only server, but it does not contain a main.js which would be necessary to run
node main.js
Other resources considered:
I did of course check the official documentation, but it looks not up-to-date. The page https://github.com/wekan/wekan/wiki/Install-and-Update is redirecting to a rather untidy page which does no longer talk about a standalone installation.
I prefer a minimal installation and not a solution using snap like described at computingforgeeks
There is also an unanswered question about a more specific installation around: Installing Wekan via Sandstorm on cPanel which follows a similar approach.
The latest releases on the Wekan page are actually no ready-to-use node builds.
Wekan is built using Meteor and you will need Meteor to create the build. This is because you could also build it using Meteor against other architectures than os.linux.x86_64.
So here is how to build the latest release as of today on your dev-machine to then deploy it:
Build it yourself
[1.] Install Meteor
curl https://install.meteor.com/ | sh
[2.] Download and extract the latest Wekan
wget https://github.com/wekan/wekan/archive/v2.48.tar.gz
tar xf wekan-2.48.tar.gz
cd wekan-2.48
[3.] Install Wekan Dependencies
./rebuild-wekan.sh
# use option 1
[4.] Install dependency Meteor packages
Now it gets dirty. Somehow the required packages are not included in the release (an issue should be opened at GH). You need to install them yourself:
# create packages dir
mkdir -p packages
cd packages
# clone packages
git clone git#github.com:wekan/wekan-ldap.git
git clone git#github.com:wekan/meteor-accounts-cas.git
git clone git#github.com:wekan/wekan-scrollbar.git
# install repo and extract packages
git clone git#github.com:wekan/meteor-accounts-oidc.git
mv meteor-accounts-oidc/packages/switch_accounts-oidc ./
mv meteor-accounts-oidc/packages/switch_oidc ./
rm -rf meteor-accounts-oidc/
cd ../
[5.] Build against your architecure
meteor build ../build --architecute os.linux.x86_64
# go grab a coffee... yes even with nvme SSD...
Once the build is ready you can go ../build and check out the wekan-2.48.tar.gz which now contains your built bundle including the described folders and files.
Use this bundle to deploy as described in the documentation.
Summary
This describes only how to create the build yourself and I am not giving any guarantee that the build package will run when deployed to your target environment.
I think there is either some issue with the way the releases are attached on GH or they explicitly want to keep it open against which arch you want to build.
In any case I would open an issue with demand for a more clear documentation and a description for reproduction of the errors your mentioned.
Further readings
https://guide.meteor.com/deployment.html#custom-deployment

Which script am I missing when trying to install framework7 custom build?

npm ERR! missing script: build-core:prod
I'm receiving the above error when trying to run the custom build for framework7 - https://framework7.io/docs/custom-build.html
I have gone through each step however I am running into this problem in cmder and I'm unsure why.
The error occurs at step 7 if this info is of any value
Any help would be appreicated.
The error says it cannot find the script build-core:prod.
I could replicate this error (missing build-core:prod), by NOT INSTALLING THE DEPENDENCIES after cloning from github.
So the steps are:
1. Clone the Framework7 Github repository
git clone https://github.com/framework7io/framework7 my-app
this will download the repository in a folder called my-app
2. Install Node.js
that's another topic, hope you have that installed
3. Install Gulp
npm install --global gulp
if you don't have that
4. Install dependencies
cd my-app
npm install
be sure that you are in the root of my-app (the directory you just created for the cloned repository)
this installs all the dependencies that Framework7 Custom Build needs
5. Duplicate my-app/scripts/build-config.js
and rename the duplicate to my-app/scripts/my-config.js
6. Open my-config.js and edit it as you need
7. Go to my-app folder (the root)
and run
npm run build-core:prod -- --config scripts/my-config.js --output path/to/output/folder
path/to/output/folder is a path to the folder where you want the customised files to be, it can be (for example) f7-my-custom-build
8. The custom build is ready,
hopefully you can work with it now. :)

npm/yarn module install with git: cloning repo into node_modules and installing does not work but yarn add does

I'm trying to make a contribution to an opensource project. In particular, react-native.
I have a test app which I've created with create-react-native-app test if I do the following:
cd test
rm -rf node_modules/react-native
yarn add https://github.com/<mygithub>/react-native # (my fork)
There's no issue when I start my app with yarn run ios
However, if I try to clone my fork into node_modules and install it manually with the following:
cd test
rm -rf node_modules/react-native
git clone https://github.com/<mygithub>/react-native
cd react-native
yarn install
I get all sorts of issues. Namely, in my case:
console.error: "React Native version mismatch.
JavaScript version: 0.0.0
Native version: 0.52.0
...
Which to me indicates that something in cloning and manually installing is done differently than adding the package with yarn install and a github url.
I want to be able to work out of a git repo to commit my work and if I use yarn install it is not an initialized git repo. For lack of a better solution, how can I get manually cloning and installing a node_module with yarn to yield the same result as adding it with yarn install?
Edit to add steps attempted for yarn-link:
git clone https://github.com/<mygithub>/react-native
cd react-native
yarn install
yarn link
cd ../test
yarn link "react-native"
This results in the same results as cloning my fork into test/node_modules.
Edit 2: I should add, according the the react-native docs, I should be able to install my fork by cloning it into my project's node_modules folder and installing. The only difference is that I'm using yarn.
https://facebook.github.io/react-native/docs/android-building-from-source.html#building-the-source

Resources