Skip to content

Instantly share code, notes, and snippets.

View dtothefp's full-sized avatar

David Fox-Powell dtothefp

  • Flexport
  • United States
View GitHub Profile
import {includePaths} from 'node-bourbon';
module: {
loaders: [
{
test: /\.scss$/,
loader: `style!css!sass?includePaths[]=${includePaths}`
}
]
}
entry: {
'global-shit': './src/my/global/shit.js',
'pages/page-a-shit.js': './src/my/pages/a-shit.js',
'layouts/layout-a-shit.js': './src/my/layouts/a-shit.js'
},
output: {
path: `./${options.outputPath}`, //hipster options passed in
filename: '[name].js'
}
"scripts": {
"dev-server": "webpack-dev-server — config webpack-dev-server.config.js — progress — colors — port 2992 — inline",
"hot-dev-server": "webpack-dev-server — config webpack-hot-dev-server.config.js — hot — progress — colors — port 2992 — inline",
"build": "webpack — config webpack-production.config.js — progress — profile — colors",
"start-dev": "node lib/server-development",
"start": "node lib/server-production"
}
export default {
entry: .....,
output: ....,
plugins:[
new webpack.ResolverPlugin(
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin(
'bower.json', ['main']
)
],
resolve: {
const plugins = [
new webpack.ProvidePlugin({
$: ‘jquery’,
jQuery: ‘jquery’,
‘window.jQuery’: ‘jquery’,
React: ‘react’,
paper: ‘paper’
})
];
import 'script!history.js/scripts/bundled/html4+html5/jquery.history';
import 'script!jquery.cookie';
/**
* These function calls bootstrap all of the global files, essentially requiring them in
* to mimic concat behavior. This is a temporary solution until we begin `require`ing utilities
* into page level JS rather than referencing them as globals.
* RegEx excludes files that have already been required in a specific order or those that should be omitted.
*
*/
const requireTest = require.context('./test', true, /_test\.js$/);
requireTest.keys().forEach(requireTest); //stolen directly from @shama
export default function(ComposedComponent) {
let displayName = ComposedComponent.displayName || ComposedComponent.name;
@nuclearComponent({
formState: FormGetters.formState,
formValidation: FormGetters.formValidation
})
@provideContextDec({
Actions: PropTypes.object.isRequired,
formId: PropTypes.string.isRequired
var checkComplexPassword = function(password) {
var CHAR_LOWERS = /[a-z]/,
CHAR_UPPERS = /[A-Z]/,
CHAR_NUMBERS = /[0-9]/,
CHAR_SPECIAL = /[?=.*!@#$%^&*]/,
CHAR_TYPES = [CHAR_LOWERS,CHAR_UPPERS,CHAR_NUMBERS,CHAR_SPECIAL],
counter = 4;
for (var i=0; i<CHAR_TYPES.length; i++){
if(!CHAR_TYPES[i].test(password)){
let mockNuclearDec = mockNuclearComponent({formState, formValidation});
HigherOrderInput.__Rewire__('nuclearComponent', mockNuclearDec);
let HigherOrderComponent = HigherOrderInput(Input);
let hoc = TestUtils.renderIntoDocument(
<HigherOrderComponent {...mockProps} />
);
let hocElm = React.findDOMNode(hoc);
let inputObj = TestUtils.findRenderedDOMComponentWithClass(hoc, 'one');