I'm using a grunt plugin called bower-concat. This plugin takes all your bower_component packages and concatenates them into a single file. It does this by looking at each component's bower.json file's "main" attribute. I'd like to modify my font-awesome's bower.json "main" attribute from
{
"name": "font-awesome",
"description": "Font Awesome",
...,
"main": [
"less/font-awesome.less",
"scss/font-awesome.scss"
]
...
}
to this, which allows my grunt-bower-concat plugin to work.
{
"name": "font-awesome",
"description": "Font Awesome",
...,
"main": [
"./css/font-awesome.css",
"./fonts/*"
]
...
}
By following this post here (https://roots.io/using-bootstrap-with-bower-how-to-override-bower-packages/), I thought I'd be able to override this attribute like so in my app's bower.json file to achieve the desired result upon bower install ...
{
"name": "MyApp"
"dependencies": {
"font-awesome": "~4.4.0"
},
"overrides": {
"font-awesome": {
"main": [
"./css/font-awesome.css",
"./fonts/*"
]
}
}
}
Unfortunately, this doesn't appear to override font-awesome's "main" attribute. Can anyone point out what I'm missing?
Related
I actually build a site with timber, below is my composer json :
{
...,
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"require": {
"timber/timber": "1.18",
"hellonico/timber-dump-extension": "^1.0",
"guzzlehttp/guzzle": "^7.0"
},
"require-dev": {
"symfony/var-dumper": "^5.3"
},
"config": {
"allow-plugins": {
"composer/installers": true
}
}
}
my footer template : {{function("wp_footer")}}</body></html>
Oddly, this snippet, doesn't outputs registered scripts but some svg tags that I don't know where they come from (image below)footer output.
here how i register my script :
wp_register_script('myjs', APP_DIR_URI .'/dist/js/myjs.js', ['jQuery'], "1.0.0", true); wp_enqueue_script('prono');
Could you please explain me why have this issue, is this related to the version of timber or something else ?
Thank you
That comes with a new WordPress block themes and specifically theme.json file. You may find more about this file and how to use it here
File not just renders svg-filters but creates inline global styles on every page. If you wish to "disable" it (you cannot disable it but you may override such behavior with desired) you may create theme.json file at the root of your theme with following content
{
"version": 2,
"settings": {
"color": {
"duotone": null,
"palette": null,
"gradients": null
},
"typography": {
"fontSizes": null
}
},
"styles": null,
"variables": null,
"presets": null
}
I've been trying to add a custom CSS file to the final build from Sencha CMD on ExtJS Application. The application has been generated using the CMD.
My CSS file is located in resources/Custom/myfile.css
try to do many different approach that i found but with no success.
My app.json looks like
{
"builds": {
"production": {
"default": true,
"compressor": {
"type": "closure"
}
}
},
"name": "Test.App",
"css": [
{
"path": "resources/Custom/_body.css",
"remote": true
}
],
"requires": [
],
"id": "fb0cc613-c7e3-4e2e-9f9f-aa569fcf2465"
}
But when try to build i got the error:
BUILD FAILED
[ERR] com.sencha.exceptions.ExBuild: Combining x-compile in HTML page with Microloader in app.json is not supported
If i remove the CSS part fo the app.json it does work !!!
I am using ExtJS 4.1.1
Any Help?
I had a problem when trying install client packages using Bower in ASP.NET 5 application. I defined some packages I want to install to my application in bower.json file, like this:
{
"name": "bower",
"license": "Apache-2.0",
"private": true,
"dependencies": {
"jquery": "1.11.2",
"modernizr": "2.8.3",
"bootstrap": "3.3.4",
"jquery.uniform": "2.1.2",
"fluidbox": "1.4.3",
"owl-carousel": "1.3.2",
"photo.swipe": "4.0.8",
"magnific-popup": "1.0.0",
"slippry": "1.2.9",
"fastclick": "1.0.6",
"imagesloaded": "3.1.8",
"jquery-validate": "1.13.1",
"fitvids": "1.1.0",
"jquery-gridrotator": "0.1.0" }
After saving, I saw in the hidden bower_components folder there were some other packages I didn't defined in the bower.json file, like this:
After running grunt task, I saw some strange packages installed to my application.
My simple gruntfile.js
module.exports = function (grunt) {
grunt.initConfig({
bower: {
install: {
options: {
targetDir: "wwwroot/lib",
layout: "byComponent",
cleanTargetDir: true
}
}
}
});
grunt.registerTask("default", ["bower:install"]);
grunt.loadNpmTasks("grunt-bower-task");
};
So, how can I only install packages I want to my ASP.NET 5 application? Thank you so much.
They are dependencies installed by bower by example Masonry use this dependencies
{
"name": "masonry",
"version": "3.3.0",
"description": "Cascading grid layout library",
"main": "masonry.js",
"dependencies": {
"get-size": "~1.2.2",
"outlayer": "~1.4.0",
"fizzy-ui-utils": "~1.0.1"
}
}
I recomend you to use the dest,js_dest, css_dest and font_dest to split the files by type and set the option keepExpandedHierarchy to false something like this
{
dest: "wwwroot/lib",
js_dest: "wwwroot/lib/js",
css_dest: "wwwroot/lib/css",
fonts_dest: "wwwroot/lib/font",
options: {
keepExpandedHierarchy: false
}
}
and use some module like includeSource to add all the files in your cshtml file
includeSource: {
layout: {
files: {
'Views/Shared/_Layout.cshtml': 'Views/Shared/_Layout.cshtml'
}
},
options: {
basePath: "wwwroot/lib/js",
baseUrl: '~/lib/',
}
}
and you must add the markup in your page
<!-- include: "type": "js", "files":"**/*.js", "ordering": "top-down" -->
<!-- /include -->
hope it helps
Has anybody ever used Symfony in conjunction with payone(payone.de)?
I got the SDK and it has the folders js, locale and php.
My problem: I don't really know how to include/use them in my project(inexperienced in Symfony) because I don't know where I should place it and how to include it. I read about the auto loader but since the SDK doesn't follow the standards needed(concerning folder structure) I guess it's not the way to go.
You can autoload all classes with the psr-0 too if the classes are following the PEAR-style non-namespaced convention.
To manage the vendor download via composer, you can define a package in your composer.json directly.
{
"repositories": [
{
"type": "package",
"package": {
"name": "payone/php-sdk",
"version": "1.0.0",
"dist": {
"url": "http://github.com/PAYONE/PHP-SDK/archive/master.zip",
"type": "zip"
},
"autoload": {
"psr-0": { "Payone_": "php/" }
}
}
}
],
"require": {
"payone/php-sdk": "1.0.*"
}
}
Note: This repository type has a few limitations and should be avoided whenever possible:
Composer will not update the package unless you change the version field.
I am creating a CpanelBundle which will integrate the Cpanel xmlapi into Symfony.
I will use the class provided by CpanelInc here: https://github.com/CpanelInc/xmlapi-php.
I want to make this bundle usable across projects and also open source.
The Symfony documentation says you should not put third party libraries into your bundles. The Cpanel class also don't have a namespace and its not on composer.
I could and should put the Cpanel class in vendor folder but how can I add it to autoload and to my bundle composer.json so when I release my bundle the user will also get it?
Hello you can load this file using composer. Please see composer autoload documentation
Your composer.json can looks like:
{
"name": "my/bundle",
"autoload": {
"psr-0": {"": "src"}
},
"require": {
"php": ">=5.3.2",
"symfony/framework-bundle": ">=2.1,<2.3-dev",
"CpanelInc/xmlapi-php": "*"
},
"repositories": [
{
"type": "package",
"package": {
"name": "CpanelInc/xmlapi-php",
"version": "master-dev",
"dist": {
"url": "http://github.com/CpanelInc/xmlapi-php/zipball/master",
"type": "zip"
},
"source": {
"url": "git://github.com/CpanelInc/xmlapi-php.git",
"type": "git",
"reference": "master"
},
"autoload": {
"files" : ['xmlapi.php']
}
}
}
]
}
Will be even better when you just create composer.json and add it for CpanelInc/xmlapi-php and do PR :)