How to install play! framework modules? - module

I'm trying to install this pagination module for my Play! application, but can't get it to work. I've extracted the zip file inside /play/modules/paginate-head/ and I an example here on SO, to change my dependencies.yml file into:
# Application dependencies
require:
- play
- pagination -> paginate-head
repositories:
- My modules:
type: local
artifact: ${application.path}/../[module]
contains:
- paginate-head
But I still don't think the module is being loaded. I'm assuming it's documentation should appear on http://localhost:9000/#documentation/home or are there other ways to see if a module was loaded? It's not telling me anything in the console neither.
Any ideas how to get this installed?

You don't need to extract a zip file, just running the command
play install paginate-head
should work fine. But unzipping will also work. You also don't need that "repositories" section in your dependencies.yml file. Play! knows where to find modules.
The real issue is that your require should look like this:
require:
- play
- play -> paginate head
Notice play to the left of the '->' which signifies that it's a module. Also no dash between 'paginate' and 'head'. That's because 'paginate' is the module name and 'head' is the version and these should be separated by a space.
Also, for modules that are hosted in the main Play! modules repo, you don't even have to install them. You can just add the require above and start Play! and it will install it automatically. Though it will install under the applications modules directory, not the play modules directory.
Hope that helps!

Related

How to use Font Awesome after it being installed with Yarn

I am using VS 2019 for Core 3.1 development and I installed Font Awesome whith Yarn:
yarn add #fortawesome/fontawesome-free
However, whenI try to reference it in my HEAD section like this:
<script defer src="~/lib/#fortawesome/fontawesome-free/js/all.js"></script>
I get the following error:
the 'fortawesome' doesnt exist in actual context
Package managers like yarn, npm, etc. just add the packages to your project. They generally aren't ready to deploy directly at that point, but rather require a build pipeline to create the actual JS/CSS resources. The #fortawesome/fontawesome repo is an exception in that 1) it's not actually a package and 2) the files are already "built". Even then, though, they still won't be in the right location.
I'm not overly familiar with yarn, but npm, for example, puts everything in a node_modules directory. That directory is not served by default, and should not be served, because it contains "raw" stuff. You'd need a separate build pipeline (using npm scripts, webpack, gulp, etc.) to build/copy assets into a directory that is served (i.e. wwwroot). That is likely the piece you are missing.
For this, since there's no build actually required, you just need to have the assets copied to something like wwwroot/lib and then you'll be able to reference it via the script tag on the page. That can be done with any tool like npm, webpack, gulp, grunt, etc. so you'll just have to research and pick the one that fits your needs best.

No detect the external library (Phpoffice) in yii2

Two computers are working on the SAME repository but first computer detect the library and work well but second computer not detect it and show "Error 'PhpOffice\Phpspreadsheet\Reader\Xlsx' not found".
In vendor, the library also exist.
composer.json and composer.lock also the same on both computer.
One thing is that by git ignore, I use yii's composer mechanism at 1st computer but at sec computer(err computer), I add library manually.
If you want to use a composer package, you absolutely need to install it using composer. This ensures that the autoloader is generated properly and your class can be found through PHP.
Copying library files into vendor directory is not enough to install it. During installation Composer creates autoload script with information how to find all classes installed by Composer. If you just copy library files, Composer will not even know that it exist and will not able load any class from it.
If you cannot use Composer on server/computer A, you should install all dependencies on different computer (B) and copy the entire vendor directory into server/computer A. Autoload definitions are in vendor so it should work if you copy the whole dorectory.

which angular2 js file should be added in on the client side?

I am a semi noob in web development.
I just started playing around with angular2 today. And i ran into a problem..
If I were to install angular2 with npm to my local computer, which file is the js file that should be linked to the html page that show up on the client?
In their guide, i see a file called /node_modules/angular2/bundles/angular2.sfx.dev.js. But i don't even see this file at all.
Is there some script that i should run to build that file? Or is the file renamed? I am really confused.
I tried some file /angular2/bundles/angular2.js, but it doesn't even export ng variable to window!
I see that in https://code.angularjs.org/2.0.0-alpha.44/angular2.sfx.dev.js, eventually ng gets exported. But what changed in alpha 53? (the version i get for doing npm install angular2)
In my projects, I a using
"node_modules/angular2/bundles/angular2.dev.js"
You might additionally need to install/add systemjs, just in case you are using the systemjs library.

Trying to add another service to the meteor accounts package

I've found this on github that shows how to add github login to the accounts. https://github.com/Jabbslad/accounts-github
Instead of installing the package with "mrt add accounts-github", I'm downloading the sources, and trying to make them work with a simple app. The goal of this is to make a few changes to the code to understand how it works and finally make my own extension to accounts.
But I get errors "Cannot read property 'github' of undefined at app/accounts-github/github_common.js:1:36".
Thx for your help.
Because you added the package yourself you need to ensure the dependencies are also installed. You can find the dependencies in package.js
If you want to make the package from scratch ensure you also use a package in your meteor app. This means that you put your stuff in a directory called accounts-github in a directory called packages in the root directory of your meteor app.
You can also add these dependencies in yourself if you don't want to use a package:
meteor add accounts-base
meteor add accounts-oauth2-helper
meteor add http
Some dependencies should be in with meteor (i.e templating)
So the problem was the git for accounts-github was not updated with the latest evolutions from meteor. So I replaced "Meteor.accounts" with "Accounts" in all files and now it works.

rbenv with hook

I'm a totally new to ruby and rbenv, but I'm trying to get this 'bwoken' app working with rbenv.
This is bwoken, it's for iOS UIAutomation testing:
https://github.com/bendyworks/bwoken
My question is how do I add hooks for rbenv?
It says:
Ensure your after_cd_bundler rvm hook is enabled:
$ chmod u+x ~/.rvm/hooks/after_cd_bundler
Then, add the following line to your Rakefile:
Ok, so I see comments in the version history here
https://github.com/sstephenson/rbenv
saying this:
Added /usr/lib/rbenv/hooks to the plugin hook search path.
Added /usr/local/etc/rbenv.d to the list of directories searched for rbenv hooks.
The problem is what is the original default place for adding the hook? They don't mention it anywhere. Where is the correct place to put it?
For rbenv you'd have to use a dot (.) file like .rbenv_version. The plugin talks configuration in a rvm context. Both are different ways of having multiple ruby version on the same system.