I'm spending way too much time finding my error. I bet I'm missing a semicolon.
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
cssbeautifier : {
files : ["css/style.css"],
options : {
indent: ' ',
openbrace: 'end-of-line',
autosemicolon: false
}
}
grunt.loadNpmTasks('grunt-cssbeautifier');
grunt.registerTask('default',["cssbeautifier"]);
})
}
package.json:
{
"name": "zavrsni-php",
"version": "1.0.0",
"description": "Job interview simulator\r Demo: http://interviewsimulator.eu.pn/",
"main": "index.php",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/MarkoIvanetic/zavrsni-PHP.git"
},
"author": "Grad",
"license": "MIT",
"bugs": {
"url": "https://github.com/MarkoIvanetic/zavrsni-PHP/issues"
},
"homepage": "https://github.com/MarkoIvanetic/zavrsni-PHP#readme",
"devDependencies": {
"grunt": "^0.4.5",
"grunt-cssbeautifier": "^0.1.2",
"grunt-jsbeautifier": "^0.2.10"
}
}
Fount it, braces on the wrong place
Related
I'm creating a solution with 2 projects. A class library and a console application to have the XUnit project. Both applications target .net 451 and .net core frameworks.
For the library I have
"netstandard1.3"
"net451"
For the xunit project I have
"netcoreapp1.0"
"net451"
I'm having problems when debugging the unit tests inside Visual Studio 2015, using the test explorer, when I try to debug, the symbols are not loaded.
Is there any setup for the projects that I'm missing? Any limitation in Visual Studio 2015 ?
I had this project and tests working fine only targeting .net core version. The problem started after introducing the net451 target.
Everything builds right and the tests also are discovered correctly.
Thanks in advance!
project.json from library project
"version": "1.0.4",
"files": {
"includeFiles": [
"Content/ReleaseNotes.txt"
],
"include": [
"../../README"
]
},
"releaseNotes": "Review ReleaseNotes.txt for details.",
"requireLicenseAcceptance": true
},
"buildOptions": {
},
"frameworks": {
"net451": {
"frameworkAssemblies": {
"System.ComponentModel.DataAnnotations": "",
"System.Data": "",
"System.Drawing": "",
"System.Drawing.Design": "",
"System.Transactions": "",
"System.Configuration": "",
"System.Configuration.Install": "",
"System.Management": "",
"System.Xml": "",
"System.Runtime": {
"type": "build"
}
},
"dependencies": {
"Google.Protobuf": "3.0.0-beta4"
}
},
"netstandard1.3": {
"buildOptions": {
"define": [ "NETCORE10" ],
"warningsAsErrors": false,
"embed": [
"keywords.txt",
"Resources.resx"
],
"resource": [ "**/*.resx" ],
"compile": {
"exclude": [
"Framework/Net451/**/*.*",
],
"includeFiles": [
"Resources.Designer.cs"
],
"excludeFiles": [
"Properties/VersionInfo.cs",
]
}
},
"dependencies": {
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"NETStandard.Library": "1.6.0",
"System.Collections.NonGeneric": "4.0.1",
"System.ComponentModel": "4.0.1",
"System.ComponentModel.Annotations": "4.1.0",
"System.ComponentModel.Primitives": "4.1.0",
"System.ComponentModel.TypeConverter": "4.1.0",
"System.Data.Common": "4.1.0",
"System.Data.SqlClient": "4.1.0",
"System.Diagnostics.Process": "4.1.0",
"System.Diagnostics.TextWriterTraceListener": "4.0.0",
"System.IO.Compression": "4.1.0",
"System.IO.FileSystem.Primitives": "4.0.1",
"System.IO.MemoryMappedFiles": "4.0.0",
"System.IO.Pipes": "4.0.0",
"System.Linq.Expressions": "4.1.0",
"System.Net.NameResolution": "4.0.0",
"System.Net.Security": "4.0.0",
"System.Net.Sockets": "4.1.0",
"System.Reflection": "4.1.0",
"System.Reflection.TypeExtensions": "4.1.0",
"System.Security.Principal.Windows": "4.0.0",
"System.Text.Encoding.CodePages": "4.0.1",
"System.Threading.Timer": "4.0.1",
"System.Threading.ThreadPool": "4.0.10",
"Google.Protobuf": "3.0.0-beta4"
}
}
}
}
project.json from xunit project
{
"version": "7.0.4",
"description": "MyLibrary",
"packOptions": {
"requireLicenseAcceptance": true
},
"buildOptions": {
},
"testRunner": "xunit",
"dependencies": {
"dotnet-test-xunit": "2.2.0-*",
"xunit": "2.2.0-*",
"MyLibrary": {
"target": "project"
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dnxcore50"
],
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
}
},
"buildOptions": {
"define": [ "NETCORE10" ],
"copyToOutput": [ "appsettings.json" ],
"compile": {
"include": [ "../*.cs" ],
"exclude": [
"**/._*",
"Framework/Net451/**/*.*"
],
"excludeFiles": [
"TestDataTable.cs"
]
},
"warningsAsErrors": false,
"optimize": true
}
},
"net451": {
"frameworkAssemblies": {
"System.Collections": {
"type": "build"
},
"System.Diagnostics.Debug": {
"type": "build"
},
"System.Linq": {
"type": "build"
},
"System.Reflection": {
"type": "build"
},
"System.Reflection.Extensions": {
"type": "build"
},
"System.Runtime": {
"type": "build"
},
"System.Runtime.Extensions": {
"type": "build"
},
"System.Threading.Tasks": {
"type": "build"
}
},
"buildOptions": {
"compile": {
"exclude": [
"Framework/NetCore10/*.*"
],
"excludeFiles": [
"Framework/Net451/PerfMonTests.cs",
"Framework/Net451/ReplicationTests.cs"
]
}
}
}
}
}
Well, hope this save some time to someone else. I'm sort of new to the xproj projects and also still learning about all the options inside the new project.json file.Which I like so far. That said here's the answer to this particular issue.
I had an optimize = true outside the frameworks section which applies to all the configurations in the project. So the IDE was never generating the debug-able code. A good practice for this is having a configurations section in your project.json file where you define how you want the build to behave for each case.
And here is the configurations section that I added.
"configurations": {
"Debug": {
"buildOptions": {
"define": [ "DEBUG" ],
"optimize": false,
"preserveCompilationContext": true
}
},
"Release": {
"buildOptions": {
"define": [ "RELEASE" ],
"optimize": true,
"preserveCompilationContext": true,
"xmlDoc": true
}
}
And that's it.
I have a custom Wordpress theme hosted on Bitbucket that I'd like installed into the /themes directory in Wordpress when I run composer install.
I've played around with different repo 'types' e.g. vcs, package etc and I get errors for everything I've tried so far.
Here's a sample of my (not working) composer.json file:
{
"authors": [
{
"name": "Joe Bloggs",
"homepage": "http://www.example.com/"
}
],
"keywords": [
"wordpress", "composer", "wp"
],
"config": {
"secure-http": false
},
"repositories": [
{
"type": "composer",
"url": "http://wpackagist.org"
},
{
"type": "package",
"package": {
"name": "wordpress/wordpress",
"version": "4.5.3",
"type": "webroot",
"dist": {
"type": "zip",
"url": "https://wordpress.org/wordpress-4.5.3.zip"
},
"require" : {
"fancyguy/webroot-installer": "1.1.0"
}
}
},
{
"type": "vcs",
"url": "https://bitbucket.org/gurtfrobe/plunderscores.git"
}
],
"require": {
"php": ">=5.3.2",
"wordpress/wordpress": "4.5.3",
"fancyguy/webroot-installer": "1.1.0",
"composer/installers": "v1.0.12",
"gurtfrobe/plunderscores": "1.0.1"
},
"extra": {
"installer-paths": {
"wp/wp-content/plugins/{$name}/": ["type:wordpress-plugin"],
"wp/wp-content/mu-plugins/{$name}/": ["type:wordpress-muplugin"],
"wp/wp-content/themes/{$name}/": ["type:wordpress-theme"]
},
"webroot-dir": "wp",
"webroot-package": "wordpress/wordpress"
}
}
I've also tried the following with no luck:
{
"type": "package",
"package": {
"name": "gurtfrobe/plunderscores.git",
"version": "1.0.1",
"type": "wordpress-theme",
"source": {
"url": "https://bitbucket.org/gurtfrobe/plunderscores.git",
"type": "vcs",
"reference": "master"
}
}
},
Is there a way of achieving this without submitting my theme to wpackagist?
I solved it with this article.
Remember to push the latest version tags after you've updated your composer.json file. Otherwise Composer will still try and download a previous version.
learning grunt.js and I keep getting this error in Terminal.
Running "sass:dist" (sass) task
Warning: Path must be a string. Received undefined Use --force to continue.
Aborted due to warnings.
Here's the code. Any help would be great
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
/** Sass task **/
sass: {
dev: {
options: {
style: 'expanded',
sourcemap: 'none',
},
files: {
'compiled/style.css': 'sass/style.scss'
}
},
dist: {
options: {
style: 'compressed',
sourcemap: 'none',
},
files: {
'compiled/style-min.css': 'sass/style-min.scss'
}
}
},
/** Watch task **/
watch: {
css: {
files: '**/*.scss',
tasks: ['sass']
}
}
});
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['watch']);
}
and here my json
{
"name": "millervolpe2016",
"version": "1.0.0",
"description": "Our company's new theme",
"main": "index.php",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/jspraguemillervolpe/miller-volpe.git"
},
"keywords": [
"miller",
"volpe"
],
"author": "Jason Sprague",
"license": "ISC",
"bugs": {
"url": "https://github.com/jspraguemillervolpe/miller-volpe/issues"
},
"homepage": "https://github.com/jspraguemillervolpe/miller-volpe#readme",
"devDependencies": {
"grunt": "^1.0.1",
"grunt-autoprefixer": "^3.0.4",
"grunt-contrib-sass": "^1.0.0",
"grunt-contrib-watch": "^1.0.0"
},
"dependencies": {}
}
your sass dist: and files: should be like that:
files: {
'compiled/style-min.css': 'sass/style.scss'
}
The file you are pointing is sass/style.scss so you should use the same for dist and dev.
this file: 'sass/style-min.scss' does not exist in your project and in your dev sass you are using: 'sass/style.scss' , I did a test here and now sass:dist works fine if you change this.
let me know if that fix your problem.
thanks.
I trying to implement angular-gird using Browserify.
I used a configuration like this:
{
"name": "Project",
"description": "Description",
"version": "0.0.1",
"repository": "...",
"license": "License",
"private": true,
"dependencies": {
"angular": "1.3.15",
"angular-ui-router": "0.2.14",
"angular-grid": "1.2.0"
},
"devDependencies": {
"browserify": "9.0.8",
"browserify-shim": "3.8.5",
},
"browserify": {
"transform": [
"browserify-shim"
]
},
"browser": {
"angular": "./client/app/common/angular-lib.js",
},
"browserify-shim": {
"angular-ui-router": {
"depends": "angular"
},
"angular-grid": {
"depends": "angular"
}
}
}
But then I get the error:
"Uncaught TypeError: require.config is not a function" (main.js).
Can someone help me? What is the best way to implement angularGrid with Browserify?
I'm trying to install some external JS libraries located in Github in a SF2 project with composer.json.
composer.json:
{
"name": "myproject",
"license": "my project",
"type": "project",
"description": "my project",
"autoload": {
"psr-0": { "": "src/" }
},
"repositories": {
"medium-editor" : {
"type": "package",
"package": {
"name": "daviferreira/medium-editor",
"type": "component",
"version": "master",
"source": {
"url": "git://github.com/daviferreira/medium-editor.git",
"type": "git",
"reference": "master"
},
"extra": {
"component": {
"scripts": [
"dist/js/medium-editor.min.js"
],
"styles": [
"dist/css/medium-editor.min.css",
"dist/css/themes/*.min.css"
]
}
},
"require": {
"robloach/component-installer": "*"
}
}
},
"classList" : {
"type": "package",
"package": {
"name": "eligrey/classList.js",
"type": "component",
"version": "master",
"source": {
"url": "git://github.com/eligrey/classList.js.git",
"type": "git",
"reference": "master"
},
"extra": {
"component": {
"scripts": [
"classList.min.js"
]
}
},
"require": {
"robloach/component-installer": "*"
}
}
}
},
"require": {
...
"daviferreira/medium-editor" : "dev-master",
"eligrey/classList.js" : "dev-master"
},
"require-dev": {
"phpunit/phpunit": "3.7.*"
},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin",
"component-dir": "web/components"
},
"minimum-stability": "stable",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "symlink",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.3-dev"
}
}
}
The libraries are downloaded but...
I'm expecting that composer will create, with the "robloach/component-installer" dependency, a copy of the files specified in "extra" of the "component" type package to the "web/component" directory, but it doesn't.
What's wrong with my config? Thanks!
After reading more carefully the robloach plugin documentation, I've tried again and finally found a solution. The problem was that I probably had made a lot of "composer update" with different configs and was obliged to remove / reinstall the packages to make it work! So the original config post in the question is the good one...
I put it again to be sure!
"medium-editor" : {
"type": "package",
"package": {
"require": {
"robloach/component-installer": "*"
},
"name": "daviferreira/medium-editor",
"type": "component",
"version": "master",
"source": {
"url": "git://github.com/daviferreira/medium-editor.git",
"type": "git",
"reference": "master"
},
"extra": {
"component": {
"scripts": [
"dist/js/medium-editor.min.js"
],
"styles": [
"dist/css/medium-editor.min.css",
"dist/css/themes/*.min.css"
]
}
}
}
},
And for sure, don't forget to add the Robloach component in the "require" libraries:
"robloach/component-installer": "dev-master",
I would suggest to use bower for fetching frontend libraries. Composer was created for managing php libs dependencies. It is importand to separate this layers because it's the easiest solution to implement.
Try PHP Composer Asset Manager package with composer if the problem persist i think you should execute the command manualy:
app/console assets:install .