How run Polymer code example? - polymer

I have downloaded this example : PolymerElements/app-layout-templates
..and I can't make it work (whereas I was able to access this one : PolymerElements/polymer-starter-kit)
I ran the following lines in the terminal :
bower init
bower -save polymer
bower bower install –save Polymer/polymer-elements Polymer/polymer-ui-elements
bower update
...and then accessed the folder via a python server.
Do you have some tips to make it work ?

If you want to try out PolymerElements/app-layout-templates then that's what you need to install on bower. Bower will download all the required dependencies for app-layout-templates to work.
bower install --save PolymerElements/app-layout-templates
After this you can start python server on folders app-layout-template, app-layout-template/nav-view etc to see how it works.
Also the repositories Polymer/polymer-elements, Polymer/polymer-ui-elements are invalid. The polymer elements are available in github repository https://github.com/PolymerElements. So to download polymer elements try something like below
bower install --save PolymerElements/iron-elements
bower install --save PolymerElements/paper-elements
bower install --save PolymerElements/neon-elements
bower install --save PolymerElements/platinum-elements

Related

Does Webpack install -g, automatically install to nodeJS's package.json? Or is this only for local installs?

Does Webpack install -g, automatically install to nodeJS's package.json? Or is this only for local installs?
So I'm tired of trying to find workarounds for require() is not defined. Meaning I would need a module loader for my project to include modules client side. Well, I've downloaded the famous 'webpack' module loader, globally
npm install -g webpack
and I noticed it didn't install to "devDependencies" in my package.json file. But I also install webpack-dev-server, but locally,
npm install webpack-dev-server --save-dev
and it was saved into my package.json. Was this saved because I used --save-dev or because I installed locally?
I'm getting an error stating my webpack module I downloaded doesn't have a configuration file, so I'm assuming I install webpack wrong, and maybe it shouldn't have been installed globally. Please help with the understanding of globally and locally, as well as why this -g webpack install didnt get saved to the package.json?
The command npm install --gloabl will install a package in global scope and make it's bin command available to you globally. This has nothing to do with the folder or project your are in right now. That means a global install will not leave anything in any package.json files.
Learn more about npm install: https://docs.npmjs.com/cli/install
npm install -g webpack will save your files in your OS file system.
npm install webpack-dev-server --save-dev will save your package in your project directory inside a folder called node_modules.
The later one will make an entry in package.json file so that next time you can install all dependdencies with just npm install command. This command installs all your packages listed in package.json.
Missing Config file: Its looking for a file called webpack.config.js. More info can be found here: https://webpack.js.org/configuration/

Update bower package configured by git url branch

I have a package in my bower.json file configured like this:
"package": "git#bitbucket.org:company/project.git#stage",
I own that package and update the stage's branch very often.
To update that bower component in the project which uses that library I have to reinstall the bower component removing the bower_components/package folder and reinstalling with bower install.
Is there any other way for bower to detect modifications in the stage's branch?
Just running the install again (without the --save option) should work.
bower install https://bitbucket.org/company/project.git#stage
If not, first try to uninstall the package with:
bower uninstall https://bitbucket.org/company/project.git#stage

Is bower_components special or unique in some way that it isn't served up on a website?

I installed Polymer using the following commands:
bower init
bower install --save Polymer/polymer#^1.1.0
bower install --save PolymerElements/paper-elements
It created a subfolder called bower_components. But none of the files were found until I copied them to a different subfolder, and then everything started working.
Why is that?
Perhaps you want to install your bower components in the "different subfolder" by default. This can be done using the following in .bowerrc:
{
"directory": "some/directory"
}
Hope that helps.
bower_components is created when you invoke bower install. All deps in bower.json will be downloaded there.

Where is Polymer paper-button.html?

I did the following:
bower init
bower install --save Polymer/polymer#^1.1.0
But I don't see paper-button.html anywhere.
Paper elements are not included in the Polymer package. You can either install them individually or all together. The following installs the paper button.
bower install --save PolymerElements/paper-button
And this all paper elements
bower install --save PolymerElements/paper-elements

error when installing polymer designer on local machine

I have cloned the git for polymer designer on my mac. Following the getting started instructions for Polymer designer works fine until I run bower install
-bash: bower: command not found
Also index.html cannot be loaded by the local httpserver.
I see this is a standard error but several solutions on stack. I need to setup this tool locally to add a custom library.
You nee to install bower: http://bower.io/#install-bower
npm install -g bower
Try this: bower install --save Polymer/polymer