My angular schema form misplaces the inline glyphicons, they are shown on the upper right corner of the page instead:
pic
This app was built with yeoman, using generator-angular.
html:
<div class="login-container">
<form name="myForm"
sf-schema="schema"
sf-form="form"
sf-model="model"
ng-submit="onSubmit(myForm)"></form>
</div>
ts:
angular.module('playgroundApp')
.controller('FormCtrl', ['$scope', function($scope) {
$scope.schema = {
"type": "object",
"title": "Types",
"properties": {
"string": {
"type": "string",
"minLength": 3
},
"integer": {
"type": "integer"
},
"number": {
"type": "number"
},
"boolean": {
"type": "boolean"
}
},
"required": [
"number"
]
};
$scope.form = [
"*",
{
"type": "submit",
"title": "OK"
}
];
$scope.model = {};
$scope.onSubmit = function(form) {
// First we broadcast an event so all fields validate themselves
$scope.$broadcast('schemaFormValidate');
// Then we check if the form is valid
if (form.$valid) {
// ... do whatever you need to do with your data.
}
}
}]);
I tried to search for conflicts between directives, unfortunately I couldn't reproduce the behaviour in a plunkr.
bower.json:
{
"name": "playground",
"version": "0.0.0",
"dependencies": {
"angular": "^1.5.3",
"bootstrap": "^3.2.0",
"angular-animate": "^1.3.0",
"angular-cookies": "^1.3.0",
"angular-resource": "^1.3.0",
"angular-route": "^1.3.0",
"angular-sanitize": "^1.3.0",
"angular-touch": "^1.3.0",
"angular-ui-grid": "~3.1.1",
"angular-ui-router": "~0.2.15",
"ngstorage": "~0.3.9",
"angular-ui-layout": "~1.3.0",
"angular-bootstrap": "~0.14.3",
"moment": "~2.10.6",
"lodash": "~3.10.1",
"angular-wizard": "~0.5.5",
"ui-select": "angular-ui-select#~0.16.0",
"select2": "~3.4.5",
"angular-flash-alert": "~2.2.5",
"angular-gantt": "^1.2.13",
"angular-strap": "^2.3.7",
"angular-schema-form": "~0.8.13",
"angular-ui-tree": "~2.15.0",
"components-font-awesome": "~4.6.1",
"woodman": "~1.1.0",
"angular-ui-bootstrap": "~1.0.3",
"angular-picklist": "*",
"jquery-ui": "~1.11.4",
"angular-schema-form-bootstrap": "~0.2.0",
"angular-schema-form-datepicker": "~0.4.0",
"jquery": "~3.0.0"
},
"devDependencies": {
"angular-mocks": "^1.3.0",
"ui-select": "angular-ui-select#~0.16.0"
},
"appPath": "app",
"moduleName": "playgroundApp",
"overrides": {
"bootstrap": {
"main": [
"less/bootstrap.less",
"dist/css/bootstrap.css",
"dist/js/bootstrap.js"
]
}
},
"resolutions": {
"lodash": "~3.10.1",
"angular-mocks": "^1.3.0"
}
}
Update: Ignored this problem for 4 months. Facing it today I installed the latest versions of angular-schema-form and angular-schema-form-bootstrap and the problems were gone.
For anyone that still has problems with those icons, is possible to disable them adding to each field in the form definition: 'feedback': false as stated in the docs here.
Maybe not the best solution, but will help if you can live without the icons.
Related
I am struggling with this jest error and have no idea how to fix it. Basically I ran the following commands to switch to new babel 7:
npx babel-upgrade --write --install
npm install --save-dev #babel/preset-react
npm install babel-polyfill
Here is my package.json where all of the configs are specified (no .babelrc, no jest.config.js):
{
"name": "seqr",
"version": "0.2.0",
"homepage": "",
"devDependencies": {
"#babel/cli": "^7.0.0",
"#babel/core": "^7.0.0",
"#babel/plugin-proposal-class-properties": "^7.0.0",
"#babel/plugin-proposal-decorators": "^7.0.0",
"#babel/plugin-transform-modules-commonjs": "^7.0.0",
"#babel/polyfill": "^7.8.3",
"#babel/preset-env": "^7.0.0",
"#babel/preset-react": "^7.8.3",
"#babel/runtime-corejs2": "^7.0.0",
"autoprefixer": "7.1.6",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^9.0.0",
"babel-jest": "^23.4.2",
"babel-loader": "^8.0.0",
"babel-plugin-module-resolver": "^3.1.1",
"babel-plugin-styled-components": "^1.5.1",
"babel-preset-react-app": "^3.1.2",
"case-sensitive-paths-webpack-plugin": "^2.1.2",
"chalk": "2.3.0",
"css-loader": "0.28.7",
"dotenv": "4.0.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"enzyme-to-json": "3.2.2",
"eslint": "^4.19.1",
"eslint-config-airbnb": "^16.1.0",
"eslint-import-resolver-babel-module": "^4.0.0",
"eslint-loader": "1.9.0",
"eslint-plugin-flowtype": "2.39.1",
"eslint-plugin-import": "^2.13.0",
"eslint-plugin-jsx-a11y": "^6.1.0",
"eslint-plugin-react": "^7.10.0",
"eslint-plugin-react-perf": "^2.0.8",
"extract-text-webpack-plugin": "^3.0.2",
"file-loader": "1.1.5",
"fs-extra": "^4.0.3",
"html-webpack-plugin": "2.30.1",
"jest": "^23.6.0",
"natives": "^1.1.6",
"object-assign": "4.1.1",
"postcss-flexbugs-fixes": "3.2.0",
"postcss-loader": "2.0.9",
"promise": "8.0.1",
"purify-css": "^1.2.6",
"purifycss-webpack": "^0.7.0",
"react-error-overlay": "^3.0.0",
"react-test-renderer": "16.2.0",
"redux-mock-store": "^1.5.3",
"style-loader": "0.19.0",
"stylelint": "^8.4.0",
"stylelint-config-standard": "^17.0.0",
"stylelint-config-styled-components": "^0.1.1",
"stylelint-processor-styled-components": "^1.3.1",
"sw-precache-webpack-plugin": "0.11.4",
"url-loader": "0.6.2",
"webpack": "^3.8.1",
"webpack-cleanup-plugin": "0.5.1",
"webpack-dev-server": "^2.9.4",
"webpack-manifest-plugin": "1.3.2",
"whatwg-fetch": "2.0.3"
},
"optionalDependencies": {
"fsevents": "^1.1.3"
},
"dependencies": {
"ajv": "^5.5.2",
"babel-polyfill": "^6.26.0",
"detect-port": "^1.2.3",
"draft-js": "^0.10.4",
"draftjs-md-converter": "^0.1.6",
"filesize": "3.5.11",
"glob": "^7.1.2",
"gtex-d3": "github:broadinstitute/gtex-viz#8d65862",
"gzip-size": "4.1.0",
"igv": "^2.2.2",
"jquery": "3.2.1",
"lodash": "^4.17.11",
"object-hash": "^1.3.0",
"prop-types": "15.6.0",
"query-string": "^6.1.0",
"random-material-color": "1.0.3",
"react": "^16.2.0",
"react-addons-shallow-compare": "15.6.2",
"react-dev-utils": "^4.2.2",
"react-document-title": "2.0.3",
"react-dom": "^16.2.0",
"react-hot-loader": "^3.0.0-beta.7",
"react-markdown-renderer": "^1.4.0",
"react-rangeslider": "^2.2.0",
"react-redux": "5.0.6",
"react-render-visualizer-decorator": "0.4.1",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"react-transition-group": "^2.2.1",
"react-virtualized": "^9.9.0",
"react-xhr-uploader": "^0.4.4",
"recursive-readdir": "2.2.1",
"redux": "^3.7.2",
"redux-form": "^7.3.0",
"redux-thunk": "2.2.0",
"request": "^2.88.0",
"reselect": "3.0.1",
"semantic-ui": "2.2.12",
"semantic-ui-react": "^0.80.0",
"slugify": "1.2.6",
"styled-components": "^2.2.3",
"timeago.js": "3.0.2",
"timeout-as-promise": "1.0.0",
"typescript": "^2.9.2",
"why-did-you-update": "^0.1.1"
},
"scripts": {
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"test": "node scripts/test.js --env=jsdom"
},
"jest": {
"collectCoverageFrom": [
"src/**/*.{js,jsx,mjs}"
],
"setupFiles": [
"<rootDir>/config/polyfills.js"
],
"snapshotSerializers": [
"enzyme-to-json/serializer"
],
"testMatch": [
"<rootDir>/**/?*.(test).js?(x)"
],
"testEnvironment": "node",
"testURL": "http://localhost",
"transform": {
"^.+\\.(js|jsx|mjs)$": "<rootDir>/node_modules/babel-jest",
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
"^(?!.*\\.(js|jsx|mjs|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
},
"transformIgnorePatterns": [
"<rootDir>[/\\\\]node_modules[/\\\\](?!(igv|gtex-d3)/).+\\.(js|jsx|ts|tsx)$"
],
"moduleNameMapper": {
"^react-native$": "react-native-web"
},
"moduleFileExtensions": [
"web.js",
"mjs",
"js",
"json",
"web.jsx",
"jsx",
"node"
]
},
"babel": {
"env": {
"test": {
"plugins": [
"#babel/plugin-transform-modules-commonjs"
]
}
},
"plugins": [
"#babel/plugin-syntax-dynamic-import",
[
"#babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"#babel/plugin-proposal-object-rest-spread",
"#babel/plugin-proposal-class-properties",
[
"babel-plugin-styled-components",
{
"displayName": true
}
],
[
"babel-plugin-module-resolver",
{
"root": [
"./"
],
"extensions": [
".js",
".jsx",
".css"
],
"alias": {
"shared": "./shared/",
"pages": "./pages/",
"gtex-d3": "./node_modules/gtex-d3/"
}
}
]
],
"presets": [
"#babel/preset-react",
[
"#babel/preset-env",
{
"modules": false
}
]
]
},
"repository": {
"type": "git",
"url": "git+https://github.com/macarthur-lab/seqr.git"
},
"license": "AGPL-3.0"
}
I updated to webpack 4 since before I had version 3 as suggested in the thread:
Babel 7 Unexpected token for React component
But it did not help.
Testing is launched by using the specified in package.json script scripts/test.js that looks like that:
'use strict';
// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'test';
process.env.NODE_ENV = 'test';
process.env.PUBLIC_URL = '';
// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
process.on('unhandledRejection', err => {
throw err;
});
// Ensure environment variables are read.
require('../config/env');
const jest = require('jest');
const argv = process.argv.slice(2);
// Watch unless on CI or in coverage mode
if (!process.env.CI && argv.indexOf('--coverage') < 0) {
argv.push('--watch');
}
jest.run(argv);
And ../config/env.js file is the following:
'use strict';
const fs = require('fs');
const path = require('path');
const paths = require('./paths');
// Make sure that including paths.js after env.js will read .env variables.
delete require.cache[require.resolve('./paths')];
const NODE_ENV = process.env.NODE_ENV;
if (!NODE_ENV) {
throw new Error(
'The NODE_ENV environment variable is required but was not specified.'
);
}
// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
var dotenvFiles = [
`${paths.dotenv}.${NODE_ENV}.local`,
`${paths.dotenv}.${NODE_ENV}`,
// Don't include `.env.local` for `test` environment
// since normally you expect tests to produce the same
// results for everyone
NODE_ENV !== 'test' && `${paths.dotenv}.local`,
paths.dotenv,
].filter(Boolean);
// Load environment variables from .env* files. Suppress warnings using silent
// if this file is missing. dotenv will never modify any environment variables
// that have already been set.
// https://github.com/motdotla/dotenv
dotenvFiles.forEach(dotenvFile => {
if (fs.existsSync(dotenvFile)) {
require('dotenv').config({
path: dotenvFile,
});
}
});
// We support resolving modules according to `NODE_PATH`.
// This lets you use absolute paths in imports inside large monorepos:
// https://github.com/facebookincubator/create-react-app/issues/253.
// It works similar to `NODE_PATH` in Node itself:
// https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
// Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
// Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims.
// https://github.com/facebookincubator/create-react-app/issues/1023#issuecomment-265344421
// We also resolve them to make sure all tools using them work consistently.
const appDirectory = fs.realpathSync(process.cwd());
process.env.NODE_PATH = (process.env.NODE_PATH || '')
.split(path.delimiter)
.filter(folder => folder && !path.isAbsolute(folder))
.map(folder => path.resolve(appDirectory, folder))
.join(path.delimiter);
console.log('NODE_PATH: ', process.env.NODE_PATH)
// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
// injected into the application via DefinePlugin in Webpack configuration.
const REACT_APP = /^REACT_APP_/i;
function getClientEnvironment(publicUrl) {
const raw = Object.keys(process.env)
.filter(key => REACT_APP.test(key))
.reduce(
(env, key) => {
env[key] = process.env[key];
return env;
},
{
// Useful for determining whether we’re running in production mode.
// Most importantly, it switches React into the correct mode.
NODE_ENV: process.env.NODE_ENV || 'development',
// Useful for resolving the correct path to static assets in `public`.
// For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
// This should only be used as an escape hatch. Normally you would put
// images into the `src` and `import` them in code to get their paths.
PUBLIC_URL: publicUrl,
}
);
// Stringify all values so we can feed into Webpack DefinePlugin
const stringified = {
'process.env': Object.keys(raw).reduce((env, key) => {
env[key] = JSON.stringify(raw[key]);
return env;
}, {}),
};
return { raw, stringified };
}
module.exports = getClientEnvironment;
Currently running npm run test causes the following error:
Jest encountered an unexpected token
import { json } from 'd3-fetch';
^
>SyntaxError: Unexpected token {
I tried a lot of things. Here is another relevant thread that unfortunately did not help me:
babel#7 and jest configuration
The error is happening in node_modules same as here:
https://github.com/facebook/jest/issues/6229
Any suggestions would be greatly appreciated.
Update
Tried changing test object in package.json config to the following one:
"env": {
"test": {
"presets": [
"#babel/preset-env",
"#babel/preset-react"
],
"plugins": [
"#babel/plugin-proposal-class-properties",
"#babel/plugin-transform-modules-commonjs",
"babel-plugin-dynamic-import-node"
]
}
},
But no luck
Update
Tried to create a separate babel.config.js and move settings from package.json to it, but still not successful:
module.exports = {
"env": {
"test": {
"presets": [
"#babel/preset-env",
"#babel/preset-react"
],
"plugins": [
"#babel/plugin-proposal-class-properties",
"#babel/plugin-transform-modules-commonjs",
"#babel/plugin-syntax-dynamic-import"
]
}
},
"plugins": [
"#babel/plugin-transform-runtime",
"#babel/plugin-transform-regenerator",
"#babel/plugin-syntax-dynamic-import",
[
"#babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"#babel/plugin-proposal-object-rest-spread",
"#babel/plugin-proposal-class-properties",
[
"babel-plugin-styled-components",
{
"displayName": true
}
],
[
"babel-plugin-module-resolver",
{
"root": [
"./"
],
"extensions": [
".js",
".jsx",
".css"
],
"alias": {
"shared": "./shared/",
"pages": "./pages/",
"gtex-d3": "./node_modules/gtex-d3/"
}
}
]
],
"presets": [
"#babel/preset-react",
[
"#babel/preset-env",
{
"modules": false
}
]
]
}
Update
Finally adding babel-plugin-dynamic-import-node fixed the issue with testing, however, I got a new error:
[eslint-import-resolver-babel-module] TypeError: Cannot read property 'find' of undefined
Update
Updating eslint-import-resolver-babel-module to the latest version fixed the issue, but another came out:
./node_modules/draftjs-md-converter/dist/index.js
Syntax error: /Users/vlasenkona/Desktop/gris-seqr2/ui/node_modules/draftjs-md-converter/dist/index.js: Identifier '_toConsumableArray' has already been declared (195:9)
193 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
194 |
> 195 | function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
| ^
196 |
197 | var parse = require('markdown-to-ast').parse;
198 |
at parser.next (<anonymous>)
I've poured my time almost 4-5 hours to figure it out, but I couldn't have done with it... but fortunately, succeeded my Gatsby APP acknowledges the Google Analytics.
However, The problem occurs "No HTTP response Detected" from Google Tag Assistant Chrome Extension.
I've pasted the Google Analytics Snippets many times into HTML.js, Index.html and updated the latest version of GatsbyJs as well.
Additionally, I've tried to turn off my Adblock extension as well! but all failed...
URL
The error occurred blog
gatsby-config.js
module.exports = {
// Note: it must *not* have a trailing slash.
siteMetadata: {
title: 'SJ personal Blog',
siteUrl: `https://ollagada.github.io`
},
plugins: [
{
resolve: `gatsby-plugin-google-analytics`,
options: {
trackingId: "MY TRACKING ID",
// Puts tracking script in the head instead of the body
head: true,
// Setting this parameter is optional
anonymize: true,
// Setting this parameter is also optional
respectDNT: true,
// Avoids sending pageview hits from custom paths
exclude: ["/preview/**", "/do-not-track/me/too/"],
// Enables Google Optimize using your container Id
optimizeId: "YOUR_GOOGLE_OPTIMIZE_TRACKING_ID",
// Any additional create only fields (optional)
sampleRate: 5,
siteSpeedSampleRate: 10,
},
},
{
resolve: `gatsby-plugin-gtag`,
options: {
// your google analytics tracking id
trackingId: `MY TRACKING ID`,
// Puts tracking script in the head instead of the body
head: true,
// enable ip anonymization
anonymize: true,
},
},
'gatsby-transformer-remark', {
resolve: `gatsby-source-filesystem`,
options: {
name: `posts`,
path: `${__dirname}/src/pages/posts`
}
},
'gatsby-plugin-react-helmet', {
resolve: `gatsby-plugin-manifest`,
options: {
name: 'gatsby-starter-default',
short_name: 'starter',
start_url: '/',
background_color: '#663399',
theme_color: '#663399',
display: 'minimal-ui',
icon: 'src/img/moi.jpg', // This path is relative to the root of the site.
}
},
]
Package.json
{
"name": "gatsby-starter-default",
"description": "Gatsby default starter",
"version": "1.0.0",
"author": "Kyle Mathews ",
"dependencies": {
"aos": "^2.3.4",
"child_process": "^1.0.2",
"fs": "0.0.1-security",
"gatsby": "^2.0.75",
"gatsby-plugin-google-analytics": "^2.0.8",
"gatsby-plugin-gtag": "^1.0.4",
"gatsby-plugin-manifest": "^2.0.2",
"gatsby-plugin-offline": "^2.0.5",
"gatsby-plugin-react-helmet": "^3.0.0",
"gatsby-plugin-sharp": "^2.0.5",
"gatsby-source-filesystem": "^2.0.1",
"gatsby-transformer-remark": "^2.1.17",
"gatsby-transformer-sharp": "^2.1.1",
"instafeed.js": "^1.4.1",
"net": "^1.0.2",
"prop-types": "^15.6.2",
"react": "^16.4.2",
"react-dom": "^16.4.2",
"react-helmet": "^5.2.0",
"react-instafeed": "^0.4.0",
"react-lines-ellipsis": "^0.13.2",
"react-mdl": "^1.11.0",
"react-spinkit": "^3.0.0",
"tls": "0.0.1",
"typed.js": "^2.0.9",
"window": "^4.2.5"
},
"keywords": [
"gatsby"
],
"license": "MIT",
"scripts": {
"build": "gatsby build",
"develop": "gatsby develop",
"format": "prettier --write '**/*.js'",
"test": "echo \"Error: no test specified\" && exit 1",
"deploy": "gatsby build --prefix-paths && gh-pages -b master -d public"
},
"devDependencies": {
"gh-pages": "^2.0.0",
"prettier": "^1.14.2"
},
"repository": {
"type": "git",
"url": "https://github.com/gatsbyjs/gatsby-starter-default"
}
}
Thank you! Lovely Day!
Here is the example from the github official documentation of normalizr library. I am using latest version 3.2.4.
schema.js
import { normalize, schema } from 'normalizr';
// Define a users schema
const user = new schema.Entity('users');
// Define your comments schema
const comment = new schema.Entity('comments', {
commenter: user
});
// Define your article
const article = new schema.Entity('articles', {
author: user,
comments: [ comment ]
});
let originalData = {
"id": "123",
"author": {
"id": "1",
"name": "Paul"
},
"title": "My awesome blog post",
"comments": [
{
"id": "324",
"commenter": {
"id": "2",
"name": "Nicole"
}
}
]
}
const normalizedData = normalize(originalData, article);
console.log('NORMALIZED DATA: ', normalizedData)
and it results as follows,
Problem is that comment and author entities were not created. They are still nested in the article.
Here is my package.json file,
{
"dependencies": {
"#rails/webpacker": "^3.0.1",
"babel-preset-react": "^6.24.1",
"form-serialize": "^0.7.2",
"isomorphic-fetch": "^2.2.1",
"jquery": "^3.2.1",
"normalizr": "3.2.4",
"prop-types": "^15.5.10",
"react": "^15.6.1",
"react-bootstrap": "^0.31.3",
"react-dom": "^15.6.1",
"react-redux": "^5.0.6",
"react-select-plus": "^1.0.0-rc.5",
"react-tooltip": "^3.3.1",
"redux": "3.5.2",
"redux-thunk": "^2.2.0",
"textile-js": "^2.0.4"
},
"devDependencies": {
"redux-logger": "^3.0.6",
"webpack-dev-server": "^2.7.1"
}
}
I spend much time to figure out the issue with no luck. It seems, normalization working fine with the old version of library (Atleast, I checked with 2.3.0).
Can someone help me with this problem? Is there anything wrong with the setup? or Do I need to install any dependencies?
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 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?