Skip to content

Instantly share code, notes, and snippets.

@bradparker
Last active January 12, 2016 06:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradparker/4b6cbd3c934cbf99e249 to your computer and use it in GitHub Desktop.
Save bradparker/4b6cbd3c934cbf99e249 to your computer and use it in GitHub Desktop.
Keep it simple
{
"name": "get-going",
"version": "2.0.1",
"description": "",
"main": "dist/index.html",
"engines": {
"node": "5.2.0"
},
"scripts": {
"setup:source:dir": "mkdir -p source",
"setup:source:html": "echo '<!doctype html>\n<html>\n<head>\n<link rel=\"stylesheet\" href=\"assets/stylesheets/main.css\">\n</head>\n<body>\n <div id=\"app\"></div>\n <script src=\"assets/javascripts/main.js\"></script>\n</body>\n</html>' > source/index.html",
"setup:source:images": "mkdir -p source/assets/images",
"setup:source:js": "echo \"import HelloWorld from './components/HelloWorld'\nimport React from 'react'\nimport { render } from 'react-dom'\n\n render(<HelloWorld />, document.getElementById('app')) \" > source/index.js",
"setup:source:component:dir": "mkdir -p source/components/HelloWorld",
"setup:source:component:js": "echo \"import React from 'react'\nimport styles from './styles.css'\n\nexport default () => <h1 className={ styles.HelloWorld }>Hello, world!</h1>\n\" > source/components/HelloWorld/index.js",
"setup:source:component:test": "echo \"import jsdom from 'mocha-jsdom'\nimport { expect } from 'chai'\nimport React from 'react'\nimport { renderIntoDocument } from 'react-addons-test-utils'\nimport HelloWorld from '.'\n\ndescribe('HelloWorld', () => {\n jsdom()\n it('totes renders', () => {\n expect(renderIntoDocument(<div><HelloWorld /></div>)).to.be.ok \n }) \n})\n\" > source/components/HelloWorld/__test__.js",
"setup:source:component:css": "echo \".HelloWorld {\n font-family: Helvetica Nueue, Helvetica, sans-serif;\n}\n\" > source/components/HelloWorld/styles.css",
"setup:source:component": "npm run setup:source:component:dir && npm run setup:source:component:js && npm run setup:source:component:test && npm run setup:source:component:css",
"setup": "npm install && npm run setup:source:dir && npm run setup:source:html && npm run setup:source:images && npm run setup:source:js && npm run setup:source:component && npm test && npm run dev",
"bundle:setup": "mkdir -p dist/assets/javascripts/ dist/assets/stylesheets/",
"bundle:build": "browserifyinc -t [babelify --presets es2015 --presets react] -p [css-modulesify --after autoprefixer -o dist/assets/stylesheets/main.css ] source/index.js -o dist/assets/javascripts/main.js -v",
"bundle": "npm run bundle:setup && npm run bundle:build",
"watch:bundle": "nodemon -x 'npm run bundle' -w source/components -e css,js",
"images": "mkdir -p dist/assets/images/ && cp -R source/assets/images dist/assets",
"watch:images": "nodemon -x 'npm run images' -w source/assets/images -e png,svg,jpg",
"index": "mkdir -p dist && cp source/index.html dist/index.html",
"watch:index": "nodemon -x 'npm run index' -w source -e html",
"build": "npm run bundle && npm run images && npm run index",
"watch": "npm run watch:bundle & npm run watch:images & npm run watch:index",
"serve": "static dist",
"dev": "npm run watch & npm run serve",
"test": "mocha --compilers js:babel-register,css:css-modules-require-hook --recursive source/**/__test__.js",
"deploy": "git-directory-deploy --directory dist --branch gh-pages"
},
"author": "Brad Parker <hi@bradparker.com>",
"license": "ISC",
"dependencies": {},
"eslintConfig": {
"env": {
"browser": true,
"node": true
},
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"destructuring": true,
"jsx": true,
"modules": true,
"objectLiteralShorthandMethods": true,
"objectLiteralShorthandProperties": true,
"templateStrings": true
}
},
"devDependencies": {
"autoprefixer": "^6.2.3",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-register": "^6.3.13",
"babelify": "^7.2.0",
"browserify": "^12.0.1",
"browserify-incremental": "^3.0.1",
"chai": "^3.4.1",
"css-modules-require-hook": "^2.1.0",
"css-modulesify": "^0.16.1",
"git-directory-deploy": "^1.4.0",
"jsdom": "^7.2.2",
"mocha": "^2.3.4",
"mocha-jsdom": "^1.0.0",
"node-static": "^0.7.7",
"nodemon": "^1.8.1",
"postcss-cli": "^2.3.3",
"postcss-import": "^7.1.3",
"react": "^0.14.6",
"react-addons-test-utils": "^0.14.6",
"react-dom": "^0.14.6"
}
}
@bradparker
Copy link
Author

  • Use a nix-y system. (Mac OS, Linux)
  • Make sure you're running node 5.2+.
  • Dump this file in a new directory and:
npm run setup

... profit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment